Kaynağa Gözat

- in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse
- in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated

Marius Stanciu 6 yıl önce
ebeveyn
işleme
01a9763ad6
3 değiştirilmiş dosya ile 18 ekleme ve 2 silme
  1. 4 0
      FlatCAMObj.py
  2. 2 0
      README.md
  3. 12 2
      flatcamTools/ToolFilm.py

+ 4 - 0
FlatCAMObj.py

@@ -727,6 +727,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
             self.ui.cutzlabel.hide()
             self.ui.cutzlabel.hide()
             self.ui.cutz_spinner.hide()
             self.ui.cutz_spinner.hide()
             self.ui.iso_tool_dia_entry.setDisabled(False)
             self.ui.iso_tool_dia_entry.setDisabled(False)
+            # update the value in the self.iso_tool_dia_entry once this is selected
+            self.ui.iso_tool_dia_entry.set_value(self.options['isotooldia'])
         else:
         else:
             self.ui.tipdialabel.show()
             self.ui.tipdialabel.show()
             self.ui.tipdia_spinner.show()
             self.ui.tipdia_spinner.show()
@@ -735,6 +737,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
             self.ui.cutzlabel.show()
             self.ui.cutzlabel.show()
             self.ui.cutz_spinner.show()
             self.ui.cutz_spinner.show()
             self.ui.iso_tool_dia_entry.setDisabled(True)
             self.ui.iso_tool_dia_entry.setDisabled(True)
+            # update the value in the self.iso_tool_dia_entry once this is selected
+            self.on_calculate_tooldia()
 
 
     def build_ui(self):
     def build_ui(self):
         FlatCAMObj.build_ui(self)
         FlatCAMObj.build_ui(self)

+ 2 - 0
README.md

@@ -21,6 +21,8 @@ CAD program, and create G-Code for Isolation routing.
 - added a new menu category in the MenuBar named 'Objects'. It will hold the objects found in the Project tab. Useful when working in FullScreen
 - added a new menu category in the MenuBar named 'Objects'. It will hold the objects found in the Project tab. Useful when working in FullScreen
 - disabeld a log.debug in ObjectColection.get_by_name()
 - disabeld a log.debug in ObjectColection.get_by_name()
 - added a Toggle Notebook button named 'NB' in the QMenBar which toggle the notebook
 - added a Toggle Notebook button named 'NB' in the QMenBar which toggle the notebook
+- in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse
+- in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated
 
 
 3.10.2019
 3.10.2019
 
 

+ 12 - 2
flatcamTools/ToolFilm.py

@@ -440,7 +440,7 @@ class Film(FlatCAMTool):
                     if punch_size >= float(film_obj.apertures[apid]['width']) or \
                     if punch_size >= float(film_obj.apertures[apid]['width']) or \
                             punch_size >= float(film_obj.apertures[apid]['height']):
                             punch_size >= float(film_obj.apertures[apid]['height']):
                         self.app.inform.emit('[ERROR_NOTCL] %s' %
                         self.app.inform.emit('[ERROR_NOTCL] %s' %
-                                             _(" Could not generate punched hole film because the punch hole size"
+                                             _("Could not generate punched hole film because the punch hole size"
                                                "is bigger than some of the apertures in the Gerber object."))
                                                "is bigger than some of the apertures in the Gerber object."))
                         return 'fail'
                         return 'fail'
                     else:
                     else:
@@ -450,7 +450,17 @@ class Film(FlatCAMTool):
                                     punching_geo.append(elem['follow'].buffer(punch_size / 2))
                                     punching_geo.append(elem['follow'].buffer(punch_size / 2))
 
 
             punching_geo = MultiPolygon(punching_geo)
             punching_geo = MultiPolygon(punching_geo)
-            punched_solid_geometry = MultiPolygon(film_obj.solid_geometry).difference(punching_geo)
+            if not isinstance(film_obj.solid_geometry, Polygon):
+                temp_solid_geometry = MultiPolygon(film_obj.solid_geometry)
+            else:
+                temp_solid_geometry = film_obj.solid_geometry
+            punched_solid_geometry = temp_solid_geometry.difference(punching_geo)
+
+            if punched_solid_geometry == temp_solid_geometry:
+                self.app.inform.emit('[WARNING_NOTCL] %s' %
+                                     _("Could not generate punched hole film because the newly created object geometry "
+                                       "is the same as the one in the source object geometry..."))
+                return 'fail'
 
 
             def init_func(new_obj, app_obj):
             def init_func(new_obj, app_obj):
                 new_obj.solid_geometry = deepcopy(punched_solid_geometry)
                 new_obj.solid_geometry = deepcopy(punched_solid_geometry)