EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
EBGeometry::PlaneSDF< T > Class Template Reference

Signed distance function for a plane. More...

#include <EBGeometry_AnalyticDistanceFunctions.hpp>

Inheritance diagram for EBGeometry::PlaneSDF< T >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::PlaneSDF< T >:
Collaboration graph
[legend]

Public Member Functions

 PlaneSDF ()=default
 Default constructor. Constructs the y = 0 plane with outward normal (0, 1, 0).
 
 PlaneSDF (const Vec3T< T > &a_point, const Vec3T< T > &a_normal) noexcept
 Full constructor.
 
 PlaneSDF (const PlaneSDF &)=default
 Copy constructor.
 
 PlaneSDF (PlaneSDF &&)=default
 Move constructor.
 
PlaneSDFoperator= (const PlaneSDF &)=default
 Copy assignment.
 
PlaneSDFoperator= (PlaneSDF &&)=default
 Move assignment.
 
 ~PlaneSDF () override=default
 Destructor.
 
signedDistance (const Vec3T< T > &a_point) const noexcept override
 Signed distance function for the plane.
 
- Public Member Functions inherited from EBGeometry::SignedDistanceFunction< T >
 SignedDistanceFunction ()=default
 Default constructor.
 
 ~SignedDistanceFunction () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept final
 Implementation of ImplicitFunction::value; delegates to signedDistance().
 
virtual Vec3T< T > normal (const Vec3T< T > &a_point, const T &a_delta) const noexcept
 Compute the outward normal using central finite differences.
 
- Public Member Functions inherited from EBGeometry::ImplicitFunction< T >
 ImplicitFunction ()=default
 Default constructor.
 
virtual ~ImplicitFunction ()=default
 Default destructor.
 
operator() (const Vec3T< T > &a_point) const noexcept
 Call operator — alternative signature for the value function.
 
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
 Compute an approximation to the bounding volume for the implicit surface using octree subdivision.
 

Protected Attributes

Vec3T< T > m_point = Vec3T<T>::zeros()
 Point on plane.
 
Vec3T< T > m_normal = Vec3T<T>(T(0), T(1), T(0))
 Plane normal vector (unit length).
 

Detailed Description

template<class T>
class EBGeometry::PlaneSDF< T >

Signed distance function for a plane.

The SDF evaluates to dot(a_point - m_point, m_normal): positive on the half-space the normal points into, negative on the opposite side. The plane itself is the zero level-set. m_normal must be unit length for the SDF to return a true distance; the full constructor normalizes the input automatically. By default the plane is the y = 0 plane with normal (0,1,0).

Template Parameters
TFloating-point precision.

Constructor & Destructor Documentation

◆ PlaneSDF() [1/2]

template<class T >
EBGeometry::PlaneSDF< T >::PlaneSDF ( )
default

Default constructor. Constructs the y = 0 plane with outward normal (0, 1, 0).

The default plane passes through the origin and separates y < 0 (negative SDF) from y > 0 (positive SDF).

◆ PlaneSDF() [2/2]

template<class T >
EBGeometry::PlaneSDF< T >::PlaneSDF ( const Vec3T< T > &  a_point,
const Vec3T< T > &  a_normal 
)
inlinenoexcept

Full constructor.

Parameters
[in]a_pointAny point on the plane.
[in]a_normalPlane normal vector (need not be unit length; it is normalized internally).

Member Function Documentation

◆ operator=() [1/2]

template<class T >
PlaneSDF & EBGeometry::PlaneSDF< T >::operator= ( const PlaneSDF< T > &  )
default

Copy assignment.

Returns
Reference to (*this).

◆ operator=() [2/2]

template<class T >
PlaneSDF & EBGeometry::PlaneSDF< T >::operator= ( PlaneSDF< T > &&  )
default

Move assignment.

Returns
Reference to (*this).

◆ signedDistance()

template<class T >
T EBGeometry::PlaneSDF< T >::signedDistance ( const Vec3T< T > &  a_point) const
inlineoverridevirtualnoexcept

Signed distance function for the plane.

Parameters
[in]a_pointPosition.
Returns
Signed distance from a_point to the plane; negative on the side opposite to the normal.

Implements EBGeometry::SignedDistanceFunction< T >.


The documentation for this class was generated from the following file: