Closed cohnt closed 4 days ago
FYI: I checked the geometry in the file test.obj with one of my CAD programs.
It displayed something strange -- picture attached.
It also displays NAN for inertia properties.
If the geometry is poorly formed, perhaps we could issue a better error message?
I've confirmed that fixing the direction of the faces no longer leads to an error. New test.obj
attached below.
Having a better error message would be very helpful in this case -- I would have never thought that having faces in the wrong direction would lead to inertia errors.
g test
v 0.000000 0.000000 0.500000
v 0.000000 0.000000 -0.500000
v 0.000000 1.000000 0.500000
v 0.000000 1.000000 -0.500000
v 1.000000 0.000000 0.500000
v 1.000000 0.000000 -0.500000
f 1 5 3
f 2 4 6
f 1 3 2
f 2 3 4
f 3 5 4
f 4 5 6
f 5 1 6
f 6 1 2
@cohnt PR #21929 is meant to produce a better error message. Feel free to provide guidance or comments here or there. As of now, the error message is something like: "CalcSpatialInertia(): The calculated volume of a triangle surface mesh is 0 whereas a reasonable positive value was expected. The mesh may have bad geometry, e.g., the winding (order of the vertices) of some faces do not produce outward normals."
Yes, that error message is very helpful. Thank you!
What happened?
I have a single obj model that I'm trying to load into the world, but I'm getting the following error message when I process the associated model directives:
I tried printing out the matrix whose eigenvalues were being computed, and all entries were
nan
.This gist has a simple reproduction of the bug.
Version
No response
What operating system are you using?
No response
What installation option are you using?
No response
Relevant log output
No response