simulate icon indicating copy to clipboard operation
simulate copied to clipboard

Meshes for non-convex polygons

Open natolambert opened this issue 3 years ago • 0 comments

Collider-meshes for non-convex polygons currently require re-building a polygon out of invisible components or an advanced integration of a V-HACD algorithm for re-constructing a non-convex mesh as a convex set of meshes.

Some resources for solving this:

Code snippet that would work if trimesh has an installed v-hacd binary:

extract_mesh = land.mesh.extract_surface().triangulate()
faces_as_array = extract_mesh.faces.reshape((extract_mesh.n_faces, 4))[:, 1:]
tmesh = trimesh.Trimesh(land.mesh.points, faces_as_array)

meshes = trimesh.interfaces.vhacd.convex_decomposition(tmesh)

(reliant on converting meshes from pyvista)

Other:

natolambert avatar Sep 14 '22 15:09 natolambert