Commit 55911430 authored by sumpfralle's avatar sumpfralle

don't break if "None" model is merged with others

fixed "copy" method for polygons (no lines were copied before)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1153 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent dea5cfe3
......@@ -70,6 +70,8 @@ def get_combined_bounds(models):
return low, high
def get_combined_model(models):
# remove all "None" models
models = [model for model in models if not model is None]
if not models:
return None
result = models.pop(0).copy()
......
......@@ -231,7 +231,10 @@ class Polygon(TransformableContainer):
self._cached_offset_polygons = {}
def copy(self):
return self.__class__(plane=self.plane.copy())
result = self.__class__(plane=self.plane.copy())
for line in self.get_lines():
result.append(line.copy())
return result
def append(self, line):
if not self.is_connectable(line):
......
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