vtkCutter: How to Separate Groups of Points in Multiple Contour Results in vtk.js

How to get the groups of points out of the vtkCutter when there is more than one contour as the result

For instance in this example, If i manipulate the planes/origin and the result be more than one closed contour, I would like to get the two groups separately. But seems like the cutter.getOutputData().getPoints().getData() returns them all in one array?

You might want to look into vtkPolyDataConnectivityFilter.

Thanks, seems like it is not in vtk.js yet

Well depending on how ambitious you are, you might want to wasm it. And I suspect a tool like trame would work as well, although it’s hard to say without knowing your requirements.

The requirement is to detect and group them into separate arrays in order to render them with SVG polyline connecting points. Thanks I will look into the proposed solutions