A powerful, high-performance Python application and library for generating, visualizing, and exporting customizable radially symmetrical gyroid structures and converting arbitrary 3D STL volumes into gyroid lattices for 3D printing and industrial design.
- Interactive GUI: Intuitive dual-mode graphical interface (Parametric Gyroid & STL Volume Infill) with real-time PyVista 3D viewport.
- STL Volume Gyroidization: Import any closed 3D STL model and convert its internal volume into a porous gyroid lattice structure.
- Command Line Interface (
pyroid-cli): Scriptable CLI supporting parametric generation, STL conversion, preset loading, offscreen rendering, and mesh stats. - Powered by
uv: Ultra-fast dependency resolution, environment isolation, and project execution usinguv. - Type-Safe Data Models: Powered by strongly-typed
GyroidParamsandSTLConversionParamsdataclasses. - Automated Mesh Repair: Watertight validation, hole filling, and optional planar surface trimming/capping ready for direct slicing and 3D printing.
- Export Options: Export high-quality STL or OBJ meshes.
- uv (install via
pip install uvorpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex")
-
Clone the repository:
git clone https://github.com/tazomatalax/pyroid.git cd pyroid -
Sync Virtual Environment:
uv venv uv sync --all-extras
Launch the dual-tab GUI using uv:
uv run main.py
# Or using entry point:
uv run pyroid-
Tab 1 (Parametric Gyroid): Adjust dimensions (
$a, b, c$ ), inner/outer radii, wall thickness, cell scaling, and preset configurations. - Tab 2 (STL to Gyroid Volume): Select an external STL file, configure unit cell pitch (mm) and wall thickness, and convert its volume into a gyroid lattice structure.
uv run pyroid-cli --output my_gyroid.stl --preset thick_walls --res 100uv run pyroid-cli --input-stl model.stl --output gyroid_model.stl --cell-size 5.0 --wall-thickness 0.5uv run pyroid-cli --input-stl input.stl --output out.stl --render screenshot.png --print-statspyroid/
├── pyroid/
│ ├── core.py # Main GyroidGenerator class & math pipeline
│ ├── models.py # GyroidParams & STLConversionParams dataclasses
│ ├── mesh_utils.py # STL loading, volumetric ray containment, watertight repair
│ ├── cli.py # Command Line Interface (pyroid-cli)
│ └── gui.py # PyQt5 dual-mode GUI & PyVistaQt interactor
├── tests/ # Automated pytest test suite
├── AGENTS.md # Developer & AI Agent contribution guide
├── pyproject.toml # Modern PEP 621 package metadata & uv overrides
├── uv.lock # Deterministic uv lockfile
└── main.py # Entry point launcher
Run the test suite using uv:
uv run pytest -vLicensed under the MIT License - see LICENSE for details.
