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

is_convex test returns False for convex hull #2337

Open
CallumDev opened this issue Jan 1, 2025 · 1 comment
Open

is_convex test returns False for convex hull #2337

CallumDev opened this issue Jan 1, 2025 · 1 comment

Comments

@CallumDev
Copy link

When running blender's Convex Hull operator on a suzanne mesh, the produced mesh does not pass the is_convex check provided by trimesh.

Model:
convexsuzanne.zip

@mikedh
Copy link
Owner

mikedh commented Jan 2, 2025

Hey, it looks like for that mesh the mesh.face_adjacency_projections, or the distance above or below a the plane of a neighboring face's single unshared vertex, aren't all "behind" the face which is what mesh.is_convex is checking:

m.face_adjacency_projections

TrackedArray([ 0.        , -0.        ,  0.02009677,  0.        ,
               0.        , -0.02154504, -0.00532035, -0.00532035,
               0.00834819,  0.00472029,  0.00834819,  0.00472029,
               0.00555775,  0.00555775,  0.        , -0.01748563,
               0.00760465,  0.00760465,  0.01668299,  0.00616435,
              -0.00877761, -0.00877761, -0.02231488, -0.00184682,
              -0.0177285 , -0.00184682])

Looking at the mesh with the "bad" faces shaded red it kind of looks like that modifier might be taking the convex hull of some "potato chip" quads, and then the triangulation is done after the hull resulting in a non-convex triangular output? Here's the notebook I was playing with.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants