Tiny CLI to voxelize a GLB mesh on CPU and emit the same files your CUDA tool produces:
name_128.json—{ "blocks": { "1":[255,255,255] }, "xyzi":[[x,y,z,1], ...] }name_position.json—[ { "translation":[ox,oy,oz], "origin":[0,0,0] } ]
Uses a solid triangle voxelizer with the hard-coded 3D Tiles cube (46×38×24 scaled by 1.3).
- JDK 17+
- Maven 3.8+
(On Windows/WSL: build in the project directory; running from WSL is fine.)
mvn -q -DskipTests clean packageBuild artifact: target/voxelizer-cli-1.0.0-all.jar
# basic
java -jar target/voxelizer-cli-1.0.0-all.jar \
-f /path/to/tile.glb -s 128 -o out -3dtiles -v
# multiple files
java -jar target/voxelizer-cli-1.0.0-all.jar \
-f a.glb -f b.glb -f c.glb -s 128 -o out -3dtiles
# from a list (one GLB path per line)
java -jar target/voxelizer-cli-1.0.0-all.jar \
-filelist tiles.txt -s 128 -o out --no-3dtiles-f <path>Add a GLB file (repeatable)-filelist <txt>Text file with one GLB path per line-s <grid>Grid size (default128)-o <dir>Output directory (default./out)-3dtiles/--no-3dtilesEnable/disable 3D Tiles cube bounds (default on)-vVerbose logs-hHelp
For each input name.glb, you’ll get in <out>:
name_<grid>.jsonname_position.json
# optional: compare only geometry (ignores color palette)
jq '.xyzi | sort_by(.[0],.[1],.[2])' out_cpu/name_128.json > cpu.xyzi.json
jq '.xyzi | sort_by(.[0],.[1],.[2])' out_cuda/name_128.json > gpu.xyzi.json
diff -u gpu.xyzi.json cpu.xyzi.jsonThat’s it!