Clip/Slice with a surface
It is currently not possible to clip/slice with a vtkPolyData surface dataset in ParaView.
It is possible to do it with a Python Programmable Filter, but this kind of script writing or out of reach for most users.
Here is a Programmable Filter script that do a clip with a surface (pv 5.10). Do not forget to set output type to vtkUnstructuredGrid
before the first apply.
import paraview.modules.vtkPVVTKExtensionsFiltersGeneral as ext
inpMain = self.GetInputDataObject( 0, 0 )
inp = self.GetInputDataObject( 0, 1 )
out = self.GetOutput()
clipper = ext.vtkPVMetaClipDataSet()
clipper.SetInputDataObject(inpMain)
clipper.SetInsideOut(True)
function = vtk.vtkImplicitPolyDataDistance()
function.SetInput(inp)
clipper.SetDataSetClipFunction(function)
clipper.Update()
outData = clipper.GetOutputDataObject(0)
out.DeepCopy(outData)
Here is a Programmable Filter script that do a slice with a surface (pv 5.10). Do not forget to set output type to vtkPolyData
before the first apply.
import paraview.modules.vtkPVVTKExtensionsFiltersGeneral as ext
inpMain = self.GetInputDataObject( 0, 0 )
inp = self.GetInputDataObject( 0, 1 )
out = self.GetOutput()
slicer = ext.vtkPVMetaSliceDataSet()
slicer.SetInputDataObject(inpMain)
function = vtk.vtkImplicitPolyDataDistance()
function.SetInput(inp)
slicer.SetDataSetCutFunction(function)
slicer.Update()
outData = slicer.GetOutputDataObject(0)
out.DeepCopy(outData)
Implementing something similar in C++ shouldn't be too hard.