forked from 1b-agent/opencadstudio-upstream
Snap and hover hit-testing scanned the whole model wire set every cursor move; a heavily block-instanced drawing explodes to millions of wires, so this stalled for over a second per move. Add a cached spatial grid (wire_grid) keyed on the geometry epoch and query only the cursor neighbourhood via Scene::hit_test_wires_near. Gate the O(in-range segments squared) intersection passes on the in-range POINT count, not the wire count — a handful of curved wires, each hundreds of tessellated points, blew the quadratic up while the wire count looked modest. Give zero-size entities away from the origin (POINTs) a real cullable AABB, and fall back to a block sub-wire's own world points when its entity bounding box is degenerate. Co-Authored-By: Claude Opus 4.8 <[email protected]>
7 lines
109 B
Rust
7 lines
109 B
Rust
pub mod hit_test;
|
|
pub mod selection_state;
|
|
pub mod grip;
|
|
pub mod quadtree;
|
|
pub mod wire_grid;
|
|
pub mod xclip;
|