Access Array of Points Coordinates Data

Hello everyone,

I would like to access the data point array coming from a clip of a 3D Geometry.

I have the below python code:

mesh = STLReader(FileNames=["D:/STL/Part.stl"])
clip1 = Clip(Input=mesh, ClipType = 'Plane')
clip1.ClipType.Origin = [0, 0.0, 0.0]
angleRad = math.radians(0)
 clip1.ClipType.Normal = [0.0, -math.cos(angleRad), math.sin(angleRad)]
a = PlotOnIntersectionCurves(Input = clip1, SliceType = 'Plane') 
SaveData('test.csv',proxy=a)

Today I use SaveData to save the data points to external file but I would like to get the points data and treat them before writing them to external file.

I have tried a lot of different things but could not find a way to access the points coordinates before writing them to an external file.

Thanks in advance for any support.

Regards,
Marc.

You need to use servermanager.fetch for that.

It can be costly if your data is big and if you are working remotelly.

I tried this but maybe not in the good way :frowning:

a = PlotOnIntersectionCurves(Input = clip1, SliceType = ‘Plane’)
b=paraview.servermanager.Fetch(a)
c=b.GetPointData()

But do not know what to do next with c ? I would like to have an array of points coordinates.

Thanks again.

a = PlotOnIntersectionCurves(Input = clip1, SliceType = ‘Plane’)
b=paraview.servermanager.Fetch(a)
c=b.GetPoint(0)
1 Like

I receive such error when I tried b.GetPoint(0)

Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘vtkCommonDataModelPython.vtkMultiBlockDataSet’ object has no attribute ‘GetPoint’

a=PlotOnIntersectionCurves(Input = clip1, SliceType = ‘Plane’)
b=paraview.servermanager.Fetch(a)
c=b.GetBlock(0)
d=c.GetPoint(0)

Still not able to get it to work:

c=b.GetBlock(0)
d=c.GetPoint(0)
Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘NoneType’ object has no attribute ‘GetPoint’

Honestly I am surprised how difficult this can be for such simple task right?

In order to inspect your data, you first have to understand how it is formatted.

Looks like you have a multiblock dataset output. If you do not care about it, you could just use a MergeBlock filters before using my first script.

I started it from scratch and it seems now ok to use your last solution.
Many thanks for all the support. I found it pretty difficult honestly for beginner. Did not find any tutorial on that, specially the MergeBlock part.

Thanks again.

MergeBlocks filter :
https://kitware.github.io/paraview-docs/latest/python/paraview.simple.MergeBlocks.html

ParaView Tutorial and Guide :
https://www.paraview.org/download/ (documentation)

TBH fetch is quite an advanced feature. If you are looking to just see the values of the points, you should use the Spreadsheet view.