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

- done regression to solve the bug with multiple passes cutting from the copper features (I should remember not to make mods here)
- if 'combine' is checked in Gerber isolation but there is only one pass, the resulting geometry will still be single geo
- the 'passes' entry was changed to a IntSpinner so it will allow passes to be entered only in range (1, 999) - it will not allow entry of 0 which may create some issues

Marius Stanciu 6 лет назад
Родитель
Сommit
fd104eee55
5 измененных файлов с 26 добавлено и 17 удалено
  1. 6 1
      FlatCAMObj.py
  2. 6 0
      README.md
  3. 10 14
      camlib.py
  4. 2 1
      flatcamGUI/FlatCAMGUI.py
  5. 2 1
      flatcamGUI/ObjectUI.py

+ 6 - 1
FlatCAMObj.py

@@ -983,7 +983,12 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
 
 
                 if empty_cnt == len(geo_obj.solid_geometry):
                 if empty_cnt == len(geo_obj.solid_geometry):
                     raise ValidationError("Empty Geometry", None)
                     raise ValidationError("Empty Geometry", None)
-                geo_obj.multigeo = True
+
+                # even if combine is checked, one pass is still singlegeo
+                if passes > 1:
+                    geo_obj.multigeo = True
+                else:
+                    geo_obj.multigeo = False
 
 
             # TODO: Do something if this is None. Offer changing name?
             # TODO: Do something if this is None. Offer changing name?
             self.app.new_object("geometry", iso_name, iso_init)
             self.app.new_object("geometry", iso_name, iso_init)

+ 6 - 0
README.md

@@ -9,6 +9,12 @@ CAD program, and create G-Code for Isolation routing.
 
 
 =================================================
 =================================================
 
 
+12.08.2019
+
+- done regression to solve the bug with multiple passes cutting from the copper features (I should remember not to make mods here)
+- if 'combine' is checked in Gerber isolation but there is only one pass, the resulting geometry will still be single geo
+- the 'passes' entry was changed to a IntSpinner so it will allow passes to be entered only in range (1, 999) - it will not allow entry of 0 which may create some issues
+
 11.08.2019
 11.08.2019
 
 
 - small changes regarding the Project Title
 - small changes regarding the Project Title

+ 10 - 14
camlib.py

@@ -554,22 +554,18 @@ class Geometry(object):
             if follow:
             if follow:
                 geo_iso = self.follow_geometry
                 geo_iso = self.follow_geometry
             else:
             else:
+                if isinstance(self.solid_geometry, list):
+                    temp_geo = cascaded_union(self.solid_geometry)
+                else:
+                    temp_geo = self.solid_geometry
+
+                # Remember: do not make a buffer for each element in the solid_geometry because it will cut into
+                # other copper features
                 if corner is None:
                 if corner is None:
-                    try:
-                        __ = iter(self.solid_geometry)
-                        for el in self.solid_geometry:
-                            geo_iso.append(el.buffer(offset, int(int(self.geo_steps_per_circle) / 4)))
-                    except TypeError:
-                        geo_iso = [self.solid_geometry.buffer(offset, int(int(self.geo_steps_per_circle) / 4))]
+                    geo_iso = temp_geo.buffer(offset, int(int(self.geo_steps_per_circle) / 4))
                 else:
                 else:
-                    try:
-                        __ = iter(self.solid_geometry)
-                        for el in self.solid_geometry:
-                            geo_iso.append(el.buffer(offset, int(int(self.geo_steps_per_circle) / 4),
-                                                     join_style=corner))
-                    except TypeError:
-                        geo_iso = [self.solid_geometry.buffer(offset, int(int(self.geo_steps_per_circle) / 4),
-                                                              join_style=corner)]
+                    geo_iso = temp_geo.buffer(offset, int(int(self.geo_steps_per_circle) / 4),
+                                              join_style=corner)
 
 
         # end of replaced block
         # end of replaced block
         if follow:
         if follow:

+ 2 - 1
flatcamGUI/FlatCAMGUI.py

@@ -4092,7 +4092,8 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
               "number (integer) of tool widths.")
               "number (integer) of tool widths.")
         )
         )
         grid0.addWidget(passlabel, 1, 0)
         grid0.addWidget(passlabel, 1, 0)
-        self.iso_width_entry = IntEntry()
+        self.iso_width_entry = FCSpinner()
+        self.iso_width_entry.setRange(1, 999)
         grid0.addWidget(self.iso_width_entry, 1, 1)
         grid0.addWidget(self.iso_width_entry, 1, 1)
 
 
         # Pass overlap
         # Pass overlap

+ 2 - 1
flatcamGUI/ObjectUI.py

@@ -276,7 +276,8 @@ class GerberObjectUI(ObjectUI):
         )
         )
         passlabel.setMinimumWidth(90)
         passlabel.setMinimumWidth(90)
         grid1.addWidget(passlabel, 1, 0)
         grid1.addWidget(passlabel, 1, 0)
-        self.iso_width_entry = IntEntry()
+        self.iso_width_entry = FCSpinner()
+        self.iso_width_entry.setRange(1, 999)
         grid1.addWidget(self.iso_width_entry, 1, 1)
         grid1.addWidget(self.iso_width_entry, 1, 1)
 
 
         overlabel = QtWidgets.QLabel(_('Pass overlap:'))
         overlabel = QtWidgets.QLabel(_('Pass overlap:'))