底图模块
Introduction
简介
您可以利用底图工作台来绘制简单的2D对象,再利用其提供的其他工具来修改这些对象。此工作台提供了工具来定义工作平面、网格。另外,还有一个snapping系统可助您精确地控制几何体的位置。
用户创建的2D对象能以类似于Inkscape或Autocad中的方式用于通用绘图。这些2D图形也可用作零件工作台与建筑工作台等其他工作台所创3D对象的基本组件。另外,也可以将底图对象转换至构图工作台,这意味着能够在零件设计工作台中利用这些图形来创建实体。
FreeCAD是一款以3D建模为主的应用软件,这使它的2D工具并非如其他绘图程序那样高级。如果您的主要目的是复杂的2D绘图与处理DXF文件,并不是3D建模,那么不妨考虑一款关于技术制图的专用软件,例如LibreCAD, QCad, TurboCad以及其他类似程序。
绘制对象
下面来介绍一些用于创建对象的工具。
- 线段(Line): 绘制两点间的线段。
- 连线(Wire): 绘制一条由多条线段构成的折线(polyline)。
- 圆形(Circle): 根据中心点与半径来绘制一个圆形。
- 弧(Arc): 根据中心点、半径、起始角度与结束角度来绘制一条弧。
- 3点绘弧(Arc 3Points): 根据圆周上的3点来绘制一条弧线段。 introduced in version 0.19
- 椭圆形(Ellipse): 根据两个角点来绘制一个椭圆形。
- 多边形(Polygon): 根据中心点、半径与边数来绘制一个规则的多边形。
- 矩形(Rectangle): 根据两个角点来绘制一个多边形。
- 文本(Text): 绘制一个多行文本注解。
- 维度注解(Dimension): 绘制一个维度注解。
- B样条(BSpline): 根据一系列点来绘制一个B样条。
- 点(Point): 插入一个点对象。
- ShapeString: 在给定位置插入一个由复合图形构成的字符串。
- Facebinder: 根据已存在对象上所选定的面来创建一个新对象。
- 贝塞尔曲线(Bezier Curve): 根据一系列点来绘制一条贝塞尔曲线。
- 三次贝塞尔曲线(Cubic Bezier Curve): 通过拖动两个点来绘制一条三次贝塞尔曲线。introduced in version 0.19
- 标签(Label): 设置一个箭头指向选定元素的标签。 introduced in version 0.17
Annotation objects
- Text: draws a multi-line text annotation.
- Dimension: draws a dimension annotation.
- Label: places a label with an arrow pointing to a selected element. introduced in version 0.17
- Annotation style editor: opens an editor to change the annotation style of these objects. introduced in version 0.19
修改对象
以下这些工具用来修改已存在的对象。这写工具处理的是用户选定的对象,如果没有选择待处理对象,系统会提醒你选择一个。
- 移动(Move): 将对象移动到另一个地方。
- 旋转(Rotate): 将对象从起始角度旋转到结束角度。
- 偏移(Offset): 将对象中的线段按特定距离进行偏移。
- Trim/Extend (Trimex): trims or extends an object.
- Join: joins lines together into a single wire. introduced in version 0.18
- Split: splits a wire into two at a point. introduced in version 0.18
- Upgrade: upgrades objects into a higher-level object.
- Downgrade: downgrades objects into lower-level objects.
- Scale: scales selected objects around a base point.
- Edit: edits a selected object.
- File:Draft Edit Improved.svg Edit Improved: enters an edit mode that allows editing different objects. introduced in version 0.19
- Wire to BSpline: converts a wire to a B-Spline and vice-versa.
- Add point: adds a point to a wire or B-Spline.
- Delete point: deletes a point from a wire or B-Spline.
- Shape 2D View: creates a 2D object which is a flattened 2D view of a 3D object.
- Draft to Sketch: converts a Draft object to a Sketcher Workbench Sketch and vice-versa.
- Array: creates a polar or rectangular array from selected objects.
- Path Array: creates an array of objects by placing the copies along a path.
- Point Array: creates an array of objects by placing the copies at certain points. introduced in version 0.18
- 克隆(Clone): 对选定的对象进行克隆操作。
- File:Draft PutOnSheet.svg 绘制(Drawing): 将选定的对象写入工程制图工作台页面。
- 镜像(Mirror): 对选定的对象进行镜像操作。
- 拉伸(Stretch): 拉伸选定的对象。introduced in version 0.17
- Clone: clones the selected objects.
- Array tools.
- Ortho Array: creates an orthogonal array from the selected object. It can also create App Link copies. introduced in version 0.19
- Polar Array: creates an array in a polar pattern, that is, sweeping an angle. It can also create App Link copies. introduced in version 0.19
- Circular Array: creates an array in a circular pattern, that is, starting from a center and moving outwards radially. It can also create App Link copies. introduced in version 0.19
- Path Array: creates an array of objects by placing the copies along a path.
- Path LinkArray: like Path Array, but creates App Links instead of regular copies. introduced in version 0.19
- Point Array: creates an array of objects by placing the copies at certain points. introduced in version 0.18
- Point LinkArray: like Point Array, but creates App Links instead of regular copies. introduced in version 0.19
- Edit: edits a selected object.
- Subelement highlight: enters an edit mode that allows editing different objects. introduced in version 0.19
- Join: joins lines together into a single wire. introduced in version 0.18
- Split: splits a wire into two at a point. introduced in version 0.18
- Upgrade: upgrades objects into a higher-level object.
- Downgrade: downgrades objects into lower-level objects.
- Wire to BSpline: converts a wire to a B-Spline and vice-versa.
- Draft to Sketch: converts a Draft object to a Sketcher Workbench Sketch and vice-versa.
- Slope: changes the elevation slope of the currently selected Draft Line or Draft Wire. introduced in version 0.17
- Flip Dimension: flips the orientation of the text of a Draft Dimension.
- Shape 2D View: creates a 2D object which is a flattened 2D view of a 3D object.
Draft Tray toolbar
The Draft Tray toolbar appears when the workbench is started, and allows selecting the working plane, together with some visual properties like the line color, shape color, line width, text size and automatic group.
- Working plane: sets a working plane from a standard view or a selected face.
- Set style: sets the default style for new objects, and optionally applies the style to selected objects and groups.
- Construction mode: toggles the Draft construction mode on or off.
- AutoGroup: automatically place new objects in a given Std Group, Draft Layer, or one of the group-like objects of the Arch Workbench, like Arch BuildingPart. introduced in version 0.17
Draft annotation scale widget
With the Draft annotation scale widget the Draft annotation scale can be specified. The widget is located in the Status bar.
Draft snap widget
The Draft snap widget can be used as an alternative for the Draft Snap toolbar. The widget is located in the Status bar.
Draft Snap toolbar
The Draft Snap toolbar allows selecting the currently snapping mode. Its button keep depressed when a mode is active.
- Toggle snap: toggles object snapping globally on or off.
- Endpoint: snaps to the endpoints of line, arc and spline segments.
- Midpoint: snaps to the middle point of line and arc segments.
- Center: snaps to the center point of circles, arcs and faces, WP proxies and Building parts
- Angle: snaps to the special cardinal points of circles and arcs, at 45° and 90°.
- Intersection: snaps to the intersection of two line or arc segments. Hover the mouse over the two desired objects to activate their intersection snaps.
- Perpendicular: on line and arc segments, snaps perpendicularly to the latest point.
- Extension: snaps on an imaginary line that extends beyond the endpoints of line segments. Hover the mouse over the desired object to activate its extension snap.
- Parallel: snaps on an imaginary line parallel to a line segment. Hover the mouse over the desired object to activate its parallel snap.
- Special: snaps on special points defined by the object. introduced in version 0.17
- Near: snaps to the closest point or edge on the nearest object.
- Ortho: snaps on imaginary lines that cross the last point, and extend at 0°, 45° and 90°.
- Grid: snaps to the intersections of the grid lines, if the grid is visible.
- Working plane: always places the snapped point on the current working plane, even if you snap to a point outside that working plane.
- Dimensions: shows temporary X and Y dimensions while snapping.
- Toggle grid: toggles the visibility of the grid on or off.
实用工具
- Layer: creates a Layer in the current document, to which objects can be added to control object visibility and color. It replaces Draft VisGroup. introduced in version 0.19
- Working Plane Proxy: create a proxy object to store the current Working Plane position. introduced in version 0.17
- Toggle display mode: switches the display mode of selected objects between "Flat Lines" and "Wireframe".
- Add to group: quickly adds selected objects to an existing Std Group.
- Select group contents: selects the contents of a selected Std Group or Draft Layer.
- Add to Construction group: add selected objects to the Construction group. introduced in version 0.17
- Heal: heals problematic Draft objects found in very old files.
Additional tools
其他工具可从Draft → Utilities菜单处找到。或者右击当前的环境菜单(context menu),具体可用工具取决于当前所选对象。
- Toggle continue mode: toggles the Draft continue mode on or off.
- Apply current style: applies the current style to selected objects and groups.
- Show snap bar: shows the Draft Snap toolbar.
Obsolete tools
These commands are obsolete but still available.
- Array: creates a polar or rectangular array from selected objects. obsolete in version 0.19
- Drawing: writes selected objects to a Drawing Workbench page. obsolete in version 0.17
- Close line: ends the drawing of the current Draft Wire or Draft BSpline, and closes it. obsolete in version 0.19
- Finish line: ends the drawing of the current Draft Wire or Draft BSpline, without closing it. obsolete in version 0.19
- Undo line: undoes the last segment of a Draft Wire. obsolete in version 0.19
首选项
文件格式
底图模块为FreeCAD提供了下列格式文件的导出、导出服务:
- Autodesk .DXF: 导入或导出由2D CAD应用程序创建的图形交换文件。参见FreeCAD and DXF Import。
- Autodesk .DWG: 在ODA转换器安装完成后,通过DXF导入工具导入或导出DWG文件。参见FreeCAD and DWG Import。
- SVG: 导入或导出由矢量绘图应用程序创建的可伸缩矢量图形文件。
- Open Cad format .OCA: 导入或导出OCA/GCAD文件,这是一种潜在的新式开放CAD文件格式。
- Airfoil Data Format .DAT: 导入DAT文件,此格式详情可参见Airfoil profiles。
Install importers
- FreeCAD and DWG Import: Imports and exports DWG files
- FreeCAD and DXF Import: Imports and exports DXF files
其他功能
- 底图坐标(Coordinates): 利用输入坐标的方式取代点击3D视图来定义一个新的点。
- 底图约束(Constraining): 限制鼠标指针在相对于前一个点的水平方向或垂直方向上移动。
- 底图捕捉(Snapping): 将新添加的点定位于已存在对象上的特定位置或网格上。
Unit tests
See also: Test Workbench.
To run the unit tests of the workbench execute the following from the operating system terminal.
freecad -t TestDraft
脚本
借助Draft API即可在宏与Python控制台中使用各种底图工具。
The workbench includes a module to create samples of all objects in a new document. introduced in version 0.19
Use this to test that all objects are produced correctly.
import drafttests.draft_test_objects as dto
doc = dto.create_test_file()
Inspecting the code of this module is useful to understand how to use the programming interface.
$INSTALLDIR/Mod/Draft/drafttests/draft_test_objects.py
Where $INSTALLDIR
is the toplevel directory where the software was installed; for example, in Linux it may be /usr/share/freecad
.
Test objects for the Draft Workbench.
有关教程
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub