mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Update shape_builder.py
Described in the https://github.com/IfcOpenShell/IfcOpenShell/issues/4989
This commit is contained in:
@@ -126,16 +126,21 @@ class ShapeBuilder:
|
|||||||
# then we do need to create segments
|
# then we do need to create segments
|
||||||
segments = []
|
segments = []
|
||||||
cur_i = 0
|
cur_i = 0
|
||||||
|
closed_by_arc = False
|
||||||
while cur_i < len(points) - 1:
|
while cur_i < len(points) - 1:
|
||||||
cur_i_ifc = cur_i + 1
|
cur_i_ifc = cur_i + 1
|
||||||
if cur_i + 1 in arc_points:
|
if cur_i + 1 in arc_points:
|
||||||
segments.append((cur_i_ifc, cur_i_ifc + 1, cur_i_ifc + 2))
|
if cur_i_ifc + 1 < len(points):
|
||||||
|
segments.append((cur_i_ifc, cur_i_ifc + 1, cur_i_ifc + 2))
|
||||||
|
else:
|
||||||
|
segments.append((cur_i_ifc, cur_i_ifc + 1, 1))
|
||||||
|
closed_by_arc = True
|
||||||
cur_i += 2
|
cur_i += 2
|
||||||
else:
|
else:
|
||||||
segments.append((cur_i_ifc, cur_i_ifc + 1))
|
segments.append((cur_i_ifc, cur_i_ifc + 1))
|
||||||
cur_i += 1
|
cur_i += 1
|
||||||
|
|
||||||
if closed:
|
if closed and not closed_by_arc:
|
||||||
segments.append((len(points), 1))
|
segments.append((len(points), 1))
|
||||||
|
|
||||||
ifc_segments = []
|
ifc_segments = []
|
||||||
|
|||||||
Reference in New Issue
Block a user