kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #01905
Gerber problem
--1-0718555374-1981907327=:8 Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello
I have a problem with 'user' rotated components.
When a pad is rotated it will be plotted as a polygon to the gerper
file, and the polygon shows as a triangle in batchPCB's DRC-bot. Dont
know if it will make it to the board, but it can be fixed by appending
first coordinate to the polygon.
I cannot get kicad to build because of some linking errors.
Could someone build a fixed pcbnew so I can proceed with my board?
Kind regards
iziot
DOESN'T WORK
G36*
X48341Y-37741D02*
X48659Y-38059D01*
X48483Y-38235D01*
X48165Y-37917D01*
G37*
plotgerb.cpp
/***************************************************************/
void PlotPolygon_GERBER(int nb_segm, int * coord, bool fill)
/***************************************************************/
{
int ii;
wxPoint pos;
fputs("G36*\n", dest);
pos.x =3D *coord;
coord++;
pos.y =3D *coord;
coord++;
UserToDeviceCoordinate(pos);
fprintf( dest, "X%5.5dY%5.5dD02*\n", pos.x, pos.y );
for( ii =3D 1; ii < nb_segm; ii++ )
{
pos.x =3D *coord;
coord++;
pos.y =3D *coord;
coord++;
UserToDeviceCoordinate(pos);
fprintf( dest, "X%5.5dY%5.5dD01*\n", pos.x, pos.y );
}
fputs("G37*\n", dest);
}
SEEMS TO WORK
G36*
X48341Y-37741D02*
X48659Y-38059D01*
X48483Y-38235D01*
X48165Y-37917D01*
X48341Y-37741D01*
G37*
/***************************************************************/
void PlotPolygon_GERBER(int nb_segm, int * coord, bool fill)
/***************************************************************/
{
int ii;
wxPoint pos;
char firstLast[50];
fputs("G36*\n", dest);
pos.x =3D *coord;
coord++;
pos.y =3D *coord;
coord++;
UserToDeviceCoordinate(pos);
sprintf( firstLast, "X%5.5dY%5.5d", pos.x, pos.y );
fputs(firstLast, dest);
fputs("D02*\n", dest);
for( ii =3D 1; ii < nb_segm; ii++ )
{
pos.x =3D *coord;
coord++;
pos.y =3D *coord;
coord++;
UserToDeviceCoordinate(pos);
fprintf( dest, "X%5.5dY%5.5dD01*\n", pos.x, pos.y );
}
fputs(firstLast, dest);
fputs("D01*\n", dest);
fputs("G37*\n", dest);
}
--1-0718555374-1981907327=:8 Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<br>Hello<br><br>I have a problem with 'user' rotated components.<br>When a=
pad is rotated it will be plotted as a polygon to the gerper file, and the=
polygon shows as a triangle in batchPCB's DRC-bot. Dont know if it will ma=
ke it to the board, but it can be fixed by appending first coordinate to th=
e polygon.<br><br>I cannot get kicad to build because of some linking error=
s.<br>Could someone build a fixed pcbnew so I can proceed with my board?<br=
><br>Kind regards<br>iziot<br><br><br><b>DOESN'T WORK</b><br><br>G36*<br>X4=
8341Y-37741D02*<br>X48659Y-38059D01*<br>X48483Y-38235D01*<br>X48165Y-37917D=
01*<br>G37*<br><br>plotgerb.cpp<br>/***************************************=
************************/<br>void PlotPolygon_GERBER(int nb_segm, int * coo=
rd, bool fill)<br>/********************************************************=
*******/<br>{<br>int ii;<br>wxPoint pos;<br><br> fputs("G=
36*\n", dest);<br> pos.x =3D *coord;<br> &nbs=
p;coord++;<br> pos.y =3D *coord;<br> co=
ord++;<br> UserToDeviceCoordinate(pos);<br> &=
nbsp;fprintf( dest, "X%5.5dY%5.5dD02*\n", pos.x, pos.y );<br> &=
nbsp;for( ii =3D 1; ii < nb_segm; ii++ )<br> {<br>&nbs=
p; pos.x =3D *coord;<br> &=
nbsp; coord++;<br> pos.y =
=3D *coord;<br> coord++;<br> &nbs=
p; UserToDeviceCoordinate(pos);<br> &n=
bsp; fprintf( dest, "X%5.5dY%5.5dD01*\n", pos.x, pos.y );=
<br> }<br><br> fputs("G37*\n", dest);<b=
r>}<br><br><br><br><b>SEEMS TO WORK</b><br><br><br>G36*<br>X48341Y-37741D02=
*<br>X48659Y-38059D01*<br>X48483Y-38235D01*<br>X48165Y-37917D01*<br>X48341Y=
-37741D01*<br>G37*<br><br><br>/********************************************=
*******************/<br>void PlotPolygon_GERBER(int nb_segm, int * coord, b=
ool fill)<br>/*************************************************************=
**/<br>{<br>int ii;<br>wxPoint pos;<br>char firstLast[50];<br><br> &nb=
sp; fputs("G36*\n", dest);<br> pos.x =3D *coord;<br=
> coord++;<br> pos.y =3D *coord;<br>&nb=
sp; coord++;<br> UserToDeviceCoordinate(pos);=
<br> sprintf( firstLast, "X%5.5dY%5.5d", pos.x, pos.y );<=
br> fputs(firstLast, dest);<br> fputs("=
D02*\n", dest);<br> for( ii =3D 1; ii < nb_segm; ii++ =
)<br> {<br> pos.x =
=3D *coord;<br> coord++;<br> &nbs=
p; pos.y =3D *coord;<br> &=
nbsp; coord++;<br> UserToDeviceC=
oordinate(pos);<br> fprintf( dest, "X%=
5.5dY%5.5dD01*\n", pos.x, pos.y );<br> }<br> =
fputs(firstLast, dest);<br> fputs("D01*\n", dest);<=
br><br> fputs("G37*\n", dest);<br>}
--1-0718555374-1981907327=:8--
Follow ups