USD -> SDF: polygon triangulation#819
Merged
ahcorde merged 5 commits intoahcorde/usd/prototype_mainfrom Jan 18, 2022
Merged
Conversation
Signed-off-by: Teo Koon Peng <koonpeng@openrobotics.org>
7 tasks
Author
|
|
Signed-off-by: Teo Koon Peng <koonpeng@openrobotics.org>
… koonpeng/polygon-triangulation
ahcorde
requested changes
Jan 13, 2022
Collaborator
ahcorde
left a comment
There was a problem hiding this comment.
I think something is wrong here.
- I modified the
gearjoint.usdinsideIssacSimand I removed everything expect one of the cylinders and I saved this world - Then I converted this saved world with the
sdfconverterand I get the following shape:
If we forget for a moment the transformations, the mesh is not rendered properly.
Author
Author
Signed-off-by: Teo Koon Peng <koonpeng@openrobotics.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



🎉 New feature
Summary
This implements the
PolygonToTrianglesfunction using the fan-triangulation algorithm. Initially tried to implement delaunay triangulation based on ignition::common's implementation, but the implementation is a wrapper around gts's implementation, which does not support 3D.While researching a custom implementation, found out that there is a much simpler way using the fan-triangulation, it is not as robust as delaunay but it looks like a better fit for the use case of triangulating convex polygons. It seems like tools like blender also uses a form of fan-triangulation of these use cases and delaunay is more commonly used for more complex scenarios like generating terrains/heightmaps etc.
Test it
Currently tested with
GearJoint.usdin isaac sim's examples (should be able to find it with a file system search). It seems to work somewhat, but I'm not sure if the current output is due to bad triangulation or other bugs.usd:
sdf:
Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-bymessages.