12#ifndef EBGEOMETRY_POLYGON2D_HPP
13#define EBGEOMETRY_POLYGON2D_HPP
47 static_assert(std::is_floating_point_v<T>,
"Polygon2D requires a floating-point T");
176 std::vector<Vec2> m_points;
202 computeWindingNumber(
const Vec2&
P)
const noexcept;
210 computeCrossingNumber(
const Vec2&
P)
const noexcept;
218 computeSubtendedAngle(
const Vec2&
P)
const noexcept;
223#include "EBGeometry_Polygon2DImplem.hpp"
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Class for embedding a polygon face into 2D.
Definition EBGeometry_Polygon2D.hpp:46
bool isPointInside(const Vec3 &a_point, const InsideOutsideAlgorithm a_algorithm) const noexcept
Check if a point is inside or outside the 2D polygon.
~Polygon2D()=default
Destructor.
Polygon2D(const Vec3 &a_normal, const std::vector< Vec3 > &a_points)
Full constructor.
Polygon2D & operator=(const Polygon2D &a_other)=default
Copy assignment operator.
bool isPointInsidePolygonWindingNumber(const Vec3 &a_point) const noexcept
Check if a point is inside a 2D polygon, using the winding number algorithm.
bool isPointInsidePolygonSubtend(const Vec3 &a_point) const noexcept
Check if a point is inside a 2D polygon, using the subtended angles.
Polygon2D & operator=(Polygon2D &&a_other) noexcept=default
Move assignment operator.
InsideOutsideAlgorithm
Supported algorithms for performing inside/outside tests when checking if a point projects to the ins...
Definition EBGeometry_Polygon2D.hpp:55
Polygon2D(Polygon2D &&a_other) noexcept=default
Move constructor.
Polygon2D()=delete
Disallowed constructor, use the one with the normal vector and points.
Polygon2D(const Polygon2D &a_other)=default
Copy constructor.
bool isPointInsidePolygonCrossingNumber(const Vec3 &a_point) const noexcept
Check if a point is inside a 2D polygon, by computing the number of times a ray crosses the polygon e...
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31