Search code examples
meshautocadraytracingtriangulation

Triangulates all objects in Autocad


I need to render Autocad models(drawing), meaning all the renderable objects on the scene, through ray casting technic. Therefore I need to triangulate the model to intersect ray-triangle. Is there any way to access triangles in the model(as I assume the Autocad engine probably triangulate all the objects within the model and render them, doesn't it?) apart from exporting the file to .FBX or other formats? The problem with .FBX is that it's slow(it writes the file twice). And other formats apparently only accept solids and not meshes.


Solution

  • You can collect the details of geometry by creating your own implementation of WorlDraw and ViewportDraw with the AutoCAD .NET API: http://adndevblog.typepad.com/autocad/2012/07/get-entity-geometry-using-custom-worlddraw-and-viewportdraw.html