'\" t
.\"     Title: VOXELIZE
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 04/13/2022
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "VOXELIZE" "nged" "04/13/2022" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
voxelize \- Takes as input a primitive or a collection of primitives ,\fIold_obj\fR, and creates a region \fI new_obj\fR which is the collection of voxels(RPPs) approximating the \fIold_obj\fR\&.
.SH "SYNOPSIS"
.HP \w'\fBvoxelize\fR\ 'u
\fBvoxelize\fR [[\-d] | {n}] [[\-s] | {"%s\ %s\ %s"}] [[\-t] | {f}] {\fInew_obj\ old_obj\fR} [\fIold_obj1\ old_obj2\ \&.\&.\&.\fR]
.SH "DESCRIPTION"
.PP
Takes as input a primitive or a collection of primitives ,\fIold_obj\fR, and creates a region
\fI new_obj\fR
which is the collection of voxels(RPPs) approximating the
\fIold_obj\fR\&. The
\fI\-d\fR
option specifies the level of detail(precision in approximation of volume) required\&. An argument of n means that n * n rays will be shot through each row, and an approximation of volume filled in each voxel region is reached averaging these n * n values\&. The
\fI\-s\fR
option lets the user specify the voxel size in each direction\&. The
\fI\-t\fR
option specifies the threshold volume to decide if voxel is to be included in the voxelized output\&. The threshold should always be a value between 0 and 1\&.
.SH "EXAMPLES"
.PP
The following example shows the use of the
\fBvoxelize\fR
command to create a voxelized version of an existing object (\fIold_object\fR) and naming the output(\fInew_object\fR)\&.
.PP
\fBExample\ \&1.\ \&Create a voxelized version of an existing primitive or collection.\fR
.PP
mged> \fBvoxelize \-d 2 \-s "0\&.5 0\&.5 0\&.5" \-t 0\&.3 newregion\&.r oldregion\&.r \fR
.RS 4
Creates a voxelized region corresponding to the original region
\fIoldregion\&.r\fR\&.
.sp
The region
\fInewregion\&.r\fR
consists of the resulting voxels\&.
.sp
The
\fI\-d 2\fR
option means that 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 of these four rays\&.
.sp
\fI\-s "0\&.5 0\&.5 0\&.5" \fR
sets the size of the voxels as 0\&.5 units (user\*(Aqs choice of units) in each dimension\&.
.sp
\fI\-t 0\&.3 \fR
means that a voxel region is considered to be "filled" if the approximated volume of
\fIoldregion\&.r\fR
filling this voxel region is 30% of its total volume\&.
.RE
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
