Draft Workbench/sv

Introduction
Rit modulen är ett pågående arbete och är en ganska experimentell modul som har gjorts för att lägga till grundläggande 2d ritfunktionalitet till FreeCAD. Den är helt och hållet skriven i python, och är även tänkt att fungera som en presentation om hur mycket du kan utöka FreeCAD endast med hjälp av python, utan att ens röra källkoden.

Draft objects can be used for general drafting, similar to what can be done with Inkscape or AutoCAD. But they can also form the base for the creation of 3D objects in other workbenches. A Draft Wire may define the path of an Arch Wall, a Draft Polygon can be extruded with Part Extrude, etc. Many of the Draft modifier tools can be applied to 2D and 3D objects created with other workbenches as well. You can, for example, move a Sketch or create a Draft OrthoArray from a Part object.

The Draft Workbench also provides tools to define a working plane, a grid, and a snapping system to precisely control the position of geometry.

If your primary goal is the production of complex 2D drawings and DXF files, and you don't need 3D modelling, FreeCAD may not be the right choice for you. You may wish to consider a dedicated software program for technical drafting instead, such as LibreCAD or QCad.



Drafting

 * [[Image:Draft_Line.svg|32px]] Line: creates a straight line.


 * [[Image:Draft_Wire.svg|32px]] Polyline: creates a polyline, a sequence of several connected line segments.


 * [[Image:Draft_Fillet.svg|32px]] Fillet: creates a fillet, a rounded corner, or a chamfer, a straight edge, between two Draft Lines.


 * [[Image:Draft_Arc.svg|32px]] Arc tools


 * [[Image:Draft_Arc.svg|32px]] Arc: creates a circular arc from a center, a radius, a start angle and an aperture angle.


 * [[Image:Draft_Arc_3Points.svg|32px]] Arc by 3 points: creates a circular arc from three points that define its circumference.


 * [[Image:Draft_Circle.svg|32px]] Circle: creates a circle from a center and a radius.


 * [[Image:Draft_Ellipse.svg|32px]] Ellipse: creates an ellipse from two points defining a rectangle in which the ellipse will fit.


 * [[Image:Draft_Rectangle.svg|32px]] Rectangle: creates a rectangle from two points.


 * [[Image:Draft_Polygon.svg|32px]] Polygon: creates a regular polygon from a center and a radius.


 * [[Image:Draft_BSpline.svg|32px]] B-spline: creates a B-spline curve from several points.


 * [[Image:Draft_CubicBezCurve.svg|32px]] Bézier tools


 * [[Image:Draft_CubicBezCurve.svg|32px]] Cubic Bézier curve: creates a Bézier curve of the third degree.


 * [[Image:Draft_BezCurve.svg|32px]] Bézier curve: creates a Bézier curve from several points.


 * [[Image:Draft_Point.svg|32px]] Point: creates a simple point.


 * [[Image:Draft_Facebinder.svg|32px]] Facebinder: creates a surface object from selected faces.


 * [[Image:Draft_ShapeString.svg|32px]] ShapeString: creates a compound shape that represents a text string.


 * [[Image:Draft_Hatch.svg|32px]] Hatch: creates hatches on the planar faces of a selected object.

Annotation

 * [[Image:Draft_Text.svg|32px]] Text: creates a multi-line text at a given point.


 * [[Image:Draft_Dimension.svg|32px]] Dimension: creates a linear dimension, a radial dimension or an angular dimension.


 * [[Image:Draft_Label.svg|32px]] Label: creates a multi-line text with a 2-segment leader line and an arrow.


 * [[Image:Draft_AnnotationStyleEditor.svg|32px]] Annotation styles...: allows you to define styles that affect the visual properties of annotation-like objects.

Modification

 * [[Image:Draft_Move.svg|32px]] Move: moves or copies selected objects from one point to another.


 * [[Image:Draft_Rotate.svg|32px]] Rotate: rotates or copies selected objects around a center point by a given angle.


 * [[Image:Draft_Scale.svg|32px]] Scale: scales or copies selected objects around a base point.


 * [[Image:Draft_Mirror.svg|32px]] Mirror: creates mirrored copies from selected objects.


 * [[Image:Draft_Offset.svg|32px]] Offset: offsets each segment of a selected object over a given distance, or creates an offset copy of the selected object.


 * [[Image:Draft_Trimex.svg|32px]] Trimex: trims or extends a selected object.


 * [[Image:Draft_Stretch.svg|32px]] Stretch: stretches objects by moving selected points.


 * [[Image:Draft_Clone.svg|32px]] Clone: creates linked copies, clones, of selected objects.


 * [[Image:Draft_OrthoArray.svg|32px]] Array tools


 * [[Image:Draft_OrthoArray.svg|32px]] Array: creates an orthogonal array from a selected object. It can optionally create a Link array.


 * Draft_PolarArray.svg Polar array: creates an array from a selected object by placing copies along a circumference. It can optionally create a Link array.


 * Draft_CircularArray.svg Circular array: creates an array from a selected object by placing copies along concentric circumferences. It can optionally create a Link array.


 * [[Image:Draft_PathArray.svg|32px]] Path array: creates an array from a selected object by placing copies along a path.


 * [[Image:Draft_PathLinkArray.svg|32px]] Path Link array: idem, but create a Link array instead of a regular array.


 * [[Image:Draft_PointArray.svg|32px]] Point Array: creates an array from a selected object by placing copies at the points from a point compound.


 * Draft_PointLinkArray.svg Point Link array: idem, but create a Link array instead of a regular array.


 * [[Image:Draft_Edit.svg|32px]] Edit: puts selected objects in Draft Edit mode. In this mode the properties of objects can be edited graphically.


 * [[Image:Draft_SubelementHighlight.svg|32px]] Subelement highlight: temporarily highlights selected objects, or the base objects of selected objects.


 * [[Image:Draft_Join.svg|32px]] Join: joins Draft Lines and Draft Wires into a single wire.


 * [[Image:Draft_Split.svg|32px]] Split: splits a Draft Line or Draft Wire at a specified point or edge.


 * [[Image:Draft_Upgrade.svg|32px]] Upgrade: upgrades selected objects.


 * [[Image:Draft_Downgrade.svg|32px]] Downgrade: downgrades selected objects.


 * [[Image:Draft_WireToBSpline.svg|32px]] Wire to B-spline: converts Draft Wires to Draft BSplines and vice versa.


 * [[Image:Draft_Draft2Sketch.svg|32px]] Draft to Sketch: converts Draft objects to Sketcher Sketches and vice versa.


 * [[Image:Draft_Slope.svg|32px]] Set slope: slopes selected Draft Lines or Draft Wires by increasing, or decreasing, the Z coordinate of all points after the first one.


 * [[Image:Draft_FlipDimension.svg|32px]] Flip dimension: rotates the dimension text of selected Draft Dimensions 180° around the dimension line.


 * [[Image:Draft_Shape2DView.svg|32px]] Shape 2D view: creates 2D projections from selected objects.

Draft Tray
The Draft Tray allows selecting the working plane, defining style settings, toggling construction mode, and specifying the active layer or group.




 * [[Image:Draft_tray_button_plane.png]] Select Plane: selects the current Draft working plane. Also available in the menu:.


 * [[Image:Draft_tray_button_style.png]] Set style: sets the default style for new objects. Also available in the menu:.


 * [[Image:Draft_tray_button_construction.png]] Toggle construction mode: switches Draft construction mode on or off. Also available in the menu:.


 * [[Image:Draft_tray_button_layer.png]] AutoGroup: changes the active Draft Layer or, optionally, the active Std Group or group-like Arch object.

Draft annotation scale widget
With the Draft annotation scale widget the Draft annotation scale can be specified.



Draft snap widget
The Draft snap widget can be used as an alternative for the Draft Snap toolbar.



Draft Snap toolbar
The Draft Snap toolbar allows selecting the active snap options. The buttons belonging to active options stay depressed. For general information about snapping see: Draft Snap.


 * [[Image:Draft_Snap_Lock.svg|32px]] Snap Lock: enables or disables snapping globally.


 * [[Image:Draft_Snap_Endpoint.svg|32px]] Snap Endpoint: snaps to the endpoints of edges.


 * [[Image:Draft_Snap_Midpoint.svg|32px]] Snap Midpoint: snaps to the midpoint of straight and circular edges.


 * [[Image:Draft_Snap_Center.svg|32px]] Snap Center: snaps to the center point of faces and circular edges, and to the point of Draft WorkingPlaneProxies and Arch BuildingParts.


 * [[Image:Draft_Snap_Angle.svg|32px]] Snap Angle: snaps to the special cardinal points on circular edges, at multiples of 30° and 45°.


 * [[Image:Draft_Snap_Intersection.svg|32px]] Snap Intersection: snaps to the intersection of two edges.


 * [[Image:Draft_Snap_Perpendicular.svg|32px]] Snap Perpendicular: snaps to the perpendicular point on edges.


 * [[Image:Draft_Snap_Extension.svg|32px]] Snap Extension: snaps to an imaginary line that extends beyond the endpoints of straight edges.


 * [[Image:Draft_Snap_Parallel.svg|32px]] Snap Parallel: snaps to an imaginary line parallel to straight edges.


 * [[Image:Draft_Snap_Special.svg|32px]] Snap Special: snaps to special points defined by the object.


 * [[Image:Draft_Snap_Near.svg|32px]] Snap Near: snaps to the nearest point on faces or edges.


 * [[Image:Draft_Snap_Ortho.svg|32px]] Snap Ortho: snaps to imaginary lines that cross the previous point at 0°, 45°, 90° and 135°.


 * [[Image:Draft_Snap_Grid.svg|32px]] Snap Grid: snaps to the intersections of grid lines.


 * [[Image:Draft_Snap_WorkingPlane.svg|32px]] Snap WorkingPlane: projects the snap point onto the current working plane.


 * [[Image:Draft_Snap_Dimensions.svg|32px]] Snap Dimensions: shows temporary X and Y dimensions.


 * [[Image:Draft_ToggleGrid.svg|32px]] Toggle Grid: switches the grid on or off.

Draft utility tools toolbar

 * [[Image:Draft_Layer.svg|32px]] Layer: creates a Draft Layer.


 * [[Image:Draft_AddNamedGroup.svg|32px]] Add a new named group: creates a named Std Group and moves selected objects to that group.


 * [[Image:Draft_AddToGroup.svg|32px]] Move to group...: moves objects to a Std Group. It can also ungroup objects.


 * [[Image:Draft_SelectGroup.svg|32px]] Select group: selects the content of Draft Layers, Std Groups or group-like Arch objects.


 * [[Image:Draft_AddConstruction.svg|32px]] Add to Construction group: moves objects to the Draft construction group.


 * [[Image:Draft_ToggleDisplayMode.svg|32px]] Toggle normal/wireframe display: switches the property of selected objects between  and.


 * [[Image:Draft_WorkingPlaneProxy.svg|32px]] Create working plane proxy: creates a working plane proxy to save the current Draft working plane.

Additional tools
The menu contains several tools. Most of them can also be accessed from toolbars or the Draft Tray and have already been mentioned above. For the following tools this is not the case:


 * [[Image:Draft_ApplyStyle.svg|32px]] Apply current style: applies the current style settings to selected objects.


 * [[Image:Draft_Heal.svg|32px]] Heal: heals problematic Draft objects found in very old files.


 * [[Image:Draft_ToggleContinueMode.svg|32px]] Toggle continue mode: switches continue mode on or off.


 * [[Image:Draft_ShowSnapBar.svg|32px]] Show snap toolbar: shows the Draft Snap toolbar.

Gemensamt beteende

 * Snäpp: tillåter dig att placera nya punkter på speciella platser på existerande objekt


 * Begränsning: Tillåter att nya punkter placeras horisontellt eller vertikalt i relation till tidigare punkter


 * Konstruktionsläge: Tillåter dig att skilja viss geometri åt från resten, för att lätt kunna stänga på/av


 * Arbetsplan: Alla skisskommandon kan användas på valfritt plani i 3D rymden. Det gällande arbetsplanet kan konfigureras på ett lätt sätt

Tree view context menu
The following additional options are available in the Tree view context menu:

Default options
If there is an active document the context menu contains one additional sub-menu:
 * : a subset of the tools available in the main Draft Utilities menu.

Wire options
For a Draft Wire, Draft BSpline, Draft CubicBezCurve and Draft BezCurve this additional option is available:


 * [[Image:Draft_Edit.svg|32px]] Flatten this wire: flattens the wire based on its internal geometry. This option currently does not work properly.

Layer container options
For a Draft LayerContainer these additional options are available:


 * [[Image:Draft_Layer.svg|32px]] Merge layer duplicates: merges all layers with the same base label. This does not work in FreeCAD version 0.19.


 * [[Image:Draft_NewLayer.svg|32px]] Add new layer: adds a new layer to the current document.

Layer options
For a Draft Layer these additional options are available:


 * [[Image:button_right.svg|32px]] Activate this layer: activates the selected layer.


 * [[Image:Draft_SelectGroup.svg|32px]] Select layer contents: selects the objects inside the selected layer.

Working plane proxy options
For a Draft WorkingPlaneProxy these additional options are available:


 * [[Image:Draft_SelectPlane.svg|32px]] Write camera position: updates the property of the working plane proxy with the current 3D view camera settings.


 * [[Image:Draft_SelectPlane.svg|32px]] Write objects state: updates the property of the working plane proxy with the current visibility state of objects in the document.

3D view context menu
The following additional options are available in the 3D view context menu:

Default options
If there is an active document the context menu contains one additional sub-menu:
 * : a subset of the tools available in the main Draft Utilities menu.

Obsolete tools
These commands are obsolete but still available:


 * [[Image:Draft_Array.svg|32px]] Array: creates an orthogonal array from a selected object. The created array can be turned into a polar array or a circular array by changing its property.


 * [[Image:Draft_Drawing.svg|32px]] Drawing: inserts views of selected objects into a drawing page.

Preferences

 * [[Image:Preferences-draft.svg|32px]] Preferences: general preferences for the Draft Workbench.


 * [[Image:Preferences-import-export.svg|32px]] Import Export Preferences: preferences available for importing from and exporting to different file formats.

Import & export
Detta är funktioner för att öppna, importera eller exportera andra filformat. Öppna kommet att öppna ett nytt dokument med filens innehåll, medan importera kommer att lägga till filinnehållet till det nuvarande dokumentet. Exportera kommer att spara de valda objekten till en fil. Om inget är valt, så kommer alla objekt att exporteras. Var uppmärksam på att eftersom tanken med Ritmodulen är att arbeta med 2d objekt, så fokuserar dessa importerare endast på 2d objekt, och, fastän DXF och OCA formaten stödjer objektdefinitioner i 3D rymden (objekt är inte nödvändigtvis platta), så kommer de inte att importera volymetriska objekt som nät, 3D ytor, etc, utan snarare linjer, cirklar, text eller flata former. För närvarande så stöds följande filformat:


 * Autodesk .DXF: Importerar och exporterar DXF filer som har skapats med andra CAD applikationer


 * SVG (som geometri): Importerar och exporterar SVG filer som har skapats med vektorbaserade ritapplikationer


 * Open Cad format .OCA: Importerar och exporterar OCA/GCAD files, ett potentiellt nytt öppet CAD filformat


 * Airfoil Data Format .DAT Importerar DAT filer som beskriver Vingprofiler

Unit tests
See also: Test Workbench.

To run the unit tests of the workbench execute the following from the operating system terminal:

API
Se Skiss API sidan för en komplett beskrivning av Skissfunktionerna som du kan använda i skript och makron

The workbench includes a module to create samples of all objects in a new document.

Use this to test that all objects are produced correctly:

Inspecting the code of this module can help to understand the programming interface.

Tutorials

 * Draft tutorial
 * Draft ShapeString tutorial