Difference between revisions of "MGED CMD voxelize"

From BRL-CAD
(voxelize)
m (Reverted edits by User000name (talk) to last revision by 14.139.128.11)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
==Syntax==
 
==Syntax==
:voxelize [-s \"dx dy dz\"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]
+
:voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]
  
 
==Argument(s)==
 
==Argument(s)==
Line 13: Line 13:
  
 
: '''-t'''
 
: '''-t'''
:: Specifies the threshold volume to decide if voxel is to be included in the voxelized output.
+
:: Specifies the threshold volume to decide if voxel is to be included in the voxelized output. It should be a value between 0 and 1(not in percentage).
  
: '''new_object'''
+
: '''new_obj'''
:: Name for resultant primitive
+
:: Name for resultant primitive that is a region containing the resulting voxels.
  
: '''old_object'''
+
: '''old_obj'''
 
:: Name of source primitive or collection.
 
:: Name of source primitive or collection.
 
  
 
==Return Value(s)==
 
==Return Value(s)==

Latest revision as of 16:40, 5 December 2017

voxelize[edit]

Syntax[edit]

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

Argument(s)[edit]

-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. It should be a value between 0 and 1(not in percentage).
new_obj
Name for resultant primitive that is a region containing the resulting voxels.
old_obj
Name of source primitive or collection.

Return Value(s)[edit]

None


Description[edit]

"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)[edit]

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[edit]

No related commands.