0

In computer graphics, it's common to use *.node and *.ele files to store tetrahedral mesh, where the former one stores 3D coordinates (x,y,z) of all the vertices and the latter one stores the indices of every tetrahedron, such as

#<tetrahedron index> <vertex 1> <vertex 2> <vertex 3> <vertex 4> <attribute>
          1             1          2           3          4          1
         ...           ...        ...         ...        ...        ...

which means a tetrahedron with index 1 consists of vertices with indices 1, 2, 3, 4 and has attribute 1.

However, it is difficult to visualize such kinds of files. So are there any libraries which can convert such kinds of *.node and *.ele files into *.obj or *.ply files for visualization in MeshLab?

Many thanks!

C. Wang
  • 2,516
  • 5
  • 29
  • 46

1 Answers1

0

Use TetGen: tetgen -r my_node_file -O. This should output a my_node_file.off file with a format similar to PLY or OBJ files (the file can either be patched in a text editor to PLY or MeshLab can do the conversion). However I believe this works only with TetGen version <= 1.4 (in 1.5, the -O option has a different meaning).

That being said, it should also be trivial to write a custom parser that will generate a PLY or OBJ file (and you gain the flexibility of filtering by attributes or do some other processing on the faces of the tetrahedral mesh).

user3146587
  • 4,250
  • 1
  • 16
  • 25
  • Thank you for your answer. Yet I am still a little confused about how to use the command. There are 2 files: `*.node` and `*.ele`, how can they be included in this command? – C. Wang Jan 23 '14 at 05:41
  • You either give the fullname of your `.node` file and the program will figure out what the corresponding `.ele` file is. Or you simply give the name of your `.node` / `.ele` files without the extension. – user3146587 Jan 25 '14 at 12:12