Part Chamfer/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav|[[Part_SectionCross|Cross sections]]|[[Part_Mirror|Mirror]]|[[Part_Module|Part]]|IconL=Part_SectionCross.png|IconC=Workbench_Part.svg|IconR=Part_Mirror.png}}
{{Docnav
|[[Part_Fillet|Fillet]]
|[[Part_MakeFace|MakeFace]]
|[[Part_Workbench|Part]]
|IconL=Part_Fillet.svg
|IconR=Part_MakeFace.svg
|IconC=Workbench_Part.svg
}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/sv|Name=Part Chamfer|Name/sv=Part Chamfer|MenuLocation=Part → Chamfer|Workbenches=[[Part Module/sv|Part]], Complete|SeeAlso=}}
{{GuiCommand/sv|Name=Part Chamfer|Name/sv=Part Chamfer|MenuLocation=Part → Chamfer|Workbenches=[[Part_Workbench/sv|Part]], Complete|SeeAlso=}}
</div>
</div>


==Description==
==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.
'''Part Chamfer''' 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.


[[Image:Chamfer-example.png|Chamfer example]]
[[Image:Chamfer-example.png|Chamfer example]]

==Usage==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 16: Line 27:


==Options==
==Options==

[[Image:Dialog-chamfer.png|Dialog-chamfer]]
[[Image:Dialog-chamfer.png|Dialog-chamfer]]
* When selecting edges on the model, you have the option to select by edge or by face. Selecting by face will select all bordering edges of that face.
* When selecting edges on the model, you have the option to select by edge or by face. Selecting by face will select all bordering edges of that face.
Line 23: Line 35:


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



[[Image:Part_Chamfer-Properties.png|left|Part Chamfer Properties]]
{{clear}}


{{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.
*{{PropertyData|Placement}}: Specifies the orientation and position of the shape in the 3D space.
*{{PropertyData|Placement}}: Specifies the orientation and position of the shape in the 3D space.
Line 34: Line 47:


==Limitations==
==Limitations==
Chamfer might do nothing if the result would touch or cross the next adjacent edge. So if you do not get the expected result, try with a smaller value. This is the same for [[Part Fillet]].

Also note that the Chamfer feature is affected by the [[Topological Naming Project|Topological Naming]] when the any change is done to a modeling step earlier in the chain that affects the number of facets or vertices. This could cause unpredictable result. Until that is resolved (possibly with V0.19) it is advised to apply Chamfer and [[Part Fillet]] operations at the last steps in the chain.


Chamfer might do nothing if the result would touch or cross the next adjacent edge. So if you do not get the expected result, try with a smaller value. This is the same for [[Image:Part_Fillet.svg|24px]] [[Part_Fillet|Part Fillet]].


Also note that the Chamfer feature is affected by the [[Topological_naming_problem|Topological naming problem]] when the any change is done to a modeling step earlier in the chain that affects the number of facets or vertices. This could cause unpredictable result. Until that is resolved it is advised to apply Chamfer and [[Image:Part_Fillet.svg|24px]] [[Part_Fillet|Part Fillet]] operations at the last steps in the chain.


==Scripting==
==Scripting==

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|macros]] and from the [[Python|Python]] console by adding a Chamfer object to the document.


'''Example Script:'''
'''Example Script:'''
{{Code|code=


{{Code|code=
import Part
import Part
cube = FreeCAD.ActiveDocument.addObject("Part::Feature", "myCube")
cube = FreeCAD.ActiveDocument.addObject("Part::Feature", "myCube")
Line 70: Line 83:


'''Example Script Explanation:'''
'''Example Script Explanation:'''

{{Code|code=
{{Code|code=
import Part
import Part
Line 75: Line 89:
cube.Shape = Part.makeBox(5, 5, 5)
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.
*Creates a 5 mm cube for us to apply chamfered edges to. See [[Part_API|Part_API]] for an explanation of the makeBox method.


{{Code|code=
{{Code|code=
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
chmfr = FreeCAD.ActiveDocument.addObject("Part::Chamfer", "myChamfer")
}}
}}

*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".


Line 85: Line 101:
chmfr.Base = FreeCAD.ActiveDocument.myCube
chmfr.Base = FreeCAD.ActiveDocument.myCube
}}
}}

*Specifies that the base shape of the chamfer object should be "myCube".
*Specifies that the base shape of the chamfer object should be "myCube".


Line 102: Line 119:
myEdges.append((12, 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.
*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)
Line 113: Line 131:
FreeCADGui.ActiveDocument.myCube.Visibility = False
FreeCADGui.ActiveDocument.myCube.Visibility = False
}}
}}

*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.


Line 118: Line 137:
FreeCAD.ActiveDocument.recompute()
FreeCAD.ActiveDocument.recompute()
}}
}}

*Recomputes all altered components on the screen and refreshes the display.
*Recomputes all altered components on the screen and refreshes the display.




{{Docnav
{{Docnav|[[Part_SectionCross|Cross sections]]|[[Part_Mirror|Mirror]]|[[Part_Module|Part]]|IconL=Part_SectionCross.png|IconC=Workbench_Part.svg|IconR=Part_Mirror.png}}
|[[Part_Fillet|Fillet]]

|[[Part_MakeFace|MakeFace]]
{{Part Tools navi}}
|[[Part_Workbench|Part]]
|IconL=Part_Fillet.svg
|IconR=Part_MakeFace.svg
|IconC=Workbench_Part.svg
}}


{{Part Tools navi{{#translation:}}}}
{{Userdocnavi}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 10:51, 25 June 2023

Part Chamfer

Menyplacering
Part → Chamfer
Arbetsbänkar
Part, Complete
Standard genväg
Ingen
Introducerad i version
-
Se även
Ingen

Description

Part Chamfer 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.

Chamfer example

Usage

Options

Dialog-chamfer

  • When selecting edges on the model, you have the option to select by edge or by face. Selecting by face will select all bordering edges of that face.
  • 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.

Limitations

Chamfer might do nothing if the result would touch or cross the next adjacent edge. So if you do not get the expected result, try with a smaller value. This is the same for Part Fillet.

Also note that the Chamfer feature is affected by the Topological naming problem when the any change is done to a modeling step earlier in the chain that affects the number of facets or vertices. This could cause unpredictable result. Until that is resolved it is advised to apply Chamfer and Part Fillet operations at the last steps in the chain.

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
FreeCAD.ActiveDocument.recompute()

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.
FreeCAD.ActiveDocument.recompute()
  • Recomputes all altered components on the screen and refreshes the display.