Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C# TinSurface Export to postgis

1 REPLY 1
SOLVED
Reply
Message 1 of 2
fabien.valentin
429 Views, 1 Reply

C# TinSurface Export to postgis

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)
{
  

}

 

1 REPLY 1
Message 2 of 2
Jeff_M
in reply to: fabien.valentin

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;
Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report