Difference between revisions of "MGED CMD voxelize"

From BRL-CAD
(Syntax)
(voxelize)
Line 32: Line 32:
  
 
==Example(s)==
 
==Example(s)==
 +
: '''mged>''' voxelize -d 2 -s "0.5 0.5 0.5" -t 0.3 newregion.r oldregion.r
 +
 +
 +
:: Gets voxels of existing object oldregion.r and calls the new object newregion.r.
 +
 +
:: -d 2 --- On each voxel row, 2*2(=4) rays are uniformly shot over the area and an approximation of the volume is reached from the raytrace data. Greater levels of detail give better approximations at the cost of more computations.
 +
 +
:: -s "0.5 0.5 0.5" --- This option specifies the size of the voxel in each direction (0.5 units in x, y and z directions in this example). The memory requirements increase with smaller voxels but the newregion.r is much a much better approximation to the oldregion.r
 +
 +
:: -t 0.3 --- This option gives the threshold above which the voxel region will be taken as "in", ie an RPP in the voxel region is made if the approximated volume in the voxel region is greater than 30%.
  
 
==See Also==
 
==See Also==

Revision as of 15:11, 15 August 2012

voxelize

Syntax

voxelize [-s \"dx dy dz\"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]

Argument(s)

-d
Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values
-s
Specifies the voxel size in each direction.
-t
Specifies the threshold volume to decide if voxel is to be included in the voxelized output.
new_object
Name for resultant primitive
old_object
Name of source primitive or collection.


Return Value(s)

None


Description

"voxelize" command takes as input a primitive or a collection (the "old object") and outputs a collection of RPPs(voxels) that approximate the old object.

The user can change the level of detail, the threshold for considering a voxel region to be "filled", and also the voxel size depending on how closely the new object should represent the old object.

Example(s)

mged> voxelize -d 2 -s "0.5 0.5 0.5" -t 0.3 newregion.r oldregion.r


Gets voxels of existing object oldregion.r and calls the new object newregion.r.
-d 2 --- On each voxel row, 2*2(=4) rays are uniformly shot over the area and an approximation of the volume is reached from the raytrace data. Greater levels of detail give better approximations at the cost of more computations.
-s "0.5 0.5 0.5" --- This option specifies the size of the voxel in each direction (0.5 units in x, y and z directions in this example). The memory requirements increase with smaller voxels but the newregion.r is much a much better approximation to the oldregion.r
-t 0.3 --- This option gives the threshold above which the voxel region will be taken as "in", ie an RPP in the voxel region is made if the approximated volume in the voxel region is greater than 30%.

See Also

No related commands.