Assembly Basic Tutorial/fr

Ce tutoriel vous donnera des informations sur le flux de travail de l'assemblage actuel tout en fournissant l'arrière-plan de la conception utilisée. L'objectif est de comprendre le fonctionnement de l'atelier d'assemblage, sa structure et son utilisation.

Cet atelier est à un stade de développement précoce, par conséquent, vous rencontrerez un comportement incohérent et toutes sortes d'erreurs / de plantage. Veuillez signaler les problèmes reproductibles à [assembly sub-forum] ou sur [mantis bug tracker].

Comment bouger les éléments : Systèmes de coordonnées
Le but d'un atelier d'assemblage est de déplacer des pièces. Il est donc évident qu'il doit y avoir un moyen de réaliser cette transformation de pièces, et cette partie de l'introduction concerne cette fonctionnalité de base.

Dans FreeCAD, chaque objet de l'espace 3D possède son propre système de coordonnées. Ce système local est mis en relation avec son système parent par une transformation, son placement. Le placement de l'objet définit comment la géométrie locale doit être translatée et tournée pour être exprimée dans le système des parents. Ainsi, si vous déplacez une pièce en modifiant sa propriété de placement, vous ne modifiez pas la pièce, mais seulement la transformation de son système de coordonnées dans le système parent. Imaginez une boîte simple créée dans le plan de travail Part. Une fois créée, le paramètre "longueur" change la dimension de la boîte dans la direction x locale. Comme le placement est vide, c'est aussi la direction x globale. Si vous faites pivoter la pièce en définissant un axe de rotation et un angle, la longueur sera toujours dans la direction x locale, cependant, visuellement, elle ne changera plus sur x lorsque les images seront présentées dans le système de coordonnées global. La géométrie de la boîte n'a pas changé, seule la visualisation est transformée.



Cela faciliterait le déplacement de pièces uniques: il suffit d'adopter son emplacement. Cependant, dans FreeCAD, la plupart des dessins sont faits avec de nombreuses fonctionnalités (protrusions, poches, etc.), comment gérer cela? Déplacer toutes les fonctionnalités? Seul le dernier? Les deux façons introduiraient un comportement de modélisation très problématique, donc une troisième méthode est utilisée: ne pas déplacer les fonctionnalités du tout! Au lieu de cela, le concept d'un corps a été introduit dans la modélisation générale, tout ce qui est fait dans la conception de la pièce est maintenant groupé en dessous. Cet objet possède également une propriété de placement et peut être transformé.

Revenons aux systèmes de coordonnées locaux et parentaux: le corps est l'incarnation parfaite de ce concept! Chaque fonctionnalité sous le corps ne peut pas être déplacée directement, son placement est toujours vide. Cela signifie que la géométrie de l'entité n'a pas besoin d'être pivotée ou translatée si nous voulons l'exprimer dans le système de coordonnées des corps. Mais nous pouvons déplacer le corps à l'intérieur du système de coordonnées global en définissant son emplacement, puis la valeur globale de la géométrie de l'entité est calculée en appliquant également cette transformation. Rappelez-vous, nous faisons tourner les systèmes de coordonnées. Cela signifie que si nous transformons le système du corps, tout ce qui est en dessous l'utilise comme son système global personnel. Il n'y a pas besoin de déplacer les fonctionnalités du tout. Vous voulez tout votre dessin à un endroit différent? Il suffit de définir le placement du corps!

To summarize: Coordinate systems can be stacked, every object uses its parents system as personal global one. If the parents coordinate system is transformed, all children get transformed too without changing their local systems.

What can be assembled: Object model
With the Body object we have everything we want for assembly: we can move complex designs in a comprehensible way, right?. Not quite! What would happen if you want to have your design many times inside the assembly? For example if you modeled a screw, you don't want to remodel it again every time you need one. Copying may work, however, what if you change your screw design: change all copies? That would be very annoying. To overcome this, again a new object is introduced: the part. A part is a pure assembly object and can only be created inside this workbench. Its purpose is to reference a body object and provide another coordinate system.

To understand why it's introduced we have to consider how things are moved in FreeCAD. Lets extend the body chart above with two parts referencing the same body as shown in the next picture.



The bodys local system is the same in both parts, however, the parts have their own placements and therefore can be transformed in respect to the global system. As placements get applied recursively, the very same features can end up on different positions. Imagine you change the parts placement P4 and P5 to different values, your design would appear in two total different places inside the global system without any changes to the features or the body holding them. And then imagine changing the body's coordinate system P3: You would change the position of all incarnations of your design in the same manner!

You may wonder how you design can be in two places while being only one geometry. Thats simple: The part shows only a visual representation of the geometry inside the body, and you can have many pictures of your single part. Also those visuals representations are transformed if you set the placement. A part holds absolutely no modeling information.

Back to our use case: if you need 100 screws you will model only one body with your design. Then you can add as much parts as you want holding this one body. By applying different placements to the parts only you can move the screws around as you want. And if you change something in your design, the body gets updated and every part too, as they all reference it. Awesome!

Now imagine another use case: you have a nice electrical motor assembly consisting of multiple parts, are all moved to the right position. Afterwards you want to create a bigger machine and you need multiple electrical motors for it. What we want is to reuse the motor assembly, the same reasoning as with the multiple body incarnations apply. For simple designs we were able to create multiple parts from one body, however, we can't create a part from multiple parts. Therefore we need another object which can do that! FreeCAD introduces the product object for this. A product is basically a full assembly with multiple parts, but also has a placement property. What does that mean? It becomes clear when we again extend the coordinate system chart with our new product object.



Now our parts are not anymore beneath the global coordinate system, but they are grouped beneath the product. For the parts nothing change: they works as before. And in fact, if our Product1 would have been the top-level object, absolutely nothing would change at all. The global system is just replaced by a product coordinate system which acts as global one. In our example however, we added the product to another product, together with a third part. Now it gets interesting: As a product has a placement property, it can be moved! And we already learned that such a transformation is applied to all children. Therefore parts 1 and 2 would move when you change the placement of Product1.

Back to our example: Product1 would be the electrical motor, Product2 the big machine. Now you can add multiple products to the machine which all reference the same parts as Product1, hence all representing a electrical motor. And as every product can be placed diffrently, you can move all motors to diffrent positions. Combine it with other parts and assemblies and you can build a complex machine. Again, if you update one body, all parts and therefore all products referencing it get updated.

At last you may ask why there is no global coordinate system in the last picture. Thats because nothing like a global coordinate system exists, it was just a concept for easy explaining. If you assembly your electrical motor, the top-level coordinate system would be the Product1 system. However, this is not a general global one, as you can add it to a another product which is the top-level cs afterwards. And this can be added to another, and so on. There is nothing like a global coordinate system, just a top-level one.

To summarize: In the assembly workbench you can combine parts to assemblies (products). These products can be staked together with other parts in arbitrary numbers.

How to set Relations: Assembly Constraints
Up to now we discussed all details of moving things around with placements and the objects involved in it. It is however very tedious to calculate all placements by hand and set them manual via the property editor. It would be more pleasant if it would be possible to set simple relations between parts instead of abstract rotations and translations. Therefore FreeCAD introduces assembly constraints. As the name indicates, they work the same way as in the sketcher: the user applies different attributes to geometries of the parts. This can be for example the distance between two points, or their orientation (parallel, perpendicular) of lines etc. FreeCAD trys then to find placements which satisfy all given constraints.



To assemble things in the real world, one would use the parts structure to fit the counterpart into its place, for example a bolt which belongs into a hole. Or surfaces which touch each other and therefore define the parts exact position. In FreeCAD it works exactly like that: you use the parts geometry to specify where the second part belongs to. At your disposal are points, straight lines, planes and cylinders. The picture to the right shows them all in the FreeCAD environment. But of course, the geometry alone is not enough to calculate the parts positions, the kind of relation needs to be known too. For example two faces: They can touch each other, or just be parallel, maybe even perpendicular. This relation is set in FreeCAD through the already mentioned assembly constraints. You have 6 diffrent types at your hand: Fix, Distance, Orientation, Angle, Align and Coincident. Lets see what they all do and how to use them.

Fix
The fix constraint is the simplest of all constraints. It only needs one part to be selected and then it fixes its position and its rotation. No matter what you do to this part afterwards: it will hold its place. And thats the whole purpose of that type. It's most useful to have always one fixed part per assembly, as it can be annoying if all parts get moved to satisfy other constraints. If you fix the most basic part in your assembly, all other parts will move towards it which gives you a pleasant experience. Note that this constraint works only in the assembly it is created in, the part will not be fixed in any parent assembly (remember: assemblies can be stacked).

Distance
As you already guessed from the name, with this constraint you can specify the distance between two geometries. This works for two points, but also for a point and a line, or a line and a cylinder and many more combinations. This constraint is pretty simple, but two points need mentioning: First, if there are multiple possible distances between geometries, for example the last mentioned line and cylinder, then the shortest distance is used. Second, sometimes multiple solutions exist even for the shortest distance. This is the case for the point-plane distance: every value can be satisfied with the point above AND below the plane. So if you only specify the value, it can happen that FreeCAD puts the point at the wrong side of the plane. To control this, the distance constraint has a special option, the solution space. This option allows to reduce the space of possible solutions, so that it matches your wishes. Lets see how this works on our small example: