Просмотр исходного кода

- 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

Marius Stanciu 6 лет назад
Родитель
Сommit
9b48db7f54
2 измененных файлов с 18 добавлено и 7 удалено
  1. 2 1
      README.md
  2. 16 6
      flatcamTools/ToolCopperThieving.py

+ 2 - 1
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
 - 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
 - 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 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
 - 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) 
 - 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
 3.12.2019
 
 

+ 16 - 6
flatcamTools/ToolCopperThieving.py

@@ -429,7 +429,11 @@ class ToolCopperThieving(FlatCAMTool):
         self.plated_area_label = QtWidgets.QLabel('%s:' % _("Plated area"))
         self.plated_area_label = QtWidgets.QLabel('%s:' % _("Plated area"))
         self.plated_area_label.setToolTip(
         self.plated_area_label.setToolTip(
             _("The area to be plated by pattern plating.\n"
             _("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"
+              "<<WARNING>> - 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 = FCEntry()
         self.plated_area_entry.setDisabled(True)
         self.plated_area_entry.setDisabled(True)
@@ -1294,6 +1298,17 @@ class ToolCopperThieving(FlatCAMTool):
             if isinstance(app_obj.sm_object.solid_geometry, MultiPolygon):
             if isinstance(app_obj.sm_object.solid_geometry, MultiPolygon):
                 geo_list = list(app_obj.sm_object.solid_geometry.geoms)
                 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 we have copper thieving geometry, add it
             if app_obj.new_solid_geometry:
             if app_obj.new_solid_geometry:
                 if '0' not in app_obj.sm_object.apertures:
                 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))
                 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.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"))
             app_obj.app.proc_container.update_view_text(' %s' % _("Append source file"))