geomc 1.0
A c++ linear algebra template library
|
A wrapper shape which dilates the extents of another Shape. More...
#include <geomc/shape/Dilated.h>
Public Types | |
typedef Shape::elem_t | T |
The coordinate type of this Shape. | |
typedef PointType< Shape::elem_t, N >::point_t | point_t |
typedef T | elem_t |
The coordinate type of this shape. | |
Public Member Functions | |
Dilated () | |
Wrap a default-constructed Shape with zero dilation. | |
Dilated (const Shape &s) | |
Wrap s with zero dilation. | |
Dilated (const Shape &s, T dilation) | |
Dilate s by the amount dilation . | |
bool | contains (Vec< T, N > p) const |
Point containment test. | |
T | sdf (Vec< T, N > p) const |
Signed distance function. | |
Vec< T, N > | convex_support (Vec< T, N > d) const |
Rect< T, N > | bounds () const |
Vec< T, N > | project (Vec< T, N > p) const |
Orthogonally project p to the surface of this shape. | |
point_t | convex_support (point_t d) const |
Geometric convex support function. More... | |
bool | intersects (const Convex< Shape::elem_t, N, Shape > &other) const |
Convex shape overlap test. More... | |
T | sdf (Vec< T, N > p) const |
Signed distance function. More... | |
Vec< Shape::elem_t, N > | normal (Vec< Shape::elem_t, N > p) const |
Unit-length outward-facing direction. More... | |
Vec< Shape::elem_t, N > | clip (Vec< Shape::elem_t, N > p) const |
Nearest point on the interior of the shape. More... | |
bool | contains (Vec< T, N > p) const |
Shape-point overlap test. More... | |
Public Attributes | |
Shape | shape |
Un-dilated shape. | |
T | dilation |
Dilation distance; a nonnegative number. | |
Static Public Attributes | |
static constexpr size_t | N = Shape::N |
The dimension of this Shape. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Shape > | |
Dilated< Shape > | dilate (const Shape &s, typename Shape::elem_t dilation) |
Dilate the shape s by the amount dilation . | |
template<typename Shape > | |
Dilated< Shape > | dilate (const Dilated< Shape > &s, typename Shape::elem_t dilation) |
Dilate the shape s by the amount dilation . | |
template<typename T , index_t N> | |
Plane< T, N > | dilate (Plane< T, N > p, T dilation) |
Dilate the Plane p by the amount dilation . More... | |
template<typename T , index_t N> | |
Sphere< T, N > | dilate (const Sphere< T, N > &s, T dilation) |
Dilate the Sphere s by the amount dilation . More... | |
A wrapper shape which dilates the extents of another Shape.
The shape is the one that would result by placing a sphere of radius dilation
at every point on the surface of the un-dilated shape.
It is not valid to construct a shape with a negative dilation.
Dilated shapes can be constructed with the convenience function dilate()
, which has overrides for certain shapes that are innately dilatable.
Nearest point on the interior of the shape.
If p
is on the interior of the shape, return p
unaltered; otherwise orthogonally project p
to the shape's surface.
|
inlineinherited |
Shape-point overlap test.
Return true
if the point p
is on the surface or interior of the shape, false
otherwise.
Geometric convex support function.
Returns the point on the surface of this convex shape that is furthest along direction d
(i.e., has the highest dot product with d
).
All shapes which implement this function automatically support geometrical intersection tests with any other Convex object.
d | Direction along which to find a support plane. |
Convex shape overlap test.
other
; false otherwise. Unit-length outward-facing direction.
For any point, return the direction which points directly away from the nearest point on the shape, away from its interior.
This should be the same as the gradient of the sdf().
Signed distance function.
Compute a signed distance to the nearest surface point on the shape. Points on the exterior have positive value; points on the interior have negative value; surface points have sdf value 0.