TETRA is an open-source pipeline for exporting and importing volumetric tetrahedral meshes from Blender to Unity (or other engines), built on top of the tetrahedralization plugin by Matthias Müller – Ten Minute Physics.
This repository provides:
- A tetrahedralization plugin for Blender
- A
.tetrafile format exporter - A Unity-compatible format and importer for use in simulations or visualization
- Format documentation and example meshes
- Generate volumetric tetrahedral meshes directly in Blender
- Export to
.tetra: a clean, human-readable format - Coordinate system conversion (Blender → Unity)
- Unity importer to load
.tetrafiles as assets - Easy integration with simulations, rendering, or analysis
git clone https://github.com/marcobuttiglione/tetra.gitIn Blender:
-
Open Edit > Preferences > Add-ons
-
Click Install...
-
Select the following files from the
blender/folder:BlenderTetPlugin.py(tetrahedral mesh generation)tetra_exporter.py(exports to.tetraformat)
-
Enable both add-ons from the list
-
Select a mesh in Object Mode
-
Use Shift + A > Mesh > Add Tetrahedralization
-
Adjust resolution and quality parameters, then confirm
-
With the resulting mesh selected, go to:
File > Export > Tetrahedral Mesh (.tetra) -
Choose a destination and export
The Unity importer (TetraImporter.cs) reads .tetra files and converts them into ScriptableObject assets of type TetrahedralMeshAsset, which contain:
- Vertex coordinates
- Tetrahedra vertex indices
- Automatically extracted edge indices
These can be used for simulations, visualizations, or custom mesh processing.
The .tetra format is a simple text-based format with two main elements:
v x y z # defines a vertex
t i j k l # defines a tetrahedron by 0-based vertex indices
# Vertices
v 0.0 0.0 0.0
v 1.0 0.0 0.0
v 0.0 1.0 0.0
v 0.0 0.0 1.0
# Tetrahedra
t 0 1 2 3See docs/format_spec.md for full specification.
/blender/
BlenderTetPlugin.py - Tetrahedral mesh generation
tetra_exporter.py - .tetra format exporter
/docs/
format_spec.md - File format documentation
/examples/
test_mesh.tetra - Example .tetra mesh file
/unity/
TetraImporter.cs - Unity asset importer
TetrahedralMeshAsset.cs - ScriptableObject asset structure
README.md
LICENSE
This project is based on the work of:
Matthias Müller – Ten Minute Physics YouTube: Ten Minute Physics Original plugin: BlenderTetPlugin.py
Included under the MIT License.
This project is released under the MIT License.
See the LICENSE file for details.
Contributions are welcome! Feel free to open issues or pull requests to:
- Improve Blender or Unity integration
- Extend the
.tetraformat - Add support for metadata, regions, or visualization tools