I’am starting to learn Paraview, and I want to create a lot of spheres from a file (.txt or csv for example) containing positions and radius of the spheres.
I was able to import the file in question, but I don’t know how to do the second step.
Can anyone help me please?
Thank you a lot !
You could begin with ParaviewGuide.pdf like I did.
In my view, creating a lot of spheres requires same amounts of Points in the file, then add certain kind of Filter to convert points to sphere.
Thank you Yoshino for your help,
Yeah, the file contains the positions coordinates of the mass center of spheres, and from it, I want to create the spheres in question.
I will take a look in ParaviewGuide.
@walid, for more specific answers to your questions, it is always helpful to post some example data so that we can see exactly what the issue is and make sure the solution works with your data.
As @Yoshino suggested, learning the interface of ParaView through the ParaView guide and also the tutorial is a good idea. These and other helpful resources are accessible from ParaView’s
Anyway, back to the question at hand. After you load a csv or txt file, you will get a table of data. The steps to what you want are first to convert the table to a 3D representation of points using the
Table to Points filter. Then the easiest way to convert these points to spheres is to use the
Assuming your csv/txt file has at least 4 columns representing the x, y, and z position of each point and the radius of each, the following steps should do what you want.
- Open the csv/txt file.
- Add the
Table To Points filter.
- Set the
Y Column, and
Z Column to the respective columns.
- Close the
SpreadSheetView. (Hit the
X button in the upper right.)
- Add the
Glyph Type to
Scale Array to the name of the column containing the radius.
- Change the
Scale Factor to
2. (The spheres are scaled from a reference with radius 0.5.)
Glyph Mode to
Here are an example csv file and an example ParaView state file that loads this file and uses to create spheres of the specified positions and radii:
example-points.csv (343 Bytes)
spheres-from-position-radius.pvsm (165.4 KB)
Thank you very much Kenneth,
Your assumption was right ! my file contains 3 colums representing x,y and z position, the column 4 is for the radius.
I just tried your method and it worked perfectly ! that’s exactly what I wanted.
Thank you a lot for you help Kenneth