How to load mesh file having special format?

I am trying to use three.js to visualize a mesh file. The file includes two parts: node coordinate definition and panel (face) definition, as shown in the following. I am new to three.js. Please help me.
I can read the coordinates and the panels, and assign to Javascript’s variables (array type). But I don’t how to assign them to the geometry object.

--------------Hull Mesh File---------------

#Number of Panels, Nodes, X-Symmetry and Y-Symmetry
5370 5458 0 0

#Start Definition of Node Coordinates ! node_number x y z
1 17.320508 0.000000 -15.000000
2 17.420508 0.000000 -15.000000
3 17.415614 0.030902 -15.000000
4 17.401410 0.058779 -15.000000
5 17.379287 0.080902 -15.000000
6 17.351410 0.095106 -15.000000
7 17.320508 0.100000 -15.000000
8 17.289606 0.095106 -15.000000
9 17.261730 0.080902 -15.000000
.
.
.
5458 -7.680016 -14.802178 -15.000000
#End Definition of Node Coordinates

#Start Definition of Node Relations ! panel_number number_of_vertices [Vertex1_ID Vertex2_ID Vertex3_ID (Vertex4_ID)]
1 3 3 2 1
2 3 4 3 1
3 3 5 4 1
4 3 6 5 1
5 3 7 6 1
.
.
.
.
5370 4 5447 5448 5458 5457
#End Definition of Node Relations

--------------End Hull Mesh File---------------

might help Three.js Custom BufferGeometry

Thank you, Orion_prime. This is exact something I am searching for.

1 Like