Outils pour utilisateurs

Outils du site


issue121:tutoriel1

Ceci est une ancienne révision du document !


In this series, we will be examining the world of FreeCAD, an open-source CAD modelling application that it still in Beta, but has been gaining acceptance in recent years. Naturally, it is readily available in the Ubuntu repositories. In the first article on using FreeCAD, we went over the basics of choosing and installing a CAD application for Ubuntu or GNU/Linux, and reviewed some salient points of the FreeCAD user interface. In this part, we will be creating a simple planar object to illustrate the use of the main workspaces, drawing and extrusion tools. Constructive Solid Geometry will also be demonstrated, to punch holes in an unsuspecting piece of plain material. Here is a quick sketch of our new object: basically, it will be a flat piece of material 2mm thick, with an external shape made out of straight lines and arcs, and two circular pieces cut out from the inside. Since the author is a European, all dimensions are in millimeters, though the reader can easily convert them into the units of his or her choice.

Dans cette série, nous examinerons le monde de FreeCAD, une application Open Source de modélisation par CAO qui est encore en bêta, mais qui a reçu un bon accueil dans les dernières années. Naturellement, elle est déjà disponible dans les dépôts d'Ubuntu. Dans le premier article sur l'utilisation de FreeCAD, nous avons passé en revue les bases d'un choix et d'une installation d'un application de CAO pour Ubuntu ou GNU/Linux, et analysé quelques points maquants de l'interface utilisateur de FreeCAD.

Dans ce numéro, nous créerons un objet plan simple pour illustrer l'utilisation des principaux espaces de travail, des outils de dessin et d'extrusion. La Géométrie constructive des Solides sera aussi présentée, pour percer des trous dans une innocente pièce de métal ordinaire. Voici une esquisse rapide de notre nouvel objet : en gros, ce sera une pièce plate de métal, épaisse de 2 mm, avec une forme extérieure faite de lignes droites et d'arcs, et à l'intérieur de laquelle deux pièces circulaires seront enlevées. Comme l'auteur est européen, toutes les dimensions seront en millimètres et le lecteur saura facilement les convertir dasn les unités de son choix.

Using the Drawing workbench Once inside FreeCAD, to begin a new project we can head over to menu option File > New. Alternatively, we can choose the appropriate tool from the default bar (the leftmost icon), or even use the keyboard shortcut Ctrl+N. As discussed in the previous article, the FreeCAD user interface has a series of workbenches, each with a specific selection of toolbars. In order to start a new project, one of the most useful is “Draft”. As its name suggests, the preset toolbars in this bench contain the tools most usually used to draw up the main characteristics of the object quickly, which can then be refined with the tools in other benches. Once inside Draft mode, there are several interface items than can be set up to facilitate working with our object. In the first place, this workbench shows us by default a grid pattern set up within the X-Y plane, that we are watching from above (down the Z axis). This grid has lines set up, with spacing of one millimeter, which may be a bit fiddly with the dimensions of our piece. So the first thing to do may be to head over to menu option Edit > Preferences. Here, we can configure the Draft workbench to our specific needs. One of the option panes, “Snapping settings”, allows us to specify grid spacing. I set this to 10 millimeters, which makes it easier to get a clear sense of the dimensions of each element in our drawing.

Utilisation de l'atelier de dessin

Une fois à l'intérieur de FreeCAD, pour commencer un nouveau projet, nous pouvons aller à l'option de menu Fichier > Nouveau. Ou, nous pouvons choisir l'outil approprié dans la barre par défaut (l'icône le plus à gauche), ou même utiliser le raccourci clavier Ctrl+N.

Comme présenté dans l'article précédent, l'interface utilisateur de FreeCAD a une séries d'ateliers, chacun avec sa sélection spécifique de barres d'outils. Au commencement d'un nouveau projet, un des plus utiles est « Draft » (Ébauche). Comme son nom le suggère, la barre d'outils prédéfinie pour cet atelier contient les outils les plus utilisés habituellement pour dessiner rapidement les principales caractéristiques de l'objet; qui pourra ensuite être affiné avec les outils des autres ateliers.

Une fois dans le mode Draft, plusieurs éléments d'interfaces peuvent être paramétrés pour faciliter le travail sur notre objet. En premier lieu, l'atelier nous montre par défaut un motif en grille paramétré dans le plan X-Y, que nous regardons du dessus (vers le bas, suivant l'axe Z). La grille a des lignes définies, avec un espacement d'un millimètre, qui peut être un peu trop fin pour notre pièce. Aussi, la première chose à faire pourrait être d'afficher l'option de menu Édition > Préférences. Là, nous pouvons configurer l'atelier Draft à nos besoins particuliers. Une des sections d'option, « Paramètres d'accroche », nous permet de spécifier l'espacement de la grille. Je le règle à 10 millimètres, ce qui facilitera notre compréhension des dimensions de chaque élément de notre dessin.

We can now adjust the zoom factor (e.g. with the mouse wheel, or swiping vertically on a laptop’s touchpad) so as to see at least four vertical grid divisions spanning 40 mm - note the view’s visible dimensions in the window’s lower right corner. As for the toolbars, for some reason the bar related to snapping points to the grid is usually collapsed. Snapping, or letting the user interface guide the point indicated with the mouse, is one of the most powerful features that is shared by many CAD programs. In this toolbar, we can configure snapping options to help up easily draw clean diagrams with object elements precisely aligned. As with all toolbars in FreeCAD, we can move the snapping toolbar to a place where we can examine its contents better. As a matter of personal choice, I tend to activate the options for snapping to the grid, which in this case will ensure the endpoints of our lines, for example, get coordinates that are integer multiples of 10 mm. I also tend to activate snapping to endpoints, which helps when drawing the last element of a multiple-segment closed path.

As for the drawing tools themselves, they are grouped into another toolbar. FreeCAD does show commendable consistency across toolbar icons, so while the previous (snapping) toolbar had icons all in the same shade of green, drawing tools are all shown with icons in yellow and black. In this project, we will be using the tool to draw a straight line from two points, the tool to draw a full circle from its center and a point, and the tool to draw a circular arc. Let us begin (above) by drawing the top line of our shape, from coordinates (-30, 20) to (30, 20). Since we have snapping to the grid activated, we will see the mouse icon change to show a green grid icon whenever it detects we are close to a grid intersection, and thinks we may wish to place this point at this place. We can then go on to draw the bottom segment, from coordinates (-30, -20) to (30, -20). Once we have the two horizontal lines set up, let us change to the arc drawing tool. To draw the circular arc closing the right end of our piece, first select the center of the arc at coordinates (30, 0). Then click on the end of the top horizontal line at coordinates (30, 20) once to indicate the radius of our arc, and a second time to indicate the point where we are beginning our arc. Finally, click on the end of the lower horizontal line at (30, -20) to give the endpoint of our arc. When clicking on the end of the horizontal lines, our mouse cursor should change to the appropriate green icon to show us FreeCAD has detected a previous line and is placing the new point at these precise coordinates. The drawing, so far, should resemble the following capture.

We can now proceed to draw the arc on the other side of the piece, closing the outside shape. With the tool to draw circles, we can put in the two circles at coordinates (-30, 0) and (30, 0), both with radius 10 mm. One final point is that the outside of our piece is, for the moment, a collection of four different segments: two Line objects, and two Arc objects. This can clearly be seen in the “Combo View” window at the left hand side of the screen. Further on, we will need to convert this object into a 3D object, and for this reason we must convert the collection of four segments into a single path. This is done with the “join objects” tool in the modification toolbar. Select all four segments, either in the combo view or in the drawing itself - holding down to Ctrl key to select multiple objects - and use this tool. In the combo view, we will see the four segments disappear, to be replaced by a single Wire object.

In the Part workbench Once we have the planar part of our project set up - in essence, a horizontal projection of the final piece - we can switch workbenches and choose “Part”. This is where we will give the piece its 3D touches. To begin with, let us use the views toolbar to switch to a 3D projection view, to see the piece in its current shape as a flat drawing contained within the X-Y plane. Depending on the current zoom factor, it may be useful to also choose the “fit to view” button to get the whole part nicely centered in the view window. Below is what we should see at this point: the outer Wire and the two inner Circles. One of the toolbars that come by default with the Part workbench contains tools to transform flat parts into volumes. Begin by choosing one of the circles, and then use the “extrude” tool. Since the circle is contained within the X-Y plane, extrusion will take place along the Z axis. Increment the length of extrusion to 4 mm, so the final piece will be a cylinder 4 mm in length. Also make sure the “Create solid” option is checked, as otherwise only the walls of the cylinder would be created.

Now do the same with the other circle, converting it also into a cylinder 4 mm high. Finally, let us make an extrusion from the Wire piece, but this time only 2 mm high. By the end of this process, if we choose a lateral orthogonal view in the view toolbar, we should see the two cylinders protruding from the main part. However, their bases are all on the same plane. This is not suitable for us, since the next operation will be to subtract the cylinders from the main part, thus creating two holes. If we leave things as they are, there may be some confusion at the lower face of each hole. It is best to make sure the cylinders protrude both above and below the main piece. To do so, we will simply displace the main part upwards by one millimeter. This is done by clicking on the part in “Combo view”, where it will probably be labeled as “Extrude002” or something similar. Then click on the tab marked “Data” at the bottom of the Combo view, unfold option Placement, then Position, and increase the value for “z” from 0 mm to 1 mm.

At the same time, one should see the main part going upwards in the main view, giving this result: Finally, we can make the holes in the main part. To do so, start by selecting both cylinders in the Combo view, and then choose menu option Part > Boolean > Union. This should make the cylinders disappear from the Combo view, and be replaced by a single Fusion object. Inside the Combo view, choose first the main part Extrude002, and then (with the Ctrl key), also choose Fusion. Then choose Part > Boolean > Cut. Voilà, we have cut out the two holes from the main part. In the last operation, the order of choosing the main part, and then the fusion of the two cylinders, is important. If one proceeds otherwise, FreeCAD will try to cut the main part out from the two cylinders, giving four very thin cylinders - definitely not what we expected!

What next? In this article on using FreeCAD, we created a simple planar object to illustrate the use of the main workspaces (Draft and Part), drawing tools, and extrusion. Constructive Solid Geometry was used to unite two cylinders, and the resulting Fusion object was used to cut two holes in the main piece thus creating the final object. In the next part of the series, we will use further tools to create a more complex 3D object, representing a Y-junction between two pipes of different diameters.

issue121/tutoriel1.1496558823.txt.gz · Dernière modification : 2017/06/04 08:47 de d52fr