forked from 1b-agent/opencadstudio-upstream
entity_wires() cloned the entire wire set — every point, fill, and snap buffer of every entity — on each call, although the set is already memoized behind an Arc and none of the 18 call sites mutates it. On large mesh imports (#358: 42M faces, ~210 MB of wire content per 1M triangles) that is a multi-GB allocation + memcpy on every pick, snap, selection, or plot pass. Return the Arc instead. Call sites iterate as before; the two window-plot paths that build a culled owned subset now clone only the wires inside the plot window, and the print pipeline moves the Arc into its async task. Measured (tests/mem_probe_meshent.rs, 1M-triangle MESH, release): resident after entity_wires() drops 758 -> 547 MB (866 -> 646 B/face). Co-Authored-By: Claude Fable 5 <[email protected]>