# MeshQuery

class `cee.usg.``MeshQuery`()

  Class for querying the FEA mesh in an UnstructGridModel.

  You can use this class to both interrogate a mesh in its local coordinates and to query a state in the model. If a state is specified the returned data will be in global coordinates, taking any displacement and transformation result into account.

Constructors

- `constructor`

Methods

- `getElementCentroid`
- `getElementNodeIndices`
- `getElementSurfaceNormal`
- `getNodePosition`

## Constructors

`MeshQuery.``constructor`(mesh)

  Arguments: | mesh (`Mesh`) – None

  Create the query object.

  If a mesh is specified, the query will be based on the mesh elements and nodes. The coordinate system of the returned data will be in mesh local coordinates.

  If a state and part index is specified, the results (displacement and transformations) will be applied if in use. So, in this case the coordinate system of the returned data will be in global coordinates.

  Return type: | MeshQuery

`MeshQuery.``constructor`(state, partIndex)

  Arguments: | state (`State`) – None partIndex (`number`) – None
  Return type: | MeshQuery

## Methods

### getElementCentroid

`MeshQuery.``getElementCentroid`(elementIndex)

  Arguments: | elementIndex (`number`) – None

  Returns the centroid of the given element

  If a mesh is specified in the constructor, the coordinate system of the returned data will be in mesh local coordinates. If a state and part index is specified in the constructor, the coordinate system of the returned data will be in global coordinates.

  Return type: | Vec3

### getElementNodeIndices

`MeshQuery.``getElementNodeIndices`(elementIndex)

  Arguments: | elementIndex (`number`) – None

  Returns an array containing the node indices for each element node in the given element

  Return type: | ArrayLike <number>

### getElementSurfaceNormal

`MeshQuery.``getElementSurfaceNormal`(elementIndex)

  Arguments: | elementIndex (`number`) – None

  Returns the surface normal of the given element

  If a mesh is specified in the constructor, the coordinate system of the returned data will be in mesh local coordinates. If a state and part index is specified in the constructor, the coordinate system of the returned data will be in global coordinates.

  Return type: | Vec3

### getNodePosition

`MeshQuery.``getNodePosition`(nodeIndex)

  Arguments: | nodeIndex (`number`) – None

  Returns the position of the given node in the given part in this state.

  If a mesh is specified in the constructor, the coordinate system of the returned data will be in mesh local coordinates. If a state and part index is specified in the constructor, the coordinate system of the returned data will be in global coordinates.

  Return type: | Vec3

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Web in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...