Part Chamfer: Difference between revisions

From FreeCAD Documentation
(Resized chamfer-dialog image to 400px)
mNo edit summary
Line 7: Line 7:


<!--T:5-->
<!--T:5-->
[[Image:Dialog-chamfer.jpg|400px|Dialog-chamfer]]
[[Image:Dialog-chamfer.png|Dialog-chamfer]]


==How to Use== <!--T:3-->
==How to Use== <!--T:3-->
Line 23: Line 23:


==Properties==
==Properties==
[[Image:Part_Chamfer-Properties.jpg|left|Part_Chamfer Properties]]
[[Image:Part_Chamfer-Properties.png|left|Part_Chamfer Properties]]



{{Properties_Title|Base}}
{{Properties_Title|Base}}
*{{PropertyData|Base}}: The shape onto which the chamfer is to be applied.
*{{PropertyData|Base}}: The shape onto which the chamfer is to be applied.
Line 33: Line 36:
The Chamfer tool can by used in [[macros]] and from the python console by adding a Chamfer object to the document.
The Chamfer tool can by used in [[macros]] and from the python console by adding a Chamfer object to the document.


<b>Example Script:</b>
'''Example Script:'''
</translate>
<syntaxhighlight>
<syntaxhighlight>
import Part
import Part
Line 56: Line 60:
FreeCADGui.ActiveDocument.myCube.Visibility = False
FreeCADGui.ActiveDocument.myCube.Visibility = False
</syntaxhighlight>
</syntaxhighlight>
<translate>



<b>Example Script Explanation:</b>
<b>Example Script Explanation:</b>
</translate>

<syntaxhighlight>
<syntaxhighlight>
import Part
import Part
Line 65: Line 69:
cube.Shape = Part.makeBox(5, 5, 5)
cube.Shape = Part.makeBox(5, 5, 5)
</syntaxhighlight>
</syntaxhighlight>
<translate>
*Creates a 5 mm cube for us to apply chamfered edges to. See [[Part_API]] for an explanation of the makeBox method.
*Creates a 5 mm cube for us to apply chamfered edges to. See [[Part_API]] for an explanation of the makeBox method.
</translate>



<syntaxhighlight>
<syntaxhighlight>
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
</syntaxhighlight>
</syntaxhighlight>
<translate>
*Adds a new object to the document of type Chamfer (from the Part module) with label "myChamfer".
*Adds a new object to the document of type Chamfer (from the Part module) with label "myChamfer".
</translate>



<syntaxhighlight>
<syntaxhighlight>
chmfr.Base = FreeCAD.ActiveDocument.myCube
chmfr.Base = FreeCAD.ActiveDocument.myCube
</syntaxhighlight>
</syntaxhighlight>
<translate>
*Specifies that the base shape of the chamfer object should be "myCube".
*Specifies that the base shape of the chamfer object should be "myCube".
</translate>



<syntaxhighlight>
<syntaxhighlight>
Line 95: Line 102:
myEdges.append((12, 1.5, 1.25))
myEdges.append((12, 1.5, 1.25))
</syntaxhighlight>
</syntaxhighlight>
<translate>
*Creates an empty array "myEdges" and then appends the array with each edge's chamfer parameters.
*Creates an empty array "myEdges" and then appends the array with each edge's chamfer parameters.
*Syntax for each item should be (edge#, chamfer start length, chamfer end length)
*Syntax for each item should be (edge#, chamfer start length, chamfer end length)


</translate>

<syntaxhighlight>
<syntaxhighlight>
chmfr.Edges = myEdges
chmfr.Edges = myEdges
</syntaxhighlight>
</syntaxhighlight>
<translate>
*Sets the Edges attribute of our Chamfer object equal to the array we just created.
*Sets the Edges attribute of our Chamfer object equal to the array we just created.
</translate>



<syntaxhighlight>
<syntaxhighlight>
FreeCADGui.ActiveDocument.myCube.Visibility = False
FreeCADGui.ActiveDocument.myCube.Visibility = False
</syntaxhighlight>
</syntaxhighlight>
<translate>
*This line simply hides "myCube" so that our newly created "myChamfer" object is the only one visible.
*This line simply hides "myCube" so that our newly created "myChamfer" object is the only one visible.



Revision as of 19:40, 2 September 2015

Part Chamfer

Menu location
Part → Chamfer
Workbenches
Part, Complete
Default shortcut
None
Introduced in version
-
See also
None

Description

Chamfers the selected edge(s) of an object. A dialog allows you to choose which edge(s) to work on as well as modify various chamfer parameters.

Dialog-chamfer

How to Use

  1. Press the button from the Part Workbench. Alternatively, you can select Part → Chamfer.
  2. Select the shape to chamfer from the dialog.
  3. Select edges to chamfer by checking the corresponding box in the chamfer dialog or by selecting them on the model directly.
  4. Edit chamfer parameters.
  5. Press OK to close the chamfer dialog and apply the chamfer.

Options

  • When selecting edges on the model, you have the option to select by edge or by face. Selecting by face can be more efficient in many situations.
  • Constant length chamfer or variable length chamfer.
    • A constant length chamfer will create a chamfer with edges equidistant to the original edge at the distance specified.
    • A variable length chamfer will have edges that may be set to different distances from the original edge, allowing you to create a chamfer at a variable angle.

Properties

Part_Chamfer Properties
Part_Chamfer Properties


Base

  • DataBase: The shape onto which the chamfer is to be applied.
  • DataPlacement: Specifies the orientation and position of the shape in the 3D space.
  • DataLabel: Label given to the object. Change to suit your needs.


Scripting

The Chamfer tool can by used in macros and from the python console by adding a Chamfer object to the document.

Example Script:

import Part
cube = FreeCAD.ActiveDocument.addObject("Part::Feature", "myCube")
cube.Shape = Part.makeBox(5, 5, 5)
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
chmfr.Base = FreeCAD.ActiveDocument.myCube
myEdges = []
myEdges.append((1, 1.5, 1.25)) # (edge number, chamfer start length, chamfer end length)
myEdges.append((2, 1.5, 1.25))
myEdges.append((3, 1.5, 1.25))
myEdges.append((4, 1.5, 1.25))
myEdges.append((5, 1.5, 1.25))
myEdges.append((6, 1.5, 1.25))
myEdges.append((7, 1.5, 1.25))
myEdges.append((8, 1.5, 1.25))
myEdges.append((9, 1.5, 1.25))
myEdges.append((10, 1.5, 1.25))
myEdges.append((11, 1.5, 1.25))
myEdges.append((12, 1.5, 1.25))
chmfr.Edges = myEdges
FreeCADGui.ActiveDocument.myCube.Visibility = False

Example Script Explanation:

import Part
cube = FreeCAD.ActiveDocument.addObject("Part::Feature", "myCube")
cube.Shape = Part.makeBox(5, 5, 5)
  • Creates a 5 mm cube for us to apply chamfered edges to. See Part_API for an explanation of the makeBox method.
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
  • Adds a new object to the document of type Chamfer (from the Part module) with label "myChamfer".
chmfr.Base = FreeCAD.ActiveDocument.myCube
  • Specifies that the base shape of the chamfer object should be "myCube".
myEdges = []
myEdges.append((1, 1.5, 1.25)) # (edge number, chamfer start length, chamfer end length)
myEdges.append((2, 1.5, 1.25))
myEdges.append((3, 1.5, 1.25))
myEdges.append((4, 1.5, 1.25))
myEdges.append((5, 1.5, 1.25))
myEdges.append((6, 1.5, 1.25))
myEdges.append((7, 1.5, 1.25))
myEdges.append((8, 1.5, 1.25))
myEdges.append((9, 1.5, 1.25))
myEdges.append((10, 1.5, 1.25))
myEdges.append((11, 1.5, 1.25))
myEdges.append((12, 1.5, 1.25))
  • Creates an empty array "myEdges" and then appends the array with each edge's chamfer parameters.
  • Syntax for each item should be (edge#, chamfer start length, chamfer end length)
chmfr.Edges = myEdges
  • Sets the Edges attribute of our Chamfer object equal to the array we just created.
FreeCADGui.ActiveDocument.myCube.Visibility = False
  • This line simply hides "myCube" so that our newly created "myChamfer" object is the only one visible.