Skip to content

validity‐first‐polycube‐labeling

Sébastien Mestrallet edited this page Mar 1, 2025 · 4 revisions

https://github.com/LIHPC-Computational-Geometry/validity-first-polycube-labeling

To build and execute, see the README

Full, manual, hex-meshing pipeline

# tetrahedrization with Gmsh
# https://gmsh.info/
gmsh input.step -3 -format mesh -o tet.mesh -setnumber Mesh.CharacteristicLengthFactor 0.1
# extract the surface, triangle mesh & store the triangle-to-tetra map for later
./bin/extract_surface tet.mesh surface.obj surface_map.txt
# run the labeling algorithm
./bin/automatic_polycube surface.obj gui=false output=surface_labeling.txt
# generate the per-tetrahedron-facet labeling using the triangle-to-tetra map
./bin/volume_labeling surface_labeling.txt surface_map.txt volume_labelign.txt
# simple polycube parametrization then HexEx (Lyon et al. 2016)
# https://github.com/fprotais/polycube_withHexEx
polycube tet.mesh volume_labelign.txt hex.mesh 1.0

Graphical applications

Geogram provides the Application, SimpleApplication and SimpleMeshApplication classes.

On top of that, I created a SimpleMeshApplicationExt class in include/gui_base.h, to add:

  • An overlay with groups of points and groups of edges. All items in a group have the same color, and are displayed/hidden simultaneously.
  • A ColorArray class : a vector of colors that can be access both as floats (for ImGui) and as chars (for OpenGL textures).
  • A update_GL_texture() to update a texture at runtime
  • A pick() function to retrieve the vertex/edge/facet/cell under the cursor. See discussion #88 and pull request #102 in the Geogram repo.

My LabelingViewerApp (include/gui_labeling.h), my HexMeshViewerApp (app/hex_mesh_viewer.cpp) and my AreasToTiltApp (app/areas_to_tilt.cpp) inherit SimpleMeshApplicationExt.

LabelingViewerApp is itself the base of:

Labeling graph

Where the labeling (vector) only encode the per-facet labels, the labeling graph stores higher level information: charts (patches of adjacent facets having the same label), boundaries (successive edges between charts) and corners (vertices where boundaries meet).

I think the Evocube equivalent is in include/chart.h (updateCharts(), computeBoundaries()) and in include/labeling_individual.h (updateChartsAndTPs())

Data structure

TODO

Construction

TODO

Turning-points identification

TODO