Skip to content

Commit 6c4e4e5

Browse files
committed
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.
1 parent a31aa60 commit 6c4e4e5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def regenerate(self, wall, length=1.0, height=1.0, angle=None):
150150
continue
151151
self.join(wall, wall2, layers1, layers2, rel.RelatedConnectionType, rel.RelatingConnectionType)
152152

153+
miny = axes[-2][0][1]
154+
maxy = axes[-1][0][1]
153155
if not self.start_points:
154156
minx = axes[0][0][0]
155157
self.start_points = [
@@ -266,6 +268,13 @@ def regenerate(self, wall, length=1.0, height=1.0, angle=None):
266268
split_points.append(end_points)
267269
split_points = iter(split_points)
268270

271+
if maxy < miny:
272+
self.maxpath_points, self.minpath_points = self.minpath_points, self.maxpath_points
273+
if self.maxpath_points:
274+
self.maxpath_points[0] = list(reversed(self.maxpath_points[0]))
275+
if self.minpath_points:
276+
self.minpath_points[0] = list(reversed(self.minpath_points[0]))
277+
269278
while True:
270279
# Draw each profile as clockwise starting from (minx, miny)
271280
start_split = next(split_points, None)

0 commit comments

Comments
 (0)