零、前言
LibreCAD is a fork of QCAD community edition version 2.0.5.0;therefore, any modifications of or additions to the program are also released under the GPLv2.
LibreCAD 是一款开源免费的 2D CAD 制图软件,原名为 CADuntu 。它是基于社区版本 QCad 构建,并利用 Qt4 进行了重构,原生支持 Mac OSX, Windows 和 Linux 。它提供了基于 GPL 协议的读取/修改/创建 CAD 文件 (.dxf ) 方案。
LibreCAD源自QCad的老版本,v2.0.5,using mingw-5.1.4 and qt-3.3.x-p8.
https://sourceforge.net/projects/qcadbin-win/
The project's first commit on Github was Aug 16, 2010.
https://github.com/LibreCAD/LibreCAD
https://sourceforge.net/projects/librecad/files/
安装包
https://sourceforge.net/projects/librecad/files/playground/master/
https://sourceforge.net/projects/librecad/files/Windows/NightlyBuilds/master/
一、环境准备
1、VS2019,Qt5.12.9/x64,Qt VS Tools插件
http://download.qt.io/official_releases/qt/
2、boost v1.71.0下载:
https://dl.bintray.com/boostorg/release/ -- 下载boost_1_71_0-msvc-14.2-64.exe文件(含源码和编译好的库)
3、检查一下Windows环境变量是否正确:
设置Windows的环境变量。推荐使用工具Rapid Environment Editor。http://www.rapidee.com/
Path=F:\Software\Qt\Qt5.12.9\5.12.9\msvc2017_64\bin
QTDIR=F:\Software\Qt\Qt5.12.9\5.12.9\msvc2017_64\
BOOST_DIR=T:\tmp-source\boost_1_71_0
BOOST_LIBDIR=T:\tmp-source\boost_1_71_0\lib64-msvc-14.2
4、LibreCAD官网下载源码
https://github.com/LibreCAD/LibreCAD/releases
<1>使用Windows记事本,修改以下源文件的编码为Unicode或者带BOM的UTF-8,否则编译会出错:
F:\CADCAM\QCAD\src\LibreCAD-2.2.0\libraries\jwwlib\src\ dl_jww.cpp jwwdoc.cpp jwwdoc.h f:\cadcam\qcad\src\librecad-2.2.0\librecad\src\lib\engine\rs.h
<2>\LibreCAD-2.2.0\librecad\src\boost.pri文件有对boost的依赖库作说明,用的是静态库.
5、打开VS2019(使用Qt Creator也行),主菜单->Qt VS Tools->打开librecad.pro文件,最后可能会提示出错(Import): Error(s): ,没关系,不管它。
开始编译源码,过程中会报错:
(1)4>f:\cadcam\qcad\src\librecad-2.2.0\librecad\src\actions\rs_actiondrawcircletan2.h(82): error C2797: “RS_ActionDrawCircleTan2::enTypeList”: 未实现成员初始值设定项列表或非静态数据成员初始值设定项内的列表初始化 (编译源文件 ui\forms\qg_circletan2options.cpp),解决办法:
\LibreCAD-2.2.0\librecad\src\actions\rs_actiondrawlinetangent2.h修改为 //list of entity types supported by current action //const std::initializer_list<RS2::EntityType> circleType {RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse}; const std::initializer_list<RS2::EntityType> circleType; \LibreCAD-2.2.0\librecad\src\actions\rs_actiondrawlinetangent2.cpp修改为 RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2( RS_EntityContainer& container, RS_GraphicView& graphicView) :RS_PreviewActionInterface("Draw Tangents 2", container, graphicView) ,circle1(nullptr) ,circle2(nullptr) ,valid(false) ,circleType({ RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse })
(2)错误 C1083 无法打开源文件: “Win32\Debug\licenses\\qrc_licenses.cpp”: No such file or directory,解决办法:
把\LibreCAD-2.2.0\librecad\src\Win32\licenses拷贝到\LibreCAD-2.2.0\librecad\src\Win32\Debug
(3)\LibreCAD-master\librecad\src\muparser.pri
LIBS += -L$$GEN_LIB_DIR -lmuparser
#PRE_TARGETDEPS += $$GEN_LIB_DIR/libmuparser.a #firecat
(4)\LibreCAD-master\librecad\src\src.pro
GEN_LIB_DIR = ../../generated/lib #PRE_TARGETDEPS += $$GEN_LIB_DIR/libdxfrw.a \ #firecat # $$GEN_LIB_DIR/libjwwlib.a #firecat LIBS += -L$$GEN_LIB_DIR -ldxfrw #firecat LIBS += -L$$GEN_LIB_DIR -ljwwlib #firecat
二、BRL-CAD
BRL-CAD是一个强大的开源跨平台实体建模系统,包括交互式几何编辑、用于渲染和几何分析的高性能射线跟踪、一个系统性能分析基准套件、应用程序开发人员的几何库,以及超过30年的积极开发。BRL-CAD和LibreCAD在谷歌程序中合作。我们在BRL-CAD的保护下参与谷歌Code-in和谷歌Summer of Code,在那里我们指导学生和学生参与开源项目。
https://sourceforge.net/projects/brlcad/files/