[vtkusers] vtkClipPolyData

mariagrazia.madaschi at libero.it mariagrazia.madaschi at libero.it
Tue Feb 8 05:35:55 EST 2011


Hello, 

I have a 3D portion of kidney: a membrane and cells on its surface.
What I have to do is to determine the area of competence of each cells, that 
is to calculate the points of the surface nearer to each cells and then 
determine the value of the area formed of these points.
Cells, obviously, are a group of points.
I have calculated the barycentre of each cells and I have calculated the 
distance between barycentres and points of surface.
I have created a list called 'ids' with an id for each points of surface; the 
id refers to the barycentre nearer to the point.
Example: ids = [ 0, 0, 0, 1, 1, 0, 1, 0, 0, 2, 1, 1, ....]  length(ids)=number 
of points of surface
Then I have created an array that permits to associate a different color to 
each id. In paraview I can visualize the surface with the areas of competence 
of each cells with differents color.

I have done a test with one barycentre.
I have create a new list called 'ids_new' and I have associated to the points 
nearer to the barycentre 0 id 0 and to the other points id 1.
In Paraview I have apllied the Clip filter with a scalar between 0 and 1, 
which gives only the points with id 0 and with the filter integrateVariables I 
have found the value of the area.

Now, I need to do this thing many time because I have 4 surfaces and about 200 
cells for each surface.
So I think the best way is to do that by python code.
 
I'm not so practice of python and vtk so I ask you an help.
How can I insert in my code the part of vtkClipPolyData? I have some errors. I 
can't find the way to say to the code to use a scalar instead of a function.

And then, is there any way to calculate the area from the code?
Better, is there any way to do what Paraview does with the IntegrateVariables 
in python code?


Thank's



More information about the vtkusers mailing list