CONTEXT

To simulate physical phenomena like heat propagation, the meshes we use must meet certain criteria to ensure relevant results, including to not self intersect or watertightness for example. But When given a mesh it can be visualy fine but with some problems inside:

mesh with issue
Figure 1. Image of a mesh with issue [1]

The Kinetic project want to be able to repair error in mesh like this one automaticly by using Different Algorithms from CGAL [2] For example the mesh above would result in this:

mesh fixed
Figure 2. Image of the mesh repaired [1]

We want to be able to get the same type of result on a different type of mesh than they used. So we gonna need to study what kind of issue would come from using mesh we are using such as stl or msh.

1. Orientation issue

As I had already been using the Kinetic algorithm for a previous project over the years, I had encountered some issues with the algorithm. We noticed that the mesh needed to meet certain criteria to produce results that accurately represented the mesh. One of the main issues was the orientation of the mesh. The mesh needed to be outwardly oriented, and each point required an associated normal vector. To test this, I tried applying the Kinetic algorithm on some basic elements like a cube. I used Gmsh to define a initial cube without considering the orientation of the faces. After that, I tried to create a better cube, and in the end, I used a CGAL function to orient the mesh. Here are the results in order:

Table 1. Cube mesh after Kinetic algorithm

Image 1

Image 2

Image 3

Cube non oriented

Cube badly oriented

Cube oriented by CGAL

We can see that if one face is badly oriented, it will result in incorrect normals, causing problems in the generation of the faces. Some faces might not even be generated. One of my first tasks was to try to fix this issue by performing some preprocessing on the different meshes I had.

2. Self intersection issue

Another issue we can takle is if the mesh has too much self intersection, the algorithm would end up with a segmantation fault, with the error following: ERROR in Linear_cell_complex_incremental_builder_3: try to use a same oriented edge twice.

Here an example of self interect mesh i experiments first :

Table 2. Cube mesh before and after Kinetic Algorithm

Image 1

Image 2

Image 3

Image 4

two cubes intersecting

two cubes intersecting a third one

three cube intersecting each other

five cube randomly intersecting each other

Result : Image 5

Error

Error

Error

Only the two cubes self intersecting worked out, the result is the merge between the outward bound of the two cube and the removal of the inner "wall" between the 2 cubes.