Draft SelectPlane/cs: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
{{Docnav
|[[Draft_Shape2DView|Shape2DView]]
|[[Draft_Stretch|Stretch]]
|[[Draft_SetStyle|SetStyle]]
|[[Draft_FinishLine|Finish line]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Stretch.svg
|IconL=Draft_Shape2DView.svg
|IconR=Draft_FinishLine.svg
|IconR=Draft_SetStyle.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 25: Line 26:


[[Image:WorkingPlane_example.png|400px]]
[[Image:WorkingPlane_example.png|400px]]
{{Caption|Different working planes can be set on which to draw shapes}}
{{Caption|Shapes created on different working planes}}


==Usage with pre-selection==
<div class="mw-translate-fuzzy">
==Použití==
# Stiskněte tlačítko {{KEY|[[Image:Draft SelectPlane.png|16px]] [[Draft SelectPlane/cs|VýběrRoviny]]}}. Pokud tlačítko nevypadá takto, podívejte se na tuto [[Basic_modeling_tutorial#DraftPlaneButton/cs|poznámku]].
</div>

The {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|SelectPlane]]}} button is present in the [[Draft_Tray|Draft Tray]] toolbar, which only appears in the [[Draft_Module|Draft]] and [[Arch_Module|Arch]] workbenches.

=== Without element selected ===

# Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|SelectPlane]]}} button, or use {{KEY|Draft}} → {{KEY|Utilities}} → {{KEY|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|SelectPlane]]}} from the top menu, or the keyboard shortcut {{KEY|W}} then {{KEY|P}}
# Select the offset, the grid spacing, and the main lines
# Select one of the presets: {{Button|[[Image:View-top.svg|16px]] XY (top)}}, {{Button|[[Image:View-front.svg|16px]] XZ (front)}}, {{Button|[[Image:View-right.svg|16px]] YZ (side)}}, {{Button|[[Image:View-isometric.svg|16px]] View}}, or {{Button|[[Image:View-axonometric.svg|16px]] Auto}}.


# Do one of the following:
Once the plane is set, the button will change to indicate the active plane {{Button|[[Image:Draft_SelectPlane.svg|16px]] Top}}, {{Button|[[Image:Draft_SelectPlane.svg|16px]] Front}}, {{Button|[[Image:Draft_SelectPlane.svg|16px]] Side}}, {{Button|[[Image:Draft_SelectPlane.svg|16px]] Auto}}, {{Button|[[Image:Draft_SelectPlane.svg|16px]] d(0.0,-1.0,0.0)}}.
#* 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 WP 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==
You can show and hide the grid with the shortcut {{KEY|G}} {{KEY|R}}.


# There are several ways to invoke the command:
=== With element selected ===
#* 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==
# Select a face of an existing object in the [[3D view]], or hold {{KEY|Ctrl}} and select three vertices of any object. {{Version|0.17}}
# Press the {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|SelectPlane]]}} button, or right click and select {{MenuCommand|Utilities → [[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|SelectPlane]]}}.


# There are several ways to invoke the command:
The plane will be created aligned to the face of the object, or to the plane defined by the three vertices.
#* 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==
==Options==
Line 60: Line 84:
* Múžete také specifikovat hodnotu odsunutí, což odsune pracovní rovinu o zadanou vzdálenost od vybrané roviny.
* Múžete také specifikovat hodnotu odsunutí, což odsune pracovní rovinu o zadanou vzdálenost od vybrané roviny.
</div>
</div>

==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==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 65: Line 105:
Objekt pracovní roviny může být snadno vyvořen a manipulován ve skriptech a [[macros/cs|makrech]]. Můžete vytvářet vlastní a používat je nezávisle na aktuální pracovní ploše Kreslení.
Objekt pracovní roviny může být snadno vyvořen a manipulován ve skriptech a [[macros/cs|makrech]]. Můžete vytvářet vlastní a používat je nezávisle na aktuální pracovní ploše Kreslení.
</div>
</div>

Working plane objects can easily be created and manipulated in [[macros|macros]] and from the [[Python|Python]] console.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 73: Line 111:


{{Code|code=
{{Code|code=
# This code only works if the Draft Workbench is active!

import FreeCAD as App
import FreeCAD as App
import FreeCADGui as Gui
import FreeCADGui as Gui

doc = App.newDocument()


workplane = App.DraftWorkingPlane
workplane = App.DraftWorkingPlane
Line 85: Line 127:
Gui.Snapper.toggleGrid()
Gui.Snapper.toggleGrid()
}}
}}

A Draft command must be issued after changing the working plane to update the visible grid, for example, [[Draft_Line|Line]], or just [[Draft_ToggleGrid|ToggleGrid]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 105: Line 145:
}}
}}


To display a new grid use a new tracker object. First set up the normal working plane as you need, then create a new tracker object, then set it to the current plane, and then you can turn it on or off.
{{Code|code=
import FreeCAD as App
import DraftTrackers

App.DraftWorkingPlane.alignToPointAndAxis(App.Vector(0, 0, 0),
App.Vector(1, 0, 0),
0)

my_grid = DraftTrackers.gridTracker()
my_grid.set()
my_grid.on()
my_grid.off()
}}

This grid is merely a visual aid and doesn't allow snapping.

To have the possibility of switching quickly to different grids, in different positions, you should create a {{Button|[[File:Draft_WorkingPlaneProxy.svg|16px]] [[Draft_WorkingPlaneProxy|Working plane proxy]]}}.


{{Docnav
{{Docnav
|[[Draft_Shape2DView|Shape2DView]]
|[[Draft_Stretch|Stretch]]
|[[Draft_SetStyle|SetStyle]]
|[[Draft_FinishLine|Finish line]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Stretch.svg
|IconL=Draft_Shape2DView.svg
|IconR=Draft_FinishLine.svg
|IconR=Draft_SetStyle.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 135: Line 157:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 12:11, 3 August 2021

Kreslení VýběrRoviny

Umístění Menu
Kreslení -> Utility -> Výběr roviny
Pracovní stoly
Kreslení, Architektura
Výchozí zástupce
Nikdo
Představen ve verzi
-
Viz také
Nikdo

Description

Popis

Modul kreslení má pracovní rovinu, která umožňuje specifikovat uživatelskou rovinu ve 3D, na které se bude realizovat následujíci kreslicí příkaz. Pro definování pracovní roviny existuje několik metod:

  • Z vybrané plochy
  • Z aktuálního pohledu
  • Z předvolby: horní, přední nebo boční
  • Žádná, v tomto případě je pracovní rovina automaticky adaptována podle aktuálního pohledu, kde spouštíte příkaz nebo na ploše, pokud začínáte kreslení na existující ploše.

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

Volby

  • Pro nastavení pracovní roviny na existující plochu: vyberte existující objekt ve 3D pohledu a potom stiskněte tlačítko VýběrRoviny
  • Stisknutí tlačítka POHLED nastaví pracovní rovinu jako je rovina pohledu, kolmo k osám kamery a procházející počátkem (0,0,0).
  • Stisknutí tlačítka ŽÁDNÁ zruší nastavení aktuální pracovní roviny. Následující 2D operace budou závislé na pohledu.
  • Múžete také specifikovat hodnotu odsunutí, což odsune pracovní rovinu o zadanou vzdálenost od vybrané roviny.

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

Skriptování

Objekt pracovní roviny může být snadno vyvořen a manipulován ve skriptech a makrech. Můžete vytvářet vlastní a používat je nezávisle na aktuální pracovní ploše Kreslení.

Můžete také přistupovat na aktuální pracovní rovinu Kreslení:

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

import FreeCAD as App
import FreeCADGui as Gui

doc = App.newDocument()

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()

Příklad:

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)