AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
winding_number.hpp File Reference

Consists of methods to compute the generalized winding number (GWN) for points with respect to various geometric objects. More...

#include "axom/core.hpp"
#include "axom/config.hpp"
#include "axom/primal/geometry/Point.hpp"
#include "axom/primal/geometry/Segment.hpp"
#include "axom/primal/geometry/Triangle.hpp"
#include "axom/primal/geometry/Polygon.hpp"
#include "axom/primal/geometry/Polyhedron.hpp"
#include "axom/primal/geometry/BezierCurve.hpp"
#include "axom/primal/geometry/NURBSCurve.hpp"
#include "axom/primal/geometry/BezierPatch.hpp"
#include "axom/primal/geometry/NURBSPatch.hpp"
#include "axom/primal/geometry/CurvedPolygon.hpp"
#include "axom/primal/geometry/BoundingBox.hpp"
#include "axom/primal/geometry/OrientedBoundingBox.hpp"
#include "axom/primal/operators/detail/winding_number_2d_impl.hpp"
#include "axom/primal/operators/detail/winding_number_2d_memoization.hpp"
#include "axom/primal/operators/detail/winding_number_3d_impl.hpp"
#include "axom/primal/operators/detail/winding_number_3d_memoization.hpp"
#include <cmath>

Classes

struct  axom::primal::WindingTolerances
 Struct containing tolerances shared across GWN values with sensible defaults. More...
 

Namespaces

 axom
 
 axom::primal
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename T >
double axom::primal::winding_number (const Point< T, 2 > &query, const axom::Array< detail::NURBSCurveGWNCache< T >> &nurbs_curve_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 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. More...
 
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_curve_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 > 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. More...
 
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. More...
 
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. More...
 
Winding number operations between 3D points and primitives
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Consists of methods to compute the generalized winding number (GWN) for points with respect to various geometric objects.