iMSTK issueshttps://gitlab.kitware.com/iMSTK/iMSTK/-/issues2021-07-27T13:41:03-04:00https://gitlab.kitware.com/iMSTK/iMSTK/-/issues/346Analytical gradient of SDF2021-07-27T13:41:03-04:00Jianfeng YanAnalytical gradient of SDFCurrently we use finite difference to compute the gradient of signed distance field. Alternatively, it can be computed directly based on the coordinates, by taking the gradient of the basis functions. The benefits include
- subject to no round-off errors
- efficiency. The gradient is just an explicit linear function of the coordinates.Currently we use finite difference to compute the gradient of signed distance field. Alternatively, it can be computed directly based on the coordinates, by taking the gradient of the basis functions. The benefits include
- subject to no round-off errors
- efficiency. The gradient is just an explicit linear function of the coordinates.https://gitlab.kitware.com/iMSTK/iMSTK/-/issues/343Inverse SDF Collision Detection2021-07-26T11:52:50-04:00Andrew WilsonInverse SDF Collision DetectionWhilst we have static SDF collision detection rigid SDF collision detection is also relatively easy. Supply the CD with a rigid transform and we can inverse transform back into the SDF for CD. This should be as simple as applying the currently set geometries transform inverse to every point before sampling in the SDF for ImplicitGeometryToPointSetCD.
We can also do it for tetrahedral meshes by inversing the deformation of the tetrahedron.Whilst we have static SDF collision detection rigid SDF collision detection is also relatively easy. Supply the CD with a rigid transform and we can inverse transform back into the SDF for CD. This should be as simple as applying the currently set geometries transform inverse to every point before sampling in the SDF for ImplicitGeometryToPointSetCD.
We can also do it for tetrahedral meshes by inversing the deformation of the tetrahedron.https://gitlab.kitware.com/iMSTK/iMSTK/-/issues/342Voronoi Based Static Collision Detection2021-07-25T22:22:58-04:00Andrew WilsonVoronoi Based Static Collision DetectionVoronoi's can be computed for static geometry, inversely mapped for rigid, or inverse transformed via tetrahedron deformation.
These can quickly give closest features during collision detection.Voronoi's can be computed for static geometry, inversely mapped for rigid, or inverse transformed via tetrahedron deformation.
These can quickly give closest features during collision detection.https://gitlab.kitware.com/iMSTK/iMSTK/-/issues/341Add Primitive Static Collision Detections2021-08-02T22:21:33-04:00Andrew WilsonAdd Primitive Static Collision DetectionsSurfaceMesh (most useful and difficult):
- [x] SurfaceMeshToSphereCD
- [x] SurfaceMeshToCapsuleCD
- Easiest of the surface mesh ones.
- [ ] SurfaceMeshToCylinderCD (involves both curved surface and sharp edges)
- [ ] SurfaceMeshToOrientedBoxCD
PointSet:
- [x] PointSetToCapsuleCD
- [x] PointSetToOrientedBoxCD
- [x] PointSetToPlaneCD
- [x] PointSetToSphereCD
- [ ] PointSetToCylinderCD (easiest, see sphere to cylinder CD as well as cylinder's signed distance function)
- Only produces single point contact. PointDirection for cylinder and PointIndexDirection for point.
TetrahedralMesh (less useful at the moment but easy):
- [ ] TetraToCylinderCD
- [ ] TetraToSphereCD
- [ ] TetraToSurfaceMeshCD
- [ ] TetraToCapsuleCD
- [ ] TetraToPlaneCD
- [x] TetraToPointSetCD
- [x] TetraToLineMeshCD
- Completed but doesn't handle the rare case of line completely embedded in the tetrahedron.
Mesh
- [x] MeshToMeshBruteForceCD (encompasses PointSet, SurfaceMesh, and LineMesh collision detection)
Primitive v Primitive (these tend to be less common in medical scenarios):
- [x] SphereToSphereCD
- [x] SphereToCylinderCD
- [x] BidirectionalPlaneToSphereCD
- [x] UnidirectionalPlaneToSphereCD
- [ ] CylinderToOrientedBoxCD
- [ ] CylinderToCylinderCD
... All other permutations ...
These can be added via unit tests (see existing CD unit tests). You don't need to implement them in some fancy simulation or verify against models, just check the CollisionData output. An accompanying example or interactive visual test for those complex ones might be useful. CollisionDataDebugObject may be used to draw contact, see BoxToBoxTest in Examples/CollisionDetection.
Do not add any spatial acceleration. That will be patterned out later for all CDs.
See CollisionUtils.h for a place to put all your collision/intersection functions. There are a number of existing basic ones provided: closest point on two lines. Closest point on triangle.
Various resources on collision detection:
- Real Time Collision Detection Book: http://www.r-5.org/files/books/computers/algo-list/realtime-3d/Christer_Ericson-Real-Time_Collision_Detection-EN.pdf
- Brief on Contact Manifolds: https://www.slideserve.com/gracej/contact-manifolds-powerpoint-ppt-presentation
- You may also refer to the documentation provided in the branch. Docs/Collision_Detection.rstSurfaceMesh (most useful and difficult):
- [x] SurfaceMeshToSphereCD
- [x] SurfaceMeshToCapsuleCD
- Easiest of the surface mesh ones.
- [ ] SurfaceMeshToCylinderCD (involves both curved surface and sharp edges)
- [ ] SurfaceMeshToOrientedBoxCD
PointSet:
- [x] PointSetToCapsuleCD
- [x] PointSetToOrientedBoxCD
- [x] PointSetToPlaneCD
- [x] PointSetToSphereCD
- [ ] PointSetToCylinderCD (easiest, see sphere to cylinder CD as well as cylinder's signed distance function)
- Only produces single point contact. PointDirection for cylinder and PointIndexDirection for point.
TetrahedralMesh (less useful at the moment but easy):
- [ ] TetraToCylinderCD
- [ ] TetraToSphereCD
- [ ] TetraToSurfaceMeshCD
- [ ] TetraToCapsuleCD
- [ ] TetraToPlaneCD
- [x] TetraToPointSetCD
- [x] TetraToLineMeshCD
- Completed but doesn't handle the rare case of line completely embedded in the tetrahedron.
Mesh
- [x] MeshToMeshBruteForceCD (encompasses PointSet, SurfaceMesh, and LineMesh collision detection)
Primitive v Primitive (these tend to be less common in medical scenarios):
- [x] SphereToSphereCD
- [x] SphereToCylinderCD
- [x] BidirectionalPlaneToSphereCD
- [x] UnidirectionalPlaneToSphereCD
- [ ] CylinderToOrientedBoxCD
- [ ] CylinderToCylinderCD
... All other permutations ...
These can be added via unit tests (see existing CD unit tests). You don't need to implement them in some fancy simulation or verify against models, just check the CollisionData output. An accompanying example or interactive visual test for those complex ones might be useful. CollisionDataDebugObject may be used to draw contact, see BoxToBoxTest in Examples/CollisionDetection.
Do not add any spatial acceleration. That will be patterned out later for all CDs.
See CollisionUtils.h for a place to put all your collision/intersection functions. There are a number of existing basic ones provided: closest point on two lines. Closest point on triangle.
Various resources on collision detection:
- Real Time Collision Detection Book: http://www.r-5.org/files/books/computers/algo-list/realtime-3d/Christer_Ericson-Real-Time_Collision_Detection-EN.pdf
- Brief on Contact Manifolds: https://www.slideserve.com/gracej/contact-manifolds-powerpoint-ppt-presentation
- You may also refer to the documentation provided in the branch. Docs/Collision_Detection.rsthttps://gitlab.kitware.com/iMSTK/iMSTK/-/issues/309Boundary Value Testing for CD2021-05-02T18:31:39-04:00Andrew WilsonBoundary Value Testing for CDMany intersection methods may be inclusive or exclusive. To keep them consistent we should add boundary value tests for them.Many intersection methods may be inclusive or exclusive. To keep them consistent we should add boundary value tests for them.