|
@@ -635,13 +635,19 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|
|
self.app.report_usage("excellon_on_create_milling_button")
|
|
self.app.report_usage("excellon_on_create_milling_button")
|
|
|
self.read_form()
|
|
self.read_form()
|
|
|
|
|
|
|
|
- # Get the tools from the list
|
|
|
|
|
|
|
+ # Get the tools from the list. These are keys
|
|
|
|
|
+ # to self.tools
|
|
|
tools = self.get_selected_tools_list()
|
|
tools = self.get_selected_tools_list()
|
|
|
|
|
|
|
|
if len(tools) == 0:
|
|
if len(tools) == 0:
|
|
|
self.app.inform.emit("Please select one or more tools from the list and try again.")
|
|
self.app.inform.emit("Please select one or more tools from the list and try again.")
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
|
|
+ for tool in tools:
|
|
|
|
|
+ if self.tools[tool]["C"] < self.options["tooldia"]:
|
|
|
|
|
+ self.app.inform.emit("[warning] Milling tool is larger than hole size. Cancelled.")
|
|
|
|
|
+ return
|
|
|
|
|
+
|
|
|
geo_name = self.options["name"] + "_mill"
|
|
geo_name = self.options["name"] + "_mill"
|
|
|
|
|
|
|
|
def geo_init(geo_obj, app_obj):
|
|
def geo_init(geo_obj, app_obj):
|
|
@@ -653,7 +659,8 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|
|
for hole in self.drills:
|
|
for hole in self.drills:
|
|
|
if hole['tool'] in tools:
|
|
if hole['tool'] in tools:
|
|
|
geo_obj.solid_geometry.append(
|
|
geo_obj.solid_geometry.append(
|
|
|
- Point(hole['point']).buffer(self.tools[hole['tool']]["C"]/2 - self.options["tooldia"]/2).exterior
|
|
|
|
|
|
|
+ Point(hole['point']).buffer(self.tools[hole['tool']]["C"] / 2 -
|
|
|
|
|
+ self.options["tooldia"] / 2).exterior
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
def geo_thread(app_obj):
|
|
def geo_thread(app_obj):
|
|
@@ -1121,7 +1128,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|
|
try:
|
|
try:
|
|
|
for sub_el in element:
|
|
for sub_el in element:
|
|
|
self.plot_element(sub_el)
|
|
self.plot_element(sub_el)
|
|
|
- except TypeError:
|
|
|
|
|
|
|
+
|
|
|
|
|
+ except TypeError: # Element is not iterable...
|
|
|
|
|
+
|
|
|
if type(element) == Polygon:
|
|
if type(element) == Polygon:
|
|
|
x, y = element.exterior.coords.xy
|
|
x, y = element.exterior.coords.xy
|
|
|
self.axes.plot(x, y, 'r-')
|
|
self.axes.plot(x, y, 'r-')
|
|
@@ -1135,7 +1144,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|
|
self.axes.plot(x, y, 'r-')
|
|
self.axes.plot(x, y, 'r-')
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- FlatCAMApp.App.log.warning("Did not plot:", str(type(element)))
|
|
|
|
|
|
|
+ FlatCAMApp.App.log.warning("Did not plot:" + str(type(element)))
|
|
|
|
|
|
|
|
def plot(self):
|
|
def plot(self):
|
|
|
"""
|
|
"""
|