Hexmachina
Hexahedral meshing based on 'SRF' approach.
Install / Use
/learn @dnkrtz/HexmachinaREADME
Hex Machina
Python implementation of the SRF approach to hexahedral meshing. (Work in Progress)

TODO
- The final volume parametrization step is not working (linear mixed-integer CG).
- Edge collapse adjustments need to be implemented.
- Move numerical optimizations to CUDA.
- Back-propagation to compute gradients in L-BFGS, hopefully improve runtime.
- Maybe run additional smoothing on surface cross-field.
Algorithm
Inputs : Triangle mesh as .stl (binary)
Given an input triangle mesh, a tetrahedral mesh is generated (using TetGen) and its boundary surface is extracted. The vertex-based curvatures and normals of the boundary surface are computed, as well as other topological information. A 3D frame is initialized at the centroid of each tetrahedron. The frame field smoothness is optimized by minimizing a non-linear energy function, solved using the efficient L-BFGS method. Moreover, some case-by-case adjustments are made to ensure the field is singularity-restricted. After the optimization, a volume parametrization is fit to the framefield as an atlas of linear maps defined on the vertices, using a CG (Conjuate Gradient) method. The hexahedral mesh is extracted based on the integer isosurface intersections.
Outputs: Saved to disk as .vtk files, which can be viewed in Paraview. This includes tetrahedral mesh, curvature cross-field, optimized 3D frame field, singular graph and the hexahedral mesh.
State of the Art
A non-exhaustive list of papers that inspired this implementation.
Volume parametrization
- All-Hex Meshing using Singularity-Restricted Field
- CubeCover - Parameterization of 3D Volumes
- Boundary Aligned Smooth 3D Cross-Frame Field
Boundary parametrization
- General Planar Quadrilateral Mesh Design Using Conjugate Direction Field
- QuadCover - Surface Parameterization using Branched Coverings
- Estimating Curvatures and Their Derivatives on Triangle Meshes
- Trivial Connections on Discrete Surfaces
Dependencies
Python 3, and set up other dependencies with:
pip install requirements.txt
Related Skills
node-connect
337.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
