-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Task
1 / 11 of 1 issue completed
Copy link
Labels
Description
TL;DR
- ✅ Use
AABBBroadPhasewithTriangleGeometry - ❌ Avoid
AABBBroadPhasewithTetrahedronGeometry
Reason: bounding boxes are updated every timestep, and withTetrahedronProximitythe cost outweighs the benefit.
Profiling Summary
Profiling InsertionAlgorithm::doDetection in NeedleInsertion.py shows where time is spent. The algorithm involves four stages:
- Puncture detection - tip (
PointProximityvsTriangleGeometry) - Shaft collision - shaft (
EdgeGeometryvsTriangleGeometry) - Needle insertion - inside tissue (
EdgeProximityvsTetrahedronGeometry) - Reprojection - coupling points (
TetrahedronProximityvsEdgeGeometry)
Without AABBBroadPhase
- The bottleneck is shaft collision, where every needle edge is checked against all surface triangles.
- Once inside tissue, shaft collision is disabled; spikes come from searching coupling points in tetrahedra. This is relatively cheap since only an
EdgeProximityon the shaft is involved compared to shaft collision where all edges are involved.
With AABBBroadPhase in TriangleGeometry
- Significant speedup: shaft collision is accelerated.
With AABBBroadPhase in TetrahedronGeometry
No benefit: updating tetrahedral bounding boxes each step is more expensive than the proximity search itself.
