Is there a way to pass a clip area to a feature edges filter


I’m trying to cut a box out of a polygon and pass the clip area to a FeatureEdges filter, but what I’m doing doesn’t seem to work. Is it possible? and if so, how?
Here’s my (not working) code:
from paraview.simple import *
import paraview.vtk as vtk

reference /usr/pack/paraview-3.14.1-gm/./paraview-3.14.1-linux-64bit/lib/paraview-3.14/site-packages/paraview/

Importing the vtk file

reader = OpenDataFile("./tm-mag-xyz_slice.vtk")
SetDisplayProperties(Representation = “Surface”)
SetDisplayProperties(ColorArrayName = “scalars”)
SetDisplayProperties(LookupTable = MakeBlueToRedLT(-100, 1e10))

collecting shape’s bounds

(xmin, xmax, ymin, ymax, zmin, zmax) = reader.GetDataInformation().GetBounds()

selecting points inside the comb

clipArea = Clip(reader)
clipArea.ClipType = ‘Box’
clipArea.ClipType.Bounds = [xmin, xmax, ymin + 160.0, ymax - 160.0, zmin, zmax]

0 to keep inside, 1 to keep outside

clipArea.InsideOut = 0

finding holes inside the polygon

featureEdges = FeatureEdges(clipArea)

selecting only the holes boundaries

featureEdges.BoundaryEdges = 1
featureEdges.FeatureEdges = 0
featureEdges.NonManifoldEdges = 0
connectivityFilter = Connectivity(featureEdges)

adding programmable filter to remove false CD channels

programmableFilter = ProgrammableFilter()
programmableFilter.Input = [reader, connectivityFilter]
progrFilterFile = open("./")
programmableFilter.Script =
w = CreateWriter("./modified_data.vtk")

That should be possible.

One way to gain insight into issues with Python scripting in ParaView is to perform the actions you want in the ParaView GUI and recording a Python trace. Start a trace by selecting the Tools -> Start Trace menu item. This will record your actions in a Python script, letting you see a script that will reproduce the actions you performed in the user interface. When you are done with your actions, select Tools -> Stop Trace. You will get a script that you can edit that should work.