Creating a simple part with PartDesign/pt-br: Difference between revisions

From FreeCAD Documentation
(Created page with "A linha inclinada deve estar livre para girar neste momento: daremos a ela uma restrição de ângulo para corrigi-la.")
(Created page with "Clique na linha inclinada e depois na linha inferior; uma vez selecionadas, essas linhas ficarão verdes escuras; então clique no ícone 24px Ângulo de restrição.")
Line 81: Line 81:
A linha inclinada deve estar livre para girar neste momento: daremos a ela uma restrição de ângulo para corrigi-la.
A linha inclinada deve estar livre para girar neste momento: daremos a ela uma restrição de ângulo para corrigi-la.


Click on the slanted line, then the bottom line; once selected these lines will turn dark green; then click the [[File:Constraint_InternalAngle.svg|24px]] [[Sketcher ConstrainAngle|Constrain internal angle]] icon.
Clique na linha inclinada e depois na linha inferior; uma vez selecionadas, essas linhas ficarão verdes escuras; então clique no ícone [[File:Constraint_InternalAngle.svg|24px]] [[Sketcher ConstrainAngle|Ângulo de restrição]].


[[File:GGTuto1_2.PNG|center]]
[[File:GGTuto1_2.PNG|center]]

Revision as of 17:13, 22 March 2023

Tutorial
Topic
Modeling
Level
Beginner
Time to complete
1 hour
Authors
GlouGlou
FreeCAD version
0.17 or above
Example files
See also
Creating a simple part with Part WB, Creating a simple part with Draft and Part WB

Este tutorial visa ensinar aos iniciantes do FreeCAD alguns recursos básicos por meio de um exemplo. Depois de ver o básico no User hub/pt-br, você poderá modelar uma primeira peça passo a passo.

Abordaremos neste tutorial em particular:

  • Usando a bancada Part Design, traçando o esboço.
  • Usando os recursos Pad e Pocket.
  • Mudança de cor e transparência.
  • Mover a peça manualmente.
  • Exibindo dimensões de referência no esboço.
  • Editando uma ou mais dimensões.
  • Usando recurso de geometria externa e usando um plano de referência para centralizar um furo.

Usando a Bancada Part Design, traçando o esboço

Crie um novo documento e mude para o a bancada Part Design usando o workbench selector (rotulado 10 na imagem vinculada) ou acessando o menu Vista → Bancada. O FreeCAD começará com as barras de ferramentas na parte superior, a tela combinada à esquerda e a visualização 3D à direita.

Crie um corpo:

Clique em Criar corpo. Nota: não confunda o Corpo, cujo ícone é azul, com a Parte, cujo ícone é amarelo. Na aba Modelo, na barra lateral da Tela combinada, um novo objeto chamado "Body" (corpo em português) aparece sob o rótulo do documento, que atualmente é "Unnamed" (ou "sem nome", em português), pois ainda não salvamos nosso documento. O Corpo é um contêiner no qual os recursos da Part Design são organizados sequencialmente para formar um único sólido. Ele contém seus próprios eixos e planos de referência. Ele será destacado em azul claro na árvore na aba Modelo, o que significa que está ativo, ou seja, podemos editar os elementos que ele contém, bem como adicionar novos elementos a ele. Se não estiver realçado, clique duas vezes ou clique com o botão direito do mouse e selecione Alternar o corpo ativo no menu que se abre. À frente da etiqueta Body, existe um ícone azul idêntico ao anterior, e uma seta ou um sinal de mais, dependendo do seu sistema operacional. Clicar na seta ou no sinal de adição na frente de Corpo expande seu conteúdo. Neste ponto, ele contém apenas um elemento chamado Origin. Na frente de Origin também há uma seta ou sinal de mais. Clique nele para expandir seu conteúdo. Isso revela os eixos e planos de referência acima mencionados, conforme mostrado na imagem abaixo:

O corpo ativo recém-criado com seu conteúdo expandido.

A Origin está acinzentada, o que indica que seu conteúdo não é visível na visualização 3D. Você pode tornar o conteúdo de Origin visível na visualização 3D selecionando Origin e pressionando a barra de espaço em seu teclado. Origem agora aparecerá em preto na árvore. Pressione a barra de espaço novamente para ocultar seu conteúdo na visualização 3D. Clique novamente na seta ou no sinal de mais na frente de Origin para recolher seu conteúdo na árvore.

Antes de continuarmos, vamos aproveitar para renomear o Corpo.

Renomeando Body:

Na árvore da aba Modelo, clique em Body com o botão direito do mouse. Selecione Renomear e digite um nome, por exemplo "Body part1" e pressione Enter para validar.

Criando um esboço:

Vamos agora traçar o esboço que define a forma geral da peça. Um esboço é um diagrama que descreve um perfil a ser aplicado a um recurso para produzir uma forma. Pode ser "positivo" ou "aditivo", como um bloco, por exemplo; ou "negativo" ou "subtrativo", como um bolso.

Aqui, como a forma geral da peça é regular ao longo do eixo Y, criaremos o bloco ao longo deste eixo.

Pressione Criar um esboço. A tela combinada agora muda para a aba Tarefas e exibe a caixa de diálogo Selecione um objeto. Esta caixa de diálogo espera a seleção de um plano ao qual anexar nosso esboço e lista os planos disponíveis. Selecione XZ_Plane (Plano de base) e clique em OK. A interface agora muda, o Sketcher (ferramenta de desenho) agora assume e suas barras de ferramentas aparecem acima da visualização 3D. Estamos no plano XZ do corpo para traçar o esboço.

Para ajudar no esboço, defina as seguintes opções em "Controles de edição" na aba Tarefas à esquerda:

  • Mostrar grade: marcado
  • Tamanho da grade: 10 mm
  • Restrições automáticas: marcado

Traçaremos o seguinte esboço:

Vamos começar com os primeiros segmentos:

Selecione a ferramenta Criar linha. Clique no ponto de origem, primeiro certificando-se de que um pequeno ponto vermelho apareça ao lado e à direita do ponteiro do mouse. Clique em seguida no eixo X cerca de 10 quadrados à direita ou cerca de 100 mm. Se o segmento não tiver exatamente 100 mm neste ponto, não importa, depois daremos a ele uma dimensão fixa que garantirá esse comprimento.

Faça o mesmo para os outros segmentos, tente mirar nos pontos que você criou que devem acender em amarelo. O que significa que esses pontos serão coincidentes. Você deve obter algo assim:

Observe as pequenas linhas vermelhas acima e ao lado dos segmentos que você desenhou: são restrições horizontais e verticais. Suas linhas são forçadas a ficar na horizontal ou na vertical. Observe também o símbolo em forma de um pequeno arco à esquerda: significa que o ponto está fixo no eixo Z.

Agora escolha diferentes segmentos de linha com o botão esquerdo do mouse e, mantendo o botão esquerdo pressionado, arraste o mouse para tentar movê-los: alguns são livres, outros não.

Aplicando restrições:

Na parte superior da Tela combinada, nas Mensagens no painel Tarefas, você pode ler o número de graus de liberdade (DoF - do inglês "Degrees of Freedom") dos elementos já esboçados: deve ser cerca de 6. O objetivo das restrições é reduzir o número de graus de liberdade para 0.

A linha inclinada deve estar livre para girar neste momento: daremos a ela uma restrição de ângulo para corrigi-la.

Clique na linha inclinada e depois na linha inferior; uma vez selecionadas, essas linhas ficarão verdes escuras; então clique no ícone Ângulo de restrição.

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


Template:Tutorials navi/pt-br