- fixed some issues in panelize and cncjob Tcl commands

- reversed the mirroring axis in the `mirror` Tcl command to be consistent with the action in GUI
This commit is contained in:
Marius Stanciu
2022-02-01 22:09:14 +02:00
committed by Marius
parent 52a0efb62e
commit b1f038dd52
7 changed files with 12 additions and 14 deletions

View File

@@ -137,9 +137,9 @@ class TclCommandCncjob(TclCommandSignaled):
args["dia"] = args["dia"] if "dia" in args and args["dia"] else self.app.defaults["tools_mill_tooldia"]
args["z_cut"] = args["z_cut"] if "z_cut" in args and args["z_cut"] else self.app.defaults["geometry_cutz"]
args["z_cut"] = args["z_cut"] if "z_cut" in args and args["z_cut"] else self.app.defaults["tools_mill_cutz"]
args["z_move"] = args["z_move"] if "z_move" in args and args["z_move"] else \
self.app.defaults["geometry_travelz"]
self.app.defaults["tools_mill_travelz"]
args["pp"] = args["pp"] if "pp" in args and isinstance(args["pp"], str) else \
self.app.defaults["tools_mill_ppname_g"]
@@ -233,8 +233,6 @@ class TclCommandCncjob(TclCommandSignaled):
return "fail"
args.pop('name', None)
args.pop('las_power', None)
args.pop('las_min_pwr', None)
for arg in args:
if arg == "toolchange_xy" or arg == "spindlespeed" or arg == "startz":
@@ -250,10 +248,6 @@ class TclCommandCncjob(TclCommandSignaled):
else:
return "fail"
# HACK !!! Should be solved elsewhere!!!
# default option for multidepth is False
# obj.options['multidepth'] = False
if not obj.multigeo:
obj.generatecncjob(use_thread=False, plot=False, **args)
else:
@@ -286,7 +280,7 @@ class TclCommandCncjob(TclCommandSignaled):
local_tools_dict[tool_uid]['data']['tools_mill_spindlespeed'] = args["spindlespeed"]
local_tools_dict[tool_uid]['data']['tools_mill_dwell'] = args["dwell"]
local_tools_dict[tool_uid]['data']['tools_mill_dwelltime'] = args["dwelltime"]
local_tools_dict[tool_uid]['data']['tools_mill_min_power'] = args["las_min_pwr"]
local_tools_dict[tool_uid]['data']['tools_mill_min_power'] = args['las_min_pwr']
local_tools_dict[tool_uid]['data']['tools_mill_ppname_g'] = args["pp"]
self.app.milling_tool.mtool_gen_cncjob(

View File

@@ -53,7 +53,7 @@ class TclCommandCutout(TclCommand):
('gaps', "Type of gaps. Can be: 'tb' = top-bottom, 'lr' = left-right and '4' = one each side."),
('outname', 'Name of the object to create.')
]),
'examples': ['cutout new_geo -dia 1.2 -margin 0.1 -gapsize 1 -gaps "tb" -outname cut_geo']
'examples': ['cutout cut_object -dia 1.2 -margin 0.1 -gapsize 1 -gaps "tb" -outname cutout_geo']
}
def execute(self, args, unnamed_args):

View File

@@ -106,6 +106,8 @@ class TclCommandMirror(TclCommandSignaled):
if 'axis' in args:
try:
axis = args['axis'].upper()
# fix so the Tcl command works just like in GUI
axis = 'X' if axis == 'Y' else 'Y'
except KeyError:
axis = 'Y'
else:

View File

@@ -15,7 +15,7 @@ if '_' not in builtins.__dict__:
class TclCommandNregions(TclCommand):
"""
Tcl shell command to follow a Gerber file
Tcl shell command that creates a Geometry object with the non-copper regions.
"""
# array of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)

View File

@@ -313,7 +313,7 @@ class TclCommandPanelize(TclCommand):
obj_fin.tools = copied_tools
if obj.multigeo is True:
for tool in obj.tools:
obj_fin.tools[tool]['solid_geometry'][:] = []
obj_fin.tools[tool]['solid_geometry'] = []
for row in range(rows):
currentx = 0.0