Lightweight C++ CPU-based voxelizer. Reads .stl files and outputs .csv point clouds for use with Paraview or other tools. No external dependencies required.
Based on the VoxSurf algorithm (three-pass rasterization with robust voting-based fill).
- Zero external dependencies (self-contained C++11)
- Binary STL input, CSV output
- Configurable voxel resolution
- Robust interior fill using majority voting from three orthogonal directions
- Optional coordinate scaling to match original STL dimensions
git clone https://github.com/alhermann/MyVox.git
cd MyVox
cmake -B build_cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build_cmakeThe executable will be at build_cmake/MyVox.
cd build
make clean && makeAdjust the compiler in build/Makefile if needed (clang++ for macOS, g++ for Linux).
./MyVox <input.stl> <output.csv> [resolution]input.stl- Path to a binary STL fileoutput.csv- Path for the CSV output (X,Y,Z columns)resolution- Voxel grid resolution (default: 128)
./MyVox ../sphere.stl output.csv 64cd build_cmake
ctest --output-on-failureThis runs unit tests for the math/data classes and an integration test that voxelizes sphere.stl.
cmake --install build_cmake --prefix /usr/local
