Reference Source
public class | source

MeshVolume

Calculates the volume of triangle meshes.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

indices: *[]

public
public
public
public

vertices: *[]

public get

Gets the volume of the mesh.

Method Summary

Public Methods
public

addIndex(index: *)

Adds an index.

public

addVertex(vertex: *)

Adds a vertex.

public

reset()

Resets, ready to add vertices and indices for a new mesh.

public

setPrimitive(primitive: *)

Public Constructors

public constructor() source

Public Members

public indices: *[] source

public lenIndices: number source

public lenVertices: number source

public primitive: * source

public vertices: *[] source

public get volume: number: * source

Gets the volume of the mesh.

The mesh must be a closed solid.

Return:

number

The volume of the mesh, or -1 if the mesh is not solid, in which case volume cannot be determined.

Public Methods

public addIndex(index: *) source

Adds an index.

Params:

NameTypeAttributeDescription
index *

public addVertex(vertex: *) source

Adds a vertex.

Params:

NameTypeAttributeDescription
vertex *

public reset() source

Resets, ready to add vertices and indices for a new mesh.

public setPrimitive(primitive: *) source

Params:

NameTypeAttributeDescription
primitive *