geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
Dilated< Shape > Class Template Reference

A wrapper shape which dilates the extents of another Shape. More...

#include <geomc/shape/Dilated.h>

Inheritance diagram for Dilated< Shape >:
Convex< Shape::elem_t, Shape::N, Dilated< Shape > > Projectable< Shape::elem_t, Shape::N, Dilated< Shape > > Bounded< Shape::elem_t, N, Dilated< Shape > > SdfEvaluable< Shape::elem_t, N, Dilated< Shape > > Dimensional< Shape::elem_t, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 
typedef Shape::elem_t 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.
 
Rect< T, Nbounds () const
 
Vec< Shape::elem_t, Nclip (Vec< Shape::elem_t, N > p) const
 Nearest point on the interior of the shape.
 
bool contains (Vec< T, N > p) const
 Point containment test.
 
point_t convex_support (point_t d) const
 Geometric convex support function.
 
Vec< T, Nconvex_support (Vec< T, N > d) const
 
bool intersects (const Convex< Shape::elem_t, N, Shape > &other) const
 Convex shape overlap test.
 
Vec< T, Nnormal (Vec< T, N > p) const
 
bool operator== (const Dilated &other) const
 
Vec< T, Nproject (Vec< T, N > p) const
 Orthogonally project p to the surface of this shape.
 
T sdf (Vec< T, N > p) const
 Signed distance function.
 

Static Public Member Functions

static constexpr bool admits_cusps ()
 

Public Attributes

T dilation
 Dilation distance; a nonnegative number.
 
Shape shape
 Un-dilated shape.
 

Static Public Attributes

static constexpr size_t N = Shape::N
 The dimension of this Shape.
 

Related Symbols

(Note that these are not member symbols.)

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 Shape>
Dilated< Shape > dilate (const Shape &s, typename Shape::elem_t dilation)
 Dilate the shape s by the amount dilation.
 
template<typename T, index_t N>
Sphere< T, Ndilate (const Sphere< T, N > &s, T dilation)
 Dilate the Sphere s by the amount dilation.
 
template<typename T, index_t N>
Plane< T, Ndilate (Plane< T, N > p, T dilation)
 Dilate the Plane p by the amount dilation.
 
template<typename T, index_t N>
Dilated< Hollow< Sphere< T, N > > > shell (const Sphere< T, N > &s, T thickness)
 Create a spherical shell with wall thickness thickness around the Sphere s.
 
template<typename T, index_t N>
Dilated< Hollow< Sphere< T, N > > > shell (Vec< T, N > center, T r0, T r1)
 Create a spherical shell around center, with inner and outer radii r0 and r1.
 

Detailed Description

template<typename Shape>
class geom::Dilated< Shape >

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.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Member Function Documentation

◆ clip()

Vec< Shape::elem_t, N > clip ( Vec< Shape::elem_t, N > p) const
inlineinherited

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.

◆ convex_support()

point_t convex_support ( point_t d) const
inlineinherited

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.

Parameters
dDirection along which to find a support plane.
Returns
A point on the surface of this convex shape.

◆ intersects()

bool intersects ( const Convex< Shape::elem_t, N, Shape > & other) const
inlineinherited

Convex shape overlap test.

Returns
True if and only if this convex shape overlaps other; false otherwise.

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