- when failing to save a project make sure that we can still close the app correctly
- Milling Tool: when generating CNCJob's from a single_geometry type fixed an issue getting bad bounds values (Inf) which did not allow saving the project that included such a CNCJob object due of failing to serialize such an object - fixed some redundancy in some RegEx expressions - minor fixes
This commit is contained in:
22
camlib.py
22
camlib.py
@@ -3375,7 +3375,7 @@ class CNCjob(Geometry):
|
||||
self.xy_toolchange = None
|
||||
else:
|
||||
# either originally it was a string or not, xy_toolchange will be made string
|
||||
self.xy_toolchange = re.sub('[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
self.xy_toolchange = re.sub(r'[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
|
||||
# and now, xy_toolchange is made into a list of floats in format [x, y]
|
||||
if self.xy_toolchange:
|
||||
@@ -3400,7 +3400,7 @@ class CNCjob(Geometry):
|
||||
self.xy_end = None
|
||||
else:
|
||||
# either originally it was a string or not, xy_end will be made string
|
||||
self.xy_end = re.sub('[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
self.xy_end = re.sub(r'[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
|
||||
# and now, xy_end is made into a list of floats in format [x, y]
|
||||
if self.xy_end:
|
||||
@@ -3862,7 +3862,7 @@ class CNCjob(Geometry):
|
||||
self.xy_end = None
|
||||
else:
|
||||
# either originally it was a string or not, xy_end will be made string
|
||||
self.xy_end = re.sub('[\(\)\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
self.xy_end = re.sub(r'[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
|
||||
# and now, xy_end is made into a list of floats in format [x, y]
|
||||
if self.xy_end:
|
||||
@@ -3882,7 +3882,7 @@ class CNCjob(Geometry):
|
||||
self.xy_toolchange = None
|
||||
else:
|
||||
# either originally it was a string or not, xy_toolchange will be made string
|
||||
self.xy_toolchange = re.sub('[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
self.xy_toolchange = re.sub(r'[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
|
||||
# and now, xy_toolchange is made into a list of floats in format [x, y]
|
||||
if self.xy_toolchange:
|
||||
@@ -4134,7 +4134,7 @@ class CNCjob(Geometry):
|
||||
if self.xy_toolchange == '':
|
||||
self.xy_toolchange = None
|
||||
else:
|
||||
self.xy_toolchange = re.sub('[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
self.xy_toolchange = re.sub(r'[()\[\]]', '', str(self.xy_toolchange)) if self.xy_toolchange else None
|
||||
|
||||
if self.xy_toolchange:
|
||||
self.xy_toolchange = [float(eval(a)) for a in self.xy_toolchange.split(",")]
|
||||
@@ -4149,7 +4149,7 @@ class CNCjob(Geometry):
|
||||
pass
|
||||
|
||||
# XY_end parameter
|
||||
self.xy_end = re.sub('[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
self.xy_end = re.sub(r'[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
if self.xy_end and self.xy_end != '':
|
||||
self.xy_end = [float(eval(a)) for a in self.xy_end.split(",")]
|
||||
if self.xy_end and len(self.xy_end) < 2:
|
||||
@@ -4950,7 +4950,7 @@ class CNCjob(Geometry):
|
||||
self.startz = float(startz) if startz is not None else self.app.options["geometry_startz"]
|
||||
self.z_end = float(endz) if endz is not None else self.app.options["geometry_endz"]
|
||||
|
||||
self.xy_end = re.sub('[()\[\]]', '', str(endxy)) if endxy else self.app.options["geometry_endxy"]
|
||||
self.xy_end = re.sub(r'[()\[\]]', '', str(endxy)) if endxy else self.app.options["geometry_endxy"]
|
||||
|
||||
if self.xy_end and self.xy_end != '':
|
||||
self.xy_end = [float(eval(a)) for a in self.xy_end.split(",")]
|
||||
@@ -4972,7 +4972,7 @@ class CNCjob(Geometry):
|
||||
if toolchangexy == '':
|
||||
self.xy_toolchange = None
|
||||
else:
|
||||
self.xy_toolchange = re.sub('[()\[\]]', '', str(toolchangexy)) \
|
||||
self.xy_toolchange = re.sub(r'[()\[\]]', '', str(toolchangexy)) \
|
||||
if toolchangexy else self.app.options["geometry_toolchangexy"]
|
||||
|
||||
if self.xy_toolchange and self.xy_toolchange != '':
|
||||
@@ -5374,7 +5374,7 @@ class CNCjob(Geometry):
|
||||
self.z_end = float(endz) if endz is not None else self.app.options["tools_mill_endz"]
|
||||
|
||||
self.xy_end = endxy if endxy != '' and endxy else self.app.options["tools_mill_endxy"]
|
||||
self.xy_end = re.sub('[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
self.xy_end = re.sub(r'[()\[\]]', '', str(self.xy_end)) if self.xy_end else None
|
||||
|
||||
if self.xy_end is not None and self.xy_end != '':
|
||||
self.xy_end = [float(eval(a)) for a in self.xy_end.split(",")]
|
||||
@@ -5397,7 +5397,7 @@ class CNCjob(Geometry):
|
||||
if toolchangexy == '':
|
||||
self.xy_toolchange = None
|
||||
else:
|
||||
self.xy_toolchange = re.sub('[()\[\]]', '', str(toolchangexy)) if self.xy_toolchange else None
|
||||
self.xy_toolchange = re.sub(r'[()\[\]]', '', str(toolchangexy)) if self.xy_toolchange else None
|
||||
|
||||
if self.xy_toolchange and self.xy_toolchange != '':
|
||||
self.xy_toolchange = [float(eval(a)) for a in self.xy_toolchange.split(",")]
|
||||
@@ -7304,7 +7304,7 @@ class CNCjob(Geometry):
|
||||
cmaxy = max(cmaxy, maxy_)
|
||||
return cminx, cminy, cmaxx, cmaxy
|
||||
else:
|
||||
# it's a Shapely object, return it's bounds
|
||||
# it's a Shapely object, return its bounds
|
||||
return obj.bounds
|
||||
|
||||
if self.multitool is False:
|
||||
|
||||
Reference in New Issue
Block a user