Gerber files generation: fix a rounding issue when drawing circles. (explains bug Bug #1339086 ).

Gerbview: allows x.7 format (recently indroduced in Gerber format)
Also minor coding style fixes.
This commit is contained in:
jean-pierre charras
2014-07-09 18:31:39 +02:00
parent 853abdac24
commit 49884da3e6
4 changed files with 39 additions and 26 deletions
+5 -2
View File
@@ -356,14 +356,17 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn
DPOINT devEnd = userToDeviceCoordinates( end );
DPOINT devCenter = userToDeviceCoordinates( aCenter )
- userToDeviceCoordinates( start );
fprintf( outputFile, "G75*\n" ); // Multiquadrant mode
if( aStAngle < aEndAngle )
fprintf( outputFile, "G03" );
else
fprintf( outputFile, "G02" );
fprintf( outputFile, "X%dY%dI%dJ%dD01*\n", int( devEnd.x ), int( devEnd.y ),
int( devCenter.x ), int( devCenter.y ) );
fprintf( outputFile, "X%dY%dI%dJ%dD01*\n",
KiROUND( devEnd.x ), KiROUND( devEnd.y ),
KiROUND( devCenter.x ), KiROUND( devCenter.y ) );
fprintf( outputFile, "G74*\nG01*\n" ); // Back to single quadrant and linear interp.
}