Skip to content

Instantly share code, notes, and snippets.

@jschoormans
Last active February 17, 2023 10:33
Show Gist options
  • Save jschoormans/3a5013ebd358d9563a41eadfbe9dac2c to your computer and use it in GitHub Desktop.
Save jschoormans/3a5013ebd358d9563a41eadfbe9dac2c to your computer and use it in GitHub Desktop.
Convert pyvista to trimesh mesh (python libraries)
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