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
|
matrix
|
Inertia matrix to use for transformation |
required |
rotation
|
matrix
|
Rotation matrix to apply to the inertia matrix |
required |
Returns:
Type | Description |
---|---|
matrix
|
Transformed inertia matrix |
Source code in onshape_robotics_toolkit\mesh.py
57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
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
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
transform_vectors(vectors, rotation, translation)
¶
Apply a transformation matrix to a set of vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vectors
|
ndarray
|
Array of vectors to use for transformation |
required |
rotation
|
ndarray
|
Rotation matrix to apply to the vectors |
required |
translation
|
ndarray
|
Translation matrix to apply to the vectors |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Array of transformed vectors |
Source code in onshape_robotics_toolkit\mesh.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|