11 #ifndef CAFU_MATH_POLYGON_HPP_INCLUDED
12 #define CAFU_MATH_POLYGON_HPP_INCLUDED
15 #include "Templates/Array.hpp"
58 bool IsValid(
const double RoundEpsilon,
const double MinVertexDist)
const;
69 Vertices[VertexNr+1<Vertices.Size() ? VertexNr+1 : 0],
70 Vertices[VertexNr]-
Plane.Normal, Epsilon);
107 bool Overlaps(
const Polygon3T<T>& OtherPoly,
bool ReportTouchesAsOverlaps,
const T EdgeThickness)
const;
void FillTJunctions(const Polygon3T< T > &Poly, const T EdgeThickness)
If poly builds t-junctions at this polygon, the according vertives are added to this polygon...
Definition: Polygon.cpp:286
SideT WhatSideSimple(const Plane3T< T > &P, const T HalfPlaneThickness) const
Like WhatSide(), but it integrates the "...AndOn" answers with the non-"AndOn" answers.
Definition: Polygon.cpp:140
This class represents a plane in three-dimensional space.
Definition: Plane3.hpp:26
static Polygon3T< T > Merge(const Polygon3T< T > &Poly1, const Polygon3T< T > &Poly2, const T EdgeThickness)
Merge Poly1 and Poly2 under the following prerequisites:
Definition: Polygon.cpp:352
ArrayT< Vector3T< T > > Vertices
Vertices of this polygon.
Definition: Polygon.hpp:32
Polygon3T< T > GetMirror() const
Returns a mirrored copy of this polygon, with reversed plane and reversed order.
Definition: Polygon.cpp:82
The polygon has vertices on the front-side of the plane.
Definition: Polygon.hpp:41
T GetArea() const
Determines the spatial area (Flächeninhalt) of this polygon.
Definition: Polygon.cpp:95
void GetChoppedUpAlong(const Polygon3T< T > &Poly, const T EdgeThickness, ArrayT< Polygon3T< T > > &NewPolys) const
Cuts this polygon along the edges of Poly.
Definition: Polygon.cpp:264
bool Encloses(const Polygon3T< T > &OtherPoly, bool MayTouchEdges, const T EdgeThickness) const
Determines whether this polygon entirely encloses OtherPoly (in the same or mirrored plane)...
Definition: Polygon.cpp:183
This class represents a polymorphic 3-dimensional vector.
Definition: Misc.hpp:11
The polygon is empty (it has no vertices).
Definition: Polygon.hpp:39
The polygon has vertices in the plane. Note that this value alone is never returned by WhatSide()...
Definition: Polygon.hpp:40
This class implements convex polygons.
Definition: Polygon.hpp:28
SideT
Describes on which side of a plane the polygon is.
Definition: Polygon.hpp:37
The polygon has vertices on the back-side of the plane.
Definition: Polygon.hpp:43
The polygon has vertices on both sides of and in the plane.
Definition: Polygon.hpp:46
SideT WhatSide(const Plane3T< T > &P, const T HalfPlaneThickness) const
Determines on what side of plane P this polygon is.
Definition: Polygon.cpp:119
Plane3T< T > GetEdgePlane(unsigned long VertexNr, const T Epsilon) const
Returns the plane that contains the polygon edge defined by (VertexNr, VertexNr+1), that is orthogonal to the polygons plane and whose normal vector points towards the polygon center.
Definition: Polygon.hpp:66
ArrayT< Polygon3T< T > > GetSplits(const Plane3T< T > &SplitPlane, const T HalfPlaneThickness) const
Splits the polygon along the passed plane.
Definition: Polygon.cpp:202
The polygon is in the mirrored version of the plane (opposite normal vectors).
Definition: Polygon.hpp:48
bool IsValid(const double RoundEpsilon, const double MinVertexDist) const
This methods returns whether a polygon is valid wrt.
Definition: Polygon.cpp:14
bool Overlaps(const Polygon3T< T > &OtherPoly, bool ReportTouchesAsOverlaps, const T EdgeThickness) const
Determines whether this polygon overlaps OtherPoly (in the same plane).
Definition: Polygon.cpp:156
static void Complete(ArrayT< Polygon3T< T > > &Polys, const T HalfPlaneThickness, const Vector3T< T > &BoundingSphereCenter=Vector3T< T >(0, 0, 0), const T BoundingSphereRadius=10.0 *1000.0 *1000.0)
Given a brush (here: array of polygons), from which only the planes are known.
Definition: Polygon.cpp:397
The polygon has vertices on the back-side of and in the plane.
Definition: Polygon.hpp:44
The polygon has vertices on the front-side of and in the plane.
Definition: Polygon.hpp:42
The polygon has vertices on both sides of the plane.
Definition: Polygon.hpp:45
bool HasVertex(const Vector3T< T > &A, const T Epsilon) const
Determines whether this polygon has a vertex A, within Epsilon tolerance of the existing vertices...
Definition: Polygon.cpp:110
Plane3T< T > Plane
Plane of this polygon.
Definition: Polygon.hpp:33
Definition: Renderer.hpp:16
The polygon is in the plane.
Definition: Polygon.hpp:47