v3d.h File Reference
Interface for r3d voxelization routines. More...
#include "r3d.h"
Go to the source code of this file.
Functions | |
void | r3d_voxelize (r3d_poly *poly, r3d_dvec3 ibox[2], r3d_real *dest_grid, r3d_rvec3 d, r3d_int polyorder) |
Voxelize a polyhedron to the destination grid. More... | |
void | r3d_clamp_ibox (r3d_poly *poly, r3d_dvec3 ibox[2], r3d_dvec3 clampbox[2], r3d_rvec3 d) |
Get the minimal box of grid indices for a polyhedron, given a grid cell spacing, also clamping it to a user-specified range while clipping the polyhedron to that range. More... | |
void | r3d_get_ibox (r3d_poly *poly, r3d_dvec3 ibox[2], r3d_rvec3 d) |
Get the minimal box of grid indices for a polyhedron, given a grid cell spacing. More... | |
Detailed Description
Interface for r3d voxelization routines.
- Date
- 15 October 2015
Function Documentation
◆ r3d_clamp_ibox()
Get the minimal box of grid indices for a polyhedron, given a grid cell spacing, also clamping it to a user-specified range while clipping the polyhedron to that range.
- Parameters
-
[in] poly The polyhedron for which to calculate the index box and clip. [in,out] ibox Minimal range of grid indices covered by the polyhedron. [in,out] clampbox Range of grid indices to which to clamp and clip ibox
andpoly
, respectively.[in] d The cell spacing of the grid. The origin of the grid is assumed to lie at the origin in space.
◆ r3d_get_ibox()
Get the minimal box of grid indices for a polyhedron, given a grid cell spacing.
- Parameters
-
[in] poly The polyhedron for which to calculate the index box. [out] ibox Minimal range of grid indices covered by the polyhedron. [in] d The cell spacing of the grid. The origin of the grid is assumed to lie at the origin in space.
◆ r3d_voxelize()
void r3d_voxelize | ( | r3d_poly * | poly, |
r3d_dvec3 | ibox[2], | ||
r3d_real * | dest_grid, | ||
r3d_rvec3 | d, | ||
r3d_int | polyorder | ||
) |
Voxelize a polyhedron to the destination grid.
- Parameters
-
[in] poly The polyhedron to be voxelized. [in] ibox Minimum and maximum indices of the polyhedron, found with r3d_get_ibox()
. These indices are from a virtual grid starting at the origin.[in,out] dest_grid The voxelization buffer. This grid is a row-major grid patch starting at d*ibox[0]
and ending atd*ibox[1]. Must have size of at least
(ibox[1].i-ibox[0].i)*(ibox[1].j-ibox[0].j)*(ibox[1].k-ibox[0].k)*R3D_NUM_MOMENTS(polyorder)`.[in] d The cell spacing of the grid. [in] polyorder Order of the polynomial density field to voxelize. 0 for constant (1 moment), 1 for linear (4 moments), 2 for quadratic (10 moments), etc.