how can I output the coordinates of the faces of a wireframe?

python
(Fabio) #1

Hi,

I can’t seem to find a way to print the coordinates of each face forming the mesh (wireframe) on my polygon. Is there an easy script to write a text file (or even output on the screen) that does that?
Thanks

Fabio

(Mathieu Westphal (Kitware)) #2

How do you define the coordinate of a face ?

(Fabio) #3

Hi Mathieu,

The input data is an unstructured grid. I apologize for the little knowledge I have of vtk.

If I visualize the file and use the wireframe view I can see that the mesh is just rectangles of different dimensions (and few triangles that define 45 deg edges of the meshed polygon).

What I need is a way to export the coordinates of all the 4 vertices of all those rectangles in a file (each line represents the 4 coordinates)

Fabio

(Mathieu Westphal (Kitware)) #4

No direct way to do that, but you can do the following :

  • Open ParaView
  • Open your file, Apply
  • Filters -> Extract Surface -> Apply
  • Create a new view, click on “Spreadsheet View”
  • Change Point Data to Cell Data
  • Click on “Show cells connectivity”, the id of the points appears
  • Click on export spreadsheet, save that as pointIds.csv
  • Change Cell Data to Point Data
  • Click on export spreadsheet, save that a pointCoord.csv

Now you only need to parse both csv file in order to reconstruct (and duplicate) the vertices coords.

(Fabio) #5

Awesome! Let me give it a try!

Thanks!