mikedh / trimesh

Python library for loading and using triangular meshes.

Home Page:https://trimesh.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extruded triangulation isn't watertight

suryam080 opened this issue · 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)

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')