KrisLibrary
1.0.0
|
An arbitrary connected polygon in 3D space given by a vertex list. More...
#include <Polygon3D.h>
Public Member Functions | |
size_t | next (size_t i) const |
size_t | prev (size_t i) const |
void | triangulateConvex (std::vector< Triangle3D > &tris) const |
Real | areaConvex () const |
Vector3 | centroidConvex () const |
void | setTransformed (const Polygon2D &in, const Matrix4 &T) |
assigns coordinate z=0 for in | |
void | setTransformed (const Polygon3D &in, const Matrix4 &T) |
void | getEdge (int i, Segment3D &ei) const |
void | getPlane (int i, Plane3D &p) const |
sets p to contain (pi,pi+1,pi+2) | |
void | getPlaneFit (Plane3D &p) const |
uses a least-squares fit | |
Real | maxDistance (const Plane3D &p) const |
maximum abs distance to the plane | |
void | getPlanarPolygon (Polygon2D &p, Matrix4 &T) const |
void | getAABB (AABB3D &) const |
bool | Read (File &f) |
bool | Write (File &f) const |
Public Attributes | |
std::vector< Point3D > | vertices |
a list of points around the boundary | |
An arbitrary connected polygon in 3D space given by a vertex list.
Vertices are numbered 0...n-1. Edge i connects verts i and i+1 (looping around to 0).
gets the best-fit plane, and projects the polygon onto that 2d plane. Returns the matrix that transforms p to this.
References Math::dot(), Math3D::Vector3::getOrthogonalBasis(), vertices, and Math3D::Polygon2D::vertices.