Draft Offset: Difference between revisions
No edit summary |
No edit summary |
||
Line 53: | Line 53: | ||
* If the {{MenuCommand|OCC-style offset}} checkbox is checked a special offset style is used: open [[Draft_Wire|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. |
* If the {{MenuCommand|OCC-style offset}} checkbox is checked a special offset style is used: open [[Draft_Wire|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 {{KEY|P}} or click the {{MenuCommand|Copy}} checkbox to toggle copy mode. If copy mode is on, the command will create an offset copy instead of offsetting the original object. |
* Press {{KEY|P}} or click the {{MenuCommand|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 {{KEY|Alt}} before picking points in the [[3D_view|3D view]] will also toggle copy mode. While {{KEY|Alt}} is held down multiple offset points can be picked. Release {{KEY|Alt}} to finish the command and |
* Holding down {{KEY|Alt}} before picking points in the [[3D_view|3D view]] will also toggle copy mode. While {{KEY|Alt}} is held down multiple offset points can be picked. Release {{KEY|Alt}} to finish the command and see the created copies. |
||
* Holding down {{KEY|Shift}} will keep the offset distance linked to the current segment. |
* Holding down {{KEY|Shift}} will keep the offset distance linked to the current segment. |
||
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command. |
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command. |
Revision as of 19:22, 31 May 2021
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
- Select the object that you wish to offset.
- Press the Draft Offset button, or press O then S keys. If no object is selected, you will be invited to select one.
- Click a point on the 3D view, or type in a distance.
The distance used to create the offset is perpendicular to one of the edges of the original shape, depending on the position of the pointer. If the pointer is moved closer to another edge, this edge now becomes the reference for the distance. Hold the Shift key to keep the current reference edge despite moving the pointer closer to other edges.
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.
- Holding down Shift will 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:- For Draft Wires, Draft Rectangles and Draft Polygons it is an offset vector that must be perpendicular to the first segment of the object.
- For Draft Circles it is the new radius.
- For Draft BSplines it is a list of new points.
- If
copy
isTrue
the original object is kept and a new object is created. - If
bind
isTrue
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
isTrue
, andbind
isTrue
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
isTrue
OCC-style offsetting is used. See Options. Ifocc
isTrue
thebind
andsym
arguments are ignored. offset_obj
is returned with the original offset object, or with the new object. Ifbind
isTrue
orocc
isTrue
, the new object is aPart::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()
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub