From d6834028841824a991cb249eae7f180ffdd6f922 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 6 Dec 2019 21:53:03 +0200 Subject: [PATCH] - few bugs solved regarding the newly created empty objects --- README.md | 1 + flatcamParsers/ParseExcellon.py | 5 +++-- flatcamTools/ToolProperties.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6998a8b..cff430e2 100644 --- a/README.md +++ b/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 diff --git a/flatcamParsers/ParseExcellon.py b/flatcamParsers/ParseExcellon.py index 54b60b85..28d87443 100644 --- a/flatcamParsers/ParseExcellon.py +++ b/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): """ diff --git a/flatcamTools/ToolProperties.py b/flatcamTools/ToolProperties.py index 56177c2d..bc93f156 100644 --- a/flatcamTools/ToolProperties.py +++ b/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]})