Skip to content

Commit

Permalink
fix(room2d): Ensure exception is not hit for degenerate roofs
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Nov 25, 2024
1 parent 9cffe54 commit f39c94c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dragonfly/room2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -4132,8 +4132,7 @@ def _roof_faces(self, all_room_poly, rel_rf_polys, rel_rf_planes, tolerance):
int_result = pb.intersect(b_room_poly, b_rf_poly, int_tol)
except Exception: # intersection failed for some reason
return None
polys = [Polygon2D(tuple(Point2D(pt.x, pt.y) for pt in new_poly))
for new_poly in int_result.regions]
polys = Polygon2D._from_bool_poly(int_result, tolerance)
if self.floor_geometry.has_holes and len(polys) > 1:
# sort the polygons by area and check if any are inside the others
polys.sort(key=lambda x: x.area, reverse=True)
Expand Down

0 comments on commit f39c94c

Please sign in to comment.