Mesh

class cee.usg.Mesh()

A mesh defines the surface elements and nodes for a Part in a Geometry.

A mesh is defined by a node array with x,y,z values and the element nodes describing the index of the nodes in each element. The number of nodes per element is defined by either a singleElementType for meshes where all the elements have the same number of nodes or by an array (elementTypeArr) with one item per element describing the number of nodes in that element.

Mesh is an immutable class, so if you need to change something you will have to construct a new mesh.

Constructors

Accessors

  • elementCount

  • elementNodeIndexArray

  • elementTypeArray

  • nodeArray

  • nodeCount

  • singleElementType

Methods


Constructors

Mesh.constructor(nodeArr, singleElementType, elementNodeIndexArr[, optionalData])
Arguments:
  • nodeArr (ArrayLike) – None

  • singleElementType (number) – None

  • elementNodeIndexArr (ArrayLike) – None

  • optionalData (OptionalMeshData) – optional None

Create a mesh.

For mesh with only one element type (all elements have the same number of element nodes) use the singleElementType version. This is more compact for storage.

The nodeArr is an array of all the nodes in the mesh as an array with [x0, y0, z0, x1, y1, z1, …].

If you have a varying number of element nodes in your elements, specify that with an array (elementTypeArr) with one item per element specifying the number of nodes for that element.

Return type:

Mesh

Mesh.constructor(nodeArr, elementTypeArr, elementNodeIndexArr[, optionalData])
Arguments:
  • nodeArr (ArrayLike) – None

  • elementTypeArr (ArrayLike) – None

  • elementNodeIndexArr (ArrayLike) – None

  • optionalData (OptionalMeshData) – optional None

Return type:

Mesh

Accessors

cee.usg.elementCount()

The number of elements in the mesh.

Return type:

number

cee.usg.elementNodeIndexArray()

Returns an array containing the node indices for each element node in the mesh.

Return type:

ArrayLike <number>

cee.usg.elementTypeArray()

If not single element type, this array contains the number of elements for all elements in the mesh

Return type:

ArrayLike <number>

cee.usg.nodeArray()

A readonly array containing the nodes of the mesh

Return type:

ArrayLike <number>

cee.usg.nodeCount()

The number of nodes in the mesh.

Return type:

number

cee.usg.singleElementType()

Returns the number of nodes in each element if all elements in the mesh have the same number of nodes

Returns 0 if there are multiple element types.

Return type:

number

Methods

getBoundingBox

Mesh.getBoundingBox()

Returns the BoundingBox of the mesh.

Return type:

BoundingBox