Draft Stretch: Difference between revisions

From FreeCAD Documentation
m (Added template)
mNo edit summary
 
(38 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:12-->
<!--T:12-->
{{Docnav
{{Docnav
|[[Draft_Mirror|Mirror]]
|[[Draft_Trimex|Trimex]]
|[[Draft_Clone|Clone]]
|[[Draft_SelectPlane|Set working plane]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Mirror.svg
|IconL=Draft_Trimex.svg
|IconR=Draft_Clone.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_SelectPlane.svg
}}
}}


Line 14: Line 15:
{{GuiCommand
{{GuiCommand
|Name=Draft Stretch
|Name=Draft Stretch
|MenuLocation=Draft → Stretch
|MenuLocation=Modification → Stretch
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]]
|Shortcut={{KEY|S}} {{KEY|H}}
|SeeAlso=[[Draft Offset]], [[Draft Scale]]
|Version=0.17
|Version=0.17
}}
}}


==Description== <!--T:2-->
==Description== <!--T:15-->
The {{Button|[[Image:Draft Stretch.svg|16px]] [[Draft Stretch|Draft Stretch]]}} tool stretches an object by moving some of its selected vertices. The equivalent action is editing the object and moving the points manually to a new position.


<!--T:7-->
<!--T:2-->
The [[Image:Draft_Stretch.svg|24px]] '''Draft Stretch''' command stretches objects by moving selected points.
The Stretch tool works for objects like [[Draft Wire|Draft Wire]]s and [[Draft BSpline|Draft BSpline]]s which are defined by many points.


</translate>
</translate>
Line 30: Line 30:
<translate>
<translate>
<!--T:3-->
<!--T:3-->
{{Caption|Stretching of three wires by enclosing some vertices and moving them to another position}}
{{Caption|Stretching three Draft Wires}}


==Usage== <!--T:4-->
==Usage== <!--T:16-->
# Select an object that you wish to stretch.
# Press the {{Button|[[Image:Draft Stretch.svg|16px]] [[Draft Stretch|Draft Stretch]]}} button. If no object is selected, you will be invited to select one.
# Click a point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button.
# Click a second point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. The first two points define a selection rectangle. The vertices of the original object enclosed by this rectangle become highlighted.
# Click a third point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button.
# Click a fourth point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. The second pair of points define a line, whose distance and direction will be used to stretch the figure attached to the highlighted points.


<!--T:8-->
<!--T:20-->
See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
Notes:
* The Stretch tool is designed to work with objects that are comprised of points. By moving only the selected points, the original figure is stretched in the desired direction.
* So far, only [[Draft Line|Draft Line]], [[Draft Wire|Draft Wire]], [[Draft BSpline|Draft BSpline]], [[Draft BezCurve|Draft BezCurve]] and [[Draft Rectangle|Draft Rectangle]] work with this tool.
* [[Draft Circle|Draft Circle]]s and [[Draft Polygon|Draft Polygon]]s are only defined by their centers; the individual edges of those shapes don't have selectable points, and therefore can't be stretched. Performing a stretch operation on them will simply move the object like using {{Button|[[Image:Draft Move.svg|16px]] [[Draft Move|Draft Move]]}}.


==Options== <!--T:5-->
<!--T:4-->
# Optionally select one or more objects. The objects must be [[Draft_Line|Draft Lines]], [[Draft_Wire|Draft Wires]], [[Draft_Rectangle|Draft Rectangles]], [[Draft_BSpline|Draft BSplines]] or [[Draft_BezCurve|Draft BezCurves]]. Other objects are ignored.
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after the first point to constrain the second point on the given axis.
# There are several ways to invoke the command:
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component.
#* Press the {{Button|[[Image:Draft_Stretch.svg|16px]] [[Draft_Stretch|Stretch]]}} button.
* 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).
#* Select the {{MenuCommand|Modification → [[Image:Draft_Stretch.svg|16px]] Stretch}} option from the menu.
* Press {{KEY|T}} or click the checkbox to toggle ''continue'' mode. If continue mode is on, the Stretch tool will restart after you give the final point, allowing you to repeat the operation without pressing the tool button again.
#* Use the keyboard shortcut: {{KEY|S}} then {{KEY|H}}.
* Hold {{KEY|Ctrl}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
* Hold {{KEY|Shift}} while drawing to [[Draft_Constrain|constrain]] your second point horizontally or vertically in relation to the first one.
# The {{MenuCommand|Stretch}} task panel opens. See [[#Options|Options]] for more information.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the current command.
# Pick the first point, one corner of a rectangular selection area, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.
# Pick the second point, the opposite corner of the selection area, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.
# The points of the selected objects that are inside the selection area are marked.
# Pick the third point, the base point, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.
# Pick the fourth point, the target point, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.


==Scripting== <!--T:6-->
==Options== <!--T:17-->

{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
<!--T:21-->
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.

<!--T:5-->
* To manually enter coordinates enter the X, Y and Z component, and press {{KEY|Enter}} after each. Or you can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button when you have the desired values. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
* Press {{KEY|R}} or click the {{MenuCommand|Relative}} checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point of the displacement are relative to the first point, else they are relative to the coordinate system origin.
* Press {{KEY|G}} or click the {{MenuCommand|Global}} checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the [[Draft_SelectPlane|working plane]] coordinate system. {{Version|0.20}}
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command.

==Scripting== <!--T:19-->

<!--T:6-->
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:9-->
<!--T:9-->
There is no Python method to stretch objects. To emulate the results of the Draft Stretch command geometric properties of objects have to be modified.
There is no programming interface available for the Stretch tool. All it does is change some attributes of the selected Draft objects, like {{incode|Placement}}, {{incode|Points}}, {{incode|Length}}, or {{incode|Height}}, which results in a stretched shape.


<!--T:10-->
When using the Stretch tool the [[Python|Python]] console shows the individual commands that were used to produce the stretching of the shape.


<!--T:11-->
<!--T:11-->
{{Docnav
{{Docnav
|[[Draft_Mirror|Mirror]]
|[[Draft_Trimex|Trimex]]
|[[Draft_Clone|Clone]]
|[[Draft_SelectPlane|Set working plane]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Mirror.svg
|IconL=Draft_Trimex.svg
|IconR=Draft_Clone.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_SelectPlane.svg
}}
}}


<!--T:13-->
{{Draft Tools navi}}

<!--T:14-->
{{Userdocnavi}}
</translate>
</translate>
{{Draft Tools navi{{#translation:}}}}
{{clear}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 18:42, 6 January 2024

Draft Stretch

Menu location
Modification → Stretch
Workbenches
Draft, Arch
Default shortcut
S H
Introduced in version
0.17
See also
None

Description

The Draft Stretch command stretches objects by moving selected points.

Stretching three Draft Wires

Usage

See also: Draft Snap and Draft Constrain.

  1. Optionally select one or more objects. The objects must be Draft Lines, Draft Wires, Draft Rectangles, Draft BSplines or Draft BezCurves. Other objects are ignored.
  2. There are several ways to invoke the command:
    • Press the Stretch button.
    • Select the Modification → Stretch option from the menu.
    • Use the keyboard shortcut: S then H.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. The Stretch task panel opens. See Options for more information.
  5. Pick the first point, one corner of a rectangular selection area, in the 3D view, or type coordinates and press the Enter point button.
  6. Pick the second point, the opposite corner of the selection area, in the 3D view, or type coordinates and press the Enter point button.
  7. The points of the selected objects that are inside the selection area are marked.
  8. Pick the third point, the base point, in the 3D view, or type coordinates and press the Enter point button.
  9. Pick the fourth point, the target point, in the 3D view, or type coordinates and press the Enter point button.

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.

  • To manually enter coordinates enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press R or click the Relative checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point of the displacement are relative to the first point, else they are relative to the coordinate system origin.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • Press S to switch Draft snapping on or off.
  • Press Esc or the Close button to abort the command.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

There is no Python method to stretch objects. To emulate the results of the Draft Stretch command geometric properties of objects have to be modified.