Skip to content

LIHPC-Computational-Geometry/dds-hexmeshing

Repository files navigation

dds-hexmeshing


Semantic data folders (dds) for hexahedral mesh generation


🔄 Changelog📖 Documentation

Instead of having:

  • a local data folder in each code repo (and a total mess inside each of them),
  • to remember the command line interface of each executable (please, don't learn them by heart),
  • to include other algorithms in your repo to compare them (adding dependencies and slipping towards enormous repos),

this project make it possible to keep each algorithm small and independent, and offering to the user an object-oriented API on data folders like, for a polycube-based hexahedral mesh generation:

Auto-download the MAMBO dataset:
./dds.py run import_MAMBO ~/data
  📂~/data
+   📁B0
+   📁B1
+   ...
+   📁S45
Tetrahedrization of M7 with Gmsh:
./dds.py run Gmsh ~/data/M7 characteristic_length_factor=0.2
  📂~/data
    📂M7
+     📂Gmsh_0.2
+       📄tet.mesh
+       📄surface.obj
coarse mesh of the M7 model
Hmm, I need a finer mesh...
./dds.py run Gmsh ~/data/M7 characteristic_length_factor=0.05
  📂~/data
    📂M7
      📁Gmsh_0.2
+     📂Gmsh_0.05
+       📄tet.mesh
+       📄surface.obj
fine mesh of the M7 model
Alright. I wonder what the naive labeling looks like.
./dds.py run naive_labeling ~/data/M7/Gmsh_0.05
  📂~/data
    📂M7
      📁Gmsh_0.2
      📂Gmsh_0.05
+       📂naive_labeling
+         📄surface_labeling.txt
        📄tet.mesh
        📄surface.obj
naive labeling computed on the tetrahedral mesh
Okay, it's not valid. Let me tweak the labeling by hand.
Sure: ./dds.py run labeling_painter ~/data/M7/Gmsh_0.05
  📂~/data
    📂M7
      📁Gmsh_0.2
      📂Gmsh_0.05
        📁naive_labeling
+       📂labeling_painter
+         📄surface_labeling.txt
        📄tet.mesh
        📄surface.obj
a labeling obtained with labeling_painter
Ho-ho! Can you extract a hex-mesh with libHexEx?
Indeed I can: ./dds.py run polycube_withHexEx ~/data/M7/Gmsh_0.05/labeling_painter
  📂~/data
    📂M7
      📁Gmsh_0.2
      📂Gmsh_0.05
        📁naive_labeling
        📂labeling_painter
+         📂polycube_withHexEx_1.0
+           📄hex.mesh
          📄surface_labeling.txt
        📄tet.mesh
        📄surface.obj
hexmesh obtained with polycube_withHexEx
Fantastic!! Can you also apply a global padding? 🥺
You know I'm just a Python script, right?
./dds.py run global_padding ~/data/M7/Gmsh_0.05/labeling_painter/polycube_withHexEx_1.0
  📂~/data
    📂M7
      📁Gmsh_0.2
      📂Gmsh_0.05
        📁naive_labeling
        📂labeling_painter
          📂polycube_withHexEx_1.0
+           📂global_padding
+             📄hex.mesh
            📄hex.mesh
          📄surface_labeling.txt
        📄tet.mesh
        📄surface.obj
hexmesh post-processed with a global padding

File format conversions required by some algorithms are automatic.

Overview of the data subfolder types (boxes) and the wrapped algorithms (arrows):

graph LR
    step(step)
    stl(stl)
    tet-mesh(tet-mesh)
    labeling(labeling)
    hex-mesh(hex-mesh)
    step -- Gmsh --> tet-mesh
    tet-mesh -- naive_labeling --> labeling
    tet-mesh -- labeling_painter --> labeling
    tet-mesh -- graphcut_labeling --> labeling
    tet-mesh -- evocube --> labeling
    tet-mesh -- automatic_polycube --> labeling
    tet-mesh -- HexBox --> hex-mesh
    tet-mesh -- AlgoHex --> hex-mesh
    tet-mesh -- marchinghex --> hex-mesh
    labeling -- polycube_withHexEx --> hex-mesh
    labeling -- robustPolycube --> hex-mesh
    hex-mesh -- global_padding --> hex-mesh
    hex-mesh -- inner_smoothing --> hex-mesh
    stl -- MG-Tetra --> tet-mesh
Loading

Repository structure: