58#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_SIMPLE_POLYGON_3D_H
59#define LASS_GUARDIAN_OF_INCLUSION_PRIM_SIMPLE_POLYGON_3D_H
83 typedef SimplePolygon3D<T> TSelf;
87 typedef typename TPoint::TVector TVector;
91 typedef typename TPoint::TValue TValue;
92 typedef typename TPoint::TParam TParam;
93 typedef typename TPoint::TReference TReference;
94 typedef typename TPoint::TConstReference TConstReference;
95 typedef typename TPoint::TNumTraits TNumTraits;
97 enum { dimension = TPoint::dimension };
99 template <
typename U>
struct Rebind
101 typedef SimplePolygon3D<U, PlaneEquationPolicy, PlaneNormalizingPolicy> Type;
104 SimplePolygon3D(
const TPlane& iPlane);
105 SimplePolygon3D(
const TPoint& iA,
const TPoint& iB,
const TPoint& iC);
109 const TPoint&
at(
int iIndexOfVertex)
const;
110 TPoint&
at(
int iIndexOfVertex);
111 const TLineSegment
edge(
int iIndexOfTailVertex)
const;
112 const TVector
vector(
int iIndexOfTailVertex)
const;
118 void add(
const TPoint& iVertex);
119 void insert(
int iIndexOfVertex,
const TPoint& iVertex);
133 bool isConcave()
const;
140 Side classify(
const TPoint& iP)
const;
147 bool isInRange(
size_t iIndexOfVertex)
const;
149 typedef std::vector<TPoint> TVertices;
155template<
typename T,
class EP,
class NP,
class PP>
158 T& oT,
const T& iMinT = 0);
160template<
typename T,
class EP1,
class NP1,
class EP2,
class NP2>
164template <
typename T,
class EP,
class NP>
167template <
typename T,
class EP,
class NP>
176#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_SIMPLE_POLYGON_3D
177#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
181#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_AABB_3D_H
185#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_RAY_3D_H
Output stream for writing a selection of geometric primitives to XML files.
convex or concave polygon in 2D (not selfintersecting, no holes)
convex or concave polygon in 3D (not selfintersecting, no holes)
TPoint & operator[](size_t iIndexOfVertex)
return vertex of polygon by its index, not wrapped, no bounds check.
void insert(int iIndexOfVertex, const TPoint &iVertex)
insert a vertex at iIndex (so it will sit before the current at(iIndex)).
const TValue area() const
return area of the polygons surface.
const XYZ majorAxis() const
determines the major axis of the normal vector.
const TValue perimeter() const
return sum of the lengths of all edges
bool contains(const TPoint &iP) const
return true if a point iP is inside the polygon, on condition iP is on the plane
const TPointH vertexCentroid() const
return the barycenter of all vertices.
const TVector vector(int iIndexOfTailVertex) const
return the vector between vertices at(iIndex) and at(iIndex + 1)\
TPoint & at(int iIndexOfVertex)
return vertex of polygon by its index, but wrap around the bounds.
bool isConvex() const
return true if polygon is convex, false if not.
const SimplePolygon2D< T > mapping(XYZ iAxis) const
maps a 3D polygon as a 2D polygon by ignoring the component along an axis.
size_t size() const
return number of vertices
void flip()
flip normal and reverse sequence of vertices
const TPoint & operator[](size_t iIndexOfVertex) const
return vertex of polygon by its index, not wrapped, no bounds check.
Orientation orientation() const
return orientation of polygon
const TValue signedArea() const
return signed polygon area.
TPlane & plane()
access support plane of polygon.
const TPoint & at(int iIndexOfVertex) const
return vertex of polygon by its index, but wrap around the bounds.
bool isReflex(int iIndexOfVertex) const
return true if inner angle of vertex is reflex (is > 180 degrees).
void add(const TPoint &iVertex)
add a point at the "end" of the vertex list
const TVector normal() const
return normal of plane
bool isEmpty() const
return true if polygon has no vertices
void remove(int iIndexOfVertex)
remove the vertex at(iIndex)
const TPointH surfaceCentroid() const
return the centroid of the filled polygon.
bool isSimple() const
return true if polygon is simple, false if not.
const TLineSegment edge(int iIndexOfTailVertex) const
return the edge of the polygon between vertices at(iIndex) and at(iIndex + 1).
const TPlane & plane() const
return support plane of polygon.
cyclic iterator over xyz indices
set of geometrical primitives
Side
Different sides of a surface.
Orientation
enumeration of clockwise versus counterclockwise
Result
meta information on the result you have from an operation like an intersection ...
Library for Assembled Shared Sources.
policy for an implementation based on the cartesian equation.
Policy to auto-normalize normals.