Basic Attachment Tutorial/fr



Part:Attachment, Ce tutoriel servira d'introduction à il n'est pas très facile à comprendre, mais utile aux utilisateurs pour plus de détails : questionner des utilisateurs confirmés

Attachment est un utilitaire pour attacher un objet à un autre. Cela lie les propriétés de placement des deux objets, l'objet attaché suivra alors l'original (si son placement est modifié.) L'accent est mis sur l'atelier Part Design et l'attachement d'esquisses à d'autres esquisses, ceci étant une méthode recommandée pour créer des modeles stable. Écrit pour la V0.19, mais devrait être valide pour toute version V0.17 et ultérieure. Cependant, les choses peuvent différer dans certains détails. Le modèle original a été conçu par Md. Aminul Islam et téléchargé à partir d'ici
 * -https://grabcad.com/library/50-cad-exercise-drawing-1

Prérequis
Avent de demarrer ce tutoriel l'utilisateur doit :-
 * 1) avoir la version V0.17 ou supérieure.
 * 2) Être à l'aise avec la navigationde vues en 3D  3D view.
 * 3) Être capable de contraindre un sketchsketch.
 * 4) Avoir un connaissance basique deWorkbench_PartDesign.svg Part Design workbench.
 * 5) et dans Expressions.

Objectifs
Le but de ce didacticiel est de montrer comment un modèle peut être construit en positionnant des esquisses par rapport à d'autres géométries à l'aide de certains des différents modes d'attachement disponibles.

Bien qu'il soit possible d'utiliser la géométrie solide (Sommets, Arêtes et Faces) pour la géométrie de référence, dans l'intérêt de ce qui est considéré comme une bonne pratique, ce tutoriel s'abstiendra de le faire. Voir Feature Editing pour plus d'explications.

Préliminaires
Avant de commencer, examinons comment nous devrions procéder pour construire ce modèle.

Quel que soit l'angle sous lequel nous le regardons, nous voyons un carré ou un rectangle avec un coin coupé.



Il existe cependant un axe évident à partir duquel toutes les caractéristiques sont communes.

Il est parfaitement possible de créer une géométrie de données ici et d'y attacher toutes les esquisses. Dans certains modèles, ce serait un choix judicieux, pour les besoins de ce didacticiel, nous nous limiterons aux plans Standard et aux croquis.

Nous pourrions faire un croquis sur n'importe lequel des grands plans. Nous pourrions inclure un coin coupé dans notre croquis de base, mais abandonnons cela et incluons un croquis et une pocket supplémentaire, à des fins d'apprentissage.



Attachment
Nous allons commencer avec un bloc et couper l'excédent.

Basculez vers l'atelier Part Design, ouvrez un nouveau document, créez un corps et une nouvelle esquisse sur le plan XY.

Là, vous venez de faire un attachement. Lorsque vous sélectionnez le plan sur lequel réaliser l'esquisse, c'est en fait ce qui est fait, le dialogue de sélection de plan n'est qu'une version simplifiée du dialogue d'attachement, où tous les décalages sont mis à zéro.

Faire un sketch d'un rectangle centré sur l'origine contraindre avec une longueur (horizontale ) 70mm largeur (verticale) 40mm

Sélectionner le sketch(presser le bouton F2)et le renommer "BaseSketch"



Top

Mode d'attachement
Si nous laissons l'esquisse où elle est, l'exemple serait trop simple, modifions donc la position de l'esquisse en modifiant son décalage de position.

Dans la vue combinée (onglet Données), regardez dans la section Attachment du volet des propriétés, ici nous pouvons voir que BaseSketch a un support de XY_Plane et est attaché avec le mode Flat Face. Regardez plus bas et trouvez la pièce jointe Offset et développez-la en cliquant sur le signe plus à côté.

Faire de même pour le sous-titre Position. Modifier le décalage X à 80 mm et le décalage Y à 90 mm.



Attachment offset is commonly used in conjunction with expressions to offer a parametric parallel to plane position, eg. positioning a sketch on the top face of a Pad, using a (Pad.Length) expression for Z offset.

L'esquisse peut maintenant être extrudée, supposons que la hauteur du pad doit être la même que la largeur de l'esquisse. Dans la boîte de dialogue Paramètres du pad, sélectionnez la case Longueur, appuyez sur '=' ou sélectionnez l'icône de fonction et tapez " Sketch.Constraints.width", cette expression doit être résolue en "40 mm", puis cocher Symetric au plan et appuyez sur touche OK.



Faisons le prochain croquis, peu importe lequel nous choisissons, mais le plus simple est le triangle isocèle 20x20 qui courre sur toute la longueur du bloc.

Make a new sketch, choose whichever plane you like (we're going to change its attachment anyway.)

Draw the triangle, make two sides equal and constrain the length the same way as you did the Pad Length only this time make the formula "Sketch.Constraints.width/2".

There should be two degrees of freedom remaining, they are the position with regards to the origin. Fix one of the corners to the origin so that the sketch looks thus:-



Top

Changing Attachment
Close the sketch. Rename the sketch, call it 'IsoscelesSketch'. The origin of the sketch is the point that will be attached in the future, so choosing how the sketch is constrained to the origin is important. The origin can be thought of as hook that catches onto the reference. We can adjust the position of the sketch using offsets, but it is better to choose wisely in the first place.

Now we are going to change the attachment mode of the sketch in our model.

Select Pad and make it invisible, and make BaseSketch visible. We need to see the BaseSketch, and we want to hide the pad so that we avoid making incorrect selections.

The 3D view should look something like this:-



I chose the XY plane for my isosceles sketch, yours may be different.

Now we need to select IsoscelesSketch and go to the properties pane in the Combo view. Click in the value box next to the Map Mode property, a button will appear with an elipsis.



Click on that and a task pane will open with the Attachment Dialogue.



Here we can see the attachment that we chose when the sketch was created (in the select Plane dialogue.)

The  button is in selecting mode, so in the 3D view select one of the long sides of the Base Sketch.

The IsoscelesSketch will attach itself to the line you selected, and the attachment mode window will change to reflect the available modes.





You can see that the IsoscelesSketch has been attached to the selected line at the point we constrained to the origin earlier on.

This concept of the origin being the attachment point is important, it makes the attachment modes very flexible, and can be a powerful tool in your modeling.

It can be used with the addition of offsets to precisely position sketches without relying on generated geometry and all the problems that may arise from using them.

FreeCAD tries to predict the attachment mode for you, and filters the modes available for the given selection.

In this case, the options are "Deactivated," "Normal To Edge" and "Inertia 2-3". Normal To Edge is in bold and is deemed the preferred selection.

The notification area at the top of the dialogue, shows a message in green stating the mode in use.

Grayed out options show that more selections are required in order to activate them.

At this point you could make another selection, and see the difference in modes. Don't forget to change back to "Normal To Edge" mode before continuing with the tutorial.

The IsoscelesSketch is now correctly positioned so confirm and exit the dialogue.

You can now pocket the sketch.



Top

A Step Further
Create the next sketch, the dimensions should be expressions ("Sketch.Constraints.width","Sketch.Constraints.width/2") and it should be constrained to the origin at the vertex adjacent the hypotenuse and its shortest side. (In the empty sketch, if you are familiar with you can use it to make a copy of the 'IsoscelesSketch' sketch, and edit its parameters to suit.)

Rename the sketch RightAngleTriangleSketch.



Once again we need to hide the solid, in this case Pocket, and make sure both sketches are visible for selection (leave isoscelesSketch invisible it will just get in the way!).

Select RightAngleTriangleSketch and open its attachment mode dialogue.

Select one of the rectangles short sides as the first reference.



The 3D view should be similar to the picture above. It is not important which end of the line the triangle is attached to (it depends on how the rectangle was drawn!)

If you chose the wrong line, change it now. If the triangle is pointing the wrong way you can correct it by checking the "Flip Sides" checkbox at the bottom of the dialogue (or later on after closing the dialogue it can be changed in the properties data tab by setting "Map Reversed" to "True").

The RightAngleTriangleSketch is now in a position that will give us the correct Geometry after a pocket operation, however we can get a little inventive here, and position the sketch so that it makes it easier for us to attach further geometry later on. We are going to shift our sketch to the middle of the line so that it provides us with a vertex at the top of the corner chamfer.

In the attachment dialogue, we are going to change the attachment mode from "Normal To Edge" to "Inertia 2-3". This will change the position to the centre of the line, it's beyond the scope of this tutorial to describe all the attachment modes, their descriptions can be found at Part Attachment. Suffice to say inertia 2-3 uses the centre of mass and does the job here.





The RightAngleTriangleSketch is now correctly positioned so confirm and exit the dialogue.

You can now pocket the sketch. This time use Symmetric to plane.



Top

Manipulating Attachment
In general it is better to position our sketches simply with attachment modes. But it is not always possible to position the sketches exactly where we need without modifying the attachment mode in some way.

FreeCAD provides a number of ways to do this.


 * 1) Attachment offset, allows positioning relative to the local coordinates of the attachment point. (where the origin of the positioned sketch is attached.)
 * 2) Map Path parameter (in the Property data tab with show all enabled) This allows for the positioning along a selected edge.
 * 3) Flip Sides/Map Reversed. Effectively mirrors the sketch.

For our final sketch, we will Attach it arbitrarily, and correct its position using the modifiers listed above.

Create the final sketch, the dimensions should be expressions("Sketch.Constraints.width","Sketch.Constraints.width/2") and it should be constrained to the origin at the vertex adjacent the hypotenuse and its shortest side.

Rename the sketch FinalSketch.



Note that FinalSketch has been constrained to the origin differently. Otherwise we could've used, but the sketch is only Three lines and five constraints.

Once again we need to hide the solid, in this case Pocket001, and make sure both sketches are visible for selection (BaseSketch and FinalSketch).

Select FinalSketch and open the attachment dialogue, Select one of the rectangles short sides as the first reference.



The 3D view should be similar to the picture above. It is not important which end of the line the triangle is attached to (it depends on how the rectangle was drawn!)

Now we need to Flip(mirror) it, translate it through 90&deg; and shift it up to the corner.

At the bottom of the attachment dialogue is a check box labeled 'Flip Sides', check this box.

The FinalSketch mirrors itself.

Now we will translate through 90&deg;. From the illustration FinalSketch above we can see the axis of revolution should be the X axis. In the Wiki this termed Roll. Remember this is relative to the local Coordinate System. Enter 90&deg; in the "around X-axis" box of the attachment offset section of the dialogue.





We could use Z-direction offset -- which now corresponds to the opposite Y-direction in the global coordinate system -- to shift FinalSketch to the corner, but I would like to demonstrate another feature.

So let's confirm and close the dialogue for now.

Top

Map Path Parameter
Select FinalSketch and look in the combo view, properties pane in the attachment section, just below the Map Mode property is the Map Path Parameter.



The default setting is 0.0 if we change it to 1 the sketch will map to the other end of the line, and 0.5 gives us half way. Enter 0.5 in the value column.

The combination of 'Normal To Edge' and Map Path Parameter is very useful for positioning sketches for Lofts or Sweeps.



You can now pocket the sketch. Don't forget to use Symmetric to plane.



Top

A Different Selection Mode
So far we have seen how to position sketches with attachment modes and offsets, but we could've used Standard planes because the relative positioning was quite simple.

Now we are faced with a more challenging problem, how do we cut away this lump that's left?



We can sees that there is a plane that passes through the corners of the red triangle, it would be simple if we could just slice it away there.

Well because we were careful with how we positioned our sketches earlier on, we can!

First make the solid invisible, in fact make everything except RightAngleTriangleSketch and FinalSketch invisible.

Now select the three points that form the plane, Don't forget to hold the key (CMD on a Mac) while making the selection.



When pressing, the attachment Dialogue will open showing the three points you selected as references 1-3 and a mode of 'Plane By 3 Points'.



Confirm and close the Dialogue. We could now use the Datum Plane to create a Sketch, but there is no need we can use the plane directly to pocket the excess material away. Make sure the datum Plane is selected, and click on pocket, in the pocket Dialogue select "through all" and "reversed". Close the Dialogue and we are all done.



Top

Temporarily attaching to a generated plane
Sometimes it is difficult to work out how to align sketch or datum plane to generated face without actually attaching to it, which as noted above can be problematic. One solution is to attach to the generated geometry and then change the attachment to one of the coordinate planes. FreeCAD will retain the existing position and orientation intact but now reference it to stable planes, thus avoiding the topological renaming problems. However, the cost of doing this that the parametric linkage to the generated geometry is lost. If the underlying model is change, it will not all fall apart as often happens when attaching to generated geometry but attachment will not follow the changes and will need adjusting by repeating the temporary attachment trick.

The previous method is more robust but more abstract and complex to achieve. The temporary attachment trick is quick and easy to implement, more robust than attachment to generated geometry but looses a degree of linkage in the parametric modelling process.

Conclusion
Part Attachment does not guarantee a robust model, the key is to avoid attaching or placing sketches on generated geometry such as faces or edges of pads and pockets.

There are many attachment modes available to users, only the basics are covered here.

One important thing to take away from this tutorial, is the importance of the origin being the 'Hook'. Remember also that orientation is in Local Coordinate System.

Happy Attaching!

Top