[vtk-developers] vtkCutter modification to use vtkCellLocator

Rostislav Khlebnikov rostislav.khlebnikov at kcl.ac.uk
Sat Aug 9 14:52:44 EDT 2014


Hi guys,

just thought that the VTK developers might be interested in the test I 
made recently.

Bascially what I did is subclass the vtkCellLocator to implement the 
visitor pattern. It allows to filter the octree nodes (e.g. reject the 
octree nodes that are of no interest early) and for leafs, to visit the 
cells of the polydata.
Then, I subclassed the vtkCutter to use this cell locator instead of 
straight iteration over cells. Likely for very complex implicit cutting 
functions this wouldnt be of any benefit. However, for those which can 
test bboxes as being of interest or not, rejecting whole subtrees, such 
as vtkPlane, it is very useful. I tested it on a surface with 500k 
triangles and the cutter performance went from 88ms per cut to 14ms.

The code I made is quite ugly due to limited extensibility of vtkCutter, 
so I had to copy-paste the RequestData method and make my changes 
instead of, say, overriding IterateCells method which would just provide 
the cells to cut through.

But anyway, I was wondering if you guys are intersted in this kind of 
functionality? Would you like me to send you the code?

All best,
    Rostislav.




More information about the vtk-developers mailing list