Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Implementation of o3d.t.geometry.TriangleMesh.clip_plane

Open 1ckendall opened this issue 1 year ago • 1 comments

Checklist

My Question

In my code I am sequentially clipping a mesh by a large number of planes, but this operation is very slow relative to the rest of my code and as far as I can tell from checking my performance manager (Windows 11 and Ubuntu, both on CPU), single-threaded. I've looked through the repo and it seems that the clip_plane operation is currently implemented with the vtkClipPolyData class, which appears to be single-threaded. Is there an obvious way to parallelise this operation?

VTK also has a vtkPolyDataPlaneClipper class, which is multithreaded but seems to be implemented on a slightly different set of inputs (apologies for the vagueness -- I am not familiar with C++). Would this be a possible future option for faster plane clipping?

1ckendall avatar Jul 04 '24 17:07 1ckendall

Hi @1ckendall, thanks for checking out ways to improve the performance. My understanding of vtkPolyDataPlaneClipper is that it does not actually clip triangles but either keeps or discards the whole triangle. However, the current clip algorithm vtkClipPolyData seems to support multiple planes, which could make clipping more efficient. Would you be willing to work on exposing this functionality?

benjaminum avatar Jul 10 '24 17:07 benjaminum