Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed distance calculation against concave triangle meshes #3220

Open
gizatt opened this issue Aug 23, 2016 · 6 comments
Open

Signed distance calculation against concave triangle meshes #3220

gizatt opened this issue Aug 23, 2016 · 6 comments
Assignees
Labels
component: geometry proximity Contact, distance, signed distance queries and related properties priority: low type: feature request

Comments

@gizatt
Copy link
Contributor

gizatt commented Aug 23, 2016

A feature I'm finding myself in great need of is the ability to call a function that operates like collisionDetectFromPoints, but on a concave mesh. Specifically, I need the ability to load in a mesh from a .obj file and query the shortest distance from a point to the surface of the mesh, with the distance having negative sign if the point is inside the mesh. (Having this functionality wrapped up to the level of a RigidBodyTree would be nice but not necessary.)

Before I go trying to twist the collision code to try to support this, is this feature in the roadmap / in progress by anyone? Any advice on a minimum-energy way to get this working?

@amcastro-tri maybe?

@amcastro-tri
Copy link
Contributor

We have now the capability to load static meshes. You can see a very simple test here.
We do not have yet the capability to do the same for dynamically moving triangle meshes. Usually we simplify concave geometries as the union of several convex geometries by having a link with several convex collision elements. That might be enough for your application as a simple workaround.

@RussTedrake
Copy link
Contributor

Related to #9779

@SeanCurtis-TRI
Copy link
Contributor

Refresh; we're still missing this. Even though we have partial support for Convex (e.g., interaction) we don't have support for signed distance to point.

One could hack it by registering a zero-radius sphere for the query point. and then calling QueryObject::ComputeSignedDistancePairClosestPoints(). But actual support for the primitive would be better.

@jwnimmer-tri jwnimmer-tri added component: geometry proximity Contact, distance, signed distance queries and related properties and removed unused team: robot locomotion group labels Apr 28, 2022
@calderpg-tri
Copy link
Contributor

This feature has come up again in the context of #14431, as parts of our collision checking pipeline require point signed distance queries and thus do not currently support mesh geometries. Specifically:

  1. The "MbpEnvironment" collision checker performs point signed distance queries against geometries belonging to the environment.
  2. The environment voxelizer uses point signed distance queries to build dense occupancy grids (in parallel, without having to use multiple contexts or add dummy geometry).

@xuchenhan-tri
Copy link
Contributor

We have the functionality to compute unsigned distance from a point to a triangular mesh (that's how we make hydro pressure fields for potentially non-convex meshes) here:

double CalcDistanceToSurfaceMesh(const Vector3<double>& p_WQ,

I would like to see QueryObject::ComputeSignedDistanceToPoint() to support all shapes. Right now support for Convex and Mesh is missing. The tricky part is doing in/out tests for .obj files, especially when there's no guarantee that the surface is even closed.

@DamrongGuoy
Copy link
Contributor

This is a relevant paper:
J.A. Baerentzen; H. Aanaes. Signed distance computation using the angle weighted pseudonormal. IEEE Transactions on Visualization and Computer Graphics ( Volume: 11, Issue: 3, May-June 2005)

They use angle-weighted pseudonormals of the closest features (vertex, edge, or triangle) to do in/out tests with the assumption that we have vertex-to-triangle and edge-to-triangle information. (It doesn't work with triangle soups.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: geometry proximity Contact, distance, signed distance queries and related properties priority: low type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants