Draft SelectPlane/sv: Difference between revisions

From FreeCAD Documentation
(new image)
(Updating to match new version of source page)
Line 4: Line 4:
</div>
</div>


<div class="mw-translate-fuzzy">
====Beskrivning====
====Beskrivning====


Detta verktyg väntar på att användaren ska markera en existerande yta i 3D vyn eller att välja ett av de förinställda planen. Arbetsplanet kommer då att ställas in till det planet, och alla efterföljande 2D operationer kommer endast att hända på detta plan.
Detta verktyg väntar på att användaren ska markera en existerande yta i 3D vyn eller att välja ett av de förinställda planen. Arbetsplanet kommer då att ställas in till det planet, och alla efterföljande 2D operationer kommer endast att hända på detta plan.
</div>


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


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 19: Line 22:
* Du kan också specificera ett offsetvärde, vilket kommer att ställa in ditt arbetsplan till ett visst avstånd från det plan som du väljer.
* Du kan också specificera ett offsetvärde, vilket kommer att ställa in ditt arbetsplan till ett visst avstånd från det plan som du väljer.
</div>
</div>

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

=== Without element selected ===

# Press the {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft SelectPlane|SelectPlane]]}} button.
# 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}}.

Once the plane is set, the button will change to indicate the active plane {{Button|[[Image:Draft SelectPlane.png|16px]] Top}}, {{Button|[[Image:Draft SelectPlane.svg|16px]] Front}}, {{Button|[[Image:Draft SelectPlane.svg|16px]] Side}}, {{Button|[[Image:Draft SelectPlane.png|16px]] Auto}}, {{Button|[[Image:Draft SelectPlane.svg|16px]] d(0.0,-1.0,0.0)}}.

You can show and hide the grid with the shortcut {{KEY|G}} {{KEY|R}}.

=== With element selected ===

# 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]]}}.

The plane will be created aligned to the face of the object, or to the plane defined by the three vertices.


==Options==
==Options==
* Press the {{Button|[[Image:View-top.svg|16px]] XY (top)}} button to set the working plane on the XY plane. To easily draw on this plane, you should set the view to the top or bottom (the normal is in the positive or negative Z direction). Press {{KEY|2}} or {{KEY|5}} to quickly switch to these views.
* To set the workplane to existing geometry: select a face of an existing object in the 3D view, or, {{Version|0.17}}, with CTRL pressed, 3 vertices on any object(s). Then press the {{KEY|[[Image:Draft SelectPlane.png|16px]] [[Draft SelectPlane|SelectPlane]]}} button
* 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.
* Press the {{Button|[[Image:View-front.svg|16px]] XZ (front)}} button to set the working plane on the XZ plane. To easily draw on this plane, you should set the view to the front or rear (the normal is in the negative or positive Y direction). Press {{KEY|1}} or {{KEY|4}} to quickly switch to these views.
* Press the {{Button|[[Image:View-right.svg|16px]] YZ (side)}} button to set the working plane on the YZ plane. To easily draw on this plane, you should set the view to the left or right side (the normal is in the positive or negative X direction). Press {{KEY|3}} or {{KEY|6}} to quickly switch to these views.
* Pressing the {{KEY|'''AUTO'''}} will unset any current working plane. The next 2D operations will be view-dependent.
* Press the {{Button|[[Image:View-isometric.svg|16px]] View}} button to set the working plane to the current 3D view, perpendicular to the camera axis and passing through the origin (0,0,0).
* You can also specify an offset value, which will set your working plane at a certain distance from the plane you select.
* Press the {{Button|[[Image:View-axonometric.svg|16px]] Auto}} button to unset any current working plane, and automatically set a working plane when a tool is used. When a drawing tool is selected the grid will be automatically updated to the current view; then, if the view is rotated, and another tool is selected, the grid redraws in the new view. This is equivalent of pressing {{Button|[[Image:View-isometric.svg|16px]] View}} automatically before using a tool.
* You can hide and show the grid with the shortcut {{KEY|'''G'''}}{{KEY|'''R'''}}
* Set the "Offset" value to set the working plane at a certain perpendicular distance from the plane you selected.
* Set the "Grid spacing" value to define the space between each line in the grid.
* Set the "Main line every" value to draw a slightly thicker line in the grid at the set value. For example, if the grid spacing is 0.5 m, and there is a main line every 20 lines, there will be slightly thicker line every 10 m.
* Click on the "Center plane on view" checkbox to draw the plane and grid closer to the camera view in the 3D view.
* Press {{KEY|Esc}} or the {{button|Close}} button to abort the current command.


==Scripting==
==Scripting==
{{emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]]. See the [http://www.freecadweb.org/api/DraftWorkingPlane.html WorkingPlane API].
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.


Working plane objects can easily be created and manipulated in [[macros]] and from the [[Python]] console.
Example:
{{Code|code=
import WorkingPlane
myPlane = WorkingPlane.plane()
}}


You can also access the current Draft working plane:
You can access the current Draft working plane, and apply transformations to it:
{{Code|code=
{{Code|code=
import FreeCAD
import FreeCAD

draftPlane = FreeCAD.DraftWorkingPlane
Workplane = FreeCAD.DraftWorkingPlane

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

Workplane.alignToPointAndAxis(v1, v2, 17)
}}
}}


A Draft command must be issued after changing the working plane to update the visible grid.
To move or rotate the Draft working plane (see the [http://www.freecadweb.org/api/DraftWorkingPlane.html WorkingPlane API] page for available methods):

You can create your own planes, and use them independently of the current working plane.
{{Code|code=
{{Code|code=
import FreeCAD
import WorkingPlane
from FreeCAD import Vector
FreeCAD.DraftWorkingPlane.alignToPointAndAxis(Vector(0,0,0), Vector(1,1,1).normalize(), 17)
}}
(note: a Draft command must have been issued to make grid adopt changes)


Plane = WorkingPlane.plane()
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.
}}


{{Draft Tools navi}}
{{Userdocnavi}}
{{clear}}
{{clear}}

Revision as of 20:55, 15 December 2018

Draft_Workingplane

Menyplacering
Drafting → SelectPlane
Arbetsbänkar
Skiss
Standard genväg
Ingen
Introducerad i version
-
Se även
Ingen

Beskrivning

Detta verktyg väntar på att användaren ska markera en existerande yta i 3D vyn eller att välja ett av de förinställda planen. Arbetsplanet kommer då att ställas in till det planet, och alla efterföljande 2D operationer kommer endast att hända på detta plan.

Different working planes can be set on which to draw shapes

Bruk

  • Välj en yta på ett existerande objekt i 3D vyn
  • Alternativt, klicka på en av förvalsknapparna: XY (topp plan), XZ (fram plan) eller YZ (sido plan)
  • Om du klickar på VIEW knappen så kommer arbetsplanet att bli samma som vyplanet, vinkelrätt till kameraaxeln och passerande genom origopunkten (0,0,0)
  • Om du klickar på NONE så kommer arbetsplanet att tas bort. Nästa 2D operationer kommer att bli vyberoende.
  • Du kan också specificera ett offsetvärde, vilket kommer att ställa in ditt arbetsplan till ett visst avstånd från det plan som du väljer.

The SelectPlane button is present in the Draft Tray toolbar, which only appears in the Draft and Arch Workbenches.

Without element selected

  1. Press the SelectPlane button.
  2. Select the offset, the grid spacing, and the main lines
  3. Select one of the presets: XY (top), XZ (front), YZ (side), View, or Auto.

Once the plane is set, the button will change to indicate the active plane Top, Front, Side, Auto, d(0.0,-1.0,0.0).

You can show and hide the grid with the shortcut G R.

With element selected

  1. Select a face of an existing object in the 3D view, or hold Ctrl and select three vertices of any object. introduced in version 0.17
  2. Press the SelectPlane button, or right click and select Utilities → SelectPlane.

The plane will be created aligned to the face of the object, or to the plane defined by the three vertices.

Options

  • Press the XY (top) button to set the working plane on the XY plane. To easily draw on this plane, you should set the view to the top or bottom (the normal is in the positive or negative Z direction). Press 2 or 5 to quickly switch to these views.
  • Press the XZ (front) button to set the working plane on the XZ plane. To easily draw on this plane, you should set the view to the front or rear (the normal is in the negative or positive Y direction). Press 1 or 4 to quickly switch to these views.
  • Press the YZ (side) button to set the working plane on the YZ plane. To easily draw on this plane, you should set the view to the left or right side (the normal is in the positive or negative X direction). Press 3 or 6 to quickly switch to these views.
  • Press the View button to set the working plane to the current 3D view, perpendicular to the camera axis and passing through the origin (0,0,0).
  • Press the Auto button to unset any current working plane, and automatically set a working plane when a tool is used. When a drawing tool is selected the grid will be automatically updated to the current view; then, if the view is rotated, and another tool is selected, the grid redraws in the new view. This is equivalent of pressing View automatically before using a tool.
  • Set the "Offset" value to set the working plane at a certain perpendicular distance from the plane you selected.
  • Set the "Grid spacing" value to define the space between each line in the grid.
  • Set the "Main line every" value to draw a slightly thicker line in the grid at the set value. For example, if the grid spacing is 0.5 m, and there is a main line every 20 lines, there will be slightly thicker line every 10 m.
  • Click on the "Center plane on view" checkbox to draw the plane and grid closer to the camera view in the 3D view.
  • Press Esc or the Close button to abort the current command.

Scripting

See also: Draft API and FreeCAD Scripting Basics. See the WorkingPlane API.

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

You can access the current Draft working plane, and apply transformations to it:

import FreeCAD

Workplane = FreeCAD.DraftWorkingPlane

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

Workplane.alignToPointAndAxis(v1, v2, 17)

A Draft command must be issued after changing the working plane to update the visible grid.

You can create your own planes, and use them independently of the current working plane.

import WorkingPlane

Plane = WorkingPlane.plane()