KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
Math3D::Polygon3D Struct Reference

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< Point3Dvertices
 a list of points around the boundary
 

Detailed Description

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).

Member Function Documentation

void Math3D::Polygon3D::getPlanarPolygon ( Polygon2D p,
Matrix4 T 
) const

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.


The documentation for this struct was generated from the following files: