Face

Represents a section bounded by a specific amount of half-edges. The current implmentation assumes that a face always consist of three edges.

Constructor

Face()

Properties

.normal : Vector3

The normal vector of the face. Default is a Vector3 at (0, 0, 0).

.midpoint : Vector3

The midpoint or centroid of the face. Default is a Vector3 at (0, 0, 0).

.area : Float

The area of the face. Default is 0.

.constant : Float

Signed distance from face to the origin. Default is 0.

.outside : VertexNode

Reference to a vertex in a vertex list this face can see. Default is null.

.mark : Integer

Marks if a face is visible or deleted. Default is 'Visible'.

.edge : HalfEdge

Reference to the base edge of a face. To retrieve all edges, you can use the 'next' reference of the current edge. Default is null.

Methods

.create (a : VertexNode, b : VertexNode, c : VertexNode) : Face

a - First vertex of the face.

b - Second vertex of the face.

c - Third vertex of the face.

Creates a face.

.getEdge (i : Integer) : HalfEdge

i - The index of the edge.

Returns an edge by the given index.

.compute () : Face

Computes all properties of the face.

.distanceToPoint (point : Vector3) : Float

point - Any point in 3D space.

Returns the signed distance from a given point to the plane representation of this face.

Source

For more info on how to obtain the source code of this module see this page.