LIHPC-Computational-Geometry / HexMeshWorkshop

High-level interface for hex-meshing algorithms. WIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HexMeshWorkshop logo
🔄 Changelog📖 User documentation🧑‍💻 Developer documentation

High-level interface for hex-meshing algorithms.

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 independant, and offering to the user an object-oriented API on data folders like:

Auto-download the MAMBO dataset:
./import_MAMBO
  📂~/data
+   📁B0
+   📁B1
+   ...
+   📁S45
Tetrahedrization of M7 with Gmsh:
./Gmsh -i ~/data/M7 --mesh-size 0.2
  📂~/data
    📂M7
+     📂Gmsh_0.2
+       📄tet.mesh
+       📄surface.obj
coarse mesh of the M7 model
Hmm, I need a finer mesh...
./Gmsh -i ~/data/M7 --mesh-size 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.
./naive_labeling -i ~/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: ./labeling_painter -i ~/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: ./polycube_withHexEx -i ~/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?
./global_padding -i ~/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)
    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

Repository structure:

  • from_cli: scripts to interact with the database from the command line
  • from_python: scripts to interact with the database from Python
  • glue_code: pieces of code for other softwares
  • img: images displayed in the README
  • modules: Python modules internal to the project

About

High-level interface for hex-meshing algorithms. WIP

License:MIT License


Languages

Language:Python 99.4%Language:Lua 0.4%Language:Shell 0.2%