Sunday, 7 October 2018

Creating TINs in ArcGIS from triangular elements?


I am working with Finite Element Method (FEM) models with triangular elements, and I'd like to view the results as TIN surfaces in ArcGIS (and in ArcScene). In my external source, I have nodes (with X,Y,Z coords) and elements (forming a triangle from three nodes), which are the fundamentals of a TIN. How can I bring these together in ArcGIS to convert my triangular elements into a new TIN surface? This should ideally be a 1:1 conversion, but the documentation isn't helping me.


Here is an illustrated example of the data I have:


Simple TIN


Nodes: n, X, Y, Z
1, 51.06, 84.98, -7.46
2, 30.45, 80.67, -7.47
3, 44.83, 72.70, 19.46
4, 64.99, 69.91, 61.48
5, 30.33, 63.40, 71.31

6, 46.95, 61.96, 48.44
7, 62.04, 51.97, 82.51
Elements: n1, n2, n3
6, 7, 4
4, 3, 6
3, 5, 6
5, 3, 2
1, 3, 4
2, 3, 1


I'm currently using ArcGIS 9.3 with the 3D Analyst Extension (among others), and would like some hints for a solution targeted for either Python or VBA.




Alternative approach: The raw data -> Esri TIN conversion doesn't look very easy, and I can't make heads or tails of the API for 3D Analyst, so I'll hold the Python/VBA solution off.


I have the same data represented in a Shapefile where all features are triangular PolygonZM shapes and the vertices have the height-field. (If you ask, this Shapefile was made using OGR via Python from the original dataset structured similarly as above). Viewing this file in ArcScene is really really slow, as I have ~100k triangular polygons in the Shapefile. This PolygonZM Shapefile should ideally convert triangle-by-triangle to a TIN dataset. I have the data, so interpretation or interpolation is not wanted!


So, how can I convert this PolygonZM Shapefile (pictured below) into a TIN? In ArcScene, in the "3D Analyst" menu, there is a "Create TIN From Features" tool, but I don't understand the language "soft clip" etc. The dialog provides no help.


ArcScene: Create TIN From Features





It turns out the best format is LandXML, thanks to the related answers below. For the example above, the file looks like this (note: the coordinate order is Y X Z):









84.98 51.06 -7.46


80.67 30.45 -7.47


72.70 44.83 19.46


69.91 64.99 61.48


63.40 30.33 71.31



61.96 46.95 48.44


51.97 62.04 82.51




6 7 4
4 3 6
3 5 6
5 3 2
1 3 4
2 3 1







Then use the LandXMLToTin_3d tool to process the result to an Esri TIN file:


Resulting TIN



Answer



The only way we found to get a triangular mesh with existing topology into ArcGIS was to use the arcpy.LandXMLToTin_3d function. It's a bit crazy to have to write out a LandXML file just to get your TIN into Arc, but it works. Here is a Python Toolbox for ArcGIS10.1 that accesses data on a triangular mesh from an ocean model, and brings it into ArcGIS as a TIN. https://github.com/rsignell-usgs/dap2arc/blob/master/dap2tin.pyt We've let ESRI know that a great enhancement would be to be able to instantiate a TIN directly using arcpy.



No comments:

Post a Comment