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

Regarding the self-intersecting mesh limitation #2

Closed
Modeuser opened this issue Jan 20, 2022 · 5 comments
Closed

Regarding the self-intersecting mesh limitation #2

Modeuser opened this issue Jan 20, 2022 · 5 comments

Comments

@Modeuser
Copy link

Would anyone happen to know what kind of error message unity would display if I tried to slice a mesh with a self-intersecting/non-closed mesh? Just wanted to check if an issue I've been having is due to this limitation.

@dgreenheck
Copy link
Owner

There won’t be any error. The triangulation algorithm which fills in the new faces will simply produce unexpected results. Can you post a screenshot of the issue? It’s also worth checking over your model in a 3D modeling app like Blender to verify there isn’t any problematic geometry. Unfortunately, I don’t know of a way to automatically detect if a mesh has self-intersecting or open geometry.

@TheScabbage
Copy link

The 3D printing addon for blender is good for checking these kinds of mesh properties. It can automatically select degenerate or overlapping faces, and check whether the mesh is manifold.

To detect an open mesh:

  • merge all duplicate verts
  • ensure every edge is used by exactly 2 faces

I'm not sure of a performant way to find self intersecting meshes though.

@dgreenheck
Copy link
Owner

dgreenheck commented Jan 21, 2022

@Modeuser FYI, here is a paper for triangulation of self-intersecting polygons: FIST: Fast Industrial Strength Triangulation of Polygons. It also appears to be faster than Sloan's algorithm (the algorithm used in OpenFracture) for most scenarios.

I initially used this paper but had issues extending it to handle polygons with holes. It's a much more complex algorithm with multiple phases and recovery modes. I ended up pivoting and switching to Sloan's algorithm I did because it does not need to handle special edge cases which I felt was a better approach to keep things more robust. I figured most meshes are closed and can easily be modified to avoid self-intersecting geometry.

@Modeuser
Copy link
Author

@dgreenheck Here's the error message I'm getting:

fragment error with obj file

Some context:

I adapted your script for the new input system and various XR interactions, so far it's working great with most of my mesh files (.fbx).

But when I tried to slice a recently added .obj file, nothing happens and this error message gets reported in the Unity debugger.

@dgreenheck
Copy link
Owner

@Modeuser Set a breakpoint on that line. Your mesh is likely missing UVs.

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

3 participants