AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Classes | |
class | BezierCurve |
Represents a Bezier curve defined by an array of control points. More... | |
class | BezierPatch |
Represents a 3D Bezier patch defined by a 2D array of control points. More... | |
class | BoundingBox |
class | CurvedPolygon |
Represents a polygon with curved edges defined by BezierCurves. More... | |
class | Hexahedron |
Represents an hexahedral geometric shape defined by eight points. More... | |
class | KnotVector |
Represents the knot vector for a B-Spline/NURBS Curve/Surface. More... | |
class | NumericArray |
A simple statically sized array of data with component-wise operators. More... | |
struct | NonChar |
Type trait to avoid outputting chars when a value is expected This avoids unintentionally outputting system beeps. More... | |
struct | NonChar< char > |
struct | NonChar< unsigned char > |
class | NURBSCurve |
Represents a NURBS curve defined by an array of control points, weights and knots. More... | |
class | NURBSPatch |
Represents a 3D NURBS patch defined by a 2D array of control points. More... | |
class | Octahedron |
Represents an octahedral geometric shape defined by six points. More... | |
class | OrientedBoundingBox |
OrientedBoundingBox represents an oriented bounding box defined by its centroid, axes, and extents. More... | |
class | Plane |
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... | |
class | Point |
The point class represents a point, \( p \in \mathcal{R}^d \) . It provides access methods to set and query the point coordinates. More... | |
class | Polygon |
Represents a polygon defined by an array of points. More... | |
class | Polyhedron |
Represents a convex polyhedron defined by an array of points and optionally their neighbors (a point is a neighbor of another point if there is an edge between them) More... | |
class | NeighborCollection |
Represents a collection of neighbor relations between vertices. More... | |
class | Quadrilateral |
Represents a quadrilateral geometric shape defined by four points. More... | |
class | Ray |
class | Segment |
class | Sphere |
Defines an oriented Sphere in 2-D (i.e., a circle) or 3-D given by its center, \( \mathcal{X} \) and radius \( \mathcal{R} \). The Sphere object provides associated operations on a sphere, such as, signed distance and orientation. More... | |
class | Tetrahedron |
Represents a tetrahedral geometric shape defined by four points. More... | |
class | Triangle |
Represents a triangular geometric shape defined by three points. More... | |
class | Vector |
Represents a vector, \( v \in \mathcal{R}^d \). It provides access methods for setting and querying the vector components as well as vector math operators, e.g., adding, subtracting, dot_product and cross_product. More... | |
Typedefs | |
Pre-defined point types | |
using | Point2D = Point< double, 2 > |
using | Point3D = Point< double, 3 > |
Pre-defined Vector types | |
using | Vector2D = Vector< double, 2 > |
using | Vector3D = Vector< double, 3 > |
Enumerations | |
enum | OrientationResult { ON_BOUNDARY , ON_POSITIVE_SIDE , ON_NEGATIVE_SIDE } |
Enumerates possible return values for orientation tests. More... | |
enum class | PolygonArray { Dynamic , Static } |
Functions | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const BezierCurve< T, NDIMS > &bCurve) |
Overloaded output operator for Bezier Curves. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const BezierPatch< T, NDIMS > &bPatch) |
Overloaded output operator for Bezier Patches. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const CurvedPolygon< T, NDIMS > &poly) |
Overloaded output operator for polygons. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Hexahedron< T, NDIMS > &hex) |
Free functions implementing Hexahedron's operators. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const KnotVector< T > &kVec) |
Overloaded output operator for knot vectors. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const NURBSCurve< T, NDIMS > &bCurve) |
Overloaded output operator for NURBS Curves. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const NURBSPatch< T, NDIMS > &nPatch) |
Overloaded output operator for NURBS Patches. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Octahedron< T, NDIMS > &oct) |
Free functions implementing Octahedron's operators. More... | |
template<typename T , int NDIMS, axom::primal::PolygonArray ARRAY_TYPE, int MAX_VERTS> | |
std::ostream & | operator<< (std::ostream &os, const Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS > &poly) |
Overloaded output operator for polygons. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Polyhedron< T, NDIMS > &poly) |
Overloaded output operator for polyhedrons. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Quadrilateral< T, NDIMS > &quad) |
Overloaded output operator for quadrilaterals. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Ray< T, NDIMS > &ray) |
Overloaded output operator for rays. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Tetrahedron< T, NDIMS > &tet) |
Free functions implementing Tetrahedron's operators. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Triangle< T, NDIMS > &tri) |
Overloaded output operator for triangles. More... | |
template<typename T > | |
Polygon< T, 3 > | clip (const Triangle< T, 3 > &tri, const BoundingBox< T, 3 > &bbox) |
Clips a 3D triangle against an axis-aligned bounding box in 3D. More... | |
template<typename T , axom::primal::PolygonArray ARRAY_TYPE, int MAX_VERTS> | |
AXOM_SUPPRESS_HD_WARN AXOM_HOST_DEVICE Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > | clip (const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > &subjectPolygon, const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > &clipPolygon, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 2D subject polygon against a clip polygon in 2D, returning their geometric intersection as a polygon. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Hexahedron< T, 3 > &hex, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D hexahedron against a tetrahedron in 3D, returning the geometric intersection of the hexahedron and the tetrahedron as a polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Tetrahedron< T, 3 > &tet, const Hexahedron< T, 3 > &hex, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D hexahedron against a tetrahedron in 3D, returning the geometric intersection of the hexahedron and the tetrahedron as a polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Octahedron< T, 3 > &oct, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D octahedron against a tetrahedron in 3D, returning the geometric intersection of the octahedron and the tetrahedron as a polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Tetrahedron< T, 3 > &tet, const Octahedron< T, 3 > &oct, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D octahedron against a tetrahedron in 3D, returning the geometric intersection of the octahedron and the tetrahedron as a polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Tetrahedron< T, 3 > &tet1, const Tetrahedron< T, 3 > &tet2, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D tetrahedron against another tetrahedron in 3D, returning the geometric intersection as a polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Tetrahedron< T, 3 > &tet, const Plane< T, 3 > &plane, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D tetrahedron against the half-space defined by a plane and returns the resulting polyhedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Polyhedron< T, 3 > | clip (const Plane< T, 3 > &plane, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false) |
Clips a 3D tetrahedron against the half-space defined by a plane and returns the resulting polyhedron. More... | |
template<typename T , int NDIMS> | |
OrientedBoundingBox< T, NDIMS > | merge_boxes (const OrientedBoundingBox< T, NDIMS > &l, const OrientedBoundingBox< T, NDIMS > &r) |
Creates an oriented bounding box which contains the passed in OBBs. More... | |
template<typename T , int NDIMS> | |
BoundingBox< T, NDIMS > | merge_boxes (const BoundingBox< T, NDIMS > &l, const BoundingBox< T, NDIMS > &r) |
Constructor. Creates a bounding box which contains the passed in bounding boxes. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Triangle< T, NDIMS > &tri) |
Creates a bounding box around a Triangle. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Quadrilateral< T, NDIMS > &quad) |
Creates a bounding box around a Quadrilateral. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Octahedron< T, NDIMS > &oct) |
Creates a bounding box around an Octahedron. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Hexahedron< T, NDIMS > &hex) |
Creates a bounding box around a Hexahedron. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Polyhedron< T, NDIMS > &poly) |
Creates a bounding box around a Polyhedron. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Tetrahedron< T, NDIMS > &tet) |
Creates a bounding box around a Tetrahedron. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > | compute_bounding_box (const Polygon< T, NDIMS > &poly) |
Creates a bounding box around a Polygon. More... | |
template<typename T > | |
T | sector_area (const primal::BezierCurve< T, 2 > &curve) |
Calculates the sector area of a planar, nonrational Bezier Curve. More... | |
template<typename T > | |
primal::Point< T, 2 > | sector_centroid (const primal::BezierCurve< T, 2 > &curve) |
Calculates the sector centroid of a planar, nonrational Bezier Curve. More... | |
template<typename T > | |
T | area (const primal::CurvedPolygon< T, 2 > &poly, double tol=1e-8) |
Returns the area enclosed by the CurvedPolygon. More... | |
template<typename T > | |
primal::Point< T, 2 > | centroid (const primal::CurvedPolygon< T, 2 > &poly, double tol=1e-8) |
Returns the centroid of the CurvedPolygon. More... | |
template<typename Lambda , typename T , int NDIMS> | |
double | evaluate_scalar_line_integral (const primal::CurvedPolygon< T, NDIMS > cpoly, Lambda &&scalar_integrand, int npts) |
Evaluate a line integral along the boundary of a CurvedPolygon object on a scalar field. More... | |
template<typename Lambda , typename T , int NDIMS> | |
double | evaluate_scalar_line_integral (const primal::BezierCurve< T, NDIMS > &c, Lambda &&scalar_integrand, int npts) |
Evaluate a line integral on a single Bezier curve on a scalar field. More... | |
template<typename Lambda , typename T , int NDIMS> | |
double | evaluate_vector_line_integral (const primal::CurvedPolygon< T, NDIMS > cpoly, Lambda &&vector_integrand, int npts) |
Evaluate a line integral along the boundary of a CurvedPolygon object on a vector field. More... | |
template<typename Lambda , typename T , int NDIMS> | |
double | evaluate_vector_line_integral (const primal::BezierCurve< T, NDIMS > &c, Lambda &&vector_integrand, int npts) |
Evaluate a line integral on a single Bezier curve on a vector field. More... | |
template<class Lambda , typename T > | |
double | evaluate_area_integral (const primal::CurvedPolygon< T, 2 > cpoly, Lambda &&integrand, int npts_Q, int npts_P=0) |
Evaluate an integral on the interior of a CurvedPolygon object. More... | |
template<typename T > | |
bool | in_curved_polygon (const Point< T, 2 > &query, const CurvedPolygon< T, 2 > &cpoly, bool useNonzeroRule=true, double edge_tol=1e-8, double EPS=1e-8) |
Robustly determine if query point is interior to a curved polygon. More... | |
template<typename T > | |
bool | in_polygon (const Point< T, 2 > &query, const Polygon< T, 2 > &poly, bool includeBoundary=false, bool useNonzeroRule=true, double edge_tol=1e-8) |
Determines containment for a point in a polygon. More... | |
template<typename T > | |
bool | in_polyhedron (const Point< T, 3 > &query, const Polyhedron< T, 3 > &poly, bool includeBoundary=false, bool useNonzeroRule=true, double edge_tol=1e-8, double EPS=1e-8) |
Determines containment for a point in a polygon. More... | |
template<typename T > | |
bool | in_sphere (const Point< T, 2 > &q, const Point< T, 2 > &p0, const Point< T, 2 > &p1, const Point< T, 2 > &p2, double EPS=1e-8) |
Tests whether a query point lies inside a 2D triangle's circumcircle. More... | |
template<typename T > | |
bool | in_sphere (const Point< T, 2 > &q, const Triangle< T, 2 > &tri, double EPS=1e-8) |
Tests whether a query point lies inside a 2D triangle's circumcircle. More... | |
template<typename T > | |
bool | in_sphere (const Point< T, 3 > &q, const Point< T, 3 > &p0, const Point< T, 3 > &p1, const Point< T, 3 > &p2, const Point< T, 3 > &p3, double EPS=1e-8) |
Tests whether a query point lies inside a 3D tetrahedron's circumsphere. More... | |
template<typename T > | |
bool | in_sphere (const Point< T, 3 > &q, const Tetrahedron< T, 3 > &tet, double EPS=1e-8) |
Tests whether a query point lies inside a 3D tetrahedron's circumsphere. More... | |
template<typename T > | |
AXOM_HOST_DEVICE T | intersection_volume (const Hexahedron< T, 3 > &hex, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false) |
Finds the absolute (unsigned) intersection volume between a hexahedron and a tetrahedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE T | intersection_volume (const Tetrahedron< T, 3 > &tet, const Hexahedron< T, 3 > &hex, double eps=1.e-10, bool tryFixOrientation=false) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and a hexahedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE T | intersection_volume (const Octahedron< T, 3 > &oct, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false) |
Finds the absolute (unsigned) intersection volume between a octahedron and a tetrahedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE T | intersection_volume (const Tetrahedron< T, 3 > &tet, const Octahedron< T, 3 > &oct, double eps=1.e-10, bool tryFixOrientation=false) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and a octahedron. More... | |
template<typename T > | |
AXOM_HOST_DEVICE T | intersection_volume (const Tetrahedron< T, 3 > &tet1, const Tetrahedron< T, 3 > &tet2, double eps=1.e-10, bool tryFixOrientation=false) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and another tetrahedron. More... | |
template<typename T > | |
bool | is_convex (const Polygon< T, 2 > &poly, double EPS=1e-8) |
Determines if a polygon defined by ordered vertices is convex. More... | |
template<typename T > | |
int | orientation (const Point< T, 3 > &p, const Triangle< T, 3 > &tri, double EPS=1e-9) |
Computes the orientation of a point p with respect to an oriented triangle tri. More... | |
template<typename T > | |
int | orientation (const Point< T, 2 > &p, const Segment< T, 2 > &seg, double EPS=1e-9) |
Computes the orientation of a point p with respect to an oriented segment. More... | |
template<typename Tp , int NDIMS = 3> | |
void | split (const Octahedron< Tp, NDIMS > &oct, axom::Array< Tetrahedron< Tp, NDIMS >> &out) |
Splits an Octahedron into eight Tetrahedrons. More... | |
double | squared_distance (const double *A, const double *B, int N) |
Computes the squared distance from point A to point B, represented by arrays of length N. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE double | squared_distance (const Point< T, NDIMS > &A, const Point< T, NDIMS > &B) |
Computes the squared distance from point A to point B. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE double | squared_distance (const Point< T, NDIMS > &P, const BoundingBox< T, NDIMS > &B) |
Computes the minimum squared distance from a query point, P, to a given axis-aligned bounding box B. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE double | squared_distance (const BoundingBox< T, NDIMS > &A, const BoundingBox< T, NDIMS > &B) |
Computes the minimum squared distance between 2 axis-aligned boxes. More... | |
template<typename T , int NDIMS> | |
double | squared_distance (const Point< T, NDIMS > &P, const Segment< T, NDIMS > &S) |
Computes the minimum squared distance from a query point, P, to the given segment, S. More... | |
template<typename T , int NDIMS> | |
double | squared_distance (const Point< T, NDIMS > &P, const Triangle< T, NDIMS > &tri) |
Computes the minimum squared distance from a query point, P, to the closest point on the given triangle. More... | |
Forward Declared Overloaded Operators | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE bool | operator== (const BoundingBox< T, NDIMS > &lhs, const BoundingBox< T, NDIMS > &rhs) |
Equality comparison operator for bounding boxes. Two bounding boxes are equal when they have the same bounds. More... | |
template<typename T , int NDIMS> | |
bool | operator!= (const BoundingBox< T, NDIMS > &lhs, const BoundingBox< T, NDIMS > &rhs) |
Inequality comparison operator for bounding boxes. Two bounding boxes are unequal when they have different bounds. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const BoundingBox< T, NDIMS > &bb) |
Overloaded output operator for bounding boxes. More... | |
template<typename T , int SIZE> | |
AXOM_HOST_DEVICE bool | operator== (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Checks if two numeric arrays are component-wise equal. More... | |
template<typename T , int SIZE> | |
bool | operator!= (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Checks if two numeric arrays are not component-wise equal. More... | |
template<typename T , int SIZE> | |
AXOM_HOST_DEVICE NumericArray< T, SIZE > | operator+ (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Performs component-wise addition of two numeric arrays. More... | |
template<typename T , int SIZE> | |
AXOM_HOST_DEVICE NumericArray< T, SIZE > | operator- (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Performs component-wise subtraction of two numeric arrays. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | operator- (const NumericArray< T, SIZE > &arr) |
Unary negation of a numeric array instance. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | operator* (const NumericArray< T, SIZE > &arr, double scalar) |
Scalar multiplication a numeric array; Scalar on rhs. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | operator* (double scalar, const NumericArray< T, SIZE > &arr) |
Scalar multiplication a numeric array; Scalar on lhs. More... | |
template<typename T , int SIZE> | |
AXOM_HOST_DEVICE NumericArray< T, SIZE > | operator* (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Component-wise multiplication of NumericArrays. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | operator/ (const NumericArray< T, SIZE > &lhs, const NumericArray< T, SIZE > &rhs) |
Component-wise division of NumericArrays. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | operator/ (const NumericArray< T, SIZE > &arr, double scalar) |
Scalar division of NumericArray; Scalar on rhs. More... | |
template<typename T , int SIZE> | |
NumericArray< T, SIZE > | abs (const NumericArray< T, SIZE > &arr) |
Coordinate-wise absolute value on the NumericArray. More... | |
template<typename T , int SIZE> | |
std::ostream & | operator<< (std::ostream &os, const NumericArray< T, SIZE > &arr) |
Overloaded output operator for numeric arrays. More... | |
template<typename T , int NDIMS> | |
bool | operator== (const OrientedBoundingBox< T, NDIMS > &lhs, const OrientedBoundingBox< T, NDIMS > &rhs) |
Equality comparison operator for oriented bounding boxes. More... | |
template<typename T , int NDIMS> | |
bool | operator!= (const OrientedBoundingBox< T, NDIMS > &lhs, const OrientedBoundingBox< T, NDIMS > &rhs) |
Inequality comparison operator for oriented bounding boxes. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const OrientedBoundingBox< T, NDIMS > &box) |
Overloaded output operator for oriented bounding boxes. More... | |
template<typename T , int NDIMS> | |
OrientedBoundingBox< T, NDIMS > | compute_oriented_bounding_box (const Point< T, NDIMS > *pts, int n) |
Creates a bounding box which contains the collection of passed in points. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Plane< T, NDIMS > &p) |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE bool | operator== (const Point< T, NDIMS > &lhs, const Point< T, NDIMS > &rhs) |
Equality comparison operator for points. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE bool | operator!= (const Point< T, NDIMS > &lhs, const Point< T, NDIMS > &rhs) |
Inequality comparison operator for points. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Point< T, NDIMS > &pt) |
Overloaded output operator for points. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE bool | operator== (const Segment< T, NDIMS > &lhs, const Segment< T, NDIMS > &rhs) |
Equality comparison operator for Segment. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE bool | operator!= (const Segment< T, NDIMS > &lhs, const Segment< T, NDIMS > &rhs) |
Inequality comparison operator for Segment. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Segment< T, NDIMS > &seg) |
Overloaded output operator for Segment. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Sphere< T, NDIMS > &s) |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator+ (const Vector< T, NDIMS > &A, const Vector< T, NDIMS > &B) |
Adds vectors A, B and stores the result into a new vector C. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Point< T, NDIMS > | operator+ (const Point< T, NDIMS > &P, const Vector< T, NDIMS > &V) |
Adds vector V to point P and stores the result into a new point. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Point< T, NDIMS > | operator+ (const Vector< T, NDIMS > &V, const Point< T, NDIMS > &P) |
Adds vector V to point P and stores the result into a new point. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Point< T, NDIMS > | operator- (const Point< T, NDIMS > &P, const Vector< T, NDIMS > &V) |
Subtracts vector V from point P and stores the result into a new point. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator- (const Vector< T, NDIMS > &A, const Vector< T, NDIMS > &B) |
Subtracts vectors A, B and stores the result into a new vector C. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator- (const Point< T, NDIMS > &h, const Point< T, NDIMS > &t) |
Subtracts Point t from Point h, yielding a vector. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator- (const Vector< T, NDIMS > &vec1) |
Unary negation of a vector instance. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator* (const Vector< T, NDIMS > &vec, const T scalar) |
Scalar multiplication of vector; Scalar on rhs. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator* (const T scalar, const Vector< T, NDIMS > &vec) |
Scalar multiplication of vector; Scalar on lhs. More... | |
template<typename T , int NDIMS> | |
AXOM_HOST_DEVICE Vector< T, NDIMS > | operator/ (const Vector< T, NDIMS > &vec, const T scalar) |
Scalar division of vector; Scalar on rhs. More... | |
template<typename T , int NDIMS> | |
std::ostream & | operator<< (std::ostream &os, const Vector< T, NDIMS > &vec) |
Overloaded output operator for vectors. More... | |
Forward-declared helper functions | |
template<typename T > | |
AXOM_HOST_DEVICE Plane< T, 2 > | make_plane (const Point< T, 2 > &x1, const Point< T, 2 > &x2) |
Constructs a Plane in 2D that goes through the specified points. More... | |
template<typename T > | |
AXOM_HOST_DEVICE Plane< T, 3 > | make_plane (const Point< T, 3 > &x1, const Point< T, 3 > &x2, const Point< T, 3 > &x3) |
Constructs a Plane in 3D that goes through the specified points. More... | |
Triangle Intersection Routines | |
template<typename T > | |
AXOM_HOST_DEVICE bool | intersect (const Triangle< T, 3 > &t1, const Triangle< T, 3 > &t2, bool includeBoundary=false, double EPS=1E-08) |
Tests if 3D Triangles t1 and t2 intersect. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 2 > &t1, const Triangle< T, 2 > &t2, bool includeBoundary=false, double EPS=1E-08) |
Tests if 2D Triangles t1 and t2 intersect. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const BoundingBox< T, 3 > &bb) |
Determines if a triangle and a bounding box intersect. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Ray< T, 3 > &ray) |
Determines if a 3D triangle intersects a 3D ray. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Ray< T, 3 > &ray, T &t) |
Determines if a 3D triangle intersects a 3D ray. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Ray< T, 3 > &ray, T &t, Point< double, 3 > &p) |
Determines if a 3D triangle intersects a 3D ray. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Segment< T, 3 > &seg) |
Determines if a 3D triangle intersects a 3D segment. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Segment< T, 3 > &seg, T &t) |
Determines if a 3D triangle intersects a 3D segment. More... | |
template<typename T > | |
bool | intersect (const Triangle< T, 3 > &tri, const Segment< T, 3 > &seg, T &t, Point< double, 3 > &p) |
Determines if a 3D triangle intersects a 3D segment. More... | |
Ray Intersection Routines | |
template<typename T > | |
bool | intersect (const Ray< T, 2 > &R, const Segment< T, 2 > &S, T &ray_param, T &seg_param, const T EPS=1e-8) |
Computes the intersection of the given ray, R, with the segment, S. More... | |
template<typename T > | |
bool | intersect (const Ray< T, 2 > &R, const Segment< T, 2 > &S, T &ray_param) |
Computes the intersection of the given ray, R, with the segment, S. More... | |
template<typename T > | |
bool | intersect (const Ray< T, 2 > &R, const Segment< T, 2 > &S, Point< T, 2 > &ip, const T EPS=1e-8) |
Computes the intersection of the given ray, R, with the segment, S. More... | |
template<typename T , int DIM> | |
AXOM_HOST_DEVICE bool | intersect (const Ray< T, DIM > &R, const BoundingBox< T, DIM > &bb, Point< T, DIM > &ip) |
Computes the intersection of the given ray, R, with the Box, bb. More... | |
Segment-BoundingBox Intersection Routines | |
template<typename T , int DIM> | |
bool | intersect (const Segment< T, DIM > &S, const BoundingBox< T, DIM > &bb, T &tmin, T &tmax, const double &EPS=1e-8) |
Computes the intersection of the given segment, S, with the Box, bb. If an intersection is found, output parameter ip contains an intersection point. More... | |
template<typename T , int DIM> | |
bool | intersect (const Segment< T, DIM > &S, const BoundingBox< T, DIM > &bb, Point< T, DIM > &ip, const double &EPS=1e-8) |
This variant returns a point within the intersection as an OUT parameters. More... | |
template<typename T , int DIM> | |
bool | intersect (const Segment< T, DIM > &S, const BoundingBox< T, DIM > &bb) |
Axis-Aligned Bounding Box Intersection Routines | |
template<typename T , int DIM> | |
AXOM_HOST_DEVICE bool | intersect (const BoundingBox< T, DIM > &bb1, const BoundingBox< T, DIM > &bb2) |
Determines if two axis aligned bounding boxes intersect. More... | |
Sphere Intersection Routines | |
template<typename T , int DIM> | |
bool | intersect (const Sphere< T, DIM > &s1, const Sphere< T, DIM > &s2, double TOL=1.e-9) |
Determines if two spheres intersect. More... | |
Oriented Bounding Box Intersection Routines | |
template<typename T > | |
bool | intersect (const OrientedBoundingBox< T, 1 > &b1, const OrientedBoundingBox< T, 1 > &b2) |
template<typename T > | |
bool | intersect (const OrientedBoundingBox< T, 2 > &b1, const OrientedBoundingBox< T, 2 > &b2) |
Determines if a 2D OBB intersects a 2D OBB. More... | |
template<typename T > | |
bool | intersect (const OrientedBoundingBox< T, 3 > &b1, const OrientedBoundingBox< T, 3 > &b2, double EPS=1E-4) |
Determines if a 3D OBB intersects a 3D OBB. More... | |
Bezier Curve Intersection Routines | |
template<typename T > | |
bool | intersect (const BezierCurve< T, 2 > &c1, const BezierCurve< T, 2 > &c2, std::vector< T > &sp, std::vector< T > &tp, double tol=1E-8) |
Tests if two Bezier Curves c1 and c2 intersect. More... | |
Plane Intersection Routines | |
template<typename T > | |
AXOM_HOST_DEVICE bool | intersect (const Plane< T, 3 > &p, const BoundingBox< T, 3 > &bb, bool checkOverlaps=false, double EPS=1E-08) |
Determines if a 3D plane intersects a 3D bounding box. By default (checkOverlaps is false), checks if |s| <= r, where "s" is the distance of the bounding box center to the plane, and "r" is the projected radius of the bounding box along the line parallel to the plane normal and going through the box center. If checkOverlaps is true, checks if |s| < r, where the bounding box overlaps both half spaces of the plane. More... | |
template<typename T , int DIM> | |
AXOM_HOST_DEVICE bool | intersect (const Plane< T, DIM > &plane, const Segment< T, DIM > &seg, T &t) |
Determines if a plane intersects a segment. More... | |
template<typename T > | |
AXOM_HOST_DEVICE bool | intersect (const Plane< T, 3 > &p, const Tetrahedron< T, 3 > &tet, Polygon< T, 3 > &intersection) |
Determines if a 3D plane intersects a tetrahedron. More... | |
Winding number operations between 2D points and primitives | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const Segment< T, 2 > &s, double edge_tol=1e-8) |
template<typename T > | |
int | winding_number (const Point< T, 2 > &q, const Triangle< T, 2 > &tri, bool includeBoundary=false, double edge_tol=1e-8) |
template<typename T > | |
int | winding_number (const Point< T, 2 > &R, const Polygon< T, 2 > &P, bool &isOnEdge, bool includeBoundary, double edge_tol) |
Computes the winding number for a 2D point wrt a 2D polygon. More... | |
template<typename T > | |
int | winding_number (const Point< T, 2 > &R, const Polygon< T, 2 > &P, bool includeBoundary=false, double edge_tol=1e-8) |
Computes the winding number for a 2D point wrt a 2D polygon. More... | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const BezierCurve< T, 2 > &c, double edge_tol=1e-8, double EPS=1e-8) |
Computes the GWN for a 2D point wrt a 2D Bezier curve. More... | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const NURBSCurve< T, 2 > &n, double edge_tol=1e-8, double EPS=1e-8) |
Computes the GWN for a 2D point wrt a 2D NURBS curve. More... | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const CurvedPolygon< T, 2 > &cpoly, double edge_tol=1e-8, double EPS=1e-8) |
Computes the GWN for a 2D point wrt to a 2D curved polygon. More... | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const axom::Array< BezierCurve< T, 2 >> &carray, double edge_tol=1e-8, double EPS=1e-8) |
Computes the GWN for a 2D point wrt to a collection of 2D Bezier curves. More... | |
template<typename T > | |
double | winding_number (const Point< T, 2 > &q, const axom::Array< NURBSCurve< T, 2 >> &narray, double edge_tol=1e-8, double EPS=1e-8) |
Computes the GWN for a 2D point wrt to a collection of 2D NURBS curves. More... | |
Winding number operations between 3D points and primitives | |
template<typename T > | |
double | winding_number (const Point< T, 3 > &q, const Triangle< T, 3 > &tri, bool &isOnFace, const double edge_tol=1e-8, const double EPS=1e-8) |
Computes the GWN for a 3D point wrt a 3D triangle. More... | |
template<typename T > | |
double | winding_number (const Point< T, 3 > &q, const Triangle< T, 3 > &tri, const double edge_tol=1e-8, const double EPS=1e-8) |
Computes the GWN for a 3D point wrt a 3D triangle. More... | |
template<typename T > | |
double | winding_number (const Point< T, 3 > &q, const Polygon< T, 3 > &poly, bool &isOnFace, const double edge_tol=1e-8, const double EPS=1e-8) |
Computes the GWN for a 3D point wrt a 3D planar polygon. More... | |
template<typename T > | |
double | winding_number (const Point< T, 3 > &q, const Polygon< T, 3 > &poly, const double edge_tol=1e-8, const double EPS=1e-8) |
Computes the GWN for a 3D point wrt a 3D planar polygon. More... | |
template<typename T > | |
int | winding_number (const Point< T, 3 > &query, const Polyhedron< T, 3 > &poly, bool includeBoundary=false, double edge_tol=1e-8, double EPS=1e-8) |
Computes the winding number for a 3D point wrt a 3D convex polyhedron. More... | |
using axom::primal::Point2D = typedef Point<double, 2> |
using axom::primal::Point3D = typedef Point<double, 3> |
using axom::primal::Vector2D = typedef Vector<double, 2> |
using axom::primal::Vector3D = typedef Vector<double, 3> |
|
strong |
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const BezierCurve< T, NDIMS > & | bCurve | ||
) |
Overloaded output operator for Bezier Curves.
Free functions related to BezierCurve.
References axom::primal::BezierCurve< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const BezierPatch< T, NDIMS > & | bPatch | ||
) |
Overloaded output operator for Bezier Patches.
Free functions related to BezierPatch.
References axom::primal::BezierPatch< T, NDIMS >::print().
AXOM_HOST_DEVICE bool axom::primal::operator== | ( | const BoundingBox< T, NDIMS > & | lhs, |
const BoundingBox< T, NDIMS > & | rhs | ||
) |
Equality comparison operator for bounding boxes. Two bounding boxes are equal when they have the same bounds.
Free functions implementing comparison and arithmetic operators.
References axom::primal::BoundingBox< T, NDIMS >::getMax(), and axom::primal::BoundingBox< T, NDIMS >::getMin().
bool axom::primal::operator!= | ( | const BoundingBox< T, NDIMS > & | lhs, |
const BoundingBox< T, NDIMS > & | rhs | ||
) |
Inequality comparison operator for bounding boxes. Two bounding boxes are unequal when they have different bounds.
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const BoundingBox< T, NDIMS > & | bb | ||
) |
Overloaded output operator for bounding boxes.
References axom::primal::BoundingBox< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const CurvedPolygon< T, NDIMS > & | poly | ||
) |
Overloaded output operator for polygons.
Free functions implementing Polygon's operators.
References axom::primal::CurvedPolygon< T, NDIMS >::print().
std::ostream& axom::primal::operator<< | ( | std::ostream & | os, |
const Hexahedron< T, NDIMS > & | hex | ||
) |
Free functions implementing Hexahedron's operators.
References axom::primal::Hexahedron< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const KnotVector< T > & | kVec | ||
) |
Overloaded output operator for knot vectors.
Free functions related to KnotVector.
References axom::primal::KnotVector< T >::print().
AXOM_HOST_DEVICE bool axom::primal::operator== | ( | const NumericArray< T, SIZE > & | lhs, |
const NumericArray< T, SIZE > & | rhs | ||
) |
Checks if two numeric arrays are component-wise equal.
Free functions implementing comparison and arithmetic operators.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
bool axom::primal::operator!= | ( | const NumericArray< T, SIZE > & | lhs, |
const NumericArray< T, SIZE > & | rhs | ||
) |
Checks if two numeric arrays are not component-wise equal.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
|
inline |
Performs component-wise addition of two numeric arrays.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
|
inline |
Performs component-wise subtraction of two numeric arrays.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
|
inline |
Unary negation of a numeric array instance.
[in] | arr | numeric array instance on the left-hand side. |
|
inline |
Scalar multiplication a numeric array; Scalar on rhs.
[in] | arr | numeric array instance. |
[in] | scalar | user-supplied scalar. |
|
inline |
Scalar multiplication a numeric array; Scalar on lhs.
[in] | scalar | user-supplied scalar. |
[in] | arr | numeric array instance. |
|
inline |
Component-wise multiplication of NumericArrays.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
|
inline |
Component-wise division of NumericArrays.
[in] | lhs | numeric array instance on the left-hand side. |
[in] | rhs | numeric array instance on the right-hand side. |
|
inline |
Scalar division of NumericArray; Scalar on rhs.
[in] | arr | numeric array instance |
[in] | scalar | user-supplied scalar |
|
inline |
Coordinate-wise absolute value on the NumericArray.
[in] | arr | numeric array instance |
References axom::utilities::abs().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const NumericArray< T, SIZE > & | arr | ||
) |
Overloaded output operator for numeric arrays.
[in] | os | C++ output stream |
[in] | arr | numeric array instance. |
References axom::primal::NumericArray< T, SIZE >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const NURBSCurve< T, NDIMS > & | bCurve | ||
) |
Overloaded output operator for NURBS Curves.
Free functions related to NURBSCurve.
References axom::primal::NURBSCurve< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const NURBSPatch< T, NDIMS > & | nPatch | ||
) |
Overloaded output operator for NURBS Patches.
Free functions related to NURBSPatch.
References axom::primal::NURBSPatch< T, NDIMS >::print().
std::ostream& axom::primal::operator<< | ( | std::ostream & | os, |
const Octahedron< T, NDIMS > & | oct | ||
) |
Free functions implementing Octahedron's operators.
References axom::primal::Octahedron< T, NDIMS >::print().
bool axom::primal::operator== | ( | const OrientedBoundingBox< T, NDIMS > & | lhs, |
const OrientedBoundingBox< T, NDIMS > & | rhs | ||
) |
Equality comparison operator for oriented bounding boxes.
Free functions implementing comparison and arithmetic operators.
Two oriented bounding boxes are equal when they have the same bounds and axes.
References axom::primal::OrientedBoundingBox< T, NDIMS >::contains().
bool axom::primal::operator!= | ( | const OrientedBoundingBox< T, NDIMS > & | lhs, |
const OrientedBoundingBox< T, NDIMS > & | rhs | ||
) |
Inequality comparison operator for oriented bounding boxes.
Two bounding boxes are unequal when they have different bounds
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const OrientedBoundingBox< T, NDIMS > & | box | ||
) |
Overloaded output operator for oriented bounding boxes.
References axom::primal::OrientedBoundingBox< T, NDIMS >::print().
OrientedBoundingBox< T, NDIMS > axom::primal::compute_oriented_bounding_box | ( | const Point< T, NDIMS > * | pts, |
int | n | ||
) |
Creates a bounding box which contains the collection of passed in points.
Call srand() to initialize the random number generator before using this function.
[in] | pts | array of points |
[in] | n | number of points |
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Plane< T, NDIMS > & | p | ||
) |
References axom::primal::Plane< T, NDIMS >::print().
AXOM_HOST_DEVICE Plane< T, 2 > axom::primal::make_plane | ( | const Point< T, 2 > & | x1, |
const Point< T, 2 > & | x2 | ||
) |
Constructs a Plane in 2D that goes through the specified points.
[in] | x1 | coordinates of the first point. |
[in] | x2 | coordinates of the second point. |
References axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_CHECK_MSG.
AXOM_HOST_DEVICE Plane< T, 3 > axom::primal::make_plane | ( | const Point< T, 3 > & | x1, |
const Point< T, 3 > & | x2, | ||
const Point< T, 3 > & | x3 | ||
) |
Constructs a Plane in 3D that goes through the specified points.
[in] | x1 | coordinates of the first point. |
[in] | x2 | coordinates of the second point. |
[in] | x3 | coordinates of the third point. |
References axom::primal::Vector< T, NDIMS >::cross_product(), axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_CHECK_MSG.
AXOM_HOST_DEVICE bool axom::primal::operator== | ( | const Point< T, NDIMS > & | lhs, |
const Point< T, NDIMS > & | rhs | ||
) |
Equality comparison operator for points.
AXOM_HOST_DEVICE bool axom::primal::operator!= | ( | const Point< T, NDIMS > & | lhs, |
const Point< T, NDIMS > & | rhs | ||
) |
Inequality comparison operator for points.
Inequality operator for points.
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Point< T, NDIMS > & | pt | ||
) |
Overloaded output operator for points.
Free functions implementing Point's operators.
References axom::primal::Point< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS > & | poly | ||
) |
Overloaded output operator for polygons.
Free functions implementing Polygon's operators.
References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Polyhedron< T, NDIMS > & | poly | ||
) |
Overloaded output operator for polyhedrons.
Free functions implementing Polyhedron's operators.
References axom::primal::Polyhedron< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Quadrilateral< T, NDIMS > & | quad | ||
) |
Overloaded output operator for quadrilaterals.
Free functions implementing Quadrilateral's operators.
References axom::primal::Quadrilateral< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Ray< T, NDIMS > & | ray | ||
) |
Overloaded output operator for rays.
Free functions implementing Ray's operators.
References axom::primal::Ray< T, NDIMS >::print().
AXOM_HOST_DEVICE bool axom::primal::operator== | ( | const Segment< T, NDIMS > & | lhs, |
const Segment< T, NDIMS > & | rhs | ||
) |
Equality comparison operator for Segment.
Equality comparison operator for segments.
AXOM_HOST_DEVICE bool axom::primal::operator!= | ( | const Segment< T, NDIMS > & | lhs, |
const Segment< T, NDIMS > & | rhs | ||
) |
Inequality comparison operator for Segment.
Inequality operator for segments.
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Segment< T, NDIMS > & | seg | ||
) |
Overloaded output operator for Segment.
Free functions implementing Segments's operators.
References axom::primal::Segment< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Sphere< T, NDIMS > & | s | ||
) |
References axom::primal::Sphere< T, NDIMS >::print().
std::ostream& axom::primal::operator<< | ( | std::ostream & | os, |
const Tetrahedron< T, NDIMS > & | tet | ||
) |
Free functions implementing Tetrahedron's operators.
References axom::primal::Tetrahedron< T, NDIMS >::print().
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Triangle< T, NDIMS > & | tri | ||
) |
Overloaded output operator for triangles.
Free functions implementing Triangle's operators.
References axom::primal::Triangle< T, NDIMS >::print().
|
inline |
Adds vectors A, B and stores the result into a new vector C.
[in] | A | vector on the left-hand side. |
[in] | B | vector on the right-hand side. |
AXOM_HOST_DEVICE Point< T, NDIMS > axom::primal::operator+ | ( | const Point< T, NDIMS > & | P, |
const Vector< T, NDIMS > & | V | ||
) |
Adds vector V to point P and stores the result into a new point.
[in] | P | point on the left-hand side. |
[in] | V | vector on the right-hand side. |
References axom::primal::Point< T, NDIMS >::array(), and axom::primal::Vector< T, NDIMS >::array().
AXOM_HOST_DEVICE Point< T, NDIMS > axom::primal::operator+ | ( | const Vector< T, NDIMS > & | V, |
const Point< T, NDIMS > & | P | ||
) |
Adds vector V to point P and stores the result into a new point.
[in] | V | vector on the left-hand side. |
[in] | P | point on the right-hand side. |
AXOM_HOST_DEVICE Point< T, NDIMS > axom::primal::operator- | ( | const Point< T, NDIMS > & | P, |
const Vector< T, NDIMS > & | V | ||
) |
Subtracts vector V from point P and stores the result into a new point.
[in] | P | point on the left-hand side. |
[in] | V | vector on the right-hand side. |
References axom::primal::Point< T, NDIMS >::array(), and axom::primal::Vector< T, NDIMS >::array().
|
inline |
Subtracts vectors A, B and stores the result into a new vector C.
[in] | A | vector on the left-hand side. |
[in] | B | vector on the right-hand side. |
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator- | ( | const Point< T, NDIMS > & | h, |
const Point< T, NDIMS > & | t | ||
) |
|
inline |
Unary negation of a vector instance.
[in] | vec1 | vector instance to negate. |
References axom::primal::Vector< T, NDIMS >::negate().
|
inline |
Scalar multiplication of vector; Scalar on rhs.
Free functions involving vectors.
[in] | vec | vector instance. |
[in] | scalar | user-supplied scalar. |
|
inline |
Scalar multiplication of vector; Scalar on lhs.
[in] | scalar | user-supplied scalar. |
[in] | vec | vector instance. |
|
inline |
Scalar division of vector; Scalar on rhs.
[in] | vec | vector instance |
[in] | scalar | user-supplied scalar. |
std::ostream & axom::primal::operator<< | ( | std::ostream & | os, |
const Vector< T, NDIMS > & | vec | ||
) |
Overloaded output operator for vectors.
[in] | os | C++ output stream |
[in] | vec | vector instance |
References axom::primal::Vector< T, NDIMS >::print().
Polygon<T, 3> axom::primal::clip | ( | const Triangle< T, 3 > & | tri, |
const BoundingBox< T, 3 > & | bbox | ||
) |
Clips a 3D triangle against an axis-aligned bounding box in 3D.
[in] | tri | The triangle to clip |
[in] | bbox | The bounding box to clip against |
References axom::primal::BoundingBox< T, NDIMS >::contains(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::primal::BoundingBox< T, NDIMS >::intersectsWith(), and axom::utilities::swap().
AXOM_SUPPRESS_HD_WARN AXOM_HOST_DEVICE Polygon<T, 2, ARRAY_TYPE, MAX_VERTS> axom::primal::clip | ( | const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > & | subjectPolygon, |
const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > & | clipPolygon, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 2D subject polygon against a clip polygon in 2D, returning their geometric intersection as a polygon.
This function clips the subject polygon by the planes obtained from the clip polygon's edges (normals point inward). Clipping the subject polygon by each plane gives the polygon above that plane. Clipping the polygon by a plane involves finding new vertices at the intersection of the polygon edges and the plane, and removing vertices from the polygon that are below the plane.
[in] | subjectPolygon | The subject polygon |
[in] | clipPolygon | The clip polygon |
[in] | eps | The tolerance for plane point orientation. Defaults to 1.e-10. |
[in] | tryFixOrientation | If true, takes each shape with a negative signed area and swaps the order of some vertices in that shape to try to obtain a nonnegative signed area. Defaults to false. |
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Hexahedron< T, 3 > & | hex, |
const Tetrahedron< T, 3 > & | tet, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D hexahedron against a tetrahedron in 3D, returning the geometric intersection of the hexahedron and the tetrahedron as a polyhedron.
This function clips the hexahedron by the 4 planes obtained from the tetrahedron's faces (normals point inward). Clipping the hexahedron/polyhedron by each plane gives the polyhedron above that plane. Clipping the polyhedron by a plane involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | hex | The hexahedron to clip |
[in] | tet | The tetrahedron to clip against |
[in] | eps | The epsilon value |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Tetrahedron< T, 3 > & | tet, |
const Hexahedron< T, 3 > & | hex, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D hexahedron against a tetrahedron in 3D, returning the geometric intersection of the hexahedron and the tetrahedron as a polyhedron.
This function clips the hexahedron by the 4 planes obtained from the tetrahedron's faces (normals point inward). Clipping the hexahedron/polyhedron by each plane gives the polyhedron above that plane. Clipping the polyhedron by a plane involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | tet | The tetrahedron to clip against |
[in] | hex | The hexahedron to clip |
[in] | eps | The epsilon value |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Octahedron< T, 3 > & | oct, |
const Tetrahedron< T, 3 > & | tet, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D octahedron against a tetrahedron in 3D, returning the geometric intersection of the octahedron and the tetrahedron as a polyhedron.
This function clips the octahedron by the 4 planes obtained from the tetrahedron's faces (normals point inward). Clipping the octahedron/polyhedron by each plane gives the polyhedron above that plane. Clipping the polyhedron by a plane involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | oct | The octahedron to clip |
[in] | tet | The tetrahedron to clip against |
[in] | eps | The epsilon value |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Tetrahedron< T, 3 > & | tet, |
const Octahedron< T, 3 > & | oct, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D octahedron against a tetrahedron in 3D, returning the geometric intersection of the octahedron and the tetrahedron as a polyhedron.
This function clips the octahedron by the 4 planes obtained from the tetrahedron's faces (normals point inward). Clipping the octahedron/polyhedron by each plane gives the polyhedron above that plane. Clipping the polyhedron by a plane involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | tet | The tetrahedron to clip against |
[in] | oct | The octahedron to clip |
[in] | tet | The tetrahedron to clip against |
[in] | eps | The epsilon value |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Tetrahedron< T, 3 > & | tet1, |
const Tetrahedron< T, 3 > & | tet2, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D tetrahedron against another tetrahedron in 3D, returning the geometric intersection as a polyhedron.
This function clips the first tetrahedron by the 4 planes obtained from the second tetrahedron's faces (normals point inward). Clipping the tetrahedron/polyhedron by each plane gives the polyhedron above that plane. Clipping the polyhedron by a plane involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | tet1 | The tetrahedron to clip |
[in] | tet2 | The tetrahedron to clip against |
[in] | eps | The epsilon value |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Tetrahedron< T, 3 > & | tet, |
const Plane< T, 3 > & | plane, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D tetrahedron against the half-space defined by a plane and returns the resulting polyhedron.
This function clips a tetrahedron against the half-space defined by a plane. This involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | tet | The tetrahedron to clip |
[in] | plane | The plane defining the half-space used to clip the tetrahedron |
[in] | eps | The tolerance for plane point orientation |
[in] | tryFixOrientation | If true and the tetrahedron has a negative signed volume, swaps the order of some vertices in the tetrathedron to try to obtain a nonnegative signed volume. Defaults to false. |
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip | ( | const Plane< T, 3 > & | plane, |
const Tetrahedron< T, 3 > & | tet, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Clips a 3D tetrahedron against the half-space defined by a plane and returns the resulting polyhedron.
This function clips a tetrahedron against the half-space defined by a plane. This involves finding new vertices at the intersection of the polyhedron edges and the plane, removing vertices from the polyhedron that are below the plane, and redefining the neighbors for each vertex (a vertex is a neighbor of another vertex if there is an edge between them).
[in] | plane | The plane defining the half-space used to clip the tetrahedron |
[in] | tet | The tetrahedron to clip |
[in] | eps | The tolerance for plane point orientation |
[in] | tryFixOrientation | If true and the tetrahedron has a negative signed volume, swaps the order of some vertices in the tetrathedron to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
OrientedBoundingBox<T, NDIMS> axom::primal::merge_boxes | ( | const OrientedBoundingBox< T, NDIMS > & | l, |
const OrientedBoundingBox< T, NDIMS > & | r | ||
) |
Creates an oriented bounding box which contains the passed in OBBs.
Call srand() to initialize the random number generator before using this function.
[in] | l | left obb |
[in] | r | right obb |
References axom::primal::OrientedBoundingBox< T, NDIMS >::contains(), and axom::primal::OrientedBoundingBox< T, NDIMS >::vertices().
BoundingBox<T, NDIMS> axom::primal::merge_boxes | ( | const BoundingBox< T, NDIMS > & | l, |
const BoundingBox< T, NDIMS > & | r | ||
) |
Constructor. Creates a bounding box which contains the passed in bounding boxes.
[in] | l | left bb |
[in] | r | right bb |
References axom::primal::BoundingBox< T, NDIMS >::addBox().
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Triangle< T, NDIMS > & | tri | ) |
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Quadrilateral< T, NDIMS > & | quad | ) |
Creates a bounding box around a Quadrilateral.
[in] | quad | The Quadrilateral |
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Octahedron< T, NDIMS > & | oct | ) |
Creates a bounding box around an Octahedron.
[in] | oct | The Octahedron |
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Hexahedron< T, NDIMS > & | hex | ) |
Creates a bounding box around a Hexahedron.
[in] | hex | The Hexahedron |
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Polyhedron< T, NDIMS > & | poly | ) |
Creates a bounding box around a Polyhedron.
[in] | poly | The Polyhedron |
References axom::primal::BoundingBox< T, NDIMS >::addPoint(), and axom::primal::Polyhedron< T, NDIMS >::numVertices().
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Tetrahedron< T, NDIMS > & | tet | ) |
Creates a bounding box around a Tetrahedron.
[in] | tet | The tetrahedron |
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box | ( | const Polygon< T, NDIMS > & | poly | ) |
Creates a bounding box around a Polygon.
[in] | poly | The polygon |
References axom::primal::BoundingBox< T, NDIMS >::addPoint(), and axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices().
T axom::primal::sector_area | ( | const primal::BezierCurve< T, 2 > & | curve | ) |
Calculates the sector area of a planar, nonrational Bezier Curve.
The sector area is the area between the curve and the origin. The equation and derivation is described in: Ueda, K. "Signed area of sectors between spline curves and the origin" IEEE International Conference on Information Visualization, 1999.
References axom::primal::BezierCurve< T, NDIMS >::getOrder(), axom::primal::BezierCurve< T, NDIMS >::isRational(), and SLIC_ASSERT.
primal::Point<T, 2> axom::primal::sector_centroid | ( | const primal::BezierCurve< T, 2 > & | curve | ) |
Calculates the sector centroid of a planar, nonrational Bezier Curve.
This is the centroid of the region between the curve and the origin. The equation and derivation are generalizations of: Ueda, K. "Signed area of sectors between spline curves and the origin" IEEE International Conference on Information Visualization, 1999.
References axom::primal::BezierCurve< T, NDIMS >::getOrder(), axom::primal::BezierCurve< T, NDIMS >::isRational(), and SLIC_ASSERT.
T axom::primal::area | ( | const primal::CurvedPolygon< T, 2 > & | poly, |
double | tol = 1e-8 |
||
) |
Returns the area enclosed by the CurvedPolygon.
References axom::primal::CurvedPolygon< T, NDIMS >::isClosed(), axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), sector_area(), SLIC_ASSERT, and SLIC_DEBUG.
primal::Point<T, 2> axom::primal::centroid | ( | const primal::CurvedPolygon< T, 2 > & | poly, |
double | tol = 1e-8 |
||
) |
Returns the centroid of the CurvedPolygon.
References area(), axom::primal::CurvedPolygon< T, NDIMS >::isClosed(), axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), sector_centroid(), SLIC_ASSERT, and SLIC_DEBUG.
double axom::primal::evaluate_scalar_line_integral | ( | const primal::CurvedPolygon< T, NDIMS > | cpoly, |
Lambda && | scalar_integrand, | ||
int | npts | ||
) |
Evaluate a line integral along the boundary of a CurvedPolygon object on a scalar field.
The line integral is evaluated on each curve in the CurvedPolygon, and added together to represent the total integral. The Polygon need not be connected. Uses 1D Gaussian quadrature generated by MFEM.
[in] | cpoly | the CurvedPolygon object |
[in] | scalar_integrand | the lambda function representing the integrand. Must accept a Point<T, NDIM> as input and return a double |
[in] | npts | the number of quadrature points to evaluate the line integral on each edge of the CurvedPolygon |
References axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), and axom::mint::SEGMENT.
double axom::primal::evaluate_scalar_line_integral | ( | const primal::BezierCurve< T, NDIMS > & | c, |
Lambda && | scalar_integrand, | ||
int | npts | ||
) |
Evaluate a line integral on a single Bezier curve on a scalar field.
[in] | c | the Bezier curve object |
[in] | scalar_integrand | the lambda function representing the integrand. Must accept a Point<T, NDIMS> as input, and return a double. |
[in] | npts | the number of quadrature nodes |
References axom::mint::SEGMENT.
double axom::primal::evaluate_vector_line_integral | ( | const primal::CurvedPolygon< T, NDIMS > | cpoly, |
Lambda && | vector_integrand, | ||
int | npts | ||
) |
Evaluate a line integral along the boundary of a CurvedPolygon object on a vector field.
The line integral is evaluated on each curve in the CurvedPolygon, and added together to represent the total integral. The Polygon need not be connected. Uses 1D Gaussian quadrature generated by MFEM.
[in] | cpoly | the CurvedPolygon object |
[in] | vector_integrand | the lambda function representing the integrand. Must accept a Point<T, NDIM> as input and return a Vector<double, NDIM> |
[in] | npts | the number of quadrature points to evaluate the line integral on each edge of the CurvedPolygon |
References axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), and axom::mint::SEGMENT.
double axom::primal::evaluate_vector_line_integral | ( | const primal::BezierCurve< T, NDIMS > & | c, |
Lambda && | vector_integrand, | ||
int | npts | ||
) |
Evaluate a line integral on a single Bezier curve on a vector field.
[in] | c | the Bezier curve object |
[in] | vector_integrand | the lambda function representing the integrand. Must accept a Point<T, NDIMS> as input, and return a Vector<double, NDIMS>. |
[in] | npts | the number of quadrature nodes |
References axom::mint::SEGMENT.
double axom::primal::evaluate_area_integral | ( | const primal::CurvedPolygon< T, 2 > | cpoly, |
Lambda && | integrand, | ||
int | npts_Q, | ||
int | npts_P = 0 |
||
) |
Evaluate an integral on the interior of a CurvedPolygon object.
See above definition for details.
[in] | cs | the array of Bezier curve objects that bound the region |
[in] | integrand | the lambda function representing the integrand. Must accept a 2D point as input and return a double |
[in] | npts_Q | the number of quadrature points to evaluate the line integral |
[in] | npts_P | the number of quadrature points to evaluate the antiderivative |
References axom::utilities::min(), axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), and axom::mint::SEGMENT.
bool axom::primal::in_curved_polygon | ( | const Point< T, 2 > & | query, |
const CurvedPolygon< T, 2 > & | cpoly, | ||
bool | useNonzeroRule = true , |
||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Robustly determine if query point is interior to a curved polygon.
[in] | query | The query point to test |
[in] | cpoly | The CurvedPolygon object to test for containment |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Determines containment using the (rounded) winding number with respect to the given curved polygon. This algorithm is robust, as the winding number is rounded in the final in/out determination. Different protocols determine containment from the winding number differently. Nonzero Rule: If the winding number is nonzero, the point is interior. Even/Odd rule: If the winding number is odd, it is interior. Exterior otherwise.
References winding_number().
bool axom::primal::in_polygon | ( | const Point< T, 2 > & | query, |
const Polygon< T, 2 > & | poly, | ||
bool | includeBoundary = false , |
||
bool | useNonzeroRule = true , |
||
double | edge_tol = 1e-8 |
||
) |
Determines containment for a point in a polygon.
[in] | query | The query point to test |
[in] | poly | The Polygon object to test for containment |
[in] | includeBoundary | If true, points on the boundary are considered interior. |
[in] | useNonzeroRule | If false, use even/odd protocol for inclusion |
[in] | edge_tol | The distance at which a point is considered on the boundary |
Determines containment using the winding number with respect to the given polygon. Different protocols determine containment from the winding number differently. Nonzero Rule: If the winding number is nonzero, the point is interior. Even/Odd rule: If the winding number is odd, it is interior. Exterior otherwise.
References winding_number().
bool axom::primal::in_polyhedron | ( | const Point< T, 3 > & | query, |
const Polyhedron< T, 3 > & | poly, | ||
bool | includeBoundary = false , |
||
bool | useNonzeroRule = true , |
||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Determines containment for a point in a polygon.
[in] | query | The query point to test |
[in] | poly | The Polyhedron object to test for containment |
[in] | includeBoundary | If true, points on the boundary are considered interior. |
[in] | useNonzeroRule | If false, use even/odd protocol for inclusion |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | The tolerance level for collinearity |
Determines containment using the winding number with respect to the given polygon. Different protocols determine containment from the winding number differently. Nonzero Rule: If the winding number is nonzero, the point is interior. Even/Odd rule: If the winding number is odd, it is interior. Exterior otherwise.
References winding_number().
|
inline |
Tests whether a query point lies inside a 2D triangle's circumcircle.
A triangle's circumcircle is the unique circle (i.e. a 2-sphere) that passes through each of its three vertices.
[in] | q | the query point |
[in] | p0 | the first vertex of the triangle |
[in] | p1 | the second vertex of the triangle |
[in] | p2 | the third vertex of the triangle |
[in] | EPS | tolerance for determining if q is on the boundary. Default: 1e-8. |
References axom::numerics::determinant(), and axom::utilities::isNearlyEqual().
|
inline |
Tests whether a query point lies inside a 2D triangle's circumcircle.
[in] | q | the query point |
[in] | tri | the triangle |
[in] | EPS | tolerance for determining if q is on the boundary. Default: 1e-8. |
References in_sphere().
|
inline |
Tests whether a query point lies inside a 3D tetrahedron's circumsphere.
A tetrahedron's circumsphere is the unique sphere that passes through each of its four vertices.
[in] | q | the query point |
[in] | p0 | the first vertex of the tetrahedron |
[in] | p1 | the second vertex of the tetrahedron |
[in] | p2 | the third vertex of the tetrahedron |
[in] | p3 | the fourth vertex of the tetrahedron |
[in] | EPS | tolerance for determining if q is on the boundary. Default: 1e-8. |
References axom::numerics::determinant(), and axom::utilities::isNearlyEqual().
|
inline |
Tests whether a query point lies inside a 3D tetrahedron's circumsphere.
[in] | q | the query point |
[in] | tet | the tetrahedron |
[in] | EPS | tolerance for determining if q is on the boundary. Default: 1e-8. |
References in_sphere().
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const Triangle< T, 3 > & | t1, |
const Triangle< T, 3 > & | t2, | ||
bool | includeBoundary = false , |
||
double | EPS = 1E-08 |
||
) |
Tests if 3D Triangles t1 and t2 intersect.
[in] | t1 | The first triangle |
[in] | t2 | The second triangle |
[in] | includeBoundary | Indicates if boundaries should be considered when detecting intersections (default: false) |
[in] | EPS | Tolerance for determining intersections (default: 1E-8) |
If parameter includeBoundary is false (default), this function will return true if the interior of t1 intersects the interior of t2. To include triangle boundaries in intersections, specify includeBoundary as true.
bool axom::primal::intersect | ( | const Triangle< T, 2 > & | t1, |
const Triangle< T, 2 > & | t2, | ||
bool | includeBoundary = false , |
||
double | EPS = 1E-08 |
||
) |
Tests if 2D Triangles t1 and t2 intersect.
[in] | t1 | The first triangle |
[in] | t2 | The second triangle |
[in] | includeBoundary | Indicates if boundaries should be considered when detecting intersections (default: false) |
[in] | EPS | Tolerance for determining intersections (default: 1E-8) |
If parameter includeBoundary is false (default), this function will return true if the interior of t1 intersects the interior of t2. To include triangle boundaries in intersections, specify includeBoundary as true.
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const BoundingBox< T, 3 > & | bb | ||
) |
Determines if a triangle and a bounding box intersect.
[in] | tri | user-supplied triangle (with three vertices). |
[in] | bb | user-supplied axis aligned bounding box. |
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Ray< T, 3 > & | ray | ||
) |
Determines if a 3D triangle intersects a 3D ray.
[in] | tri | A 3D triangle |
[in] | ray | A 3D ray |
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Ray< T, 3 > & | ray, | ||
T & | t | ||
) |
Determines if a 3D triangle intersects a 3D ray.
[in] | tri | A 3D triangle |
[in] | ray | A 3D ray |
[out] | t | Intersection point of tri and R, w.r.t. parametrization of R |
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Ray< T, 3 > & | ray, | ||
T & | t, | ||
Point< double, 3 > & | p | ||
) |
Determines if a 3D triangle intersects a 3D ray.
[in] | tri | A 3D triangle |
[in] | ray | A 3D ray |
[out] | t | Intersection point of tri and R, w.r.t. parametrization of R |
[out] | p | Intersection point of tri and R, in barycentric coordinates relative to tri. |
References axom::primal::Point< T, NDIMS >::array().
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Segment< T, 3 > & | seg | ||
) |
Determines if a 3D triangle intersects a 3D segment.
[in] | tri | A 3D triangle |
[in] | seg | A 3D line segment |
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Segment< T, 3 > & | seg, | ||
T & | t | ||
) |
Determines if a 3D triangle intersects a 3D segment.
[in] | tri | A 3D triangle |
[in] | seg | A 3D line segment |
[out] | t | Intersection point of tri and seg, w.r.t. seg's parametrization |
bool axom::primal::intersect | ( | const Triangle< T, 3 > & | tri, |
const Segment< T, 3 > & | seg, | ||
T & | t, | ||
Point< double, 3 > & | p | ||
) |
Determines if a 3D triangle intersects a 3D segment.
[in] | tri | A 3D triangle |
[in] | seg | A 3D line segment |
[out] | t | Intersection point of tri and seg, w.r.t. seg's parametrization |
[out] | p | Intersection point of tri and R, in barycentric coordinates relative to tri. |
References axom::primal::Point< T, NDIMS >::array().
bool axom::primal::intersect | ( | const Ray< T, 2 > & | R, |
const Segment< T, 2 > & | S, | ||
T & | ray_param, | ||
T & | seg_param, | ||
const T | EPS = 1e-8 |
||
) |
Computes the intersection of the given ray, R, with the segment, S.
[in] | R | the specified ray |
[in] | S | the segment to check |
[out] | ray_param | parametric coordinate of intersection along R, valid only if status=true. |
[out] | seg_param | parametric coordinate of intersection along S, valid only if status=true. |
[in] | EPS | tolerance for intersection tests |
bool axom::primal::intersect | ( | const Ray< T, 2 > & | R, |
const Segment< T, 2 > & | S, | ||
T & | ray_param | ||
) |
Computes the intersection of the given ray, R, with the segment, S.
[in] | R | the specified ray |
[in] | S | the segment to check |
[out] | ray_param | parametric coordinate of intersection along R, valid only if status=true |
References intersect().
bool axom::primal::intersect | ( | const Ray< T, 2 > & | R, |
const Segment< T, 2 > & | S, | ||
Point< T, 2 > & | ip, | ||
const T | EPS = 1e-8 |
||
) |
Computes the intersection of the given ray, R, with the segment, S.
[in] | R | the specified ray |
[in] | S | the segment to check |
[out] | ip | the intersection point on S, valid only if status=true. |
[in] | EPS | tolerance for intersection tests |
References axom::primal::Ray< T, NDIMS >::at().
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const Ray< T, DIM > & | R, |
const BoundingBox< T, DIM > & | bb, | ||
Point< T, DIM > & | ip | ||
) |
Computes the intersection of the given ray, R, with the Box, bb.
[in] | R | the specified ray |
[in] | bb | the user-supplied axis-aligned bounding box |
[out] | ip | the intersection point where R intersects bb. |
bool axom::primal::intersect | ( | const Segment< T, DIM > & | S, |
const BoundingBox< T, DIM > & | bb, | ||
T & | tmin, | ||
T & | tmax, | ||
const double & | EPS = 1e-8 |
||
) |
Computes the intersection of the given segment, S, with the Box, bb. If an intersection is found, output parameter ip contains an intersection point.
Computes Segment-Box intersection using the slab method from pg 180 of Real Time Collision Detection by Christer Ericson. This variant returns the two parametric coordinates of the intersection segment as OUT parameters
References axom::primal::Segment< T, NDIMS >::length().
bool axom::primal::intersect | ( | const Segment< T, DIM > & | S, |
const BoundingBox< T, DIM > & | bb, | ||
Point< T, DIM > & | ip, | ||
const double & | EPS = 1e-8 |
||
) |
This variant returns a point within the intersection as an OUT parameters.
References axom::primal::Segment< T, NDIMS >::at(), and intersect().
bool axom::primal::intersect | ( | const Segment< T, DIM > & | S, |
const BoundingBox< T, DIM > & | bb | ||
) |
References intersect().
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const BoundingBox< T, DIM > & | bb1, |
const BoundingBox< T, DIM > & | bb2 | ||
) |
Determines if two axis aligned bounding boxes intersect.
[in] | bb1 | user-supplied axis aligned bounding box. |
[in] | bb2 | user-supplied axis aligned bounding box. |
References axom::primal::BoundingBox< T, NDIMS >::intersectsWith().
bool axom::primal::intersect | ( | const Sphere< T, DIM > & | s1, |
const Sphere< T, DIM > & | s2, | ||
double | TOL = 1.e-9 |
||
) |
Determines if two spheres intersect.
[in] | s1 | user-supplied sphere object to check for intersection. |
[in] | s2 | user-supplied sphere object to check for intersection. |
[in] | TOL | tolerance used for intersection check (optional) |
References axom::primal::Sphere< T, NDIMS >::intersectsWith().
bool axom::primal::intersect | ( | const OrientedBoundingBox< T, 1 > & | b1, |
const OrientedBoundingBox< T, 1 > & | b2 | ||
) |
bool axom::primal::intersect | ( | const OrientedBoundingBox< T, 2 > & | b1, |
const OrientedBoundingBox< T, 2 > & | b2 | ||
) |
Determines if a 2D OBB intersects a 2D OBB.
[in] | b1 | A 2D OrientedBoundingBox |
[in] | b2 | A 2D OrientedBoundingBox |
bool axom::primal::intersect | ( | const OrientedBoundingBox< T, 3 > & | b1, |
const OrientedBoundingBox< T, 3 > & | b2, | ||
double | EPS = 1E-4 |
||
) |
Determines if a 3D OBB intersects a 3D OBB.
[in] | b1 | A 3D OrientedBoundingBox |
[in] | b2 | A 3D OrientedBoundingBox |
[in] | EPS | error tolerance for intersection |
bool axom::primal::intersect | ( | const BezierCurve< T, 2 > & | c1, |
const BezierCurve< T, 2 > & | c2, | ||
std::vector< T > & | sp, | ||
std::vector< T > & | tp, | ||
double | tol = 1E-8 |
||
) |
Tests if two Bezier Curves c1 and c2 intersect.
[in] | c1 | the first BezierCurve, parametrized in [0,1) |
[in] | c2 | the second BezierCurve, parametrized in [0,1) |
[out] | sp | vector of parameter space intersection points for c1 |
[out] | tp | vector of parameter space intersection points for c2 |
[in] | tol | tolerance parameter for determining if a curve can be approximated by a line segment. |
Finds all intersection points between the two curves.
References axom::primal::BezierCurve< T, NDIMS >::getOrder().
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const Plane< T, 3 > & | p, |
const BoundingBox< T, 3 > & | bb, | ||
bool | checkOverlaps = false , |
||
double | EPS = 1E-08 |
||
) |
Determines if a 3D plane intersects a 3D bounding box. By default (checkOverlaps is false), checks if |s| <= r, where "s" is the distance of the bounding box center to the plane, and "r" is the projected radius of the bounding box along the line parallel to the plane normal and going through the box center. If checkOverlaps is true, checks if |s| < r, where the bounding box overlaps both half spaces of the plane.
[in] | p | A 3D plane |
[in] | bb | A 3D bounding box |
[in] | checkOverlaps | If true, checks if bounding box overlaps both halfspaces of the plane. Otherwise, overlap of both halfspaces is not guaranteed. Default is false. |
[in] | EPS | tolerance parameter for determining if "s" is just within min/max of "r". |
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const Plane< T, DIM > & | plane, |
const Segment< T, DIM > & | seg, | ||
T & | t | ||
) |
Determines if a plane intersects a segment.
[in] | plane | A plane |
[in] | seg | A line segment |
[out] | t | Intersection point of plane and seg, w.r.t. seg's parametrization |
AXOM_HOST_DEVICE bool axom::primal::intersect | ( | const Plane< T, 3 > & | p, |
const Tetrahedron< T, 3 > & | tet, | ||
Polygon< T, 3 > & | intersection | ||
) |
Determines if a 3D plane intersects a tetrahedron.
[in] | p | A 3D plane |
[in] | tet | A 3D tetrahedron |
[out] | intersection | A polygon containing the intersection. |
AXOM_HOST_DEVICE T axom::primal::intersection_volume | ( | const Hexahedron< T, 3 > & | hex, |
const Tetrahedron< T, 3 > & | tet, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Finds the absolute (unsigned) intersection volume between a hexahedron and a tetrahedron.
[in] | hex | The hexahedron |
[in] | tet | The tetrahedron |
[in] | eps | The tolerance for determining the intersection |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
AXOM_HOST_DEVICE T axom::primal::intersection_volume | ( | const Tetrahedron< T, 3 > & | tet, |
const Hexahedron< T, 3 > & | hex, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and a hexahedron.
[in] | hex | The tetrahedron |
[in] | tet | The hexahedron |
[in] | eps | The tolerance for determining the intersection |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References intersection_volume().
AXOM_HOST_DEVICE T axom::primal::intersection_volume | ( | const Octahedron< T, 3 > & | oct, |
const Tetrahedron< T, 3 > & | tet, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Finds the absolute (unsigned) intersection volume between a octahedron and a tetrahedron.
[in] | oct | The octahedron |
[in] | tet | The tetrahedron |
[in] | eps | The tolerance for determining the intersection |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
AXOM_HOST_DEVICE T axom::primal::intersection_volume | ( | const Tetrahedron< T, 3 > & | tet, |
const Octahedron< T, 3 > & | oct, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and a octahedron.
[in] | oct | The tetrahedron |
[in] | tet | The octahedron |
[in] | eps | The tolerance for determining the intersection |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References intersection_volume().
AXOM_HOST_DEVICE T axom::primal::intersection_volume | ( | const Tetrahedron< T, 3 > & | tet1, |
const Tetrahedron< T, 3 > & | tet2, | ||
double | eps = 1.e-10 , |
||
bool | tryFixOrientation = false |
||
) |
Finds the absolute (unsigned) intersection volume between a tetrahedron and another tetrahedron.
[in] | tet1 | The tetrahedron |
[in] | tet2 | The other tetrahedron |
[in] | eps | The tolerance for determining the intersection |
[in] | tryFixOrientation | If true, takes each shape with a negative signed volume and swaps the order of some vertices in that shape to try to obtain a nonnegative signed volume. Defaults to false. |
References clip().
bool axom::primal::is_convex | ( | const Polygon< T, 2 > & | poly, |
double | EPS = 1e-8 |
||
) |
Determines if a polygon defined by ordered vertices is convex.
[in] | poly | The polygon |
A 2D polygon is convex when every line that does not contain an edge intersects the shape at most twice. Checks whether for each pair of vertices P[i-1]P[i+1], the point P[i] and (P[0] or P[n]) lie on the same side of the line connecting them.
Algorithm adapted from: Y. L. Ma, W.T. Hewitt. "Point inversion and projection for NURBS curve and surface: Control polygon approach" Computer Aided Geometric Design 20(2):79-99, May 2003.
References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), ON_BOUNDARY, and orientation().
|
inline |
Computes the orientation of a point p with respect to an oriented triangle tri.
[in] | p | the query point |
[in] | tri | an oriented triangle |
[in] | EPS | a tolerance for determining if p and tri are coplanar |
References axom::numerics::determinant(), axom::utilities::isNearlyEqual(), ON_BOUNDARY, ON_NEGATIVE_SIDE, and ON_POSITIVE_SIDE.
|
inline |
Computes the orientation of a point p with respect to an oriented segment.
[in] | p | the query point |
[in] | seg | an oriented segment |
[in] | EPS | a tolerance for determining if p and seg are coplanar |
References axom::numerics::determinant(), axom::utilities::isNearlyEqual(), ON_BOUNDARY, ON_NEGATIVE_SIDE, and ON_POSITIVE_SIDE.
void axom::primal::split | ( | const Octahedron< Tp, NDIMS > & | oct, |
axom::Array< Tetrahedron< Tp, NDIMS >> & | out | ||
) |
Splits an Octahedron into eight Tetrahedrons.
Tp | the coordinate type, such double or float |
NDIMS | the number of spatial dimensions (must be 3). |
[in] | oct | The Octahedron to split |
[out] | out | The axom::Array of Tetrahedron objects; the fragments of oct are appended to out. |
The tets are produced by putting a vertex at the centroid of the oct and drawing an edge from each vertex to the centroid.
References SLIC_ASSERT.
|
inline |
Computes the squared distance from point A to point B, represented by arrays of length N.
[in] | A | source point |
[in] | B | end point. |
[in] | N | length of A and B. |
|
inline |
Computes the squared distance from point A to point B.
[in] | A | source point |
[in] | B | end point. |
References axom::primal::Vector< T, NDIMS >::squared_norm().
|
inline |
Computes the minimum squared distance from a query point, P, to a given axis-aligned bounding box B.
[in] | P | the query point. |
[in] | B | the axis-aligned bounding box. |
References axom::utilities::clampVal(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::primal::BoundingBox< T, NDIMS >::isValid(), axom::utilities::max(), and squared_distance().
|
inline |
Computes the minimum squared distance between 2 axis-aligned boxes.
[in] | A | the first axis-aligned bounding box. |
[in] | B | the second axis-aligned bounding box. If the boxes overlap, the minimum distance is zero. |
References axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::primal::BoundingBox< T, NDIMS >::isValid(), axom::utilities::max(), and axom::primal::Vector< T, NDIMS >::squared_norm().
|
inline |
Computes the minimum squared distance from a query point, P, to the given segment, S.
[in] | P | the query point. |
[in] | S | the input segment. |
References squared_distance().
|
inline |
Computes the minimum squared distance from a query point, P, to the closest point on the given triangle.
[in] | P | the query point. |
[in] | tri | the supplied triangle. |
References squared_distance().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const Segment< T, 2 > & | s, | ||
double | edge_tol = 1e-8 |
||
) |
int axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const Triangle< T, 2 > & | tri, | ||
bool | includeBoundary = false , |
||
double | edge_tol = 1e-8 |
||
) |
References winding_number().
int axom::primal::winding_number | ( | const Point< T, 2 > & | R, |
const Polygon< T, 2 > & | P, | ||
bool & | isOnEdge, | ||
bool | includeBoundary, | ||
double | edge_tol | ||
) |
Computes the winding number for a 2D point wrt a 2D polygon.
[in] | R | The query point to test |
[in] | P | The Polygon object to test for containment |
[in] | includeBoundary | If true, points on the boundary are considered interior |
[in] | isOnEdge | An optional return parameter if the point is on the boundary |
[in] | edge_tol | The distance at which a point is considered on the boundary |
Uses an adapted ray-casting approach that counts quarter-rotation of vertices around the query point. Current policy is to return 1 on edges without strict inclusion, 0 on edges with strict inclusion.
The polygon is assumed to be closed, so the winding number is an integer
Directly uses algorithm in Kai Hormann, Alexander Agathos, "The point in polygon problem for arbitrary polygons" Computational Geometry, Volume 20, Issue 3, 2001,
References axom::numerics::determinant(), axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), and squared_distance().
int axom::primal::winding_number | ( | const Point< T, 2 > & | R, |
const Polygon< T, 2 > & | P, | ||
bool | includeBoundary = false , |
||
double | edge_tol = 1e-8 |
||
) |
Computes the winding number for a 2D point wrt a 2D polygon.
[in] | R | The query point to test |
[in] | P | The Polygon object to test for containment |
[in] | includeBoundary | If true, points on the boundary are considered interior |
[in] | edge_tol | The distance at which a point is considered on the boundary |
Computes the integer winding number for a polygon without an additional return parameter for whether the point is on the boundary.
References winding_number().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const BezierCurve< T, 2 > & | c, | ||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the GWN for a 2D point wrt a 2D Bezier curve.
[in] | query | The query point to test |
[in] | c | The Bezier curve object |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN using a recursive, bisection algorithm that constructs a polygon with the same integer WN as the curve closed with a linear segment. The generalized WN of the closing line is then subtracted from the integer WN to return the GWN of the original curve.
Nearly-linear Bezier curves are the base case for recursion.
See Algorithm 2 in Jacob Spainhour, David Gunderman, and Kenneth Weiss. 2024. Robust Containment Queries over Collections of Rational Parametric Curves via Generalized Winding Numbers. ACM Trans. Graph. 43, 4, Article 38 (July 2024)
References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::addVertex(), axom::primal::BezierCurve< T, NDIMS >::boundingBox(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::primal::BoundingBox< T, NDIMS >::expand(), axom::primal::BezierCurve< T, NDIMS >::getOrder(), axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), and winding_number().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const NURBSCurve< T, 2 > & | n, | ||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the GWN for a 2D point wrt a 2D NURBS curve.
[in] | query | The query point to test |
[in] | n | The NURBS curve object |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN by decomposing into rational Bezier curves and summing the resulting GWNs. Far-away curves can be evaluated without decomposition using direct formula.
References axom::primal::NURBSCurve< T, NDIMS >::boundingBox(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::primal::BoundingBox< T, NDIMS >::expand(), axom::primal::NURBSCurve< T, NDIMS >::extractBezier(), axom::primal::NURBSCurve< T, NDIMS >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), and winding_number().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const CurvedPolygon< T, 2 > & | cpoly, | ||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the GWN for a 2D point wrt to a 2D curved polygon.
[in] | query | The query point to test |
[in] | cpoly | The CurvedPolygon object |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN for the curved polygon by summing the GWN for each curved edge
References axom::primal::CurvedPolygon< T, NDIMS >::numEdges(), and winding_number().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const axom::Array< BezierCurve< T, 2 >> & | carray, | ||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the GWN for a 2D point wrt to a collection of 2D Bezier curves.
[in] | query | The query point to test |
[in] | carray | The array of Bezier curves |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Sums the GWN at query
for each curved edge
References AXOM_UNUSED_VAR, and winding_number().
double axom::primal::winding_number | ( | const Point< T, 2 > & | q, |
const axom::Array< NURBSCurve< T, 2 >> & | narray, | ||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the GWN for a 2D point wrt to a collection of 2D NURBS curves.
[in] | query | The query point to test |
[in] | narray | The array of NURBS curves |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Sums the GWN at query
for each curved edge
References AXOM_UNUSED_VAR, and winding_number().
double axom::primal::winding_number | ( | const Point< T, 3 > & | q, |
const Triangle< T, 3 > & | tri, | ||
bool & | isOnFace, | ||
const double | edge_tol = 1e-8 , |
||
const double | EPS = 1e-8 |
||
) |
Computes the GWN for a 3D point wrt a 3D triangle.
[in] | query | The query point to test |
[in] | tri | The 3D Triangle object |
[in] | isOnFace | An optional return parameter if the point is on the triangle |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN as the solid angle modulo 4pi using the formula from Oosterom, Strackee, "The Solid Angle of a Plane Triangle" IEEE Transactions on Biomedical Engineering, Vol BME-30, No. 2, February 1983 with extra adjustments if the triangle takes up a full octant
References axom::primal::Triangle< T, NDIMS >::area(), and axom::utilities::isNearlyEqual().
double axom::primal::winding_number | ( | const Point< T, 3 > & | q, |
const Triangle< T, 3 > & | tri, | ||
const double | edge_tol = 1e-8 , |
||
const double | EPS = 1e-8 |
||
) |
Computes the GWN for a 3D point wrt a 3D triangle.
[in] | query | The query point to test |
[in] | tri | The 3D Triangle object |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN for the triangle without an additional return parameter
References winding_number().
double axom::primal::winding_number | ( | const Point< T, 3 > & | q, |
const Polygon< T, 3 > & | poly, | ||
bool & | isOnFace, | ||
const double | edge_tol = 1e-8 , |
||
const double | EPS = 1e-8 |
||
) |
Computes the GWN for a 3D point wrt a 3D planar polygon.
[in] | query | The query point to test |
[in] | poly | The Polygon object |
[in] | isOnFace | Return variable to show if the point is on the polygon |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Triangulates the polygon and computes the triangular GWN for each component
References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), and winding_number().
double axom::primal::winding_number | ( | const Point< T, 3 > & | q, |
const Polygon< T, 3 > & | poly, | ||
const double | edge_tol = 1e-8 , |
||
const double | EPS = 1e-8 |
||
) |
Computes the GWN for a 3D point wrt a 3D planar polygon.
[in] | query | The query point to test |
[in] | poly | The Polygon object |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the GWN for the polygon without an additional return parameter
References winding_number().
int axom::primal::winding_number | ( | const Point< T, 3 > & | query, |
const Polyhedron< T, 3 > & | poly, | ||
bool | includeBoundary = false , |
||
double | edge_tol = 1e-8 , |
||
double | EPS = 1e-8 |
||
) |
Computes the winding number for a 3D point wrt a 3D convex polyhedron.
[in] | query | The query point to test |
[in] | poly | The Polyhedron object |
[in] | includeBoundary | If true, points on the boundary are considered interior. |
[in] | edge_tol | The physical distance level at which objects are considered indistinguishable |
[in] | EPS | Miscellaneous numerical tolerance level for nonphysical distances |
Computes the faces of the polyhedron and computes the GWN for each. The sum is then rounded to the nearest integer, as the shape is assumed to be closed.
References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::addVertex(), axom::Array< T, DIM, SPACE >::data(), axom::primal::Polyhedron< T, NDIMS >::getFaces(), axom::primal::Polyhedron< T, NDIMS >::hasNeighbors(), axom::primal::Polyhedron< T, NDIMS >::numVertices(), SLIC_ASSERT, and winding_number().