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/73655608dl_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