Packageaway3d.tools.helpers
Classpublic class FaceHelper
InheritanceFaceHelper Inheritance Object

Helper Class for face manipulationFaceHelper



Public Methods
 MethodDefined By
  
addFace(mesh:Mesh, v0:Vertex, v1:Vertex, v2:Vertex, uv0:UV, uv1:UV, uv2:UV, subGeomIndice:uint):void
[static]
FaceHelper
  
addFaces(mesh:Mesh, v0s:Vector.<Vertex>, v1s:Vector.<Vertex>, v2s:Vector.<Vertex>, uv0s:Vector.<UV>, uv1s:Vector.<UV>, uv2s:Vector.<UV>, subGeomIndices:Vector.<uint>):void
[static] Adds a series of faces from a mesh.
FaceHelper
  
quarterFace(mesh:Mesh, indice:uint, subGeomIndice:uint):void
[static] Divides a face into 4 faces.
FaceHelper
  
quarterFaces(mesh:Mesh):void
[static] Divides all the faces of a mesh in 4 faces.
FaceHelper
  
removeFace(mesh:Mesh, index:uint, subGeomIndice:uint):void
[static] Remove a face from a mesh
FaceHelper
  
removeFaces(mesh:Mesh, indices:Vector.<uint>, subGeomIndices:Vector.<uint>):void
[static] Remove a series of faces from a mesh.
FaceHelper
  
splitFace(mesh:Mesh, indice:uint, subGeomIndice:uint, side:uint = 0):void
[static] Divides a face into 2 faces.
FaceHelper
  
splitFaces(mesh:Mesh):void
[static] Divides all the faces of a mesh in 2 faces.
FaceHelper
  
triFace(mesh:Mesh, indice:uint, subGeomIndice:uint):void
[static] Divides a face into 3 faces.
FaceHelper
  
triFaces(mesh:Mesh):void
[static] Divides all the faces of a mesh in 3 faces.
FaceHelper
Method Detail
addFace()method
public static function addFace(mesh:Mesh, v0:Vertex, v1:Vertex, v2:Vertex, uv0:UV, uv1:UV, uv2:UV, subGeomIndice:uint):void

Parameters

mesh:Mesh
 
v0:Vertex
 
v1:Vertex
 
v2:Vertex
 
uv0:UV
 
uv1:UV
 
uv2:UV
 
subGeomIndice:uint

addFaces()method 
public static function addFaces(mesh:Mesh, v0s:Vector.<Vertex>, v1s:Vector.<Vertex>, v2s:Vector.<Vertex>, uv0s:Vector.<UV>, uv1s:Vector.<UV>, uv2s:Vector.<UV>, subGeomIndices:Vector.<uint>):void

Adds a series of faces from a mesh. All vectors must have the same length.

Parameters

mesh:Mesh — Mesh. The mesh to remove a face from
 
v0s:Vector.<Vertex> — A vector with a series of Vertex Objects representing the v0 of a face.
 
v1s:Vector.<Vertex> — A vector with a series of Vertex Objects representing the v1 of a face.
 
v2s:Vector.<Vertex> — A vector with a series of Vertex Objects representing the v2 of a face.
 
uv0s:Vector.<UV> — A vector with a series of UV Objects representing the uv0 of a face.
 
uv1s:Vector.<UV> — A vector with a series of UV Objects representing the uv1 of a face.
 
uv2s:Vector.<UV> — A vector with a series of UV Objects representing the uv2 of a face.
 
subGeomIndices:Vector.<uint>

quarterFace()method 
public static function quarterFace(mesh:Mesh, indice:uint, subGeomIndice:uint):void

Divides a face into 4 faces.

Parameters

mesh:Mesh — The mesh holding the face to split in 4.
 
indice:uint — The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice]]
 
subGeomIndice:uint — The index of the subgeometry holder this face.

quarterFaces()method 
public static function quarterFaces(mesh:Mesh):void

Divides all the faces of a mesh in 4 faces.

Parameters

mesh:Mesh — The mesh holding the faces to split in 4 At this time of dev, quarterFaces method will abort if a subgeometry reaches max buffer limit of 65k

removeFace()method 
public static function removeFace(mesh:Mesh, index:uint, subGeomIndice:uint):void

Remove a face from a mesh

Parameters

mesh:Mesh — Mesh. The mesh to remove a face from
 
index:uint — uint. Index of the face in vertices. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 3 in vertice vector is then extracted from vertices[indices[indice]]
 
subGeomIndice:uint — uint. Index of vertex 1 of the face

removeFaces()method 
public static function removeFaces(mesh:Mesh, indices:Vector.<uint>, subGeomIndices:Vector.<uint>):void

Remove a series of faces from a mesh. Indices and geomIndices must have the same length. Meshes with less that 20k faces and single material, will generally only have one single subgeometry. The geomIndices vector will then contain only zeros. IMPORTANT: the code considers the indices as location in the mesh subgemeometry indices vector, not the value at the pointer location.

Parameters

mesh:Mesh — Mesh. The mesh to remove a face from
 
indices:Vector.<uint> — A vector with a series of uints indices: the indices of the faces to be removed.
 
subGeomIndices:Vector.<uint> — A vector with a series of uints indices representing the subgeometries of the faces to be removed.

splitFace()method 
public static function splitFace(mesh:Mesh, indice:uint, subGeomIndice:uint, side:uint = 0):void

Divides a face into 2 faces.

Parameters

mesh:Mesh — The mesh holding the face to split in 2
 
indice:uint — The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice]]
 
subGeomIndice:uint — The index of the subgeometry holder this face.
 
side:uint (default = 0) — [optional] The side of the face to split in two. 0 , 1 or 2. (clockwize).

splitFaces()method 
public static function splitFaces(mesh:Mesh):void

Divides all the faces of a mesh in 2 faces.

Parameters

mesh:Mesh — The mesh holding the faces to split in 2

triFace()method 
public static function triFace(mesh:Mesh, indice:uint, subGeomIndice:uint):void

Divides a face into 3 faces.

Parameters

mesh:Mesh — The mesh holding the face to split in 3.
 
indice:uint — The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice]]
 
subGeomIndice:uint — The index of the subgeometry holder this face.

triFaces()method 
public static function triFaces(mesh:Mesh):void

Divides all the faces of a mesh in 3 faces.

Parameters

mesh:Mesh — The mesh holding the faces to split in 3 At this time of dev, triFaces method will abort if a subgeometry reaches max buffer limit of 65k