天天看点

AutoCAD *.dxf文件解析,dxflib在VS2013的使用

dxflib是开源库,用于解析dxf文件

https://www.qcad.org/en/ https://www.qcad.org/en/dxflib-downloads

-- dxflib源码下载

https://qcad.org/en/90-dxflib

-- dxflib主页

https://qcad.org/doc/dxflib/2.5/classref/annotated.html

-- dxflib文档说明

https://github.com/qcad/qcad https://github.com/msteinbeck/tinyspline

-- 用于解析dxf的spline图元

源码在VS不需要编译成为库,编译会报错:error C4996: 'fopen': This function orvariable may be unsafe.

这是因为打开安全开发生命周期(SDL)的原因,在项目属性->配置属性->C/C++里将SDL检查关掉。

具体使用方法请参考文章:

https://blog.csdn.net/huanghxyz/article/details/73655608

dl_dxf.cpp源码第1023行,有使用std::min

maxVertices = std::min(maxVertices, vertexIndex+1);

如果编译报错,std::max、std::min error C2589: “(”:“::”右边的非法标记,error C2059: 语法错误:“::”。解决办法如下:

https://blog.csdn.net/libaineu2004/article/details/88911392

我个人实践的源码工程请下载:

https://download.csdn.net/download/libaineu2004/11074482

---附录---

除了dxflib,我还找到了另外一个dxf开源解析库libdxfrw:

https://github.com/LibreCAD/libdxfrw https://sourceforge.net/projects/libdxfrw/ https://librecad.org/ https://github.com/LibreCAD

继续阅读