Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(faces): Ensure degenerate geometry is caught for all split methods #424

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ladybug_geometry/geometry3d/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,11 @@ def split_with_line(self, line, tolerance):
if len(cycle) >= 3:
pt_3ds = [prim_pl.xy_to_xyz(node.pt) for node in cycle]
new_face = Face3D(pt_3ds, plane=prim_pl)
new_face = new_face.remove_colinear_vertices(tolerance)
split_faces.append(new_face)
try:
new_face = new_face.remove_colinear_vertices(tolerance)
split_faces.append(new_face)
except AssertionError: # degenerate geometry to ignore
pass

# rebuild the Face3D from the results and return them
if len(split_faces) == 1:
Expand Down Expand Up @@ -1279,8 +1282,11 @@ def split_with_polyline(self, polyline, tolerance):
if len(cycle) >= 3:
pt_3ds = [prim_pl.xy_to_xyz(node.pt) for node in cycle]
new_face = Face3D(pt_3ds, plane=prim_pl)
new_face = new_face.remove_colinear_vertices(tolerance)
split_faces.append(new_face)
try:
new_face = new_face.remove_colinear_vertices(tolerance)
split_faces.append(new_face)
except AssertionError: # degenerate geometry to ignore
pass

# rebuild the Face3D from the results and return them
if len(split_faces) == 1:
Expand Down
Loading