The geom_voxelizer utility generates a voxelized geometry from a DIRSIG scene.
Conceptually, a voxelized grid is simply a regularly spaced array of boxes. This utility checks whether any of the scene geometry falls within a given box and marks the box as being either occupied or unoccupied. Such voxelized geometry output can be fed in to external models. A sample output is shown in the following screen grab:
Lower extent: [18.2867, 16.5155, 66.2077]
Upper extent: [28.2867, 36.5155, 86.2077]
DeltaX: 10
DeltaY: 10
DeltaZ: 10
0 6 7 1
0 7 7 1
0 8 7 1
0 9 7 1
0 10 7 1
... ... ... ...
... ... ... ...
... ... ... ...
... ... ... ...
108 99 6 1
108 100 6 1
108 101 6 1
108 102 6 1
108 103 6 1
The first five lines of output show the parameters under which the voxelized grid was constructed. Each of the data lines has three columns for indicating the voxel index (x,y,z counting from 0) and one column for indicating the absence (``0'') or presence (``1'') of geometry Optionally, the output of empty voxels can be suppressed.
This program is part of the DIRSIG4 distribution.