Voxelization

voxelize module provides functions for voxelizing NURBS volumes. voxelize() also supports multi-threaded operations via multiporcessing module.

Function Reference

geomdl.voxelize.voxelize(obj, **kwargs)

Generates binary voxel representation of the surfaces and volumes.

Keyword Arguments:
  • grid_size: size of the voxel grid. Default: (16, 16, 16)
  • padding: voxel padding for in-outs finding. Default: 10e-8
  • use_mp: flag to activate multi-threaded voxelization. Default: False
  • num_procs: number of concurrent processes for multi-threaded voxelization. Default: 4
Parameters:obj (abstract.Surface or abstract.Volume) – input surface(s) or volume(s)
Returns:voxel grid and filled information
Return type:tuple
geomdl.voxelize.save_voxel_grid(voxel_grid, file_name)

Saves binary voxel grid as a binary file.

The binary file is structured in little-endian unsigned int format.

Parameters:
  • voxel_grid (list, tuple) – binary voxel grid
  • file_name (str) – file name to save