Commit 574ecca8 authored by sumpfralle's avatar sumpfralle

show support bridges for the parts of the 2D model below the bottom plane


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@955 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 334ed178
...@@ -423,11 +423,13 @@ class ContourModel(BaseModel): ...@@ -423,11 +423,13 @@ 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, z=None): def get_polygons(self, z=None, ignore_below=True):
if z is None: if z is None:
return self._line_groups return self._line_groups
else: elif ignore_below:
return [group for group in self._line_groups if group.minz == z] return [group for group in self._line_groups if group.minz == z]
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(z=z_plane) polygons = model.get_polygons(z=z_plane, ignore_below=False)
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