Skip to content

Commit 211d87a

Browse files
chriswmackeyChris Mackey
authored andcommitted
fix(face): Ensure Face3Ds with 3 vertices still get checked for colinear
1 parent 2cbc7b6 commit 211d87a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ladybug_geometry/geometry3d/face.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ def remove_colinear_vertices(self, tolerance):
778778
at which point the vertex is considered colinear.
779779
"""
780780
if len(self.vertices) == 3:
781+
valid_pts = [pt for i, pt in enumerate(self.vertices)
782+
if not pt.is_equivalent(self.vertices[i - 1], tolerance)]
783+
assert len(valid_pts) == 3, 'There must be at least 3 vertices for ' \
784+
'a Face3D. Got {}'.format(len(valid_pts))
781785
return self
782786
if not self.has_holes: # we only need to evaluate one list of vertices
783787
new_vertices = self._remove_colinear(

0 commit comments

Comments
 (0)