← Back to team overview

kicad-developers team mailing list archive

Re: HPGL

 

Hello Dick,

thanks for the hints. The macro works good. The patch is attached.

(I will never use HPGL, and don't give a crap about it. If somebody just wants to fix it,
go ahead.

Many old pen plotters use only HPGL. They can coat directly the PCB. For these users (me too) is a accurate and fast HPGL plot important.

Regards, Andreas
=== modified file common/common_plotHPGL_functions.cpp
--- common/common_plotHPGL_functions.cpp	2012-10-13 18:54:33 +0000
+++ common/common_plotHPGL_functions.cpp	2013-02-03 20:38:30 +0000
@@ -393,14 +393,16 @@
     DPOINT centre_dev = userToDeviceCoordinates( centre );
 
     if( plotMirror )
-        angle = (StAngle - EndAngle) / 10.0;
+        angle = StAngle - EndAngle;
     else
-        angle = (EndAngle - StAngle) / 10.0;
+        angle = EndAngle - StAngle;
+    NORMALIZE_ANGLE_180( angle );
+    angle /= 10;
 
     // Calculate start point,
     wxPoint cmap;
-    cmap.x  = (int) ( centre.x + ( radius * cos( RAD2DEG( StAngle / 10.0 ) ) ) );
-    cmap.y  = (int) ( centre.y - ( radius * sin( RAD2DEG( StAngle / 10.0 ) ) ) );
+    cmap.x  = int( centre.x + ( radius * cos( DEG2RAD( StAngle / 10.0 ) ) ) );
+    cmap.y  = int( centre.y - ( radius * sin( DEG2RAD( StAngle / 10.0 ) ) ) );
     DPOINT  cmap_dev = userToDeviceCoordinates( cmap );
 
     fprintf( outputFile,
@@ -478,7 +480,7 @@
 
     double rsize = userToDeviceSize( radius );
 
-    fprintf( outputFile, "PA %.0f,%.0fd;CI %.0f;\n",
+    fprintf( outputFile, "PA %.0f,%.0f;CI %.0f;\n",
              pos_dev.x, pos_dev.y, rsize );
 
     if( trace_mode == FILLED )        // Plot in filled mode.


Follow ups

References