mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 19:34:34 +00:00
32ac20e8e3
theoryshaw's follow-up on #6944: after the profile/curve reconstruction fix (previous commit), the arc/circle marker for a freshly Shift+D-duplicated loop wouldn't appear until leaving and re-entering Edit Mode. Root cause: ProfileDecorator groups arc/circle vertices purely by IFCARCINDEX/IFCCIRCLE vertex-group index every draw call (it has no cache to go stale, it fully recomputes from the live edit-mesh bmesh each frame). Duplicating a loop copies its vertex-group weights onto the new geometry, since Blender allocates no new group for a duplicate, so the source loop and its live duplicate land in the same dict entry. That entry then fails the "exactly 2 verts per circle / 3 per arc" check and is skipped entirely, so BOTH the original and the duplicate stop being drawn until the mesh is reimported and gets fresh, distinct groups. Verified live in headless Blender: built a bmesh with an IFCCIRCLE loop and an IFCARCINDEX loop, then ran bmesh.ops.duplicate on each (the same bmesh-level operation underlying Shift+D) and called ProfileDecorator's draw method directly. Before this change, duplicating either loop dropped both the original and the duplicate from the decorator (0 circle/arc batches drawn instead of 2). After, both draw immediately, with no change to the non-duplicated case (still 1) or to genuinely distinct loops (5 independent circles still resolve to 5, not merged). 500-circle timing is unchanged (~14.3ms/draw before and after), so the added connectivity split is not a hot-path regression. Added test/bim/module/model/test_profile_decorator_duplicate_loop.py pinning the new _connected_components helper's behavior for single and duplicated circle/arc loops. This contribution was produced with the assistance of an AI coding tool.