Assembly Workbench: Difference between revisions

From FreeCAD Documentation
(→‎Drive the Crank: recompte/solve command added to macro, auto recompute/solve seems to be a bit unreliable)
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 25: Line 25:
The [[File:Workbench_Assembly.svg|24px]] [[Assembly_Workbench|Assembly Workbench]] is FreeCAD's new built-in assembly workbench.
The [[File:Workbench_Assembly.svg|24px]] [[Assembly_Workbench|Assembly Workbench]] is FreeCAD's new built-in assembly workbench.


<!--T:9-->
==Tools== <!--T:10-->
More to come...


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

===Assembly=== <!--T:24-->


<!--T:11-->
<!--T:11-->
Line 38: Line 40:
<!--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}}]].


<!--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=== <!--T:26-->


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


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

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

<!--T:29-->
* <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]]: [[Fine-tuning#Assembly_Workbench|{{Emphasis|Experimental feature}}]].

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


==Example==
==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 78: Line 101:
<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 91: Line 116:
<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 103: Line 131:
<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 113: Line 143:
<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 125: Line 157:
<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 141: Line 177:
<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 151: Line 189:
<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 161: Line 201:
<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 169: Line 210:
<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 179: Line 222:
<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):


Line 212: Line 260:
<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! -->

Latest revision as of 15:41, 23 May 2024

Assembly workbench icon

Introduction

introduced in version 1.0

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

Tools

Experimental features are not available by default. To enable them see Fine-tuning.

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