Commit ea170c89 authored by sumpfralle's avatar sumpfralle

fixed typos

moved direction check for waterlines to the Plane class


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@652 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 9c847a4b
...@@ -219,11 +219,6 @@ class Model(BaseModel): ...@@ -219,11 +219,6 @@ class Model(BaseModel):
for t in self._triangles: for t in self._triangles:
collision_line = plane.intersect_triangle(t) collision_line = plane.intersect_triangle(t)
if not collision_line is None: if not collision_line is None:
# check direction of line - the lines should run anti-clockwise
cross = plane.n.cross(collision_line.dir)
if cross.dot(t.normal) > 0:
# revert the direction of the line
collision_line = Line(collision_line.p2, collision_line.p1)
collision_lines.append(collision_line) collision_lines.append(collision_line)
# combine these lines into polygons # combine these lines into polygons
contour = ContourModel(plane=plane) contour = ContourModel(plane=plane)
...@@ -390,7 +385,7 @@ class ContourModel(BaseModel): ...@@ -390,7 +385,7 @@ class ContourModel(BaseModel):
if not new_groups is None: if not new_groups is None:
new_line_groups.extend(new_groups) new_line_groups.extend(new_groups)
if len(new_line_groups) > 0: if len(new_line_groups) > 0:
result = ContourModel(plane=self.plane) result = ContourModel(plane=self._plane)
for group in new_line_groups: for group in new_line_groups:
result.append(group) result.append(group)
return result return result
...@@ -413,7 +408,7 @@ class ContourModel(BaseModel): ...@@ -413,7 +408,7 @@ class ContourModel(BaseModel):
# use a cached offset model if it exists # use a cached offset model if it exists
if offset in self._cached_offset_models: if offset in self._cached_offset_models:
return self._cached_offset_models[offset] return self._cached_offset_models[offset]
result = ContourModel(plane=self.plane) result = ContourModel(plane=self._plane)
for group in self._line_groups: for group in self._line_groups:
new_groups = group.get_offset_polygons(offset) new_groups = group.get_offset_polygons(offset)
if not new_groups is None: if not new_groups is None:
......
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