mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
82dd1d94de
Refs gh#8088. Array regen + multi-opening drops fan out N+1 wall recuts per operator (one per child filling deletion + the final mirror recut), making CSG opening-subtraction O(N^2) for a linear UX action. Introduces tool.Geometry.batch_host_recut() — a context manager that coalesces switch_representation and bpy.ops.bim.update_representation calls per voided element within one operator transaction. The drain re-reads the active representation so the recut reflects current IFC. Wraps 7 entry points (regenerate_array, RegenerateArray, RemoveArray, AddOpening, RecalculateFill, CloneOpening, regenerate_from_type) and rewires 7 leaf call sites in opening.py, void/operator.py, and mirror_parent_void_fillings_to_children. An AST forward-compat guard pins the rewire contract: no direct switch_representation or bpy.ops.bim.update_representation in the three target files outside the helper definitions. A 16-child array regen now recuts the wall once instead of 17 times. The CSG cost per recut is unchanged; only the count is reduced. 21 new tests across three lanes (helper unit, entry-point coalescing, AST guard) — all green. Generated with the assistance of an AI coding tool.