perf: AABB snap pre-rejection via acadrust bounding_box() (Option K upgrade)

Add `aabb: [f32; 4]` field to WireModel (world-space 2-D bounding box).
In tessellate_entity() set each wire's AABB from e.as_entity().bounding_box()
via new entity_aabb() helper; Insert sub-entities each get their own AABB.
Preview/interim wires and any entity returning a zero-extent default box get
UNBOUNDED_AABB so they are never pre-rejected.

Replace the chord-sphere heuristic in Snapper::wire_in_range() with a proper
AABB vs snap-circle overlap test.  The new check is four scalar comparisons and
correctly handles closed curves (circles, arcs) which the chord-sphere approach
had to special-case.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-04-26 12:21:51 +03:00
1 parent 2da9301a2b
commit bfd8d0411a
35 files changed
+107 -25

No files matched your search

+1
View File
@@ -133,6 +133,7 @@ impl CadCommand for AttdefCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -526,5 +526,6 @@ fn line_wire(from: Vec3, to: Vec3) -> WireModel {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
}
}
+1
View File
@@ -87,6 +87,7 @@ impl CadCommand for LineCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -112,6 +112,7 @@ impl CadCommand for MlineCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -111,6 +111,7 @@ impl CadCommand for ImageCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+2
View File
@@ -85,6 +85,7 @@ impl CadCommand for RayCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
@@ -162,6 +163,7 @@ impl CadCommand for XLineCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -82,6 +82,7 @@ impl CadCommand for RevCloudCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+2
View File
@@ -118,6 +118,7 @@ impl CadCommand for WipeoutCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
WipeoutMode::Polygonal => {
@@ -138,6 +139,7 @@ impl CadCommand for WipeoutCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -75,6 +75,7 @@ impl CadCommand for AreaCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -70,6 +70,7 @@ impl CadCommand for DistCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
}
+1
View File
@@ -133,6 +133,7 @@ impl CadCommand for StretchCommand {
tangent_geoms: vec![],
aci: 0,
key_vertices: vec![],
aabb: WireModel::UNBOUNDED_AABB,
})
}
_ => None,