Create a list of triangle elements from a points list and an element list

Hi all, I have a MSH file which looks like the one below (I cut the number of nodes and elements short for readability).

How can I import these triangular elements into grasshopper?

MESH dimension 3 ElemType Triangle Nnode 3
Coordinates
1 -17.635664 134.698010 0.025751
2 -12.680912 134.711894 0.043898
3 -7.681358 134.632521 0.055979
4 -2.655868 134.558046 0.069528
5 2.383539 134.593594 0.087442
6 7.425387 134.603822 0.083278
7 12.335474 134.596297 0.078165
8 17.383368 134.593959 0.072286
9 -17.648710 129.675088 0.054638
...
end Coordinates
Elements
1 2 1 9
2 9 10 2
3 11 3 2
4 2 10 11
5 4 3 11
...
end Elements

So far, I basically got this far. The top list contains the coordinates of each point, the bottom list describes per element which 3 points to use to create the triangle

I just can’t figure out how to now use the bottom list to connect the coordinates in the top list with each other:

I think this should work, but because no file was posted I couldn’t test it :upside_down_face:

posting_a_file_helps_everyone.gh (14.8 KB)

1 Like

Hi Inno, thanks for your help!

Your solution wasn’t perfect but definitely helped me in the right direction. :smiley:

I unfortunately can’t upload a .msh file to the forum.’

Quick question: How do you show the function names above each block? And the note above the spacebar panel?

GrasshopperFile.gh (15.7 KB)

by using this plugin: Sunglasses | Food4Rhino

right click on a group area (the purple area, not components) and the very first line of the menu that pops up is an empty textbox where you can input the group name

1 Like