From f39c94cc105b73492281cdf2843cf7fdeaf5408f Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Mon, 25 Nov 2024 12:38:22 -0800 Subject: [PATCH] fix(room2d): Ensure exception is not hit for degenerate roofs --- dragonfly/room2d.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dragonfly/room2d.py b/dragonfly/room2d.py index 118162cf..82680c69 100644 --- a/dragonfly/room2d.py +++ b/dragonfly/room2d.py @@ -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)