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 >:
Dimensional< Shape::elem_t, Shape::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.
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, Nbounds () const
 Compute the axis-aligned bounding box of the shape.
Vec< T, Nclip (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.
measure_boundary () const
 Measure the boundary (surface area) of the shape.
Vec< T, Nnormal (Vec< T, N > p) const
 Normal vector at point p.
bool operator== (const Hollow &other) const
 Shape equality test.
Vec< T, Nproject (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
 The dimension of this object.

(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 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

◆ 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: