Functions for dealing with meshes.
NOTE 1: most functions only handle collapsed editable mesh models. Make sure that's what you're passing into them.
NOTE 2: most functions that alter mesh topology (face/vertex count or order) below are NOT SAFE to use with meshes using mapping channels higher than 1.
Delete any isolated verts in the mesh.
OK.
%<obj>
Detaches faces in the "faces" bitarray, returns new object.
Note: Both the detached object and original object will have left over, isolated verts after this operation. It's a good idea to run CleanIsoVerts on both objects afterwards.
A new object containing the detached faces.
<%obj>
<bitArray>
Takes each element in an object and detaches it.
Note: this function can take a non-trivial amount of time.
An array of newly created objects.
<obj>
Gets an array of all the polygons in a mesh. Note: This is VERY SLOW, and requires avg_dlx.dlx.
An array of bitarrays. Each bitarray describes which faces make up a single polygon. ie:
polyArray = getAllPolygons $
will select the first polygon of the currently selected mesh.
$.selectedFaces = polyArray[1]
<obj>
Works exactly like "GetAllPolygons
", only it posts a progress bar while processing.
An array of bitarrays. Each bitarray describes which faces make up a single polygon. ie:
polyArray = getAllPolygonsProgress $
will select the first polygon of the currently selected mesh.
$.selectedFaces = polyArray[1]
<obj>
Gets an array of all the elements in a mesh.
Returns an array of bitarrays. Each bitarray describes which faces make up a single element.
<obj>
<vertFaceCache>
getVertFaceCache
" on the passed object.
Gets the closest vertex on a mesh to a specified point.
The index of the closest vertex on the mesh or undefined on failure.
<meshObj>
<pnt>
[vertMask:undefined]
Returns the indexes (and distances) to verts on a mesh from a specified point.
Use GetClosestVert()
if you only need the one closest vertex, as it's faster.
Returns array, where:
<returnArray[1]>
returnArray[1][1]
is the closest vertex, and returnArray[1][returnArray[1].count]
is the farthest.
<returnArray[2]>
returnArray[2][n]
corresponds to the distance from vertex returnArray[1][n]
.
<meshObj>
<pnt>
[vertMask:undefined]
Gets faces based on normal orientation towards a vector.
A bitarray describing which faces point towards the given vector.
<obj>
<vec>
<angleThreshold>
vec
before it is ignored.
Get all the faces that are connected to a single face.
Returns a bitarray describing which faces are connected to the specified face.
<obj>
<faceIdx>
<vertFaceCache>
getVertFaceCache
" on the passed object.
Returns a cache to use with certain mesh functions. This needs to be rebuilt each time mesh topology changes, but it can take a fair amount of time to calculate, so avoid calling this unnecessarily.
Return an array of arrays (one for each vertex). Each array holds all the face indicies that the corresponding vertex references.
<obj>
Checks that object is a collapsed editable mesh.
True if mesh is a collapsed editable mesh, otherwise false.
<obj>