AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal Namespace Reference

Namespaces

 detail
 
 experimental
 
 internal
 

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  Cone
 Represents a cone defined by a base radius, a top radius, the length, the orientation and the location of the base center. More...
 
class  CurvedPolygon
 Represents a polygon with generic curves for edges. 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  Line
 Represents a line, \( L(t) \in \mathcal{R}^d \) , defined by an origin point, \( P \) and a normalized direction vector, \( \vec{d} \), \( \ni L(t)= P + t\vec{d} \forall t \in \mathcal{R} \). More...
 
class  NURBSCurve
 Represents a NURBS curve defined by an array of control points, weights and knots. More...
 
class  NURBSPatch
 Represents a NURBS patch defined by a 2D array of control points. More...
 
class  TrimmingCurveQuadratureData
 
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...
 
struct  WindingTolerances
 Struct containing tolerances shared across GWN values with sensible defaults. 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 Cone< T, NDIMS > &Cone)
 Free functions implementing Cone's operators. More...
 
template<typename T , int NDIMS, PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS > regular_polygon (int nSides, T radius=T {1}, const axom::numerics::Matrix< T > &transform=axom::numerics::Matrix< T >::identity(NDIMS))
 Create a regular polygon. More...
 
template<typename T >
Polyhedron< T, 3 > regular_prism (int numSides, T radius=1, T height=1, const axom::numerics::Matrix< T > &transform=axom::numerics::Matrix< T >::identity(4))
 Construct a regular 3D prism. More...
 
template<typename CurveType >
std::ostream & operator<< (std::ostream &os, const CurvedPolygon< CurveType > &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 Line< T, NDIMS > &line)
 Overloaded output operator for lines. 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>
Point< T, NDIMS > transform_point (const Point< T, NDIMS > &pt, const axom::numerics::Matrix< T > &transform=axom::numerics::Matrix< T >::identity(NDIMS))
 Transform a point using a transformation matrix. 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::primal::PolygonArray ARRAY_TYPE, int MAX_VERTS>
AXOM_HOST_DEVICE Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > clip (const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > &subjectPolygon, const Plane< T, 2 > &clipPlane, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 2D subject polygon against a clip plane 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 Hexahedron< T, 3 > &hex1, const Hexahedron< T, 3 > &hex2, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D hexahedron against a hexahedron in 3D, returning the geometric intersection of the hexahedron and the hexahedron 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 Polyhedron< T, 3 > &poly, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D polyhedron against another polyhedron in 3D, returning the geometric intersection as a polyhedron. More...
 
template<typename T >
AXOM_HOST_DEVICE Polyhedron< T, 3 > clip (const Polyhedron< T, 3 > &poly, const Tetrahedron< T, 3 > &tet, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D polyhedron against another polyhedron in 3D, returning the geometric intersection as a polyhedron. More...
 
template<typename T >
AXOM_HOST_DEVICE Polyhedron< T, 3 > clip (const Hexahedron< T, 3 > &hex, const Polyhedron< T, 3 > &poly, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D hexahedron against a polyhedron in 3D, returning the geometric intersection as a polyhedron. More...
 
template<typename T >
AXOM_HOST_DEVICE Polyhedron< T, 3 > clip (const Polyhedron< T, 3 > &poly, const Hexahedron< T, 3 > &hex, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D polyhedron against a hexahedron in 3D, returning the geometric intersection as a polyhedron. More...
 
template<typename T >
AXOM_HOST_DEVICE Polyhedron< T, 3 > clip (const Polyhedron< T, 3 > &poly1, const Polyhedron< T, 3 > &poly2, double eps=1.e-10)
 Clips a 3D polyhedron against another polyhedron 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 >
AXOM_HOST_DEVICE Polyhedron< T, 3 > clip (const Polyhedron< T, 3 > &poly, const Plane< T, 3 > &plane, double eps=1.e-10)
 Clips a 3D polyhedron 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 Polyhedron< T, 3 > &poly, double eps=1.e-10)
 Clips a 3D polyhedron 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 Hexahedron< T, 3 > &hex, const Plane< T, 3 > &plane, double eps=1.e-10, bool tryFixOrientation=false)
 Clips a 3D hexahedron 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, PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
AXOM_HOST_DEVICE BoundingBox< T, NDIMS > compute_bounding_box (const Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS > &poly)
 Creates a bounding box around a Polygon. More...
 
template<typename T >
sector_area (const primal::BezierCurve< T, 2 > &curve)
 Calculates the signed 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 area-weighted centroid numerator of a planar, nonrational Bezier curve. More...
 
template<typename T >
area (const primal::CurvedPolygon< BezierCurve< 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< BezierCurve< T, 2 >> &poly, double tol=1e-8)
 Returns the centroid of the CurvedPolygon. More...
 
template<typename T , typename CurveType >
bool in_curved_polygon (const Point< T, 2 > &query, const CurvedPolygon< CurveType > &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 >
bool in_sphere (const BoundingBox< T, 2 > &bb, const Sphere< T, 2 > &circle)
 Tests whether a bounding box lies inside a 2D sphere. More...
 
template<typename T >
AXOM_HOST_DEVICE bool intersect (const Segment< T, 3 > &P, const Segment< T, 3 > &Q, Point< T, 3 > &intersection, const T EPS=static_cast< T >(1e-08))
 Determines if two 3D segments intersect. More...
 
template<typename T >
bool intersect (const Ray< T, 3 > &ray, const BezierPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol, double EPS, bool isHalfOpen, bool &success)
 Determines if a ray intersects a Bezier patch. More...
 
template<typename T >
bool intersect (const Ray< T, 3 > &ray, const BezierPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol=1e-8, double EPS=1e-8, bool isHalfOpen=false)
 ! More...
 
template<typename T >
bool intersect (const Line< T, 3 > &line, const BezierPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol, double EPS, bool isHalfOpen, bool &success)
 Determines if a line (two-sided ray) intersects a Bezier patch. More...
 
template<typename T >
bool intersect (const Line< T, 3 > &line, const BezierPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol=1e-8, double EPS=1e-8, bool isHalfOpen=false)
 ! More...
 
template<typename T >
bool intersect (const Ray< T, 3 > &ray, const NURBSPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol, double EPS, bool countUntrimmed, bool isHalfOpen, bool &success)
 Determines if a ray intersects a NURBS patch. More...
 
template<typename T >
bool intersect (const Ray< T, 3 > &ray, const NURBSPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol=1e-8, double EPS=1e-8, bool countUntrimmed=true, bool isHalfOpen=false)
 ! More...
 
template<typename T >
bool intersect (const Line< T, 3 > &line, const NURBSPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol, double EPS, bool countUntrimmed, bool isHalfOpen, bool &success)
 Determines if a line (two-sided ray) intersects a NURBS patch. More...
 
template<typename T >
bool intersect (const Line< T, 3 > &line, const NURBSPatch< T, 3 > &patch, axom::Array< T > &t, axom::Array< T > &u, axom::Array< T > &v, double tol=1e-8, double EPS=1e-8, bool countUntrimmed=true, bool isHalfOpen=false)
 ! More...
 
template<typename T >
bool intersect (const NURBSCurve< T, 2 > &n1, const NURBSCurve< T, 2 > &n2, axom::Array< T > &p1, axom::Array< T > &p2, double tol=1.0E-8)
 Finds the intersection points for two NURBS curves in 2D. More...
 
template<typename T >
AXOM_HOST_DEVICEintersection_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_DEVICEintersection_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_DEVICEintersection_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_DEVICEintersection_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_DEVICEintersection_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 T , PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
AXOM_HOST_DEVICE primal::Polygon< T, 3, ARRAY_TYPE, MAX_VERTS > slice (const primal::Tetrahedron< T, 3 > &tet, const primal::Plane< T, 3 > &plane)
 Slices a 3D tetrahedron with a plane and returns the resulting polygon. More...
 
template<typename Tp >
void split (const Octahedron< Tp, 3 > &oct, axom::Array< Tetrahedron< Tp, 3 >> &out)
 Splits an Octahedron into eight Tetrahedrons. More...
 
template<typename Tp >
AXOM_HOST_DEVICE void split (const Octahedron< Tp, 3 > &oct, Tetrahedron< Tp, 3 > *outPtr)
 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>
AXOM_HOST_DEVICE 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>
AXOM_HOST_DEVICE 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...
 
template<typename T >
double winding_number (const Point< T, 2 > &q, const Segment< T, 2 > &s, double edge_tol=1e-8)
 Compute the GWN for a 2D point wrt a 2D line segment. More...
 
template<typename T >
int winding_number (const Point< T, 2 > &q, const Triangle< T, 2 > &tri, bool includeBoundary=false, double edge_tol=1e-8)
 Compute the winding number for a 2D point wrt a 2D triangle. More...
 
template<typename T >
int winding_number (const Point< T, 2 > &R, const Polygon< T, 2 > &P, bool &isOnEdge, bool includeBoundary=false, double edge_tol=1e-8)
 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 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 BezierCurve< T, 2 > &bezier, 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 , typename CurveType >
double winding_number (const Point< T, 2 > &q, const CurvedPolygon< CurveType > &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...
 
template<typename T >
double winding_number (const Point< T, 2 > &query, const detail::NURBSCurveGWNCache< T > &nurbs_cache, bool &isOnCurve, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for a 2D point wrt memoized data for a 2D NURBS curve. More...
 
template<typename T >
double winding_number (const Point< T, 2 > &q, const detail::NURBSCurveGWNCache< T > &nurbs_cache, double edge_tol=1e-8, double EPS=1e-8)
 Overload without optional return parameter. More...
 
template<typename T >
double winding_number (const Point< T, 2 > &query, const axom::Array< detail::NURBSCurveGWNCache< T >> &nurbs_cache_arr, bool &isOnCurve, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for a 2D point wrt an array of memoized data for 2D NURBS curves. More...
 
template<typename T >
double winding_number (const Point< T, 2 > &query, const axom::ArrayView< const detail::NURBSCurveGWNCache< T >> &nurbs_curve_arr, double edge_tol=1e-8, double EPS=1e-8)
 Overload for views. More...
 
template<typename T >
double winding_number (const Point< T, 2 > &query, const axom::Array< detail::NURBSCurveGWNCache< T >> &nurbs_curve_arr, double edge_tol=1e-8, double EPS=1e-8)
 Overload without optional return parameter. More...
 
template<typename T >
axom::Array< double > winding_number (const axom::Array< Point< T, 2 >> &query_arr, const axom::Array< detail::NURBSCurveGWNCache< T >> &nurbs_cache_arr, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for an array of 2D points wrt an array of cached data for 2D NURBS curves. More...
 
template<typename T , typename CurveType >
axom::Array< double > winding_number (const axom::Array< Point< T, 2 >> &query_arr, const axom::Array< CurveType > &curve_arr, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for an array of 2D points wrt an array of generic 2D curves. More...
 
template<typename T , typename CurveType >
axom::Array< double > winding_number (const axom::Array< Point< T, 2 >> &q_arr, const CurvedPolygon< CurveType > &cpoly, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for an array of 2D points wrt to a 2D curved polygon. More...
 
template<typename T >
axom::Array< double > winding_number (const axom::Array< Point< T, 2 >> &q_arr, const CurvedPolygon< detail::NURBSCurveGWNCache< T >> &cpoly, double edge_tol=1e-8, double EPS=1e-8)
 Computes the GWN for an array of 2D points wrt to a 2D curved polygon. 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 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...
 
Evaluates scalar-field line integrals for functions f : R^n -> R^m
template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType evaluate_line_integral (const primal::CurvedPolygon< CurveType > &cpoly, Lambda &&integrand, int npts)
 Evaluate a line integral along the boundary of a CurvedPolygon object for a function with an arbitrary return type. More...
 
template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType evaluate_line_integral (const CurveType &c, Lambda &&integrand, int npts)
 Evaluate a line integral along the boundary of a generic curve for a function with an arbitrary return type. More...
 
template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType evaluate_line_integral (const axom::Array< CurveType > &carray, Lambda &&integrand, int npts)
 Evaluate a line integral on an array of NURBS curves on a scalar field for a function with an arbitrary return type. More...
 
Evaluates vector-field line integrals for functions f : R^n -> R^n
template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType evaluate_vector_line_integral (const CurvedPolygon< CurveType > &cpoly, Lambda &&vector_integrand, int npts)
 Evaluate a vector-field line integral along the boundary of a CurvedPolygon object. More...
 
template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType evaluate_vector_line_integral (const CurveType &c, Lambda &&vector_integrand, int npts)
 Evaluate a vector-field line integral on a single generic curve. More...
 
template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType evaluate_vector_line_integral (const axom::Array< CurveType > &carray, Lambda &&vector_integrand, int npts)
 Evaluate a line integral on an array of generic curves on a vector field. More...
 
Evaluates scalar-field 2D area integrals for functions f : R^2 -> R^m
template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType evaluate_area_integral (const primal::CurvedPolygon< CurveType > &cpoly, Lambda &&integrand, int npts_Q, int npts_P=0)
 Evaluate an integral on the interior of a CurvedPolygon object. More...
 
template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType evaluate_area_integral (const axom::Array< CurveType > &carray, Lambda &&integrand, int npts_Q, int npts_P=0)
 Evaluate an integral on the interior of a region bound by 2D curves. More...
 
Evaluates scalar-field surface integrals for functions f : R^3 -> R^m
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType evaluate_surface_integral (const primal::BezierPatch< T, 3 > &patch, Lambda &&integrand, int npts)
 Evaluate a scalar surface integral on a single Bezier patch. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType evaluate_surface_integral (const primal::NURBSPatch< T, 3 > &patch, Lambda &&integrand, int npts_Q, int npts_P=0)
 Evaluate a scalar surface integral on a single NURBS patch. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType evaluate_surface_integral (const axom::Array< BezierPatch< T, 3 >> &patches, Lambda &&integrand, int npts)
 Evaluate a scalar surface integral on a collection of Bezier patches. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType evaluate_surface_integral (const axom::Array< NURBSPatch< T, 3 >> &patches, Lambda &&integrand, int npts_Q, int npts_P=0)
 Evaluate a scalar surface integral on a collection of NURBS patches. More...
 
Evaluates scalar-field volume integrals for functions f : R^3 -> R^m
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType evaluate_volume_integral (const primal::BezierPatch< T, 3 > &patch, Lambda &&integrand, T lower_bound_z, int npts_uv, int npts_z=0)
 Evaluate a scalar volume-integral contribution from a single Bezier patch. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType evaluate_volume_integral (const primal::NURBSPatch< T, 3 > &patch, Lambda &&integrand, T lower_bound_z, int npts_Q, int npts_P=0, int npts_Z=0)
 Evaluate a scalar volume-integral contribution from a single NURBS patch. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType evaluate_volume_integral (const axom::Array< BezierPatch< T, 3 >> &patches, Lambda &&integrand, int npts_uv, int npts_z=0)
 Evaluate a scalar volume integral over a collection of Bezier patches. More...
 
template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType evaluate_volume_integral (const axom::Array< NURBSPatch< T, 3 >> &patches, Lambda &&integrand, int npts_Q, int npts_P=0, int npts_Z=0)
 Evaluate a scalar volume integral over a collection of NURBS patches. 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 >
AXOM_HOST_DEVICE 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 >
AXOM_HOST_DEVICE 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 >
AXOM_HOST_DEVICE 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 >
AXOM_HOST_DEVICE 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 >
AXOM_HOST_DEVICE bool intersect (const Ray< T, 2 > &R, const Segment< T, 2 > &S)
 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...
 
template<typename T , int DIM>
AXOM_HOST_DEVICE bool intersect (const Ray< T, DIM > &R, const BoundingBox< T, DIM > &bb)
 Computes the intersection of the given ray, R, with the Box, bb. More...
 
template<typename T , int DIM>
AXOM_HOST_DEVICE bool intersect (const Line< T, DIM > &L, const BoundingBox< T, DIM > &bb, Point< T, DIM > &ip)
 Computes the intersection of the given line, L, with the Box, bb. More...
 
template<typename T , int DIM>
AXOM_HOST_DEVICE bool intersect (const Line< T, DIM > &L, const BoundingBox< T, DIM > &bb)
 Computes the intersection of the given line, L, with the Box, bb. More...
 
Segment-BoundingBox Intersection Routines
template<typename T , int DIM>
AXOM_HOST_DEVICE 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>
AXOM_HOST_DEVICE 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...
 
template<typename T >
bool intersect (const Sphere< T, 2 > &circle, const BoundingBox< T, 2 > &bb)
 Determines if a 2D sphere intersects (overlaps with) a bounding box. More...
 
template<typename T >
bool intersect (const Sphere< T, 2 > &circle, const NURBSCurve< T, 2 > &curve, axom::Array< T > &circle_params, axom::Array< T > &curve_params, double tol=1e-8, double EPS=1e-8)
 Determines if a 2D sphere intersects a NURBS Curve. 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, axom::Array< T > &sp, axom::Array< T > &tp, double tol=1E-8)
 Tests if two Bezier Curves c1 and c2 intersect. More...
 
template<typename T >
bool intersect (const Ray< T, 2 > &r, const BezierCurve< T, 2 > &c, axom::Array< T > &rp, axom::Array< T > &cp, double tol=1E-8, double EPS=1E-8)
 Function to find intersections between a ray and a Bezier curve. More...
 
template<typename T >
bool intersect (const Ray< T, 2 > &r, const NURBSCurve< T, 2 > &n, axom::Array< T > &rp, axom::Array< T > &np, double tol=1E-8, double EPS=1E-8)
 Function to find intersections between a ray and a NURBS curve. 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, const double &EPS=1e-12)
 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 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 > &q, 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...
 
template<typename T >
double winding_number (const Point< T, 3 > &query, const detail::NURBSPatchGWNCache< T > &nurbs, const double edge_tol=1e-8, const double ls_tol=1e-8, const double quad_tol=1e-8, const double disk_size=0.01, const double EPS=1e-8)
 Computes the GWN for a 3D point wrt a 3D NURBS patch with precomputed data. More...
 
template<typename T >
double winding_number (const Point< T, 3 > &query, const axom::ArrayView< const detail::NURBSPatchGWNCache< T >> &nurbs_arr, const double edge_tol=1e-8, const double ls_tol=1e-8, const double quad_tol=1e-8, const double disk_size=0.01, const double EPS=1e-8)
 Overload for a single query and an ArrayView. More...
 
template<typename T , typename SurfaceType >
double winding_number (const Point< T, 3 > &query, const SurfaceType &surf, const double edge_tol=1e-8, const double ls_tol=1e-8, const double quad_tol=1e-8, const double disk_size=0.01, const double EPS=1e-8)
 Computes the GWN for a 3D point wrt a generic 3D surface object. More...
 
template<typename T >
axom::Array< double > winding_number (const axom::Array< Point< T, 3 >> &query_arr, const axom::Array< detail::NURBSPatchGWNCache< T >> &nurbs_arr, const double edge_tol=1e-8, const double ls_tol=1e-8, const double quad_tol=1e-8, const double disk_size=0.01, const double EPS=1e-8)
 Computes the GWN for an array of 3D point wrt an array of NURBS patch cache data. More...
 
template<typename T , typename SurfaceType >
axom::Array< double > winding_number (const axom::Array< Point< T, 3 >> &query_arr, const axom::Array< SurfaceType > &surf_arr, const double edge_tol=1e-8, const double ls_tol=1e-8, const double quad_tol=1e-8, const double disk_size=0.01, const double EPS=1e-8)
 Computes the GWN for an array an array of 3D points wrt an array of generic surfaces. More...
 

Typedef Documentation

◆ Point2D

using axom::primal::Point2D = typedef Point<double, 2>

◆ Point3D

using axom::primal::Point3D = typedef Point<double, 3>

◆ Vector2D

using axom::primal::Vector2D = typedef Vector<double, 2>

◆ Vector3D

using axom::primal::Vector3D = typedef Vector<double, 3>

Enumeration Type Documentation

◆ OrientationResult

Enumerates possible return values for orientation tests.

Enumerator
ON_BOUNDARY 

primitive is on the boundary of a primitive

ON_POSITIVE_SIDE 

primitive is on the positive side of a primitive

ON_NEGATIVE_SIDE 

primitive is on the negative side of a primitive

◆ PolygonArray

The polygon can have a dynamic or static array to store vertices

Enumerator
Dynamic 
Static 

Function Documentation

◆ operator<<() [1/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [2/23]

template<typename T , int NDIMS>
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().

◆ operator==() [1/4]

template<typename T , int NDIMS>
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().

◆ operator!=() [1/4]

template<typename T , int NDIMS>
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.

◆ operator<<() [3/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [4/23]

template<typename T , int NDIMS>
std::ostream& axom::primal::operator<< ( std::ostream &  os,
const Cone< T, NDIMS > &  Cone 
)

Free functions implementing Cone's operators.

References axom::primal::Cone< T, NDIMS >::print().

◆ regular_polygon()

template<typename T , int NDIMS, PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
Polygon<T, NDIMS, ARRAY_TYPE, MAX_VERTS> axom::primal::regular_polygon ( int  nSides,
radius = T {1},
const axom::numerics::Matrix< T > &  transform = axom::numerics::Matrix<T>::identity(NDIMS) 
)

Create a regular polygon.

Parameters
nSidesThe number of sides in the polygon.
radiusThe radius of the polgon from the origin to a point.
transformAn optional transformation matrix, which defaults to the identity matrix for the dimension NDIMS.
Returns
A new regular polygon with nSides sides and radius \radius, transformed by the supplied tranformation matrix.
Note
This is host-only function.

◆ regular_prism()

template<typename T >
Polyhedron<T, 3> axom::primal::regular_prism ( int  numSides,
radius = 1,
height = 1,
const axom::numerics::Matrix< T > &  transform = axom::numerics::Matrix<T>::identity(4) 
)

Construct a regular 3D prism.

Parameters
numSidesThe number of sides on the base polygon.
radiusThe radius of the base polygon.
heightThe height of the prism.
transformAn optional 4x4 matrix transformation.
Returns
A Polyhedron that represents the regular prism.

References axom::primal::Polyhedron< T, NDIMS >::addNeighbors(), axom::primal::Polyhedron< T, NDIMS >::addVertex(), axom::numerics::Matrix< T >::getNumColumns(), axom::numerics::Matrix< T >::getNumRows(), axom::numerics::matrix_multiply(), SLIC_ASSERT, and axom::numerics::Matrix< T >::zeros().

◆ operator<<() [5/23]

template<typename CurveType >
std::ostream & axom::primal::operator<< ( std::ostream &  os,
const CurvedPolygon< CurveType > &  poly 
)

Overloaded output operator for polygons.

Free functions implementing Polygon's operators.

References axom::primal::CurvedPolygon< CurveType >::print().

◆ operator<<() [6/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [7/23]

template<typename T >
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().

◆ operator<<() [8/23]

template<typename T , int NDIMS>
std::ostream & axom::primal::operator<< ( std::ostream &  os,
const Line< T, NDIMS > &  line 
)

Overloaded output operator for lines.

Free functions implementing Line's operators.

References axom::primal::Line< T, NDIMS >::print().

◆ operator<<() [9/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [10/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [11/23]

template<typename T , int NDIMS>
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().

◆ operator==() [2/4]

template<typename T , int NDIMS>
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().

◆ operator!=() [2/4]

template<typename T , int NDIMS>
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

◆ operator<<() [12/23]

template<typename T , int NDIMS>
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().

◆ compute_oriented_bounding_box()

template<typename T , int NDIMS>
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.

Parameters
[in]ptsarray of points
[in]nnumber of points
Note
if n <= 0, invokes default constructor

◆ operator<<() [13/23]

template<typename T , int NDIMS>
std::ostream & axom::primal::operator<< ( std::ostream &  os,
const Plane< T, NDIMS > &  p 
)

◆ make_plane() [1/2]

template<typename T >
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.

Parameters
[in]x1coordinates of the first point.
[in]x2coordinates of the second point.
Returns
plane the plane/line defined by the two points
Precondition
x1 should not be equal to x2

References axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_CHECK_MSG.

◆ make_plane() [2/2]

template<typename T >
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.

Parameters
[in]x1coordinates of the first point.
[in]x2coordinates of the second point.
[in]x3coordinates of the third point.
Returns
plane the plane defined by the three points
Precondition
The user-supplied points, x1, x2, x3 should not be collinear.

References axom::primal::Vector< T, NDIMS >::cross_product(), axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_CHECK_MSG.

◆ operator==() [3/4]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE bool axom::primal::operator== ( const Point< T, NDIMS > &  lhs,
const Point< T, NDIMS > &  rhs 
)

Equality comparison operator for points.

◆ operator!=() [3/4]

template<typename T , int NDIMS>
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.

◆ operator<<() [14/23]

template<typename T , int NDIMS>
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().

◆ transform_point()

template<typename T , int NDIMS>
Point<T, NDIMS> axom::primal::transform_point ( const Point< T, NDIMS > &  pt,
const axom::numerics::Matrix< T > &  transform = axom::numerics::Matrix<T>::identity(NDIMS) 
)

Transform a point using a transformation matrix.

Parameters
ptThe point to be transformed.
transformThe transformation matrix.
Returns
The transformed point.
Note
We allow a matrix 1 rank larger than NDIMS so we can perform translations.

References axom::numerics::matrix_vector_multiply(), and SLIC_ASSERT.

◆ operator<<() [15/23]

template<typename T , int NDIMS, axom::primal::PolygonArray ARRAY_TYPE, int MAX_VERTS>
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().

◆ operator<<() [16/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [17/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [18/23]

template<typename T , int NDIMS>
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().

◆ operator==() [4/4]

template<typename T , int NDIMS>
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.

◆ operator!=() [4/4]

template<typename T , int NDIMS>
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.

◆ operator<<() [19/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [20/23]

template<typename T , int NDIMS>
std::ostream & axom::primal::operator<< ( std::ostream &  os,
const Sphere< T, NDIMS > &  s 
)

◆ operator<<() [21/23]

template<typename T , int NDIMS>
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().

◆ operator<<() [22/23]

template<typename T , int NDIMS>
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().

◆ operator+() [1/3]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator+ ( const Vector< T, NDIMS > &  A,
const Vector< T, NDIMS > &  B 
)
inline

Adds vectors A, B and stores the result into a new vector C.

Parameters
[in]Avector on the left-hand side.
[in]Bvector on the right-hand side.
Returns
C resulting vector, \( C_i = A_i + B_i \forall i \)

◆ operator+() [2/3]

template<typename T , int NDIMS>
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.

Parameters
[in]Ppoint on the left-hand side.
[in]Vvector on the right-hand side.
Returns
resulting point, \( p'_i = p_i + v_i \forall i \)

References axom::primal::Point< T, NDIMS >::array(), and axom::primal::Vector< T, NDIMS >::array().

◆ operator+() [3/3]

template<typename T , int NDIMS>
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.

Parameters
[in]Vvector on the left-hand side.
[in]Ppoint on the right-hand side.
Returns
resulting point, \( p'_i = v_i + p_i \forall i \)

◆ operator-() [1/4]

template<typename T , int NDIMS>
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.

Parameters
[in]Ppoint on the left-hand side.
[in]Vvector on the right-hand side.
Returns
resulting point, \( p'_i = p_i + v_i \forall i \)

References axom::primal::Point< T, NDIMS >::array(), and axom::primal::Vector< T, NDIMS >::array().

◆ operator-() [2/4]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator- ( const Vector< T, NDIMS > &  A,
const Vector< T, NDIMS > &  B 
)
inline

Subtracts vectors A, B and stores the result into a new vector C.

Parameters
[in]Avector on the left-hand side.
[in]Bvector on the right-hand side.
Returns
C resulting vector, \( C_i = A_i - B_i \forall i \)

◆ operator-() [3/4]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator- ( const Point< T, NDIMS > &  h,
const Point< T, NDIMS > &  t 
)

Subtracts Point t from Point h, yielding a vector.

Parameters
[in]hthe head of the resulting vector
[in]tthe tail of the resulting vector
Returns
resulting vector, \( V_i = h_i - t_i \forall i \)

◆ operator-() [4/4]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator- ( const Vector< T, NDIMS > &  vec1)
inline

Unary negation of a vector instance.

Parameters
[in]vec1vector instance to negate.
Returns
C resulting vector from unary negation.

References axom::primal::Vector< T, NDIMS >::negate().

◆ operator*() [1/2]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator* ( const Vector< T, NDIMS > &  vec,
const T  scalar 
)
inline

Scalar multiplication of vector; Scalar on rhs.

Free functions involving vectors.

Parameters
[in]vecvector instance.
[in]scalaruser-supplied scalar.
Returns
C resulting vector, \( \ni: C_i = scalar*vec_i, \forall i\)

◆ operator*() [2/2]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator* ( const T  scalar,
const Vector< T, NDIMS > &  vec 
)
inline

Scalar multiplication of vector; Scalar on lhs.

Parameters
[in]scalaruser-supplied scalar.
[in]vecvector instance.
Returns
C resulting vector, \( \ni: C_i = scalar*vec_i, \forall i\)

◆ operator/()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Vector< T, NDIMS > axom::primal::operator/ ( const Vector< T, NDIMS > &  vec,
const T  scalar 
)
inline

Scalar division of vector; Scalar on rhs.

Parameters
[in]vecvector instance
[in]scalaruser-supplied scalar.
Returns
C resulting vector, \( \ni: C_i = vec_i / scalar, \forall i\)
Precondition
scalar != 0.0

◆ operator<<() [23/23]

template<typename T , int NDIMS>
std::ostream & axom::primal::operator<< ( std::ostream &  os,
const Vector< T, NDIMS > &  vec 
)

Overloaded output operator for vectors.

Parameters
[in]osC++ output stream
[in]vecvector instance

References axom::primal::Vector< T, NDIMS >::print().

◆ clip() [1/19]

template<typename T >
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.

Parameters
[in]triThe triangle to clip
[in]bboxThe bounding box to clip against
Returns
A planar polygon of the triangle clipped against the bounding box. If the triangle is completely outside the bounding box, the returned polygon is empty (i.e. it has no vertices).
Note
Using a specialization of the Sutherland-Hodgeman clipping algorithm for axis aligned planes

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

◆ clip() [2/19]

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

Parameters
[in]subjectPolygonThe subject polygon
[in]clipPolygonThe clip polygon
[in]epsThe tolerance for plane point orientation. Defaults to 1.e-10.
[in]tryFixOrientationIf 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.
Returns
A polygon of the subject polygon clipped against the clip polygon.
Note
Function is based off the Sutherland–Hodgman algorithm.
Warning
Polygons with static array types must have enough vertices preallocated for the output polygon. It is mandatory that MAX_VERTS >= subjectPolygon.numVertices() + clipPolygon.numVertices() for the output polygon with the largest possible vertex count. Otherwise, if there is not enough preallocated vertices, output polygon will have missing vertices.
See also
axom::primal::Polygon::addVertex(), axom::StaticArray::push_back() for behavior when there is not enough preallocated vertices.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polygon will have a non-positive and/or unexpected area.
If tryFixOrientation flag is false and some of the shapes have a negative signed area, the returned Polygon will have a non-positive and/or unexpected area.

◆ clip() [3/19]

template<typename T , axom::primal::PolygonArray ARRAY_TYPE, int MAX_VERTS>
AXOM_HOST_DEVICE Polygon<T, 2, ARRAY_TYPE, MAX_VERTS> axom::primal::clip ( const Polygon< T, 2, ARRAY_TYPE, MAX_VERTS > &  subjectPolygon,
const Plane< T, 2 > &  clipPlane,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 2D subject polygon against a clip plane in 2D, returning their geometric intersection as a polygon.

This function makes a clip polygon line segment from the plane and delegates clipping to the polygon-polygon clipper.

Parameters
[in]subjectPolygonThe subject polygon
[in]clipPlaneThe clip plane
[in]epsThe tolerance for plane point orientation. Defaults to 1.e-10.
[in]tryFixOrientationIf 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.
Returns
A polygon of the subject polygon clipped against the clip plane.

◆ clip() [4/19]

template<typename T >
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).

Parameters
[in]hexThe hexahedron to clip
[in]tetThe tetrahedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the hexahedron clipped against the tetrahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [5/19]

template<typename T >
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).

Parameters
[in]tetThe tetrahedron to clip against
[in]hexThe hexahedron to clip
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the hexahedron clipped against the tetrahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

References clip().

◆ clip() [6/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Hexahedron< T, 3 > &  hex1,
const Hexahedron< T, 3 > &  hex2,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D hexahedron against a hexahedron in 3D, returning the geometric intersection of the hexahedron and the hexahedron as a polyhedron.

This function clips the hexahedron by the 6 planes obtained from the hexahedron'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).

Parameters
[in]hex1The hexahedron to clip
[in]hex2The hexahedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the hexahedron clipped against the hexahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
hex1 and hex2 are assumed to be convex.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [7/19]

template<typename T >
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).

Parameters
[in]octThe octahedron to clip
[in]tetThe tetrahedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the octahedron clipped against the tetrahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [8/19]

template<typename T >
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).

Parameters
[in]tetThe tetrahedron to clip against
[in]octThe octahedron to clip
[in]tetThe tetrahedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the octahedron clipped against the tetrahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

References clip().

◆ clip() [9/19]

template<typename T >
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).

Parameters
[in]tet1The tetrahedron to clip
[in]tet2The tetrahedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the tetrahedron clipped against the other tetrahedron.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [10/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Tetrahedron< T, 3 > &  tet,
const Polyhedron< T, 3 > &  poly,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D polyhedron against another polyhedron in 3D, returning the geometric intersection as a polyhedron.

This function clips the first polyhedron by the planes obtained from the second polyhedron's faces (normals point inward). Clipping the 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).

Parameters
[in]tetThe tetrahedron to clip
[in]polyThe polyhedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the clip results
Note
poly is assumed to be convex. Any non-planar faces in poly will result in multiple clipping planes for the face.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [11/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Polyhedron< T, 3 > &  poly,
const Tetrahedron< T, 3 > &  tet,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D polyhedron against another polyhedron in 3D, returning the geometric intersection as a polyhedron.

This function clips the first polyhedron by the planes obtained from the second polyhedron's faces (normals point inward). Clipping the 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).

Parameters
[in]tetThe tetrahedron to clip
[in]polyThe polyhedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the clip results
Note
poly is assumed to be convex. Any non-planar faces in poly will result in multiple clipping planes for the face.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [12/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Hexahedron< T, 3 > &  hex,
const Polyhedron< T, 3 > &  poly,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D hexahedron against a polyhedron in 3D, returning the geometric intersection as a polyhedron.

This function clips the polyhedron by the planes obtained from the hexahedron's faces (normals point inward). Clipping the 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).

Parameters
[in]hexThe hexahedron to clip
[in]polyThe polyhedron to clip against
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the clip results
Note
hex and poly shapes are assumed to be convex. The hex shape is clipped as a polyhedron. Any non-planar faces may give rise to non-planar clipped faces. The poly shape's faces are used as clipping planes for hex. Any non-planar faces in poly will result in multiple clipping planes for the face.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [13/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Polyhedron< T, 3 > &  poly,
const Hexahedron< T, 3 > &  hex,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D polyhedron against a hexahedron in 3D, returning the geometric intersection as a polyhedron.

This function clips the polyhedron by the planes obtained from the hexahedron's faces (normals point inward). Clipping the 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).

Parameters
[in]polyThe polyhedron to clip against
[in]hexThe hexahedron to clip
[in]epsThe epsilon value
[in]tryFixOrientationIf 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.
Returns
A polyhedron of the clip results
Note
hex and poly shapes are assumed to be convex. Any non-planar faces may give rise to non-planar clipped faces. The hex shape's faces are used as clipping planes for poly. Any non-planar faces in hex will result in multiple clipping planes for the face.
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned Polyhedron will have a non-positive and/or unexpected volume.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned Polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [14/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Polyhedron< T, 3 > &  poly1,
const Polyhedron< T, 3 > &  poly2,
double  eps = 1.e-10 
)

Clips a 3D polyhedron against another polyhedron in 3D, returning the geometric intersection as a polyhedron.

This function clips the first polyhedron by the planes obtained from the second polyhedron's faces (normals point inward). Clipping the 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).

Parameters
[in]poly1The polyhedron to clip
[in]poly2The polyhedron to clip against
[in]epsThe epsilon value
Returns
A polyhedron of the clip results
Note
poly1 and poly2 shapes are assumed to be convex. Any non-planar faces may give rise to non-planar clipped faces. The poly2 shape's faces are used as clipping planes for poly1. Any non-planar faces in poly2 will result in multiple clipping planes for the face.

◆ clip() [15/19]

template<typename T >
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).

Parameters
[in]tetThe tetrahedron to clip
[in]planeThe plane defining the half-space used to clip the tetrahedron
[in]epsThe tolerance for plane point orientation
[in]tryFixOrientationIf 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.
Returns
The polyhedron obtained from clipping a tetrahedron against the half-space defined by a plane.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the tetrahedron's vertex order will be valid. It is the responsiblity of the caller to pass a tetrahedron with a valid vertex order. Otherwise, the returned polyhedron will have a non-positive and/or unexpected volume.
If the tryFixOrientation flag is false and the tetrahedron has a negative signed volume, the returned polyhedron will have a non-positive and/or unexpected volume.

◆ clip() [16/19]

template<typename T >
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).

Parameters
[in]planeThe plane defining the half-space used to clip the tetrahedron
[in]tetThe tetrahedron to clip
[in]epsThe tolerance for plane point orientation
[in]tryFixOrientationIf 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.
Returns
The polyhedron obtained from clipping a tetrahedron against the half-space defined by a plane.
Note
Function is based off clipPolyhedron() in Mike Owen's PolyClipper.
Warning
tryFixOrientation flag does not guarantee the tetrahedron's vertex order will be valid. It is the responsiblity of the caller to pass a tetrahedron with a valid vertex order. Otherwise, the returned polyhedron will have a non-positive and/or unexpected volume.
If the tryFixOrientation flag is false and the tetrahedron has a negative signed volume, the returned polyhedron will have a non-positive and/or unexpected volume.

References clip().

◆ clip() [17/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Polyhedron< T, 3 > &  poly,
const Plane< T, 3 > &  plane,
double  eps = 1.e-10 
)

Clips a 3D polyhedron against the half-space defined by a plane and returns the resulting polyhedron.

This function clips a polyhedron 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).

Parameters
[in]planeThe plane defining the half-space used to clip the tetrahedron
[in]polyThe polyhedron to clip
[in]epsThe tolerance for plane point orientation
Returns
The polyhedron obtained from clipping a polyhedron against the half-space defined by a plane.

◆ clip() [18/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Plane< T, 3 > &  plane,
const Polyhedron< T, 3 > &  poly,
double  eps = 1.e-10 
)

Clips a 3D polyhedron against the half-space defined by a plane and returns the resulting polyhedron.

This function clips a polyhedron 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).

Parameters
[in]polyThe polyhedron to clip
[in]planeThe plane defining the half-space used to clip the polyhedron.
[in]epsThe tolerance for plane point orientation
Returns
The polyhedron obtained from clipping a polyhedron against the half-space defined by a plane.

◆ clip() [19/19]

template<typename T >
AXOM_HOST_DEVICE Polyhedron<T, 3> axom::primal::clip ( const Hexahedron< T, 3 > &  hex,
const Plane< T, 3 > &  plane,
double  eps = 1.e-10,
bool  tryFixOrientation = false 
)

Clips a 3D hexahedron against the half-space defined by a plane and returns the resulting polyhedron.

This function clips a hexahedron against the half-space defined by a plane. This involves finding new vertices at the intersection of the hexahedron edges and the plane, removing vertices from the hexahedron 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).

Parameters
[in]hexThe hexahedron to clip
[in]planeThe plane defining the half-space used to clip the hexahedron.
[in]epsThe tolerance for plane point orientation
[in]tryFixOrientationIf 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.
Returns
The polyhedron obtained from clipping a hexahedron against the half-space defined by a plane.

References clip(), and axom::primal::Polyhedron< T, NDIMS >::from_primitive().

◆ merge_boxes() [1/2]

template<typename T , int NDIMS>
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.

Parameters
[in]lleft obb
[in]rright obb

References axom::primal::OrientedBoundingBox< T, NDIMS >::contains(), and axom::primal::OrientedBoundingBox< T, NDIMS >::vertices().

◆ merge_boxes() [2/2]

template<typename T , int NDIMS>
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.

Parameters
[in]lleft bb
[in]rright bb

References axom::primal::BoundingBox< T, NDIMS >::addBox().

◆ compute_bounding_box() [1/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Triangle< T, NDIMS > &  tri)

Creates a bounding box around a Triangle.

Parameters
[in]triThe Triangle

◆ compute_bounding_box() [2/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Quadrilateral< T, NDIMS > &  quad)

Creates a bounding box around a Quadrilateral.

Parameters
[in]quadThe Quadrilateral

◆ compute_bounding_box() [3/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Octahedron< T, NDIMS > &  oct)

Creates a bounding box around an Octahedron.

Parameters
[in]octThe Octahedron

◆ compute_bounding_box() [4/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Hexahedron< T, NDIMS > &  hex)

Creates a bounding box around a Hexahedron.

Parameters
[in]hexThe Hexahedron

◆ compute_bounding_box() [5/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Polyhedron< T, NDIMS > &  poly)

◆ compute_bounding_box() [6/7]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Tetrahedron< T, NDIMS > &  tet)

Creates a bounding box around a Tetrahedron.

Parameters
[in]tetThe tetrahedron

◆ compute_bounding_box() [7/7]

template<typename T , int NDIMS, PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
AXOM_HOST_DEVICE BoundingBox<T, NDIMS> axom::primal::compute_bounding_box ( const Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS > &  poly)

Creates a bounding box around a Polygon.

Parameters
[in]polyThe polygon

References axom::primal::BoundingBox< T, NDIMS >::addPoint(), and axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices().

◆ sector_area()

template<typename T >
T axom::primal::sector_area ( const primal::BezierCurve< T, 2 > &  curve)

Calculates the signed sector area of a planar, nonrational Bezier curve.

The sector area is the signed area between the curve and the origin. The equation and derivation are 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.

◆ sector_centroid()

template<typename T >
primal::Point<T, 2> axom::primal::sector_centroid ( const primal::BezierCurve< T, 2 > &  curve)

Calculates the area-weighted centroid numerator of a planar, nonrational Bezier curve.

This is the first raw moment of the region between the curve and the origin. Divide by sector_area() to recover the centroid. 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.

◆ area()

template<typename T >
T axom::primal::area ( const primal::CurvedPolygon< BezierCurve< T, 2 >> &  poly,
double  tol = 1e-8 
)

Returns the area enclosed by the CurvedPolygon.

References sector_area(), SLIC_ASSERT, and SLIC_DEBUG.

◆ centroid()

template<typename T >
primal::Point<T, 2> axom::primal::centroid ( const primal::CurvedPolygon< BezierCurve< T, 2 >> &  poly,
double  tol = 1e-8 
)

Returns the centroid of the CurvedPolygon.

References area(), sector_centroid(), SLIC_ASSERT, and SLIC_DEBUG.

◆ evaluate_line_integral() [1/3]

template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType axom::primal::evaluate_line_integral ( const primal::CurvedPolygon< CurveType > &  cpoly,
Lambda &&  integrand,
int  npts 
)

Evaluate a line integral along the boundary of a CurvedPolygon object for a function with an arbitrary return type.

The line integral is evaluated on each curve in the CurvedPolygon, and added together to represent the total integral. The curved polygon need not be connected.

Evaluate the line integral with Gauss-Legendre quadrature

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning an integrable type
LambdaRetTypeA type which supports addition and scalar multiplication
Parameters
[in]cpolythe CurvedPolygon object
[in]integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature points to evaluate the line integral on each edge of the CurvedPolygon
Returns
the value of the integral

References axom::primal::CurvedPolygon< CurveType >::numEdges().

◆ evaluate_line_integral() [2/3]

template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType axom::primal::evaluate_line_integral ( const CurveType &  c,
Lambda &&  integrand,
int  npts 
)

Evaluate a line integral along the boundary of a generic curve for a function with an arbitrary return type.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning an integrable type
LambdaRetTypeA type which supports addition and scalar multiplication
Parameters
[in]cthe generic curve object
[in]integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature nodes
Returns
the value of the integral

◆ evaluate_line_integral() [3/3]

template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType axom::primal::evaluate_line_integral ( const axom::Array< CurveType > &  carray,
Lambda &&  integrand,
int  npts 
)

Evaluate a line integral on an array of NURBS curves on a scalar field for a function with an arbitrary return type.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning an integrable type
LambdaRetTypeA type which supports addition and scalar multiplication
Parameters
[in]carrayThe array of generic curve objects
[in]integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature nodes per curve per knot span
Note
Each NURBS curve is decomposed into Bezier segments, and the Gaussian quadrature is computed using npts on each segment
Returns
the value of the integral

References axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ evaluate_vector_line_integral() [1/3]

template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType axom::primal::evaluate_vector_line_integral ( const CurvedPolygon< CurveType > &  cpoly,
Lambda &&  vector_integrand,
int  npts 
)

Evaluate a vector-field line integral along the boundary of a CurvedPolygon object.

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.

Evaluate the vector field line integral with Gauss-Legendre quadrature

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning its numeric type
FuncRetTypeThe CurveType's numeric type
Parameters
[in]cpolythe CurvedPolygon object
[in]vector_integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature points to evaluate the line integral on each edge of the CurvedPolygon
Precondition
Lambda must return the CurveTypes's vector type
Returns
the value of the integral

References axom::primal::CurvedPolygon< CurveType >::numEdges().

◆ evaluate_vector_line_integral() [2/3]

template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType axom::primal::evaluate_vector_line_integral ( const CurveType &  c,
Lambda &&  vector_integrand,
int  npts 
)

Evaluate a vector-field line integral on a single generic curve.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning its numeric type
FuncRetTypeThe CurveType's numeric type
Parameters
[in]cthe generic curve object
[in]vector_integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature nodes
Precondition
Lambda must return the CurveTypes's vector type
Returns
the value of the integral

◆ evaluate_vector_line_integral() [3/3]

template<typename CurveType , typename Lambda , typename FuncRetType = typename CurveType::NumericType>
FuncRetType axom::primal::evaluate_vector_line_integral ( const axom::Array< CurveType > &  carray,
Lambda &&  vector_integrand,
int  npts 
)

Evaluate a line integral on an array of generic curves on a vector field.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
LambdaA callable type taking a CurveType's PointType and returning its numeric type
FuncRetTypeThe CurveType's numeric type
Parameters
[in]carrayThe array of generic curve objects
[in]vector_integrandthe lambda function representing the integrand.
[in]nptsthe number of quadrature nodes per curve per knot span
Note
Each NURBS curve is decomposed into Bezier segments, and the Gaussian quadrature is computed using npts on each segment
Returns
the value of the integral

References axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ evaluate_area_integral() [1/2]

template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType axom::primal::evaluate_area_integral ( const primal::CurvedPolygon< CurveType > &  cpoly,
Lambda &&  integrand,
int  npts_Q,
int  npts_P = 0 
)

Evaluate an integral on the interior of a CurvedPolygon object.

Evaluates the integral using a Spectral Mesh-Free Quadrature derived from Green's theorem, evaluating the area integral as a line integral of the antiderivative over each component curve.

For algorithm details, see "Spectral Mesh-Free Quadrature for Planar Regions Bounded by Rational Parametric Curves" by David Gunderman et al.

Template Parameters
LambdaA callable type taking a CurveType's PointType and returning an integrable type
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the geometry
LambdaRetTypeA type which supports addition and scalar multiplication
Parameters
[in]cpolythe CurvedPolygon object
[in]integrandthe lambda function representing the integrand.
[in]npts_Qthe number of quadrature points to evaluate the line integral
[in]npts_Pthe number of quadrature points to evaluate the antiderivative
Returns
the value of the integral

References axom::utilities::min(), and axom::primal::CurvedPolygon< CurveType >::numEdges().

◆ evaluate_area_integral() [2/2]

template<typename CurveType , typename Lambda , typename LambdaRetType = std::invoke_result_t<Lambda, typename CurveType::PointType>>
LambdaRetType axom::primal::evaluate_area_integral ( const axom::Array< CurveType > &  carray,
Lambda &&  integrand,
int  npts_Q,
int  npts_P = 0 
)

Evaluate an integral on the interior of a region bound by 2D curves.

See above definition for details.

Template Parameters
LambdaA callable type taking a CurveType's PointType and returning an integrable type
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the geometry
LambdaRetTypeA type which supports addition and scalar multiplication
Parameters
[in]carraythe array of generic curve objects that bound the region
[in]integrandthe lambda function representing the integrand.
[in]npts_Qthe number of quadrature points to evaluate the line integral
[in]npts_Pthe number of quadrature points to evaluate the antiderivative
Note
The numerical result is only meaningful if the curves enclose a region
Returns
the value of the integral

References axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ evaluate_surface_integral() [1/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_surface_integral ( const primal::BezierPatch< T, 3 > &  patch,
Lambda &&  integrand,
int  npts 
)

Evaluate a scalar surface integral on a single Bezier patch.

Uses tensor-product Gauss-Legendre quadrature in the patch parameter space.

Parameters
[in]patchthe Bezier patch
[in]integrandcallable representing the integrand
[in]nptsthe number of quadrature points in each parametric direction
Precondition
The patch parameterization must be valid on its full parameter domain.

◆ evaluate_surface_integral() [2/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_surface_integral ( const primal::NURBSPatch< T, 3 > &  patch,
Lambda &&  integrand,
int  npts_Q,
int  npts_P = 0 
)

Evaluate a scalar surface integral on a single NURBS patch.

Untrimmed patches are integrated by Bezier extraction followed by tensor-product Gauss-Legendre quadrature. Trimmed patches are integrated by reducing the parameter-space area integral to line integrals over the trimming curves.

Parameters
[in]patchthe NURBS patch
[in]integrandcallable representing the integrand
[in]npts_Qthe number of quadrature points on each trimming curve or in each parametric direction for untrimmed Bezier pieces
[in]npts_Pthe number of quadrature points used for numerical antidifferentiation in parameter space
Precondition
The patch parameterization must be valid on its full parameter domain.
If the patch is trimmed, its trimming curves must bound the intended interior region in parameter space.

◆ evaluate_surface_integral() [3/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_surface_integral ( const axom::Array< BezierPatch< T, 3 >> &  patches,
Lambda &&  integrand,
int  npts 
)

Evaluate a scalar surface integral on a collection of Bezier patches.

The result is the sum of the surface integrals over each patch in the array.

Parameters
[in]patchesthe patch collection
[in]integrandcallable representing the integrand
[in]nptsthe number of quadrature points in each parametric direction
Precondition
Each patch parameterization must be valid on its full parameter domain.

◆ evaluate_surface_integral() [4/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_surface_integral ( const axom::Array< NURBSPatch< T, 3 >> &  patches,
Lambda &&  integrand,
int  npts_Q,
int  npts_P = 0 
)

Evaluate a scalar surface integral on a collection of NURBS patches.

The result is the sum of the surface integrals over each patch in the array.

Parameters
[in]patchesthe patch collection
[in]integrandcallable representing the integrand
[in]npts_Qthe number of quadrature points on each trimming curve or in each parametric direction for untrimmed Bezier pieces
[in]npts_Pthe number of quadrature points used for numerical antidifferentiation in parameter space
Precondition
Each patch parameterization must be valid on its full parameter domain.
Any trimmed patch in the array must have trimming curves that bound its intended interior region in parameter space.

◆ evaluate_volume_integral() [1/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_volume_integral ( const primal::BezierPatch< T, 3 > &  patch,
Lambda &&  integrand,
lower_bound_z,
int  npts_uv,
int  npts_z = 0 
)

Evaluate a scalar volume-integral contribution from a single Bezier patch.

This applies the Stokes-based reduction used for the full volume algorithm to one patch using a z-directed numerical antiderivative.

Parameters
[in]patchthe Bezier patch
[in]integrandcallable representing the integrand
[in]lower_bound_zthe shared lower integration bound used for the z-directed antiderivative across the full boundary
[in]npts_uvthe number of quadrature points in each patch parameter direction
[in]npts_zthe number of quadrature points used for numerical antidifferentiation in z
Precondition
The patch parameterization must be valid on its full parameter domain.
The returned value is geometrically meaningful as a volume contribution only when this patch is interpreted as part of a closed, consistently oriented boundary that uses the same lower integration bound.

◆ evaluate_volume_integral() [2/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_volume_integral ( const primal::NURBSPatch< T, 3 > &  patch,
Lambda &&  integrand,
lower_bound_z,
int  npts_Q,
int  npts_P = 0,
int  npts_Z = 0 
)

Evaluate a scalar volume-integral contribution from a single NURBS patch.

Trimmed patches use the same Green/Stokes reduction as the surface-integral algorithm, combined with a z-directed numerical antiderivative for the volume reduction.

Parameters
[in]patchthe NURBS patch
[in]integrandcallable representing the integrand
[in]lower_bound_zthe shared lower integration bound used for the z-directed antiderivative across the full boundary
[in]npts_Qthe number of quadrature points on each trimming curve or in each parametric direction for untrimmed Bezier pieces
[in]npts_Pthe number of quadrature points used for numerical antidifferentiation in parameter space
[in]npts_Zthe number of quadrature points used for numerical antidifferentiation in z
Precondition
The patch parameterization must be valid on its full parameter domain.
If the patch is trimmed, its trimming curves must bound the intended interior region in parameter space.
The returned value is geometrically meaningful as a volume contribution only when this patch is interpreted as part of a closed, consistently oriented boundary that uses the same lower integration bound.

◆ evaluate_volume_integral() [3/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename BezierPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_volume_integral ( const axom::Array< BezierPatch< T, 3 >> &  patches,
Lambda &&  integrand,
int  npts_uv,
int  npts_z = 0 
)

Evaluate a scalar volume integral over a collection of Bezier patches.

The result is obtained by summing the Stokes-based contribution from each patch in the collection.

Parameters
[in]patchesthe patch collection
[in]integrandcallable representing the integrand
[in]npts_uvthe number of quadrature points in each patch parameter direction
[in]npts_zthe number of quadrature points used for numerical antidifferentiation in z
Precondition
Each patch parameterization must be valid on its full parameter domain.
The patch collection must represent a closed, consistently oriented boundary of the target volume.

References axom::utilities::min().

◆ evaluate_volume_integral() [4/4]

template<typename Lambda , typename T , typename LambdaRetType = std::invoke_result_t<Lambda, typename NURBSPatch<T, 3>::PointType>>
LambdaRetType axom::primal::evaluate_volume_integral ( const axom::Array< NURBSPatch< T, 3 >> &  patches,
Lambda &&  integrand,
int  npts_Q,
int  npts_P = 0,
int  npts_Z = 0 
)

Evaluate a scalar volume integral over a collection of NURBS patches.

The result is obtained by summing the Stokes-based contribution from each patch in the collection.

Parameters
[in]patchesthe patch collection
[in]integrandcallable representing the integrand
[in]npts_Qthe number of quadrature points on each trimming curve or in each parametric direction for untrimmed Bezier pieces
[in]npts_Pthe number of quadrature points used for numerical antidifferentiation in parameter space
[in]npts_Zthe number of quadrature points used for numerical antidifferentiation in z
Precondition
Each patch parameterization must be valid on its full parameter domain.
Any trimmed patch in the array must have trimming curves that bound its intended interior region in parameter space.
The patch collection must represent a closed, consistently oriented boundary of the target volume.

References axom::utilities::min().

◆ in_curved_polygon()

template<typename T , typename CurveType >
bool axom::primal::in_curved_polygon ( const Point< T, 2 > &  query,
const CurvedPolygon< CurveType > &  cpoly,
bool  useNonzeroRule = true,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Robustly determine if query point is interior to a curved polygon.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
Parameters
[in]queryThe query point to test
[in]cpolyThe CurvedPolygon object to test for containment
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous 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.

Returns
A boolean value indicating containment.

References winding_number().

◆ in_polygon()

template<typename T >
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.

Parameters
[in]queryThe query point to test
[in]polyThe Polygon object to test for containment
[in]includeBoundaryIf true, points on the boundary are considered interior.
[in]useNonzeroRuleIf false, use even/odd protocol for inclusion
[in]edge_tolThe 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.

Returns
boolean value indicating containment.

◆ in_polyhedron()

template<typename T >
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.

Parameters
[in]queryThe query point to test
[in]polyThe Polyhedron object to test for containment
[in]includeBoundaryIf true, points on the boundary are considered interior.
[in]useNonzeroRuleIf false, use even/odd protocol for inclusion
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSThe 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.

Returns
boolean value indicating containment.

References winding_number().

◆ in_sphere() [1/5]

template<typename T >
bool axom::primal::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 
)
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.

Parameters
[in]qthe query point
[in]p0the first vertex of the triangle
[in]p1the second vertex of the triangle
[in]p2the third vertex of the triangle
[in]EPStolerance for determining if q is on the boundary. Default: 1e-8.
Returns
true if the point is inside the circumcircle, false if it is on the circle's boundary or outside the circle

References axom::numerics::determinant(), and axom::utilities::isNearlyEqual().

◆ in_sphere() [2/5]

template<typename T >
bool axom::primal::in_sphere ( const Point< T, 2 > &  q,
const Triangle< T, 2 > &  tri,
double  EPS = 1e-8 
)
inline

Tests whether a query point lies inside a 2D triangle's circumcircle.

Parameters
[in]qthe query point
[in]trithe triangle
[in]EPStolerance for determining if q is on the boundary. Default: 1e-8.
See also
in_sphere

References in_sphere().

◆ in_sphere() [3/5]

template<typename T >
bool axom::primal::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 
)
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.

Parameters
[in]qthe query point
[in]p0the first vertex of the tetrahedron
[in]p1the second vertex of the tetrahedron
[in]p2the third vertex of the tetrahedron
[in]p3the fourth vertex of the tetrahedron
[in]EPStolerance for determining if q is on the boundary. Default: 1e-8.
Returns
true if the point is inside the circumsphere, false if it is on the sphere's boundary or outside the sphere

References axom::numerics::determinant(), and axom::utilities::isNearlyEqual().

◆ in_sphere() [4/5]

template<typename T >
bool axom::primal::in_sphere ( const Point< T, 3 > &  q,
const Tetrahedron< T, 3 > &  tet,
double  EPS = 1e-8 
)
inline

Tests whether a query point lies inside a 3D tetrahedron's circumsphere.

Parameters
[in]qthe query point
[in]tetthe tetrahedron
[in]EPStolerance for determining if q is on the boundary. Default: 1e-8.
See also
in_sphere

References in_sphere().

◆ in_sphere() [5/5]

template<typename T >
bool axom::primal::in_sphere ( const BoundingBox< T, 2 > &  bb,
const Sphere< T, 2 > &  circle 
)
inline

Tests whether a bounding box lies inside a 2D sphere.

Parameters
[in]bbthe bounding box
[in]circlethe sphere

References axom::primal::Sphere< T, NDIMS >::getCenter(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), and axom::primal::Sphere< T, NDIMS >::getRadius().

◆ intersect() [1/43]

template<typename T >
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Segment< T, 3 > &  P,
const Segment< T, 3 > &  Q,
Point< T, 3 > &  intersection,
const T  EPS = static_cast<T>(1e-08) 
)

Determines if two 3D segments intersect.

Parameters
[in]PA 3D line segment
[in]QA 3D line segment
[out]intersectionIntersection point of P and Q. When the segments are collinear and overlap over a nonzero interval, intersection is set to the first point of the overlap encountered when moving from P.source() to P.target().
[in]EPSTolerance used in the segment-segment intersection test.
Returns
true iff P intersects with Q, otherwise, false.
Note
The value of intersection should be ignored when this function returns false.

◆ intersect() [2/43]

template<typename T >
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.

Parameters
[in]t1The first triangle
[in]t2The second triangle
[in]includeBoundaryIndicates if boundaries should be considered when detecting intersections (default: false)
[in]EPSTolerance for determining intersections (default: 1E-8)
Returns
status true iff t1 intersects with t2, otherwise, false.

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.

◆ intersect() [3/43]

template<typename T >
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.

Parameters
[in]t1The first triangle
[in]t2The second triangle
[in]includeBoundaryIndicates if boundaries should be considered when detecting intersections (default: false)
[in]EPSTolerance for determining intersections (default: 1E-8)
Returns
status true iff t1 intersects with t2, otherwise, false.

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.

◆ intersect() [4/43]

template<typename T >
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Triangle< T, 3 > &  tri,
const BoundingBox< T, 3 > &  bb 
)

Determines if a triangle and a bounding box intersect.

Parameters
[in]triuser-supplied triangle (with three vertices).
[in]bbuser-supplied axis aligned bounding box.
Returns
true iff tri intersects with bb, otherwise, false.

◆ intersect() [5/43]

template<typename T >
bool axom::primal::intersect ( const Triangle< T, 3 > &  tri,
const Ray< T, 3 > &  ray 
)

Determines if a 3D triangle intersects a 3D ray.

Parameters
[in]triA 3D triangle
[in]rayA 3D ray
Returns
true iff tri intersects with ray, otherwise, false.

◆ intersect() [6/43]

template<typename T >
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.

Parameters
[in]triA 3D triangle
[in]rayA 3D ray
[out]tIntersection point of tri and R, w.r.t. parametrization of R
Note
If there is an intersection, the intersection point is: R.at(t)
Returns
true iff tri intersects with ray, otherwise, false.

◆ intersect() [7/43]

template<typename T >
AXOM_HOST_DEVICE 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.

Parameters
[in]triA 3D triangle
[in]rayA 3D ray
[out]tIntersection point of tri and R, w.r.t. parametrization of R
[out]pIntersection point of tri and R, in barycentric coordinates relative to tri.
Note
If there is an intersection, the intersection point is: R.at(t)
Returns
true iff tri intersects with ray, otherwise, false.
Note
t and p only valid when function returns true

References axom::primal::Point< T, NDIMS >::array().

◆ intersect() [8/43]

template<typename T >
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Triangle< T, 3 > &  tri,
const Segment< T, 3 > &  seg 
)

Determines if a 3D triangle intersects a 3D segment.

Parameters
[in]triA 3D triangle
[in]segA 3D line segment
Returns
true iff tri intersects with seg, otherwise, false.

◆ intersect() [9/43]

template<typename T >
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.

Parameters
[in]triA 3D triangle
[in]segA 3D line segment
[out]tIntersection point of tri and seg, w.r.t. seg's parametrization
Returns
true iff tri intersects with seg, otherwise, false.

◆ intersect() [10/43]

template<typename T >
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.

Parameters
[in]triA 3D triangle
[in]segA 3D line segment
[out]tIntersection point of tri and seg, w.r.t. seg's parametrization
[out]pIntersection point of tri and R, in barycentric coordinates relative to tri.
Note
If there is an intersection, the intersection point pt is: pt = seg.source() + t * ( seg.dest() - seg.target() )
Returns
true iff tri intersects with seg, otherwise, false.
Note
t and p only valid when function returns true

References axom::primal::Point< T, NDIMS >::array().

◆ intersect() [11/43]

template<typename T >
AXOM_HOST_DEVICE 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.

Parameters
[in]Rthe specified ray
[in]Sthe segment to check
[out]ray_paramparametric coordinate of intersection along R, valid only if status=true.
[out]seg_paramparametric coordinate of intersection along S, valid only if status=true.
[in]EPStolerance for intersection tests
Returns
status true iff R intersects with S, otherwise, false.
See also
primal::Ray
primal::Segment

◆ intersect() [12/43]

template<typename T >
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.

Parameters
[in]Rthe specified ray
[in]Sthe segment to check
[out]ray_paramparametric coordinate of intersection along R, valid only if status=true
Note
If you need to specify a tolerance for the intersection tests, please use the overload of this function with two [OUT] parameters (ray_param and seg_param)
Returns
status true iff R intersects with S, otherwise, false.
See also
primal::Ray
primal::Segment

References intersect().

◆ intersect() [13/43]

template<typename T >
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Ray< T, 2 > &  R,
const Segment< T, 2 > &  S 
)

Computes the intersection of the given ray, R, with the segment, S.

Parameters
[in]Rthe specified ray
[in]Sthe segment to check
Note
If you need to specify a tolerance for the intersection tests, please use the overload of this function with two [OUT] parameters (ray_param and seg_param)
Returns
status true iff R intersects with S, otherwise, false.
See also
primal::Ray
primal::Segment

References intersect().

◆ intersect() [14/43]

template<typename T >
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.

Parameters
[in]Rthe specified ray
[in]Sthe segment to check
[out]ipthe intersection point on S, valid only if status=true.
[in]EPStolerance for intersection tests
Returns
status true iff R intersects with S, otherwise, false.
See also
primal::Ray
primal::Segment
primal::Point

References axom::primal::Ray< T, NDIMS >::at().

◆ intersect() [15/43]

template<typename T , int DIM>
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.

Parameters
[in]Rthe specified ray
[in]bbthe user-supplied axis-aligned bounding box
[out]ipthe intersection point with minimum parameter value where R intersects bb.
Returns
status true iff bb intersects with R, otherwise, false.
See also
primal::Ray
primal::Segment
primal::BoundingBox
Note
Computes Ray Box intersection using the slab method from pg 180 of Real Time Collision Detection by Christer Ericson.

◆ intersect() [16/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Ray< T, DIM > &  R,
const BoundingBox< T, DIM > &  bb 
)

Computes the intersection of the given ray, R, with the Box, bb.

Parameters
[in]Rthe specified ray
[in]bbthe user-supplied axis-aligned bounding box
Returns
status true iff bb intersects with R, otherwise, false.
See also
primal::Ray
primal::Segment
primal::BoundingBox
Note
Computes Ray Box intersection using the slab method from pg 180 of Real Time Collision Detection by Christer Ericson.

References AXOM_STATIC_ASSERT, axom::utilities::max(), and axom::utilities::min().

◆ intersect() [17/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Line< T, DIM > &  L,
const BoundingBox< T, DIM > &  bb,
Point< T, DIM > &  ip 
)

Computes the intersection of the given line, L, with the Box, bb.

Parameters
[in]Lthe specified line (two-sided ray)
[in]bbthe user-supplied axis-aligned bounding box
[out]ipthe intersection point with minimum parameter value where L intersects bb.
Returns
status true iff bb intersects with R, otherwise, false.
See also
primal::Line
primal::Segment
primal::BoundingBox
Note
Computes Ray Box intersection using the slab method from pg 180 of Real Time Collision Detection by Christer Ericson.

◆ intersect() [18/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Line< T, DIM > &  L,
const BoundingBox< T, DIM > &  bb 
)

Computes the intersection of the given line, L, with the Box, bb.

Parameters
[in]Lthe specified line (two-sided ray)
[in]bbthe user-supplied axis-aligned bounding box
Returns
status true iff bb intersects with R, otherwise, false.
See also
primal::Line
primal::BoundingBox
Note
Computes Ray Box intersection using the slab method from pg 180 of Real Time Collision Detection by Christer Ericson.

References AXOM_STATIC_ASSERT, axom::primal::Line< T, NDIMS >::direction(), axom::utilities::max(), and axom::primal::Line< T, NDIMS >::origin().

◆ intersect() [19/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE 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.

Returns
status true iff bb intersects with S, otherwise, false.
Note
The intersection between segment S and box bb intersect, will, in general, be a along a (1D) subset of segment S. One variant of this function returns the two parametric coordinates of the intersections along S found while determining if there is a valid intersection. Another variant returns an intersection point along S Specifically, it is the point of smallest parametric coordinate that is contained in bb (i.e. with parameter tmin). These are only valid when the function returns true

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

◆ intersect() [20/43]

template<typename T , int DIM>
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().

◆ intersect() [21/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Segment< T, DIM > &  S,
const BoundingBox< T, DIM > &  bb 
)

References intersect().

◆ intersect() [22/43]

template<typename T , int DIM>
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.

Parameters
[in]bb1user-supplied axis aligned bounding box.
[in]bb2user-supplied axis aligned bounding box.
Returns
true iff bb1 intersects with bb2, otherwise, false.

References axom::primal::BoundingBox< T, NDIMS >::intersectsWith().

◆ intersect() [23/43]

template<typename T , int DIM>
bool axom::primal::intersect ( const Sphere< T, DIM > &  s1,
const Sphere< T, DIM > &  s2,
double  TOL = 1.e-9 
)

Determines if two spheres intersect.

Parameters
[in]s1user-supplied sphere object to check for intersection.
[in]s2user-supplied sphere object to check for intersection.
[in]TOLtolerance used for intersection check (optional)
Note
If TOL is not supplied, the default is 1.e-9.
Returns
status true iff s1 intersects with s2, otherwise, false.

References axom::primal::Sphere< T, NDIMS >::intersectsWith().

◆ intersect() [24/43]

template<typename T >
bool axom::primal::intersect ( const Sphere< T, 2 > &  circle,
const BoundingBox< T, 2 > &  bb 
)

Determines if a 2D sphere intersects (overlaps with) a bounding box.

Parameters
[in]circleThe sphere to check for intersection
[in]bbThe bounding box to check for intersection

◆ intersect() [25/43]

template<typename T >
bool axom::primal::intersect ( const Sphere< T, 2 > &  circle,
const NURBSCurve< T, 2 > &  curve,
axom::Array< T > &  circle_params,
axom::Array< T > &  curve_params,
double  tol = 1e-8,
double  EPS = 1e-8 
)

Determines if a 2D sphere intersects a NURBS Curve.

Parameters
[in]circleThe sphere to check for intersection
[in]curveThe NURBS curve to check for intersection
[out]circle_paramsThe parameter values of the sphere at the intersection points
[out]curve_paramsThe parameter values of the curve at the intersection points
[in]tolTolerance parameter for physical distances
[in]EPSTolerance parameter for parameter-space distances
Returns
True if the sphere intersects the curve, false otherwise

References axom::primal::NURBSCurve< T, NDIMS >::extractBezier(), axom::primal::NURBSCurve< T, NDIMS >::getKnots(), axom::primal::KnotVector< T >::getUniqueKnots(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ intersect() [26/43]

template<typename T >
bool axom::primal::intersect ( const OrientedBoundingBox< T, 1 > &  b1,
const OrientedBoundingBox< T, 1 > &  b2 
)

◆ intersect() [27/43]

template<typename T >
bool axom::primal::intersect ( const OrientedBoundingBox< T, 2 > &  b1,
const OrientedBoundingBox< T, 2 > &  b2 
)

Determines if a 2D OBB intersects a 2D OBB.

Parameters
[in]b1A 2D OrientedBoundingBox
[in]b2A 2D OrientedBoundingBox
Returns
true iff b1 intersects with b2, otherwise, false.

◆ intersect() [28/43]

template<typename T >
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.

Parameters
[in]b1A 3D OrientedBoundingBox
[in]b2A 3D OrientedBoundingBox
[in]EPSerror tolerance for intersection
Returns
true iff b1 intersects with b2, otherwise, false.

◆ intersect() [29/43]

template<typename T >
bool axom::primal::intersect ( const BezierCurve< T, 2 > &  c1,
const BezierCurve< T, 2 > &  c2,
axom::Array< T > &  sp,
axom::Array< T > &  tp,
double  tol = 1E-8 
)

Tests if two Bezier Curves c1 and c2 intersect.

Returns
status true iff c1 intersects c2, otherwise false.
Parameters
[in]c1the first BezierCurve, parametrized in [0,1)
[in]c2the second BezierCurve, parametrized in [0,1)
[out]spvector of parameter space intersection points for c1
[out]tpvector of parameter space intersection points for c2
[in]toltolerance parameter for determining if a curve can be approximated by a line segment.
Returns
True if the curves intersect, false otherwise. Intersection parameters are stored in sp and tp

Finds all intersection points between the two curves.

Note
This function assumes two dimensional curves in a plane.
This function assumes that the curves are in general position. Specifically, we assume that all intersections are at points and that the curves don't overlap.
This function assumes the all intersections have multiplicity one, i.e. there are no points at which the curves and their derivatives both intersect. Thus, the function does not find tangencies.
This function assumes that the curves are half-open, i.e. they contain their first endpoint, but not their last endpoint. Thus, the curves do not intersect at \( s==1 \) or at \( t==1 \).

References axom::primal::BezierCurve< T, NDIMS >::getOrder(), and axom::numerics::transforms::scale().

◆ intersect() [30/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 2 > &  r,
const BezierCurve< T, 2 > &  c,
axom::Array< T > &  rp,
axom::Array< T > &  cp,
double  tol = 1E-8,
double  EPS = 1E-8 
)

Function to find intersections between a ray and a Bezier curve.

Parameters
[in]rThe input ray
[in]cThe input curve
[out]rpParametric coordinates of intersections in r [0, inf)
[out]cpParametric coordinates of intersections in c [0, 1)
[in]tolTolerance parameter for physical distances
[in]EPSTolerance parameter for parameter-space distances
Note
A BezierCurve is parametrized in [0,1). This function assumes the all intersections have multiplicity one, i.e. the function does not find tangencies.
Returns
True if the ray intersects the Bezier curve, False otherwise

References axom::primal::BezierCurve< T, NDIMS >::getOrder(), and axom::numerics::transforms::scale().

◆ intersect() [31/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 2 > &  r,
const NURBSCurve< T, 2 > &  n,
axom::Array< T > &  rp,
axom::Array< T > &  np,
double  tol = 1E-8,
double  EPS = 1E-8 
)

Function to find intersections between a ray and a NURBS curve.

Parameters
[in]rThe input ray
[in]nThe input curve
[out]rpParametric coordinates of intersections in r [0, inf)
[out]cpParametric coordinates of intersections in the knot span of n
[in]tolTolerance parameter for physical distances
[in]EPSTolerance parameter for parameter-space distances
Note
Assumes the NURBS curve is parameterized on a half-open interval [a, b), and assumes the all intersections have multiplicity one, i.e. the function does not find tangencies.
Returns
True if the ray intersects the NURBS curve, False otherwise

References axom::primal::NURBSCurve< T, NDIMS >::boundingBox(), axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), axom::primal::NURBSCurve< T, NDIMS >::extractBezier(), axom::primal::NURBSCurve< T, NDIMS >::getKnots(), axom::primal::KnotVector< T >::getUniqueKnots(), intersect(), axom::utilities::lerp(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ intersect() [32/43]

template<typename T >
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.

Parameters
[in]pA 3D plane
[in]bbA 3D bounding box
[in]checkOverlapsIf true, checks if bounding box overlaps both halfspaces of the plane. Otherwise, overlap of both halfspaces is not guaranteed. Default is false.
[in]EPStolerance parameter for determining if "s" is just within min/max of "r".
Returns
true iff plane intersects with bounding box, otherwise, false.
Note
Uses method from pg 164 of Real Time Collision Detection by Christer Ericson.

◆ intersect() [33/43]

template<typename T , int DIM>
AXOM_HOST_DEVICE bool axom::primal::intersect ( const Plane< T, DIM > &  plane,
const Segment< T, DIM > &  seg,
T &  t,
const double &  EPS = 1e-12 
)

Determines if a plane intersects a segment.

Parameters
[in]planeA plane
[in]segA line segment
[out]tIntersection point of plane and seg, w.r.t. seg's parametrization
[in]EPStolerance parameter for determining if 0.0 <= t <= 1.0
Note
If there is an intersection, the intersection point pt is: pt = seg.at(t)
Returns
true iff plane intersects with seg, otherwise, false.
Note
t is only valid when function returns true
Uses method from pg 176 of Real Time Collision Detection by Christer Ericson.

◆ intersect() [34/43]

template<typename T >
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.

Parameters
[in]pA 3D plane
[in]tetA 3D tetrahedron
[out]intersectionA polygon containing the intersection.
Returns
true if plane intersects with tetrahedron, otherwise, false.
Note
If no intersection is found, the output polygon will be empty. If the plane intersects at a tetrahedron vertex, the polygon will contain duplicated points.

◆ intersect() [35/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 3 > &  ray,
const BezierPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol,
double  EPS,
bool  isHalfOpen,
bool &  success 
)

Determines if a ray intersects a Bezier patch.

Parameters
[in]rayThe ray to intersect with the patch.
[in]patchThe Bezier patch to intersect with the ray.
[out]tThe t parameter(s) of intersection point(s).
[out]uThe u parameter(s) of intersection point(s).
[out]vThe v parameter(s) of intersection point(s).
[in]tolThe tolerance for intersection (for physical distances).
[in]EPSThe tolerance for intersection (for parameter distances).
[in]isHalfOpenTrue if the patch is parameterized in [0,1)^2.
[out]successFalse if an early return occured.

For bilinear patches, implements GARP algorithm from Chapter 8 of Ray Tracing Gems (2019) For higher order patches, intersections are found through recursive subdivison until the subpatch is approximated by a bilinear patch. Assumes that the ray is not tangent to the patch, and that the intersection is not at a point of degeneracy for which there are infinitely many intersections.

Note
This method clears the input vectors t, u, v
Warning
This function returns early if we record excessive intersections. This implies the patch is degenerate at the point of intersection.
Returns
True if an intersection is found, false otherwise

References axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::primal::Ray< T, NDIMS >::direction(), axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), and axom::primal::Ray< T, NDIMS >::origin().

◆ intersect() [36/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 3 > &  ray,
const BezierPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol = 1e-8,
double  EPS = 1e-8,
bool  isHalfOpen = false 
)

!

Determines if a ray intersects a Bezier patch with fewer exposed parameters.

References intersect().

◆ intersect() [37/43]

template<typename T >
bool axom::primal::intersect ( const Line< T, 3 > &  line,
const BezierPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol,
double  EPS,
bool  isHalfOpen,
bool &  success 
)

Determines if a line (two-sided ray) intersects a Bezier patch.

Parameters
[in]lineThe line to intersect with the patch.
[in]patchThe Bezier patch to intersect with the ray.
[out]tThe t parameter(s) of intersection point(s).
[out]uThe u parameter(s) of intersection point(s).
[out]vThe v parameter(s) of intersection point(s).
[in]tolThe tolerance for intersection (for physical distances).
[in]EPSThe tolerance for intersection (for parameter distances).
[in]isHalfOpenTrue if the patch is parameterized in [0,1)^2.
[out]successFalse if an early return occured.

For bilinear patches, implements GARP algorithm from Chapter 8 of Ray Tracing Gems (2019) For higher order patches, intersections are found through recursive subdivison until the subpatch is approximated by a bilinear patch. Assumes that the line is not tangent to the patch, and that the intersection is not at a point of degeneracy for which there are infinitely many intersections.

Note
This method clears the input vectors t, u, v
Warning
This function returns early if we record excessive intersections. This implies the patch is degenerate at the point of intersection.
Returns
True if an intersection is found, false otherwise

References axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), and axom::primal::BezierPatch< T, NDIMS >::getOrder_v().

◆ intersect() [38/43]

template<typename T >
bool axom::primal::intersect ( const Line< T, 3 > &  line,
const BezierPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol = 1e-8,
double  EPS = 1e-8,
bool  isHalfOpen = false 
)

!

Determines if a line intersects a Bezier patch with fewer exposed parameters.

References intersect().

◆ intersect() [39/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 3 > &  ray,
const NURBSPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol,
double  EPS,
bool  countUntrimmed,
bool  isHalfOpen,
bool &  success 
)

Determines if a ray intersects a NURBS patch.

Parameters
[in]rayThe ray to intersect with the patch.
[in]patchThe NURBS patch to intersect with the ray.
[out]tThe t parameter(s) of intersection point(s).
[out]uThe u parameter(s) of intersection point(s).
[out]vThe v parameter(s) of intersection point(s).
[in]tolThe tolerance for intersection (for physical distances).
[in]EPSThe tolerance for intersection (for parameter distances).
[in]countUntrimmedTrue if intersections with the untrimmed patch should also be recorded.
[in]isHalfOpenTrue if the patch is parameterized in [0,1)^2.
[out]successFalse if an early return occured.

Perform Bezier extraction and record intersections with each patch. After intersections are recorded, parameter points located outside the trimming curves are pruned from the list (unless specified by countUntrimmed).

Note
This method clears the input vectors t, u, v
Warning
This function returns early if we record excessive intersections. This implies the patch is degenerate at the point of intersection.
Returns
True if an intersection is found, false otherwise

References axom::primal::NURBSPatch< T, NDIMS >::boundingBox(), axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), axom::primal::NURBSPatch< T, NDIMS >::extractBezier(), axom::primal::NURBSPatch< T, NDIMS >::getKnots_u(), axom::primal::NURBSPatch< T, NDIMS >::getKnots_v(), axom::primal::KnotVector< T >::getNumKnots(), axom::primal::KnotVector< T >::getUniqueKnots(), intersect(), axom::primal::NURBSPatch< T, NDIMS >::isVisible(), axom::utilities::lerp(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and squared_distance().

◆ intersect() [40/43]

template<typename T >
bool axom::primal::intersect ( const Ray< T, 3 > &  ray,
const NURBSPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol = 1e-8,
double  EPS = 1e-8,
bool  countUntrimmed = true,
bool  isHalfOpen = false 
)

!

Determines if a ray intersects a NURBS patch with fewer exposed parameters.

References intersect().

◆ intersect() [41/43]

template<typename T >
bool axom::primal::intersect ( const Line< T, 3 > &  line,
const NURBSPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol,
double  EPS,
bool  countUntrimmed,
bool  isHalfOpen,
bool &  success 
)

Determines if a line (two-sided ray) intersects a NURBS patch.

Parameters
[in]lineThe line to intersect with the patch.
[in]patchThe NURBS patch to intersect with the line.
[out]tThe t parameter(s) of intersection point(s).
[out]uThe u parameter(s) of intersection point(s).
[out]vThe v parameter(s) of intersection point(s).
[in]tolThe tolerance for intersection (for physical distances).
[in]EPSThe tolerance for intersection (for parameter distances).
[in]countUntrimmedTrue if intersections with the untrimmed patch should also be recorded.
[in]isHalfOpenTrue if the patch is parameterized in [0,1)^2.
[out]successFalse if an early return occured.

Perform Bezier extraction and record intersections with each patch. After intersections are recorded, parameter points located outside the trimming curves are pruned from the list (unless specified by countUntrimmed).

Note
This method clears the input vectors t, u, v
Warning
This function returns early if we record excessive intersections. This implies the patch is degenerate at the point of intersection.
Returns
True if an intersection is found, false otherwise

References axom::primal::NURBSPatch< T, NDIMS >::boundingBox(), axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::Array< T, DIM, SPACE, StoragePolicy >::empty(), axom::primal::BoundingBox< T, NDIMS >::expand(), axom::primal::NURBSPatch< T, NDIMS >::extractBezier(), axom::primal::NURBSPatch< T, NDIMS >::getKnots_u(), axom::primal::NURBSPatch< T, NDIMS >::getKnots_v(), axom::primal::KnotVector< T >::getNumKnots(), axom::primal::KnotVector< T >::getUniqueKnots(), intersect(), axom::primal::NURBSPatch< T, NDIMS >::isVisible(), axom::utilities::lerp(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and squared_distance().

◆ intersect() [42/43]

template<typename T >
bool axom::primal::intersect ( const Line< T, 3 > &  line,
const NURBSPatch< T, 3 > &  patch,
axom::Array< T > &  t,
axom::Array< T > &  u,
axom::Array< T > &  v,
double  tol = 1e-8,
double  EPS = 1e-8,
bool  countUntrimmed = true,
bool  isHalfOpen = false 
)

!

Determines if a line intersects a NURBS patch with fewer exposed parameters.

References intersect().

◆ intersect() [43/43]

template<typename T >
bool axom::primal::intersect ( const NURBSCurve< T, 2 > &  n1,
const NURBSCurve< T, 2 > &  n2,
axom::Array< T > &  p1,
axom::Array< T > &  p2,
double  tol = 1.0E-8 
)

Finds the intersection points for two NURBS curves in 2D.

Parameters
[in]n1A 2D NURBSCurve.
[in]n2A 2D NURBSCurve.
[out]p1The array of parameters for intersection points in n1.
[out]p2The array of parameters for intersection points in n2.
[in]tolTolerance used in the segment pair intersection test.
Returns
true iff n1 intersects with n2, otherwise, false.
Note
The number of new entries added to p1 and p2 is the number of intersections, and corresponding entries in p1 and p2 are for the same intersection. This function checks for intersections of Bezier segments of the two NURBS curves. It does not perform simple bounding-box checks to quickly determine no intersection, which could be done before calling this function for better efficiency in some applications.

◆ intersection_volume() [1/5]

template<typename T >
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.

Parameters
[in]hexThe hexahedron
[in]tetThe tetrahedron
[in]epsThe tolerance for determining the intersection
[in]tryFixOrientationIf 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.
Returns
Intersection volume between the hexahedron and tetrahedron
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned volume may be zero and/or unexpected.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned volume of intersection may be zero and/or unexpected.

References clip().

◆ intersection_volume() [2/5]

template<typename T >
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.

Parameters
[in]hexThe tetrahedron
[in]tetThe hexahedron
[in]epsThe tolerance for determining the intersection
[in]tryFixOrientationIf 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.
Returns
Intersection volume between the tetrahedron and hexahedron
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned volume may be zero and/or unexpected.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned volume of intersection may be zero and/or unexpected.

References intersection_volume().

◆ intersection_volume() [3/5]

template<typename T >
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.

Parameters
[in]octThe octahedron
[in]tetThe tetrahedron
[in]epsThe tolerance for determining the intersection
[in]tryFixOrientationIf 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.
Returns
Intersection volume between the octahedron and tetrahedron
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned volume may be zero and/or unexpected.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned volume of intersection may be zero and/or unexpected.

References clip().

◆ intersection_volume() [4/5]

template<typename T >
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.

Parameters
[in]octThe tetrahedron
[in]tetThe octahedron
[in]epsThe tolerance for determining the intersection
[in]tryFixOrientationIf 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.
Returns
Intersection volume between the tetrahedron and octahedron
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned volume may be zero and/or unexpected.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned volume of intersection may be zero and/or unexpected.

References intersection_volume().

◆ intersection_volume() [5/5]

template<typename T >
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.

Parameters
[in]tet1The tetrahedron
[in]tet2The other tetrahedron
[in]epsThe tolerance for determining the intersection
[in]tryFixOrientationIf 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.
Returns
Intersection volume between the tetrahedra
Warning
tryFixOrientation flag does not guarantee the shapes' vertex orders will be valid. It is the responsiblity of the caller to pass shapes with a valid vertex order. Otherwise, if the shapes have invalid vertex orders, the returned volume may be zero and/or unexpected.
If tryFixOrientation flag is false and some of the shapes have a negative signed volume, the returned volume of intersection may be zero and/or unexpected.

References clip().

◆ is_convex()

template<typename T >
bool axom::primal::is_convex ( const Polygon< T, 2 > &  poly,
double  EPS = 1e-8 
)

Determines if a polygon defined by ordered vertices is convex.

Parameters
[in]polyThe 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.

Note
Only defined in 2D
Returns
A boolean value indicating convexity

References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), ON_BOUNDARY, and orientation().

◆ orientation() [1/2]

template<typename T >
int axom::primal::orientation ( const Point< T, 3 > &  p,
const Triangle< T, 3 > &  tri,
double  EPS = 1e-9 
)
inline

Computes the orientation of a point p with respect to an oriented triangle tri.

Parameters
[in]pthe query point
[in]trian oriented triangle
[in]EPSa tolerance for determining if p and tri are coplanar
Returns
The orientation of p with respect to tri
Note
The triangle lies in a plane that divides space into the positive half-space and the negative half-space. The triangle's normal vector points in the positive half-space. The return value of this routine can be one of the following:
  • ON_BOUNDARY, when p is coplanar with tri (within tolerance EPS)
  • ON_POSITIVE_SIDE, when p lies in the positive half-space
  • ON_NEGATIVE_SIDE, when p lies in the negative half-space
See also
OrientationResult

References axom::numerics::determinant(), axom::utilities::isNearlyEqual(), ON_BOUNDARY, ON_NEGATIVE_SIDE, and ON_POSITIVE_SIDE.

◆ orientation() [2/2]

template<typename T >
int axom::primal::orientation ( const Point< T, 2 > &  p,
const Segment< T, 2 > &  seg,
double  EPS = 1e-9 
)
inline

Computes the orientation of a point p with respect to an oriented segment.

Parameters
[in]pthe query point
[in]segan oriented segment
[in]EPSa tolerance for determining if p and seg are coplanar
Returns
The orientation of p with respect to seg
Note
The segment lies in a plane that divides space into the positive half-space and the negative half-space. The segment's normal vector points in the positive half-space. The return value can be one of the following:
  • ON_BOUNDARY, when p is coplanar with seg (within tolerance EPS)
  • ON_POSITIVE_SIDE, when p lies in the positive half-space
  • ON_NEGATIVE_SIDE, when p lies in the negative half-space
See also
OrientationResult

References axom::numerics::determinant(), axom::utilities::isNearlyEqual(), ON_BOUNDARY, ON_NEGATIVE_SIDE, and ON_POSITIVE_SIDE.

◆ slice()

template<typename T , PolygonArray ARRAY_TYPE = PolygonArray::Dynamic, int MAX_VERTS = DEFAULT_MAX_NUM_VERTICES>
AXOM_HOST_DEVICE primal::Polygon<T, 3, ARRAY_TYPE, MAX_VERTS> axom::primal::slice ( const primal::Tetrahedron< T, 3 > &  tet,
const primal::Plane< T, 3 > &  plane 
)

Slices a 3D tetrahedron with a plane and returns the resulting polygon.

Parameters
[in]tetThe tetrahedron to slice
[in]planeThe slicing plane
Returns
The polygon obtained from slicing a tetrahedron with a plane. When the plane intersects the tetrahedron in a nondegenerate cross section, the return value is a triangle or quadrilateral. Degenerate intersections are also represented as polygons: a plane that touches the tetrahedron at a single vertex returns a one-vertex polygon, and a plane that intersects the tetrahedron only along one edge returns a two-vertex polygon.
Note
For nondegenerate intersections, the polygon vertices are intended to be ordered so that the polygon normal is aligned with the plane normal.

◆ split() [1/2]

template<typename Tp >
void axom::primal::split ( const Octahedron< Tp, 3 > &  oct,
axom::Array< Tetrahedron< Tp, 3 >> &  out 
)

Splits an Octahedron into eight Tetrahedrons.

Template Parameters
Tpthe coordinate type, such double or float
Parameters
[in]octThe Octahedron to split
[out]outThe 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.

◆ split() [2/2]

template<typename Tp >
AXOM_HOST_DEVICE void axom::primal::split ( const Octahedron< Tp, 3 > &  oct,
Tetrahedron< Tp, 3 > *  outPtr 
)

Splits an Octahedron into eight Tetrahedrons.

Template Parameters
Tpthe coordinate type, such as double or float
Parameters
[in]octThe Octahedron to split
[out]outPtrC-style array of 8 Tetrahedron objects.

The tets are produced by putting a vertex at the centroid of the oct and drawing an edge from each vertex to the centroid.

◆ squared_distance() [1/6]

double axom::primal::squared_distance ( const double *  A,
const double *  B,
int  N 
)
inline

Computes the squared distance from point A to point B, represented by arrays of length N.

Parameters
[in]Asource point
[in]Bend point.
[in]Nlength of A and B.
Returns
the squared distance from point A to point B. If N < 1, return 0.
Precondition
A and B are arrays of at least length N.

◆ squared_distance() [2/6]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::squared_distance ( const Point< T, NDIMS > &  A,
const Point< T, NDIMS > &  B 
)
inline

Computes the squared distance from point A to point B.

Parameters
[in]Asource point
[in]Bend point.
Returns
the squared distance from point A to point B.

References axom::primal::Vector< T, NDIMS >::squared_norm().

◆ squared_distance() [3/6]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::squared_distance ( const Point< T, NDIMS > &  P,
const BoundingBox< T, NDIMS > &  B 
)
inline

Computes the minimum squared distance from a query point, P, to a given axis-aligned bounding box B.

Parameters
[in]Pthe query point.
[in]Bthe axis-aligned bounding box.
Returns
the squared distance from P to the closest point on box B or axom::numerics::floating_point_limits<T>::max() if B is invalid.

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

◆ squared_distance() [4/6]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::squared_distance ( const BoundingBox< T, NDIMS > &  A,
const BoundingBox< T, NDIMS > &  B 
)
inline

Computes the minimum squared distance between 2 axis-aligned boxes.

Parameters
[in]Athe first axis-aligned bounding box.
[in]Bthe second axis-aligned bounding box. If the boxes overlap, the minimum distance is zero.
Returns
the squared distance between the closest points on A and B or axom::numerics::floating_point_limits<T>::max() if either box is invalid.

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

◆ squared_distance() [5/6]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::squared_distance ( const Point< T, NDIMS > &  P,
const Segment< T, NDIMS > &  S 
)
inline

Computes the minimum squared distance from a query point, P, to the given segment, S.

Parameters
[in]Pthe query point.
[in]Sthe input segment.
Returns
the minimum squared-distance from P to the segment S.

References squared_distance().

◆ squared_distance() [6/6]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::squared_distance ( const Point< T, NDIMS > &  P,
const Triangle< T, NDIMS > &  tri 
)
inline

Computes the minimum squared distance from a query point, P, to the closest point on the given triangle.

Parameters
[in]Pthe query point.
[in]trithe supplied triangle.
Returns
the squared distance from P to the closest point on the triangle T.

References squared_distance().

◆ winding_number() [1/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  q,
const Segment< T, 2 > &  s,
double  edge_tol = 1e-8 
)

Compute the GWN for a 2D point wrt a 2D line segment.

Parameters
[in]qThe query point to test
[in]sThe line segment
[in]edge_tolThe tolerance at which a point is on the line
Returns
The GWN

◆ winding_number() [2/28]

template<typename T >
int axom::primal::winding_number ( const Point< T, 2 > &  q,
const Triangle< T, 2 > &  tri,
bool  includeBoundary = false,
double  edge_tol = 1e-8 
)

Compute the winding number for a 2D point wrt a 2D triangle.

Parameters
[in]qThe query point to test
[in]triThe triangle
[in]includeBoundaryIf true, points on the boundary are considered interior.
[in]edge_tolThe tolerance at which a point is on the line

The triangle is assumed to be closed, so the winding number is an integer

Returns
The integer winding number

References winding_number().

◆ winding_number() [3/28]

template<typename T >
int axom::primal::winding_number ( const Point< T, 2 > &  R,
const Polygon< T, 2 > &  P,
bool &  isOnEdge,
bool  includeBoundary = false,
double  edge_tol = 1e-8 
)

Computes the winding number for a 2D point wrt a 2D polygon.

Parameters
[in]RThe query point to test
[in]PThe Polygon object to test for containment
[out]isOnEdgeAn optional return parameter if the point is on the boundary
[in]includeBoundaryIf true, points on the boundary are considered interior
[in]edge_tolThe distance at which a point is considered on the boundary
Returns
The integer winding number

◆ winding_number() [4/28]

template<typename T >
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.

Parameters
[in]RThe query point to test
[in]PThe Polygon object to test for containment
[in]includeBoundaryIf true, points on the boundary are considered interior
[in]edge_tolThe 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.

Returns
The integer winding number

◆ winding_number() [5/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]nThe NURBS curve object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Returns
The GWN.

◆ winding_number() [6/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  q,
const BezierCurve< T, 2 > &  bezier,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for a 2D point wrt a 2D NURBS curve.

Parameters
[in]qThe query point to test
[in]bezierThe Bezier curve object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Returns
The GWN.

◆ winding_number() [7/28]

template<typename T , typename CurveType >
double axom::primal::winding_number ( const Point< T, 2 > &  q,
const CurvedPolygon< CurveType > &  cpoly,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for a 2D point wrt to a 2D curved polygon.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
Parameters
[in]qThe query point to test
[in]cpolyThe CurvedPolygon object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the GWN for the curved polygon by summing the GWN for each curved edge

Returns
The GWN.

References axom::primal::CurvedPolygon< CurveType >::numEdges(), and winding_number().

◆ winding_number() [8/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]carrayThe array of Bezier curves
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Sums the GWN at q for each curved edge

Returns
The GWN.

◆ winding_number() [9/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]narrayThe array of NURBS curves
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Sums the GWN at q for each curved edge

Returns
The GWN.

◆ winding_number() [10/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  query,
const detail::NURBSCurveGWNCache< T > &  nurbs_cache,
bool &  isOnCurve,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for a 2D point wrt memoized data for a 2D NURBS curve.

Parameters
[in]queryThe query point to test
[in]nurbs_cacheThe NURBS curve cache data object containing memoized values
[out]isOnCurveSet to true is the query point is on the curve
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Returns
The GWN.

◆ winding_number() [11/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  q,
const detail::NURBSCurveGWNCache< T > &  nurbs_cache,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Overload without optional return parameter.

References winding_number().

◆ winding_number() [12/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  query,
const axom::Array< detail::NURBSCurveGWNCache< T >> &  nurbs_cache_arr,
bool &  isOnCurve,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for a 2D point wrt an array of memoized data for 2D NURBS curves.

Parameters
[in]queryThe query point to test
[in]nurbs_cache_arrThe array of memoized curve objects
[out]isOnCurveSet to true is the query point is on the curve
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Returns
The GWN.

References winding_number().

◆ winding_number() [13/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  query,
const axom::ArrayView< const detail::NURBSCurveGWNCache< T >> &  nurbs_curve_arr,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Overload for views.

References winding_number().

◆ winding_number() [14/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 2 > &  query,
const axom::Array< detail::NURBSCurveGWNCache< T >> &  nurbs_curve_arr,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Overload without optional return parameter.

References winding_number().

◆ winding_number() [15/28]

template<typename T >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 2 >> &  query_arr,
const axom::Array< detail::NURBSCurveGWNCache< T >> &  nurbs_cache_arr,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for an array of 2D points wrt an array of cached data for 2D NURBS curves.

Parameters
[in]query_arrThe array of query points to test
[in]nurbs_curve_arrThe array of memoized curve objects
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Note
This method is accelerated via memoization, i.e. dynamically caching and reusing intermediate values for each curve across query points
Returns
The array of GWN values.

◆ winding_number() [16/28]

template<typename T , typename CurveType >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 2 >> &  query_arr,
const axom::Array< CurveType > &  curve_arr,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for an array of 2D points wrt an array of generic 2D curves.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
Parameters
[in]query_arrThe array of query point to test
[in]curve_arrThe array of curve objects
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Note
This method is accelerated via memoization, i.e. dynamically caching and reusing intermediate values for each curve across query points
Returns
The array of GWN values.

References axom::Array< T, DIM, SPACE, StoragePolicy >::emplace_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and winding_number().

◆ winding_number() [17/28]

template<typename T , typename CurveType >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 2 >> &  q_arr,
const CurvedPolygon< CurveType > &  cpoly,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for an array of 2D points wrt to a 2D curved polygon.

Template Parameters
CurveTypeThe BezierCurve, NURBSCurve, or NURBSCurveGWNCache which represents the curve
Parameters
[in]q_arrThe array of query points to test
[in]cpolyThe CurvedPolygon object of generic curves
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the GWN for the curved polygon by summing the GWN for each curved edge

Note
This method is accelerated via memoization, i.e. dynamically caching and reusing intermediate values for each curve across query points
Returns
The GWN.

References axom::Array< T, DIM, SPACE, StoragePolicy >::emplace_back(), axom::primal::CurvedPolygon< CurveType >::numEdges(), and winding_number().

◆ winding_number() [18/28]

template<typename T >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 2 >> &  q_arr,
const CurvedPolygon< detail::NURBSCurveGWNCache< T >> &  cpoly,
double  edge_tol = 1e-8,
double  EPS = 1e-8 
)

Computes the GWN for an array of 2D points wrt to a 2D curved polygon.

Parameters
[in]q_arrThe array of query points to test
[in]cpolyThe CurvedPolygon object of NURBS curves with cached GWN data
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the GWN for the curved polygon by summing the GWN for each curved edge

Warning
Because the cache isKdiscarded immediately after computation, this method is not accelerated by memoization
Returns
The GWN.

References winding_number().

◆ winding_number() [19/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]triThe 3D Triangle object
[out]isOnFaceAn optional return parameter if the point is on the triangle
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous 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

Returns
The GWN.

References axom::primal::Triangle< T, NDIMS >::area(), axom::numerics::cross_product(), axom::numerics::dot_product(), and axom::utilities::isNearlyEqual().

◆ winding_number() [20/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]triThe 3D Triangle object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the GWN for the triangle without an additional return parameter

Returns
The GWN.

References winding_number().

◆ winding_number() [21/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]polyThe Polygon object
[out]isOnFaceReturn variable to show if the point is on the polygon
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Precondition
Assumes the polygon is planar. Otherwise, a meaningless value is returned.

Triangulates the polygon and computes the triangular GWN for each component

Returns
The GWN.

References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::numVertices(), and winding_number().

◆ winding_number() [22/28]

template<typename T >
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.

Parameters
[in]qThe query point to test
[in]polyThe Polygon object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Precondition
Assumes the polygon is planar. Otherwise, a meaningless value is returned.

Computes the GWN for the polygon without an additional return parameter

Returns
The GWN.

References winding_number().

◆ winding_number() [23/28]

template<typename T >
int axom::primal::winding_number ( const Point< T, 3 > &  q,
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.

Parameters
[in]qThe query point to test
[in]polyThe Polyhedron object
[in]includeBoundaryIf true, points on the boundary are considered interior.
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Precondition
Expects the polyhedron to be convex and closed so that the returned value is an integer.

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.

Returns
The integer winding number.

References axom::primal::Polygon< T, NDIMS, ARRAY_TYPE, MAX_VERTS >::addVertex(), axom::Array< T, DIM, SPACE, StoragePolicy >::data(), axom::primal::Polyhedron< T, NDIMS >::getFaces(), axom::primal::Polyhedron< T, NDIMS >::hasNeighbors(), axom::primal::Polyhedron< T, NDIMS >::numVertices(), SLIC_ASSERT, and winding_number().

◆ winding_number() [24/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 3 > &  query,
const detail::NURBSPatchGWNCache< T > &  nurbs,
const double  edge_tol = 1e-8,
const double  ls_tol = 1e-8,
const double  quad_tol = 1e-8,
const double  disk_size = 0.01,
const double  EPS = 1e-8 
)

Computes the GWN for a 3D point wrt a 3D NURBS patch with precomputed data.

Parameters
[in]queryThe query point to test
[in]nurbsThe NURBS patch object with data
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]ls_tolThe tolerance for the line-surface intersection routine
[in]quad_tolThe maximum relative error allowed in the quadrature
[in]disk_sizeThe size of extracted disks as a percent of parameter bbox diagonal
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the generalized winding number for a NURBS patch using Stokes theorem.

Returns
The GWN.

◆ winding_number() [25/28]

template<typename T >
double axom::primal::winding_number ( const Point< T, 3 > &  query,
const axom::ArrayView< const detail::NURBSPatchGWNCache< T >> &  nurbs_arr,
const double  edge_tol = 1e-8,
const double  ls_tol = 1e-8,
const double  quad_tol = 1e-8,
const double  disk_size = 0.01,
const double  EPS = 1e-8 
)

Overload for a single query and an ArrayView.

◆ winding_number() [26/28]

template<typename T , typename SurfaceType >
double axom::primal::winding_number ( const Point< T, 3 > &  query,
const SurfaceType &  surf,
const double  edge_tol = 1e-8,
const double  ls_tol = 1e-8,
const double  quad_tol = 1e-8,
const double  disk_size = 0.01,
const double  EPS = 1e-8 
)

Computes the GWN for a 3D point wrt a generic 3D surface object.

Template Parameters
SurfaceTypeThe BezierPatch or NURBSPatch which represents the surface
Parameters
[in]queryThe query point to test
[in]surfThe BezierPatch or NURBSPatch object
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]ls_tolThe tolerance for the line-surface intersection routine
[in]quad_tolThe maximum relative error allowed in the quadrature
[in]disk_sizeThe size of extracted disks as a percent of parameter bbox diagonal
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances
Warning
Because the constructed cache object is discarded after gwn evaluation, this method is not accelerated via memoization
Returns
The GWN.

References winding_number().

◆ winding_number() [27/28]

template<typename T >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 3 >> &  query_arr,
const axom::Array< detail::NURBSPatchGWNCache< T >> &  nurbs_arr,
const double  edge_tol = 1e-8,
const double  ls_tol = 1e-8,
const double  quad_tol = 1e-8,
const double  disk_size = 0.01,
const double  EPS = 1e-8 
)

Computes the GWN for an array of 3D point wrt an array of NURBS patch cache data.

Parameters
[in]query_arrThe query point to test
[in]nurbs_arrArray of NURBSPatchGWNCache object containing intermediate values
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]ls_tolThe tolerance for the line-surface intersection routine
[in]quad_tolThe maximum relative error allowed in the quadrature
[in]disk_sizeThe size of extracted disks as a percent of parameter bbox diagonal
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the generalized winding number for a NURBS patch using Stokes theorem.

Note
This method is accelerated via memoization, i.e. dynamically caching and reusing intermediate values for each curve across query points
Returns
The array of GWN values.

◆ winding_number() [28/28]

template<typename T , typename SurfaceType >
axom::Array<double> axom::primal::winding_number ( const axom::Array< Point< T, 3 >> &  query_arr,
const axom::Array< SurfaceType > &  surf_arr,
const double  edge_tol = 1e-8,
const double  ls_tol = 1e-8,
const double  quad_tol = 1e-8,
const double  disk_size = 0.01,
const double  EPS = 1e-8 
)

Computes the GWN for an array an array of 3D points wrt an array of generic surfaces.

Template Parameters
SurfaceTypeThe BezierPatch or NURBSPatch which represents the surface
Parameters
[in]query_arrThe query point to test
[in]surf_arrArray of NURBSPatch or BezierPatch objects
[in]edge_tolThe physical distance level at which objects are considered indistinguishable
[in]ls_tolThe tolerance for the line-surface intersection routine
[in]quad_tolThe maximum relative error allowed in the quadrature
[in]disk_sizeThe size of extracted disks as a percent of parameter bbox diagonal
[in]EPSMiscellaneous numerical tolerance level for nonphysical distances

Computes the generalized winding number for a NURBS patch using Stokes theorem.

Note
This method is accelerated via memoization, i.e. dynamically caching and reusing intermediate values for each curve across query points
Returns
The array of GWN values.

References axom::Array< T, DIM, SPACE, StoragePolicy >::emplace_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and winding_number().