In the image I try to explain better. The cylinder is passing through the cube and I want to know witch is the surface percentage that is touching the cube (red surface 60%) and witch is not (40%).
In the image I try to explain better. The cylinder is passing through the cube and I want to know witch is the surface percentage that is touching the cube (red surface 60%) and witch is not (40%).
The only method I know of currently is to use the collision detection filter. It takes two vtkPolyData objects and the output is the number of contacts. It cannot tell you surface area of the contact, but can also give you the list of points that are colliding. An example of usage can be found here:
Please be mindful that in Slicer, MRML nodes may be under transforms, and those need to be applied using vtkTransformPolyDataFilter so that the vtkPolyData objects (used both in model nodes and segmentation nodes’ closed surface representation) are in the right coordinate system (as shown in Slicer). The example I linked to above also contains this step.
Also please note that the integration of this class into VTK is in progress, if you don’t want to use SlicerRT, see this MR: https://gitlab.kitware.com/vtk/vtk/merge_requests/4527
Until then, you’ll need to use SlicerRT’s own class.