STL model voxel

Hello, everyone. I am a novice. Does anyone know how to use octree algorithm to voxel STL model?

You can convert an STL model to voxel array using vtkPolyDataToImageStencil filter.