Draft Offset: Difference between revisions

From FreeCAD Documentation
(Updated Usage)
No edit summary
Line 48: Line 48:
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# To define the offset distance do one of the following:
# To define the offset distance do one of the following:
#* Pick a point on the [[3D_view|3D view]].
#* Pick a point in the [[3D_view|3D view]].
#* Make sure the pointer is on the correct side of the object in the [[3D_view|3D view]] and enter a {{MenuCommand|Distance}}.
#* Make sure the pointer is on the correct side of the object in the [[3D_view|3D view]] and enter a {{MenuCommand|Distance}}.



Revision as of 08:27, 11 June 2021

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Draft Offset

Menu location
Modification → Offset
Workbenches
Draft, Arch
Default shortcut
O S
Introduced in version
-
See also
Draft Scale, Part 2D Offset

Description

The Offset tool moves the selected object by a given distance (offset) perpendicular to itself.

Typically this tool is used in copy mode to create offset copies of a base wire while leaving this wire in the same place. The offset copies are scaled versions of the original object. To create other scaled copies use Draft Scale. To produce exact copies shifted a distance use Draft Move.

Offsetting a wire a certain distance from one of its edges

Usage

See also: Draft Snap and Draft Constrain.

  1. Optionally select one object.
  2. There are several ways to invoke the command:
    • Press the Draft Offset button.
    • Select the Modification → Offset option from the menu.
    • Use the keyboard shortcut: O then S.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. To define the offset distance do one of the following:
    • Pick a point in the 3D view.
    • Make sure the pointer is on the correct side of the object in the 3D view and enter a Distance.

Options

The single character keyboard shortcut and the modifier keys mentioned here can be changed. See Draft Preferences.

  • If the OCC-style offset checkbox is checked a special offset style is used: open Draft Wires are offset on both sides, and new edges are connected with rounded corners. This only works for planar Draft objects with at least two straight edges. Note that with this style a new non-parametric object is created, and if copy mode is off the original object is deleted.
  • Press P or click the Copy checkbox to toggle copy mode. If copy mode is on, the command will create an offset copy instead of offsetting the original object.
  • Holding down Alt before picking points in the 3D view will also toggle copy mode. While Alt is held down multiple offset points can be picked. Release Alt to finish the command and see the created copies.
  • Hold down Shift to keep the offset distance linked to the current segment.
  • Press Esc or the Close button to abort the command.

Preferences

See also: Preferences Editor and Draft Preferences.

  • To change the number of decimals used for the input of the distance: Edit → Preferences... → General → Units → Units settings → Number of decimals.
  • To store and reuse the same copy mode setting across commands: Edit → Preferences... → Draft → General settings → Draft tools options → Global copy mode.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To offset objects use the offset method of the Draft module. The method can only handle Draft Wires, Draft Circles, Draft Rectangles, Draft Polygons and Draft BSplines.

offset_obj = offset(obj, delta, copy=False, bind=False, sym=False, occ=False)
  • obj is the object to be offset.
  • delta contains the offset information:
  • If copy is True the original object is kept and a new object is created.
  • If bind is True a face is created by connecting the shape of the original object and the shape of its offset. This only works for open Draft Wires.
  • If sym is True, and bind is True as well, the offset is made on both sides of the original object, the total width being the length of the given vector. This only works for open Draft Wires.
  • If occ is True OCC-style offsetting is used. See Options. If occ is True the bind and sym arguments are ignored.
  • offset_obj is returned with the original offset object, or with the new object. If bind is True or occ is True, the new object is a Part::Feature object.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1500, 2000, 0)
p3 = App.Vector(4000, 0, 0)

wire = Draft.make_wire([p1, p2, p3])
doc.recompute()

vector = App.Vector(-200, 150, 0)
offset1 = Draft.offset(wire, vector, copy=True, bind=True, sym=True)
offset2 = Draft.offset(wire, 3*vector, copy=True)
offset3 = Draft.offset(wire, 6*vector, copy=True)
offset4 = Draft.offset(wire, 9*vector, copy=True)
offset5 = Draft.offset(wire, 1.5*vector, copy=True, occ=True)

doc.recompute()