OpenVDB  9.0.1
Namespaces | Functions
Primitives.h File Reference

Generates volumetric primitives, e.g. sphere, torus etc, as NanoVDB grid. More...

#include "GridBuilder.h"

Go to the source code of this file.

Namespaces

 nanovdb
 

Functions

template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createLevelSetSphere (ValueT radius=100, const Vec3< ValueT > &center=Vec3< ValueT >(0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="sphere_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a narrow-band level set of a sphere. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createFogVolumeSphere (ValueT radius=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0f, double halfWidth=3.0f, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a sparse fog volume of a sphere such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the sphere to 1 at the halfWidth and interior of the sphere. More...
 
template<typename ValueT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > createPointSphere (int pointsPerVoxel=1, ValueT radius=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0f, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_points", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
 Returns a handle to a PointDataGrid containing points scattered on the surface of a sphere. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createLevelSetTorus (ValueT majorRadius=100.0f, ValueT minorRadius=50.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a narrow-band level set of a torus in the xz-plane. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createFogVolumeTorus (ValueT majorRadius=100.0f, ValueT minorRadius=50.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="torus_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a sparse fog volume of a torus in the xz-plane such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the torus to 1 at the halfWidth and interior of the torus. More...
 
template<typename ValueT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > createPointTorus (int pointsPerVoxel=1, ValueT majorRadius=100.0f, ValueT minorRadius=50.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, const Vec3d &origin=Vec3d(0.0f), const std::string &name="torus_points", ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())
 Returns a handle to a PointDataGrid containing points scattered on the surface of a torus. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createLevelSetBox (ValueT width=40.0f, ValueT height=60.0f, ValueT depth=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a narrow-band level set of a box. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createFogVolumeBox (ValueT width=40.0f, ValueT height=60.0f, ValueT depth=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a sparse fog volume of a box such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the box to 1 at the halfWidth and interior of the box. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createLevelSetOctahedron (ValueT scale=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a narrow-band level set of a octahedron. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createFogVolumeOctahedron (ValueT scale=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a sparse fog volume of an octahedron such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the octahedron to 1 at the halfWidth and interior of the octahedron. More...
 
template<typename ValueT = float, typename VoxelT = ValueT, typename BufferT = HostBuffer>
GridHandle< BufferT > createLevelSetBBox (ValueT width=40.0f, ValueT height=60.0f, ValueT depth=100.0f, ValueT thickness=10.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="bbox_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())
 Returns a handle to a narrow-band level set of a bounding-box (= wireframe of a box) More...
 
template<typename ValueT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > createPointBox (int pointsPerVoxel=1, ValueT width=40.0f, ValueT height=60.0f, ValueT depth=100.0f, const Vec3< ValueT > &center=Vec3< ValueT >(0.0f), double voxelSize=1.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_points", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
 Returns a handle to a PointDataGrid containing points scattered on the surface of a box. More...
 
template<typename ValueT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > createPointScatter (const NanoGrid< ValueT > &srcGrid, int pointsPerVoxel=1, const std::string &name="point_scatter", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
 Given an input NanoVDB voxel grid this methods returns a GridHandle to another NanoVDB PointDataGrid with points scattered in the active leaf voxels of in input grid. More...
 

Detailed Description

Generates volumetric primitives, e.g. sphere, torus etc, as NanoVDB grid.

Author
Ken Museth
Date
June 26, 2020
Note
This has no dependency on openvdb.