Mesh
This module contains functions for transforming meshes and inertia matrices.
transform_inertia_matrix(inertia_matrix, rotation)
¶
Transform an inertia matrix
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inertia_matrix
|
NDArray[floating]
|
Inertia matrix to use for transformation |
required |
rotation
|
NDArray[floating]
|
Rotation matrix to apply to the inertia matrix |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Transformed inertia matrix |
Source code in onshape_robotics_toolkit\mesh.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
transform_mesh(mesh, transform)
¶
Apply a transformation matrix to an STL mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh
|
Mesh
|
STL mesh to use for transformation |
required |
transform
|
ndarray
|
Transformation matrix to apply to the mesh |
required |
Returns:
| Type | Description |
|---|---|
Mesh
|
Transformed STL mesh |
Examples:
>>> mesh = Mesh.from_file("mesh.stl")
>>> transform = np.eye(4)
>>> transform_mesh(mesh, transform)
Source code in onshape_robotics_toolkit\mesh.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
transform_vectors(vectors, rotation, translation)
¶
Apply a transformation matrix to a set of vectors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vectors
|
NDArray[floating]
|
Array of vectors to use for transformation |
required |
rotation
|
NDArray[floating]
|
Rotation matrix to apply to the vectors |
required |
translation
|
NDArray[floating]
|
Translation matrix to apply to the vectors |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Array of transformed vectors |
Source code in onshape_robotics_toolkit\mesh.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |