Draft Module

From FreeCAD Documentation
Jump to navigation Jump to search
This page is a translated version of the page Draft Workbench and the translation is 3% complete.
Outdated translations are marked like this.
Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎hrvatski • ‎italiano • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎română • ‎svenska • ‎čeština • ‎български • ‎русский • ‎українська • ‎中文 • ‎中文(中国大陆)‎ • ‎中文(台灣)‎ • ‎日本語 • ‎한국어
Draft workbench icon

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.

Draft Workbench Example.png

The image shows the grid aligned with the XY plane.
On the left, in white, several planar objects.
On the right a non-planar Draft Wire used as the Path Object of a Draft PathArray.

Drafting

  • Draft Line.svg Line: creates a straight line.
  • Draft Wire.svg Polyline: creates a polyline, a sequence of several connected line segments.
  • Draft Arc.svg Arc tools
  • Draft Arc.svg Arc: creates a circular arc from a center, a radius, a start angle and an aperture angle.
  • Draft Circle.svg Circle: creates a circle from a center and a radius.
  • Draft Ellipse.svg Ellipse: creates an ellipse from two points defining a rectangle in which the ellipse will fit.
  • Draft Rectangle.svg Rectangle: creates a rectangle from two points.
  • Draft Polygon.svg Polygon: creates a regular polygon from a center and a radius.
  • Draft BSpline.svg B-spline: creates a B-spline curve from several points.
  • Draft CubicBezCurve.svg Bézier tools
  • Draft Point.svg Point: creates a simple point.
  • Draft Facebinder.svg Facebinder: creates a surface object from selected faces.
  • Draft ShapeString.svg ShapeString: creates a compound shape that represents a text string.

Annotation

  • Draft Text.svg Text: creates a multi-line text at a given point.
  • Draft Dimension.svg Dimension: creates a linear dimension, a radial dimension or an angular dimension.
  • Draft Label.svg Label: creates a multi-line text with a 2-segment leader line and an arrow.

Modification

  • Draft Move.svg Move: moves or copies selected objects from one point to another.
  • Draft Rotate.svg Rotate: rotates or copies selected objects around a center point by a given angle.
  • Draft Scale.svg Scale: scales or copies selected objects around a base point.
  • Draft Mirror.svg Mirror: creates mirrored copies from selected objects.
  • Draft Offset.svg Offset: offsets each segment of a selected object over a given distance, or creates an offset copy of the selected object.
  • Draft Trimex.svg Trimex: trims or extends a selected object.
  • Draft Stretch.svg Stretch: stretches objects by moving selected points.
  • Draft Clone.svg Clone: creates linked copies, clones, of selected objects.
  • Draft OrthoArray.svg Array tools
  • Draft PathArray.svg Path array: creates an array from a selected object by placing copies along a path.
  • Draft PointArray.svg Point Array: creates an array from a selected object by placing copies at the points from a point compound.
  • Draft Edit.svg Edit: puts selected objects in Draft Edit mode. In this mode the properties of objects can be edited graphically.
  • Draft SubelementHighlight.svg Subelement highlight: temporarily highlights selected objects, or the base objects of selected objects.
  • Draft Upgrade.svg Upgrade: upgrades 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.

Draft tray default.png

  • Draft tray button plane.png Select Plane: selects the current Draft working plane. Also available in the menu: Draft → Utilities → Draft SelectPlane.svg Select Plane.
  • Draft tray button construction.png Toggle construction mode: switches Draft construction mode on or off. Also available in the menu: Draft → Utilities → Draft ToggleConstructionMode.svg Toggle construction mode.

Draft annotation scale widget

With the Draft annotation scale widget the Draft annotation scale can be specified. introduced in version 0.19

Draft annotation scale widget button.png

Draft snap widget

The Draft snap widget can be used as an alternative for the Draft Snap toolbar. introduced in version 0.19

Draft snap widget button.png

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.

  • Draft Snap Lock.svg Snap Lock: enables or disables snapping globally.
  • Draft Snap Midpoint.svg Snap Midpoint: snaps to the midpoint of straight and circular edges.
  • Draft Snap Angle.svg Snap Angle: snaps to the special cardinal points on circular edges, at multiples of 30° and 45°.
  • Draft Snap Extension.svg Snap Extension: snaps to an imaginary line that extends beyond the endpoints of straight edges.
  • Draft Snap Parallel.svg Snap Parallel: snaps to an imaginary line parallel to straight edges.
  • Draft Snap Special.svg Snap Special: snaps to special points defined by the object.
  • Draft Snap Near.svg Snap Near: snaps to the nearest point on faces or edges.
  • Draft Snap Ortho.svg Snap Ortho: snaps to imaginary lines that cross the previous point at 0°, 45°, 90° and 135°.
  • Draft Snap Grid.svg Snap Grid: snaps to the intersections of grid lines.

Draft utility tools toolbar

Additional tools

The Draft → Utilities 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:

  • Draft Heal.svg Heal: heals problematic Draft objects found in very old files.

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
  • Kopiering: Alla ändringsverktyg kan antingen ändra de valda objekten eller skapa en förändrad kopiaav dem. Genom att trycka på ALT tangenten medan verktyget används kommer att skapa en kopia
  • 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:

  • Utilities: 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:

  • Draft Edit.svg 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:

  • Draft Layer.svg Merge layer duplicates: this option currently does not work.

Layer options

For a Draft Layer these additional options are available:

Working plane proxy options

For a Draft WorkingPlaneProxy these additional options are available:

  • Draft SelectPlane.svg Write objects state: updates the VyVisibility Map 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:

  • Utilities: a subset of the tools available in the main Draft Utilities menu.

Obsolete tools

These commands are obsolete but still available:

Preferences

  • Preferences-draft.svg Preferences: general preferences for the Draft Workbench.

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

Unit tests

See also: Test Workbench.

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

freecad -t TestDraft

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. introduced in version 0.19

Use this to test that all objects are produced correctly:

import drafttests.draft_test_objects as dto
doc = dto.create_test_file()

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

Tutorials