- small fixes in NCC Tool and in the FlatCAMGeometry class

This commit is contained in:
Marius Stanciu 2019-11-28 00:49:21 +02:00 committed by Marius
parent 14efe0fc34
commit cefbcd1816
3 changed files with 26 additions and 11 deletions

View File

@ -3694,6 +3694,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
"toolchange": self.ui.toolchangeg_cb, "toolchange": self.ui.toolchangeg_cb,
"toolchangez": self.ui.toolchangez_entry, "toolchangez": self.ui.toolchangez_entry,
"endz": self.ui.gendz_entry, "endz": self.ui.gendz_entry,
"cnctooldia": self.ui.addtool_entry
}) })
# Fill form fields only on object create # Fill form fields only on object create
@ -4438,9 +4439,16 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
half_vangle = float(self.ui.tipangle_entry.get_value()) / 2 half_vangle = float(self.ui.tipangle_entry.get_value()) / 2
row = self.ui.geo_tools_table.currentRow() row = self.ui.geo_tools_table.currentRow()
tool_uid = int(self.ui.geo_tools_table.item(row, 5).text()) tool_uid_item = self.ui.geo_tools_table.item(row, 5)
if tool_uid_item is None:
return
tool_uid = int(tool_uid_item.text())
tool_dia_item = self.ui.geo_tools_table.item(row, 1)
if tool_dia_item is None:
return
tooldia = float(tool_dia_item.text())
tooldia = float(self.ui.geo_tools_table.item(row, 1).text())
new_cutz = (tooldia - vdia) / (2 * math.tan(math.radians(half_vangle))) new_cutz = (tooldia - vdia) / (2 * math.tan(math.radians(half_vangle)))
new_cutz = float('%.*f' % (self.decimals, new_cutz)) * -1.0 # this value has to be negative new_cutz = float('%.*f' % (self.decimals, new_cutz)) * -1.0 # this value has to be negative

View File

@ -9,12 +9,16 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
28.11.2019
- small fixes in NCC Tool and in the FlatCAMGeometry class
27.11.2019 27.11.2019
- in Tool Film added the page size and page orientation in case of saving the film as PDF file - in Tool Film added the page size and page orientation in case of saving the film as PDF file
- the application workspace has now a lot more options selectable in the Edit -> Preferences -> General -> GUI Preferences - the application workspace has now a lot more options selectable in the Edit -> Preferences -> General -> GUI Preferences
- updated the drawing of the workspace such that the application overall start time is improved and after first turn on of the workspace, toggling it will have no performance penalty - updated the drawing of the workspace such that the application overall start time is improved and after first turn on of the workspace, toggling it will have no performance penalty
- updated the workspace functions to work in Legacy(@D) graphic mode - updated the workspace functions to work in Legacy(2D) graphic mode
- adjusted the selection color transparency for the Legacy(2D) graphic mode because it was too transparent for the fill - adjusted the selection color transparency for the Legacy(2D) graphic mode because it was too transparent for the fill
26.11.2019 26.11.2019

View File

@ -248,7 +248,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tipangle_entry.setSingleStep(5) self.tipangle_entry.setSingleStep(5)
grid1.addWidget(self.tipanglelabel, 6, 0) grid1.addWidget(self.tipanglelabel, 6, 0)
grid1.addWidget(self.tipangle_entry, 6 , 1) grid1.addWidget(self.tipangle_entry, 6, 1)
# Cut Z entry # Cut Z entry
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
@ -538,6 +538,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.grb_circle_steps = int(self.app.defaults["gerber_circle_steps"]) self.grb_circle_steps = int(self.app.defaults["gerber_circle_steps"])
self.tooldia = None
# ############################################################################# # #############################################################################
# ############################ SGINALS ######################################## # ############################ SGINALS ########################################
# ############################################################################# # #############################################################################
@ -1138,7 +1140,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.ncc_obj = self.app.collection.get_by_name(self.obj_name) self.ncc_obj = self.app.collection.get_by_name(self.obj_name)
except Exception as e: except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), str(self.obj_name))) self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), str(self.obj_name)))
return "Could not retrieve object: %s" % self.obj_name return "Could not retrieve object: %s with error: %s" % (self.obj_name, str(e))
if self.ncc_obj is None: if self.ncc_obj is None:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Object not found"), str(self.obj_name))) self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Object not found"), str(self.obj_name)))
@ -1179,7 +1181,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name) self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
except Exception as e: except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), self.bound_obj_name)) self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), self.bound_obj_name))
return "Could not retrieve object: %s" % self.bound_obj_name return "Could not retrieve object: %s with error: %s" % (self.bound_obj_name, str(e))
self.clear_copper(ncc_obj=self.ncc_obj, self.clear_copper(ncc_obj=self.ncc_obj,
ncctooldia=self.ncc_dia_list, ncctooldia=self.ncc_dia_list,
@ -1609,11 +1611,10 @@ class NonCopperClear(FlatCAMTool, Gerber):
sol_geo = ncc_obj.solid_geometry sol_geo = ncc_obj.solid_geometry
if has_offset is True: if has_offset is True:
app_obj.inform.emit('[WARNING_NOTCL] %s ...' % app_obj.inform.emit('[WARNING_NOTCL] %s ...' % _("Buffering"))
_("Buffering"))
sol_geo = sol_geo.buffer(distance=ncc_offset) sol_geo = sol_geo.buffer(distance=ncc_offset)
app_obj.inform.emit('[success] %s ...' % app_obj.inform.emit('[success] %s ...' % _("Buffering finished"))
_("Buffering finished"))
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box) empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
if empty == 'fail': if empty == 'fail':
return 'fail' return 'fail'
@ -1890,6 +1891,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
tools_storage.pop(k, None) tools_storage.pop(k, None)
geo_obj.options["cnctooldia"] = str(tool) geo_obj.options["cnctooldia"] = str(tool)
geo_obj.multigeo = True geo_obj.multigeo = True
geo_obj.tools.clear() geo_obj.tools.clear()
geo_obj.tools = dict(tools_storage) geo_obj.tools = dict(tools_storage)
@ -2302,11 +2304,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
if run_threaded: if run_threaded:
proc.done() proc.done()
return return
except Exception as e: except Exception:
if run_threaded: if run_threaded:
proc.done() proc.done()
traceback.print_stack() traceback.print_stack()
return return
if run_threaded: if run_threaded:
proc.done() proc.done()
else: else: