cutdigital / mcut

A library for detecting and resolving intersections between two surface meshes.
https://cutdigital.github.io/mcut.site
Other
414 stars 76 forks source link

SEALING FRAGMENT missing faces #36

Closed Yourbee closed 10 months ago

Yourbee commented 11 months ago

image

image

https://drive.google.com/drive/folders/1CJBihfQMN4d1W9-JELtoK52jQ6msenDr?usp=drive_link

Yourbee commented 11 months ago

when this happened, MC_DISPATCH_FILTER_FRAGMENT_LOCATION_ABOVE | MC_DISPATCH_FILTER_FRAGMENT_SEALING_OUTSIDE get the SEALING FRAGMENT inside.

Normally MC_DISPATCH_FILTER_FRAGMENT_LOCATION_ABOVE | MC_DISPATCH_FILTER_FRAGMENT_SEALING_INSIDE get get the SEALING FRAGMENT inside

chitalu commented 11 months ago

Hi @Yourbee,

The file(s) cannot be accessed without permission. A publicly accessible link is required.

Alternatively, you may attached the file(s) here if it is small enough.

Yourbee commented 11 months ago

Hi @Yourbee,

The file(s) cannot be accessed without permission. A publicly accessible link is required.

Alternatively, you may attached the file(s) here if it is small enough.

OK, the file zip is here mcut test data.zip

chitalu commented 10 months ago

Hi @Yourbee

The problem is due to the fact that your input mesh "solid.obj" has faces with a reversed winding order (CW instead of CCW). That is your faces indices are reversed. This is probably because "solid.obj" was an output fragment of a preceeding mcDispatch call.

Fragments that are "below" and sealed from the "outside" shall always have a reversed winding order w.r.t the input source-mesh. Refer to #8 for a gist on how MCUT computes the output. And then refer to this tutorial on how to request face indices with reversed winding order for such fragments.

That should address your problem.

For reference here is your original mesh (view in MeshLab) image

And here is the one after flipping the winding order (i.e. reversing the normals) image