Manual:Traditional 2D drafting/zh-cn

可能你对 FreeCAD 感兴趣，因为你有技术绘图经验，例如使用过 AutoCAD 等软件. 你了解设计，或者你更喜欢在实际制造它们之前先绘制出来. 无论哪种情况，FreeCAD 都具有更传统的工作台： Draft Workbench，包含大多数 2D CAD 应用程序中都有的工具.

Draft 工作台虽然继承了传统 2D CAD 的工作方式，但并不局限于 2D 领域. Draft 工作台的所有工具都可以在整个 3D 空间中工作. 许多 Draft 工具，例如， Move 和 Rotate在 FreeCAD 中使用广泛，因为比起手动更改位置参数，Move 和 Rotate 更直观.

在 Draft 工作台提供的工具中，你会发现传统的绘图工具，像 Line， Circle, or  Wire (polyline), modification tools like  Move,  Rotate or  Offset, a working plane/grid system，修改工具之类，像 Move,  Rotate or  Offset, a working plane/grid system，让你精确定义正在工作的平面，以及一个完整的 snapping system ，使得相对于彼此绘制和定位元素非常容易.

为了展示 Draft 的工作流程和能力范围，我们做一个简单的练习，结果将是这个小图，一个只包含厨房顶部的小房子的平面图（一个非常荒谬的平面图，但我们可以在这里做我们想做的事，不是够了吗？）：




 * 切换到 Draft 工作台
 * 与所有技术绘图应用程序一样，正确设置环境是明智的，它将为你节省大量时间. 在菜单 Edit -> Preferences -> Draft 根据自己的喜好配置grid and working plane, Text 和 Dimension. 但是，在本练习中，我们将这些设置保留默认值.




 * 你可能需要注意一个选项，它很霸道："Fill objects with faces whenever possible" 选项. 如果选中这个选项，默认情况下 FreeCAD 将用面来填充诸如矩形或圆形这类的闭合对象，这样可能就难以捕捉到底层对象了. 你可以立即关闭此选项，或者稍后关闭每个单独对象的 "Make Face" 属性，以防止它们创建面.


 * Draft 工作台还有两个特殊的工具栏. 一个具是 visual settings，可以更改当前工作平面，打开/关闭 construction mode，设置要用于新对象的线条颜色、面的颜色、线宽和文本大小. 另一个是snap locations，可以打开/关闭网格并设置/取消设置单个 Snap locations.




 * 打开所有捕捉按钮是会带来方便，但也会使绘图变慢，因为移动鼠标光标时需要进行更多的计算. 通常只保留实际使用的那些就好了.


 * 我们先打开 construction mode，这样可以绘制一些引导线，在其基础上绘制最终的几何图形.
 * 愿意的话，将 working plane 设置为 XY. 这样无论当前视图如何，工作平面都不会改变. 如果没有设置，工作平面将自动适应当前视图，只要想在 XY（地面）平面上绘图，都应该小心注意保持在顶视图.
 * 然后，选择 [[Image:Draft_Rectangle.png|16px]] Rectangle 工具并绘制一个矩形，从点（0,0,0）开始，2 米乘 2 米（将 Z 保持为零）. 请注意，大多数 Draft 命令都完全可以使用双字母快捷键从键盘执行，而无需鼠标. 我们的第一个 2x2m 的矩形可以这样完成：re 0 Enter 0 Enter 0 Enter 2m Enter 2m Enter 0 Enter.
 * 将矩形向内复制 15cm，使用 [[Image:Draft_Offset.png|16px]] Offset 工具，打开复制模式，并给出距离 15cm.




 * 接下来，绘制几条垂直的线来定义门窗的位置，使用 [[Image:Draft_Line.png|16px]] Line 工具. 这些线与两个矩形的交叉点为我们提供帮助，来捕捉墙壁的位置. 从点（15cm，1m，0）到点（15cm，3m，0）绘制第一条线.
 * 使用 [[Image:Draft_Move.png|16px]] Move 工具，打开 Copy 模式,将这条线复制 5 次. 同时打开 Relative 模式，定义相对距离的移动，这比计算每条线的确切位置更容易. 给每个新副本任意起始点，例如，可以保留在（0,0,0），指定相对终点如下：
 * line001: x: 10cm
 * line002: x: 120cm
 * line003: x: -55cm, y: -2m
 * line004: x: 80cm
 * line005: x: 15cm




 * 这就是我们现在所需要的，所以我们可以关闭构造模式. 检查一下所有构造几何体是否已放入 "Construction" 组中，这样可以轻松地将其全部隐藏起来，甚至可以在以后完全删除它.
 * 现在用 [[Image:Draft_Wire.png|16px]] Wire 工具绘制两面墙壁. 确保 [[Image:Snap_Intersection.png|16px]] intersection snap 已打开，因为我们需要捕捉到线条和矩形的交叉点. 绘制如下两条线，单击圈出轮廓的所有点. 要使它们闭合，请再次单击第一个点，或触发 Close 按钮.




 * We can change their default grey color to a nice hatch pattern, by selecting both walls, then setting their Pattern property to Simple, and their Pattern size to your liking, for example 0.005.




 * We can now hide the construction geometry by right-clicking the Construction group and choose Hide Selection.
 * Let's now draw the windows and doors. Make sure the [[Image:Snap_Midpoint.png|16px]] midpoint snap is turned on, and draw six lines as follow:




 * We will now change the door line to create an opened door symbol. Start by rotating the line using the [[Image:Draft_Rotate.png|16px]] Rotate tool. Click the endpoint of the line as rotation center, give it a start angle of 0, and an end angle of -90.
 * Then create the opening arc with the [[Image:Draft_Arc.png|16px]] Arc tool. Pick the same point as the rotation center we used in the previous step as center, click the other point of the line to give the radius, then the start and end points as follow:




 * We can now start placing some furniture. To begin with, let's place a counter by drawing a rectangle from the upper left inner corner, and giving it a width of 170cm and a height of -60cm. In the image below, the Transparency property of the rectangle is set to 80%, to give it a nice furniture look.
 * Then let's add a sink and a cookertop. Drawing these kinds of symbols by hand can be very tedious, and they are usually easy to find on the internet, for example on http://www.cad-blocks.net . In the Downloads section below, for convenience, we separated a sink and a cookertop from this project, and saved them as DXF files.You can download these two files by visiting the links below, and right-clicking the Raw button, then choosing save as.
 * Inserting a DXF file into an opened FreeCAD document can be done either by choosing the File -> Import menu option, or by dragging and dropping the DXF file from your file explorer into the FreeCAD window. The contents of the DXF files might not appear right on the center of your current view, depending on where they were in the DXF file. You can use menu View -> Standard views -> Fit all to zoom out and find the imported objects. Insert the two DXF files, and move them to a suitable location on the tabletop:




 * We can now place a couple of dimensions using the [[Image:Draft_Dimension.png|16px]] Dimension tool. Dimensions are drawn by clicking 3 points: the start point, an end point, and a third point to place the dimension line. To make horizontal or vertical dimensions, even if the two first points are not aligned, press Shift while clicking the second point.
 * You can change the position of a dimension text by double-clicking the dimension in the tree view. A control point will allow you to move the text graphically. In our exercise, the "0.15" texts have been moved away for better clarity.
 * You can change the contents of the dimension text by editing their Override property. In our example, the texts of the door and window dimensions have been edited to indicate their heights:




 * Let's add some description texts using the [[Image:Draft_Text.png|16px]] Text tool. Click a point to position the text, then enter the lines of text, pressing Enter after each line. To finish, press Enter twice.
 * The indication lines (also called "leaders") that link the texts to the item they are describing are simply done with the Wire tool. Draw wires, starting from the text position, to the place being described. Once that is done, you can add a bullet or arrow at the end of the wires by setting their End Arrow property to True




 * Our drawing is now complete! Since there are quite a number of objects there, it would be wise do some cleaning and restructure everything into nice groups, to make the file easier to understand for other people:




 * We can now print our work by placing it on a Drawing sheet, which we will show later in this manual, or directly export our drawing to other CAD applications, by exporting it to a DXF file. Simply select our "Floor plan" group, select menu File -> Export, and select the Autodesk DXF format. The file can then be opened in any other 2D CAD application such as LibreCAD. You might notice some differences, depending on the configurations of each application.




 * The most important thing about the Draft Workbench, however, is that the geometry you create with it can be used as a base or easily extruded into 3D objects, simply by using the [[Image:Part_Extrude.png|16px]] Part_Extrude tool from the Part Workbench, or, to stay in Draft, the [[Image:Draft_Trimex.png|16px]] Trimex (Trim/Extend/Extrude) tool, which under the hood performs a Part Extrusion, but does it "the Draft way", that is, allows you to indicate and snap the extrusion length graphically. Experiment extruding our walls as shown below.
 * By pressing the [[Image:Draft_SelectPlane.png|16px]] working plane button after selecting a face of an object, you are also able to place the working plane anywhere, and therefore draw Draft objects in different planes, for example on top of the walls. These can then be extruded to form other 3D solids. Experiment setting the working plane on one of the top faces of the walls, then draw some rectangles up there.




 * All kinds of openings can also be done as easily by drawing Draft objects on the faces of walls, then extruding them, then using the boolean tools from the Part Workbench to subtract them from another solid, as we saw in the previous chapter.

Fundamentally, what the Draft Workbench does is provide graphical ways to create basic Part operations. While in Part you will usually position objects by setting their placement parameter, in Draft you can do it on-screen. There are times when one is better, other times when the other is preferable. Don't forget, you can create custom toolbars in one of these workbenches, add the tools from the other, and get the best of both worlds.

Downloads


 * The file created during this exercise: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/cabin.FCStd
 * The sink DXF file: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/sink.dxf
 * The cookertop DXF file: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/cooktop.dxf
 * The final DXF file produced during this exercise: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/cabin.dxf

Read more


 * The Draft Workbench
 * Snapping
 * The Draft working plane