【工具使用】FreeCAD基础使用

一、简介

    FreeCAD 是一个开源的计算机辅助设计(CAD)软件,主要用于 2D 和 3D 建模。本文主要讲述其基本应用。
    一般会拿它跟AutoCAD进行比较,以下列出两者的一些对比。

特性FreeCADAutoCAD
软件类型开源商业软件
开发平台多平台(Windows、Mac、Linux)Windows为主,也支持其他平台
功能参数化三维建模二维和三维绘图和建模
价格完全免费需要购买,价格相对较高
文件格式支持多种文件格式,如step、iges、stl、svg、dxf、obj等广泛支持行业标准格式
用户群体业余爱好者、程序员、有经验的CAD用户、学生、老师等专业设计师、工程师、建筑师等
技术支持社区支持和官方文档官方和代理商提供技术支持

二、软件安装

2.1 下载安装

    首先进入FreeCAD官网链接下载FreeCAD安装包,本文演示的软件版本为0.21.2。
安装包下载

    安装时只需要修改个安装路径就行。
软件安装

2.2 设置中文

1、点击“Edit”菜单,选择“Preferences”选项。
2、在“Preferences”窗口中,点击“Change language”下拉框。
3、选择“‌简体中文”或“‌繁体中文”。
4、点击“OK”按钮,完成语言设置。
在这里插入图片描述
注:虽然设置了中文,但有些菜单还是英文的,习惯就好。

三、基础使用

3.1 新建工程

    点击新建...,新建一个工程。

新建文件
    新建一个工作空间,首先选择视图->工作台->Part Design,在左上角选择创建实体,再选择创建草图,然后从xyxzyz三个平面中选择一个平面开始画图。

在这里插入图片描述

3.2 2D建模

    常用的工具栏如下图红框所示,左边是用于切换视角,一般用在3D建模上;中间的是绘制基础图形的工具;右边是画完图形后给图形设置明确参数用的。这也印证了前面说FreeCAD是一种参数化建模的说法。
在这里插入图片描述
    假如现在想画一个半径为10mm的圆,选择画圆工具,从中心点开始,随便画个圆。
画圆1
    然后选择约束条件,设置半径为10mm,就可以锁定当前的圆形。
画圆2
    通过鼠标滚轮可以进行视图的缩小和放大。
    如果需要切掉一个角,则可以先画一根横线。

切角1

    计算下需要切掉的角的大小,比如这里想要按10mm的线长切掉一个角,那就约束线的长度为10mm。
切角2
    然后选择修剪边缘,点击需要去除的线,将多余的线切掉。
切角3

3.3 3D建模

    将上面所建的2D模型变成3D,还记得前面选择的绘图平面吗?现在就要基于此平面上的图形进行延伸形成3D模型。
    首先左上角选择Close关闭当前草图,选择凸台将平面图形拉伸成立体图形,同时设置其高度即可完成3D建模。
在这里插入图片描述

    如果需要在模型内开槽,则选择需要开槽的面,新建草图。
顶部开槽

    这里挖个正方形孔,过程同上2D建模。这里画一个以原点为中心的正方形,边长为5mm。这里为了使正方形中心对称,用上了辅助线。画这个的方法有很多种,不局限于这种。

顶部开槽2

    重点操作来了,平面图可以生成立体3D建模,那怎么做到开槽呢?这里就要用到与凸台对应的另一个功能凹坑。关闭草图后,选择凹坑,设置需要挖的深度,即可对3D模型进行挖孔。

顶部开槽3

    建模的基本功能就这些,其他功能可以自己继续尝试探索。

四、注意事项

1、使用约束时,不可以过多约束,比如来一个正方形,只需要约束一条边垂直且等于另一条边,剩下两个边直接连上即可,限制过多反而会出错。

Module developer’s guide to FreeCAD source code by Qingfeng Xia http://www.iesensor.com • 2015-09-18 version 0.1 for FreeCAD version 0.16-dev • 2016-09-18 version 0.2 for FreeCAD version 0.17-dev License of this book This ebook is licensed the same as FreeCAD document license CC-BY 3.0 http://creativecommons.org/licenses/by/3.0/Contents 1 FreeCAD overview and architecture 7 1.1 Introduction to FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 Key features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.1 Key software libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.2 Mixed python and c++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.3 GPL code will not be included into installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 How 3D model are renderred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.1 Selection of 3D visualization libarary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.2 Discussion of 3D rendering library selection on FreeCAD Forum . . . . . . . . . . . . . . . . . . . . . 8 1.5 Roadmap of FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5.1 Keep updated with main components: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5.2 C++11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5.3 Pyside 2 project for Qt 5.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 Organisation of FreeCAD source code 11 2.1 Build system for FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.1 Analysis of src/cMake/SMesh.cMake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.2 List of files and folders in FreeCAD source folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.3 List of modules in FreeCAD Mod folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.4 Learning path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5 Learning OpenInventor/Coin3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5.1 OpenInventor in FreeCAD’s ViewProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5.2 Important classes in OpenInventor/Coin3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.5.3 Window System integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.5.4 Pivy: Coin3D ’s Python wrapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Base, App and Main module 19 3.1 List of header files in Base folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.1 Frequently included headers files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.1.2 Correct way of using Sequencer in try-catch block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.1.3 String enconding utf8 and conversion into wchar_t QString . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2 Type, BaseClass, PyObjectBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.1 Type system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.2 src/Base/BaseClass.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.3 src/Base/PyObjectBase.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.2.4 src/Base/Persistence.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.2.5 GeoFeature: Base class of all geometric document objects . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.3 Unit scheme for physial quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.1 src/Base/Unit.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.2 src/Base/Quantity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4 List of header files in App folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.5 Property framewrok . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.5.1 Naming of property and PropertyEditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.5.2 src/App/PropertyStandard.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.5.3 PropertyEnumeration, see src/App/Enumeration.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.5.4 Geometry related property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.5.5 File related property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

知识噬元兽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值