Draft Line/zh-cn: Difference between revisions

From FreeCAD Documentation
(Created page with "===将多条单独的线段合为一体=== 如果选定了若干连接在一起的线段,再按下{{Button|16px Draft Upgr...")
(Updating to match new version of source page)
 
(35 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Docnav||[[Draft_Wire|Wire]]|[[Draft_Module|Draft]]|IconC=Workbench_Draft.svg|IconR=Draft_Wire.svg}}


{{Docnav
|
|[[Draft_Wire|Wire]]
|[[Draft_Workbench|Draft]]
|IconL=
|IconR=Draft_Wire.svg
|IconC=Workbench_Draft.svg
}}

<div class="mw-translate-fuzzy">
{{GuiCommand
{{GuiCommand
|Name=Draft Line
|Name=Draft Line
|MenuLocation=Draft → Line
|MenuLocation=Draft → Line
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|Workbenches=[[Draft Workbench|Draft]], [[Arch Workbench|Arch]]
|Shortcut=L I
|Shortcut=L I
|SeeAlso=[[Draft Wire|Draft Wire]], [[Draft Point]]
|SeeAlso=[[Draft Wire|Draft Wire]], [[Draft Point]]
|Version=0.7
|Version=0.7
}}
}}
</div>


==Description==

<div class="mw-translate-fuzzy">
==描述==
==描述==
线段工具用于创建两点定义的线段。它根据[[底图工具栏]]中[[底图线型]]的设置来绘制线段。此工具与[[底线连线]]工具的行为基本相同,唯独线段工具在绘制完一条两点的线段即停止工作。
线段工具用于创建两点定义的线段。它根据[[Draft Tray]]中[[Draft Linestyle]]的设置来绘制线段。此工具与[[Draft Wire]]工具的行为基本相同,唯独线段工具在绘制完一条两点的线段即停止工作。
</div>

A Draft Line is in fact a [[Draft_Wire|Draft Wire]] with only two points.


[[Image:Draft_Line_example.jpg|400px]]
[[Image:Draft_Line_example.jpg|400px]]
<div class="mw-translate-fuzzy">
{{Caption|根据两点创建一条线段}}
{{Caption|根据两点创建一条线段}}
</div>

==Usage==

See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].


<div class="mw-translate-fuzzy">
==如何使用==
==如何使用==
# 按下{{Button|[[Image:Draft Line.svg|16px]] [[Draft Line]]}}按钮, 或先按{{KEY|L}}再按{{KEY|I}}键。
# 按下{{Button|[[Image:Draft Line.svg|16px]] [[Draft Line]]}}按钮, 或先按{{KEY|L}}再按{{KEY|I}}键。
# 在3D视图中单击第一个点,或输入[[Draft_Coordinates|坐标]]并按下{{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}}按钮。
# 在3D视图中单击第一个点,或输入坐标并按下{{Button|[[Image:Draft_AddPoint.svg|16px]] add point}}按钮。
# 在3D视图中单击第二个点,或输入 [[Draft_Coordinates|坐标]]并按下{{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}}键。
# 在3D视图中单击第二个点,或输入坐标并按下{{Button|[[Image:Draft_AddPoint.svg|16px]] add point}}键。
</div>


==Options==
通过双击树状视图(tree view)中的元素或点击{{Button|[[Image:Draft Edit.svg|16px]] [[Draft Edit]]}}按钮即可编辑对应线段。届时,您就可将构成线段的点拖动到预定的新位置。


The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts (for version 0.22).
===将多条单独的线段合为一体===
如果选定了若干连接在一起的[[Draft Line/zh-cn|线段]],再按下{{Button|[[Image:Draft Upgrade.svg|16px]] [[Draft Upgrade]]}}工具,即可将它们融合为一条连线(wire);但是,却不能对这条连线进行后续编辑。为了创建一条可编辑的连线,至少需要用{{Button|[[Image:Draft Upgrade.svg|16px]] [[Draft Upgrade]]}}三次以上来调整新图形(连线->闭合连线->面)。您也可以用{{Button|[[Image:Draft Wire.svg|16px]] [[Draft Wire]]}}工具来融合初始的多条单独线段。


<div class="mw-translate-fuzzy">
A wire can also be created from a single line by adding another point anywhere along its length. To do this, press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button, and click anywhere on the line.
==选项==
* 设置好第一个点后,按{{KEY|X}}、{{KEY|Y}}或{{KEY|Z}}键来约束第二点的对应坐标。
* 为了手动输入坐标值,可以在每次输入X、Y与Z分量后按{{KEY|Enter}}键。
** 您也通过指定"Length(长度)"与"Angle(角度)"的值来定义点的极坐标。点击"Angle"边上的复选框来约束线段所指向的角度。您还可以点击{{Button|[[Image:Draft_AddPoint.svg|16px]] add point}}按钮来插入点。
* 按{{KEY|R}}键或点击relative复选框切换至''相对坐标''模式。如果开启了相对坐标模式,则第二个点的坐标将相对于第一个点而定(即以第一个点为基准);否则两点采用绝对坐标定义,即基于原点(0,0,0)而定。
* 按{{KEY|T}}键或点击continue复选框切换至''连续''模式。如果开启了连续模式,则在指定某线段第二个端点后,线段绘制工具将自动重启并继续下条线段的绘制,而不必再次按线段工具按钮。
* 在将端点强制绘至最近[[Draft_Snap|捕捉]]位置时,按住{{KEY|Ctrl}}。
* 在绘制第二端点时,按住{{KEY|Shift}}键来[[Draft_Constrain|约束(constrain)]]它的位置位于第一个点的水平方向或垂直方向。
* 按{{KEY|Ctrl}}+{{KEY|Z}}键或点击{{button|[[Image:Draft UndoLine.png|12px]] Undo}}按钮来撤销最近绘制的线段。
* 按{{KEY|Esc}}键或点击{{Button|Close}}按钮来终止当前命令。
</div>


==Options==
==Notes==
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after the first point to constrain the second point on the given axis.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component.
** You can also define the polar coordinates of the point by giving a value to "Length" and "Angle". Click on the checkbox next to "Angle" to constrain the pointer to the specified angle. You can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button when you have the desired values to insert the point.
* Press {{KEY|R}} or click the checkbox to toggle ''relative'' mode. If relative mode is on, the coordinates of the second point are relative to the first one; if not, they are absolute, taken from the origin (0,0,0).
* Press {{KEY|T}} or click the checkbox to toggle ''continue'' mode. If continue mode is on, the Line tool will restart after you give the second point, allowing you to draw another line segment without pressing the tool button again.
* Hold {{KEY|Ctrl}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
* Hold {{KEY|Shift}} while drawing to [[Draft_Constrain|constrain]] your second point horizontally or vertically in relation to the first one.
* Press {{KEY|Ctrl}}+{{KEY|Z}} or press the {{button|[[Image:Draft UndoLine.png|12px]] [[Draft_UndoLine|Undo]]}} button to undo the last point.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the current command.


<div class="mw-translate-fuzzy">
==Properties==
通过双击树状视图(tree view)中的元素或点击{{Button|[[Image:Draft Edit.svg|16px]] [[Draft Edit]]}}按钮即可编辑对应线段。届时,您就可将构成线段的点移动到预定的新位置。
A Line object shares all properties from a [[Draft Wire]], however, only some of these properties are applicable to the Line.
</div>


===Data===
==Preferences==
* {{PropertyData|Start}}: specifies the start point.
* {{PropertyData|End}}: specifies the end point.
* {{PropertyData|Subdivisions}}: specifies the number of interior nodes in the line. {{version|0.16}}
* {{PropertyData|Length}}: (read-only) specifies the length of the segment.


See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].
===View===

* {{PropertyView|End Arrow}}: if it is {{TRUE}} it will display a symbol at the last point of the line, so it can be used as an annotation line.
* To change the initial focus of the task panel to the {{MenuCommand|Length}} input box: {{MenuCommand|Edit → Preferences... → Draft → General → Set focus on Length instead of X coordinate}}. Note that you must move the pointer in the [[3D_view|3D view]] for the change to take effect.
* {{PropertyView|Arrow Size}}: specifies the size of the symbol displayed at the end of the line.
* If the {{MenuCommand|Edit → Preferences... → Draft → General → Create Part primitives if possible}} option is checked, the command will create a [[Part_Line|Part Line]] instead of a Draft Line.
* {{PropertyView|Arrow Type}}: specifies the type of symbol displayed at the end of the line, which can be "Dot", "Circle", "Arrow", or "Tick".

==Properties==

<div class="mw-translate-fuzzy">
==属性==
线段对象享有[[Draft Wire]]的所有属性,但是其中仅有部分属性适用于线段。
</div>


==Scripting==
==Scripting==
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


<div class="mw-translate-fuzzy">
The Line tool can be used in [[macros]] and from the [[Python]] console by using the following function:
==脚本==
{{Emphasis|参见:}} [[Draft API]] 与 [[FreeCAD Scripting Basics]]。
</div>

<div class="mw-translate-fuzzy">
借助下列函数即可在[[macros|宏]]与[[Python]]控制台中使用线段绘制工具:
</div>

{{Code|code=
{{Code|code=
Line = makeLine(p1, p2)
line = make_line(p1, p2)
Line = makeLine(LineSegment)
line = make_line(LineSegment)
Line = makeLine(Shape)
line = make_line(Shape)
}}
}}


* Creates a {{incode|Line}} object between points {{incode|p1}} and {{incode|p2}}, each defined by its {{incode|FreeCAD.Vector}}, with units in millimeters.
* 创建点{{incode|p1}}与点{{incode|p2}}间的一条 {{incode|Line}}对象,每个点由其{{incode|FreeCAD.Vector}}来定义,且以毫米为单位。
* Creates a {{incode|Line}} object from a {{incode|Part.LineSegment}}.
* 根据{{incode|Part.LineSegment}}来创建一条{{incode|Line}}对象。
* Creates a {{incode|Line}} object from the first vertex to the last vertex of the given {{incode|Shape}}.
* 从指定{{incode|Shape}}的第一个顶点至最后一个顶点创建一条{{incode|Line}}对象。

示例:


Example:
{{Code|code=
{{Code|code=
import FreeCAD, Draft
import FreeCAD as App
import Draft


doc = App.newDocument()
p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(1000, 500, 0)
p3 = FreeCAD.Vector(-250, -500, 0)
p4 = FreeCAD.Vector(500, 1000, 0)


Line1 = Draft.makeLine(p1, p2)
p1 = App.Vector(0, 0, 0)
Line2 = Draft.makeLine(p3, p4)
p2 = App.Vector(1000, 500, 0)
p3 = App.Vector(-250, -500, 0)
p4 = App.Vector(500, 1000, 0)

line1 = Draft.make_line(p1, p2)
line2 = Draft.make_line(p3, p4)

doc.recompute()
}}
}}


{{Docnav||[[Draft_Wire|Wire]]|[[Draft_Module|Draft]]|IconC=Workbench_Draft.svg|IconR=Draft_Wire.svg}}


{{Docnav
{{Draft Tools navi}}
|
|[[Draft_Wire|Wire]]
|[[Draft_Workbench|Draft]]
|IconL=
|IconR=Draft_Wire.svg
|IconC=Workbench_Draft.svg
}}


{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 05:00, 9 January 2024

Draft Line

Menu location
Draft → Line
Workbenches
Draft, Arch
Default shortcut
L I
Introduced in version
0.7
See also
Draft Wire, Draft Point

Description

描述

线段工具用于创建两点定义的线段。它根据Draft TrayDraft Linestyle的设置来绘制线段。此工具与Draft Wire工具的行为基本相同,唯独线段工具在绘制完一条两点的线段即停止工作。

A Draft Line is in fact a Draft Wire with only two points.

根据两点创建一条线段

Usage

See also: Draft Tray, Draft Snap and Draft Constrain.

如何使用

  1. 按下 Draft Line按钮, 或先按L再按I键。
  2. 在3D视图中单击第一个点,或输入坐标并按下 add point按钮。
  3. 在3D视图中单击第二个点,或输入坐标并按下 add point键。

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 0.22).

选项

  • 设置好第一个点后,按XYZ键来约束第二点的对应坐标。
  • 为了手动输入坐标值,可以在每次输入X、Y与Z分量后按Enter键。
    • 您也通过指定"Length(长度)"与"Angle(角度)"的值来定义点的极坐标。点击"Angle"边上的复选框来约束线段所指向的角度。您还可以点击 add point按钮来插入点。
  • R键或点击relative复选框切换至相对坐标模式。如果开启了相对坐标模式,则第二个点的坐标将相对于第一个点而定(即以第一个点为基准);否则两点采用绝对坐标定义,即基于原点(0,0,0)而定。
  • T键或点击continue复选框切换至连续模式。如果开启了连续模式,则在指定某线段第二个端点后,线段绘制工具将自动重启并继续下条线段的绘制,而不必再次按线段工具按钮。
  • 在将端点强制绘至最近捕捉位置时,按住Ctrl
  • 在绘制第二端点时,按住Shift键来约束(constrain)它的位置位于第一个点的水平方向或垂直方向。
  • Ctrl+Z键或点击 Undo按钮来撤销最近绘制的线段。
  • Esc键或点击Close按钮来终止当前命令。

Notes

通过双击树状视图(tree view)中的元素或点击 Draft Edit按钮即可编辑对应线段。届时,您就可将构成线段的点移动到预定的新位置。

Preferences

See also: Preferences Editor and Draft Preferences.

  • To change the initial focus of the task panel to the Length input box: Edit → Preferences... → Draft → General → Set focus on Length instead of X coordinate. Note that you must move the pointer in the 3D view for the change to take effect.
  • If the Edit → Preferences... → Draft → General → Create Part primitives if possible option is checked, the command will create a Part Line instead of a Draft Line.

Properties

属性

线段对象享有Draft Wire的所有属性,但是其中仅有部分属性适用于线段。

Scripting

脚本

参见: Draft APIFreeCAD Scripting Basics

借助下列函数即可在Python控制台中使用线段绘制工具:

line = make_line(p1, p2)
line = make_line(LineSegment)
line = make_line(Shape)
  • 创建点p1与点p2间的一条 Line对象,每个点由其FreeCAD.Vector来定义,且以毫米为单位。
  • 根据Part.LineSegment来创建一条Line对象。
  • 从指定Shape的第一个顶点至最后一个顶点创建一条Line对象。

示例:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 500, 0)
p3 = App.Vector(-250, -500, 0)
p4 = App.Vector(500, 1000, 0)

line1 = Draft.make_line(p1, p2)
line2 = Draft.make_line(p3, p4)

doc.recompute()