From 8d63845f3d80d597ddc0b6b028c37310848c921e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Fri, 17 Jan 2025 15:09:57 -0300 Subject: [PATCH] Change `AddSlabFromWalls` to consistently create walls in a counterclockwise direction. This guarantees that the external face of the walls aligns with the edges of the slab. --- src/bonsai/bonsai/bim/module/model/wall.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index e7da04d2db..dc1887d2cc 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -618,6 +618,8 @@ class DumbWallGenerator: polyline_points = extrusion.SweptArea.OuterCurve.Points.CoordList polyline_points = [[(v * self.unit_scale) for v in p] for p in polyline_points] polyline_points = [slab_obj.matrix_world @ Vector((p[0], p[1], elevation)) for p in polyline_points] + if not tool.Cad.is_counter_clockwise_order(polyline_points[0], polyline_points[1], polyline_points[2]): + polyline_points = polyline_points[::-1] is_polyline_closed = True walls = [] for i in range(len(polyline_points) - 1):