- working on the Follow Tool and Milling Tool
This commit is contained in:
@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
13.01.2021
|
||||||
|
|
||||||
|
- working on the Follow Tool and Milling Tool
|
||||||
|
|
||||||
12.01.2021
|
12.01.2021
|
||||||
|
|
||||||
- in Gerber parser added a fix for Gerber region geometry that is self-intersecting
|
- in Gerber parser added a fix for Gerber region geometry that is self-intersecting
|
||||||
|
|||||||
@@ -1270,7 +1270,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
|||||||
if self.cnc_tools:
|
if self.cnc_tools:
|
||||||
for tooluid_key in self.cnc_tools:
|
for tooluid_key in self.cnc_tools:
|
||||||
tooldia = self.app.dec_format(
|
tooldia = self.app.dec_format(
|
||||||
float(self.cnc_tools[tooluid_key]['tools_mill_tooldia']),
|
float(self.cnc_tools[tooluid_key]['data']['tools_mill_tooldia']),
|
||||||
self.decimals
|
self.decimals
|
||||||
)
|
)
|
||||||
gcode_parsed = self.cnc_tools[tooluid_key]['gcode_parsed']
|
gcode_parsed = self.cnc_tools[tooluid_key]['gcode_parsed']
|
||||||
|
|||||||
@@ -316,7 +316,8 @@ class ToolFollow(AppTool, Gerber):
|
|||||||
'solid_geometry': new_obj.solid_geometry
|
'solid_geometry': new_obj.solid_geometry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for d in new_data:
|
||||||
|
print(d, new_data[d])
|
||||||
ret = self.app.app_obj.new_object("geometry", outname, follow_init)
|
ret = self.app.app_obj.new_object("geometry", outname, follow_init)
|
||||||
if ret == 'fail':
|
if ret == 'fail':
|
||||||
self.app.inform.emit("[ERROR_NOTCL] %s" % _("Failed to create Follow Geometry."))
|
self.app.inform.emit("[ERROR_NOTCL] %s" % _("Failed to create Follow Geometry."))
|
||||||
@@ -356,12 +357,12 @@ class ToolFollow(AppTool, Gerber):
|
|||||||
if opt_key.find('geometry' + "_") == 0:
|
if opt_key.find('geometry' + "_") == 0:
|
||||||
oname = opt_key[len('geometry') + 1:]
|
oname = opt_key[len('geometry') + 1:]
|
||||||
new_data[oname] = app_obj.options[opt_key]
|
new_data[oname] = app_obj.options[opt_key]
|
||||||
if opt_key.find('tools_mill' + "_") == 0:
|
if opt_key.find('tools_') == 0:
|
||||||
oname = opt_key[len('tools_mill') + 1:]
|
new_data[opt_key] = app_obj.options[opt_key]
|
||||||
new_data[oname] = app_obj.options[opt_key]
|
|
||||||
|
|
||||||
# Propagate options
|
# Propagate options
|
||||||
new_obj.options["tools_mill_tooldia"] = app_obj.defaults["tools_mill_tooldia"]
|
new_obj.options["tools_mill_tooldia"] = app_obj.defaults["tools_mill_tooldia"]
|
||||||
|
new_data["tools_mill_tooldia"] = app_obj.defaults["tools_mill_tooldia"]
|
||||||
|
|
||||||
target_geo = unary_union(followed_obj.follow_geometry)
|
target_geo = unary_union(followed_obj.follow_geometry)
|
||||||
area_follow = target_geo.intersection(deepcopy(unary_union(self.sel_rect)))
|
area_follow = target_geo.intersection(deepcopy(unary_union(self.sel_rect)))
|
||||||
|
|||||||
@@ -2766,10 +2766,9 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
tool_cnt += 1
|
tool_cnt += 1
|
||||||
|
|
||||||
dia_cnc_dict = deepcopy(tools_dict[tooluid_key])
|
dia_cnc_dict = deepcopy(tools_dict[tooluid_key])
|
||||||
tooldia_val = app_obj.dec_format(float(tools_dict[tooluid_key]['tools_mill_tooldia']), self.decimals)
|
tooldia_val = app_obj.dec_format(
|
||||||
dia_cnc_dict.update({
|
float(tools_dict[tooluid_key]['data']['tools_mill_tooldia']), self.decimals)
|
||||||
'tools_mill_tooldia': tooldia_val
|
dia_cnc_dict['data']['tools_mill_tooldia'] = tooldia_val
|
||||||
})
|
|
||||||
|
|
||||||
if "optimization_type" not in tools_dict[tooluid_key]['data']:
|
if "optimization_type" not in tools_dict[tooluid_key]['data']:
|
||||||
def_optimization_type = self.app.defaults["tools_mill_optimization_type"]
|
def_optimization_type = self.app.defaults["tools_mill_optimization_type"]
|
||||||
@@ -2800,9 +2799,7 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
else:
|
else:
|
||||||
tool_offset = 0.0
|
tool_offset = 0.0
|
||||||
|
|
||||||
dia_cnc_dict.update({
|
dia_cnc_dict['data']['tools_mill_offset_value'] = tool_offset
|
||||||
'tools_mill_offset_value': tool_offset
|
|
||||||
})
|
|
||||||
|
|
||||||
z_cut = tools_dict[tooluid_key]['data']["tools_mill_cutz"]
|
z_cut = tools_dict[tooluid_key]['data']["tools_mill_cutz"]
|
||||||
z_move = tools_dict[tooluid_key]['data']["tools_mill_travelz"]
|
z_move = tools_dict[tooluid_key]['data']["tools_mill_travelz"]
|
||||||
@@ -2932,10 +2929,9 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
dia_cnc_dict = deepcopy(tools_dict[tooluid_key])
|
dia_cnc_dict = deepcopy(tools_dict[tooluid_key])
|
||||||
|
|
||||||
# Tooldia update
|
# Tooldia update
|
||||||
tooldia_val = app_obj.dec_format(float(tools_dict[tooluid_key]['tooldia']), self.decimals)
|
tooldia_val = app_obj.dec_format(
|
||||||
dia_cnc_dict.update({
|
float(tools_dict[tooluid_key]['data']['tools_mill_tooldia']), self.decimals)
|
||||||
'tooldia': tooldia_val
|
dia_cnc_dict['data']['tools_mill_tooldia'] = tooldia_val
|
||||||
})
|
|
||||||
|
|
||||||
if "optimization_type" not in tools_dict[tooluid_key]['data']:
|
if "optimization_type" not in tools_dict[tooluid_key]['data']:
|
||||||
def_optimization_type = self.app.defaults["tools_mill_optimization_type"]
|
def_optimization_type = self.app.defaults["tools_mill_optimization_type"]
|
||||||
@@ -2969,12 +2965,12 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
tools_dict[tooluid_key]['data']['ppname_g'] = self.ui.pp_geo_name_cb.get_value()
|
tools_dict[tooluid_key]['data']['ppname_g'] = self.ui.pp_geo_name_cb.get_value()
|
||||||
|
|
||||||
# Offset calculation
|
# Offset calculation
|
||||||
offset_type = dia_cnc_dict['tools_mill_offset_type'].lower()
|
offset_type = dia_cnc_dict['tools_mill_offset_type']
|
||||||
if offset_type == 'in':
|
if offset_type == 1: # 'in'
|
||||||
tool_offset = -tooldia_val / 2
|
tool_offset = -tooldia_val / 2
|
||||||
elif offset_type == 'out':
|
elif offset_type == 2: # 'out'
|
||||||
tool_offset = tooldia_val / 2
|
tool_offset = tooldia_val / 2
|
||||||
elif offset_type == 'custom':
|
elif offset_type == 3: # 'custom'
|
||||||
offset_value = self.ui.offset_entry.get_value()
|
offset_value = self.ui.offset_entry.get_value()
|
||||||
if offset_value:
|
if offset_value:
|
||||||
tool_offset = float(offset_value)
|
tool_offset = float(offset_value)
|
||||||
@@ -2987,9 +2983,7 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
else:
|
else:
|
||||||
tool_offset = 0.0
|
tool_offset = 0.0
|
||||||
|
|
||||||
dia_cnc_dict.update({
|
dia_cnc_dict['data']['tools_mill_offset_value'] = tool_offset
|
||||||
'offset_value': tool_offset
|
|
||||||
})
|
|
||||||
|
|
||||||
# Solid Geometry
|
# Solid Geometry
|
||||||
tool_solid_geometry = self.target_obj.tools[tooluid_key]['solid_geometry']
|
tool_solid_geometry = self.target_obj.tools[tooluid_key]['solid_geometry']
|
||||||
|
|||||||
Reference in New Issue
Block a user