Draft SelectPlane/tr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand/tr|Name=Draft SelectPlane|Name/tr=Draft SelectPlane|Workbenches=[[Draft Module/tr|Draft]], [[Arch Module/tr|Arch]]|MenuLocation=Draft -> Utilities -> Select Plane}}


{{Docnav
==Description==
|[[Draft_Shape2DView|Shape2DView]]
The Draft module features a working plane system, that allows you to specify a custom plane in the 3D space on which next Draft command will occur. There are several methods to define the working plane:
|[[Draft_SetStyle|SetStyle]]
* From a selected face
|[[Draft_Workbench|Draft]]
* From the current view
|IconL=Draft_Shape2DView.svg
* From a preset: top, frontal or lateral
|IconR=Draft_SetStyle.svg
* None, in which case the working plane is adapted automatically to the current view when you start a command, or to a face if you start drawing on an existing face.
|IconC=Workbench_Draft.svg
}}


<div class="mw-translate-fuzzy">
[[Image:Workingplane_example.jpg|400px]]
{{GuiCommand/tr
|Name=Draft SelectPlane
|Name/tr=Çalışma düzlemini ayarla
|MenuLocation=Draft → Utilities → Select Plane
|Workbenches=[[Draft_Workbench/tr|Draft]], [[Arch_Workbench/tr|Arch]]
}}
</div>


==How to use==
==Description==
# Press the {{KEY|[[Image:Draft SelectPlane.png|16px]] [[Draft SelectPlane|SelectPlane]]}} button. If your button doesn't look like this, see this [[Basic_modeling_tutorial#DraftPlaneButton|note]].


The [[Image:Draft_SelectPlane.svg|24px]] '''Draft SelectPlane''' command selects the current Draft working plane. This is the plane in the [[3D_view|3D view]] where new [[Draft_Workbench|Draft]] objects are created. A new working plane can be based on one of several [[#Usage_with_presets|presets]] or on a selection. The selection can be created before ([[#Usage_with_pre-selection|pre-selection]]) or after ([[#Usage_with_post-selection|post-selection]]) starting the command.
==Options==

* To set the workplane to an existing face: select a face of an existing object in the 3D view, then press the {{KEY|[[Image:Draft SelectPlane.png|16px]] [[Draft SelectPlane|SelectPlane]]}} button
[[Image:WorkingPlane_example.png|400px]]
* Pressing the {{KEY|'''VIEW'''}} button will set the working plane as the view plane, perpendicular to the camera axis and passing through the (0,0,0) origin point.
{{Caption|Shapes created on different working planes}}
* Pressing the {{KEY|'''NONE'''}} will unset any current working plane. The next 2D operations will be view-dependent.

* You can also specify an offset value, which will set your working plane at a certain distance from the plane you select.
==Usage with pre-selection==

# Do one of the following:
#* Select a single object. The following objects are supported:
#** [[Draft_WorkingPlaneProxy|Draft WorkingPlaneProxies]]: the {{PropertyView|View Data}} (the camera position) and the {{PropertyView|Visibility Map}} (the saved visibility of objects) of the working plane proxy are also restored.
#** [[Arch_BuildingPart|Arch BuildingParts]].
#** [[Arch_SectionPlane|Arch SectionPlanes]].
#** [[Std_Part|Std Parts]]: to avoid selecting subelements it is advisable to select these in the [[Tree_view|Tree view]].
#** [[Part_Feature|Part Feature]] objects that have a single face. [[Part_Plane|Part Planes]] for example.
#** Objects that are not [[Part_Feature|Part Feature]] objects and have a {{PropertyData|Placement}} property.
#* Select one or more subelements. You can select:
#** A flat face.
#** Three vertices.
#** A circular edge.
#** Two straight edges that are co-planar but not co-linear.
#** A straight edge and a vertex that does not lie on the (extended) edge.
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]]. Depending on the current working plane this button can look different.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
# The working plane and the button in the [[Draft_Tray|Draft Tray]] are updated.

==Usage with post-selection==

# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]]. Depending on the current working plane this button can look different.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
# The {{MenuCommand|Working plane setup}} task panel opens. See [[#Options|Options]] for more information.
# Do one of the following:
#* Select a single object. See the [[#Usage_with_pre-selection|previous paragraph]] for the supported objects.
#* Select one or more subelements. You can select:
#** A flat face.
#** Three vertices.
# Click anywhere in the [[3D_view|3D view]] to confirm the selection and finish the command.
# The working plane and the button in the [[Draft_Tray|Draft Tray]] are updated.

==Usage with presets==

# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]]. Depending on the current working plane this button can look different.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
# The {{MenuCommand|Working plane setup}} task panel opens. See [[#Options|Options]] for more information.
# Press any of the buttons to finish the command.
# The working plane and the button in the [[Draft_Tray|Draft Tray]] are updated.

==Options==

* Press the {{Button|[[Image:View-top.svg|16px]] Top (XY)}} button to align the working plane with the XY plane of the global coordinate system.
* Press the {{Button|[[Image:View-front.svg|16px]] Front (XZ)}} button to align the working plane with the XZ plane of the global coordinate system.
* Press the {{Button|[[Image:View-right.svg|16px]] Side (YZ)}} button to align the working plane with the YZ plane of the global coordinate system.
* Press the {{Button|[[Image:View-isometric.svg|16px]] Align to view}} button to align the working plane with the current [[3D_view|3D view]]. If the {{MenuCommand|Center plane on view}} checkbox is unchecked the working plane origin will match the origin of the global coordinate system, else it will match the center of the current [[3D_view|3D view]].
* Press the {{Button|[[Image:View-axonometric.svg|16px]] Automatic}} button to automatically align the working plane with the current [[3D_view|3D view]] whenever a Draft or [[Arch_Workbench|Arch]] command requiring point input is started. This is equivalent to pressing the {{Button|[[Image:View-isometric.svg|16px]] Align to view}} button before using the command.
* The {{MenuCommand|Offset}} defines the perpendicular distance between the calculated plane and the actual working plane.
* Check the {{MenuCommand|Center plane on view}} checkbox to put the origin of the working plane in the center of to the current [[3D_view|3D view]]. This option really only makes sense if the {{Button|[[Image:View-isometric.svg|16px]] Align to view}} button is used.
* Select a vertex in the [[3D_view|3D view]] and press the {{Button|[[Image:Draft_Move.svg|16px]] Move working plane}} button to move the working plane so that its origin matches the position of the selected vertex.
* The {{MenuCommand|Grid spacing}} defines the distance between grid lines.
* The {{MenuCommand|Main line every}} value determines where main grid lines are drawn. Main grid lines are slightly thicker than normal grid lines. For example if the grid spacing is {{Value|0.5 m}} and there is a main line every {{Value|10 lines}}, such a line will occur every {{Value|5 m}}.
* The {{MenuCommand|Grid extension}} value determines the number of grid lines in the X and Y direction of the grid.
* The {{MenuCommand|Snapping radius}} is the maximum distance at which [[Draft_Snap_Grid|Draft Snap Grid]] detects the intersections of grid lines.
* Press the {{Button|[[Image:view-fullscreen.svg|16px]] Center view}} button to use the origin of the current working plane as the center of the [[3D_view|3D view]].
* Press the {{Button|[[Image:edit-undo.svg|16px]] Previous}} button to reset the working plane to its previous position.
* Press {{KEY|Esc}} or the {{button|Close}} button to abort the command.

==Notes==

* It can be useful to align the [[3D_view|3D view]] with the selected Draft working plane. For example after switching the working plane to Front you may want to switch to the [[Std_ViewFront|Front view]] as well.
* The grid can be toggled with the [[Draft_ToggleGrid|Draft ToggleGrid]] command.
* By double-clicking [[Draft_WorkingPlaneProxy|Draft WorkingPlaneProxies]] in the [[Tree_view|Tree view]] you can quickly switch between working planes.

==Preferences==

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

* The grid settings in the task panel as well as several other grid settings are available as preferences: {{MenuCommand|Edit → Preferences... → Draft → Grid and snapping → Grid}}.
* To use the grid the {{MenuCommand|Edit → Preferences... → Draft → Grid and snapping → Grid → Use grid}} option must be selected. After changing this preference you must restart FreeCAD.
* The Snapping radius can also be changed on-the-fly (see [[Draft_Snap#Preferences|Draft Snap]]) or by changing: {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → Mod → Draft → snapRange}}.


==Scripting==
==Scripting==
Working plane objects can easily be created and manipulated in scripts and [[macros]]. You can create your own, and use them independently of the current Draft working plane.


See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
Example:
<syntaxhighlight>
import WorkingPlane
myPlane = WorkingPlane.plane()
</syntaxhighlight>


If the [[Draft_Workbench|Draft Workbench]] is active the FreeCAD application object has a {{incode|DraftWorkingPlane}} property which stores the current Draft working plane. You can access this property and apply transformations to it:
You can also access the current Draft working plane:
<syntaxhighlight>
import FreeCAD
draftPlane = FreeCAD.DraftWorkingPlane
</syntaxhighlight>


{{Code|code=
To move or rotate the Draft working plane (see the [http://www.freecadweb.org/api/DraftWorkingPlane.html WorkingPlane API] page for available methods):
# This code only works if the Draft Workbench is active!
<syntaxhighlight>
import FreeCAD
from FreeCAD import Vector
FreeCAD.DraftWorkingPlane.alignToPointAndAxis(Vector(0,0,0), Vector(1,1,1).normalize(), 17)
</syntaxhighlight>
(note: a Draft command must have been issued to make grid adopt changes)


import FreeCAD as App
The working plane has a complete [http://www.freecadweb.org/api/DraftWorkingPlane.html scripting API] on its own, with convenience functions to position it and convert to/from placements.
import FreeCADGui as Gui


workplane = App.DraftWorkingPlane
{{clear}}

<languages/>
v1 = App.Vector(0, 0, 0)
v2 = App.Vector(1, 1, 1).normalize()

workplane.alignToPointAndAxis(v1, v2, 17)
Gui.Snapper.toggleGrid()
Gui.Snapper.toggleGrid()
}}

It is also possible to create planes independently of the Draft working plane. This can be useful for calculations and projections:

{{Code|code=
import WorkingPlane

my_plane = WorkingPlane.plane()

v1 = App.Vector(0, 0, 0)
v2 = App.Vector(1, 1, 1).normalize()
my_plane.alignToPointAndAxis(v1, v2, 17)

projection = my_plane.projectPoint(App.Vector(10, 15, 2))
print(projection)
}}


{{Docnav
|[[Draft_Shape2DView|Shape2DView]]
|[[Draft_SetStyle|SetStyle]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Shape2DView.svg
|IconR=Draft_SetStyle.svg
|IconC=Workbench_Draft.svg
}}

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

Revision as of 19:03, 4 September 2021

Çalışma düzlemini ayarla

Menü konumu
Draft → Utilities → Select Plane
Tezgahlar
Draft, Arch
Varsayılan kısayol
Hiçbiri
Versiyonda tanıtıldı
-
Ayrıca bkz
Hiçbiri

Description

The Draft SelectPlane command selects the current Draft working plane. This is the plane in the 3D view where new Draft objects are created. A new working plane can be based on one of several presets or on a selection. The selection can be created before (pre-selection) or after (post-selection) starting the command.

Shapes created on different working planes

Usage with pre-selection

  1. Do one of the following:
    • Select a single object. The following objects are supported:
    • Select one or more subelements. You can select:
      • A flat face.
      • Three vertices.
      • A circular edge.
      • Two straight edges that are co-planar but not co-linear.
      • A straight edge and a vertex that does not lie on the (extended) edge.
  2. There are several ways to invoke the command:
    • Press the Draft SelectPlane button in the Draft Tray. Depending on the current working plane this button can look different.
    • Select the Utilities → Select Plane option from the menu.
    • Use the keyboard shortcut: W then P.
  3. The working plane and the button in the Draft Tray are updated.

Usage with post-selection

  1. There are several ways to invoke the command:
    • Press the Draft SelectPlane button in the Draft Tray. Depending on the current working plane this button can look different.
    • Select the Utilities → Select Plane option from the menu.
    • Use the keyboard shortcut: W then P.
  2. The Working plane setup task panel opens. See Options for more information.
  3. Do one of the following:
    • Select a single object. See the previous paragraph for the supported objects.
    • Select one or more subelements. You can select:
      • A flat face.
      • Three vertices.
  4. Click anywhere in the 3D view to confirm the selection and finish the command.
  5. The working plane and the button in the Draft Tray are updated.

Usage with presets

  1. There are several ways to invoke the command:
    • Press the Draft SelectPlane button in the Draft Tray. Depending on the current working plane this button can look different.
    • Select the Utilities → Select Plane option from the menu.
    • Use the keyboard shortcut: W then P.
  2. The Working plane setup task panel opens. See Options for more information.
  3. Press any of the buttons to finish the command.
  4. The working plane and the button in the Draft Tray are updated.

Options

  • Press the Top (XY) button to align the working plane with the XY plane of the global coordinate system.
  • Press the Front (XZ) button to align the working plane with the XZ plane of the global coordinate system.
  • Press the Side (YZ) button to align the working plane with the YZ plane of the global coordinate system.
  • Press the Align to view button to align the working plane with the current 3D view. If the Center plane on view checkbox is unchecked the working plane origin will match the origin of the global coordinate system, else it will match the center of the current 3D view.
  • Press the Automatic button to automatically align the working plane with the current 3D view whenever a Draft or Arch command requiring point input is started. This is equivalent to pressing the Align to view button before using the command.
  • The Offset defines the perpendicular distance between the calculated plane and the actual working plane.
  • Check the Center plane on view checkbox to put the origin of the working plane in the center of to the current 3D view. This option really only makes sense if the Align to view button is used.
  • Select a vertex in the 3D view and press the Move working plane button to move the working plane so that its origin matches the position of the selected vertex.
  • The Grid spacing defines the distance between grid lines.
  • The Main line every value determines where main grid lines are drawn. Main grid lines are slightly thicker than normal grid lines. For example if the grid spacing is 0.5 m and there is a main line every 10 lines, such a line will occur every 5 m.
  • The Grid extension value determines the number of grid lines in the X and Y direction of the grid.
  • The Snapping radius is the maximum distance at which Draft Snap Grid detects the intersections of grid lines.
  • Press the Center view button to use the origin of the current working plane as the center of the 3D view.
  • Press the Previous button to reset the working plane to its previous position.
  • Press Esc or the Close button to abort the command.

Notes

  • It can be useful to align the 3D view with the selected Draft working plane. For example after switching the working plane to Front you may want to switch to the Front view as well.
  • The grid can be toggled with the Draft ToggleGrid command.
  • By double-clicking Draft WorkingPlaneProxies in the Tree view you can quickly switch between working planes.

Preferences

See also: Preferences Editor and Draft Preferences.

  • The grid settings in the task panel as well as several other grid settings are available as preferences: Edit → Preferences... → Draft → Grid and snapping → Grid.
  • To use the grid the Edit → Preferences... → Draft → Grid and snapping → Grid → Use grid option must be selected. After changing this preference you must restart FreeCAD.
  • The Snapping radius can also be changed on-the-fly (see Draft Snap) or by changing: Tools → Edit parameters... → BaseApp → Preferences → Mod → Draft → snapRange.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

If the Draft Workbench is active the FreeCAD application object has a DraftWorkingPlane property which stores the current Draft working plane. You can access this property and apply transformations to it:

# This code only works if the Draft Workbench is active!

import FreeCAD as App
import FreeCADGui as Gui

workplane = App.DraftWorkingPlane

v1 = App.Vector(0, 0, 0)
v2 = App.Vector(1, 1, 1).normalize()

workplane.alignToPointAndAxis(v1, v2, 17)
Gui.Snapper.toggleGrid()
Gui.Snapper.toggleGrid()

It is also possible to create planes independently of the Draft working plane. This can be useful for calculations and projections:

import WorkingPlane

my_plane = WorkingPlane.plane()

v1 = App.Vector(0, 0, 0)
v2 = App.Vector(1, 1, 1).normalize()
my_plane.alignToPointAndAxis(v1, v2, 17)

projection = my_plane.projectPoint(App.Vector(10, 15, 2))
print(projection)