Draft Workbench: Difference between revisions

From FreeCAD Documentation
No edit summary
Line 88: Line 88:
* Pressing ESCAPE cancels the function.
* Pressing ESCAPE cancels the function.
* Pressing ESCAPE cancels the function
* Pressing ESCAPE cancels the function

==Common behaviours==

===Snapping===

In all functions that support snapping, following snap locations are currently availible:
* Endpoint of lines
* Midpoint of lines
* Center of circles and arcs
* Quadrant points of circles and arcs
* Endpoints of arcs

In functions that support both snapping and constraining, the combination of both behaviours (SHIFT+CTRL) can extend much the snapping possibilities.

Revision as of 22:45, 9 February 2008

The draft Module is a work-in-progress and quite experimental module made to add basic 2d drawing functionality to FreeCAD. It is written entirely in python, and is also intended to showcase how far you can extend FreeCAD entirely in python, without even touching the source code. This module is currently developed outside of the main FreeCAD development structure.

Currently it is not really usable for production work, but already contains a couple of working basic functions. Feel free to test, and give us a feedback on the discussion page!

I also maintain a workplan of the whole thing here.

Installation

The draft Module is currently not part of the FreeCAD package, so you'll need to download it from here: http://yorik.orgfree.com/scripts/Draft.zip The zipfile here above contains just a "draft" directory. To install the module, simply place that directory into the "Mod" directory of FreeCAD.

Please note that the draft module requires two specific python modules to be installed and working on your system, PyQt4 and Pyvy. Instructions for installing or compiling these modules can be found on the extra python modules page.

Import functions

Autodesk DXF

Menu: File > Open

This function opens a DXF file (any version from 12 to 2007) in a new drawing. The color and linetype of objects is currently not used. DXF object types currently read by this script + implementation in FreeCAD:

  • line: read and converted to FreeCAD Polygon
  • lwpolyline: read and converted to FreeCAD Polygon w/ arcs straigthened
  • text: read but no implementation in FreeCAD
  • mtext: read but no implementation in FreeCAD
  • circle: read and converted to FreeCAD Circle
  • arc: read and converted to FreeCAD Circle
  • layer: read and layers containing objects are conveted to FreeCAD Group
  • block_record: read but no implementation in FreeCAD

SVG

Menu: File > Open

A function to import SVG files as workable 2D objects, in opposition to the built-in drawing module which imports svg files as sheet drawings. SVG objects that get imported at the moment:

  • PATH objects with M, C, L or A commands: converted to FreeCAD polygon
  • RECT objects: converted to FreeCAD polygon

Drawing functions

2-point Line

draft Toolbar > 2-point Line or Context menu > draft > 2-point Line

This function asks the user for 2 points and draws a line betwen them. The newly created line will have the current color and width. The points can be picked with the mouse in the 3d view or by entering corrdinates with the keyboard. Following functionality is availible:

  • Picking a point on an empty area of the 3d view will return a point situated at your mouse location on the current workplane.
  • Picking a point on an object will return a point situated on the object, at your mouse location. An open "o" symbol appears to notify you.
  • Pressing CTRL will snap your point to availible snap locations. A filled "o" or square symbol appears.
  • Pressing SHIFT will constrain your new point in relation to the last one, horizontally or vertically, depending on the location of your mouse at the moment you press SHIFT. To change between horizontal and vertical, simply release SHIFT and press it again with your mouse in another location.
  • Enter numbers to insert manually a coordinate.
  • Pressing ENTER will switch you from X to Y, from Y to Z and pressing ENTER while you are editing Z will create a new point.
  • Pressing SPACE will switch between relative and absolute coordinates. In relative coordinates, the location you enter is relative to the last point.
  • Pressing Z or pressing the "Undo" button will undo the last point.
  • Pressing ESCAPE will cancel the operation.

Multiple-point Line

draft Toolbar > Multiple-point Line or Context menu > draft > Multiple-point Line

This function behaves exactly the same way as the previous one, except that it doesn't stop after 2 points. Besids that, a number of extra features are availible:

  • Double-clicking the last point, instead of simply clicking, will finish the line, leaving it open.
  • Pressing F or context menu > draft > Finish or pressing the "Finish" button will also finish the line, leaving it open.
  • CTRL-Clicking (snapping) on the first point will finish and close the line
  • Pressing C or context menu > draft > Close or pressing the "Close" button will also finish and close the line.

Circle

draft Toolbar > Circle or Context menu > draft > Circle

This function draws a circle by asking for two points, the center and the radius. Both values can also be entered manually. The created circle will take the current line width and color. Availible features:

  • Pressing CTRL will snap you to availible snap locations. A filled symbol appears to notify you.
  • Pressing ESCAPE cancels the function.

Arc

draft Toolbar > Arc or Context menu > draft > Arc

This function draws an arc by picking four points: the center, the radius, the start angle and the end angle. All these values can also be entered manually. The created arc will take the current line width and color. Availible features:

  • Pressing CTRL will snap you to availible snap locations. A filled symbol appears to notify you.
  • Pressing SHIFT will constrain you vertically or horizontally in relation to the center.
  • Pressing ALT when choosing the end angle will switch you to counter-clockwise direction.
  • Pressing ESCAPE cancels the function.
  • Pressing ESCAPE cancels the function

Common behaviours

Snapping

In all functions that support snapping, following snap locations are currently availible:

  • Endpoint of lines
  • Midpoint of lines
  • Center of circles and arcs
  • Quadrant points of circles and arcs
  • Endpoints of arcs

In functions that support both snapping and constraining, the combination of both behaviours (SHIFT+CTRL) can extend much the snapping possibilities.