Export vertices and indices for faces

Hi there,

what would be a good way to export vertices and indices of a mesh surface? i need to have these two arrays somehow compatible to this: Create Custom Meshes From Scratch | Babylon.js Documentation
like so:

var positions = [-5, 2, -3, -7, -2, -3, -3, -2, -3, 5, 2, 3, 7, -2, 3, 3, -2, 3];var indices = [0, 1, 2, 3, 4, 5];

i quickly slammed this gh definition together, but have the issue that the indices do not represent the indices but rather just an array with a series of numbers. How would i get the triangulated indices here?

Any idea would be awesome! Thanks a lot!!
verticesIndices.gh (8.1 KB)

Any Mesh is a mini DataBase that correlates Vertices (and/or Topology Vertices), Topology Edges and Faces. Info for these is sampled in DataTrees (of type int) called Connectivity Trees - at least having the GH way in mind. Since we have 3 classes of objects (V, E, F) we can have up to 9 Conn Trees (but some are rarely used in real-life).

That said the Vertices (i.e. points on a per MeshFace basis) indexing is NOT the same as the TopologyVertices (i.e. points on a per Mesh basis) indexing (but there’s handy RC Methods from-to).

Assuming that you can handle DataTrees … if you want a C# that sheds light on basic Connectivity matters … notify.