perf: implement L–S performance improvements

- L: pre-project wire endpoints to screen before ApparentIntersection pair loops
- O+S: tight per-segment AABB cull + move a0/a1 Vec3 outside inner snap loop
- P: epoch-cached entity→block reverse map replaces O(E×B) scan
- Q: lazy per-point projection in hit tests eliminates per-wire Vec<Point> alloc
- R: HatchModel.boundary Arc<Vec> so clone is pointer bump not heap alloc
This commit is contained in:
Hakan Seven committed 2026-05-06 22:42:22 +03:00
1 parent b83c982bc2
commit 45f9f96c93
6 files changed
+265 -233

No files matched your search

+3 -3
View File
@@ -113,7 +113,7 @@ impl HatchCommand {
}]
});
HatchModel {
boundary,
boundary: std::sync::Arc::new(boundary),
pattern: HatchPattern::Pattern(families),
name: pat_name.into(),
color: [0.75, 0.75, 0.75, 0.85],
@@ -245,7 +245,7 @@ impl GradientCommand {
fn make_hatch(&self, boundary: Vec<[f32; 2]>) -> HatchModel {
HatchModel {
boundary,
boundary: std::sync::Arc::new(boundary),
pattern: HatchPattern::Gradient {
angle_deg: 0.0,
color2: [0.18, 0.18, 0.18, 0.0],
@@ -396,7 +396,7 @@ impl CadCommand for BoundaryCommand {
self.missed = false;
// Store as a Hatch entity (solid fill) so it is selectable.
let model = HatchModel {
boundary: outline.clone(),
boundary: std::sync::Arc::new(outline.clone()),
pattern: HatchPattern::Solid,
name: "SOLID".into(),
color: [0.45, 0.45, 0.45, 0.60],