![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Represents the union of two signed distance functions. More...
#include <distance.hpp>
Public Member Functions | |
| UnionDistance (D1 const &u, D2 const &v) | |
| Constructor for the union distance function. | |
| void | operator() (const Point< FloatType, Dim > &point, FloatType *distance_buffer) const |
| Compute the signed distance between a point and the union of two shapes. | |
| std::array< Point< FloatType, Dim >, 2 > | bbox () const |
| Get the bounding box of the union of two shapes. | |
Static Public Member Functions | |
| static constexpr size_t | size () |
| Get the size of the distance buffer for this union operation. | |
Static Public Attributes | |
| static constexpr bool | is_leaf = false |
Private Attributes | |
| std::conditional_t< D1::is_leaf, const D1 &, const D1 > | m_u |
| std::conditional_t< D2::is_leaf, const D2 &, const D2 > | m_v |
Represents the union of two signed distance functions.
This class computes the signed distance between a point and the union of two shapes, where the distance to the union is defined as the minimum of the distances to the individual shapes.
| FloatType | The type of floating-point value. |
| Dim | The dimensionality of the space (e.g., 2D or 3D). |
| D1 | The first distance function (e.g., RectangleDistance, CircleDistance). |
| D2 | The second distance function. |
|
inline |
Constructor for the union distance function.
| u | The first distance function. |
| v | The second distance function. |
|
inline |
Get the bounding box of the union of two shapes.
The bounding box of the union is the box that encompasses both shapes.
|
inline |
Compute the signed distance between a point and the union of two shapes.
The distance is the minimum of the distances to the two shapes.
| point | The point for which the distance is to be computed. |
| distance_buffer | The buffer where the computed distances will be stored. |
|
inlinestaticconstexpr |
Get the size of the distance buffer for this union operation.
The size is the sum of the sizes of the individual distance buffers for D1 and D2.
|
staticconstexpr |
|
private |
The first distance function. If it is concrete we just need a reference, otherwise we copy the expression.
|
private |
The second distance function. If it is concrete we just need a reference, otherwise we copy the expression.