- fixed bug in the Isolation Tool that in certain cases an empty geometry was present in the solid_geometry which mae the CNCJob object generation to fail. It happen for Gerber objects created in the Gerber Editor

This commit is contained in:
Marius Stanciu
2020-06-10 03:27:53 +03:00
committed by Marius
parent 0643971b01
commit a3fd6e9f87
5 changed files with 59 additions and 29 deletions

View File

@@ -20,6 +20,7 @@ from appObjects.FlatCAMObj import *
import itertools
import numpy as np
from collections import defaultdict
import gettext
import appTranslation as fcTranslate
@@ -169,11 +170,11 @@ class ExcellonObject(FlatCAMObj, Excellon):
# this dict will hold the unique tool diameters found in the exc_list objects as the dict keys and the dict
# values will be list of Shapely Points; for drills
custom_dict_drills = {}
custom_dict_drills = defaultdict(list)
# this dict will hold the unique tool diameters found in the exc_list objects as the dict keys and the dict
# values will be list of Shapely Points; for slots
custom_dict_slots = {}
custom_dict_slots = defaultdict(list)
for exc in flattened_list:
# copy options of the current excellon obj to the final excellon obj
@@ -186,19 +187,11 @@ class ExcellonObject(FlatCAMObj, Excellon):
for drill in exc.drills:
exc_tool_dia = float('%.*f' % (decimals_exc, exc.tools[drill['tool']]['C']))
if exc_tool_dia not in custom_dict_drills:
custom_dict_drills[exc_tool_dia] = [drill['point']]
else:
custom_dict_drills[exc_tool_dia].append(drill['point'])
custom_dict_drills[exc_tool_dia].append(drill['point'])
for slot in exc.slots:
exc_tool_dia = float('%.*f' % (decimals_exc, exc.tools[slot['tool']]['C']))
if exc_tool_dia not in custom_dict_slots:
custom_dict_slots[exc_tool_dia] = [[slot['start'], slot['stop']]]
else:
custom_dict_slots[exc_tool_dia].append([slot['start'], slot['stop']])
custom_dict_slots[exc_tool_dia].append([slot['start'], slot['stop']])
# add the zeros and units to the exc_final object
exc_final.zeros = exc.zeros

View File

@@ -1100,6 +1100,9 @@ class GeometryObject(FlatCAMObj, Geometry):
except ValueError:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
return
except AttributeError:
self.ui_connect()
return
tool_dia = float('%.*f' % (self.decimals, d))
tooluid = int(self.ui.geo_tools_table.item(current_row, 5).text())