template<typename FloatType, int32_t Dim, typename Distance>
class vulpes::geometry::DistanceExpression< FloatType, Dim, Distance >
Template class representing a generic signed distance expression.
This template class defines the interface for various distance functions via CRTP. It provides static methods and operators to calculate the distance between a given point and a shape, and to compute the bounding box (bbox) of that shape. The distance expression keeps in "memory" the distances with each shape it is composed of (e.g. in the intersection of a rectangle and a circle the output distance gives the distance with respect to each segment of the rectangle and the circle)
- Template Parameters
-
| FloatType | The type of floating-point value (e.g., float, double). |
| Dim | The dimensionality of the space (e.g., 2D or 3D). |
| Distance | The specific distance function that will be used (e.g., RectangleDistance, CircleDistance). |
template<typename FloatType, int32_t Dim, typename Distance>
Get the size of the distance buffer required for this expression.
This method delegates to the size() method of the Distance type. E.g. a rectangle will need a buffer of 4 to save the distance with respect to each side, plus one that is the distance with respect itself.
- Returns
- The size of the distance buffer.