MmgTools / mmg

open source software for bidimensional and tridimensional remeshing

Home Page:http://www.mmgtools.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assert ( ps > 0. || ps2 > 0. && "Unexpected case") in `mmg3dBezierCP` / surface degeneracy

Algiane opened this issue · comments

Commit f57b861 adds an assertion on the fact that at least one of the projections of the 2 normals at a ridge point onto the normal at triangle is positive. This assertion fails on the attached mesh (where .txtextension has to be replaced by .mesh one) with commit 4883d1a and following command line :

mmg3d_debug -v 5 -noswap -nomove temp-with-ridges.mesh

temp-with-ridges.txt

First attempt to solve this issue shows that the bug is reproductible without collapses.
In this case, we see surface approximation degeneracy: triangle 12207 with vertices 15103 15104 15105 is splitted by surface patterns (anatets_iso) and point 23015 is inserted at an unexpected position.

Following picture shows initial mesh and some of inserted nodes (from left to right, nodes 23016 23015 23017). The shadows linked to the normals are disabled because smoothing hides the splitting issue (normals have probably suitable values).
Capture d’écran 2022-10-17 à 11 25 49

Next picture shows a more global vue of the mesh with input ridges (mesh has been generated from structural optimization and level-set discretization with ridge detection, which has produces some artifacts).
Capture d’écran 2022-10-17 à 11 26 09. The triangle that creates the issue has 1 regular point (15103) with one normal, 1 ridge point (15104) with 2 normals and one corner/required point (15105) without any normal.

Last picture shows normal at vertices (only the right mesh should be considered as input normals are erased along ridges). We can note that normals seems to have suitable values and that n1 should be used at point 15104 (it has been added by hand from gdb info inside this mesh for visualization purpose).
Capture d’écran 2022-10-17 à 12 39 39

Finally :

  • surface point 23015 can't be inserted along the built bezier edge because it creates bad oriented tetra (due to the ridge presence);
  • thus, point coordinates are computed using a dichotomy (see MMG3D_dichoto1) between "ideal point" and point at the middle of edge 15104 - 15103. Last valid parameter computed is t=0.4375.