Note
Go to the end to download the full example code.
Transformation of mesh example in slam¶
# Authors:
# Guillaume Auzias <guillaume.auzias@univ-amu.fr>
# Maxime Van Der Valk <maxime.vandervalk@univ-amu.fr>
# License: MIT
# sphinx_gallery_thumbnail_number = 2
importation of slam modules
import slam.io as sio
import numpy as np
import trimesh.transformations as ttrans
Load a mesh
Apply a random transformation to the mesh
mesh.apply_transform(ttrans.random_rotation_matrix())
<trimesh.Trimesh(vertices.shape=(2328, 3), faces.shape=(4652, 3))>
reortient the mesh according to its principal inertia axes
mesh.apply_transform(mesh.principal_inertia_transform)
<trimesh.Trimesh(vertices.shape=(2328, 3), faces.shape=(4652, 3))>
Define and apply a rotation around the x axis
<trimesh.Trimesh(vertices.shape=(2328, 3), faces.shape=(4652, 3))>
VISUALIZATION USING INTERNAL TOOLS¶
Total running time of the script: (0 minutes 2.505 seconds)