From 4dbf6b2fa965f9428f43be4287e092a69643dca9 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 3 Sep 2019 01:32:10 +0300 Subject: [PATCH] - small changes in NCC tool regarding the usage of the V-shape tool --- FlatCAMObj.py | 2 +- README.md | 1 + flatcamTools/ToolNonCopperClear.py | 20 ++++++++++++++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 01ea8703..53f97c88 100644 --- a/FlatCAMObj.py +++ b/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) diff --git a/README.md b/README.md index 86fa9233..45c0c359 100644 --- a/README.md +++ b/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 diff --git a/flatcamTools/ToolNonCopperClear.py b/flatcamTools/ToolNonCopperClear.py index 9adb6ef7..e69719ff 100644 --- a/flatcamTools/ToolNonCopperClear.py +++ b/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."))