Explorar el Código

- make sure to copy the options attribute to the final object in the case of: FlatCAMGeometry.merge(), FlatCAMGerber.merge() and for the Panelize Tool

Marius Stanciu hace 7 años
padre
commit
d88d334867
Se han modificado 3 ficheros con 25 adiciones y 2 borrados
  1. 15 1
      FlatCAMObj.py
  2. 1 1
      README.md
  3. 9 0
      flatcamTools/ToolPanelize.py

+ 15 - 1
FlatCAMObj.py

@@ -370,6 +370,12 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
             grb_final.solid_geometry = [grb_final.solid_geometry]
             grb_final.solid_geometry = [grb_final.solid_geometry]
 
 
         for grb in grb_list:
         for grb in grb_list:
+            for option in grb.options:
+                if option is not 'name':
+                    try:
+                        grb_final.options[option] = grb.options[option]
+                    except:
+                        log.warning("Failed to copy option.", option)
 
 
             # Expand lists
             # Expand lists
             if type(grb) is list:
             if type(grb) is list:
@@ -1716,11 +1722,19 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         if type(geo_final.solid_geometry) is not list:
         if type(geo_final.solid_geometry) is not list:
             geo_final.solid_geometry = [geo_final.solid_geometry]
             geo_final.solid_geometry = [geo_final.solid_geometry]
 
 
+
+
         for geo in geo_list:
         for geo in geo_list:
+            for option in geo.options:
+                if option is not 'name':
+                    try:
+                        geo_final.options[option] = geo.options[option]
+                    except:
+                        log.warning("Failed to copy option.", option)
+
             # Expand lists
             # Expand lists
             if type(geo) is list:
             if type(geo) is list:
                 FlatCAMGeometry.merge(geo, geo_final)
                 FlatCAMGeometry.merge(geo, geo_final)
-
             # If not list, just append
             # If not list, just append
             else:
             else:
                 # merge solid_geometry, useful for singletool geometry, for multitool each is empty
                 # merge solid_geometry, useful for singletool geometry, for multitool each is empty

+ 1 - 1
README.md

@@ -13,7 +13,7 @@ CAD program, and create G-Code for Isolation routing.
 
 
 - deleted junk folders
 - deleted junk folders
 - remade the Panelize Tool: now it is much faster, it is multi-threaded, it works with multitool geometries and it works with multigeo geometries too.
 - remade the Panelize Tool: now it is much faster, it is multi-threaded, it works with multitool geometries and it works with multigeo geometries too.
-
+- make sure to copy the options attribute to the final object in the case of: FlatCAMGeometry.merge(), FlatCAMGerber.merge() and for the Panelize Tool
 
 
 24.01.2019
 24.01.2019
 
 

+ 9 - 0
flatcamTools/ToolPanelize.py

@@ -359,6 +359,13 @@ class Panelize(FlatCAMTool):
                     obj_fin.slots = []
                     obj_fin.slots = []
                     obj_fin.solid_geometry = []
                     obj_fin.solid_geometry = []
 
 
+                    for option in panel_obj.options:
+                        if option is not 'name':
+                            try:
+                                obj_fin.options[option] = panel_obj.options[option]
+                            except:
+                                log.warning("Failed to copy option.", option)
+
                     for row in range(rows):
                     for row in range(rows):
                         currentx = 0.0
                         currentx = 0.0
                         for col in range(columns):
                         for col in range(columns):
@@ -386,6 +393,8 @@ class Panelize(FlatCAMTool):
                         currenty += lenghty
                         currenty += lenghty
 
 
                     obj_fin.create_geometry()
                     obj_fin.create_geometry()
+                    obj_fin.zeros = panel_obj.zeros
+                    obj_fin.units = panel_obj.units
 
 
                 def job_init_geometry(obj_fin, app_obj):
                 def job_init_geometry(obj_fin, app_obj):
                     currentx = 0.0
                     currentx = 0.0