- in drillcncjob Tcl command added the usage of RTree path optimization and made it the default choice

This commit is contained in:
Marius Stanciu
2022-01-30 16:54:20 +02:00
committed by Marius
parent 71441a80e5
commit 16af642409
3 changed files with 7 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta
- fixed not adding the feedrate code in `drillcncjob` Tcl command
- fixed crash when trying to do a `select all` and there are app Scripts present
- updated the `drillcncjob` Tcl command to make a script exit in case of an error
- in `drillcncjob` Tcl command added the usage of `RTree` path optimization and made it the default choice
29.01.2022

View File

@@ -4353,9 +4353,7 @@ class CNCjob(Geometry):
altPoints.append((point.coords.xy[0][0], point.coords.xy[1][0]))
optimized_path = self.optimized_travelling_salesman(altPoints)
elif used_excellon_optimization_type == 'R':
for point in points[tool]:
altPoints.append((point.coords.xy[0][0], point.coords.xy[1][0]))
optimized_path = self.exc_optimized_rtree(altPoints)
optimized_path = self.exc_optimized_rtree(points[tool])
if optimized_path == 'fail':
return 'fail'
else:
@@ -4426,6 +4424,9 @@ class CNCjob(Geometry):
if used_excellon_optimization_type == 'T':
locx = point[0]
locy = point[1]
elif used_excellon_optimization_type == 'R':
locx = point[0][0]
locy = point[0][1]
else:
locx = locations[point][0]
locy = locations[point][1]

View File

@@ -270,7 +270,8 @@ class TclCommandDrillcncjob(TclCommandSignaled):
"in format (x, y) - no spaces allowed. But always two comma separated values.")
return "fail"
opt_type = args["opt_type"] if "opt_type" in args and args["opt_type"] else 'B'
# Path optimization
opt_type = args["opt_type"] if "opt_type" in args and args["opt_type"] else 'R'
# ##########################################################################################
# ################# Set parameters #########################################################