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 26: Line 26:


{{Version|0.22}}: For each 3D view a separate working plane is stored.
{{Version|0.22}}: For each 3D view a separate working plane is stored.

The {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]] changes depending on the current working plane. {{Version|0.22}}: If the working plane is not set to {{MenuCommand|Auto}} an asterisk ({{MenuCommand|*}}) is appended to the button label if the origin of the working plane does not match the global origin.


[[Image:WorkingPlane_example.png|400px]]
[[Image:WorkingPlane_example.png|400px]]
Line 48: Line 50:
#** An edge and a vertex, or two edges. The combined vertices must define a plane. ({{Version|0.22}})
#** An edge and a vertex, or two edges. The combined vertices must define a plane. ({{Version|0.22}})
# There are several ways to invoke the command:
# 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.
#* Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]].
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
Line 56: Line 58:


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


# There are several ways to invoke the command:
# 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.
#* Press the {{Button|[[Image:Draft_SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button in the [[Draft_Tray|Draft Tray]].
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_SelectPlane.svg|16px]] Select Plane}} option from the menu.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
#* Use the keyboard shortcut: {{KEY|W}} then {{KEY|P}}.
Line 99: Line 99:


* 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}}.
* 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}}.
* 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}}.


Line 109: Line 108:
</div>
</div>


{{Version|0.22}}:
<div class="mw-translate-fuzzy">

Můžete také přistupovat na aktuální pracovní rovinu Kreslení:
The WorkingPlane module offers two classes to create working plane objects: the {{incode|PlaneBase}} class and the {{incode|PlaneGui}} class. The second class inherits from the first. Objects of the {{incode|PlaneGui}} class interact with the GUI (the [[Draft_Tray|Draft Tray]] button), the [[3D_view|3D view]] and the [[Draft_Snap_Grid|grid]]. {{incode|PlaneBase}} objects do not.
</div>

Use the {{incode|get_working_plane()}} method of the WorkingPlane module to get an instance of the {{incode|PlaneGui}} class linked to the current 3D view. The method either returns the existing working plane linked to the view or creates a new working plane if required.


{{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 WorkingPlane


wp = WorkingPlane.get_working_plane()
workplane = App.DraftWorkingPlane


v1 = App.Vector(0, 0, 0)
origin = App.Vector(0, 0, 0)
v2 = App.Vector(1, 1, 1).normalize()
normal = App.Vector(1, 1, 1).normalize()
offset = 17
wp.align_to_point_and_axis(origin, normal, offset)


point = App.Vector(10, 15, 2)
workplane.alignToPointAndAxis(v1, v2, 17)
projection = wp.project_point(point)
Gui.Snapper.toggleGrid()
print(projection)
Gui.Snapper.toggleGrid()
}}
}}


The {{incode|PlaneBase}} class can be used to create working planes independent of the GUI:
<div class="mw-translate-fuzzy">
Příklad:
</div>


{{Code|code=
{{Code|code=
import WorkingPlane
import WorkingPlane


my_plane = WorkingPlane.plane()
wp = WorkingPlane.PlaneBase()

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



Revision as of 21:44, 11 November 2023

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.

introduced in version 0.22: For each 3D view a separate working plane is stored.

The Draft SelectPlane button in the Draft Tray changes depending on the current working plane. introduced in version 0.22: If the working plane is not set to Auto an asterisk (*) is appended to the button label if the origin of the working plane does not match the global origin.

Shapes created on different working planes

Usage with pre-selection

  1. Do one of the following:
  2. There are several ways to invoke the command:
    • Press the Draft SelectPlane button in the Draft Tray.
    • 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.
    • 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:
  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.
    • 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.
  • 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í.

introduced in version 0.22:

The WorkingPlane module offers two classes to create working plane objects: the PlaneBase class and the PlaneGui class. The second class inherits from the first. Objects of the PlaneGui class interact with the GUI (the Draft Tray button), the 3D view and the grid. PlaneBase objects do not.

Use the get_working_plane() method of the WorkingPlane module to get an instance of the PlaneGui class linked to the current 3D view. The method either returns the existing working plane linked to the view or creates a new working plane if required.

import FreeCAD as App
import WorkingPlane

wp = WorkingPlane.get_working_plane()

origin = App.Vector(0, 0, 0)
normal = App.Vector(1, 1, 1).normalize()
offset = 17
wp.align_to_point_and_axis(origin, normal, offset)

point = App.Vector(10, 15, 2)
projection = wp.project_point(point)
print(projection)

The PlaneBase class can be used to create working planes independent of the GUI:

import WorkingPlane

wp = WorkingPlane.PlaneBase()