From 6c4e4e5f910a7959175f329cc159eb65f7b0f16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Mon, 30 Jun 2025 19:46:38 -0300 Subject: [PATCH] Partial solution for #6775. The issue happens when a wall has a "ATPATH" connection and has a negative direction sense. It mixes the profile points in an incorrect order. This commit seems to fix it, but maybe there is a better solution. --- .../api/geometry/regenerate_wall_representation.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py index ecdd68308a..0cce951810 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py @@ -150,6 +150,8 @@ class Regenerator: continue self.join(wall, wall2, layers1, layers2, rel.RelatedConnectionType, rel.RelatingConnectionType) + miny = axes[-2][0][1] + maxy = axes[-1][0][1] if not self.start_points: minx = axes[0][0][0] self.start_points = [ @@ -266,6 +268,13 @@ class Regenerator: split_points.append(end_points) split_points = iter(split_points) + if maxy < miny: + self.maxpath_points, self.minpath_points = self.minpath_points, self.maxpath_points + if self.maxpath_points: + self.maxpath_points[0] = list(reversed(self.maxpath_points[0])) + if self.minpath_points: + self.minpath_points[0] = list(reversed(self.minpath_points[0])) + while True: # Draw each profile as clockwise starting from (minx, miny) start_split = next(split_points, None)