|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Defines an oriented plane within a 2-D or 3-D Euclidean space and provides associated operators, such as, projection, signed distance, orientation, etc. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/primal/geometry/Plane.hpp>

Public Types | |
| using | VectorType = primal::Vector< T, NDIMS > |
| using | PointType = primal::Point< T, NDIMS > |
Public Member Functions | |
| AXOM_HOST_DEVICE const VectorType & | getNormal () const |
| Returns a const pointer to the plane's normal vector. More... | |
| AXOM_HOST_DEVICE T | getOffset () const |
| Returns the offset of the plane from origin. More... | |
| AXOM_HOST_DEVICE T | signedDistance (const PointType &x) const |
| Computes the signed distance of the specified point to this Plane. More... | |
| AXOM_HOST_DEVICE PointType | projectPoint (const PointType &x) const |
| Computes the projection of a given point, x, onto this Plane. More... | |
| AXOM_HOST_DEVICE PointType | reflectPoint (const PointType &x) const |
| Computes the reflection of a given point, x, across this Plane. More... | |
| AXOM_HOST_DEVICE void | flip () |
| Flips the orientation of the plane. More... | |
| AXOM_HOST_DEVICE int | getOrientation (const PointType &x, double TOL=1.e-9) const |
| Computes the orientation of the point with respect to this Plane. More... | |
| AXOM_HOST_DEVICE bool | isValid (double TOL=PRIMAL_TINY) const |
| Simple check for validity of a Plane. More... | |
| std::ostream & | print (std::ostream &os) const |
| Prints the Plane information in the given output stream. More... | |
Constructors | |
| Plane ()=default | |
| Constructs a Plane with a zero normal vector and zero offset. More... | |
| AXOM_HOST_DEVICE | Plane (const VectorType &normal, const PointType &x, bool normalize=true) |
| Constructs a Plane with a given normal, \( \mathcal{N} \), that passes through the specified point, \( x \). More... | |
| AXOM_HOST_DEVICE | Plane (const VectorType &normal, T offset, bool normalize=true) |
| Constructs a plane with a specified normal, \( \mathcal{N} \), located at the given offset from origin. More... | |
Static Public Member Functions | |
| static constexpr AXOM_HOST_DEVICE int | getDimension () |
| Returns the dimension of the Plane. More... | |
Defines an oriented plane within a 2-D or 3-D Euclidean space and provides associated operators, such as, projection, signed distance, orientation, etc.
The Plane object defines an oriented plane in Hessian Normal form:
\f$ \mathcal{N} \cdot x - d = 0 \f$
where, \( \mathcal{N} \) is a normal and \( d \) is the offset of the plane (in the direction of the specified normal) to the origin.
The Plane class defines a co-dimension-one plane that splits the ambient space into two halfspaces, such that, the signed distance for any point is: (a) negative below the plance, (b) positive above the plane and (c) zero on the plane.
A Plane object may be constructed in three ways:
| T | the underlying data type, e.g., double, float, etc. |
| NDIMS | the number of dimensions |
| using axom::primal::Plane< T, NDIMS >::VectorType = primal::Vector<T, NDIMS> |
| using axom::primal::Plane< T, NDIMS >::PointType = primal::Point<T, NDIMS> |
|
default |
| AXOM_HOST_DEVICE axom::primal::Plane< T, NDIMS >::Plane | ( | const VectorType & | normal, |
| const PointType & | x, | ||
| bool | normalize = true |
||
| ) |
Constructs a Plane with a given normal, \( \mathcal{N} \), that passes through the specified point, \( x \).
| [in] | normal | the supplied plane normal, \( \mathcal{N} \) |
| [in] | x | a specified point that the plane passes through, \( x \) |
| [in] | normalize | if true, normalize the given vector (default: true) |
References axom::primal::Point< T, NDIMS >::array(), axom::primal::Vector< T, NDIMS >::is_zero(), axom::numerics::normalize(), and SLIC_ASSERT_MSG.
| AXOM_HOST_DEVICE axom::primal::Plane< T, NDIMS >::Plane | ( | const VectorType & | normal, |
| T | offset, | ||
| bool | normalize = true |
||
| ) |
Constructs a plane with a specified normal, \( \mathcal{N} \), located at the given offset from origin.
| [in] | normal | the supplied plane normal, \( \mathcal{N} \) |
| [in] | offset | the plane offset from origin |
| [in] | normalize | if true, normalize the given vector (default: true) |
References axom::primal::Vector< T, NDIMS >::is_zero(), axom::numerics::normalize(), and SLIC_ASSERT_MSG.
|
inlinestaticconstexpr |
|
inline |
Returns a const pointer to the plane's normal vector.
|
inline |
Returns the offset of the plane from origin.
|
inline |
Computes the signed distance of the specified point to this Plane.
| [in] | x | buffer consisting of the query point coordinates. |
References axom::primal::Vector< T, NDIMS >::dot().
| AXOM_HOST_DEVICE Plane< T, NDIMS >::PointType axom::primal::Plane< T, NDIMS >::projectPoint | ( | const PointType & | x | ) | const |
Computes the projection of a given point, x, onto this Plane.
| [in] | x | buffer consisting of the coordinates of the point to project. |
| AXOM_HOST_DEVICE Plane< T, NDIMS >::PointType axom::primal::Plane< T, NDIMS >::reflectPoint | ( | const PointType & | x | ) | const |
Computes the reflection of a given point, x, across this Plane.
| [in] | x | buffer consisting of the coordinates of the point to project. |
| AXOM_HOST_DEVICE void axom::primal::Plane< T, NDIMS >::flip |
Flips the orientation of the plane.
| AXOM_HOST_DEVICE int axom::primal::Plane< T, NDIMS >::getOrientation | ( | const PointType & | x, |
| double | TOL = 1.e-9 |
||
| ) | const |
Computes the orientation of the point with respect to this Plane.
| [in] | x | buffer consisting of the query point coordinates. |
| [in] | TOL | user-supplied tolerance. Optional. Default is 1.e-9. |
x lies on the plane x is above the plane x is below the plane References axom::utilities::isNearlyEqual(), axom::primal::ON_BOUNDARY, axom::primal::ON_NEGATIVE_SIDE, and axom::primal::ON_POSITIVE_SIDE.
| AXOM_HOST_DEVICE bool axom::primal::Plane< T, NDIMS >::isValid | ( | double | TOL = PRIMAL_TINY | ) | const |
Simple check for validity of a Plane.
Check that the normal is not the zero vector.
| [in] | TOL | user-supplied tolerance. Optional. Default is 1.0e-50. |
References axom::utilities::isNearlyEqual().
| std::ostream & axom::primal::Plane< T, NDIMS >::print | ( | std::ostream & | os | ) | const |