Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::geometry::dist3d::HexahedronDistance< FloatType > Class Template Reference

Signed distance function for a hexahedron (cuboid) in 3D space. More...

#include <distance.hpp>

Inheritance diagram for vulpes::geometry::dist3d::HexahedronDistance< FloatType >:
[legend]
Collaboration diagram for vulpes::geometry::dist3d::HexahedronDistance< FloatType >:
[legend]

Public Member Functions

 HexahedronDistance (const Point< FloatType, 3 > &corner_a, const Point< FloatType, 3 > &corner_b)
 Constructor for the hexahedron distance function.
void operator() (const Point< FloatType, 3 > &point, FloatType *distance_buffer) const
 Compute the signed distance between a point and the hexahedron.
std::array< Point< FloatType, 3 >, 2 > bbox () const
 Get the bounding box of the hexahedron.
void operator() (const Point< FloatType, Dim > &point, FloatType *distance_buffer) const
 Evaluate the distance function for the given point.

Static Public Member Functions

static constexpr size_t size ()
 Get the size of the distance buffer for this distance function.

Static Public Attributes

static constexpr bool is_leaf = true
 A flag indicating that this is a leaf node in a composite expression. Indeed we give an explicit formula to compute the distance.

Private Attributes

const Point< FloatType, 3 > m_corner_a
 Smallest corner of the hexahedron.
const Point< FloatType, 3 > m_corner_b
 Largest corner of the hexahedron.

Detailed Description

template<typename FloatType>
class vulpes::geometry::dist3d::HexahedronDistance< FloatType >

Signed distance function for a hexahedron (cuboid) in 3D space.

This class computes the signed distance between a point and a hexahedron defined by two corner points.

Template Parameters
FloatTypeThe type of floating-point value.

Constructor & Destructor Documentation

◆ HexahedronDistance()

template<typename FloatType>
vulpes::geometry::dist3d::HexahedronDistance< FloatType >::HexahedronDistance ( const Point< FloatType, 3 > & corner_a,
const Point< FloatType, 3 > & corner_b )
inline

Constructor for the hexahedron distance function.

Parameters
corner_asmallest corner.
corner_blargest corner.

Member Function Documentation

◆ bbox()

template<typename FloatType>
std::array< Point< FloatType, 3 >, 2 > vulpes::geometry::dist3d::HexahedronDistance< FloatType >::bbox ( ) const
inline

Get the bounding box of the hexahedron.

Returns
The bounding box as an array of two points.

◆ operator()() [1/2]

template<typename FloatType>
void vulpes::geometry::dist3d::HexahedronDistance< FloatType >::operator() ( const Point< FloatType, 3 > & point,
FloatType * distance_buffer ) const
inline

Compute the signed distance between a point and the hexahedron.

Parameters
pointThe point for which the distance is to be computed.
distance_bufferThe buffer where the computed distances will be stored.

◆ operator()() [2/2]

void vulpes::geometry::DistanceExpression< FloatType, Dim, HexahedronDistance< FloatType > >::operator() ( const Point< FloatType, Dim > & point,
FloatType * distance_buffer ) const
inlineinherited

Evaluate the distance function for the given point.

This function computes the signed distance between a point and the shape defined by the Distance type. The result is stored in the provided distance_buffer.

Parameters
pointThe point for which the distance needs to be computed.
distance_bufferThe buffer where the computed distances will be stored.

◆ size()

template<typename FloatType>
constexpr size_t vulpes::geometry::dist3d::HexahedronDistance< FloatType >::size ( )
inlinestaticconstexpr

Get the size of the distance buffer for this distance function.

Returns
The size of the buffer (6 for the sides + 1 for self).

Member Data Documentation

◆ is_leaf

template<typename FloatType>
bool vulpes::geometry::dist3d::HexahedronDistance< FloatType >::is_leaf = true
staticconstexpr

A flag indicating that this is a leaf node in a composite expression. Indeed we give an explicit formula to compute the distance.

◆ m_corner_a

template<typename FloatType>
const Point<FloatType, 3> vulpes::geometry::dist3d::HexahedronDistance< FloatType >::m_corner_a
private

Smallest corner of the hexahedron.

◆ m_corner_b

template<typename FloatType>
const Point<FloatType, 3> vulpes::geometry::dist3d::HexahedronDistance< FloatType >::m_corner_b
private

Largest corner of the hexahedron.


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