Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository tries to solve the following problem: given two domains (named I and J), find a map (represented by triangles) that minimises distortion. The particularity of this approach is that we allow ourselves to modify connectivity, as long as it is modified in both domains simultaneously, hence the naming co-triangulation.

In these examples, distortion is introduced by modifying an inner border inside only one domain (J).

The workflow consists of two steps that are repeated:

1 - This first step consists of a loop of two substeps :

a - Operations on the connectivity: Mesh repairing using edge flips, edge collapse and edge splits to avoid ill-shaped triangles that could crash the optimizer (see below). More specifically, triangle aspect ratios
    are the metric optimized in this substep.
    
b - Optimisation on the geometry: Map optimisation using LBFGS (https://en.wikipedia.org/wiki/Limited-memory_BFGS) (quasi-Newton) and the symmetric Dirichlet energy (https://en.wikipedia.org/wiki/Dirichlet_energy)

2 - Remeshing of the two domains using mmg2d :

a - metric is computed by triangle, then laplacian smoothed, clipped and adjusted in foresight in order to get around 5000 triangles at the end of step 2.b.

b - remesher is called, giving a triangulation of domain I, which induces a triangulation of domain J (using the old map to project points).

c - domain J is then untangled (https://hal.science/hal-03127350v2/file/Foldover_free___halversion.pdf)

This procedure was came up with by the following observation: the mesh is sometimes too "rigid" for step 1 to have any effect (see for example tests_out/side_by_side/full_rotation_before). No matter the amount of triangles allocated, the same "squary" structure arises from the untangler, and is a local minima extremely hard to get out of in terms of distortion. This means in effectivity, allowing the connectivity to change amounted to no real boost in high distortion situations, which was precisely the goal in the first place.

However in lower distortion scenari, it was observed that lowering the distortion led to a form of anisotropy (qualitatively), which gave the idea to remesh by extracting a metric. Fortunately, the library mmg2d is an industrial grade tool to achieve this exact step so there was no need to reinvent the wheel.

By looping over these two steps, the mesh becomes more flexible and the process can be iterated over for better results.

Unfortunately, mmg is very picky when it comes to input format, this explains the mess i made in main.cpp->run_tests with the successive saves and import, which would otherwise be extremely straigth-forward. The metric computation is handled in PairedTriangle.to_mmg()

PairedTriangles gives an interface to work with two domains and a connectivity at the same time, and the files also provides all kinds of useful functions to work with triangles, along with the untangler. The file is very long but the functions there are very straigth forward, and do exactly what expected. The only function worth reading is to_mmg(), the others won't give any insight on how the codebase works.

Overall i would consider this codebase poor in quality, the goal is only to expose the method, many naming conventions in particular around file handling were used to make debugging easy and are extremely obnoxious, they may be clarified in the future but it doesn't seem to me like this part is the most important.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages