Loading...
Searching...
No Matches
Primitives.h File Reference

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

`#include <nanovdb/NanoVDB.h>`
`#include "CreateNanoGrid.h"`
`#include <nanovdb/util/ForEach.h>`

Go to the source code of this file.

## Namespaces

namespace | nanovdb

## Macros

#define | NANOVDB_PARALLEL_PRIMITIVES

## Functions

template<typename BuildT = float, typename BufferT = HostBuffer>

enable_if< is_same< float, BuildT >::value||is_same< double, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(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, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a sphere.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< Fp4, BuildT >::value||is_same< Fp8, BuildT >::value||is_same< Fp16, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(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, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="sphere_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createFogVolumeSphere (double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, 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.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeSphere (double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, 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())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointSphere (int pointsPerVoxel=1, double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, 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.
template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), 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, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a torus in the xz-plane.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), 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())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, 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.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointTorus (int pointsPerVoxel=1, double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), 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.
template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), 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, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a box.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), 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, 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.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createLevelSetOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), 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, const BufferT &buffer=BufferT())
| Returns a handle to a narrow-band level set of a octahedron.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createFogVolumeOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), 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, 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.
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBBox (double width=40.0, double height=60.0, double depth=100.0, double thickness=10.0, const Vec3d &center=Vec3d(0.0), 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, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a bounding-box (= wireframe of a box)
template<typename BuildT, typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBBox (double width=40.0, double height=60.0, double depth=100.0, double thickness=10.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="bbox_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointBox (int pointsPerVoxel=1, double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), 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.
template<typename SrcBuildT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > | createPointScatter (const NanoGrid< SrcBuildT > &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. Note, the coordinates of the points are encoded as blind data in world-space.

## 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.

## Macro Definition Documentation

## NANOVDB_PARALLEL_PRIMITIVES

#define NANOVDB_PARALLEL_PRIMITIVES