Creating a simple part with Part WB: Difference between revisions

From FreeCAD Documentation
mNo edit summary
 
(27 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
{{TutorialInfo
{{TutorialInfo
|Topic=Modeling
|Topic=Modeling
Line 9: Line 10:
|FCVersion=0.19 or above
|FCVersion=0.19 or above
|Files=
|Files=
|SeeAlso=[[Creating_a_simple_part_with_PartDesign|Creating a simple part with PartDesign]], [[Creating_a_simple_part_with_Draft_and_Part_WB|Creating a simple part with Draft and Part WB]]
}}
}}


==Introduction==
==Introduction== <!--T:2-->


<!--T:3-->
This tutorial aims to be used as a first introduction to 3d modeling using the [[Part_Workbench|Part Workbench]] [[Image:Switch_PartWorkbench.JPG]] of FreeCAD. After having finished this tutorial you should be able to make simple 3d models by using primitives like cubes, cylinders, etc with a technique called [https://en.wikipedia.org/wiki/Constructive_solid_geometry Constructive Solid Geometry], short '''CSG''' modeling. Another way to create 3d models is by using a 2d shape to create a 3d shape by for example extruding or revolving the 2d shape in 3d space. For an introduction of that technique please follow the sister-tutorial ''[[Creating_a_simple_part_with_PartDesign|Creating a simple part with PartDesign]]''. The two tutorials intentionally have exactly the same model generated, this presents the beginner with a hands on experience of the two different techniques and how they are implemented in FreeCAD. The definition of the two techniques can be viewed as strictly divided from a semantic point of view, however there is nothing directly hindering a mix of the techniques when creating models. There are some caveats to watch out for when mixing modeling techniques, those are mainly related to aspects of how FreeCAD is programmed. There is a [[Creating_a_simple_part_with_Draft_and_Part_WB|third tutorial]] intended as a first introduction to a mixed modeling example. That tutorial uses the '''Draft Workbench''' to create a 2d profile utilized to extrude a solid in the '''Part Workbench''' to make the same model as in this tutorial.
This tutorial aims to be used as a first introduction to 3D modeling using the [[Part_Workbench|Part Workbench]] [[Image:Switch_PartWorkbench.JPG]] of FreeCAD. After having finished this tutorial you should be able to make simple 3D models by using primitives like cubes, cylinders, etc with a technique called [https://en.wikipedia.org/wiki/Constructive_solid_geometry Constructive Solid Geometry], short '''CSG''' modeling. Another way to create 3D models is by using a 2D shape by for example extruding or revolving the 2D shape in 3D space. For an introduction of that technique please follow the sister-tutorial ''[[Creating_a_simple_part_with_PartDesign|Creating a simple part with PartDesign]]''. The two tutorials intentionally have exactly the same model generated, this presents the beginner with a hands on experience of the two different techniques and how they are implemented in FreeCAD. The definition of the two techniques can be viewed as strictly divided from a semantic point of view, however there is nothing directly hindering a mix of the techniques when creating models. There are some caveats to watch out for when mixing modeling techniques, those are mainly related to aspects of how FreeCAD is programmed. There is a [[Creating_a_simple_part_with_Draft_and_Part_WB|third tutorial]] intended as a first introduction to a mixed modeling example. That tutorial uses the '''Draft Workbench''' to create a 2D profile utilized to extrude a solid in the '''Part Workbench''' to make the same model as in this tutorial.


<!--T:4-->
Before you start please have a look at how to '''[[Mouse_navigation|navigate]]''' the 3d space.
When hoovering over the mouse model selector in the lower right corner of the FreeCAD window a cheat-sheet of the current mouse model appears as in the picture below.
Before you start please have a look at how to '''[[Mouse_navigation|navigate]]''' in 3D space. When hoovering over the mouse model selector in the lower right corner of the FreeCAD window, a cheat-sheet of the current mouse model appears as in the picture below.


</translate>
</translate>
Line 22: Line 25:
<translate>
<translate>


<!--T:5-->
Many newcomers to cad programs get stuck while learning the software, if that happens to you, please go ahead and search the wiki or forum for further information – chances are that others also have been stuck on the same specific thing in the past so there is already an answer to your specific question. Or make a post on the forum with your questions or findings. The forum has several threads where users are helped to complete all sorts of different tasks, those threads are often similar to tutorials, and often have specific illustrations included.
Many newcomers to CAD programs get stuck while learning the software, if that happens to you, please go ahead and search the wiki or forum for further information – chances are that others also have been stuck on the same specific thing in the past so there is already an answer to your specific question. Or make a post on the forum with your questions or findings. The forum has several threads where users are helped to complete all sorts of different tasks, those threads are often similar to tutorials, and often have specific illustrations included.


===The tutorial covers===
===The tutorial covers=== <!--T:6-->


<!--T:7-->
* The model to make
* The model to make
* Using the Part Workbench to create and manipulate the primitive building blocks
* Using the Part Workbench to create and manipulate the primitive building blocks
Line 35: Line 40:
* Editing dimensions
* Editing dimensions
* Organizing the tree a bit differently
* Organizing the tree a bit differently
* Wrapping up


===The model to make===
==The model to make== <!--T:8-->


</translate>
</translate>
Line 44: Line 50:
<translate>
<translate>


==Using the Part Workbench to create and manipulate the primitive building blocks==
==Using the Part Workbench to create and manipulate the primitive building blocks== <!--T:9-->


<!--T:10-->
Create a new document and save it directly under a new name, it is good practice to make sure that you save the document at regular intervals, or just before larger operations. Then switch to the '''[[Part_Workbench|Part Workbench]]''' using either the [[Getting_started#Exploring_FreeCAD|workbench selector]] (labeled 10 in the linked image) or by going to the {{MenuCommand|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 a new document and save it directly under a new name, it is good practice to make sure that you save the document at regular intervals, or just before larger operations. Then switch to the '''[[Part_Workbench|Part Workbench]]''' using either the [[Getting_started#Exploring_the_interface|workbench selector]] (labeled 10 in the linked image) or by going to the {{MenuCommand|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 the main solid block===
===Create the main solid block=== <!--T:11-->


<!--T:12-->
Press [[Image:Part_Box.svg|24px|link=Part_Box]] [[Part_Box|Box]] to make a default solid cube. The cube appears in the 3d view and also as a new object in the [[Tree_view|tree-view]] in the sidebar.
Press [[Image:Part_Box.svg|24px|link=Part_Box]] [[Part_Box|Box]] to make a default solid cube. The cube appears in the [[3D_view|3D view]] and also as a new object in the [[Tree_view|Tree view]] in the sidebar.


<!--T:13-->
Press [[Image:Std_ViewIsometric.svg|24px|link=Std_ViewIsometric]] [[Std_ViewIsometric|Isometric]] to see the cube in 3d.
Press [[Image:Std_ViewIsometric.svg|24px|link=Std_ViewIsometric]] [[Std_ViewIsometric|Isometric]] to see the cube in 3D.


</translate>
</translate>
Line 58: Line 67:
<translate>
<translate>


<!--T:14-->
Select the cube in the [[Tree_view|tree-view]], it becomes green in the 3d view. Below the tree-view you will now see that the cube by default is created with the dimensions '''Length x Width x Height''' as ''10 x 10 x 10 mm''. Change those dimensions to '''100 x 30 x 50''' as per the initial drawing of the model.
Select the cube in the [[Tree_view|Tree view]], it becomes green in the 3D view. Below the tree view you will now see that the cube by default is created with the dimensions '''Length x Width x Height''' as ''10 x 10 x 10 mm''. Change those dimensions to '''100 x 30 x 50''' as per the initial drawing of the model.


</translate>
</translate>
Line 64: Line 74:
<translate>
<translate>


<!--T:15-->
When changing a property, like ''Length'' through the spinbox, one can either enter the values, or use the scroll-wheel to tick values up or down. The arrows for ticking values up or down can of course also be used. In the right most picture above, the ''Height'' property is in edit mode, rolling the scroll wheel when the mouse is over that cell will change the value by one up or down.
When changing a property, like ''Length'' through the spinbox, one can either enter the values, or use the scroll-wheel to tick values up or down. The arrows for ticking values up or down can of course also be used. In the right most picture above, the ''Height'' property is in edit mode, rolling the scroll wheel when the mouse is over that cell will change the value by one up or down.


<!--T:16-->
Click [[Image:Std_ViewFitAll.svg|24px|link=Std_ViewFitAll]] '''[[Std_ViewFitAll|Fit all]]''' to see the whole cube.
Click [[Image:Std_ViewFitAll.svg|24px|link=Std_ViewFitAll]] '''[[Std_ViewFitAll|Fit all]]''' to see the whole cube.


Line 72: Line 84:
<translate>
<translate>


===Create the fillet===
===Create the fillet=== <!--T:17-->


<!--T:18-->
To make the filleted corner, in the toolbar press [[Image:Part_Fillet.svg|24px|link=Part_Fillet]] '''[[Part_Fillet|Fillet]]''' which opens the ''task panel'' for fillets in the combo view to the side. Change the ''radius'' spinbox to 20 mm, then in the 3d view, select the width edge to the upper right and click {{Button|OK}}.
To make the filleted corner, in the toolbar press [[Image:Part_Fillet.svg|24px|link=Part_Fillet]] '''[[Part_Fillet|Fillet]]''' which opens the ''task panel'' for fillets in the [[Combo_view|combo view]] to the side. Change the ''radius'' spinbox to 20 mm, then in the 3D view, select the width edge to the upper right and click {{Button|OK}}.


</translate>
</translate>
Line 80: Line 93:
<translate>
<translate>


<!--T:19-->
The ''task panel'' closes and you are back to the tree-view which now has a fillet object instead of the earlier cube.
The ''task panel'' closes and you are back to the Tree view which now has a fillet object instead of the earlier cube.


===Visibility of children===
===Visibility of children=== <!--T:20-->


<!--T:21-->
Click the plus sign/caret to expand the children of the fillet, which in this case is the ''cube'' we created earlier, but it is grayed out. Select the cube and press the space bar – this toggles visibility so the cube is now visible again and the icon is no longer grayed out. To deselect the cube click in a blank area in the tree-view or the 3d view.
Click the plus sign/caret to expand the children of the fillet, which in this case is the ''cube'' we created earlier, but it is grayed out. Select the cube and press the space bar – this toggles visibility so the cube is now visible again and the icon is no longer grayed out. To deselect the cube click in a blank area in the Tree view or the 3D view.


</translate>
</translate>
Line 90: Line 105:
<translate>
<translate>


===Create the chamfer===
===Create the chamfer=== <!--T:22-->


<!--T:23-->
Next is to create the 30 degree ''chamfer'', start by toggling the visibility of the child cube of the fillet. There is a chamfer tool in [[Part_Workbench|Part Workbench]], but instead of using it we will make the chamfer with another block and a boolean cut.
Next is to create the 30 degree ''chamfer'', start by toggling the visibility of the child cube of the fillet. There is a chamfer tool in [[Part_Workbench|Part Workbench]], but instead of using it we will make the chamfer with another block and a boolean cut.


<!--T:24-->
Create a new [[Image:Part_Box.svg|24px|link=Part_Box]] '''[[Part_Box|Box]]''' with dimensions 60 x 30 x 30. Change the '''placement angle''' to -30 degrees.
Create a new [[Image:Part_Box.svg|24px|link=Part_Box]] '''[[Part_Box|Box]]''' with dimensions 60 x 30 x 30. Change the '''placement angle''' to -30 degrees.


Line 100: Line 117:
<translate>
<translate>


<!--T:25-->
The placement angle is using the '''placement vector''' (Axis) as axis of rotation. The default is the z-axis, which is not matching our target direction, changing the placement vector to the '''y-axis''' produces the desired orientation of the cutting tool for the chamfer.
The placement angle is using the '''placement vector''' (Axis) as axis of rotation. The default is the z-axis, which is not matching our target direction, changing the placement vector to the '''y-axis''' produces the desired orientation of the cutting tool for the chamfer.


Line 106: Line 124:
<translate>
<translate>


<!--T:26-->
The same placement can be attained with other values as well, the simplest alternative example of a placement that is the same is an angle of +30 degrees and a y-axis of -1.
The same placement can be attained with other values as well, the simplest alternative example of a placement that is the same is an angle of +30 degrees and a y-axis of -1.


====Python console====
====Python console==== <!--T:27-->


<!--T:28-->
Furthermore the position needs to be adjusted, looking at the drawing of the finished part, there is no direct dimension to use for the intended translation upwards. Since the upward dimension is the one needed, we have to calculate it. Let’s make use of the built in '''[[Python_console|python console]]''' for those calculations, it is basic trigonometry. If the FreeCAD python console is not visible for you, just right-click in an empty space in the toolbar area and check the ''python console'' and it should appear in the workspace, when there you should as well add the '''[[Report_view|report view]]''' if not already visible. The ''report view'' most of the times provides useful information or even hints of what to do next for different commands.
Furthermore the position needs to be adjusted, looking at the drawing of the finished part, there is no direct dimension to use for the intended translation upwards. Since the upward dimension is the one needed, we have to calculate it. Let’s make use of the built in '''[[Python_console|Python console]]''' for those calculations, it is basic trigonometry. If the FreeCAD Python console is not visible for you, just right-click in an empty space in the toolbar area and check the ''Python console'' and it should appear in the workspace, when there you should as well add the '''[[Report_view|report view]]''' if not already visible. The ''report view'' most of the times provides useful information or even hints of what to do next for different commands.


</translate>
</translate>
Line 116: Line 136:
<translate>
<translate>


<!--T:29-->
After importing the '''[https://docs.python.org/3/library/math.html#module-math math]''' module from the standard libraries in python we can use the formula ''(50 - math.tan(math.radians(30)) * 50)'' to find the distance in z-direction that the block should be moved. Copy the result of the formula from the python console and paste it into the z position for '''Cube001'''. The ''tool'' to use for the chamfer ''cut'' is now properly oriented and positioned.
After importing the '''[https://docs.python.org/3/library/math.html#module-math math]''' module from the standard libraries in python we can use the formula ''(50 - math.tan(math.radians(30)) * 50)'' to find the distance in z-direction that the block should be moved. Copy the result of the formula from the Python console and paste it into the z position for '''Cube001'''. The ''tool'' to use for the chamfer ''cut'' is now properly oriented and positioned.


</translate>
</translate>
Line 122: Line 143:
<translate>
<translate>


====Expressions====
====Expressions==== <!--T:30-->


<!--T:31-->
One does not have to use the python console to do the calculation, In most cases when dealing with numeric parametric values, FreeCAD has a short-cut to a built-in calculator. It is called '''[[Expressions|Expressions]]''' in FreeCAD, you can enter the ''expression mode'' by first clicking in the spinbox for the z-position, a small blueish circular icon will appear at the right side.
One does not have to use the Python console to do the calculation, In most cases when dealing with numeric parametric values, FreeCAD has a short-cut to a built-in calculator. It is called '''[[Expressions|Expressions]]''' in FreeCAD, you can enter the ''expression mode'' by first clicking in the spinbox for the z-position, a small blueish circular icon will appear at the right side.


</translate>
</translate>
Line 130: Line 152:
<translate>
<translate>


<!--T:32-->
Clicking that icon opens new window ''Formula editor'' where formulas and expressions can be entered as shown below. Using expressions is a powerful tool, since one can access parameters from the model, effectively making all parameters in the model available as variables to be used when creating an expression. In short, in our formula, instead of entering the number 50 when in the formula editor, we could enter a ''named parameter'' holding the value 50 from the cube, with the benefit that if we change the cube ''height'', the position of the chamfer will automatically follow. The value of 50 in the current model is referred to as ''Cube.Length'', i.e. the ''Length'' property of the ''Cube'' feature. Further information on this can be found on the wiki.
Clicking that icon opens new window ''Formula editor'' where formulas and expressions can be entered as shown below. Using expressions is a powerful tool, since one can access parameters from the model, effectively making all parameters in the model available as variables to be used when creating an expression. In short, in our formula, instead of entering the number 50 when in the formula editor, we could enter a ''named parameter'' holding the value 50 from the cube, with the benefit that if we change the cube ''height'', the position of the chamfer will automatically follow. The value of 50 in the current model is referred to as ''Cube.Length'', i.e. the ''Length'' property of the ''Cube'' feature. Further information on this can be found on the wiki.


Line 136: Line 159:
<translate>
<translate>


<!--T:33-->
To make the cut, with the {{KEY|Ctrl}} key pressed down first select the '''Fillet''' in the tree-view and then the latest created cube (named '''Cube001''') and finally in the toolbar press the [[Image:Part_Cut.svg|24px|link=Part_Cut]] '''[[Part_Cut|Cut]]''' button. Your tree-view should now again be a single object in the root called '''Cut'''.
To make the cut, with the {{KEY|Ctrl}} key pressed down first select the '''Fillet''' in the Tree view and then the latest created cube (named '''Cube001''') and finally in the toolbar press the [[Image:Part_Cut.svg|24px|link=Part_Cut]] '''[[Part_Cut|Cut]]''' button. Your Tree view should now again be a single object in the root called '''Cut'''.


</translate>
</translate>
Line 142: Line 166:
<translate>
<translate>


====The measurement tool====
====The toolbars==== <!--T:102-->


<!--T:103-->
The '''[[Part_Measure_Menu|measurement tool]]''' in the '''Part Workbench''' can be used to check that our calculation and placement of the chamfer is correct.
A sidenote on the toolbars, since they are the typical avenue to invoke commands. Although there is a basic setting for the layout of the toolbars, the actual layout on your computer could turn out to be less than ideal. In such cases it is easy to adjust. Consider the upper section of the below image. There are two rows of toolbars and only a limited number of the [[Part_Workbench|Part Workbench]] toolbar buttons are visible. The simplest way to see more toolbar buttons is to maximize the FreeCAD window, unless it already is maximized of course.
Press the [[Image:Part_Measure_Linear.svg|24px|link=Part_Measure_Linear]] '''[[Part_Measure_Linear|Measure Linear]]''' button and a ''task panel'' opens up, then select the 2 endpoints of one side of the chamfer.

<!--T:104-->
More common is to adjust the layout of the toolbars to suit your needs and your specific computer. The repositioning is done with the handle on the left of each toolbar. You can just click and drag the handle to a new location. In the lower section of the below image the toolbar positions have been adjusted, revealing their full content. Changes to toolbar positions are persistent through sessions.

</translate>
[[Image:T101pwb01-141_toolbars.png|center]]
<translate>

====The measurement tool==== <!--T:34-->

<!--T:35-->
The '''[[Part_Workbench#Measure|measurement tool]]''' in the '''Part Workbench''' can be used to check that our calculation and placement of the chamfer is correct. Press the [[Image:Part_Measure_Linear.svg|24px|link=Part_Measure_Linear]] '''[[Part_Measure_Linear|Measure Linear]]''' button and a ''task panel'' opens up, then select the 2 endpoints of one side of the chamfer.


</translate>
</translate>
Line 151: Line 187:
<translate>
<translate>


<!--T:36-->
It checks out with an x dimension of 50 mm, clear the measurement and close the dialogue.
It checks out with an x dimension of 50 mm, clear the measurement and close the dialogue.


===Create the hole===
===Create the hole=== <!--T:37-->


<!--T:38-->
To make the hole, press the [[Image:Part_Cylinder.svg|24px|link=Part_Cylinder]] '''[[Part_Cylinder|Cylinder]]''' button, set the ''radius'' to 5 mm and ''height'' to 50 mm.
To make the hole, press the [[Image:Part_Cylinder.svg|24px|link=Part_Cylinder]] '''[[Part_Cylinder|Cylinder]]''' button, set the ''radius'' to 5 mm and ''height'' to 50 mm.


Line 161: Line 199:
<translate>
<translate>


<!--T:39-->
Next we need to position the hole according to the dimensions in the drawing. Change the view to [[Image:Std_ViewTop.svg|24px|link=Std_ViewTop]] '''[[Std_ViewTop|Top]]''' view, then right-click the '''Cylinder''' in the tree-view and select '''Transform''' from the pop-up menu.
Next we need to position the hole according to the dimensions in the drawing. Change the view to [[Image:Std_ViewTop.svg|24px|link=Std_ViewTop]] '''[[Std_ViewTop|Top]]''' view, then right-click the '''Cylinder''' in the Tree view and select '''Transform''' from the pop-up menu.


</translate>
</translate>
Line 167: Line 206:
<translate>
<translate>


<!--T:40-->
Change the ''Translation increment'' to 5 and use the red and green arrow to position the cylinder in the right position, moving it 15 mm in y and 65 in x by dragging the arrow ends with the mouse. Click {{Button|OK}} to close the ''Transform'' dialogue. To make the hole press the {{KEY|Ctrl}} key and select the '''Cut''' and '''Cylinder''' in the tree-view, then press the [[Image:Part_Cut.svg|24px|link=Part_Cut]] '''[[Part_Cut|Cut]]''' button in the toolbar. Your tree-view should once again have a single object in the root called '''Cut001'''.
Change the ''Translation increment'' to 5 and use the red and green arrow to position the cylinder in the right position, moving it 15 mm in y and 65 in x by dragging the arrow ends with the mouse. Click {{Button|OK}} to close the ''Transform'' dialogue. To make the hole press the {{KEY|Ctrl}} key and select the '''Cut''' and '''Cylinder''' in the Tree view, then press the [[Image:Part_Cut.svg|24px|link=Part_Cut]] '''[[Part_Cut|Cut]]''' button in the toolbar. Your Tree view should once again have a single object in the root called '''Cut001'''.


<!--T:41-->
Congratulations, the model is now ready.
Congratulations, the model is now ready.


Line 175: Line 216:
<translate>
<translate>


<!--T:42-->
With the basic model ready, let us explore different ways to alter this model, some examples are related to the appearance, additional features, or simply a different way to do the same.
With the basic model ready, let us explore different ways to alter this model, some examples are related to the appearance, additional features, or simply a different way to do the same.


==Changing the color and transparency==
==Changing the color and transparency== <!--T:43-->


<!--T:44-->
There are several different ways one can change the appearance of objects, for this case, let's use the view tab in the property part of the combo view. First select the object in the tree-view and then edit any property like line color, shape color or transparency via the '''view tab''' (found at the bottom of the ''combo view'').
There are several different ways one can change the appearance of objects, for this case, let's use the view tab in the property part of the combo view. First select the object in the Tree view and then edit any property like line color, shape color or transparency via the '''view tab''' (found at the bottom of the ''combo view'').


</translate>
</translate>
Line 185: Line 228:
<translate>
<translate>


<!--T:45-->
Unfortunately when the object is selected it is a bit hard to see how it will look when tuning the new appearance. To see the final result one has to deselect the object. Here is the new look of the model, where one now can see the through hole also in the iso-view. Another way to edit the appearance is via the {{MenuCommand|View → [[Image:Std_SetAppearance.svg|24px|link=Std_SetAppearance]] Appearance...}} menu.
Unfortunately when the object is selected it is a bit hard to see how it will look when tuning the new appearance. To see the final result one has to deselect the object. Here is the new look of the model, where one now can see the through hole also in the iso-view. Another way to edit the appearance is via the {{MenuCommand|View → [[Image:Std_SetAppearance.svg|24px|link=Std_SetAppearance]] Appearance...}} menu.


Line 191: Line 235:
<translate>
<translate>


==A different way to locate the hole==
==A different way to locate the hole== <!--T:46-->


<!--T:47-->
Do a ''save-as'' under a new name. Then delete the cut that added the hole and move the cylinder back to zero position. Your model should look like the below picture, which is the starting point for using a different technique to locate the hole at the center of the upper face. Note that the color is back to the default gray, the change in appearance we did was on the cut object which now is deleted.
Do a ''save-as'' under a new name. Then delete the cut that added the hole and move the cylinder back to zero position. Your model should look like the below picture, which is the starting point for using a different technique to locate the hole at the center of the upper face. Note that the color is back to the default gray, the change in appearance we did was on the cut object which now is deleted.


Line 199: Line 244:
<translate>
<translate>


<!--T:48-->
This time the [[Image:Workbench_Draft.svg|24px|link=Draft_Workbench]] '''[[Draft_Workbench|Draft Workbench]]''' will be used to locate the hole. The hole is as before to be located at the center of the upper face, which is the same as the midpoint of the diagonal of the upper face.
This time the [[Image:Workbench_Draft.svg|24px|link=Draft_Workbench]] '''[[Draft_Workbench|Draft Workbench]]''' will be used to locate the hole. The hole is as before to be located at the center of the upper face, which is the same as the midpoint of the diagonal of the upper face.

Start by switching the workbench to '''Draft''', it might be that a ''grid'' appears in the 3d view, the grid visibility can be toggled with [[Image:Draft_ToggleGrid.svg|24px|link=Draft_ToggleGrid]] [[Draft_ToggleGrid|Toggle Grid]] in the toolbar. When making use of the '''[[Draft_Snap|snap]]''' functionality in the '''Draft Workbench''' it helps to only have the ''snap types'' of interest enabled, this time it is sufficient to leave ''endpoint, midpoint and circle center enabled'', so the settings for snapping should look something like below.
<!--T:97-->
Start by switching the workbench to '''Draft''', it might be that a ''grid'' appears in the 3D view, the grid visibility can be toggled with [[Image:Draft_ToggleGrid.svg|24px|link=Draft_ToggleGrid]] [[Draft_ToggleGrid|Toggle Grid]] in the toolbar. When making use of the '''[[Draft_Snap|snap]]''' functionality in the '''Draft Workbench''' it helps to only have the ''snap types'' of interest enabled. This time it is sufficient to leave ''endpoint, midpoint and circle center enabled'', so the settings for snapping should look something like below.


</translate>
</translate>
Line 206: Line 254:
<translate>
<translate>


<!--T:49-->
Finding the point to place the center of the cylinder could be done by making a diagonal as helpline and use the center of the cylinder and midpoint of the diagonal to identify the points to move between, however it turns out that we do not even need to make any helplines, we can snap on already existing solid geometry.
Finding the point to place the center of the cylinder could be done by making a diagonal as helpline and use the center of the cylinder and midpoint of the diagonal to identify the points to move between, however it turns out that we do not even need to make any helplines, we can snap on already existing solid geometry.


<!--T:50-->
Select the '''Cylinder''' in the tree-view (it turns green in the 3d view) and press the [[Image:Draft_Move.svg|24px|link=Draft_Move]] '''[[Draft_Move|Move]]''' button in the toolbar. A ''task panel'' opens for moving objects, make sure that ''Copy'' is unchecked.
Select the '''Cylinder''' in the Tree view (it turns green in the 3D view) and press the [[Image:Draft_Move.svg|24px|link=Draft_Move]] '''[[Draft_Move|Move]]''' button in the toolbar. A ''task panel'' opens for moving objects, make sure that ''Copy'' is unchecked.


</translate>
</translate>
Line 214: Line 264:
<translate>
<translate>


<!--T:51-->
Then move the mouse to the upper face of the cylinder so that you see a ''white dot'' in the center of the circle as per the left picture below, this together with the center symbol next to the mouse pointer means that a left button mouse click will snap to the white point.
Then move the mouse to the upper face of the cylinder so that you see a ''white dot'' in the center of the circle as per the left picture below, this together with the center symbol next to the mouse pointer means that a left button mouse click will snap to the white point.


Line 220: Line 271:
<translate>
<translate>


<!--T:52-->
When you have the white dot on the upper face, click the left mouse button, and repeat for the upper square face of the main solid, like the right picture above, and confirm the choice with a left mouse button click. The snap function makes use of ''mass-center'' for any type of face, and in this case the mass center is the same as the geometrical center that is sought after. You will by now have noticed that the move of the cylinder is animated, so you always see what is about to happen.
When you have the white dot on the upper face, click the left mouse button, and repeat for the upper square face of the main solid, like the right picture above, and confirm the choice with a left mouse button click. The snap function makes use of ''mass-center'' for any type of face, and in this case the mass center is the same as the geometrical center that is sought after. You will by now have noticed that the move of the cylinder is animated, so you always see what is about to happen.


<!--T:53-->
Repeating the step of the '''boolean cut''' from earlier once again will make the through hole that completes the model. Using the '''linear measurement tool''' in the Part Workbench, a check that the hole is correctly placed is done. The measurement can only be done between ''points'', so the measurement is done from main body zero to the seam point of the cylinder, meaning that the correct distance is 70 mm instead of the 65 that is on the drawing to account for the extra radius that is included in the distance.
Repeating the step of the '''boolean cut''' from earlier once again will make the through hole that completes the model. Using the '''linear measurement tool''' in the Part Workbench, a check that the hole is correctly placed is done. The measurement can only be done between ''points'', so the measurement is done from main body zero to the seam point of the cylinder, meaning that the correct distance is 70 mm instead of the 65 that is on the drawing to account for the extra radius that is included in the distance.


Line 228: Line 281:
<translate>
<translate>


==Making the hole a countersunk hole==
==Making the hole a countersunk hole== <!--T:54-->


<!--T:55-->
Switch back to the [[Part_Workbench|Part Workbench]] and create a ''cone'' by pressing the [[Image:Part_Cone.svg|24px|link=Part_Cone]] '''[[Part_Cone|Cone]]''' button in the toolbar. Change ''radius1'' to 0 mm and ''radius2'' to 7 mm – this will give a 2 mm ''countersink'' on the radius. Making the ''height'' of the cone 7 mm results in a 90 degree top angle of the cone, or 45 degree countersink angle. Worth to note is that again one could as well use the [[Image:Part_Chamfer.svg|24px|link=Part_Chamfer]] [[Part_Chamfer|Chamfer]] operation.
Switch back to the [[Part_Workbench|Part Workbench]] and create a ''cone'' by pressing the [[Image:Part_Cone.svg|24px|link=Part_Cone]] '''[[Part_Cone|Cone]]''' button in the toolbar. Change ''radius1'' to 0 mm and ''radius2'' to 7 mm – this will give a 2 mm ''countersink'' on the radius. Making the ''height'' of the cone 7 mm results in a 90 degree top angle of the cone, or 45 degree countersink angle. Worth to note is that again one could as well use the [[Image:Part_Chamfer.svg|24px|link=Part_Chamfer]] [[Part_Chamfer|Chamfer]] operation.


<!--T:56-->
When working with FreeCAD you will continuously be faced with several different ways to achieve seemingly the same result. There is hardly any absolute truth in what is the right way to achieve a particular end result – however when looking in a specific context one specific workflow can be more flexible, allow for later features to actually be used etc. How you build 3d models will evolve over time as you along the way learn more and more about the features and capabilities of FreeCAD.
When working with FreeCAD you will continuously be faced with several different ways to achieve seemingly the same result. There is hardly any absolute truth in what is the right way to achieve a particular end result – however when looking in a specific context one specific workflow can be more flexible, allow for later features to actually be used etc. How you build 3D models will evolve over time as you along the way learn more and more about the features and capabilities of FreeCAD.


</translate>
</translate>
Line 238: Line 293:
<translate>
<translate>


<!--T:57-->
Translate the cone so that it is ''concentric'' with the hole and ''coplanar'' with the main solid upper surface. Use any method described earlier in this tutorial to accomplish that.
Translate the cone so that it is ''concentric'' with the hole and ''coplanar'' with the main solid upper surface. Use any method described earlier in this tutorial to accomplish that.

<!--T:98-->
In the picture below the move is made with ''Transform'' and an ''increment'' setting of 1 mm, since the cone has a characteristic dimension of 7 mm, meaning that the earlier increment setting of 5 mm will not allow for correct positioning. The [[Image:Std_DrawStyleWireFrame.svg|24px|link=Std_DrawStyle#Wireframe]] '''[[Std_DrawStyle#Wireframe|Wireframe]]''' rendering is used to easier see that the cone is in the right position.
In the picture below the move is made with ''Transform'' and an ''increment'' setting of 1 mm, since the cone has a characteristic dimension of 7 mm, meaning that the earlier increment setting of 5 mm will not allow for correct positioning. The [[Image:Std_DrawStyleWireFrame.svg|24px|link=Std_DrawStyle#Wireframe]] '''[[Std_DrawStyle#Wireframe|Wireframe]]''' rendering is used to easier see that the cone is in the right position.


Line 245: Line 303:
<translate>
<translate>


<!--T:58-->
To complete the model, let's make use of the [[Image:Part_Boolean.svg|24px|link=Part_Boolean]] '''[[Part_Boolean|Boolean]]''' command instead of first selecting objects and apply a specific boolean operation. Press the toolbar button and a ''task panel'' opens as per the below picture to the left.
To complete the model, let's make use of the [[Image:Part_Boolean.svg|24px|link=Part_Boolean]] '''[[Part_Boolean|Boolean]]''' command instead of first selecting objects and apply a specific boolean operation. Press the toolbar button and a ''task panel'' opens as per the below picture to the left.


Line 251: Line 310:
<translate>
<translate>


<!--T:59-->
Three items needs to be specified, the ''operation type'', the ''first shape'' and the ''second shape''. The cone is supposed to be cut, this is called ''Difference'' in this command, instead of ''Cut''. The first shape is our '''Cut001''', it is listed under ''compounds'', since it is build from several solids. The second shape is the '''Cone'''. Once the correct settings are made for the command, click the {{Button|Apply}} button to execute the operation. This has all been done in the picture to the right, and there one can also see that a ''compound'' '''Cut002''' is now listed, this is our final model shape. After having changed the appearance the final model looks like this.
Three items needs to be specified, the ''operation type'', the ''first shape'' and the ''second shape''. The cone is supposed to be cut, this is called ''Difference'' in this command, instead of ''Cut''. The first shape is our '''Cut001''', it is listed under ''compounds'', since it is build from several solids. The second shape is the '''Cone'''. Once the correct settings are made for the command, click the {{Button|Apply}} button to execute the operation. This has all been done in the picture to the right, and there one can also see that a ''compound'' '''Cut002''' is now listed, this is our final model shape. After having changed the appearance the final model looks like this.


Line 257: Line 317:
<translate>
<translate>


==Making a hollow piece==
==Making a hollow piece== <!--T:60-->


<!--T:61-->
Do a ''save-as'' under a new name. FreeCAD has all of the typical operations of a 3D modeller, one of them is [[Image:Part_Thickness.svg|24px|link=Part_Thickness]] '''[[Part_Thickness|Thickness]]''', which is used to ''hollow out'' parts.
Do a ''save-as'' under a new name. FreeCAD has all of the typical operations of a 3D modeller, one of them is [[Image:Part_Thickness.svg|24px|link=Part_Thickness]] '''[[Part_Thickness|Thickness]]''', which is used to ''hollow out'' parts.


<!--T:62-->
Rotate the view so that the bottom face of the model is visible.
Rotate the view so that the bottom face of the model is visible.


Line 267: Line 329:
<translate>
<translate>


<!--T:63-->
Select the ''bottom face'' of the model, then in the [[Part_Workbench|Part Workbench]] select [[Image:Part_Thickness.svg|24px|link=Part_Thickness]] '''[[Part_Thickness|Thickness]]''' and the screen should look like below.
Select the ''bottom face'' of the model, then in the [[Part_Workbench|Part Workbench]] select [[Image:Part_Thickness.svg|24px|link=Part_Thickness]] '''[[Part_Thickness|Thickness]]''' and the screen should look like below.


Line 273: Line 336:
<translate>
<translate>


<!--T:64-->
Click {{Button|OK}}, as you can see there is now a ''radius'' on the hollowed out part.
Click {{Button|OK}}, as you can see there is now a ''radius'' on the hollowed out part.


Line 279: Line 343:
<translate>
<translate>


<!--T:65-->
Moreover, when taking a measurement of the width of the part, it is now 32 mm, so the ''thickness'' has been applied ''outwards''. Let’s edit that, double-click the model in the tree-view and modify the ''join-type'' settings to ''intersection'' and the ''thickness'' setting to -1.
Moreover, when taking a measurement of the width of the part, it is now 32 mm, so the ''thickness'' has been applied ''outwards''. Let’s edit that, double-click the model in the Tree view and modify the ''join-type'' settings to ''intersection'' and the ''thickness'' setting to -1.


</translate>
</translate>
Line 285: Line 350:
<translate>
<translate>


<!--T:66-->
Now the outer width of the part is 30 mm, same as before and the corners are all sharp corners.
Now the outer width of the part is 30 mm, same as before and the corners are all sharp corners.


Line 291: Line 357:
<translate>
<translate>


==A different way to position the chamfer==
==A different way to position the chamfer== <!--T:67-->


<!--T:68-->
Do a ''save-as'' under a new name. Then delete features so that the model looks like below.
Do a ''save-as'' under a new name. Then delete features so that the model looks like below.


Line 299: Line 366:
<translate>
<translate>


<!--T:69-->
Make a '''Cube''' with dimensions '''30x30x60''', ending up like below.
Make a '''Cube''' with dimensions '''30x30x60''', ending up like below.


Line 305: Line 373:
<translate>
<translate>


<!--T:70-->
Change the '''placement''' by first rotating -120 degrees around the Y-axis.
Change the '''placement''' by first rotating -120 degrees around the Y-axis.


Line 311: Line 380:
<translate>
<translate>


<!--T:71-->
Finally, change the position to '''X=50''' and '''Z=50''' and make the ''cut'' to produce the same result as earlier.
Finally, change the position to '''X=50''' and '''Z=50''' and make the ''cut'' to produce the same result as earlier.


Line 317: Line 387:
<translate>
<translate>


<!--T:72-->
This once again highlights that there are always several ways to produce the same outcome, which is a recurring theme when it comes to 3d modeling. When it comes to basic geometries or solids, one can use different workbenches in FreeCAD as well as different commands and still have the same outer shape of a solid. You simply need to find your own way to a set of preferred tools and workflow that you are comfortable in using. Modeling in parametric 3d is a process of constant learning, and takes practice to master.
This once again highlights that there are always several ways to produce the same outcome, which is a recurring theme when it comes to 3D modeling. When it comes to basic geometries or solids, one can use different workbenches in FreeCAD as well as different commands and still have the same outer shape of a solid. You simply need to find your own way to a set of preferred tools and workflow that you are comfortable in using. Modeling in parametric 3D is a process of constant learning, and takes practice to master.


==Editing dimensions, face colors and TNP==
==Editing dimensions, face colors and TNP== <!--T:73-->


<!--T:74-->
FreeCAD is a parametric 3d modeler, this allows you to change any ''placement'' or ''dimension'' and the model will update accordingly. In general this works, but it is possible to break a model when edited – for example when a fillet is based on an edge that no longer exists due to editing. When a model breaks during editing, it is referred to as '''TNP, Topological Naming Problem'''.
FreeCAD is a parametric 3D modeler, this allows you to change any ''placement'' or ''dimension'' and the model will update accordingly. In general this works, but it is possible to break a model when edited – for example when a fillet is based on an edge that no longer exists due to editing. When a model breaks during editing, it is referred to as '''TNP, [[Topological_naming_problem|Topological Naming Problem]]'''.


<!--T:75-->
Go ahead and experiment with changing dimensions and placements to see if you can break the model, do not forget to recalculate the model after changes if required. This can be done with the [[Image:Std_Refresh.svg|24px|link=Std_Refresh]] [[Std_Refresh|Refresh]] button in the toolbar, if the icon is grayed out it is not needed to refresh the object.
Go ahead and experiment with changing dimensions and placements to see if you can break the model, do not forget to recalculate the model after changes if required. This can be done with the [[Image:Std_Refresh.svg|24px|link=Std_Refresh]] [[Std_Refresh|Refresh]] button in the toolbar, if the icon is grayed out it is not needed to refresh the object.


===Reposition the cylinder===
===Reposition the cylinder=== <!--T:76-->


<!--T:77-->
Here is an example of the cylinder moved from the center to one side of the main body by using ''Transform'' on the cylinder. As can be seen in the picture, the cone is still in the original position, not affected by the move of the cylinder.
Here is an example of the cylinder moved from the center to one side of the main body by using ''Transform'' on the cylinder. As can be seen in the picture, the cone is still in the original position, not affected by the move of the cylinder.


Line 333: Line 407:
<translate>
<translate>


<!--T:78-->
When you move the cylinder and break through the outer surface, in version 0.19 you are loosing part of the color settings on your model. FreeCAD reverts to the user default settings for shape colors and transparency in the 3D view, however the '''Cut002''' shape still shows the colors and transparency that it had before as seen in below picture.
When you move the cylinder and break through the outer surface, in version 0.19 you are loosing part of the color settings on your model. FreeCAD reverts to the user default settings for shape colors and transparency in the 3D view, however the '''Cut002''' shape still shows the colors and transparency that it had before as seen in below picture.


===Fixing the colors===
===Fixing the colors=== <!--T:79-->


</translate>
</translate>
Line 341: Line 416:
<translate>
<translate>


<!--T:80-->
Here is one way to get it back. First change ''transparency'' one tick up or down and then back, that brings back the transparency. You can do the same trick on ''shape color''. Another way to get the color back is to ''right-click'' '''Cut002''' in the tree-view and select '''Set Colors''' in the context menu. In the ''task panel'' that displays, click {{Button|Set to Default}}, that brings back the color to the one set in the view-properties.
Here is one way to get it back. First change ''transparency'' one tick up or down and then back, that brings back the transparency. You can do the same trick on ''shape color''. Another way to get the color back is to ''right-click'' '''Cut002''' in the Tree view and select '''Set Colors''' in the context menu. In the ''task panel'' that displays, click {{Button|Set to Default}}, that brings back the color to the one set in the view-properties.


</translate>
</translate>
Line 347: Line 423:
<translate>
<translate>


<!--T:81-->
The '''Set Colors''' command allows you to select individual faces of a shape and set a unique color on the selected faces.
The '''Set Colors''' command allows you to select individual faces of a shape and set a unique color on the selected faces.


===Multiple solids===
===Multiple solids=== <!--T:82-->


<!--T:83-->
Another example where the cube that is making the chamfer has been translated and rotated.
Another example where the cube that is making the chamfer has been translated and rotated.


Line 357: Line 435:
<translate>
<translate>


<!--T:84-->
As can be seen when repositioning the chamfer in this way, the end result is ''3 disjoint solids''. [[Part_Workbench|Part Workbench]] allows this, [[PartDesign_Workbench|PartDesign Workbench]] does not, either you will get an ''multiple solids error'' or it will simply not render all solids.
As can be seen when repositioning the chamfer in this way, the end result is ''3 disjoint solids''. [[Part_Workbench|Part Workbench]] allows this, [[PartDesign_Workbench|PartDesign Workbench]] does not, either you will get an ''multiple solids error'' or it will simply not render all solids.


===TNP===
===TNP=== <!--T:85-->


<!--T:86-->
Going back to the original completed model, let’s explore how the faces are named.
Going back to the original completed model, let’s explore how the faces are named.

<!--T:99-->
Here the '''[[Selection_view|selection view]]''' has been made active, just to show clearly what is selected and not, also coloring is adjusted so that the selection is easier to see.
Here the '''[[Selection_view|selection view]]''' has been made active, just to show clearly what is selected and not, also coloring is adjusted so that the selection is easier to see.


Line 368: Line 450:
<translate>
<translate>


<!--T:87-->
Selecting one side face and the cylinder inner face gives that they are internally called face ''2'' and ''9'', where face ''2'' is the side face. Face numbering can be different for you.
Selecting one side face and the cylinder inner face gives that they are internally called face ''2'' and ''9'', where face ''2'' is the side face. Face numbering can be different for you.

<!--T:100-->
Moving the cylinder so that the cavity ends up on the side face, and doing the selection of faces now gives a different number for the cylindrical face.
Moving the cylinder so that the cavity ends up on the side face, and doing the selection of faces now gives a different number for the cylindrical face.


Line 375: Line 460:
<translate>
<translate>


<!--T:88-->
Face 2 is the right side of the original face 2, the left side of former face 2 is now face 8. The cylindrical part was face 9, but is now face 7. FreeCAD reassigns the numbering and the order is not necessarily preserved. The total face count in the first model is 10, in the version with the cylindrical face piercing the side face, the total face count is 11. So obviously face numbering has to change when the so called ''topology'' changes. This probably feels like a minute detail, but turns out to be quite important in parametric 3d cad. Imagine that you have used the cylindrical face as reference for another feature, it used to be called face 9, but is now called face 8. The reference to the intended cylindrical surface is lost. Since FreeCAD, at least in currently released versions does not keep track of the ''intended face'', it only keeps track of the ''numbered face'', a model breaks when a reference is made to a face that later is renumbered. This is called '''TNP, Topological Naming Problem'''.
Face 2 is the right side of the original face 2, the left side of former face 2 is now face 8. The cylindrical part was face 9, but is now face 7. FreeCAD reassigns the numbering and the order is not necessarily preserved. The total face count in the first model is 10, in the version with the cylindrical face piercing the side face, the total face count is 11. So obviously face numbering has to change when the so called ''topology'' changes. This probably feels like a minute detail, but turns out to be quite important in parametric 3D CAD. Imagine that you have used the cylindrical face as reference for another feature, it used to be called face 9, but is now called face 8. The reference to the intended cylindrical surface is lost. Since FreeCAD, at least in currently released versions does not keep track of the ''intended face'', it only keeps track of the ''numbered face'', a model breaks when a reference is made to a face that later is renumbered. This is called '''TNP, [[Topological_naming_problem|Topological Naming Problem]]'''.


<!--T:89-->
You are encouraged to learn how to avoid broken models due to TNP, further reading can be done [[Topological_naming_problem|elsewhere on the wiki]], which largely focus on a ''sketch driven'' workflow, the underlying mechanism is the same though. The renumbering described here for faces goes for all geometrical entities, faces, edges and vertexes.
You are encouraged to learn how to avoid broken models due to TNP, further reading can be done [[Topological_naming_problem|elsewhere on the wiki]], which largely focuses on a ''sketch driven'' workflow, the underlying mechanism is the same though. The renumbering described here for faces goes for all geometrical entities, faces, edges and vertexes.


==Organizing the tree a bit differently==
==Organizing the tree a bit differently== <!--T:90-->


<!--T:91-->
Do a ''save-as'' under a new name. Then delete all the cuts ending up in a model looking like below.
Do a ''save-as'' under a new name. Then delete all the cuts ending up with a model looking like below.


</translate>
</translate>
Line 387: Line 475:
<translate>
<translate>


<!--T:92-->
When using '''Part Workbench''' and modelling feature rich solids, then the tree structure of a solid can become cumbersome to decipher. So far we have created one primitive / feature and applied a boolean operation. In Part Workbench one can bundle primitives into one boolean operation. In our case we have the cylinder, cone and cube that are all a cut boolean operation.
When using the '''Part Workbench''' and modelling feature rich solids, the tree structure of a solid can become hard to decipher. So far we have created one primitive / feature and applied a boolean operation. In the Part Workbench one can bundle primitives into one boolean operation. In our case we have the cylinder, cone and cube that are all a cut boolean operation.

<!--T:101-->
Instead of making a cut for each primitive, we can first apply a boolean union, [[Image:Part_Fuse.svg|24px|link=Part_Fuse]] '''[[Part_Fuse|Fuse]]''' the primitives intended for the boolean cut, and then make the ''cut'' between the '''Fillet''' and the '''Fusion'''.
Instead of making a cut for each primitive, we can first apply a boolean union, [[Image:Part_Fuse.svg|24px|link=Part_Fuse]] '''[[Part_Fuse|Fuse]]''' the primitives intended for the boolean cut, and then make the ''cut'' between the '''Fillet''' and the '''Fusion'''.


<!--T:93-->
Using this approach, the tree-view ends up looking like below, which is just a different way of building the same model. Compare this with the original tree-view, none is better than the other, however when making more complex models one approach over the other, can have benefits in ease of modifying/reorganizing the model if needed.
Using this approach, the Tree view ends up looking like below, which is just a different way of building the same model. Compare this with the original Tree view, none is better than the other, however when making more complex models, one approach over the other can have benefits in ease of modifying/reorganizing the model if needed.


</translate>
</translate>
Line 396: Line 488:
<translate>
<translate>


==Wrapping up==
==Wrapping up== <!--T:94-->


<!--T:95-->
Having gone through the tutorial you are now briefly acquainted with the user interface of FreeCAD and you have learned the basics in using '''Part Workbench'''. You should now be able to build simple models after your own liking. '''Part Workbench''' is one of the workbenches that can be used to create solids, '''PartDesign Workbench''' is another. The different workbenches have different capabilities and workflows. Learning FreeCAD in full, especially considering all add-ons and macros takes years, so keep on exploring new and different ways of making models – take different tutorials on the wiki, the learning never stops when working with FreeCAD. It is suggested that you learn ''sketches'' and '''PartDesign Workbench''' next if your focus is on creating solids. If your focus is modelling buildings your next learning should be the '''Draft''' and '''Arch''' workbenches.
Having gone through the tutorial you are now briefly acquainted with the user interface of FreeCAD and you have learned the basics in using the '''Part Workbench'''. You should now be able to build simple models after your own liking. The '''Part Workbench''' is one of the workbenches that can be used to create solids, the '''PartDesign Workbench''' is another. The different workbenches have different capabilities and workflows. Learning FreeCAD in full, especially considering all add-ons and macros takes years, so keep on exploring new and different ways of making models – take different tutorials on the wiki, the learning never stops when working with FreeCAD. It is suggested that you learn ''sketches'' and the '''PartDesign Workbench''' next if your focus is on creating solids. If your focus is modelling buildings your next learning should be the '''Draft''' and '''Arch''' workbenches.


<!--T:96-->
At last, FreeCAD is made by volunteers in their spare time. If you want to further advance FreeCAD’s capabilities, consider [[Help_FreeCAD|contributing]] to FreeCAD, for example by improving documentation.
At last, FreeCAD is made by volunteers in their spare time. If you want to further advance FreeCAD’s capabilities, consider [[Help_FreeCAD|contributing]] to FreeCAD, for example by improving the documentation.





Latest revision as of 16:03, 14 September 2022

Tutorial
Topic
Modeling
Level
Beginner
Time to complete
2 hours
Authors
heda
FreeCAD version
0.19 or above
Example files
See also
Creating a simple part with PartDesign, Creating a simple part with Draft and Part WB

Introduction

This tutorial aims to be used as a first introduction to 3D modeling using the Part Workbench of FreeCAD. After having finished this tutorial you should be able to make simple 3D models by using primitives like cubes, cylinders, etc with a technique called Constructive Solid Geometry, short CSG modeling. Another way to create 3D models is by using a 2D shape by for example extruding or revolving the 2D shape in 3D space. For an introduction of that technique please follow the sister-tutorial Creating a simple part with PartDesign. The two tutorials intentionally have exactly the same model generated, this presents the beginner with a hands on experience of the two different techniques and how they are implemented in FreeCAD. The definition of the two techniques can be viewed as strictly divided from a semantic point of view, however there is nothing directly hindering a mix of the techniques when creating models. There are some caveats to watch out for when mixing modeling techniques, those are mainly related to aspects of how FreeCAD is programmed. There is a third tutorial intended as a first introduction to a mixed modeling example. That tutorial uses the Draft Workbench to create a 2D profile utilized to extrude a solid in the Part Workbench to make the same model as in this tutorial.

Before you start please have a look at how to navigate in 3D space. When hoovering over the mouse model selector in the lower right corner of the FreeCAD window, a cheat-sheet of the current mouse model appears as in the picture below.

Many newcomers to CAD programs get stuck while learning the software, if that happens to you, please go ahead and search the wiki or forum for further information – chances are that others also have been stuck on the same specific thing in the past so there is already an answer to your specific question. Or make a post on the forum with your questions or findings. The forum has several threads where users are helped to complete all sorts of different tasks, those threads are often similar to tutorials, and often have specific illustrations included.

The tutorial covers

  • The model to make
  • Using the Part Workbench to create and manipulate the primitive building blocks
  • Changing the color and transparency
  • A different way to locate the hole
  • Making the hole a countersunk hole
  • Making a hollow piece
  • A different way to position the chamfer
  • Editing dimensions
  • Organizing the tree a bit differently
  • Wrapping up

The model to make

Using the Part Workbench to create and manipulate the primitive building blocks

Create a new document and save it directly under a new name, it is good practice to make sure that you save the document at regular intervals, or just before larger operations. Then switch to the Part Workbench using either the workbench selector (labeled 10 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 the main solid block

Press Box to make a default solid cube. The cube appears in the 3D view and also as a new object in the Tree view in the sidebar.

Press Isometric to see the cube in 3D.

Select the cube in the Tree view, it becomes green in the 3D view. Below the tree view you will now see that the cube by default is created with the dimensions Length x Width x Height as 10 x 10 x 10 mm. Change those dimensions to 100 x 30 x 50 as per the initial drawing of the model.

When changing a property, like Length through the spinbox, one can either enter the values, or use the scroll-wheel to tick values up or down. The arrows for ticking values up or down can of course also be used. In the right most picture above, the Height property is in edit mode, rolling the scroll wheel when the mouse is over that cell will change the value by one up or down.

Click Fit all to see the whole cube.

Create the fillet

To make the filleted corner, in the toolbar press Fillet which opens the task panel for fillets in the combo view to the side. Change the radius spinbox to 20 mm, then in the 3D view, select the width edge to the upper right and click OK.

The task panel closes and you are back to the Tree view which now has a fillet object instead of the earlier cube.

Visibility of children

Click the plus sign/caret to expand the children of the fillet, which in this case is the cube we created earlier, but it is grayed out. Select the cube and press the space bar – this toggles visibility so the cube is now visible again and the icon is no longer grayed out. To deselect the cube click in a blank area in the Tree view or the 3D view.

Create the chamfer

Next is to create the 30 degree chamfer, start by toggling the visibility of the child cube of the fillet. There is a chamfer tool in Part Workbench, but instead of using it we will make the chamfer with another block and a boolean cut.

Create a new Box with dimensions 60 x 30 x 30. Change the placement angle to -30 degrees.

The placement angle is using the placement vector (Axis) as axis of rotation. The default is the z-axis, which is not matching our target direction, changing the placement vector to the y-axis produces the desired orientation of the cutting tool for the chamfer.

The same placement can be attained with other values as well, the simplest alternative example of a placement that is the same is an angle of +30 degrees and a y-axis of -1.

Python console

Furthermore the position needs to be adjusted, looking at the drawing of the finished part, there is no direct dimension to use for the intended translation upwards. Since the upward dimension is the one needed, we have to calculate it. Let’s make use of the built in Python console for those calculations, it is basic trigonometry. If the FreeCAD Python console is not visible for you, just right-click in an empty space in the toolbar area and check the Python console and it should appear in the workspace, when there you should as well add the report view if not already visible. The report view most of the times provides useful information or even hints of what to do next for different commands.

After importing the math module from the standard libraries in python we can use the formula (50 - math.tan(math.radians(30)) * 50) to find the distance in z-direction that the block should be moved. Copy the result of the formula from the Python console and paste it into the z position for Cube001. The tool to use for the chamfer cut is now properly oriented and positioned.

Expressions

One does not have to use the Python console to do the calculation, In most cases when dealing with numeric parametric values, FreeCAD has a short-cut to a built-in calculator. It is called Expressions in FreeCAD, you can enter the expression mode by first clicking in the spinbox for the z-position, a small blueish circular icon will appear at the right side.

Clicking that icon opens new window Formula editor where formulas and expressions can be entered as shown below. Using expressions is a powerful tool, since one can access parameters from the model, effectively making all parameters in the model available as variables to be used when creating an expression. In short, in our formula, instead of entering the number 50 when in the formula editor, we could enter a named parameter holding the value 50 from the cube, with the benefit that if we change the cube height, the position of the chamfer will automatically follow. The value of 50 in the current model is referred to as Cube.Length, i.e. the Length property of the Cube feature. Further information on this can be found on the wiki.

To make the cut, with the Ctrl key pressed down first select the Fillet in the Tree view and then the latest created cube (named Cube001) and finally in the toolbar press the Cut button. Your Tree view should now again be a single object in the root called Cut.

The toolbars

A sidenote on the toolbars, since they are the typical avenue to invoke commands. Although there is a basic setting for the layout of the toolbars, the actual layout on your computer could turn out to be less than ideal. In such cases it is easy to adjust. Consider the upper section of the below image. There are two rows of toolbars and only a limited number of the Part Workbench toolbar buttons are visible. The simplest way to see more toolbar buttons is to maximize the FreeCAD window, unless it already is maximized of course.

More common is to adjust the layout of the toolbars to suit your needs and your specific computer. The repositioning is done with the handle on the left of each toolbar. You can just click and drag the handle to a new location. In the lower section of the below image the toolbar positions have been adjusted, revealing their full content. Changes to toolbar positions are persistent through sessions.

The measurement tool

The measurement tool in the Part Workbench can be used to check that our calculation and placement of the chamfer is correct. Press the Measure Linear button and a task panel opens up, then select the 2 endpoints of one side of the chamfer.

It checks out with an x dimension of 50 mm, clear the measurement and close the dialogue.

Create the hole

To make the hole, press the Cylinder button, set the radius to 5 mm and height to 50 mm.

Next we need to position the hole according to the dimensions in the drawing. Change the view to Top view, then right-click the Cylinder in the Tree view and select Transform from the pop-up menu.

Change the Translation increment to 5 and use the red and green arrow to position the cylinder in the right position, moving it 15 mm in y and 65 in x by dragging the arrow ends with the mouse. Click OK to close the Transform dialogue. To make the hole press the Ctrl key and select the Cut and Cylinder in the Tree view, then press the Cut button in the toolbar. Your Tree view should once again have a single object in the root called Cut001.

Congratulations, the model is now ready.

With the basic model ready, let us explore different ways to alter this model, some examples are related to the appearance, additional features, or simply a different way to do the same.

Changing the color and transparency

There are several different ways one can change the appearance of objects, for this case, let's use the view tab in the property part of the combo view. First select the object in the Tree view and then edit any property like line color, shape color or transparency via the view tab (found at the bottom of the combo view).

Unfortunately when the object is selected it is a bit hard to see how it will look when tuning the new appearance. To see the final result one has to deselect the object. Here is the new look of the model, where one now can see the through hole also in the iso-view. Another way to edit the appearance is via the View → Appearance... menu.

A different way to locate the hole

Do a save-as under a new name. Then delete the cut that added the hole and move the cylinder back to zero position. Your model should look like the below picture, which is the starting point for using a different technique to locate the hole at the center of the upper face. Note that the color is back to the default gray, the change in appearance we did was on the cut object which now is deleted.

This time the Draft Workbench will be used to locate the hole. The hole is as before to be located at the center of the upper face, which is the same as the midpoint of the diagonal of the upper face.

Start by switching the workbench to Draft, it might be that a grid appears in the 3D view, the grid visibility can be toggled with Toggle Grid in the toolbar. When making use of the snap functionality in the Draft Workbench it helps to only have the snap types of interest enabled. This time it is sufficient to leave endpoint, midpoint and circle center enabled, so the settings for snapping should look something like below.

Finding the point to place the center of the cylinder could be done by making a diagonal as helpline and use the center of the cylinder and midpoint of the diagonal to identify the points to move between, however it turns out that we do not even need to make any helplines, we can snap on already existing solid geometry.

Select the Cylinder in the Tree view (it turns green in the 3D view) and press the Move button in the toolbar. A task panel opens for moving objects, make sure that Copy is unchecked.

Then move the mouse to the upper face of the cylinder so that you see a white dot in the center of the circle as per the left picture below, this together with the center symbol next to the mouse pointer means that a left button mouse click will snap to the white point.

When you have the white dot on the upper face, click the left mouse button, and repeat for the upper square face of the main solid, like the right picture above, and confirm the choice with a left mouse button click. The snap function makes use of mass-center for any type of face, and in this case the mass center is the same as the geometrical center that is sought after. You will by now have noticed that the move of the cylinder is animated, so you always see what is about to happen.

Repeating the step of the boolean cut from earlier once again will make the through hole that completes the model. Using the linear measurement tool in the Part Workbench, a check that the hole is correctly placed is done. The measurement can only be done between points, so the measurement is done from main body zero to the seam point of the cylinder, meaning that the correct distance is 70 mm instead of the 65 that is on the drawing to account for the extra radius that is included in the distance.

Making the hole a countersunk hole

Switch back to the Part Workbench and create a cone by pressing the Cone button in the toolbar. Change radius1 to 0 mm and radius2 to 7 mm – this will give a 2 mm countersink on the radius. Making the height of the cone 7 mm results in a 90 degree top angle of the cone, or 45 degree countersink angle. Worth to note is that again one could as well use the Chamfer operation.

When working with FreeCAD you will continuously be faced with several different ways to achieve seemingly the same result. There is hardly any absolute truth in what is the right way to achieve a particular end result – however when looking in a specific context one specific workflow can be more flexible, allow for later features to actually be used etc. How you build 3D models will evolve over time as you along the way learn more and more about the features and capabilities of FreeCAD.

Translate the cone so that it is concentric with the hole and coplanar with the main solid upper surface. Use any method described earlier in this tutorial to accomplish that.

In the picture below the move is made with Transform and an increment setting of 1 mm, since the cone has a characteristic dimension of 7 mm, meaning that the earlier increment setting of 5 mm will not allow for correct positioning. The Wireframe rendering is used to easier see that the cone is in the right position.

To complete the model, let's make use of the Boolean command instead of first selecting objects and apply a specific boolean operation. Press the toolbar button and a task panel opens as per the below picture to the left.

Three items needs to be specified, the operation type, the first shape and the second shape. The cone is supposed to be cut, this is called Difference in this command, instead of Cut. The first shape is our Cut001, it is listed under compounds, since it is build from several solids. The second shape is the Cone. Once the correct settings are made for the command, click the Apply button to execute the operation. This has all been done in the picture to the right, and there one can also see that a compound Cut002 is now listed, this is our final model shape. After having changed the appearance the final model looks like this.

Making a hollow piece

Do a save-as under a new name. FreeCAD has all of the typical operations of a 3D modeller, one of them is Thickness, which is used to hollow out parts.

Rotate the view so that the bottom face of the model is visible.

Select the bottom face of the model, then in the Part Workbench select Thickness and the screen should look like below.

Click OK, as you can see there is now a radius on the hollowed out part.

Moreover, when taking a measurement of the width of the part, it is now 32 mm, so the thickness has been applied outwards. Let’s edit that, double-click the model in the Tree view and modify the join-type settings to intersection and the thickness setting to -1.

Now the outer width of the part is 30 mm, same as before and the corners are all sharp corners.

A different way to position the chamfer

Do a save-as under a new name. Then delete features so that the model looks like below.

Make a Cube with dimensions 30x30x60, ending up like below.

Change the placement by first rotating -120 degrees around the Y-axis.

Finally, change the position to X=50 and Z=50 and make the cut to produce the same result as earlier.

This once again highlights that there are always several ways to produce the same outcome, which is a recurring theme when it comes to 3D modeling. When it comes to basic geometries or solids, one can use different workbenches in FreeCAD as well as different commands and still have the same outer shape of a solid. You simply need to find your own way to a set of preferred tools and workflow that you are comfortable in using. Modeling in parametric 3D is a process of constant learning, and takes practice to master.

Editing dimensions, face colors and TNP

FreeCAD is a parametric 3D modeler, this allows you to change any placement or dimension and the model will update accordingly. In general this works, but it is possible to break a model when edited – for example when a fillet is based on an edge that no longer exists due to editing. When a model breaks during editing, it is referred to as TNP, Topological Naming Problem.

Go ahead and experiment with changing dimensions and placements to see if you can break the model, do not forget to recalculate the model after changes if required. This can be done with the Refresh button in the toolbar, if the icon is grayed out it is not needed to refresh the object.

Reposition the cylinder

Here is an example of the cylinder moved from the center to one side of the main body by using Transform on the cylinder. As can be seen in the picture, the cone is still in the original position, not affected by the move of the cylinder.

When you move the cylinder and break through the outer surface, in version 0.19 you are loosing part of the color settings on your model. FreeCAD reverts to the user default settings for shape colors and transparency in the 3D view, however the Cut002 shape still shows the colors and transparency that it had before as seen in below picture.

Fixing the colors

Here is one way to get it back. First change transparency one tick up or down and then back, that brings back the transparency. You can do the same trick on shape color. Another way to get the color back is to right-click Cut002 in the Tree view and select Set Colors in the context menu. In the task panel that displays, click Set to Default, that brings back the color to the one set in the view-properties.

The Set Colors command allows you to select individual faces of a shape and set a unique color on the selected faces.

Multiple solids

Another example where the cube that is making the chamfer has been translated and rotated.

As can be seen when repositioning the chamfer in this way, the end result is 3 disjoint solids. Part Workbench allows this, PartDesign Workbench does not, either you will get an multiple solids error or it will simply not render all solids.

TNP

Going back to the original completed model, let’s explore how the faces are named.

Here the selection view has been made active, just to show clearly what is selected and not, also coloring is adjusted so that the selection is easier to see.

Selecting one side face and the cylinder inner face gives that they are internally called face 2 and 9, where face 2 is the side face. Face numbering can be different for you.

Moving the cylinder so that the cavity ends up on the side face, and doing the selection of faces now gives a different number for the cylindrical face.

Face 2 is the right side of the original face 2, the left side of former face 2 is now face 8. The cylindrical part was face 9, but is now face 7. FreeCAD reassigns the numbering and the order is not necessarily preserved. The total face count in the first model is 10, in the version with the cylindrical face piercing the side face, the total face count is 11. So obviously face numbering has to change when the so called topology changes. This probably feels like a minute detail, but turns out to be quite important in parametric 3D CAD. Imagine that you have used the cylindrical face as reference for another feature, it used to be called face 9, but is now called face 8. The reference to the intended cylindrical surface is lost. Since FreeCAD, at least in currently released versions does not keep track of the intended face, it only keeps track of the numbered face, a model breaks when a reference is made to a face that later is renumbered. This is called TNP, Topological Naming Problem.

You are encouraged to learn how to avoid broken models due to TNP, further reading can be done elsewhere on the wiki, which largely focuses on a sketch driven workflow, the underlying mechanism is the same though. The renumbering described here for faces goes for all geometrical entities, faces, edges and vertexes.

Organizing the tree a bit differently

Do a save-as under a new name. Then delete all the cuts ending up with a model looking like below.

When using the Part Workbench and modelling feature rich solids, the tree structure of a solid can become hard to decipher. So far we have created one primitive / feature and applied a boolean operation. In the Part Workbench one can bundle primitives into one boolean operation. In our case we have the cylinder, cone and cube that are all a cut boolean operation.

Instead of making a cut for each primitive, we can first apply a boolean union, Fuse the primitives intended for the boolean cut, and then make the cut between the Fillet and the Fusion.

Using this approach, the Tree view ends up looking like below, which is just a different way of building the same model. Compare this with the original Tree view, none is better than the other, however when making more complex models, one approach over the other can have benefits in ease of modifying/reorganizing the model if needed.

Wrapping up

Having gone through the tutorial you are now briefly acquainted with the user interface of FreeCAD and you have learned the basics in using the Part Workbench. You should now be able to build simple models after your own liking. The Part Workbench is one of the workbenches that can be used to create solids, the PartDesign Workbench is another. The different workbenches have different capabilities and workflows. Learning FreeCAD in full, especially considering all add-ons and macros takes years, so keep on exploring new and different ways of making models – take different tutorials on the wiki, the learning never stops when working with FreeCAD. It is suggested that you learn sketches and the PartDesign Workbench next if your focus is on creating solids. If your focus is modelling buildings your next learning should be the Draft and Arch workbenches.

At last, FreeCAD is made by volunteers in their spare time. If you want to further advance FreeCAD’s capabilities, consider contributing to FreeCAD, for example by improving the documentation.