You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a large mesh object with a few milion triangles. I use trimesh.slice_plane with a box bound and get a nice looking result.
To speed this up (when slicing a small area from the large mesh) I wonder if there is a function to get all the faces/vertices of the mesh that is within or on the border of my slicing-bound? I'm thinking it would be quicker to first get all the triangles that can possibly be sliced before doing the actual slicing. Not sure if it would be quicker or not.
Similar to how the spat command in og2ogr works:.
-spat 182100 6731100 182200 6731200 -clipsrc 182100 6731100 182200 6731200
Spat defines the region of of the mesh that is of interest for the clipping, while clipscr is doing the actual slicing/clipping. Using just the clipsrc is alot slower using gdal.
The text was updated successfully, but these errors were encountered:
Yeah it's true the slice function could check mesh.triangles_tree against the AABB of the slice plane inside the AABB of the mesh. Given the speed of dot products, this may be slower below some threshold of triangles but yeah for big meshes seems like it would definitely be faster.
Constructing the triangles_tree is pretty expensive so we probably wouldn't want to do it for every plane normal, but you could imagine constructing a few trees along 2-3 different vectors and having this be pretty snappy on giant meshes. Cool idea and totally open to PR's!
I'll add it to the enhancements list and close this issue, thanks for the report!
I have a large mesh object with a few milion triangles. I use
trimesh.slice_plane
with a box bound and get a nice looking result.To speed this up (when slicing a small area from the large mesh) I wonder if there is a function to get all the faces/vertices of the mesh that is within or on the border of my slicing-bound? I'm thinking it would be quicker to first get all the triangles that can possibly be sliced before doing the actual slicing. Not sure if it would be quicker or not.
Similar to how the spat command in og2ogr works:.
-spat 182100 6731100 182200 6731200 -clipsrc 182100 6731100 182200 6731200
Spat defines the region of of the mesh that is of interest for the clipping, while clipscr is doing the actual slicing/clipping. Using just the clipsrc is alot slower using gdal.
The text was updated successfully, but these errors were encountered: