AutoCAD中表达的地形数据一般是二维的。通过分析DXF文件格式和地形数据的表达方式,提出一种从DXF文件中提取三维地形数据的方法:用块实体获取点位平面信息,用文本实体获取高程信息。用匹配盒的方法,将两种信息匹配并组合成三维点。接着对这些三维散乱点集进行三角剖分,形成三角形网。使用OpenGL对三角形网渲染,生成具有真实感的三维地形。最后,通过具体实例验证了该方法。
Representation of terrain data in AutoCAD is usually in 2D form.Through analyzing DXF file format and representation of terrain data,we propose a method for extracting 3D terrain data from DXF file,which obtains point's location information from block entity and height information from text entity.Matching-Box is presented,which can match the two information and combine them into 3D point with x,y and z.Then,these scattered 3D points is triangulated and converted into triangle meshes.OpenGL is used to render triangle meshes to create 3D realistic terrain.Finally,an example is given to validate the method.