ParaView: How to import into ParaView a csv-file exported from ParaView (reverse procedure of "Save Data")

My attempt is to import cylinder geometries for boreholes. Unfortunately, I have not found a guideline how to do this. Therefore, I have created a cylinder within ParaView and exported the cylinder with File > Save Data…. I now have a file with the header line Normals:0, Normals:1, Normals:2, TCoords:0, TCoords:1, Points:0, Points:1, Points:2 and data underneath it. I’m not able to read the data although I have the origin cylinder in ParaView. Is there a guideline which explains this format so I can create own files to import other cylinders which should represent boreholes?

Sounds like boolean operations, see this:

Unfortunately, I can’t figure out what the boolean filter has to do with my problem. The boolean filter sounds more for intersection, union etc. However, I just want to understand how to prepare data, e.g. in a csv-file, to import into ParaView. The example given in my question would be a good start: is there a description which explains the csv-file produced from a cylinder by Export data …?

Not sure what you mean. a .csv is only a table, how can a cylinder be represented by a .csv file ?

Hi Brian,

In case you know boreholes geometry, you can use Sources->Programmable Source to create boreholes according your geometry. Here is a simple example of how to add some polygons to represent a small part of a cylinder (figure attached):

pdo = self.GetPolyDataOutput()

points = vtk.vtkPoints()
points.InsertPoint(0, 0.0,0.0,0.0)
points.InsertPoint(1, 0.0,1.0,0.0)
points.InsertPoint(2, 1.0,1.0,0.0)
points.InsertPoint(3, 1.0,0.0,0.0)
points.InsertPoint(4, 1.5,1.0,0.67)
points.InsertPoint(5, 1.5,0.0,0.67)

quad1 = vtk.vtkQuad()
quad1.GetPointIds().SetId(0,0)
quad1.GetPointIds().SetId(1,1)
quad1.GetPointIds().SetId(2,2)
quad1.GetPointIds().SetId(3,3)

quad2 = vtk.vtkQuad()
quad2.GetPointIds().SetId(0,3)
quad2.GetPointIds().SetId(1,2)
quad2.GetPointIds().SetId(2,4)
quad2.GetPointIds().SetId(3,5)

cells = vtk.vtkCellArray()
cells.InsertNextCell(quad1)
cells.InsertNextCell(quad2)

pdo.SetPoints(points)
pdo.SetPolys(cells)

If you have cylinder geometry somewhere in file, you can write a Python code which will be able to get points and vertices from your file and add them to PV similarly to example above.

If I do not understand you, please clarify what do you have and what do you want to do. Thanks.

Best Regards,
Pavel

@Pavel: That’s a very fine suggestion. I managed to draw boreholes with this technique.

Please have a look at the uploaded image: the csv-file (4) results from File > Save Data … from a cylinder. By this the content of the csv-file actually should represent the cylinder. I thought I could import this csv-file into ParaView to create a cylinder (actually the reverse process of Save Data …). This csv-file could serve as a template how to create a cylinder by importing a csv-file into ParaView. However, I can’t interpret the content and don’t know how to use this csv-file. Is there a guideline how to interpret the content of this csv-file?

Ok, thanks. Please give some time to suggest a solution for your case.