Search code examples
openglopengl-esautocaddxf

autocad dxf files displayed in opengl/opengl es


I'm wondering if there is a way to extract the necessary data out of an autocad .dxf file, so I can visualize the structure in opengl?

I've found some old cold snippets for windows written in cpp but since the standard changes I assume 15 yr old code is a little outdated.

Also, there is a book about the .dxf file standard but it's also from the 90's and aside that, rarely available.

Another way might be to convert it to some other file format and then extract the data I need.

Trying to look into the .dxf files didn't give too much insight either since a simple cuboid contains a lot of data already!

Can anyone give me hint on how to approach this?


Solution

  • The references are a good place to start, but if you are doing heavy 3D work it may not be possible to accomplish what you are attempting..

    We recently wrote a DXF converter in JAVA based entirely on the references. Although many of the entities are relatively straightfoward, many other entities (3DSOLID, BODY, REGION, SURFACE, Swept Surface) are not really possible to translate, since the reference states that the groups are primarily proprietary data. Other objects (Extruded Surface, Revolved Surface, Swept Surface (again)) have significant chunks of binary data which may hold important information you need.

    These entities were not vital for our efforts, but if you are looking to convert to OpenGL, these may be the entities you were particularly concerned with.