Voronizer turns any STL mesh into an airy, open-cell structure built from Voronoi struts. CUDA kernels voxelize the source model, seed a Voronoi diagram, and emit printable lattices for both the model interior and optional support scaffolding. The latest iteration focuses on hollow, strut-based Voronization—dial in shell thickness, strut diameters, and surface nets to produce lightweight foams straight from your GPU (or fall back to a CPU path when CUDA is unavailable).
- Open Voronoi foam: fill the model volume with struts or keep only a thin surface net.
- Per-feature control: independent parameters for model infill and support lattices (
MODEL_CELL,SUPPORT_CELL, thresholds, shells). - GPU-accelerated pipeline:
numba.cudakernels for voxelization, signed-distance evaluation, and Voronoi carving. - Debug + export tools: slice visualizer, raw voxel analysis, and mesh exporters for downstream cleanup.
- NVIDIA GPU + CUDA Toolkit (10.x or newer recommended). When CUDA is missing, Voronizer automatically falls back to a CPU implementation of the strut finder—expect noticeably longer runtimes on large grids (though tiny lattices can actually finish faster on CPU because they avoid CUDA launch/transfer overhead).
- Python 3.8+ with
numba,numpy,matplotlib,Pillow,scikit-imageinstalled.
pip install numba numpy matplotlib Pillow scikit-image
| Path | Purpose |
|---|---|
Input/ |
Demo STLs; add your own meshes here. |
Output/ |
Runtime export bucket (ignored by git). Meshes arrive as .ply. |
userInput.py |
All toggles: select STL, resolution, strut diameters, shell thickness, perforations, etc. |
main.py |
Pipeline driver: voxelize → Voronize → smooth → export. |
voxelize.py, voronize.py, Frep.py, SDF3D.py |
CUDA kernels and helpers for SDF + Voronoi math. |
visualizeSlice.py, analysis.py |
Optional helpers for debugging cross-sections and metrics. |
- Drop an STL in
Input/. - In
userInput.pysetFILE_NAME = "myMesh.stl"and tweak:RESOLUTION: grid density (start ~140 for testing).MODEL_CELL/SUPPORT_CELL: target Voronoi strut thickness in voxels.MODEL_THRESH/SUPPORT_THRESH: cell density. Larger = more points/struts.MODEL_SHELL: add a solid skin outside the lattice (keep0for fully open cells).NET = True+NET_THICKNESS: surface-only webbing.PERFORATE = True: drill holes through support cells for resin flushes.
- Run
python main.py. On systems without CUDA, the CPU fallback kicks in automatically; just budget extra time for the strut-finding phase (unless you’re experimenting on very small structures, where the CPU route can be quicker). - Collect
.plymeshes fromOutput/and, if necessary, post-process in MeshLab (clean non-manifold faces, apply HC-Laplacian smoothing).
- Balance
MODEL_CELLwithRESOLUTION: smaller voxels allow thinner struts without breakup. - For delicate lattices, keep
SMOOTH = Trueand considerAESTHETIC = Trueto remove internal clutter while keeping the outer foam. - Need two printable parts? Set
SEPARATE_SUPPORTS = Trueto emit model + supports independently. - Keep GPU memory headroom: if you see
CudaAPIError: cuMemcpyDtoH, dropRESOLUTIONor simplify the STL (MeshMixer → Simplification → 0.5 reduction works well).
- UnicodeDecodeError while loading STL → Re-export your mesh as a binary STL.
- Runtime exceeds minutes → Lower
RESOLUTION, decimate the mesh, and close other GPU-hungry apps. - Banding or chunky struts → Increase
SMOOTH_STEPSinmain.pyor run HC-Laplacian smoothing in MeshLab after export.
- Keep GPU kernels colocated with their host helpers (e.g., CUDA bits stay in
voxelize.py,Frep.py). - Add lightweight assertions/logging for new utilities so regressions surface quickly.
- Output directories (
Output/, caches,.ply) are ignored; please keep the repo clean of generated meshes.
Create, tweak, and print latticed art—happy Voronizing!