Voxelizes or uniformly samples a mesh at a given voxel_size
using a face-splitting algorithm. Classy Voxelizer is designed to correctly handle meshes where each point in the underlying cloud is associated to a (semantic) class, either by its color or a label property.
A mesh (source: ScanNet) where each point's color represents a semantic class.
color
: for meshes where a point's color associates it to a (semantic) class.labels
: for meshes containing a 'label' attribute per pointnone
: for meshes where color attributes represent the actual appearance of that point
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
./classy_voxelizer <input_filename> <output_filename> <voxel_size> <class_mapping> <voxelize>
The voxelize
flag (true/false) specifies whether the output cloud shall contain points representing empty-space (a voxelization) or only points lying in occupied space (a uniform sampling).
- Reads ASCII/binary PLY, writes binary PLY (thanks to tinyply)
- <voxel_size> argument in meters
- Requires Eigen3