From 92cc601a854bd0cefeaeaa32467f64ccc75b669a Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Thu, 9 Jul 2026 14:56:12 +0300 Subject: [PATCH] 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 --- src/bonsai/bonsai/tool/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index 4f1278b51a..ab1e81b9e6 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -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.