vtkCutter cutting disconnected cells

I have an FEA mesh of 3d cells, with results that are discontinuous between cells. I model this by splitting the points such that each cell has its own points.

I want to cut through those cells, yielding a single polygon per cell.

Initially I just used a vtkCutter and set GenerateTrianglesOff to produce polygons. This works somewhat but it merges back the points that were split, causing unexpected irregularity in the bands that are generated by the banded contour filter.

To address this I used a vtkNonMergingPointLocator for the vtkCutter, but now I end up with triangles even though I said that I don’t want triangles…

An image of the cut surface before the contouring shows clearly that triangles are generated…

I realize that what I’m asking is somewhat of a blend between non-merging and merging point-locator behaviors: merging while dealing with a single input cell but non-merging across input cells. Is there a way to achieve this with the current locators and cutter or do I have to roll my own, or should this be considered a bug of vtkCutter?

Here’s the complete script cutting-plane.py (2.8 KB)

Hi Andreas,

I’m not sure if this will help, but I ran into a similar problem (I use “similar” very loosely here) when writing the vtkClipClosedSurface filter. My solution was to create a locator based on edges rather than points, e.g. new points that are generated by cutting different edges will never be merged. Unfortunately this locator isn’t implemented as its own class, so it cannot be used with vtkCutter.

However, I vaguely remember seeing a similar solution in one of the other VTK classes (might have been vtkFlyingEdges).

Edit: after a quick search I found vtkStaticEdgeLocatorTemplate, which might be related (I say might because it’s a class that I’ve never actually seen before, so I’m just making a guess).

Just a follow-up, vtkPlaneCutter or vtkFlyingEdgesPlaneCutter might be closer to what you need.

Thanks for the replies, that’s a lot of new leads that I can explore. I’m not sure how the edge-locator would come into play: the vtkCutter uses the vtkCell::Contour methods which require a vtkIncrementalPointLocator. One way I imagined should work is to reset the locator for each cell and append the points and point-data of each individual cell. Not really an efficient way I think.

The vtkFlyingEdgesPlaneCutter is only for image data apparently, but vtkPlaneCutter is promising. Its output is a composite data structure with a block for each thread’s result. My input is a vtkMultiBlockDataSet with a block for each part in the mesh. Would it be possible to reconstruct this structure from the output of the vtkPlaneCutter?

Unfortunately vtkPlaneCutter also ends up returning triangles instead of polygons as the documentation suggests. I should be able to stitch them back together if I know which triangles belong together.

The edge locator doesn’t come into play with vtkCutter/vtkPointLocator since, as far as I understand, the API of vtkPointLocator doesn’t allow for “merging while dealing with a single input cell but non-merging across input cells”. In other words, I think you’ll have to abandon vtkCutter in order to find a solution.

Unfortunately my experience with vtkPlaneCutter is nil, so hopefully someone else will step in to the conversation…