Frequently, the mesh desired for MOC is coarse relative to the curvature of the geometry. This mean quadratic curves have a large curvature. The meshes generated by Gmsh can therefore sometimes have self-intersecting mesh faces.
Some insight into how this happens: Gmsh first creates a linear mesh, which has the correct topology. Then, the mesh is made quadratic by placing an additional vertex for each edge. These new vertices may lie on an entity's bounding curves, overlapping a linear edge of the same mesh element. See below for an example.
We can currently detect when self-intersection occurs, but make no effort to fix it. I think we should be able to fix self-intersection in cases like this by translating the quadratic vertex of the straight edge by a small amount.
Frequently, the mesh desired for MOC is coarse relative to the curvature of the geometry. This mean quadratic curves have a large curvature. The meshes generated by Gmsh can therefore sometimes have self-intersecting mesh faces.
Some insight into how this happens: Gmsh first creates a linear mesh, which has the correct topology. Then, the mesh is made quadratic by placing an additional vertex for each edge. These new vertices may lie on an entity's bounding curves, overlapping a linear edge of the same mesh element. See below for an example.
We can currently detect when self-intersection occurs, but make no effort to fix it. I think we should be able to fix self-intersection in cases like this by translating the quadratic vertex of the straight edge by a small amount.