Open jdumas opened 6 years ago
Hi Jeremie,
Your initial mesh is a cube mesh with 2 triangles per faces?
In fact, Mmg computes the local Hausdorff (and not the global one):
if this distance is too large, we insert points onto the curve bezier triangle (on the linked picture, the initial straight triangle is in grey, the bezier triangle is dashed, we insert points because the Hausdorff distance is too large and we obtain the triangles in red)
I think that the 0.21 value is the maximal distance between the faces of the initial cube and the final mesh, so the global Hausdorff distance, am I right?
In your case, because the automatic detection of sharp angles is disabled, Mmg "smooth" the geometry according to the normal at vertices that it computes (from the normal at the triangles sharing the vertex) and as you have very few triangles per cube faces, this normal is far from the normal at the cube faces. With sharp angles, Mmg computes 2 normals per point (one for each surface that the sharp angle delimits) so the cube geometry keeped.
To conclude, in your case, you have 2 solutions:
Thanks for the detailed explanation.
How can we provide ridges to mmg?
In fact I stumbled upon this issue when trying to remesh the Ford engine model. The cylindrical holes are made of long thin triangles, and I'm seeing bulges inside the holes, even with sharp angle detection enabled. I think mmgs should subdivide triangles until a certain edge length is reached before attempting to remesh using local Hausdorff distance maybe? I mean I could also look into doing this preprocessing myself and see if it helps.
Because of the coarse initial mesh, the surface reconstruction of Mmg is very sensitive to the ridges detection. To give the ridges to Mmg :
If you know it, you can also provide the normals at vertices to Mmg:
Ok thanks! Any suggestion how to deal with the long triangles in the cylinders of the ford engine model? Would providing correct ridges and vertex-averaged normals on non-feature vertices would be enough to get a good remeshed surface? How does mmg numbers the edges of the mesh? Do I need to explicitly call MMG3D_Set_edge
and then call MMG3D_Set_ridge
with the same number? If I provide vertex normals with MMG3D_Set_normalAtVertex
, will mmgs recompute one normal per incident triangle for vertices on a ridge?
Just for reference, here is the result I'm getting if I try to remesh the Ford engine model from Thingiverse, as linked above:
I just merged duplicated vertices from the .stl, saved as .mesh, and called mmgs
with default parameters on it.
Hi Jeremie,
You made a good point, in fact, providing the vertex averaged normals on non feature vertices is exactly what Mmg computes so the result will be pretty similar. And for now, Mmg always computes its own normals at ridges points so you don't have any way to provide it. But I think that it can be useful to add it (I am not sure about when it can be done but I add it to my todo list).
Having the suitable ridges will strongly help Mmg (see the attached picture) but it seems to not be sufficient. I am not sure why but Mmg still corrupt the geometry in some specific areas.
To provide ridges, yes, you must explicitly call MMG3D_Set_edge and then MMG3D_Set_ridge with the edge index.
How did you generate the above screenshot then? By changing the angle threshold for ridge detection?
Oh yes, sorry: I use the increase the sensitivity for the sharp edge detection -ar 15 option (just to check that having all the ridges of the cylinder helps). Of course, in consequences, I have some spurious ridges.
Ok I see. Not completely satisfactory since it still mess up the geometry somehow. Please let me know if you ever find out why.
Just a note that -- unsurprisingly -- this problem also happens with mmg3d. Here is an example using default ridges in red. The result is over-refined in region where the ridge detection missed the transition to the flat regions. This creates some unwanted bump, although not as bad as on the previous example.
If you're interested let me know and I can upload the input tet mesh.
Hi Jeremie,
Thank you for the feedback. Yes, it is not suprising that missing some ridges leads to introduce a bunp in the surface: Mmg thinks that the surface is smooth so it computes the normals at vertices taking into account the 2 surfaces that in fact are shared by a sharp angle.
But I am still not sure of what happens here, because in this case, it seems that we have all the ridges but we still destroy the surface.
Regards,
Algiane
Hi Algiane,
MMGS messes up the geometry and causes bulging effect in curved areas with high aspect ratio triangles. Is there a solution or work around for this issue? What is the root cause of the problem? I can help resolve the issue.
Regards,
Paresh
Hi Paresh,
The bulging effect may have several causes:
Do note hesitate to create a new post around this issue and to attach your input mesh, I can try to see what happens...
Regards, Algiane
Algiane , thank you for your message. I'll create an issue and attach a simple sample model. Thanks!
Hi,
I'm observing a weird bulging effect with mmgs's surface remeshing. If I take a unit cube and remesh it with the default option, without angle detection (
-nr -hausd 0.01
), I get the following result:Measuring the Hausdorff distance with the original cube gives me a value of 0.21, which is super large compared to the requested one (0.01). Any idea what went wrong? How is mmg ensuring the Hausdorff distance during the remeshing?