geomc 1.0
A c++ linear algebra template library
|
A shape transformed by a similarity transform (translation, rotation, and scale). More...
#include <geomc/shape/Similar.h>
Public Types | |
using | elem_t = typename Shape::elem_t |
using | point_t |
The type of a point in this object's space. | |
using | T = elem_t |
Public Member Functions | |
Similar () | |
Wrap a default-constructed shape with the identity transform. | |
Similar (const Shape &shape) | |
Wrap a shape with an identity transform. | |
Similar (const Shape &shape, const Similarity< T, N > &xf) | |
Wrap a shape with a similarity transform. | |
Rect< T, N > | bounds () const |
Compute the axis-aligned bounding box of the shape. | |
Vec< Shape::elem_t, N > | clip (Vec< Shape::elem_t, N > p) const |
Nearest point on the interior of the shape. | |
bool | contains (Vec< Shape::elem_t, N > p) const |
Shape-point overlap test. | |
bool | contains (typename Shape::point_t p) const |
Shape-point intersection test. | |
point_t | convex_support (point_t d) const |
Geometric convex support function. | |
Vec< T, N > | convex_support (Vec< T, N > d) const |
Rect< T, 1 > | intersect (const Ray< T, N > &ray) const |
Ray-shape intersection. | |
bool | intersects (const Convex< Shape::elem_t, N, Shape > &other) const |
Convex shape overlap test. | |
template<typename S> requires requires (Similarity<T,N> xf, const Shape s, const S b) { s.intersects(b); { b / xf } -> std::same_as<S>; } | |
bool | intersects (const S &s) const |
Intersection with another shape. Available if the other shape can be transformed into our space while preserving its type. | |
template<typename S> requires requires (const Similar<Shape> s, const S b) { s.intersects(b); } | |
bool | intersects (const Similar< S > &s) const |
Intersecion with another similar shape. Available if our shape can intersect the other shape's base shape. | |
T | measure_boundary () const |
Measure the boundary (surface area) of the shape. | |
T | measure_interior () const |
Measure the interior (volume) of the shape. | |
Vec< T, N > | normal (Vec< T, N > p) const |
Direction away from the surface of the shape at point p . | |
operator Transformed< Shape > () const | |
Convert this shape to a Transformed shape. | |
bool | operator== (const Similar &other) const |
Vec< T, N > | project (Vec< T, N > p) const |
Orthogonally project p to the surface of this shape. | |
T | sdf (Vec< T, N > p) const |
Signed distance function. | |
Similar< Rect< T, N > > | transformed_bounds () const |
Static Public Member Functions | |
static constexpr bool | admits_cusps () |
Public Attributes | |
Shape | shape |
Un-transformed shape. | |
Similarity< T, N > | xf |
Static Public Attributes | |
static constexpr index_t | N = Shape::N |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T, index_t N> | |
using | Box = Similar<Rect<T,N>> |
Convenience typedef for arbitrarily-oriented Rects. | |
template<typename Shape> | |
Similar< Shape > | operator* (const Similarity< typename Shape::elem_t, Shape::N > &xf, const Shape &shape) |
Transform the shape shape by wrapping it with a Similarity transform. | |
template<typename Shape> | |
Similar< Shape > | operator* (const Similarity< typename Shape::elem_t, Shape::N > &xf, const Similar< Shape > &s) |
Transform the shape s by xf . | |
template<typename Shape> | |
Similar< Shape > & | operator*= (Similar< Shape > &s, const Similarity< typename Shape::elem_t, Shape::N > &xf) |
In-place transform the shape s by xf . | |
template<typename Shape> | |
Similar< Shape > | operator/ (const Shape &s, const Similarity< typename Shape::elem_t, Shape::N > &xf) |
Transform the shape s by the inverse of xf . | |
template<typename Shape> | |
Similar< Shape > | operator/ (const Similar< Shape > &s, const Similarity< typename Shape::elem_t, Shape::N > &xf) |
Transform the shape s by the inverse of xf . | |
template<typename Shape> | |
Similar< Shape > & | operator/= (Similar< Shape > &s, const Similarity< typename Shape::elem_t, Shape::N > &xf) |
In-place transform the shape s by the inverse of xf . | |
A shape transformed by a similarity transform (translation, rotation, and scale).
Similar transfrorms guarantee that shapes and relative distances are preserved. For arbitrarily-transformed shapes, see Transformed.
|
inherited |
The type of a point in this object's space.
An N-vector of T if N > 1, otherwise a T.
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 support function. Return the point on the surface of the shape which is farthest in the direction d
.
Convex shape overlap test.
other
; false otherwise.