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

Selects the boundary of a shape. More...

#include <geomc/shape/Hollow.h>

Inheritance diagram for Hollow< Shape >:
Projectable< Shape::elem_t, Shape::N, Hollow< Shape > > SdfEvaluable< Shape::elem_t, N, Hollow< Shape > >

Public Types

using elem_t = typename Shape::elem_t
 
using T = elem_t
 

Public Member Functions

 Hollow ()
 Wrap a default-constructed shape with the identity transform.
 
 Hollow (const Shape &shape)
 Wrap a shape with a similarity transform.
 
Rect< T, N > bounds () const
 Compute the axis-aligned bounding box of the shape.
 
Vec< T, N > clip (Vec< T, N > p) const
 Nearest point on the interior of the shape to p; the same as project(p), since hollow shapes do not have an interior.
 
bool contains (typename Shape::point_t p) const
 Shape-point intersection test. Always returns false, because hollow shapes are infinitely thin.
 
bool contains (Vec< Shape::elem_t, N > p) const
 Shape-point overlap test.
 
measure_boundary () const
 Measure the boundary (surface area) of the shape.
 
Vec< T, N > normal (Vec< T, N > p) const
 Normal vector at point p.
 
bool operator== (const Hollow &other) const
 Shape equality test.
 
Vec< T, N > project (Vec< T, N > p) const
 Project a point to the surface of this shape.
 
sdf (Vec< T, N > p) const
 Signed distance function.
 

Static Public Member Functions

static constexpr bool admits_cusps ()
 

Public Attributes

Shape shape
 Solid shape.
 

Static Public Attributes

static constexpr index_t N = Shape::N
 

Related Symbols

(Note that these are not member symbols.)

template<typename Shape, Transform< typename Shape::elem_t, Shape::N > Xf>
Hollow< Shape > operator* (const Xf &xf, const Hollow< Shape > &s)
 Transform a hollow shape.
 
template<typename Shape, Transform< typename Shape::elem_t, Shape::N > Xf>
Hollow< Shape > operator/ (const Hollow< Shape > &s, const Xf &xf)
 Inverse transform a hollow shape.
 
template<typename Shape, Transform< typename Shape::elem_t, Shape::N > Xf>
Hollow< Shape > & operator*= (Hollow< Shape > &s, const Xf &xf)
 In-place transform a hollow shape.
 
template<typename Shape, Transform< typename Shape::elem_t, Shape::N > Xf>
Hollow< Shape > & operator/= (Hollow< Shape > &s, const Xf &xf)
 In-place inverse transform a hollow shape.
 

Detailed Description

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

Selects the boundary of a shape.

Hollow shapes are infinitely thin. They are the boundary of a shape, but do not contain any points. Hollow shapes can report the distance to their surface, the normal vector at a test point, and can orthogonally project points onto their surface.

Hollow shapes may be a useful foundation for thick-shelled shapes using the Dilated shape wrapper.

Member Function Documentation

◆ contains()

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

Shape-point overlap test.

Return true if the point p is on the surface or interior of the shape, false otherwise.

◆ measure_boundary()

template<typename Shape>
T measure_boundary ( ) const
inline

Measure the boundary (surface area) of the shape.

This is the same as the boundary of the inner shape. Hollow shapes do not have any volume, so this is their only meaningful measure.


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