mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Bonsai: close IfcPolyline loops by appending the closing edge (#8043)
convert_curve_to_mesh built the edge chain of a polyline with extend, then for a closed polyline overwrote the last edge with the closing edge instead of appending it. That discarded the final real segment, so every closed IfcPolyline loop came back one edge short and open. On the edit mode round trip the inner void loop of an IfcArbitraryProfileDefWithVoids was then lost or misclassified, and the profile was rewritten without its void, collapsing the extrusion to a bounding box. Append the closing edge instead, matching the IfcIndexedPolyCurve branch. Live tested: the Tab round trip now keeps both loops closed and re-exports the IfcArbitraryProfileDefWithVoids with its inner void intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
CyrilWaechter
parent
aede574d0e
commit
1a181a8d48
@@ -618,7 +618,7 @@ class Model(bonsai.core.tool.Model):
|
||||
|
||||
cls.edges.extend([(i, i + 1) for i in range(offset, len(cls.vertices) - 1)])
|
||||
if is_closed:
|
||||
cls.edges[-1] = (len(cls.vertices) - 1, offset) # Close the loop
|
||||
cls.edges.append((len(cls.vertices) - 1, offset)) # Close the loop
|
||||
|
||||
elif curve.is_a("IfcCompositeCurve"):
|
||||
# This is a first pass incomplete implementation only for simple polylines, and misses many details.
|
||||
|
||||
Reference in New Issue
Block a user