Part Offset2D: Difference between revisions

From FreeCAD Documentation
m (ellipses don't work either)
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>
<!--T:55-->
{{Docnav
|[[Part_Offset|3D Offset]]
|[[Part_Thickness|Thickness]]
|[[Part_Module|Part]]
|IconL=Part_Offset.png
|IconC=Workbench_Part.svg
|IconR=Part_Thickness.png
}}


<!--T:23-->
{{GuiCommand|Name=Part Offset2D|MenuLocation=Part → 2D Offset|Workbenches=[[Part Module|Part]]|SeeAlso=[[Part_Offset|Part_Offset]], [[Part_Thickness|Part Thickness]], [[Draft_Offset|Draft Offset]]}}
{{GuiCommand
|Name=Part Offset2D
|MenuLocation=Part → 2D Offset
|Workbenches=[[Part Module|Part]]
|Version=0.17
|SeeAlso=[[Part_Offset|Part Offset 3D]], [[Part_Thickness|Part Thickness]], [[Draft_Offset|Draft Offset]]
}}


==Description== <!--T:25-->
[[image:Part Offset2D Demo.png|600px]]

...UNDER CONSTRUCTION...

==Description==
Part 2D Offset constructs a wire, parallel to the original wire, at a certain distance from it. Or enlarges/shrinks a planar face, similarly.
Part 2D Offset constructs a wire, parallel to the original wire, at a certain distance from it. Or enlarges/shrinks a planar face, similarly.


<!--T:26-->
The wire/face must be planar. There can be multiple wires in one object.
The wire/face must be planar. There can be multiple wires in one object, not necessarily coplanar.

</translate>
[[image:Part Offset2D Demo.png|600px]]
<translate>


==How to use==
==How to use== <!--T:27-->
# Select an object to offset
# Select an object to offset
# Invoke Part Offset2D command.
# Press the {{KEY|[[File:Part Offset2D.svg|24px]]}} '''Offset2D''' button.
# Set up the offset in Task Panel, and accept the dialog.
# Set up the offset in Task Panel.
# Press {{KEY|OK}}.


<!--T:28-->
A 2D Offset parametric object is created. Original objects are switched to wireframe display mode.
A 2D Offset parametric object is created. Original objects are switched to wireframe display mode.


==Properties==
==Properties== <!--T:29-->


<!--T:30-->
{{TitleProperty|Offset}}
* {{PropertyData|Source}}: Link to original shape
* {{PropertyData|Source}}: Link to original shape


<!--T:31-->
* {{PropertyData|Value}} The distance to enlarge the wire/face by. If negative, the wire/face is shrunk instead.
* {{PropertyData|Value}} The distance to enlarge the wire/face by. If negative, the wire/face is shrunk instead.


<!--T:32-->
* {{PropertyData|Mode}} ("Pipe" or "Skin"): sets how non-closed wires are processed. If "Pipe", the wire is outlined as if it was an extremely thin closed contour. If "Skin", an open wire is created.
* {{PropertyData|Mode}} ("Pipe" or "Skin"): sets how non-closed wires are processed. If "Pipe", the wire is outlined as if it was an extremely thin closed contour. If "Skin", an open wire is created.


</translate>
[[image:Part Offset2D Mode.png|600px]]
:[[image:Part Offset2D Mode.png|600px]]
<translate>


<!--T:34-->
* {{PropertyData|Join}} ("Arc", "Tangent", "Intersection"): sets the behavior around kinks. If "Arc", offset segments are connected with an arc of circle, centered at the vertex. "Tangent" is unsupported on OCC7.0.0. "Intersection": offset segments are extended till they intersect.
* {{PropertyData|Join}} ("Arc", "Tangent", "Intersection"): sets the behavior around kinks. If "Arc", offset segments are connected with an arc of circle, centered at the vertex. "Tangent" is unsupported on OCC7.0.0. "Intersection": offset segments are extended till they intersect.


</translate>
[[image:Part Offset2D Join.png|600px]]
:[[image:Part Offset2D Join.png|600px]]
<translate>


<!--T:36-->
* {{PropertyData|Intersection}} ("false", "true"): sets if multiple wires are treated collectively or independently. If "false", wires are offset independently, intersections between resulting wires are ignored. If "true", the wires are offset in collective manner.
* {{PropertyData|Intersection}} ("false", "true"): sets if multiple wires are treated collectively or independently. If "false", wires are offset independently, intersections between resulting wires are ignored. If "true", the wires are offset in collective manner.


</translate>
[[image:Part Offset2D Intersection.png|600px]]
:[[image:Part Offset2D Intersection.png|600px]]
<translate>


<!--T:38-->
Only wires within a compound are coupled. For example, if the structure is like compound(wire1, wire2, compound(wire3, wire4)), wire1 and wire2 will be treated collectively, but independently from wire3 and wire4. Likewise, wire3 and wire4 are treated collectively, but independently of wire1+wire2.
:Only wires within a compound are coupled. For example, if the structure is like compound(wire1, wire2, compound(wire3, wire4)), wire1 and wire2 will be treated collectively, but independently from wire3 and wire4. Likewise, wire3 and wire4 are treated collectively, but independently of wire1+wire2.


<!--T:39-->
Also, in collective mode, directions of wires are important, and influence direction of offset. This is in tight relationship with how holes in faces are treated.
:Also, in collective mode, directions of wires are important, and influence direction of offset. This is in tight relationship with how holes in faces are treated.


<!--T:40-->
Wires being treated collectively must be coplanar. Wires being offset independently don't have to be coplanar.
:Wires being treated collectively must be coplanar. Wires being offset independently don't have to be coplanar.


<!--T:41-->
* {{PropertyData|Fill}} ("false", "true"): if "true", the space between original wire/face and the offset is filled with a face.
* {{PropertyData|Fill}} ("false", "true"): if "true", the space between original wire/face and the offset is filled with a face.


</translate>
[[image:Part Offset2D Fill.png|600px]]
:[[image:Part Offset2D Fill.png|600px]]
<translate>


==Known issues==
==Known issues== <!--T:43-->


<!--T:54-->
* Using the tool can crash FreeCAD (see next point). On Windows, these crashes are converted to exceptions and don't generally cause FreeCAD to close; on other OS'es it is not the case. So, it is advised to save project before attempting to use the tool.
* Most of non-default modes will only work with OCC 7.0.0 or later.


<!--T:44-->
* Using the tool can crash FreeCAD (see next point). On Windows, these crashes are converted to exceptions and don't generally cause FreeCAD to close; on other OS'es it is not the case, so it is advisable to save project before attempting to use the tool. Ellipses are not handled either.

<!--T:45-->
* Enlarging faces with circular holes by an amount large enough to cause holes to close up, a crash occurs (OCC 7.0.0). The problem seems to be specific to circles; other shapes seem to close out properly.
* Enlarging faces with circular holes by an amount large enough to cause holes to close up, a crash occurs (OCC 7.0.0). The problem seems to be specific to circles; other shapes seem to close out properly.


<!--T:46-->
* when offsetting circles that have non-zero Placement, the result is placed wrongly. (OCC 7.0.0)
* when offsetting circles that have non-zero Placement, the result is placed wrongly. (OCC 7.0.0)


<!--T:47-->
* when offsetting circles, sometimes they are offset in unexpected direction (e.g. inward instead of outward). (OCC 7.0.0)
* when offsetting circles, sometimes they are offset in unexpected direction (e.g. inward instead of outward). (OCC 7.0.0)


<!--T:48-->
* Fill="true" doesn't work when collectively offsetting open wires in "Skin" mode
* Fill="true" doesn't work when collectively offsetting open wires in "Skin" mode


<!--T:49-->
* "Tangent" join mode doesn't work (OCC 7.0.0)
* "Tangent" join mode doesn't work (OCC 7.0.0)


<!--T:50-->
* Offsetting wires made of single line segment is not supported (because line segment doesn't define a plane). Single line segments cannot participate in collective offset either.
* Offsetting wires made of single line segment is not supported (because line segment doesn't define a plane). Single line segments cannot participate in collective offset either.


==Scripting==
==Scripting== <!--T:51-->


<!--T:52-->
The tool can by used in [[macros]] and from the python console by using the following function:
The tool can by used in [[macros]] and from the python console by using the following function:
</translate>
</translate>
Line 75: Line 122:
<translate>
<translate>


<!--T:53-->
2D offset is also available as a method of Part.Shape. Example:
2D offset is also available as a method of Part.Shape. Example:
</translate>
</translate>
Line 100: Line 148:
# structure follows that of source shape.
# structure follows that of source shape.
}}
}}

<translate>
<translate>


==Version== <!--T:22-->
<!--T:56-->
{{Docnav
The tool was introduced in FreeCAD v0.17.8350. Most of non-default modes will only work with OCC 7.0.0 or later.
|[[Part_Offset|3D Offset]]
|[[Part_Thickness|Thickness]]
|[[Part_Module|Part]]
|IconL=Part_Offset.png
|IconC=Workbench_Part.svg
|IconR=Part_Thickness.png
}}


<!--T:57-->
{{Part Tools navi}}

<!--T:58-->
{{Userdocnavi}}
</translate>
</translate>


{{clear}}
{{clear}}
<languages/>

Revision as of 14:32, 12 January 2020

Part Offset2D

Menu location
Part → 2D Offset
Workbenches
Part
Default shortcut
None
Introduced in version
0.17
See also
Part Offset 3D, Part Thickness, Draft Offset

Description

Part 2D Offset constructs a wire, parallel to the original wire, at a certain distance from it. Or enlarges/shrinks a planar face, similarly.

The wire/face must be planar. There can be multiple wires in one object, not necessarily coplanar.

How to use

  1. Select an object to offset
  2. Press the Offset2D button.
  3. Set up the offset in Task Panel.
  4. Press OK.

A 2D Offset parametric object is created. Original objects are switched to wireframe display mode.

Properties

  • DataSource: Link to original shape
  • DataValue The distance to enlarge the wire/face by. If negative, the wire/face is shrunk instead.
  • DataMode ("Pipe" or "Skin"): sets how non-closed wires are processed. If "Pipe", the wire is outlined as if it was an extremely thin closed contour. If "Skin", an open wire is created.
  • DataJoin ("Arc", "Tangent", "Intersection"): sets the behavior around kinks. If "Arc", offset segments are connected with an arc of circle, centered at the vertex. "Tangent" is unsupported on OCC7.0.0. "Intersection": offset segments are extended till they intersect.
  • DataIntersection ("false", "true"): sets if multiple wires are treated collectively or independently. If "false", wires are offset independently, intersections between resulting wires are ignored. If "true", the wires are offset in collective manner.
Only wires within a compound are coupled. For example, if the structure is like compound(wire1, wire2, compound(wire3, wire4)), wire1 and wire2 will be treated collectively, but independently from wire3 and wire4. Likewise, wire3 and wire4 are treated collectively, but independently of wire1+wire2.
Also, in collective mode, directions of wires are important, and influence direction of offset. This is in tight relationship with how holes in faces are treated.
Wires being treated collectively must be coplanar. Wires being offset independently don't have to be coplanar.
  • DataFill ("false", "true"): if "true", the space between original wire/face and the offset is filled with a face.

Known issues

  • Most of non-default modes will only work with OCC 7.0.0 or later.
  • Using the tool can crash FreeCAD (see next point). On Windows, these crashes are converted to exceptions and don't generally cause FreeCAD to close; on other OS'es it is not the case, so it is advisable to save project before attempting to use the tool. Ellipses are not handled either.
  • Enlarging faces with circular holes by an amount large enough to cause holes to close up, a crash occurs (OCC 7.0.0). The problem seems to be specific to circles; other shapes seem to close out properly.
  • when offsetting circles that have non-zero Placement, the result is placed wrongly. (OCC 7.0.0)
  • when offsetting circles, sometimes they are offset in unexpected direction (e.g. inward instead of outward). (OCC 7.0.0)
  • Fill="true" doesn't work when collectively offsetting open wires in "Skin" mode
  • "Tangent" join mode doesn't work (OCC 7.0.0)
  • Offsetting wires made of single line segment is not supported (because line segment doesn't define a plane). Single line segments cannot participate in collective offset either.

Scripting

The tool can by used in macros and from the python console by using the following function:

f = App.ActiveDocument.addObject("Part::Offset2D", "Offset2D")
f.Source =  #some object
f.Value = 10.0

2D offset is also available as a method of Part.Shape. Example:

import Part
circle = Part.Circle().toShape()
enlarged_circle = circle.makeOffset2D(10.0)
Part.show(circle)
Part.show(enlarged_circle)
# makeOffset2D(offset, join = 0, fill = False, openResult = false, intersection = false)
# 
# * offset: distance to expand the shape by. 
# 
# * join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =
# intersection
# 
# * fill: if true, the output is a face filling the space covered by offset. If
# false, the output is a wire/face.
# 
# * openResult: True for "Skin" mode; False for Pipe mode. 
# 
# * intersection: collective offset
# 
# Returns: result of offsetting (wire or face or compound of those). Compounding
# structure follows that of source shape.