Quellcode durchsuchen

- few bugs solved regarding the newly created empty objects

Marius Stanciu vor 6 Jahren
Ursprung
Commit
d683402884
3 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen
  1. 1 0
      README.md
  2. 3 2
      flatcamParsers/ParseExcellon.py
  3. 4 1
      flatcamTools/ToolProperties.py

+ 1 - 0
README.md

@@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing.
 - cleaned up the Excellon parser and fixed some bugs (old and new); Excellon parser has it's own convert_units() method no longer inheriting from Geometry
 - in Excellon UI fixed bug that did not allow editing of the Offset Z parameter from the Tool table
 - in Properties Tool added new information's for the tools in the CNCjob objects
+- few bugs solved regarding the newly created empty objects
 
 5.12.2019 
 

+ 3 - 2
flatcamParsers/ParseExcellon.py

@@ -997,7 +997,8 @@ class Excellon(Geometry):
         # now it can get bounds for nested lists of objects
 
         log.debug("flatcamParsers.ParseExcellon.Excellon.bounds()")
-        if self.solid_geometry is None:
+
+        if self.solid_geometry is None or not self.tools:
             log.debug("flatcamParsers.ParseExcellon.Excellon -> solid_geometry is None")
             return 0, 0, 0, 0
 
@@ -1039,7 +1040,7 @@ class Excellon(Geometry):
             maxx_list.append(maxx)
             maxy_list.append(maxy)
 
-        return (min(minx_list), min(miny_list), max(maxx_list), max(maxy_list))
+        return min(minx_list), min(miny_list), max(maxx_list), max(maxy_list)
 
     def convert_units(self, units):
         """

+ 4 - 1
flatcamTools/ToolProperties.py

@@ -307,9 +307,12 @@ class Properties(FlatCAMTool):
                         area_chull = None
                         log.debug("Properties.addItems() --> %s" % str(e))
 
-            if self.app.defaults['units'].lower() == 'mm':
+            if self.app.defaults['units'].lower() == 'mm' and area_chull:
                 area_chull = area_chull / 100
 
+            if area_chull is None:
+                area_chull = 0
+
             self.calculations_finished.emit(area, length, width, area_chull, copper_area, dims)
 
         self.app.worker_task.emit({'fcn': job_thread, 'params': [obj]})