Hello,
I want to export one TInSurface to postgis database.
Todo that, i have to split the TinSurface to several polyline3D or Polygon3D geometry? How can i get that ? (i only have TinSurfaceTriangle)
Or maybe if TIN geometry exist for Postgis ?
TinSurface aSurface = (TinSurface)tr.GetObject(surfaceId, OpenMode.ForRead); TinSurfaceTriangleCollection triangleCollection = aSurface.GetTriangles(false); foreach (TinSurfaceTriangle triangle in triangleCollection) { }
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Not sure what postgis requires, but you could get the contours as polylines, or create 3 sided polygons from the Triangle data, or a few other methods exist as well. This is what I do to create Faces for use in machine control:
public static DBObjectCollection ExtractFaces(this TinSurface surf) { DBObjectCollection faces = new DBObjectCollection(); foreach (TinSurfaceTriangle triangle in surf.GetTriangles(false)) { Face face = new Face(triangle.Vertex1.Location, triangle.Vertex2.Location, triangle.Vertex3.Location, true, true, true, true); faces.Add(face); } return faces;