- fixed issue in NCC Tool when using area option

This commit is contained in:
Marius Stanciu
2019-09-02 00:53:02 +03:00
committed by Marius
parent 1e6eebefed
commit 7827cbfe6c
2 changed files with 49 additions and 43 deletions

View File

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
2.09.2019
- fixed issue in NCC Tool when using area option
1.09.2019 1.09.2019
- fixed open handlers - fixed open handlers

View File

@@ -1178,6 +1178,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
ncc_sel_obj = ncc_obj ncc_sel_obj = ncc_obj
else: else:
ncc_sel_obj = sel_obj ncc_sel_obj = sel_obj
except Exception as e:
log.debug("NonCopperClear.clear_copper() --> %s" % str(e))
return 'fail'
bounding_box = None bounding_box = None
if ncc_select == 'itself': if ncc_select == 'itself':
@@ -1195,14 +1198,15 @@ class NonCopperClear(FlatCAMTool, Gerber):
bounding_box = env_obj.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre) bounding_box = env_obj.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre)
except Exception as e: except Exception as e:
log.debug("NonCopperClear.on_ncc() --> %s" % str(e)) log.debug("NonCopperClear.clear_copper() 'itself' --> %s" % str(e))
self.app.inform.emit(_("[ERROR_NOTCL] No object available.")) self.app.inform.emit(_("[ERROR_NOTCL] No object available."))
return return 'fail'
elif ncc_select == 'area': elif ncc_select == 'area':
geo_n = MultiPolygon(self.sel_rect) geo_n = cascaded_union(self.sel_rect)
try: try:
__ = iter(geo_n) __ = iter(geo_n)
except TypeError: except Exception as e:
log.debug("NonCopperClear.clear_copper() 'area' --> %s" % str(e))
geo_n = [geo_n] geo_n = [geo_n]
geo_buff_list = [] geo_buff_list = []
@@ -1215,7 +1219,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
if isinstance(ncc_sel_obj, FlatCAMGeometry): if isinstance(ncc_sel_obj, FlatCAMGeometry):
try: try:
__ = iter(geo_n) __ = iter(geo_n)
except TypeError: except Exception as e:
log.debug("NonCopperClear.clear_copper() 'box' --> %s" % str(e))
geo_n = [geo_n] geo_n = [geo_n]
geo_buff_list = [] geo_buff_list = []
@@ -1230,9 +1235,6 @@ class NonCopperClear(FlatCAMTool, Gerber):
else: else:
self.app.inform.emit(_("[ERROR_NOTCL] The reference object type is not supported.")) self.app.inform.emit(_("[ERROR_NOTCL] The reference object type is not supported."))
return 'fail' return 'fail'
except Exception as e:
log.debug("NonCopperClear.clear_copper() --> %s" % str(e))
return 'fail'
# ######################################################################################################## # ########################################################################################################
# set the name for the future Geometry object # set the name for the future Geometry object