slice along polyline

(Marios Karaoulis) #1

I am new to paraview and trying to figure things out.
A have a VTK file that represents volumentirc data. I want to slice the volume, alony y-axis, given some points (xyz) that are on z=0 plane.

I loaded a txt file and convert it to TabletoPoints. Now on the surface of this volume, I can see the points.
I am not sure how to proceed from this point. I tried to convert the points to polyline, but don’t know how.
Then on the volume data, I clicked on the option slizeAlongPolyline, but paraview crashes without any message.

What can I do?

(Kenneth Moreland) #2

The only way I know of to create a poly line from the collection of points that you get from Table To Points is to use the Programmable Filter. If you add the Programmable Filter to your points and use the following script, that should connect the points together in a polyline.

output.Points = inputs[0].Points
numPoints = len(output.Points)

pointIds = vtk.vtkIdList()
for i in range(numPoints):
    pointIds.SetId(i, i)

output.Allocate(1, 1)
output.InsertNextCell(vtk.VTK_POLY_LINE, pointIds)

Now you can create the Slice Along PolyLine filter. Set the Dataset input to your volume and the Poly Line input to the previously created output from the Programmable Filter.

(Marios Karaoulis) #3

Great. That worked perfectly!!!