geomc 1.0
A c++ linear algebra template library
|
A geometric plane or hyperplane. More...
#include <geomc/shape/Plane.h>
Public Member Functions | |
Plane () | |
Plane (Vec< T, N > n) | |
Plane (Vec< T, N > n, Vec< T, N > pt) | |
T | distance (const Vec< T, N > p) const |
T | sdf (Vec< T, N > p) const |
bool | contains (const Vec< T, N > p) const |
template<typename ConvexShape > | |
bool | contains (const ConvexShape &shape) const |
Vec< T, N > | project (Vec< T, N > p) const |
Vec< T, N > | origin () const |
void | apply (const AffineTransform< T, N > &xf) |
void | apply_inverse (const AffineTransform< T, N > &xf) |
template<typename ConvexShape > | |
bool | intersects (const ConvexShape &shape) const |
bool | intersects (const Sphere< T, N > &s) const |
bool | intersects (const Vec< T, N > *hull, index_t npts) const |
Plane< T, N > & | operator*= (const AffineTransform< T, N > &tx) |
Plane< T, N > & | operator/= (const AffineTransform< T, N > &tx) |
Static Public Member Functions | |
static Plane | from_basis (const Vec< T, N > bases[N-1]) |
static Plane | from_basis (const Vec< T, N > bases[N-1], Vec< T, N > p) |
static Plane | from_simplex (const Vec< T, N > points[N]) |
Public Attributes | |
Vec< T, N > | normal |
Normal direction, unit length. | |
T | d |
Distance along the unit normal from the origin to the plane surface. | |
Friends | |
Plane< T, N > | operator* (const AffineTransform< T, N > &tx, Plane< T, N > p) |
Plane< T, N > | operator/ (Plane< T, N > p, const AffineTransform< T, N > &tx) |
A geometric plane or hyperplane.
A Euclidean subspace of RN with dimension N-1.
|
inline |
Construct a plane with a normal along +x, crossing the origin.
Construct a plane with normal n
passing through the point pt
.
n | Normal direction. |
pt | A point on the plane. |
|
inline |
Geometrically transform this plane by xf
.
xf | An affine transformation. |
|
inline |
Un-transform this plane by xf
.
xf | An affine transformation. |
|
inline |
Half-space test.
true
if shape
is completely on or below the surface of the plane (i.e. on the side opposite the normal); false otherwise.
|
inline |
Half-space test.
true
if p
is on or below the surface of the plane (i.e. on the side opposite the normal); false
otherwise.
|
inline |
p
along the normal direction to the surface of the plane. Negative if p
is on the backfacing side of the plane. Construct a plane spanning the given basis vectors.
bases | An array of N-1 bases. |
Construct a plane spanning the given basis vectors through the given point.
bases | An array of N-1 bases. |
p | Point through which to construct the plane. |
Construct a plane spanning the points on the given simplex (i.e. line segment, triangle, tetrahedron, etc; as appropriate for the dimension).
points | The N vertecies of a simplex. |
|
inline |
Convex shape intersection test.
true
if and only if this plane passes through shape
.
|
inline |
Sphere interesection test.
true
if and only if this plane passes through s
.
|
inline |
Convex hull intersection test.
hull | A list of points whose convex hull is to be tested. |
npts | Number of points in the list. |
true
if this plane intersects the convex hull of hull
, false
otherwise,
|
inline |
Affine transformation.
tx | An affine transformation to apply to this plane. |
|
inline |
Inverse affine transformation.
tx | An affine transformation to un-apply to this plane. |
|
inline |
|
inline |
Return the signed distance to the surface of the shape.
|
friend |
Affine transformation.
tx | An affine transformation. |
p | A plane. |
p
transformed by at
.
|
friend |
Inverse affine transformation.
p | A plane. |
tx | An affine transformation. |
p
un-transformed by at
.