Creating a simple part with PartDesign: Difference between revisions

From FreeCAD Documentation
(Create page from GlouGlou's Sandbox tutorial, translating to English in progress.)
 
(Changed remaining 24px icons to 32px.)
(34 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<languages/>
{{Message|This tutorial is being translated in English from [[Sandbox:Tuto_GlouGlou1]]. It is not yet ready to mark for translation.}}
<translate>

<!--T:1-->
{{TutorialInfo
{{TutorialInfo
|Topic=Modeling
|Topic=Modeling
Line 7: Line 8:
|Time=1 hour
|Time=1 hour
|FCVersion=0.17 or above
|FCVersion=0.17 or above
|Files=[https://github.com/FreeCAD/Examples/blob/master/Creating_a_simple_PartDesign_Body.FCStd Creating a simple PartDesign Body.FCStd]
|Files=[url-du-fichier nom-du-fichier]}}
}}




</translate>
[[Image:GGTuto1_Vue.PNG|center]]
[[File:GGTuto1_Vue.PNG|center]]
<translate>


<!--T:2-->
This tutorial aims to teach FreeCAD beginners a few basic features through an example.
This tutorial aims to teach FreeCAD beginners a few basic features through an example.
After covering the basics in the [[User hub]], you will be able to model a first part step by step.
After covering the basics in the [[User hub]], you will be able to model a first part step by step.


<!--T:3-->
'''We will cover in this tutorial in particular:'''
'''We will cover in this tutorial in particular:'''


<!--T:4-->
* Using [[PartDesign_Workbench|Part Design workbench v0.17]], tracing the sketch.
* Using [[PartDesign_Workbench|Part Design workbench]], tracing the sketch.
* Using Pad and Pocket features.
* Using Pad and Pocket features.
* Changing color and transparency.
* Changing color and transparency.
Line 26: Line 31:
* Using external geometry feature and using a reference plane to centre a hole.
* Using external geometry feature and using a reference plane to centre a hole.


===Using [[PartDesign_Workbench|Part Design workbench]], tracing the sketch=== <!--T:5-->


<!--T:6-->
Create a new document and switch to the {{KEY|[[File:Workbench_PartDesign.svg|32px]] '''Part Design workbench'''}} using either the [[Getting_started#Exploring_FreeCAD|workbench selector]] (labelled 6 in the linked image) or by going to the ''View → Workbench'' menu. FreeCAD will start with toolbars at the top, the combo view to the left and the 3D view at the right.


<!--T:7-->
===Using [[PartDesign_Workbench|Part Design workbench v0.17]], tracing the sketch===

Create a new document and select the Part Design workbench. Freecad will start with toolbars at the top, the combo view to the left and the 3D view at the right.

'''Create body:'''
'''Create body:'''


<!--T:8-->
Press [[File:PartDesign Body.png|32px]] [[PartDesign Body|Create body]]. A body is a container in which Part Design features are sequentially arranged. It contains its own reference axes and planes. It will be highlighted in light blue, which means that it is active, that is to say that we can edit shapes. If it's not highlighted, double-click it. Let's take the opportunity to rename it.
Press [[File:PartDesign_Body.svg|32px]] [[PartDesign Body|Create body]]. '''''Note:''' do not confuse the Body, which icon is blue, with the Part container which icon is yellow.'' In the Model tab under the Combo View sidebar, a new object labelled "Body" appears under the document label, which is currently "Unnamed" since we haven't saved our document yet. The Body is a container in which Part Design features are sequentially arranged to form a single solid. It contains its own reference axes and planes. It will be highlighted in light blue in the Model tree, which means that it is active, that is to say that we can edit the elements it contains as well as add new elements to it. If it's not highlighted, double-click it or right-click and select ''Toggle active body'' in the contextual menu. In front of the Body label, there is a blue icon identical to the one above, and an arrow or a plus sign, depending on your operating system. Clicking on the arrow or plus sign in front of Body expands its content. At this point, it only contains an element labelled ''Origin''. In front of this ''Origin'' is also an arrow or plus sign. Click on it to expand its content. It reveals the aforementioned reference axes and planes as shown in the image below:
</translate>
[[File:PartDesign Body tree Unnamed.png|none]]
<translate>
<!--T:101-->
''The newly created active Body with its content expanded.''
The ''Origin'' is greyed out, which indicates that its content is not visible in the 3D view. You can make ''Origin'''s content visible in the 3D view by selecting ''Origin'' and pressing the spacebar on your keyboard. ''Origin'' will now show black in the tree. Press the spacebar again to hide its content in the 3D view. Click again on the arrow or plus sign in front of ''Origin'' to collapse its content in the Model tree.
Before we continue, let's take the opportunity to rename the Body.


<!--T:9-->
'''Rename body:'''
'''Rename body:'''


<!--T:10-->
Click on the body with the right mouse button. Select Rename and type a name, for example "Body part1" and press {{KEY|Enter}} to validate.
In the Model tree, click on the Body with the right mouse button. Select Rename and type a name, for example "Body part1" and press {{KEY|Enter}} to validate.


<!--T:11-->
'''Create sketch:'''
'''Create sketch:'''


<!--T:12-->
We will now trace the sketch which defines the general shape of the part. A sketch is a diagram describing a profile to be applied to a feature in order to produce a shape. It can be either "positive" or "additive", like a pad for example; or "negative" or "subtractive", like a pocket.
We will now trace the sketch which defines the general shape of the part. A sketch is a diagram describing a profile to be applied to a feature in order to produce a shape. It can be either "positive" or "additive", like a pad for example; or "negative" or "subtractive", like a pocket.


<!--T:13-->
Here, since the part's general shape is regular along the Y axis, we will create the Pad along this axis.
Here, since the part's general shape is regular along the Y axis, we will create the Pad along this axis.


<!--T:14-->
Press [[Image:Sketcher_NewSketch.png|32px]] [[Sketcher_NewSketch/fr|New sketch]]. FreeCAD then offers to attach this sketch to a plane of the Body; select the XZ plane and press {{KEY|OK}}. The interface now changes, the Sketcher now takes over and its toolbars appear over the 3D view. We find ourselves on the XZ plane of the body to trace the sketch.
Press [[Image:Sketcher_NewSketch.svg|32px]] [[Sketcher_NewSketch|New sketch]]. The Combo View now switches to the '''Tasks''' tab and displays the ''Select feature'' dialog. This dialog expects the selection of a plane to which to attach our sketch, and lists the available planes. Select ''XZ_Plane (Base plane)'' and press {{KEY|OK}}. The interface now changes, the Sketcher now takes over and its toolbars appear above the 3D view. We find ourselves on the XZ plane of the body to trace the sketch.


<!--T:15-->
Pour faciliter le dessin, vérifiez à gauche dans "Modifier les contrôles" les options choisies: "Afficher la grille:ok", "Taille de la grille:10mm", "Contraintes auto:ok"
To aid with sketching, set the following options in "Edit controls" in the Tasks panel to the left:
Nous allons dessiner l'esquisse suivante:[[Image:GGTuto1_0.PNG|center]]
* Show grid: checked
* Grid size: 10 mm
* Auto constraints: checked


<!--T:16-->
'''Commençons les premiers segments:'''
We will trace the following sketch:


</translate>
Choisissez l'outil [[Image:Sketcher_Line.png|32px]] [[Sketcher_Line/fr|Ligne]].
[[Image:GGTuto1_0.PNG|center]]
Cliquez sur l'origine et second clic sur l'axe des X environ à 10 cases soit environ 100mm. Si le segment ne fait pas exactement 100mm à ce stade, ce n'est pas grave, nous allons par la suite donner une cote fixe qui va contraindre cette longueur.
<translate>


<!--T:17-->
Faites de même pour les autres segments, essayez de viser les points que vous avez créés qui doivent s'éclairer en jaune. Ce qui signifie que ces points seront coïncidents. Vous devriez obtenir à peu près ceci:[[Image:GGTuto1_1.PNG|center]]
'''Let's start with the first segments:'''
Remarquez les petites lignes rouges au dessus et à coté des segments que vous avez tracés: il s'agit de contraintes d'horizontalité et de verticalité. Vos lignes sont forcées à rester soit horizontales, soit verticales.
Remarquez également le symbole en forme d'un petit arc à gauche: il signifie que le point appartient à l'axe des Z.


<!--T:18-->
Saisissez maintenant différents segments avec le bouton gauche de la souris et tout en gardant le bouton gauche enfoncé, essayez de les déplacer: certains sont libres d'autres non.
Select the [[Image:Sketcher_Line.svg|32px]] [[Sketcher_CreateLine|Line]] tool. Click on the origin point, first making sure that a small red dot appears besides and to the right of the mouse pointer. Click next on the X axis about 10 squares to the right or at about 100 mm. If the segment is not exactly 100 mm at this point, it does not matter, we will later give it a fixed dimension that will constrain this length.


<!--T:19-->
'''Appliquer des contraintes:'''
Do the same for the other segments, try to aim at the points that you have created which must light up in yellow. Which means that these points will be coincident. You should get pretty much this:


</translate>
En haut de la boite combinée on peut lire le nombre de degrés de liberté des éléments déjà dessinés: il doit être d'environ 6, l'objectif des contraintes est d'arriver à 0.
[[Image:GGTuto1_1.PNG|center]]
<translate>


<!--T:20-->
Le segment incliné doit être libre actuellement de tourner: nous allons lui donner une contrainte d'angle pour le fixer.
Note the small red lines above and beside the segments you have drawn: these are horizontal and vertical constraints. Your lines are forced to stay either horizontal or vertical. Note also the symbol in the form of a small arc on the left: it means that the point is fixed to the Z axis.


<!--T:21-->
Cliquez dessus, puis le segment du bas, ces segments doivent être jaunes, puis cliquez sur l’icône [[Image:Constraint_InternalAngle.png|32px]] [[Constraint_InternalAngle/fr|Angle Interne]]. [[Image:GGTuto1_2.PNG|center]]
Now pick different line segments with the left mouse button and while keeping the left button pressed, drag the mouse to try to move them: some are free, others not.
Entrez la valeur de 30°. Les deux segments ont un angle fixe désormais. Déplacez cette contrainte à l'intérieur du schéma.


<!--T:22-->
Nous allons maintenant contraindre le segment du bas avec une cote: Cliquez dessus puis cliquez sur [[Image:Constraint_HorizontalDistance.png|32px]] [[Constraint_HorizontalDistance/fr|Distance horizontale]].
'''Applying constraints:'''


<!--T:23-->
Donnez la valeur de 100mm. Le segment vertical à droite s'aligne exactement avec le quadrillage de 10 cases. Logique, puisque un carreau fait 10mm!
At the top of the combo box, in the Tasks panel, you can read the number of degrees of freedom of the already sketched elements: it must be about 6, the objective of the constraints is to reduce the number of degrees of freedom to 0.


<!--T:24-->
Donnons la hauteur générale à la pièce en sélectionnant le point le plus haut à gauche et l'origine. Cliquez sur [[Image:Constraint_VerticalDistance.png|32px]] [[Constraint_VerticalDistance/fr|Distance verticale]], entrez 50mm.
The slanted line should be free to rotate at this time: we will give it an angle constraint to fix it.


<!--T:25-->
Procédez de même pour la longueur horizontale de la pente avec comme côte 50mm également.
Click on the slanted line, then the bottom line; once selected these lines will turn dark green; then click the [[File:Constraint_InternalAngle.svg|32px]] [[Sketcher ConstrainAngle|Constrain internal angle]] icon.


</translate>
Déplacez les cotations à l’extérieur de la pièce pour une meilleure visibilité. Vous devriez arriver à quelque chose comme çà:
[[Image:GGTuto1_3.PNG|center]]
[[File:GGTuto1_2.PNG|center]]
<translate>
Remarquez le nombre de degrés de liberté est passé à 2. Il s'agit des extrémités restées encore ouvertes.


<!--T:26-->
Enter a value of 30°. Both lines have a fixed angle now. The constraint was created to the left of the sketch; with the mouse, move it inside the profile.


<!--T:27-->
'''Dessin de l'arc de cercle:'''
We will now constrain the bottom line with a dimension: select it then click on [[File:Constraint_HorizontalDistance.svg|32px]] [[Sketcher ConstrainDistanceX|Constrain horizontal distance]].


<!--T:28-->
Cliquez sur [[Image:Sketcher_Arc.png|32px]] [[Sketcher_Arc/fr|Arc]], positionnez le centre à environ x=80 y=30. puis cliquez sur le premier point de départ de l'arc qui correspond à la fin du segment en haut puis la fin de l'arc avec l'autre segment (les points doivent s'éclairer en jaune).
Enter a value of 100 mm. The vertical line on the right now aligns exactly with the grid's 10th square to the right of the origin.


<!--T:29-->
Donnons lui une contrainte de rayon: cliquez dessus, puis [[Image:Constraint_Radius.png|32px]] [[Constraint_Radius/fr|Rayon]] ensuite donnez une valeur de 20mm.
Let's set the overall height to the profile by selecting the highest point on the left then the origin point. Click on [[File:Constraint_VerticalDistance.svg|32px]] [[Sketcher ConstrainDistanceY|constrain vertical distance]], enter a value of 50 mm.


<!--T:30-->
Indiquons maintenant que les départ de l'arc soient tangent avec les segments: cliquez sur l'arc, puis le segment du haut, puis [[Image:Constraint_Tangent.png|32px]] [[Constraint_Tangent/fr|Tangente]]. Un message s'affiche, validez.
Do the same for the horizontal length of the sloped line with another 50 mm horizontal distance constraint.
Procédez de même pour la contrainte de tangence l'autre coté de l'arc.


<!--T:31-->
Nous avons procédé en deux étapes pour réaliser l'esquisse, mais nous aurions pu aussi dessiner complétement l'esquisse avant de la contraindre entièrement.
Move the dimensions away from the profile for better visibility. You should now have something like this:


</translate>
[[File:GGTuto1_3.PNG|center]]
<translate>


<!--T:32-->
'''Esquisse complétement contrainte:'''
Notice that the number of degrees of freedom reduced to 2. These are the ends still open.


<!--T:33-->
Si vous avez bien travaillé, vous devriez obtenir ceci:[[Image:GGTuto1_4.PNG|center]]
'''Tracing the arc'''
l'esquisse est devenue verte, ce qui signifie qu'elle est entièrement contrainte. Il n'y a plus aucune ambiguïté, tout est parfaitement défini. Ceci est confirmé par le message du solveur en haut à gauche. Remarquez également que le centre de l'arc a légèrement bougé, en effet en donnant ces trois dernières contraintes, Freecad a calculé la vraie position du centre.


<!--T:34-->
Si votre esquisse n'est pas encore verte, un ou plusieurs points ne sont pas coïncidents (2 points sont superposés mais non coïncidents). Faite une petite fenêtre (fenêtre de capture) autour d'un point, et cliquez sur [[Image:Constraint_PointOnPoint.png|32px]] [[Constraint_PointOnPoint/fr|Coïncident]].
Click on [[Image:Sketcher_Arc.svg|32px]] [[Sketcher_CreateArc|Arc]], position the center at approximately x = 80 y = 30; then click to define the first starting point of the arc on the upper horizontal line's right end point; then click to define the end of the arc to the right vertical line's upper end point (make sure the points are highlighted in yellow before clicking).


<!--T:35-->
Procédez de la même manière avec tous les points.
Give the radius a radius constraint: select the arc, then click on [[File:Constraint_Radius.svg|32px]] [[Sketcher_ConstrainRadius|Constrain radius]] then enter a value of 20 mm.


<!--T:36-->
Si votre esquisse n'est toujours pas verte, vérifiez que tous les segments aient une contrainte soit [[Image:Constraint_Horizontal.png|32px]] [[Constraint_Horizontal/fr|Horizontal]], soit [[Image:Constraint_Vertical.png|32px]] [[Constraint_Vertical/fr|Vertical]], rajoutez la éventuellement.
Now let's make the arc tangent to the lines it's connected to: select the arc, then the top line, then click on [[File:Constraint_Tangent.svg|32px]] [[Sketcher ConstrainTangent|Constrain tangent]]. A ''Constraint substitution'' message appears, click {{KEY|OK}}. Do the same for the tangent constraint on the other side of the arc.


<!--T:37-->
===Utiliser les fonctions Pad et Pocket.===
We proceeded in two stages to create the sketch, but we could also have traced the profile completely before constraining it fully.


Cliquez sur "Fermer" dans la boite combinée, en haut à gauche, l'atelier Part Design est de nouveau activé.


<!--T:38-->
Cliquez sur [[Image:View-isometric.png|24px]] [[Std OrthographicCamera|Orthographic view]] puis [[Image:View-zoom-all.png|24px|vertical-align: top=zoom-all]] [[Std_ViewFitAll|Fit all]], ce qui donne une vue en 3D isométrique centrée.
'''Fully constrained sketch:'''


<!--T:39-->
Cliquez sur [[Image:PartDesign_Pad.png|32px]] [[PartDesign_Pad/fr|Protrusion]] (ou extrusion), donnez longueur = 30mm. Cliquez sur OK, la forme est réalisée.
If you worked well, you should get this:


</translate>
Notez que la forme crée est un solide plein.
[[Image:GGTuto1_5.PNG|center]]
[[File:GGTuto1_4.PNG|center]]
<translate>


<!--T:40-->
The sketch has become green, which means that it is fully constrained. There is no longer any ambiguity, everything is perfectly defined. This is confirmed by the solver message at the top left. Also note that the center of the arc has moved slightly, indeed giving these last three constraints, FreeCAD has calculated the true position of the center.


<!--T:41-->
'''Création du trou:'''
If your sketch is not yet green, one or more points are not coincident (2 points can be superimposed yet not be coincident). Make a small window (capture window) around a point to select, and create a [[File:Constraint_PointOnPoint.svg|32px]] [[‎Sketcher ConstrainCoincident|Coincident constraint]]. ''Note: don't mistake the Coincident constraint for the Sketcher Point; while their icons are very similar, the latter has a larger icon; it adds a lone point in the sketch.''


<!--T:42-->
Cliquez sur la face supérieure (carrée) de la pièce et cliquez sur l’icône [[Image:Sketcher_NewSketch.png|32px]] créer un nouveau sketch. Freecad crée une nouvelle esquisse rattachée à cette face. Nous sommes donc sur un plan parallèle au plan absolu XY, mais décalé en hauteur de la hauteur de la pièce c'est à dire 50mm.
Proceed in the same way with all the points.


<!--T:43-->
Vous pouvez activer une vue en 3D [[Image:View-isometric.png|24px]] ou rester vue de dessus [[Image:View-top.png|24px]]
If your sketch is still not green, verify that all lines (but the slanted one) have either a [[Image:Constraint_Horizontal.svg|32px]] [[Sketcher ConstrainHorizontal|Horizontal]] or [[File:Constraint_Vertical.svg|32px]] [[Sketcher ConstrainVertical|Vertical]] constraint, and add if necessary.


=== Using Pad and Pocket features === <!--T:44-->
Notez que les origines de cette nouvelle esquisse sont celles du body. Elles peuvent être différentes, mais ici, sont confondues avec les origines absolues.


<!--T:45-->
Avec l'outil [[Image:Sketcher_Circle.png|32px]] [[Sketcher_Circle|Circle]] cliquez à peu près au centre de la face et faites un cercle de n'importe quel rayon.
Click on {{KEY|Close}} in the Tasks tab, at the top left corner. We automatically exit the Sketcher workbench, and the Part Design workbench is activated again. The Combo View switches back to the Model tab. If you left your ''Body part1'' expanded, you will see a new '''Sketch''' element below ''Origin'', and nested under the Body.
At this point, let's save our document. Give it a name (for example "tutorial1", or any name that you find relevant). It is good practice to save your document often, for example after completing a sketch or a feature.


<!--T:46-->
Sélectionnez le cercle puis [[Image:Constraint_Radius.png|32px]] [[Constraint_Radius|Radius]], entrez la valeur 5mm.
Click on [[Image:Std_ViewIsometric.svg|32px]] '''Isometric view''' then [[File:Std_ViewFitAll.svg|32px]] [[Std_ViewFitAll|Fit all]], which gives a centered 3D isometric view.


<!--T:47-->
Sélectionnez le centre du cercle puis [[Image:Sketcher_ConstrainLock.png|32px]] [[Constraint_Lock/fr|Fixe]], double cliquez sur la cote des X entrez -65mm (ici nous indiquons une position par rapport à l'origine du sketch). Faites de même pour la cote en Y (-15mm). Le cercle prend sa bonne position et l'esquisse doit être verte, elle est complétement contrainte:
Click on [[File:PartDesign_Pad.svg|32px]] [[PartDesign_Pad|Pad]], enter a length of 30 mm; check the '''Reversed''' box to reverse the direction of the Pad. Click {{KEY|OK}}, the shape is completed. In the Model tree, a '''Pad''' object (that we call feature) appears instead of the Sketch. In fact, it has claimed Sketch, since it is based on it; clicking on the arrow or plus sign in front of ''Pad'' to expand it will reveal the Sketch underneath, which was automatically made hidden (its label is grayed out).
[[Image:GGTuto1_6.PNG|center]]


<!--T:48-->
Fermez l'atelier Sketcher et cliquez sur [[Image:PartDesign_Pocket.png|32px]] [[PartDesign_Pocket/fr|Cavité]]
Note that the shape created forms a solid.


</translate>
Cavité ou "Pocket" est une fonction dite "soustrative", elle enlève de la matière à notre pièce, ici un cylindre puisque l'esquisse est un cercle. Indiquez "à travers tout" pour traverser complètement la pièce. Validez.
[[File:GGTuto1_5.PNG|center]]
<translate>


<!--T:49-->
'''Creating the hole'''


<!--T:50-->
===Changer couleur et transparence.===
Click on the top (square) side of the part and click the [[File:Sketcher_NewSketch.svg|32px]] icon to create a new sketch. FreeCAD creates a new sketch attached to this face. So we are on a plane parallel to the absolute plane XY, but offset in height from the height of the piece, i.e. 50 mm.
Il est possible de changer la couleur de la pièce, c'est souvent utile pour distinguer une pièce parmi d'autres.
La transparence de la pièce peut être aussi modifiée, ce qui est pratique pour visualiser les formes internes.
Sélectionnez le body et allez dans la partie inférieure de l'affichage de gauche, sélectionnez l'onglet Vue, Cliquez sur le carré gris de "Shape Color" et sélectionnez une autre couleur de la "matière" de la pièce. Changez la valeur de Transparency, avec par exemple 50 et validez (0=totalement opaque,100= totalement transparent).


<!--T:51-->
Le trou est désormais visible à l’intérieur de la pièce. C'est souvent utile pour voir les faces cachées ou interne du modèle
You can switch the 3D window to an isometric view [[File:Std_ViewIsometric.svg|32px]] or stay in top view [[File:Std_ViewTop.svg|32px]]. At any time, you can return to Sketch view (the view is oriented to face the sketch plane) using the [[File:Sketcher_ViewSketch.svg|32px]] [[Sketcher ViewSketch]] icon.


<!--T:52-->
Vous pouvez aussi faire varier "Line Color" et "Line Width" pour changer l'épaisseur des traits et leur couleur du contour de la pièce.
Note that the origin of this new sketch is that of the body. They may be different, but here are confounded with the absolute origin.


<!--T:53-->
===Déplacer manuellement la pièce.===
With the [[Image:Sketcher_Circle.svg|32px]] [[Sketcher_CreateCircle|Circle]] tool, click roughly in the center of the face and make a circle of any radius.
Allez dans "Affichage" et sélectionnez "affichage des axes de coordonnées". Il s'agit des axes absolus (origines machine). Vous devriez voir dans la vue 3D, les 3 axes OX,OY,OZ de couleurs différentes. Ce repère va nous aider à nous orienter dans l'espace. Ce repère est fixe et immuable,c'est soit la vue qui tourne, soit l'objet qui tourne dans cet espace.


<!--T:54-->
Sélectionnez le Body, dans la partie inférieure de la vue combinée à gauche, voir pouvez voir ceci:
Select the circle then create a [[File:Constraint_Radius.svg|32px]] [[Sketcher ConstrainRadius|Radius constraint]], enter a value of 5 mm.
[[Image:GGTuto1_10.PNG|center]]
Cliquez sur les trois petits points, cela ouvre une nouvelle boite. A l'aide des flèches vous pouvez faire varier la position et les angles de la pièce. C'est en fait la position du body (donc son origine) qui bouge dans l'espace, l'orientation de la vue 3D ne change pas.


<!--T:55-->
Autre méthode:
Select the center of the circle then create a [[File:Sketcher_ConstrainLock.svg|32px]] [[Sketcher_ConstrainLock|Lock constraint]]; double-click on the horizontal dimension and enter -65 mm (here we indicate a position relative to the origin of the sketch). Do the same for the vertical dimension (-15 mm). The circle takes its correct position and the sketch becomes green, indicating it is fully constrained:
Dans la vue combo, sélectionnez le Body et cliquez sur le bouton droit de la souris: cliquez sur "transformer".
Une vue comme celle ci apparait:
[[Image:GGTuto1_11.PNG|center]]
Maintenez et faites glisser les cônes le long des axes et les sphères pour bouger la pièce (le body) dans tous les sens.


</translate>
Validez. Puis remettez angles et coordonnées à 0.
[[File:GGTuto1_6.PNG|center]]
<translate>


<!--T:56-->
Close the sketch; in the Model tree, a new '''Sketch001''' object has appeared below Pad. While Sketch001 is still selected, click on [[File:PartDesign_Pocket.svg|32px]] [[PartDesign_Pocket|Pocket]].


<!--T:57-->
===Afficher des côtes indicatives dans le sketch.===
Pocket is a feature called "subtractive", it removes material from our part, here in the form of a cylinder since the sketch is a circle. Set "Through all" to completely cut the part. Press {{KEY|OK}} to complete. In the Model tree, a new element labelled '''Pocket''' appears at the bottom of the Body part1, and claims Sketch001.


===Changing color and transparency=== <!--T:58-->
Il peut être utile de connaitre des dimensions de certaines parties du sketch, issues du calcul interne de Freecad. On peut s'en servir juste pour contrôle, ou les utiliser par la suite pour paramétrer d'autres dimensions par exemple.


<!--T:59-->
Double cliquez sur le premier sketch, puis cliquez sur [[Image:Sketcher_ToggleConstraint.png |32px]] [[Sketcher_ToggleConstraint/fr|Basculement de Contrainte]]. A partir de maintenant, on peut afficher des contraintes indicatives: elles seront bleues et n'auront pas d'influence sur les formes du sketch d’où elles sont issues, elles sont calculées automatiquement.
It is possible to change the color of the part, it is often useful to distinguish a part among others. The transparency of the piece can also be modified, which is useful for visualizing its internals.


<!--T:60-->
Vous pouvez afficher ces côtes par exemple:
Select the '''Body part1''' body; make sure that the Model tab of the Combo View is selected and go to the lower part of the Combo View, then click on the View tab; locate the ''Shape Color'' property; you may need to use the vertical scroll bar to the right to find it. ''You can also widen the Property column: hover your mouse pointer over the separating line between the ''Property'' and ''Value'' headers; when the pointer turns into a double-sided arrow, press and hold your left mouse button and drag sideways, then release.'' In the right column, click on the gray square, which opens the '''Select Color''' dialog. Pick another color then click OK. Next, again in the View tab, change the value of Transparency, for example to 50 and press {{KEY|Enter}} to complete (0 = totally opaque, 100 = totally transparent).
[[Image:GGTuto1_7.PNG|center]]
On constate que l'arrondi a bien une longueur de 20, car tangent avec les faces.


<!--T:61-->
On peut voir également que Freecad calcule la face de gauche (50-50xTAN 30°), ainsi que la cote de distance de l'axe de l'arc avec l'origine.
The hole is now visible inside the part. This is often useful for seeing the hidden or internal faces of the model.


<!--T:62-->
===Faire varier une ou plusieurs dimensions.===
You can also vary "Line Color" and "Line Width" to change the line thickness and the color of the part outline.


=== Manually move the part === <!--T:63-->
En cours de modélisation, on peut faire varier les cotes du modèle.
Go to the ''View'' menu and select ''Toggle axis cross''. These are the absolute axes. You should see in the 3D view, the 3 axes X, Y, Z in red, green and blue. This landmark will help us to orient ourselves in space. This landmark is fixed and immutable, it is either the view that rotates or the object that rotates in this space.
C'est très simple, pour l'épaisseur de la pièce double cliquez sur Pad, puis entrez une nouvelle valeur, 40mm par exemple. Dans la partie basse de la vue combo, on peut changer cette valeur également. Validez, la forme de l'objet a changé.


<!--T:64-->
Faites de même pour la longueur totale de la pièce: double cliquez sur Sketch, puis double cliquez sur la cote de 100, donnez lui 110mm puis validez.
Select the Body; at the bottom of the Combo View on the left, you can see this (the ''Data'' tab needs to be on the foreground, you may need to click on the ''Data'' tab to make it visible):


</translate>
On constate que la pièce à grossi, mais le trou n'est plus centré au milieu de la face car il a été localisé dans le référentiel du corps actif (le body). Ce qui ne correspond pas forcement à ce que l'on voudrait, le trou devrait rester au centre, quelques soit la dimension de la face.
[[File:GGTuto1_10.PNG|center]]
<translate>


<!--T:65-->
Click on the three small dots, i.e., the ellipsis (if they don't appear, click on the Value section of the '''Placement''' field); this opens a new dialog in the Tasks panel. Using the arrows you can vary the position and angles of the part. It is actually the position of the body (so its origin) that moves in space, the orientation of the 3D view does not change.


<!--T:66-->
===Centrer le trou.===
Another method: in the Combo View, select the Body and click on the right button of the mouse, then select ''Transform''. A view like this appears:
'''Première méthode à l'aide de la géométrie externe.'''


</translate>
Reprenez le sketch du trou, passez en vue 3D et effacez ses 2 positions en X et Y.
[[File:GGTuto1_11.PNG|center]]
<translate>


<!--T:67-->
Puis cliquez sur [[Image:Sketcher_External.png|32px]] [[Sketcher_External/fr|Géométrie externe]].
Hold and drag the cones along the axes or the spheres to move the body in all directions.


<!--T:68-->
Nous allons maintenant créer deux segments dans le sketch, mais issus d'une forme (ou fonction) externe à celui ci et précédemment définie: celle du Pad.
Validate. Then reset angles and coordinates to 0.


=== Displaying reference dimensions in the sketch === <!--T:69-->
Cliquez sur une arrête sur le dessus de la pièce et qui est en travers. Par exemple coté pente.


<!--T:70-->
Il doit apparaitre maintenant un segment violet à la place de cette arrête. Faites de même pour l'autre arrête coté arrondi.
It may be useful to know the dimensions of some parts of the sketch, from the internal calculation of FreeCAD. It can be used just for reference, or use them later to set other dimensions for example.


<!--T:71-->
On peut maintenant se servir de ces segments (et surtout les points des extrémités) pour centrer le cercle, il faut cependant rajouter encore deux segments de construction: par exemple les diagonales.
In the Model tree, if necessary expand ''Body part1'' then ''Pad'' to show the first Sketch. Double-click on it (or right-click and select ''Edit sketch'' in the contextual menu) then click on [[Image:Sketcher_ToggleConstraint.svg|32px]] [[Sketcher_ToggleDrivingConstraint|Toggle Constraint]]. ('''Note:''' depending on your computer display resolution, this icon may not be visible. At the right end of the Constraints toolbar, you may find a {{KEY|»}} button. Click on it to expand and access collapsed icons.) From now on, we can create reference dimensions rather than dimensional constraints: they will be blue and will have no influence on the shapes of the sketch from which they come, they are calculated automatically.


<!--T:72-->
Cliquez sur [[Image:Sketcher_ToggleConstruction.png|32px]] [[Sketcher_ToggleConstruction|Mode Construction]], nous passons en mode lignes de construction: les segments seront en bleu et ne seront pas des arrêtes sur la pièce. Ils vont permettre d'accrocher le centre du cercle. Créez les diagonales de la même manière que vous avez dessiné les premiers segments. Assurez vous que tous les points soient coïncidents.
You can display these dimensions for example:
Sélectionnez ensuite le centre du cercle, puis les deux diagonales bleues et cliquez sur [[Image:Constraint_PointOnObject.png|32px]] [[Constraint_PointOnObject/fr|Point sur objet]], le cercle doit se centrer à l'intersection des diagonales, c'est dire au centre de la face. L'esquisse doit être verte, complétement contrainte (c'est indispensable). Remarquez qu'à part le rayon du cercle, il n'est donc plus nécessaire de donner une valeur numérique comme contrainte.
[[Image:GGTuto1_8.PNG|center]]
Quittez le sketcher, on constate que le cercle s'est bien centré. (la fonction pocket n'a pas été effacée, mais modifiée). Si vous changez à nouveau les dimensions de la pièce, l'épaisseur ou la longueur, le cercle doit rester centré sur la face.


</translate>
'''Se passer de lignes de construction:'''
[[File:GGTuto1_7.PNG|center]]
<translate>


<!--T:73-->
Il est souvent possible d'éviter de créer des lignes de construction. Vous pouvez reprendre le sketch, effacer les diagonales et utiliser la contrainte [[Image:Constraint_Symmetric.png|32px]] [[Constraint_Symmetric/fr|Symétrie]] entre les deux sommets opposés des segments de géométrie externe et le centre du cercle (sélectionnez les points dans cet ordre):
We can see for example that the arc has a length of 20 since it's tangent with the edges.
[[Image:GGTuto1_12.PNG|center]]
Nous obtenons exactement la même chose pour la position du trou. En fait, grâce aux contraintes disponibles dans l’atelier Sketcher, il existe de nombreuses méthodes possibles. Cet exemple montre qu'il est souvent préférable de choisir la méthode la plus simple, limitant ainsi le nombre d'objets créés ainsi que les erreurs qui pourraient en découler.


<!--T:74-->
'''Deuxième méthode à l'aide d'un plan de référence.'''
We can also see that FreeCAD calculates the left face (50-50xTAN 30 °), as well as the distance dimension of the axis of the arc with the origin.


=== Editing one or more dimensions === <!--T:75-->
Voici une autre méthode, plus rapide qui est possible depuis la version 0.17: l'utilisation d'un plan de référence et son attachement (ou dépendance).


<!--T:76-->
Commencez par effacer le la fonction "Pocket" ainsi que le sketch du trou.
During modeling, you can vary the dimensions of the model. It's very simple: for the thickness of the piece, double-click Pad, then enter a new value, 40mm for example. In the lower part of the combo view, you can change this value as well. Validate, the shape of the object has changed.
Sélectionnez la face du dessus et cliquez sur [[File:PartDesign Point.png|32px]] [[PartDesign Point/fr]] : crée un point de référence dans le corps actif. Le mode d'attachement choisi doit être "centre de masse".


<!--T:77-->
Comme la face est rectangulaire, son centre de masse correspond au centre de ses diagonales. Validez, un point de référence est crée.
Do the same for the total length of the piece: double-click on Sketch, then double-click on the 100 mm dimensional constraint, change it to 110 mm then validate.

<!--T:78-->
We can see that the piece was enlarged, but the hole is no longer centered in the middle of the top face. That's because it has been constrained to the sketch origin. Which does not necessarily correspond to what one would like, the hole should remain in the center, whatever the size of the face.


=== Center the hole === <!--T:79-->
'''First method using external geometry.'''

<!--T:80-->
Edit again the sketch of the hole and erase its horizontal and vertical distance constraints.

<!--T:81-->
Then click on [[File:Sketcher_External.svg|32px]] [[Sketcher_External|External Geometry]].

<!--T:82-->
We will now create two lines in the sketch, but extracted from a shape (or feature) external to this one and previously defined: that of the Pad.

<!--T:83-->
Click on a vertical edge at the top of the part. For example, the edge slope side.

<!--T:84-->
A new magenta line will appear above the edge. Repeat for the other edge, on the rounded side.

<!--T:85-->
We can now use these lines (and especially their end points) to centre the circle, however we must add two construction lines: for example the diagonals.

<!--T:86-->
Click on [[File:Sketcher_AlterConstruction.svg|32px]] [[Sketcher_ToggleConstruction|Construction Mode]], we switch to construction mode: the lines will be blue and will be discarded outside of the sketch editing mode. They will allow to fix the center of the circle. Create the diagonals in the same way that you drew the first lines. Make sure all points are coincident.

<!--T:87-->
Then select the center of the circle, then the two blue diagonal lines and click on [[File:Constraint_PointOnObject.svg|32px]] [[Sketcher ConstrainPointOnObject|Point on object]], the circle must be centred at the intersection of the diagonals, that is at the center of the face. The sketch must be green, completely constrained (it is essential). Note that besides the radius of the circle, it is no longer necessary to create dimensional constraints.

<!--T:102-->
Please note that in addition to switching the the toolbar to construction mode, the [[File:Sketcher_AlterConstruction.svg|32px]] [[Sketcher_ToggleConstruction|Construction Mode]] button can also switch individual Sketcher elements to construction mode if they have been selected. If you accidentally switch an element to construction mode, you may get an error when you exit the sketch.

</translate>
[[File:GGTuto1_8.PNG|center]]
<translate>

<!--T:88-->
Leave the sketch, we see that the circle is well centred. (The pocket feature was not deleted, but modified). If you change the dimensions of the part again, the thickness or the length, the circle will remain centered on the face.

<!--T:89-->
'''Avoid construction lines:'''

<!--T:90-->
It is often possible to avoid creating construction lines. You can edit the sketch again, erase the construction lines and use a [[File:Constraint_Symmetric.svg|32px]] [[Sketcher ConstrainSymmetric|Symmetric constraint]] between the two opposite vertices of the external geometry lines and the centre of the circle (select points in this order):

</translate>
[[File:GGTuto1_12.PNG|center]]
<translate>

<!--T:91-->
We get exactly the same result for the position of the hole. In fact, thanks to the constraints available in the Sketcher workbench, there are many possible methods. This example shows that it is often better to choose the simplest method, thus limiting the number of objects created as well as the errors that might result.

<!--T:92-->
'''Second method using a datum plane.'''

<!--T:93-->
Here is another, faster method that is possible since version 0.17: the use of a datum plane and its attachment.

<!--T:94-->
Start by erasing the "Pocket" function as well as the sketch of the hole. Select the top face and click [[File:PartDesign_Point.svg|32px]] [[PartDesign Point|Datum point]]: create a datum point in the active body. The attachment mode chosen must be "Center of mass".

<!--T:95-->
As the face is rectangular, its center of mass corresponds to the center of its diagonals. Validate, and a datum point is created.
Sélectionnez encore la face du dessus et tout en appuyant sur la touche CTRL, sélectionnez à gauche le point que vous venez de créer, Relâchez CTRL et cliquez sur [[File:PartDesign Plane.png|32px]] [[PartDesign Plane/fr]]. Un plan de référence est crée avec comme origine le point.
Select the top face again and while holding down the CTRL key, select the point you just created in the Model tree, release CTRL and click [[File:PartDesign_Plane.svg|32px]] [[PartDesign Plane|Datum plane]]. A reference plane is created with the origin of the point. Click OK.

<!--T:96-->
It is now very easy to center the circle! Select from the Model tree or in the 3D view the plane you created, and click on [[Image:Sketcher_NewSketch.svg|32px]] [[Sketcher_NewSketch|Create a sketch]], a sketch is created with as origin, the origin of the plane. Then just trace the 5 mm radius circle on this origin, then validate (the sketch must be green imperatively).

<!--T:97-->
You get with "Pocket", as created previously, the hole and it will always be centered.


</translate>
Il est désormais très facile de centrer le cercle! Sélectionnez à gauche ou sur la vue 3D le plan que vous avez crée, et cliquez sur [[Image:Sketcher_NewSketch.png|32px]] [[Sketcher_NewSketch/fr|Créer une esquisse]], un sketch se crée avec comme origine, l'origine du plan. Il suffit alors de dessiner le cercle de 5mm de rayon sur cette origine, puis validez (le sketch doit être vert impérativement).
[[File:GGTuto1_9.PNG|center]]
<translate>


<!--T:98-->
Vous obtenez avec "Pocket", comme créé précédemment, le trou et toujours centré.
This tutorial is completed, save this file, you can have fun exploring various features. Change other dimensions, make other shapes, put other holes on other faces, it is when making mistakes that we progress!


<!--T:99-->
[[Image:GGTuto1_9.PNG|center]]
You can also continue with this other tutorial of a slightly more complicated part:


<!--T:100-->
Ce tutoriel est terminé, enregistrez ce fichier, vous pouvez vous amuser à explorer diverses fonctions.
[[Basic Part Design Tutorial 017]]
Changez d'autres côtes, faites d'autres formes, placez d'autre trous sur les autres faces, c'est en se trompant que l'on progresse!


</translate>
Vous pouvez aussi continuer avec cet autre tutoriel d'une pièce un peu plus compliquée:


{{Tutorials navi{{#translation:}}}}
https://www.freecadweb.org/wiki/Basic_Part_Design_Tutorial_017/fr
{{PartDesign Tools navi{{#translation:}}}}
{{Sketcher Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Revision as of 11:55, 23 June 2020

Tutorial
Topic
Modeling
Level
Beginner
Time to complete
1 hour
Authors
GlouGlou
FreeCAD version
0.17 or above
Example files
Creating a simple PartDesign Body.FCStd
See also
None

This tutorial aims to teach FreeCAD beginners a few basic features through an example. After covering the basics in the User hub, you will be able to model a first part step by step.

We will cover in this tutorial in particular:

  • Using Part Design workbench, tracing the sketch.
  • Using Pad and Pocket features.
  • Changing color and transparency.
  • Moving the part manually.
  • Displaying reference dimensions in the sketch.
  • Editing one or more dimensions.
  • Using external geometry feature and using a reference plane to centre a hole.

Using Part Design workbench, tracing the sketch

Create a new document and switch to the Part Design workbench using either the workbench selector (labelled 6 in the linked image) or by going to the View → Workbench menu. FreeCAD will start with toolbars at the top, the combo view to the left and the 3D view at the right.

Create body:

Press Create body. Note: do not confuse the Body, which icon is blue, with the Part container which icon is yellow. In the Model tab under the Combo View sidebar, a new object labelled "Body" appears under the document label, which is currently "Unnamed" since we haven't saved our document yet. The Body is a container in which Part Design features are sequentially arranged to form a single solid. It contains its own reference axes and planes. It will be highlighted in light blue in the Model tree, which means that it is active, that is to say that we can edit the elements it contains as well as add new elements to it. If it's not highlighted, double-click it or right-click and select Toggle active body in the contextual menu. In front of the Body label, there is a blue icon identical to the one above, and an arrow or a plus sign, depending on your operating system. Clicking on the arrow or plus sign in front of Body expands its content. At this point, it only contains an element labelled Origin. In front of this Origin is also an arrow or plus sign. Click on it to expand its content. It reveals the aforementioned reference axes and planes as shown in the image below:

The newly created active Body with its content expanded.

The Origin is greyed out, which indicates that its content is not visible in the 3D view. You can make Origin's content visible in the 3D view by selecting Origin and pressing the spacebar on your keyboard. Origin will now show black in the tree. Press the spacebar again to hide its content in the 3D view. Click again on the arrow or plus sign in front of Origin to collapse its content in the Model tree.

Before we continue, let's take the opportunity to rename the Body.

Rename body:

In the Model tree, click on the Body with the right mouse button. Select Rename and type a name, for example "Body part1" and press Enter to validate.

Create sketch:

We will now trace the sketch which defines the general shape of the part. A sketch is a diagram describing a profile to be applied to a feature in order to produce a shape. It can be either "positive" or "additive", like a pad for example; or "negative" or "subtractive", like a pocket.

Here, since the part's general shape is regular along the Y axis, we will create the Pad along this axis.

Press New sketch. The Combo View now switches to the Tasks tab and displays the Select feature dialog. This dialog expects the selection of a plane to which to attach our sketch, and lists the available planes. Select XZ_Plane (Base plane) and press OK. The interface now changes, the Sketcher now takes over and its toolbars appear above the 3D view. We find ourselves on the XZ plane of the body to trace the sketch.

To aid with sketching, set the following options in "Edit controls" in the Tasks panel to the left:

  • Show grid: checked
  • Grid size: 10 mm
  • Auto constraints: checked

We will trace the following sketch:

Let's start with the first segments:

Select the Line tool. Click on the origin point, first making sure that a small red dot appears besides and to the right of the mouse pointer. Click next on the X axis about 10 squares to the right or at about 100 mm. If the segment is not exactly 100 mm at this point, it does not matter, we will later give it a fixed dimension that will constrain this length.

Do the same for the other segments, try to aim at the points that you have created which must light up in yellow. Which means that these points will be coincident. You should get pretty much this:

Note the small red lines above and beside the segments you have drawn: these are horizontal and vertical constraints. Your lines are forced to stay either horizontal or vertical. Note also the symbol in the form of a small arc on the left: it means that the point is fixed to the Z axis.

Now pick different line segments with the left mouse button and while keeping the left button pressed, drag the mouse to try to move them: some are free, others not.

Applying constraints:

At the top of the combo box, in the Tasks panel, you can read the number of degrees of freedom of the already sketched elements: it must be about 6, the objective of the constraints is to reduce the number of degrees of freedom to 0.

The slanted line should be free to rotate at this time: we will give it an angle constraint to fix it.

Click on the slanted line, then the bottom line; once selected these lines will turn dark green; then click the Constrain internal angle icon.

Enter a value of 30°. Both lines have a fixed angle now. The constraint was created to the left of the sketch; with the mouse, move it inside the profile.

We will now constrain the bottom line with a dimension: select it then click on Constrain horizontal distance.

Enter a value of 100 mm. The vertical line on the right now aligns exactly with the grid's 10th square to the right of the origin.

Let's set the overall height to the profile by selecting the highest point on the left then the origin point. Click on constrain vertical distance, enter a value of 50 mm.

Do the same for the horizontal length of the sloped line with another 50 mm horizontal distance constraint.

Move the dimensions away from the profile for better visibility. You should now have something like this:

Notice that the number of degrees of freedom reduced to 2. These are the ends still open.

Tracing the arc

Click on Arc, position the center at approximately x = 80 y = 30; then click to define the first starting point of the arc on the upper horizontal line's right end point; then click to define the end of the arc to the right vertical line's upper end point (make sure the points are highlighted in yellow before clicking).

Give the radius a radius constraint: select the arc, then click on Constrain radius then enter a value of 20 mm.

Now let's make the arc tangent to the lines it's connected to: select the arc, then the top line, then click on Constrain tangent. A Constraint substitution message appears, click OK. Do the same for the tangent constraint on the other side of the arc.

We proceeded in two stages to create the sketch, but we could also have traced the profile completely before constraining it fully.


Fully constrained sketch:

If you worked well, you should get this:

The sketch has become green, which means that it is fully constrained. There is no longer any ambiguity, everything is perfectly defined. This is confirmed by the solver message at the top left. Also note that the center of the arc has moved slightly, indeed giving these last three constraints, FreeCAD has calculated the true position of the center.

If your sketch is not yet green, one or more points are not coincident (2 points can be superimposed yet not be coincident). Make a small window (capture window) around a point to select, and create a Coincident constraint. Note: don't mistake the Coincident constraint for the Sketcher Point; while their icons are very similar, the latter has a larger icon; it adds a lone point in the sketch.

Proceed in the same way with all the points.

If your sketch is still not green, verify that all lines (but the slanted one) have either a Horizontal or Vertical constraint, and add if necessary.

Using Pad and Pocket features

Click on Close in the Tasks tab, at the top left corner. We automatically exit the Sketcher workbench, and the Part Design workbench is activated again. The Combo View switches back to the Model tab. If you left your Body part1 expanded, you will see a new Sketch element below Origin, and nested under the Body.

At this point, let's save our document. Give it a name (for example "tutorial1", or any name that you find relevant). It is good practice to save your document often, for example after completing a sketch or a feature.

Click on Isometric view then Fit all, which gives a centered 3D isometric view.

Click on Pad, enter a length of 30 mm; check the Reversed box to reverse the direction of the Pad. Click OK, the shape is completed. In the Model tree, a Pad object (that we call feature) appears instead of the Sketch. In fact, it has claimed Sketch, since it is based on it; clicking on the arrow or plus sign in front of Pad to expand it will reveal the Sketch underneath, which was automatically made hidden (its label is grayed out).

Note that the shape created forms a solid.

Creating the hole

Click on the top (square) side of the part and click the icon to create a new sketch. FreeCAD creates a new sketch attached to this face. So we are on a plane parallel to the absolute plane XY, but offset in height from the height of the piece, i.e. 50 mm.

You can switch the 3D window to an isometric view or stay in top view . At any time, you can return to Sketch view (the view is oriented to face the sketch plane) using the Sketcher ViewSketch icon.

Note that the origin of this new sketch is that of the body. They may be different, but here are confounded with the absolute origin.

With the Circle tool, click roughly in the center of the face and make a circle of any radius.

Select the circle then create a Radius constraint, enter a value of 5 mm.

Select the center of the circle then create a Lock constraint; double-click on the horizontal dimension and enter -65 mm (here we indicate a position relative to the origin of the sketch). Do the same for the vertical dimension (-15 mm). The circle takes its correct position and the sketch becomes green, indicating it is fully constrained:

Close the sketch; in the Model tree, a new Sketch001 object has appeared below Pad. While Sketch001 is still selected, click on Pocket.

Pocket is a feature called "subtractive", it removes material from our part, here in the form of a cylinder since the sketch is a circle. Set "Through all" to completely cut the part. Press OK to complete. In the Model tree, a new element labelled Pocket appears at the bottom of the Body part1, and claims Sketch001.

Changing color and transparency

It is possible to change the color of the part, it is often useful to distinguish a part among others. The transparency of the piece can also be modified, which is useful for visualizing its internals.

Select the Body part1 body; make sure that the Model tab of the Combo View is selected and go to the lower part of the Combo View, then click on the View tab; locate the Shape Color property; you may need to use the vertical scroll bar to the right to find it. You can also widen the Property column: hover your mouse pointer over the separating line between the Property and Value headers; when the pointer turns into a double-sided arrow, press and hold your left mouse button and drag sideways, then release. In the right column, click on the gray square, which opens the Select Color dialog. Pick another color then click OK. Next, again in the View tab, change the value of Transparency, for example to 50 and press Enter to complete (0 = totally opaque, 100 = totally transparent).

The hole is now visible inside the part. This is often useful for seeing the hidden or internal faces of the model.

You can also vary "Line Color" and "Line Width" to change the line thickness and the color of the part outline.

Manually move the part

Go to the View menu and select Toggle axis cross. These are the absolute axes. You should see in the 3D view, the 3 axes X, Y, Z in red, green and blue. This landmark will help us to orient ourselves in space. This landmark is fixed and immutable, it is either the view that rotates or the object that rotates in this space.

Select the Body; at the bottom of the Combo View on the left, you can see this (the Data tab needs to be on the foreground, you may need to click on the Data tab to make it visible):

Click on the three small dots, i.e., the ellipsis (if they don't appear, click on the Value section of the Placement field); this opens a new dialog in the Tasks panel. Using the arrows you can vary the position and angles of the part. It is actually the position of the body (so its origin) that moves in space, the orientation of the 3D view does not change.

Another method: in the Combo View, select the Body and click on the right button of the mouse, then select Transform. A view like this appears:

Hold and drag the cones along the axes or the spheres to move the body in all directions.

Validate. Then reset angles and coordinates to 0.

Displaying reference dimensions in the sketch

It may be useful to know the dimensions of some parts of the sketch, from the internal calculation of FreeCAD. It can be used just for reference, or use them later to set other dimensions for example.

In the Model tree, if necessary expand Body part1 then Pad to show the first Sketch. Double-click on it (or right-click and select Edit sketch in the contextual menu) then click on Toggle Constraint. (Note: depending on your computer display resolution, this icon may not be visible. At the right end of the Constraints toolbar, you may find a » button. Click on it to expand and access collapsed icons.) From now on, we can create reference dimensions rather than dimensional constraints: they will be blue and will have no influence on the shapes of the sketch from which they come, they are calculated automatically.

You can display these dimensions for example:

We can see for example that the arc has a length of 20 since it's tangent with the edges.

We can also see that FreeCAD calculates the left face (50-50xTAN 30 °), as well as the distance dimension of the axis of the arc with the origin.

Editing one or more dimensions

During modeling, you can vary the dimensions of the model. It's very simple: for the thickness of the piece, double-click Pad, then enter a new value, 40mm for example. In the lower part of the combo view, you can change this value as well. Validate, the shape of the object has changed.

Do the same for the total length of the piece: double-click on Sketch, then double-click on the 100 mm dimensional constraint, change it to 110 mm then validate.

We can see that the piece was enlarged, but the hole is no longer centered in the middle of the top face. That's because it has been constrained to the sketch origin. Which does not necessarily correspond to what one would like, the hole should remain in the center, whatever the size of the face.


Center the hole

First method using external geometry.

Edit again the sketch of the hole and erase its horizontal and vertical distance constraints.

Then click on External Geometry.

We will now create two lines in the sketch, but extracted from a shape (or feature) external to this one and previously defined: that of the Pad.

Click on a vertical edge at the top of the part. For example, the edge slope side.

A new magenta line will appear above the edge. Repeat for the other edge, on the rounded side.

We can now use these lines (and especially their end points) to centre the circle, however we must add two construction lines: for example the diagonals.

Click on Construction Mode, we switch to construction mode: the lines will be blue and will be discarded outside of the sketch editing mode. They will allow to fix the center of the circle. Create the diagonals in the same way that you drew the first lines. Make sure all points are coincident.

Then select the center of the circle, then the two blue diagonal lines and click on Point on object, the circle must be centred at the intersection of the diagonals, that is at the center of the face. The sketch must be green, completely constrained (it is essential). Note that besides the radius of the circle, it is no longer necessary to create dimensional constraints.

Please note that in addition to switching the the toolbar to construction mode, the Construction Mode button can also switch individual Sketcher elements to construction mode if they have been selected. If you accidentally switch an element to construction mode, you may get an error when you exit the sketch.

Leave the sketch, we see that the circle is well centred. (The pocket feature was not deleted, but modified). If you change the dimensions of the part again, the thickness or the length, the circle will remain centered on the face.

Avoid construction lines:

It is often possible to avoid creating construction lines. You can edit the sketch again, erase the construction lines and use a Symmetric constraint between the two opposite vertices of the external geometry lines and the centre of the circle (select points in this order):

We get exactly the same result for the position of the hole. In fact, thanks to the constraints available in the Sketcher workbench, there are many possible methods. This example shows that it is often better to choose the simplest method, thus limiting the number of objects created as well as the errors that might result.

Second method using a datum plane.

Here is another, faster method that is possible since version 0.17: the use of a datum plane and its attachment.

Start by erasing the "Pocket" function as well as the sketch of the hole. Select the top face and click Datum point: create a datum point in the active body. The attachment mode chosen must be "Center of mass".

As the face is rectangular, its center of mass corresponds to the center of its diagonals. Validate, and a datum point is created.

Select the top face again and while holding down the CTRL key, select the point you just created in the Model tree, release CTRL and click Datum plane. A reference plane is created with the origin of the point. Click OK.

It is now very easy to center the circle! Select from the Model tree or in the 3D view the plane you created, and click on Create a sketch, a sketch is created with as origin, the origin of the plane. Then just trace the 5 mm radius circle on this origin, then validate (the sketch must be green imperatively).

You get with "Pocket", as created previously, the hole and it will always be centered.

This tutorial is completed, save this file, you can have fun exploring various features. Change other dimensions, make other shapes, put other holes on other faces, it is when making mistakes that we progress!

You can also continue with this other tutorial of a slightly more complicated part:

Basic Part Design Tutorial 017


Template:Tutorials navi