← Back to team overview

kicad-developers team mailing list archive

Re: HPGL

 

Hello,

the attached hpgl6.patch removes double lines to polygon isles in filled areas. See the attached image for differences. The hpgl5.patch ist also installed, as seen at the segments.

Without the patch, the plotter pen crosses the filling lines and destroy the ink coat.

Regards, Andreas

=== modified file common/common_plotHPGL_functions.cpp
--- common/common_plotHPGL_functions.cpp	2013-02-04 00:53:48 +0000
+++ common/common_plotHPGL_functions.cpp	2013-02-16 13:14:09 +0000
@@ -266,9 +266,31 @@
 
     MoveTo( aCornerList[0] );
 
-    for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
-        LineTo( aCornerList[ii] );
-
+    unsigned ii, jj, ia, ie, ja, je, dbl;
+    
+    for( ii = 1; ii < aCornerList.size(); ii++ )
+    {
+        // fade out double lines to polygon isles 
+        dbl = 0;
+        ia = ii - 1; // start
+        ie = ii; // end
+        for( jj = 1; jj < aCornerList.size(); jj++ ) // search in the list for double lines
+        {
+            if( ii != jj ) // only for other points
+            {
+                ja = jj - 1; // start
+                je = jj; // end
+                if((( aCornerList[ia] == aCornerList[ja] ) && ( aCornerList[ie] == aCornerList[je] )) 
+                    || (( aCornerList[ia] == aCornerList[je] ) && ( aCornerList[ie] == aCornerList[ja] ))) // double lines found
+                    dbl = 1;
+                    continue;
+            }
+        }
+        if( dbl > 0 )
+            MoveTo( aCornerList[ii] );
+        else
+            LineTo( aCornerList[ii] );
+    }
     // Close polygon if filled.
     if( aFill )
     {

Attachment: KicadFilledArea.png
Description: PNG image


Follow ups

References