Assembly Workbench: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(example added to show that Assembly is already quite useful)
(2 intermediate revisions by one other user not shown)
Line 20: Line 20:


<!--T:7-->
<!--T:7-->
{{Version|0.22}}
{{Version|1.0}}


<!--T:8-->
<!--T:8-->
Line 46: Line 46:


<!--T:16-->
<!--T:16-->
* [[Image:Assembly_CreateJointFixed.svg|32px]] [[Assembly_CreateJointFixed|Create Fixed Joint]]
* [[Image:Assembly_CreateJointFixed.svg|32px]] [[Assembly_CreateJointFixed|Create a Fixed Joint]]


<!--T:17-->
<!--T:17-->
Line 62: Line 62:
<!--T:21-->
<!--T:21-->
* [[Image:Assembly_CreateJointDistance.svg|32px]] [[Assembly_CreateJointDistance|Create Distance Joint]]
* [[Image:Assembly_CreateJointDistance.svg|32px]] [[Assembly_CreateJointDistance|Create Distance Joint]]


==Example==

<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.
<div class="mw-collapsible-content">

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

</translate>
[[Image:Assembly3_KinematicExample-01.png|300px]]
<translate>

{{Caption|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.

</translate>
[[Image:Assembly3_KinematicExample-02.png|200px]]
[[Image:Assembly3_KinematicExample-03.png|200px]]
[[Image:Assembly3_KinematicExample-04.png|200px]]
[[Image:Assembly3_KinematicExample-05.png|200px]]
<translate>

{{Caption|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====

[[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)

</translate>
[[Image:Assembly_KinematicExample-01.png|200px]]
<translate>

{{Caption|Tree view of Parts and Assembly in a document}}

====Move the parts into the Assembly container====

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.

</translate>
[[Image:Assembly_KinematicExample-02.png|200px]]
<translate>

{{Caption|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|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 adds a GroundedJoint object in the Joints container.

</translate>
[[Image:Assembly_KinematicExample-03.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-04.png|240px]]
<translate>

{{Caption|Expand the Joints container to find the GroundedJoint object}}

The GroundedJoint object cannot be unhidden and has no representation in the 3D view.

====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).<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 Revolute joint between Base and Crank

</translate>
[[Image:Assembly_KinematicExample-05.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-06.png|200px]]
<translate>

{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Crank}}

* A Cylindrical joint between Base and Slider

</translate>
[[Image:Assembly_KinematicExample-07.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-08.png|200px]]
<translate>

{{Caption|Selected elements +[[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|Create Cylindrical Joint]] → rearranged Slider}}

* A Revolute joint between Crank and Rod

</translate>
[[Image:Assembly_KinematicExample-09.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-10.png|200px]]
<translate>

{{Caption|Selected elements + [[Image:Assembly_CreateJointRevolute.svg|16px]] [[Assembly_CreateJointRevolute|Create Revolute Joint]] → rearranged Rod}}

</translate>
[[Image:Assembly_KinematicExample-11.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-12.png|200px]]
<translate>

{{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.}}

* A Cylindrical joint between Rod and Slider

</translate>
[[Image:Assembly_KinematicExample-13.png|200px]]
[[Image:Button_right.svg|16px|link=]]
[[Image:Assembly_KinematicExample-14.png|200px]]
<translate>

{{Caption|Selected elements +[[Image:Assembly_CreateJointCylindrical.svg|16px]] [[Assembly_CreateJointCylindrical|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.<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).

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):

</translate>
{{Code|code=
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
}}
<translate>
(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.)

</div> <!-- End of collapsible element for ... section. Do not remove! -->
</div> <!-- End of collapsible element for ... section. Do not remove! -->





Revision as of 08:49, 2 May 2024

Assembly workbench icon

Introduction

introduced in version 1.0

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

More to come...

Tools


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

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

(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.)