Mesh

Mesh

Represents a geometry type that is defined by vertices and faces. This is often called a face-vertex mesh.

Constructor

new Mesh()

Extends

Members

hasBrepForm :bool

Inherited From:
Returns true if the Brep.TryConvertBrep function will be successful for this object
Type:
  • bool

hasCachedTextureCoordinates :bool

Will return true if SetCachedTextureCoordinates has been called; otherwise will return false.
Type:
  • bool

hasPrincipalCurvatures :bool

HasPrincipalCurvatures
Type:
  • bool

isClosed :bool

Returns true if every mesh "edge" has two or more faces.
Type:
  • bool

isDeformable :bool

Inherited From:
true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
Type:
  • bool

isValid :bool

Inherited From:
Tests an object to see if it is valid.
Type:
  • bool

objectType :ObjectType

Inherited From:
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
Type:
  • ObjectType

partitionCount :int

Number of partition information chunks stored on this mesh based on the last call to CreatePartitions
Type:
  • int

userStringCount

Inherited From:

Methods

(static) createFromSubDControlNet() → {Mesh}

Create a mesh from a SubD control net
Returns:
mesh representing control net on success, null on failure
Type
Mesh

(static) createFromThreejsJSON()

...

(static) toThreejsJSONMerged()

...

append(other)

Appends a copy of another mesh to this one and updates indices of appended mesh parts.
Parameters:
Name Type Description
other Mesh Mesh to append to this one.

clearSurfaceData()

Removes surface parameters, curvature parameters and surface statistics from the mesh.

clearTextureData()

Removes all texture coordinate information from this mesh.

compact() → {bool}

Removes any unreferenced objects from arrays, re-indexes as needed and shrinks arrays to minimum required size.
Returns:
true on success, false on failure.
Type
bool

createPartitions() → {bool}

In ancient times (or modern smart phone times), some rendering engines were only able to process small batches of triangles and the CreatePartitions() function was provided to partition the mesh into subsets of vertices and faces that those rendering engines could handle.
Returns:
true on success
Type
bool

destroyPartition()

Destroys mesh partition.

destroyTopology()

Removes topology data, forcing all topology information to be recomputed.

destroyTree()

Destroys the mesh vertex access tree.

duplicate() → {GeometryBase}

Inherited From:
Constructs a deep (full) copy of this object.
Returns:
An object of the same type as this, with the same properties and behavior.
Type
GeometryBase

encode()

Inherited From:
...

faces()

...

getBoundingBox(plane) → {Array}

Inherited From:
Aligned Bounding box solver. Gets the plane aligned bounding box.
Parameters:
Name Type Description
plane Plane Orientation plane for BoundingBox.
Returns:
[BoundingBox, Box]
  • (BoundingBox) A BoundingBox in plane coordinates.
  • (Box) Aligned box in World coordinates.
Type
Array

getUserString()

Inherited From:
...

getUserStrings()

Inherited From:
...

isManifold(topologicalTest) → {Array}

Gets a value indicating whether or not the mesh is manifold. A manifold mesh does not have any edge that borders more than two faces.
Parameters:
Name Type Description
topologicalTest bool If true, the query treats coincident vertices as the same.
Returns:
[bool, bool, bool]
  • (bool) true if every mesh "edge" has at most two adjacent faces.
  • (bool) isOriented will be set to true if the mesh is a manifold and adjacent faces have compatible face normals.
  • (bool) hasBoundary will be set to true if the mesh is a manifold and there is at least one "edge" with no more than one adjacent face.
Type
Array

makeDeformable() → {bool}

Inherited From:
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
Returns:
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.
Type
bool

normals()

...

rdkXml()

Inherited From:
...

rotate(angleRadians, rotationAxis, rotationCenter) → {bool}

Inherited From:
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Parameters:
Name Type Description
angleRadians double Angle of rotation in radians.
rotationAxis Array.<x, y, z> Direction of the axis of rotation.
rotationCenter Array.<x, y, z> Point on the axis of rotation.
Returns:
true if geometry successfully rotated.
Type
bool

scale(scaleFactor) → {bool}

Inherited From:
Scales the object by the specified factor. The scale is centered at the origin.
Parameters:
Name Type Description
scaleFactor double The uniform scaling factor.
Returns:
true if geometry successfully scaled.
Type
bool

setTextureCoordinates(tm, xf, lazy)

Set texture coordinates using given mapping and applying given transform. Set lazy to false to generate texture coordinates right away.
Parameters:
Name Type Description
tm TextureMapping Texture mapping
xf Transform Transform to apply to the texture mapping
lazy bool Whether to generate lazily (true) or right away (false)

setUserString()

Inherited From:
...

textureCoordinates()

...

toJSON()

Inherited From:
Create a JSON string representation of this object

topologyEdges()

...

toThreejsJSON()

...

toThreejsJSON()

...

transform(xform) → {bool}

Inherited From:
Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.
Parameters:
Name Type Description
xform Transform Transformation to apply to geometry.
Returns:
true if geometry successfully transformed.
Type
bool

translate(translationVector) → {bool}

Inherited From:
Translates the object along the specified vector.
Parameters:
Name Type Description
translationVector Array.<x, y, z> A moving vector.
Returns:
true if geometry successfully translated.
Type
bool

vertexColors()

...

vertices()

...