Commit 78aaf83b authored by sumpfralle's avatar sumpfralle

automatically distributed support grid is now only attached to the lower plane...

automatically distributed support grid is now only attached to the lower plane of a multi-layered 2D model


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@952 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 774d6118
...@@ -423,8 +423,11 @@ class ContourModel(BaseModel): ...@@ -423,8 +423,11 @@ class ContourModel(BaseModel):
def get_num_of_lines(self): def get_num_of_lines(self):
return sum([len(group) for group in self._line_groups]) return sum([len(group) for group in self._line_groups])
def get_polygons(self): def get_polygons(self, z=None):
return self._line_groups if z is None:
return self._line_groups
else:
return [group for group in self._line_groups if group.minz == z]
def reverse_directions(self, callback=None): def reverse_directions(self, callback=None):
for polygon in self._line_groups: for polygon in self._line_groups:
......
...@@ -162,7 +162,7 @@ def get_support_distributed(model, z_plane, average_distance, ...@@ -162,7 +162,7 @@ def get_support_distributed(model, z_plane, average_distance,
return return
result = Model() result = Model()
if hasattr(model, "get_polygons"): if hasattr(model, "get_polygons"):
polygons = model.get_polygons() polygons = model.get_polygons(z=z_plane)
else: else:
polygons = model.get_waterline_contour(Plane(Point(0, 0, z_plane), polygons = model.get_waterline_contour(Plane(Point(0, 0, z_plane),
Vector(0, 0, 1))).get_polygons() Vector(0, 0, 1))).get_polygons()
......
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