Last active
February 17, 2023 10:33
-
-
Save jschoormans/3a5013ebd358d9563a41eadfbe9dac2c to your computer and use it in GitHub Desktop.
Convert pyvista to trimesh mesh (python libraries)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box = pv.Box() | |
box.triangulate() | |
faces = box.faces.reshape((-1,5)) #first dim is nr of points | |
faces = faces[:,1:] | |
t = trimesh.creation.Trimesh(vertices=np.array(box.points), | |
faces = faces, | |
face_normals = t2.face_normals) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment