Commit 77ecc7ae authored by sumpfralle's avatar sumpfralle

added a "copy" function for toolpaths


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1162 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 805f4be5
......@@ -74,6 +74,15 @@ class Toolpath(object):
def get_params(self):
return dict(self.parameters)
def copy(self):
new_paths = []
for path in self.paths:
new_path = Path()
for point in path.points:
new_path.append(point)
new_paths.append(new_path)
return Toolpath(new_paths, parameters=self.get_params())
def _get_limit_generic(self, attr, func):
path_min = []
for path in self.paths:
......@@ -215,14 +224,7 @@ class Toolpath(object):
def get_cropped_copy(self, polygons, callback=None):
# create a deep copy of the current toolpath
new_paths = []
for path in self.paths:
if path:
new_path = Path()
for point in path.points:
new_path.append(point)
new_paths.append(new_path)
tp = Toolpath(new_paths, **self.get_params())
tp = self.copy()
tp.crop(polygons, callback=callback)
return tp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment