Back to class index

Class Polyhedron

Summary

Represents a three-dimensional closed geometric solid defined by flat polygonal faces.

Member Reference

PolyhedronRepresents a three-dimensional closed geometric solid defined by flat polygonal faces.
vSpecifies the vertices of this polyhedron.
fSpecifies the individual faces of this polyhedron.
ctorThe default constructor creates a null polyhedron.
NumVertices()[const]Returns the number of vertices in this polyhedron.
NumFaces()[const]Returns the number of faces in this polyhedron.
NumEdges()[const]Returns the number of (unique) edges in this polyhedron.
VertexArrayPtr() (+1 overload)Returns a pointer to an array of vertices of this polyhedron.
Vertex(vertexIndex)[const]Returns the ith vertex of this polyhedron.
Edge(edgeIndex)[const]Returns the ith edge of this polyhedron.
Edges()[const]Returns all the (unique) edges of this polyhedron.
Faces()[const]
EdgeIndices()[const]Returns all the (unique) edges of this polyhedron, as indices to the polyhedron vertex array.
FacePolygon(faceIndex)[const]Returns a polygon representing the given face.
FacePlane(faceIndex)[const]Returns the plane of the given polyhedron face.
FaceNormal(faceIndex)[const]Returns the normalized normal vector of the given face.
ExtremeVertex(direction)[const]Returns the index of the vertex of this polyhedron that reaches farthest in the given direction.
ExtremePoint(direction)[const]Computes an extreme point of this Polyhedron in the given direction.
ProjectToAxis(...)[const]Projects this Polyhedron onto the given 1D axis direction vector.
ConvexCentroid()[const]Returns the exact center of mass of the convex hull of this polyhedron.
ApproximateConvexCentroid()[const]If this Polyhedron is a tetrahedron, this is the center of mass for the Polyhedron.
SurfaceArea()[const]Computes the total surface area of the faces of this polyhedron.
Volume()[const]Computes the internal volume of this polyhedron.
MinimalEnclosingAABB()[const]Returns the smallest AABB that encloses this polyhedron.
MergeAdjacentPlanarFaces()
FaceIndicesValid()[const]Tests if the faces in this polyhedron refer to valid existing vertices.
FlipWindingOrder()Flips the winding order of all faces in this polyhedron.
OrientNormalsOutsideConvex()Assuming that this polyhedron is convex, reorients all faces of this polyhedron so that each face plane has its normal pointing outwards.
RemoveRedundantVertices()Removes from the vertex array all vertices that are not referred to by any of the faces of this polyhedron.
IsNull()[const]Returns true if this polyhedron has 0 vertices and 0 faces.
IsClosed()[const]Returns true if this polyhedron is closed and does not have any gaps.
IsConvex()[const]Returns true if this polyhedron is convex.
EulerFormulaHolds()[const]Returns true if the Euler formula (V + F - E == 2) holds for this Polyhedron.
FacesAreNondegeneratePlanar(epsilon)[const]Tests whether all the faces of this polyhedron are non-degenerate (have at least 3 vertices) and in case they have more than 3 vertices, tests that the faces are planar.
ClipLineSegmentToConvexPolyhedron(...)[const]Clips the line/ray/line segment specified by L(t) = ptA + t * dir, tFirst <= t <= tLast, inside this convex polyhedron.
NearestVertex(point)[const]Returns the index of the nearest vertex to the given point.
Contains(point)[const] (+7 overloads)Tests if the given object is fully contained inside this closed polyhedron.
FaceContains(...)[const]Tests if the given face of this Polyhedron contains the given point.
FaceContainmentDistance2D(...)[const]A helper for Contains() and FaceContains() tests: Returns a positive value if the given point is contained in the given face, and a negative value if the given point is outside the face.
ContainsConvex(point,epsilon)[const] (+2 overloads)Tests if the given object is fully contained inside this convex polyhedron.
ClosestPoint(...)[const] (+2 overloads)Computes the closest point on this polyhedron to the given object.
ClosestPointConvex(point)[const]Returns the closest point on this convex polyhedron to the given point.
Distance(point)[const]Returns the distance between this polyhedron and the given object.
Intersects(lineSegment)[const] (+11 overloads)Tests whether this polyhedron and the given object intersect.
IntersectsConvex(line)[const] (+2 overloads)Tests whether this convex polyhedron and the given object intersect.
MergeConvex(point)
Translate(offset)Translates this Polyhedron in world space.
Transform(transform) (+3 overloads)Applies a transformation to this Polyhedron.
SetEquals(p2)Tests if these two polyhedrons represent the same set of points.
SwapVertices(i,j)Swaps two vertices in the vertex array and updates all faces of this polyhedron so that the volume represented by this polyhedron stays the same.
CanonicalizeFaceArray()Converts the list of faces into a canonical order for easier comparison.
ContainsFace(face)[const]Returns true if one of the faces of this Polyhedron has the same ordered of indices as the given Face.
FindClosestVertex(pt,outDistanceSq)[const]Searches each vertex of this polyhedron to find the closest vertex to the given target point.
Triangulate()[const]
ToString()[const]
ConvexHull(...)[static]Creates a Polyhedron object that represents the convex hull of the given point array.
Tetrahedron(...)[static]See http://paulbourke.net/geometry/platonic/.
Octahedron(...)[static]See http://paulbourke.net/geometry/platonic/.
Hexahedron(...)[static]See http://paulbourke.net/geometry/platonic/.
Icosahedron(...)[static]See http://paulbourke.net/geometry/platonic/.
Dodecahedron(...)[static]See http://paulbourke.net/geometry/platonic/.
Back to class index