From 9b48db7f5493c1145eaa17da153d821a1476b4ad Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 4 Dec 2019 17:54:05 +0200 Subject: [PATCH] - Copper Thieving Tool - updated the way plated area is calculated making it a bit more precise but still it is a bit bigger than the actual area --- README.md | 3 ++- flatcamTools/ToolCopperThieving.py | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c936a801..88b91b0b 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,10 @@ CAD program, and create G-Code for Isolation routing. - fixed bug in FCSpinner and FCDoubleSpinner GUI elements, that are now the main GUI element in FlatCAM, that made partial selection difficult - updated the Paint Tool in Geometry Editor to use the FCDoublepinbox - added the possibility for suffix presence on the FCSpinner and FCDoubleSpinner GUI Elements -- added the '%' symbol for overlap fields; I still need to divide the conntet by 100 to get the original decimal +- added the '%' symbol for overlap fields; I still need to divide the content by 100 to get the original (0 ... 1) value - fixed the overlap parameter all over the app to reflect the change to percentage - in Copper Thieving Tool added the display of the patterned plated area (approximative area) +- Copper Thieving Tool - updated the way plated area is calculated making it a bit more precise but still it is a bit bigger than the actual area 3.12.2019 diff --git a/flatcamTools/ToolCopperThieving.py b/flatcamTools/ToolCopperThieving.py index 0c111daf..b8e402c3 100644 --- a/flatcamTools/ToolCopperThieving.py +++ b/flatcamTools/ToolCopperThieving.py @@ -429,7 +429,11 @@ class ToolCopperThieving(FlatCAMTool): self.plated_area_label = QtWidgets.QLabel('%s:' % _("Plated area")) self.plated_area_label.setToolTip( _("The area to be plated by pattern plating.\n" - "Basically is made from the openings in the plating mask.") + "Basically is made from the openings in the plating mask.\n\n" + "<> - the calculated area is actually a bit larger\n" + "due of the fact that the soldermask openings are by design\n" + "a bit larger than the copper pads, and this area is\n" + "calculated from the soldermask openings.") ) self.plated_area_entry = FCEntry() self.plated_area_entry.setDisabled(True) @@ -1294,6 +1298,17 @@ class ToolCopperThieving(FlatCAMTool): if isinstance(app_obj.sm_object.solid_geometry, MultiPolygon): geo_list = list(app_obj.sm_object.solid_geometry.geoms) + plated_area = 0.0 + for geo in geo_list: + plated_area += geo.area + + if app_obj.new_solid_geometry: + for geo in app_obj.new_solid_geometry: + plated_area += geo.area + if app_obj.robber_geo: + plated_area += app_obj.robber_geo.area + self.plated_area_entry.set_value(plated_area) + # if we have copper thieving geometry, add it if app_obj.new_solid_geometry: if '0' not in app_obj.sm_object.apertures: @@ -1357,11 +1372,6 @@ class ToolCopperThieving(FlatCAMTool): geo_list.append(app_obj.robber_geo.buffer(ppm_clearance)) - plated_area = 0.0 - for geo in geo_list: - plated_area += geo.area - self.plated_area_entry.set_value(plated_area) - app_obj.sm_object.solid_geometry = MultiPolygon(geo_list).buffer(0.0000001).buffer(-0.0000001) app_obj.app.proc_container.update_view_text(' %s' % _("Append source file"))