Functions for 3D Point3D concave and convex flat polygons. No specific order is required.
enum ContainsPointRes ContainsPoint(const Vector<Point3D>& polygon, const Point3D& point, double distanceTol, double angleNormalTol)
Checks if point point is inside or in the boundaries of polygon polygon.
distanceTol indicates the tolerance in m to check if a point is in the plane of the polygon.
angleNormalTol indicates the tolerance in rad of the normals of the triangles of the polygon, to test if polygon is flat.
Returned ContainsPointRes is:
>0 (POLY_IN) if pt is inside
== 0 (POLY_SECT) if pt is in the boundary.
Negatives values indicate that point is outside:
POLY_NOPLAN = -4. The polygon is not flat.
POLY_FAR = -3. The point is not in the same plane.
POLY_3 = -2. The polygon has less than three points.
POLY_OUT = -1. The point is in the same plane, but outside.
double Area(const UVector<Point3D>& p)
Returns the area of polygon p.
bool IsRectangle(const UVector<Point3D>& p)
Returns true if p is a rectangle (flat).
bool IsFlat(const UVector<Point3D>& p)
Returns true if the polygon p is on a flat surface.
Point3D Centroid(const UVector<Point3D>& p)
Returns the centroid of polygon p.
Vector<Pointf> Point3Dto2D_XY(const Vector<Point3D>& bound)
Converts the 3D polygon bound to a 2D polygon based on X and Y.
Vector<Pointf> Point3Dto2D_XZ(const Vector<Point3D>& bound)
Converts the 3D polygon bound to a 2D polygon based on X and Z.
Vector<Pointf> Point3Dto2D_YZ(const Vector<Point3D>& bound)
Converts the 3D polygon bound to a 2D polygon based on Y and Z.
Vector<Point3D> Point2Dto3D_XY(const Vector<Pointf>& bound)
Converts the 2D polygon bound to a 3D polygon based on X and Y.
Vector<Point3D> Point2Dto3D_XZ(const Vector<Pointf>& bound)
Converts the 2D polygon bound to a 3D polygon based on X and Z.
Vector<Point3D> Point2Dto3D_YZ(const Vector<Pointf>& bound)
Converts the 2D polygon bound to a 3D polygon based on Y and Z.
|