Abstract representation of an implicit function function (not necessarily signed distance).
More...
|
| ImplicitFunction ()=default |
| Disallowed, use the full constructor.
|
|
virtual | ~ImplicitFunction ()=default |
| Destructor (does nothing)
|
|
virtual T | value (const Vec3T< T > &a_point) const noexcept=0 |
| Value function. Points are outside the object if value > 0.0 and inside if value < 0.0. More...
|
|
T | operator() (const Vec3T< T > &a_point) const noexcept |
| Alternative signature for the value function. More...
|
|
template<class BV > |
BV | approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const noexcept |
| Compute an approximation to the bounding volume for the implicit surface, using octrees. More...
|
|
template<class T>
class ImplicitFunction< T >
Abstract representation of an implicit function function (not necessarily signed distance).
The value function must be implemented by subclasses.
template<class T >
template<class BV >
BV ImplicitFunction< T >::approximateBoundingVolumeOctree |
( |
const Vec3T< T > & |
a_initialLowCorner, |
|
|
const Vec3T< T > & |
a_initialHighCorner, |
|
|
const unsigned int |
a_maxTreeDepth, |
|
|
const T & |
a_safety = 0.0 |
|
) |
| const |
|
inlinenoexcept |
Compute an approximation to the bounding volume for the implicit surface, using octrees.
This routine will try to compute a bonding using octree subdivision of the implicit function. This routine will characterize a cubic region in space as being 'inside', 'outside', or intersected by computing the value function at the center of the cube. If the value function is larger than the extents of the cube, we assume that there is no intersection inside the cube. The success of this algorithm therefore relies on the implicit function also being a signed distance function, or at the very least not being horrendously far from being an SDF. If octree subdivision fails, this will return the maximally representable bounding volume.
- Parameters
-
[in] | a_initialLowCorner | Initial low corner. |
[in] | a_initialHighCorner | Initial high corner. |
[in] | a_maxTreeDepth | Maximum permitted octree depth. |
[in] | a_safety | Safety factor when determining intersection. a_safety=1 sets safety factor to cube width, a_safety=2 sets twice the cube width, etc. |
- Note
- The bounding volume type BV MUST have a constructor BV(std::vector<Vec3T<T>>).