trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Extruded triangulation isn't watertight

Open suryam080 opened this issue 1 year ago • 1 comments

Hi, Many thanks for this very useful library.

I am loading a simple disk (SVG attached here) as path, triangulating it and extruding this triangulation so that I can compute representative mass_properties as shown below. But contrary to my expectation, the mesh isn't watertight. What am I missing? Also, any mass_properties computed from here could be relied upon or not? Thanks.

import trimesh
path = trimesh.load_path("disk.svg")
[v, f] = path.triangulate()
height = 1.0
mesh = trimesh.creation.extrude_triangulation(v, f, height)
print(mesh.is_watertight)
print(mesh.moment_inertia)
![disk](https://github.com/mikedh/trimesh/assets/161718502/ab46f0df-130a-494c-8312-d4f30a9f4015)

suryam080 avatar Feb 29 '24 12:02 suryam080

Hey, if the triangulation was well constructed it should be watertight, maybe try triangle?

# pip install triangle
# triangle has a non-standard open source license but is free for non-commercial applications
[v, f] = path.triangulate(engine='triangle')

mikedh avatar Feb 29 '24 20:02 mikedh