OpenVDB: ClosestSurfacePoint< GridT > Class Template Reference

OpenVDB 12.0.1 |

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ClosestSurfacePoint< GridT > Class Template Reference

Accelerated closest surface point queries for narrow band level sets. More...

`#include <openvdb/tools/VolumeToSpheres.h>`

## Public Types
using | Ptr = std::unique_ptr<ClosestSurfacePoint>
using | TreeT = typename GridT::TreeType
using | BoolTreeT = typename TreeT::template ValueConverter<bool>::Type
using | Index32TreeT = typename TreeT::template ValueConverter<Index32>::Type
using | Int16TreeT = typename TreeT::template ValueConverter<Int16>::Type

## Public Member Functions
bool | search (const std::vector< Vec3R > &points, std::vector< float > &distances)
| Compute the distance from each input point to its closest surface point.
bool | searchAndReplace (std::vector< Vec3R > &points, std::vector< float > &distances)
| Overwrite each input point with its closest surface point.
const Index32TreeT & | indexTree () const
| Tree accessor.
const Int16TreeT & | signTree () const
| Tree accessor.

## Static Public Member Functions
template<typename InterrupterT = util::NullInterrupter>
static Ptr | create (const GridT &grid, float isovalue=0.0, InterrupterT *interrupter=nullptr)
| Extract surface points and construct a spatial acceleration structure.

## Detailed Description

template<typename GridT>
class openvdb::v12_0::tools::ClosestSurfacePoint< GridT >

Accelerated closest surface point queries for narrow band level sets.

Supports queries that originate at arbitrary world-space locations, is not confined to the narrow band region of the input volume geometry.

## Member Typedef Documentation

## ◆ BoolTreeT

template<typename GridT>

using BoolTreeT = typename TreeT::template ValueConverter<bool>::Type

## ◆ Index32TreeT

template<typename GridT>

using Index32TreeT = typename TreeT::template ValueConverter<Index32>::Type

## ◆ Int16TreeT

template<typename GridT>

using Int16TreeT = typename TreeT::template ValueConverter<Int16>::Type

## ◆ Ptr

template<typename GridT>

using Ptr = std::unique_ptr<ClosestSurfacePoint>

## ◆ TreeT

template<typename GridT>

using TreeT = typename GridT::TreeType

## Member Function Documentation

## ◆ create()

template<typename GridT>
template<typename InterrupterT>

ClosestSurfacePoint< GridT >::Ptr create | ( | const GridT & | grid,
|  | float | isovalue = 0.0,
|  | InterrupterT * | interrupter = nullptr )
| static

Extract surface points and construct a spatial acceleration structure.

Returns
  a null pointer if the initialization fails for any reason, otherwise a unique pointer to a newly-allocated ClosestSurfacePoint object.

Parameters

  grid | a scalar level set or fog volume
  isovalue | the voxel value that determines the surface of the volume The default value of zero works for signed distance fields, while fog volumes require a larger positive value (0.5 is a good initial guess).
  interrupter | pointer to an object adhering to the util::NullInterrupter interface.

## ◆ indexTree()

template<typename GridT>

const Index32TreeT & indexTree | ( |  | ) | const
| inline

Tree accessor.

## ◆ search()

template<typename GridT>

bool search | ( | const std::vector< Vec3R > & | points,
|  | std::vector< float > & | distances )

Compute the distance from each input point to its closest surface point.

Parameters

  points | input list of points in world space
  distances | output list of closest surface point distances

## ◆ searchAndReplace()

template<typename GridT>

bool searchAndReplace | ( | std::vector< Vec3R > & | points,
|  | std::vector< float > & | distances )

Overwrite each input point with its closest surface point.

Parameters

  points | input/output list of points in world space
  distances | output list of closest surface point distances

## ◆ signTree()

template<typename GridT>

const Int16TreeT & signTree | ( |  | ) | const
| inline

Tree accessor.