Selaa lähdekoodia

- small changes in NCC tool regarding the usage of the V-shape tool

Marius Stanciu 6 vuotta sitten
vanhempi
commit
4dbf6b2fa9
3 muutettua tiedostoa jossa 18 lisäystä ja 5 poistoa
  1. 1 1
      FlatCAMObj.py
  2. 1 0
      README.md
  3. 16 4
      flatcamTools/ToolNonCopperClear.py

+ 1 - 1
FlatCAMObj.py

@@ -3998,7 +3998,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
 
         tooldia = float(self.ui.geo_tools_table.item(row, 1).text())
         new_cutz = (tooldia - vdia) / (2 * math.tan(math.radians(half_vangle)))
-        new_cutz = float('%.4f' % -new_cutz)
+        new_cutz = float('%.4f' % -new_cutz) # this value has to be negative
         self.ui.cutz_entry.set_value(new_cutz)
 
         # store the new CutZ value into storage (self.tools)

+ 1 - 0
README.md

@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
 
 - in NCC tool there is now a depth of cut parameter named 'Cut Z' which will dictate how deep the tool will enter into the PCB material
 - in NCC tool added possibility to choose between the type of tools to be used and when V-shape is used then the tool diameter is calculated from the desired depth of cut and from the V-tip parameters
+- small changes in NCC tool regarding the usage of the V-shape tool
 
 2.09.2019
 

+ 16 - 4
flatcamTools/ToolNonCopperClear.py

@@ -548,8 +548,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
             "name": '_ncc',
             "plot": self.app.defaults["geometry_plot"],
             "cutz": float(self.cutz_entry.get_value()),
-            "vtipdia": 0.2,
-            "vtipangle": 30,
+            "vtipdia": float(self.tipdia_entry.get_value()),
+            "vtipangle": float(self.tipangle_entry.get_value()),
             "travelz": self.app.defaults["geometry_travelz"],
             "feedrate": self.app.defaults["geometry_feedrate"],
             "feedrate_z": self.app.defaults["geometry_feedrate_z"],
@@ -838,6 +838,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
 
         self.ui_disconnect()
 
+        self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
+
         if dia:
             tool_dia = dia
         else:
@@ -875,9 +877,14 @@ class NonCopperClear(FlatCAMTool, Gerber):
                         self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
                                                "use a number."))
                         return
-
+                # calculated tool diameter so the cut_z parameter is obeyed
                 tool_dia = tip_dia + 2 * cut_z * math.tan(math.radians(tip_angle))
-                tool_dia = float('%.4f' % tool_dia)
+
+                # update the default_data so it is used in the ncc_tools dict
+                self.default_data.update({
+                    "vtipdia": tip_dia,
+                    "vtipangle": (tip_angle * 2),
+                })
             else:
                 try:
                     tool_dia = float(self.addtool_entry.get_value())
@@ -895,6 +902,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
                 self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter to add, in Float format."))
                 return
 
+        if self.units == 'MM':
+            tool_dia = float('%.2f' % tool_dia)
+        else:
+            tool_dia = float('%.4f' % tool_dia)
+
         if tool_dia == 0:
             self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter with non-zero value, "
                                    "in Float format."))