Parcourir la source

- fixed the Gerber.merge() to work for the case when one of the merged Gerber objects solid_geometry type is Polygon and not a list

Marius Stanciu il y a 6 ans
Parent
commit
0eb3ea0283
2 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. 7 3
      FlatCAMObj.py
  2. 1 0
      README.md

+ 7 - 3
FlatCAMObj.py

@@ -411,9 +411,13 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
                         except:
                             log.warning("Failed to copy option.", option)
 
-                for geos in grb.solid_geometry:
-                    grb_final.solid_geometry.append(geos)
-                    grb_final.follow_geometry.append(geos)
+                try:
+                    for geos in grb.solid_geometry:
+                        grb_final.solid_geometry.append(geos)
+                        grb_final.follow_geometry.append(geos)
+                except TypeError:
+                    grb_final.solid_geometry.append(grb.solid_geometry)
+                    grb_final.follow_geometry.append(grb.solid_geometry)
 
                 for ap in grb.apertures:
                     if ap not in grb_final.apertures:

+ 1 - 0
README.md

@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
 19.03.2019
 
 - added autocomplete for Code editor; TODO: needs to be enabled only when doing Scripts, right now is available for everyone.
+- fixed the Gerber.merge() to work for the case when one of the merged Gerber objects solid_geometry type is Polygon and not a list
 
 18.03.2019