← Back to team overview

kicad-developers team mailing list archive

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>&nbsp;&nbsp; &nbsp;fputs("G=
36*\n", dest);<br>&nbsp;&nbsp; &nbsp;pos.x =3D *coord;<br>&nbsp;&nbsp; &nbs=
p;coord++;<br>&nbsp;&nbsp; &nbsp;pos.y =3D *coord;<br>&nbsp;&nbsp; &nbsp;co=
ord++;<br>&nbsp;&nbsp; &nbsp;UserToDeviceCoordinate(pos);<br>&nbsp;&nbsp; &=
nbsp;fprintf( dest, "X%5.5dY%5.5dD02*\n", pos.x, pos.y );<br>&nbsp;&nbsp; &=
nbsp;for( ii =3D 1; ii &lt; nb_segm; ii++ )<br>&nbsp;&nbsp; &nbsp;{<br>&nbs=
p;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos.x =3D *coord;<br>&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; &nbsp;coord++;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos.y =
=3D *coord;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;coord++;<br>&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; &nbsp;UserToDeviceCoordinate(pos);<br>&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; &nbsp;fprintf( dest, "X%5.5dY%5.5dD01*\n", pos.x, pos.y );=
<br>&nbsp;&nbsp; &nbsp;}<br><br>&nbsp;&nbsp; &nbsp;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>&nbsp;&nb=
sp; &nbsp;fputs("G36*\n", dest);<br>&nbsp;&nbsp; &nbsp;pos.x =3D *coord;<br=
>&nbsp;&nbsp; &nbsp;coord++;<br>&nbsp;&nbsp; &nbsp;pos.y =3D *coord;<br>&nb=
sp;&nbsp; &nbsp;coord++;<br>&nbsp;&nbsp; &nbsp;UserToDeviceCoordinate(pos);=
<br>&nbsp;&nbsp; &nbsp;sprintf( firstLast, "X%5.5dY%5.5d", pos.x, pos.y );<=
br>&nbsp;&nbsp; &nbsp;fputs(firstLast, dest);<br>&nbsp;&nbsp; &nbsp;fputs("=
D02*\n", dest);<br>&nbsp;&nbsp; &nbsp;for( ii =3D 1; ii &lt; nb_segm; ii++ =
)<br>&nbsp;&nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos.x =
=3D *coord;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;coord++;<br>&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; &nbsp;pos.y =3D *coord;<br>&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp; &nbsp;coord++;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;UserToDeviceC=
oordinate(pos);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fprintf( dest, "X%=
5.5dY%5.5dD01*\n", pos.x, pos.y );<br>&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp; =
&nbsp;fputs(firstLast, dest);<br>&nbsp;&nbsp; &nbsp;fputs("D01*\n", dest);<=
br><br>&nbsp;&nbsp; &nbsp;fputs("G37*\n", dest);<br>}
 --1-0718555374-1981907327=:8-- 




Follow ups