← Back to team overview

kicad-developers team mailing list archive

PATCH: close bug #1371656 - fix IDF export

 

The remaining issue in Bug 1371656 (zero radius circles causing problems)
is a failure of the IDF exporter's output. This patch rejects all zero size
graphical segments and produces the desired IDF output.

The VRML related issues were previously fixed by Jean-Pierre with a
patch to specctra_export.cpp, so this patch will close the bug.

- Cirilo
=== modified file 'pcbnew/exporters/export_idf.cpp'
--- pcbnew/exporters/export_idf.cpp	2014-11-13 11:29:05 +0000
+++ pcbnew/exporters/export_idf.cpp	2014-12-20 21:20:14 +0000
@@ -76,6 +76,10 @@
         {
         case S_SEGMENT:
             {
+                if( ( graphic->GetStart().x == graphic->GetEnd().x )
+                    && ( graphic->GetStart().y == graphic->GetEnd().y ) )
+                    break;
+
                 sp.x    = graphic->GetStart().x * scale + offX;
                 sp.y    = -graphic->GetStart().y * scale + offY;
                 ep.x    = graphic->GetEnd().x * scale + offX;
@@ -89,6 +93,10 @@
 
         case S_ARC:
             {
+                if( ( graphic->GetCenter().x == graphic->GetArcStart().x )
+                    && ( graphic->GetCenter().y == graphic->GetArcStart().y ) )
+                    break;
+
                 sp.x = graphic->GetCenter().x * scale + offX;
                 sp.y = -graphic->GetCenter().y * scale + offY;
                 ep.x = graphic->GetArcStart().x * scale + offX;
@@ -102,6 +110,9 @@
 
         case S_CIRCLE:
             {
+                if( graphic->GetRadius() == 0 )
+                    break;
+
                 sp.x = graphic->GetCenter().x * scale + offX;
                 sp.y = -graphic->GetCenter().y * scale + offY;
                 ep.x = sp.x - graphic->GetRadius() * scale;


Follow ups