Voxelize Mesh
Voxelize Mesh is the experimental twin — same inputs, rougher output
- mesh
- Voxel Block
Voxelize Mesh looks like a duplicate of Mesh To Voxel - same inputs, same VOXEL_BLOCK output, same category - but it's really the pack's second, rougher attempt at the same job. If you're new to this pack, my honest advice is to skip it and use Mesh To Voxel instead. This node exists because the author tried the VTK route first (or in parallel), and the code tells that story pretty clearly.
How it works
Where Mesh To Voxel does the voxelization with raw trimesh math, this one pulls in PyVista (pv.wrap(mesh) then pv.voxelize(surface, density=surface.length / 200)) to generate the voxel grid, then writes each resulting voxel point into the output block. The intent is the same: mesh in, cubic RGBA block out.
But read the loop closely and two things jump out:
- It doesn't scale the mesh into the grid first. It only keeps voxel points whose raw coordinates happen to fall inside
[0, voxel_size). Unless your mesh is already positioned and sized to land in that range, you'll get an empty block or one where only a corner of the mesh shows up. - It writes the voxel's x, y, z coordinates into the RGB channels -
voxel_grid[int(x), int(y), int(z)] = [x, y, z, 1.0]- not the mesh's colors. So the "colors" in the output are literally position values, which makes downstream previews look like noise and makes the whole RGBA contract of the pack meaningless for this node.
The density=surface.length / 200 heuristic is also a gamble. surface.length for a wrapped mesh isn't a robust measure of how fine the voxelization should be, so you get whatever that expression happens to produce. This is the "rough draft" part.
Inputs and outputs
- mesh (
MESH) - same trimesh object Mesh To Voxel expects. - voxel_size (
INT, default 20, 1–100) - the grid resolution, though as noted the node mostly ignores it for scaling and only uses it as a clipping bound.
Output is one Voxel Block (VOXEL_BLOCK), which you can wire into Voxel Viewer or Voxel Block Saver just like any other block.
The dependency catch
This is the one node in the pack with a heavy, separate dependency. PyVista drags in the whole VTK stack, which is a big install, and - like the rest of this pack - there's no requirements.txt to trigger it for you:
pip install pyvista
When would you actually use it?
Honestly, rarely. The color handling is broken (you get coordinates, not colors), the grid scaling is broken, and the dependency cost is the highest in the pack. The one scenario where it could make sense: if you're already running PyVista for something else and you want a VTK-style voxelization of a mesh that's already normalized into the target range, you can make it produce something - but for a beginner, the whole thing is a trap with no payoff. Mesh To Voxel gives you a working, color-preserving block with two light dependencies. Reach for that one.
And set your expectations: the whole pack is a single-commit, unmaintained experiment from late 2024. That's fine for the solid nodes. This one is the reason the pack has rough edges.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mesh | MESH | — | |
| voxel_size | INT | 201–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Voxel Block | VOXEL_BLOCK | — |