Assembly Workbench: Difference between revisions

From FreeCAD Documentation
(Experimental feature)
(Marked this version for translation)
 
(11 intermediate revisions by 3 users not shown)
Line 4: Line 4:
<!--T:4-->
<!--T:4-->
{{Docnav
{{Docnav
|[[Arch_Workbench|Arch Workbench]]
|[[Std_Base|Std Base]]
|[[CAM_Workbench|CAM Workbench]]
|[[BIM_Workbench|BIM Workbench]]
|IconL=Workbench_Arch.svg
|IconL=Freecad.svg
|IconR=Workbench_CAM.svg
|IconR=Workbench_BIM.svg
}}
}}


Line 27: Line 27:
==Tools== <!--T:10-->
==Tools== <!--T:10-->


===Assembly=== <!--T:24-->
Experimental features not available by default. To enable them see [[Fine-tuning#Assembly_Workbench|Fine-tuning]].

===Assembly===


<!--T:11-->
<!--T:11-->
Line 35: Line 33:


<!--T:12-->
<!--T:12-->
* [[Image:Assembly_InsertLink.svg|32px]] [[Assembly_InsertLink|Insert Link]]
* [[Image:Assembly_InsertLink.svg|32px]] [[Assembly_InsertLink|Insert Component]]


<!--T:13-->
<!--T:13-->
* [[Image:Assembly_SolveAssembly.svg|32px]] [[Assembly_SolveAssembly|Solve Assembly]]
* [[Image:Assembly_SolveAssembly.svg|32px]] [[Assembly_SolveAssembly|Solve Assembly]]


<!--T:25-->
* [[Image:Assembly_CreateView.svg|32px]] [[Assembly_CreateView|Create Exploded View]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].
* [[Image:Assembly_CreateView.svg|32px]] [[Assembly_CreateView|Create Exploded View]]


<!--T:14-->
<!--T:14-->
* [[Image:Assembly_ExportASMT.svg|32px]] [[Assembly_ExportASMT|Export ASMT File]]
* [[Image:Assembly_ExportASMT.svg|32px]] [[Assembly_ExportASMT|Export ASMT File]]


===Joints===
===Joints=== <!--T:26-->


<!--T:15-->
<!--T:15-->
Line 68: Line 67:
* [[Image:Assembly_CreateJointDistance.svg|32px]] [[Assembly_CreateJointDistance|Create Distance Joint]]
* [[Image:Assembly_CreateJointDistance.svg|32px]] [[Assembly_CreateJointDistance|Create Distance Joint]]


<!--T:69-->
* [[Image:Assembly_CreateJointRackPinion.svg|32px]] [[Assembly_CreateJointRackPinion|Create Rack and Pinion Joint]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].
* [[Image:Assembly_CreateJointParallel.svg|32px]] [[Assembly_CreateJointParallel|Create Parallel Joint]]


<!--T:70-->
* [[Image:Assembly_CreateJointScrew.svg|32px]] [[Assembly_CreateJointScrew|Create Screw Joint]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].
* [[Image:Assembly_CreateJointPerpendicular.svg|32px]] [[Assembly_CreateJointPerpendicular|Create Perpendicular Joint]]


<!--T:71-->
* <span id="Assembly_CompCreateJointGearBelt">[[Image:Assembly_CreateJointGears.svg|x32px]][[Image:Toolbar_flyout_arrow_blue_background.svg|x32px]] Create Gear/Belt Joint:</span><!--Do not edit span id: the Assembly_CompCreateJointGearBelt pages redirect here-->
* [[Image:Assembly_CreateJointAngle.svg|32px]] [[Assembly_CreateJointAngle|Create Angle Joint]]


<!--T:27-->
:* [[Image:Assembly_CreateJointGears.svg|32px]] [[Assembly_CreateJointGears|Create Gears Joint]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].
* [[Image:Assembly_CreateJointRackPinion.svg|32px]] [[Assembly_CreateJointRackPinion|Create Rack and Pinion Joint]]


<!--T:28-->
:* [[Image:Assembly_CreateJointBelt.svg|32px]] [[Assembly_CreateJointBelt|Create Belt Joint]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].
* [[Image:Assembly_CreateJointScrew.svg|32px]] [[Assembly_CreateJointScrew|Create Screw Joint]]


<!--T:29-->
==Example==
* <span id="Assembly_CreateJointGearBelt">[[Image:Assembly_CreateJointGears.svg|x32px]][[Image:Toolbar_flyout_arrow_blue_background.svg|x32px]] Create Gear/Belt Joint:</span><!--Do not edit span id: the Assembly_CompCreateJointGearBelt pages redirect here-->


<!--T:30-->
:* [[Image:Assembly_CreateJointGears.svg|32px]] [[Assembly_CreateJointGears|Create Gears Joint]]

<!--T:31-->
:* [[Image:Assembly_CreateJointBelt.svg|32px]] [[Assembly_CreateJointBelt|Create Belt Joint]]

==Example== <!--T:32-->

<!--T:33-->
<div class="mw-collapsible mw-collapsed toccolours">
<div class="mw-collapsible mw-collapsed toccolours">
[[Image:Assembly3_KinematicExample-01.png|80px]] This example is temporary and may be removed once proper descriptions/tutorials are available.
[[Image:Assembly3_KinematicExample-01.png|80px]] This example is temporary and may be removed once proper descriptions/tutorials are available.
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">


===A kinematic assembly===
===A kinematic assembly=== <!--T:34-->


<!--T:35-->
The kinematic assembly to be created consists of four parts: a Base, a Slider, a Crank, and a connecting Rod. They are connected with four joints.
The kinematic assembly to be created consists of four parts: a Base, a Slider, a Crank, and a connecting Rod. They are connected with four joints.


Line 92: Line 107:
<translate>
<translate>


<!--T:36-->
{{Caption|Assembled parts: Base (amber), Slider (light blue), Crank (red), connecting Rod (green)}}
{{Caption|Assembled parts: Base (amber), Slider (light blue), Crank (red), connecting Rod (green)}}


====Prepare parts====
====Prepare parts==== <!--T:37-->


<!--T:38-->
In this example all parts and the assembly are created in one document.
In this example all parts and the assembly are created in one document.


Line 105: Line 122:
<translate>
<translate>


<!--T:39-->
{{Caption|From left to right: Base, Slider, Crank, connecting Rod}}
{{Caption|From left to right: Base, Slider, Crank, connecting Rod}}


<!--T:40-->
Cylindrical geometries are either parallel or perpendicular, the rest of the shapes is not relevant for this example unless it causes clashes. With this in mind model your own shapes.
Cylindrical geometries are either parallel or perpendicular, the rest of the shapes is not relevant for this example unless it causes clashes. With this in mind model your own shapes.


====Add a root assembly====
====Add a root assembly==== <!--T:41-->


<!--T:42-->
[[Image:Assembly_CreateAssembly.svg|16px]] [[Assembly_CreateAssembly|Create Assembly]] adds a root assembly to a document. (this tool can also add a sub-assembly to an existing selected assembly)
[[Image:Assembly_CreateAssembly.svg|16px]] [[Assembly_CreateAssembly|Create Assembly]] adds a root assembly to a document. (this tool can also add a sub-assembly to an existing selected assembly)


Line 117: Line 137:
<translate>
<translate>


<!--T:43-->
{{Caption|Tree view of Parts and Assembly in a document}}
{{Caption|Tree view of Parts and Assembly in a document}}


====Move the parts into the Assembly container====
====Move the parts into the assembly container==== <!--T:44-->


<!--T:45-->
In the [[Tree_view|Tree view]] drag and drop the parts on the Assembly object. Now they can be handled by the Assembly's solver.
In the [[Tree_view|Tree view]] drag and drop the parts on the Assembly object. Now they can be handled by the Assembly's solver.


Line 127: Line 149:
<translate>
<translate>


<!--T:46-->
{{Caption|The Parts are in the Assembly container now}}
{{Caption|The Parts are in the Assembly container now}}


====Ground a part====
====Ground a part==== <!--T:47-->


<!--T:48-->
To keep the assembly at the desired position, the base part should be locked, or grounded as it is called here. Select the Base in the [[Tree_view|Tree view]] or in the [[3D_view|3D view]] and use the [[Image:Assembly_ToggleGrounded.svg|16px]] [[Assembly_ToggleGrounded|Toggle grounded]] command. This fixes the position of the Base in relation to the local coordinate system (LCS) of the Assembly container. This (also suffixes a lock icon to the label of the Base object and (before weekly build 0.22 - 37213)) adds a GroundedJoint object in the Joints container.
To keep the assembly at the desired position, the base part should be locked, or grounded as it is called here. Select the Base in the [[Tree_view|Tree view]] or in the [[3D_view|3D view]] and use the [[Image:Assembly_ToggleGrounded.svg|16px]] [[Assembly_ToggleGrounded|Toggle grounded]] command. This fixes the position of the Base in relation to the local coordinate system (LCS) of the Assembly container. This (also suffixes a lock icon to the label of the Base object and (before weekly build 0.22 - 37213)) adds a GroundedJoint object in the Joints container.


Line 139: Line 163:
<translate>
<translate>


<!--T:49-->
{{Caption|Expand the Joints container to find the GroundedJoint object}}
{{Caption|Expand the Joints container to find the GroundedJoint object}}


<!--T:50-->
(The GroundedJoint object cannot be unhidden and has no representation in the 3D view (before weekly build 0.22 - 37213))
(The GroundedJoint object cannot be unhidden and has no representation in the 3D view (before weekly build 0.22 - 37213))


====Apply joints====
====Apply joints==== <!--T:51-->


<!--T:52-->
A joint connects exactly two elements of different parts. They can optionally be selected before the desired joint tool is invoked (any number of selected elements other than two results in an empty selection).<br>The elements define the position and orientation of a LCS represented by a filled circle on the local XY plane and three lines along the local X (red), Y (green), and Z (blue) axes.
A joint connects exactly two elements of different parts. They can optionally be selected before the desired joint tool is invoked (any number of selected elements other than two results in an empty selection).<br>The elements define the position and orientation of a LCS represented by a filled circle on the local XY plane and three lines along the local X (red), Y (green), and Z (blue) axes.


<!--T:53-->
* A Revolute joint between Base and Crank
* A Revolute joint between Base and Crank


Line 155: Line 183:
<translate>
<translate>


<!--T:54-->
{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Crank}}
{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Crank}}


<!--T:55-->
* A Cylindrical joint between Base and Slider
* A Cylindrical joint between Base and Slider


Line 165: Line 195:
<translate>
<translate>


<!--T:56-->
{{Caption|Selected elements +[[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|Create Cylindrical Joint]] → rearranged Slider}}
{{Caption|Selected elements +[[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|Create Cylindrical Joint]] → rearranged Slider}}


<!--T:57-->
* A Revolute joint between Crank and Rod
* A Revolute joint between Crank and Rod


Line 175: Line 207:
<translate>
<translate>


<!--T:58-->
{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Rod}}
{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Rod}}


Line 183: Line 216:
<translate>
<translate>


<!--T:59-->
{{Caption|Now there are several joints in a line and we have to help the solver to find a sensible solution.<br>Click and drag the parts → into an easier to compute position.}}
{{Caption|Now there are several joints in a line and we have to help the solver to find a sensible solution.<br>Click and drag the parts → into an easier to compute position.}}


<!--T:60-->
* A Cylindrical joint between Rod and Slider
* A Cylindrical joint between Rod and Slider


Line 193: Line 228:
<translate>
<translate>


<!--T:61-->
{{Caption|Selected elements +[[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|Create Cylindrical Joint]] → finished Assembly}}
{{Caption|Selected elements + [[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|Create Cylindrical Joint]] → finished Assembly}}


<!--T:62-->
In the finished assembly use the mouse pointer to drag the parts according to the used joints.
In the finished assembly use the mouse pointer to drag the parts according to the used joints.


====Drive the Crank====
====Drive the crank==== <!--T:63-->


<!--T:64-->
To control the layout of the assembly by the angle between the Base and the Crank we have to change the Revolute joint to a Fixed joint.<br>
To control the layout of the assembly by the angle between the Base and the Crank we have to change the Revolute joint to a Fixed joint.<br>
To do so double-click on the Revolute object in the Tree view. In the dialog change Revolute to Fixed and change the Rotation value as desired (the movement should follow the mouse wheel action).
To do so double-click on the Revolute object in the Tree view. In the dialog change Revolute to Fixed and change the Rotation value as desired (the movement should follow the mouse wheel action).


<!--T:65-->
Now only the Label of the joint was changed but not its Name! (Each change of the joint type will also change the Label)
Now only the Label of the joint was changed but not its Name! (Each change of the joint type will also change the Label)


<!--T:66-->
The Rotation property of the Fixed joint can be controlled via macro or from the python console (just copy and paste the following lines):
The Rotation property of the Fixed joint can be controlled via macro or from the Python console (just copy and paste the following lines):


</translate>
</translate>
Line 215: Line 255:
App.activeDocument().recompute(None,True,True)
App.activeDocument().recompute(None,True,True)
}}
}}
<translate>

<!--T:72-->
Or alternatively:
Or alternatively:

</translate>
{{Code|code=
{{Code|code=
actuator = FreeCAD.ActiveDocument.getObject('Revolute')
actuator = FreeCAD.ActiveDocument.getObject('Revolute')
Line 226: Line 271:
<translate>
<translate>


<!--T:67-->
(The Name of the joint is still Revolute while its Label has changed to Fixed, and the end of the range must be greater than 360 to also include this angle as a valid result.)
(The Name of the joint is still Revolute while its Label has changed to Fixed, and the end of the range must be greater than 360 to also include this angle as a valid result.)




<!--T:68-->
</div> <!-- End of collapsible element for ... section. Do not remove! -->
</div> <!-- End of collapsible element for ... section. Do not remove! -->
</div> <!-- End of collapsible element for ... section. Do not remove! -->
</div> <!-- End of collapsible element for ... section. Do not remove! -->
Line 235: Line 282:
<!--T:22-->
<!--T:22-->
{{Docnav
{{Docnav
|[[Arch_Workbench|Arch Workbench]]
|[[Std_Base|Std Base]]
|[[CAM_Workbench|CAM Workbench]]
|[[BIM_Workbench|BIM Workbench]]
|IconL=Workbench_Arch.svg
|IconL=Freecad.svg
|IconR=Workbench_CAM.svg
|IconR=Workbench_BIM.svg
}}
}}



Latest revision as of 19:03, 31 May 2024

Assembly workbench icon

Introduction

introduced in version 1.0

The Assembly Workbench is FreeCAD's new built-in assembly workbench.

Tools

Assembly

Joints

  • Create Gear/Belt Joint:

Example

This example is temporary and may be removed once proper descriptions/tutorials are available.

A kinematic assembly

The kinematic assembly to be created consists of four parts: a Base, a Slider, a Crank, and a connecting Rod. They are connected with four joints.

Assembled parts: Base (amber), Slider (light blue), Crank (red), connecting Rod (green)

Prepare parts

In this example all parts and the assembly are created in one document.

From left to right: Base, Slider, Crank, connecting Rod

Cylindrical geometries are either parallel or perpendicular, the rest of the shapes is not relevant for this example unless it causes clashes. With this in mind model your own shapes.

Add a root assembly

Create Assembly adds a root assembly to a document. (this tool can also add a sub-assembly to an existing selected assembly)

Tree view of Parts and Assembly in a document

Move the parts into the assembly container

In the Tree view drag and drop the parts on the Assembly object. Now they can be handled by the Assembly's solver.

The Parts are in the Assembly container now

Ground a part

To keep the assembly at the desired position, the base part should be locked, or grounded as it is called here. Select the Base in the Tree view or in the 3D view and use the Toggle grounded command. This fixes the position of the Base in relation to the local coordinate system (LCS) of the Assembly container. This (also suffixes a lock icon to the label of the Base object and (before weekly build 0.22 - 37213)) adds a GroundedJoint object in the Joints container.

Expand the Joints container to find the GroundedJoint object

(The GroundedJoint object cannot be unhidden and has no representation in the 3D view (before weekly build 0.22 - 37213))

Apply joints

A joint connects exactly two elements of different parts. They can optionally be selected before the desired joint tool is invoked (any number of selected elements other than two results in an empty selection).
The elements define the position and orientation of a LCS represented by a filled circle on the local XY plane and three lines along the local X (red), Y (green), and Z (blue) axes.

  • A Revolute joint between Base and Crank

Selected elements + Create Revolute Joint → rearranged Crank

  • A Cylindrical joint between Base and Slider

Selected elements + Create Cylindrical Joint → rearranged Slider

  • A Revolute joint between Crank and Rod

Selected elements + Create Revolute Joint → rearranged Rod

Now there are several joints in a line and we have to help the solver to find a sensible solution.
Click and drag the parts → into an easier to compute position.

  • A Cylindrical joint between Rod and Slider

Selected elements + Create Cylindrical Joint → finished Assembly

In the finished assembly use the mouse pointer to drag the parts according to the used joints.

Drive the crank

To control the layout of the assembly by the angle between the Base and the Crank we have to change the Revolute joint to a Fixed joint.
To do so double-click on the Revolute object in the Tree view. In the dialog change Revolute to Fixed and change the Rotation value as desired (the movement should follow the mouse wheel action).

Now only the Label of the joint was changed but not its Name! (Each change of the joint type will also change the Label)

The Rotation property of the Fixed joint can be controlled via macro or from the Python console (just copy and paste the following lines):

actuator = FreeCAD.ActiveDocument.getObject('Revolute')

for angle in range(0,361,10):
    # A full rotation of the Crank in steps of 10°
    actuator.Rotation = angle
    App.activeDocument().recompute(None,True,True)

Or alternatively:

actuator = FreeCAD.ActiveDocument.getObject('Revolute')

for angle in range(0,361,10):
    # A full rotation of the Crank in steps of 10°
    actuator.Rotation = angle
    Gui.runCommand('Assembly_SolveAssembly',0)

(The Name of the joint is still Revolute while its Label has changed to Fixed, and the end of the range must be greater than 360 to also include this angle as a valid result.)