Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Face

A face of the convex hull.

Hierarchy

  • Face

Index

Constructors

Properties

area: number = 0

The area of the face.

centroid: number[]

The centroid of the face.

edge: null | HalfEdge

The edge of the face.

mark: number

The state the face is in.

nVertices: number

The number of vertices in the face.

normal: number[]

normal of the face.

offset: number

The offset of the face from the origin.

outside: null | Vertex

The vertex on the outside of the face.

Methods

  • collectIndices(): (undefined | number)[]
  • Collects the indices of the face.

    Returns (undefined | number)[]

    The indices of the face.

  • computeCentroid(): void
  • Computes the centroid of the face.

    Returns void

  • computeNormal(): void
  • Computes the normal for the face.

    Returns void

  • computeNormalAndCentroid(minArea?: number): void
  • Computes the normal and the centroid for the face.

    Parameters

    • Optional minArea: number

      The minimum area of the face.

    Returns void

  • computeNormalMinArea(minArea: number): void
  • Computes the normal for the face using the minimum area.

    Parameters

    • minArea: number

      The minimum area of the face.

    Returns void

  • distanceToPlane(point: number[]): number
  • Calculates the distance from the face to a given point.

    Parameters

    • point: number[]

      The point to check.

    Returns number

    The distance from the face to the point.

  • Gets an edge at the given index.

    Parameters

    • i: number

      The index of the edge.

    Returns null | HalfEdge

    The edge at the given index.

  • mergeAdjacentFaces(adjacentEdge: HalfEdge, discardedFaces?: (null | Face)[]): (null | Face)[]
  • Merges adjacent faces.

    Parameters

    • adjacentEdge: HalfEdge

      The edge to start from.

    • discardedFaces: (null | Face)[] = []

      The faces that are discarded.

    Returns (null | Face)[]

    The face that is left after merging.

  • Creates a triangle from the face.

    Parameters

    • v0: Vertex

      The first vertex.

    • v1: Vertex

      The second vertex.

    • v2: Vertex

      The third vertex.

    • minArea: number = 0

      The minimum area of the triangle.

    Returns Face

    The triangle.