Basic Part Design Tutorial 019
Tutorial |
Topic |
---|
Modeling |
Level |
Beginner |
Time to complete |
Less than an hour |
Authors |
Carlo Dormeletti (onekk) Ed Williams (edwilliams16) |
FreeCAD version |
0.19 or higher |
Example files |
[] |
See also |
None |
This tutorial introduces the new user to some of the tools and techniques used in the PartDesign Workbench. This tutorial is not a complete and comprehensive guide to the Part Design Workbench and many of the tools and capabilities are not covered. This tutorial will take user through the steps needed to model the part shown in the image below using sketches.
Before you begin
The task
In this tutorial, you will be using the Part Design Workbench to create a 3D solid model of the part shown in the Drawing below, on which all of the necessary dimensions to complete this task are given. See Workbench Concepts for some conceptual background.
You will start by creating a core solid shape from a base Sketch and then build on that shape, adding what are known as Features.
These features will either add material to, or remove material from the solid by use of additional sketches and accompanying feature operations.
This Tutorial will not use every feature and tool available within the Part Design Workbench, but should use enough to give the user of this tutorial a basic foundation upon which to build their knowledge and skills.
This tutorial will provide detailed descriptions when it describes an operation for the first time; subsequent operations will have a more concise description. When in doubt, find the operation that contains the more detailed description. For instance, when creating a sketch for the first time the process of choosing the sketch Plane will be explained in detail, for subsequent sketches it will not.
Feel free to signal errors and problems in this forum thread:
New Part Design Tutorial for FC 019 and 020
The part
Constructing the part
Startup
First begin by making sure you are in PartDesign Workbench, selected from the drop-down menu. Once there, you will want to create a new document if you have not done so already. It is a good habit to save your work often, so first save the new document, giving it any name you choose.
All work in Part Design begins with a Body. Then we will build the solid inside the body by starting with a sketch.
Click on Create new body to create and activate a new Body Container. Note: this step can be omitted. When creating a sketch using Part Design|Sketch|Create Sketch, if no existing Body is found, a new one is automatically created and activated. This is not the case if you create a sketch using the Sketcher workbench, as sketches are useful in workbenches other than Part Design.
Master sketch
You will create a master sketch, see Sketcher WorkBench for a more detailed explanation of the terminology used here.
The workflow follows one of the many possible ways to make the above design.
This example will use some techniques described in Advice for creating stable models.
- master sketch
- Named constraints are used to hold dimensions that can be readily referenced later in the model construction.
For instance, to change the model width from 53 mm, as in the technical drawing, to 55 mm we need only to modify the Length value of the appropriate named constraint in the master sketch and the whole model will modify accordingly. This is parametric design in action. - External Geometries are potentially subject to the Topological Naming Problem. We will be using them only when strictly necessary and will attempt to refer to the most stable elements available. Referring to edges or vertices of prior sketches is normally more stable than referencing edges or vertices of generated geometry.
Rationale
- The Master sketch contains the model's rectangular base shape and two named constraints that will be created to supply correct dimensions to other parts of the model:
- length that will contain 53mm. (The result of adding the 39mm dimension to the two 7mm "sides")
- width that will contain 26mm.
Notes
- If Auto constraints in the Sketcher's Edit controls window is checked, some constraints will be applied automatically. Otherwise, you will need to apply them yourself.
- You exit a drawing tool by pressing the Esc key or by right-clicking an empty area of the 3D view. The mouse cursor should change to the standard arrow cursor. If you press Esc an additional time you will exit the sketch edit mode. To return to the editor, click on the Model tab, then either double-click the Sketch element in the tree, or right-click it and select Edit sketch in the resulting context menu.)
- If Sketcher's Solver detects a redundant constraint it will turn the sketch orange in color. Before further constraints are added, redundant constraints should be removed. (Redundant constraints are shown in the Task view - click on the blue reference and press Del.)
- It's possible that some elements of the side panel, for instance the OK button may not be visible if the side panel is not wide enough.
You can make it wider by dragging its right border.
Place your mouse pointer over the border; when the pointer changes to a two-way arrow, press and hold the left mouse button and drag.
Sketch
Step 1: Create the sketch
- Click on Create new sketch or the menu item Sketch|Create Sketch. This will create the sketch within the just created body. It will be named Sketch.
- A task panel like Fig: SK1 will open where you have to choose to which plane the sketch will be attached.
- Select XY_Plane from the list.
- Press OK.
- FreeCAD automatically switches to the Sketcher Workbench.
- The sketch is opened in edit mode: you will see something like Fig: SK2.
Step 2: Add geometry
- Click on Rectangle tool.
- Click two points to create a rectangle roughly centered around the Y axis similar to Fig: SKC1. Note:
- Don't place points on X axis as the Solver will automatically apply constraints that will create a problem later.
- The dimensions of the rectangle are unimportant at this point. They will be assigned using constraints in a later step.
- Once done, press Esc, or right-click, to exit "rectangle creation mode". "Rectangle creation mode" is indicated by this cursor appearance:
.
Step 3: Assign a horizontal constraint
- Assign now a horizontal distance constraint this way:
- Select the line defined by P2 and P3 in Fig: SKC1.
- Use the button horizontal distance constraint:
- A dimension will appear between extreme points of the line selected. This dimension is the current distance.
- Additionally, a dialog will appear:
- Set Length = 53mm, and to be able to easily reference this dimension later a name is required. You are free to use the name of your choice. It need only be unique within the sketch. Assign Name = length.
- Click OK.
- The result should resemble Fig: SKC2
Step 4: Assign a symmetrical constraint
- To center the the top edge of the rectangle around the origin proceed as follows:
- Select points P2 and P3 of the rectangle.
- Select the origin of the sketch.
Note: the selection order of the points is important. - Use Symmetric tool.
- You will end up with something that resembles Fig: SKC3.
- Making a good choice of origin of the model can simplify its construction, in this case by taking advantage of the part's reflection symmetry in a later steps.
Step 5: Assign a vertical constraint
- You now assign a vertical distance constraint, using a procedure analogous to the prior horizontal distance constraint
- Select the line defined by P3 and P4 in Fig: SKC1.
- Click on vertical distance constraint:
- Assign Length = 26 mm
- Assign Name = width.
- Click OK.
- Result should resemble Fig: SKC4.
- Note the following:
- The lines on the sketch will become "bright green". (Assuming you have not modified the default color theme).
- The Solver messages window displays Fully constrained.
- If you select any line or vertex of the sketch and try to drag it, it won't move.
Step 6: Close the sketch
- Click the Close button at the top of the tasks panel to leave sketch edit mode.
Main profile
You will create a new sketch that is holding the main profile.
Sketch001
Step 1: Create the sketch
- Click on Create new sketch. Create it in YZ_Plane. FreeCAD will assign the name of Sketch001.
Step 2: Add geometry
- Use the Polyline tool to make a shape like that in Fig: SP1.
- The labels P1, P2 etc. will not appear in the Sketcher. They were added as references.
- The three vertical and horizontal constraints you see in the image are added automatically by the auto-constraints provided you drew the lines that way. If you didn't you need to add them.
- When you close the figure, make sure the first point is selected when you click to create the final line. The selected point will change color and you will see the symbol for a Coincident constraint appear by the vertex. Coincidence constraints have to be explicit - just having two vertices visually coincident is not sufficient.
- As done in first sketch you will assign additional constraints later to adjust the dimensions and exact shape (see note about Constraints below).
Step 3: Assign constraints
- Select the point P2 and the Y-axis and apply a Point on object constraint.
- Select the origin and the point P1 and apply a Horizontal constraint. Why not a Coincident constraint, you might ask. Try it (and undo). The sketch will turn orange and a solver message redundant constraints will appear. Because the line P1-P2 has already been constrained to be vertical, the only remaining degree of freedom is P1's y-coordinate. The coincidence constraint sets both the x- and y-coordinates to zero, but the x-coordinate is already determined. The horizontal constraint, on the other hand, only sets the y-coordinate to zero, which is sufficient.
- Select the line defined by points P2 and P3 and apply a horizontal distance constraint and assign Length = 5 mm.
- Select the line defined by points P1 and P2 and apply a vertical distance constraint and assign Length = 26 mm.
- Select the line defined by points P4 and P1 and apply a horizontal distance constraint:
- For this value you will use a "Named constraint" using Expressions. To do so you have to press the little button on the dimensions , and you will be presented with a new dialog window named Formula editor that contains an input field and a Result: label, similar to the image below:
When you start typing in the input field, you will be presented with some autocompletions. - Select the label of the sketch. In our case we want
<<Sketch>>.
. Note the period after the "element label". - To select named constraint "width", you have to enter
Constraints.
with the period. Here autocomplete works. - To add "width", as yet autocompletion is not available, so complete the cell to read
<<Sketch>>.Constraints.width
. If all went well the "red error message" in the Result: field has been replaced by the correct value as in the figure below: - Click OK to close Formula editor dialog.
- Click OK to close Insert length dialog.
- For this value you will use a "Named constraint" using Expressions. To do so you have to press the little button on the dimensions , and you will be presented with a new dialog window named Formula editor that contains an input field and a Result: label, similar to the image below:
- At this point you should have a fully constrained sketch similar to Fig: SPFC.
- Note the subtly different colors used for distance constraints assigned using expressions and those assigned specifying a length.
Step 4: Close the sketch
- Click the Close button at the top of the tasks panel to leave sketch edit mode.
Pad
- Make sure Sketch001 is selected.
- Select Pad from the toolbar or from the Part Design menu:
- Once that is done you will have a solid as shown in Fig: Pad.
Features
With Pad you have obtained a solid.
Now it is time to add some Features to this solid. Feature operations add or subtract material from our body. The result of any feature operation must remain a single contiguous body. You can't create additional bodies or cut them into pieces with them.
These Features could be applied in various ways, the way presented here is not the only way to achieve desired result.
The starting point is again a Sketch.
Corner cutouts
Sketch002
Step 1: Hide the solid
- Hide the just created solid: Select Pad and click the Spacebar.
Step 2: Create the sketch
- Click on Create new sketch in XZ_Plane. Sketch will be named Sketch002.
Step 3: Add geometry
- Select Rectangle tool, and create a rectangle. Do not create it too near an axis, to avoid any automatic constraints that would make it difficult to move into the correct position using the External geometry tool.
Step 4: Assign dimensional constraints
- Select one of the horizontal lines apply a horizontal distance constraint and a value of 11 mm.
- Select one of the vertical lines and give it a vertical distance constraint and a value of 5 mm.
- You should obtain something similar to Fig: SK2.
Step 5: Close the sketch
- Click Close at the top of the task panel. Sketch002 will not be not fully constrained at this stage.
Step 6: Make previous sketches visible
- To use External geometry the sketches whose elements we want to reference must be visible. Make sure Sketch and Sketch001 are both visible. Use the Spacebar to toggle visibility if needed.
Step 7: Applying External geometries constraints
- Double click on Sketch002 to activate edit mode. Rotate the view so you can clearly see the points as shown in Fig: SK2_1. This will ease subsequent steps. Note that the rectangle's initial position could be different in your sketch.
- Select External geometry tool, the cursor will became .
- Select with this cursor point P1 in Fig: SK2_2, selected point will remain highlighted and in the Elements tab of task panel you will see that this element is shown File:Pd tut ext geom pt.png.
- Select with this cursor point P2 in Fig: SK2_2.
In the Elements tab of task panel you will see another element like the above. - Right-click or press Esc to terminate External Geometry selection. The cursor will return to the standard arrow pointer.
- Select point P1 and point P3 and apply a Vertical Constraint. The rectangle will be aligned with the X position of selected point.
- Select point P2 and point P3 and apply a Horizontal Constraint. The rectangle will be aligned with the Y position of the selected point.
- Sketch002 should now show green as "fully constrained".
Step 8: Close the sketch
- Click Close at the top of the task panel.
To create the cutouts we will use the Pocket tool. This tool is the opposite of the Pad tool. Whereas the Pad tool adds material to the part, the Pocket tool removes material from the part.
- Select Pad and unhide it.
- Select Sketch002.
- Select Pocket and configure the operation:
- You should have something that resembles Fig: PK1
Mirror
Instead of creating another sketch and pocketing it, we can take advantage of the model's symmetry about the YZ plane and use Mirrored.
- Select Pocket.
- Click on the Mirrored feature on the toolbar or from the Part Design|Apply a pattern menu:
- If all has gone well, you should now have a part that looks like Fig: PK2.
Sides
Sketch003
- Make sure Sketch is visible, and Mirrored is hidden.
- Click on Create new sketch and create the new sketch in XY_Plane; Sketch will be named Sketch003.
- Select Rectangle tool, and create a rectangle, similar to those in Fig: Sk3_1. This should not trigger any auto constraint, because we offset our rectangle from the x-axis.
- Apply these constraints:
- Select one of the horizontal lines apply a horizontal distance constraint and a value of 7 mm.
- Select one of the vertical lines and give it a vertical distance constraint using an Expression and assigning the distance
<<Sketch>>.Constraints.width
. - Add an External geometry using the point P1 as shown in Fig: SK2_2. (Vertices are somewhat finicky to select. Selecting any line containing P1 will create external references to both ends.)
- Select both the top-left point of created rectangle, (marked TL in in Fig: Sk3_1) and the newly added External Geometry reference to P1.
- Apply a Coincident Constraint.
- The sketch should be fully constrained now.
- Click Close at the top of the task panel.
Pad001
- Select Sketch003.
- Click Pad:
- You should have a result as shown in Fig: Pad001
Mirrored001
- Select Pad001.
- Click on Mirrored:
- If all has gone well, you should now have a part that looks like Fig: Mirrored001.
Note:
Our two mirror operations have a common symmetry plane, so we could have made our model a little simpler by combining them. We would
- Omit the Mirror operation above
- Select both Pad001 and Pocket in step 1 of the above Mirrored001 operation.
This emphasizes the important concept that we are mirroring the selected features (the operations we performed on the body, in the order selected), not the body itself.
Center hole
Now it is time for the most challenging part of our modeling, a challenge that arises because the central pocket dimensions are referred to the slanted face.
If you use as a reference points on the slanted face created by padding Sketch001, you expose yourself to the Topological naming problem. A better solution is to reference Sketch001 itself when creating our next sketch as follows.
Sketch004
- Make Sketch visible, and Mirrored001 hidden.
- Click on Create new sketch, and create the new sketch in the YZ Plane. This will create a sketch named Sketch004.
- Using Polyline tool, trace a polyline like that indicated by the points P1, P2, P3, P4 in Fig: CP01.
- Remember to close the polyline by clicking the last point over the selected first point. This will create the required coincidence constraint.
- Check the applied constraints:
- If Auto constraints was selected delete the redundant Constraint vertical applied to the line defined by P1 and P2.
- If Auto constraints was not selected apply the following constraints manually:
- Constraint horizontal on lines defined by P1 and P4, and P2 and P3.
- Point on object on P1 and P2 on the Y axis.
- Using External geometry tool select line defined by EGP1 and EGP2 on Sketch001 indicated in Fig: CP02 with purple color.
- Apply Point on object to P3 and P4, selecting the point and the external geometry, this will make line P3 to P4 coincident with line defined by EGP1 and EGP2 in Sketch001.
- Apply Distance to line P3 to P4 and assign Length = 17.00mm
- Apply Distance to P4 and EGP2 and assign Length = 7.00mm.
- This will result in a fully constrained sketch like in Fig: CP02.
- Click Close at the top of the task panel.
Pocket001
Now you have to model central pocket, Drawing specify its distance from side pad as 11mm. An easy calculation shows that with this dimension the pocket is centered, having modeled the solid symmetric around the Y axis is more easy to place the pocket.
- Select Sketch004.
- Select Pocket and configure the operation:
- Select the newly created Pocket001.
- Change its Refine property to True.
Notes:
- Refine will try to delete "seams" left by previous operations. It is advisable to only Refine the final solid obtained, as some operations can fail if Refine is activated.
(However, there are also cases where Refine can make an operation succeed. So in case of problems check this property and test. Unfortunately there is not yet a general rule to follow.) - Alternatively we could have used Type Dimension , checked Symmetric to Plane and entered 17 mm for the Length value
The result
Your model is complete. It should look like the image below.
Single click on Sketch in the Tree View. Look for Sketch|Constraints in the Data tab and check on the effects of changing the length and/or width properties. The model should change parametrically.
Additional resources
File to make comparison with your results:
- Structure tools: Part, Group
- Helper tools: Create body, Create sketch, Attach sketch, Edit sketch, Validate sketch, Check geometry, Create a sub-object(s) shape binder, Create a clone, Create a datum plane, Create a datum line, Create a datum point, Create a local coordinate system
- Modeling tools:
- Additive tools: Pad, Revolution, Additive loft, Additive pipe, Additive helix, Additive box, Additive cylinder, Additive sphere, Additive cone, Additive ellipsoid, Additive torus, Additive prism, Additive wedge
- Subtractive tools: Pocket, Hole, Groove, Subtractive loft, Subtractive pipe, Subtractive helix, Subtractive box, Subtractive cylinder, Subtractive sphere, Subtractive cone, Subtractive ellipsoid, Subtractive torus, Subtractive prism, Subtractive wedge
- Boolean: Boolean operation
- Dress-up tools: Fillet, Chamfer, Draft, Thickness
- Transformation tools: Mirrored, Linear Pattern, Polar Pattern, Create MultiTransform, Scaled
- Extras: Migrate, Sprocket, Involute gear, Shaft design wizard
- Context menu: Set tip, Move object to other body, Move object after other object, Appearance, Color per face
- Preferences: Preferences, Fine tuning
- General: Create sketch, Edit sketch, Attach sketch, Reorient sketch, Validate sketch, Merge sketches, Mirror sketch, Leave sketch, View sketch, View section, Toggle grid, Toggle snap, Configure rendering order, Stop operation
- Sketcher geometries: Point, Polyline, Line, Arc, Arc by 3 points, Arc of ellipse, Arc of hyperbola, Arc of parabola, Circle, Circle by 3 points, Ellipse, Ellipse by 3 points, Rectangle, Centered rectangle, Rounded rectangle, Triangle, Square, Pentagon, Hexagon, Heptagon, Octagon, Regular polygon, Slot, Arc slot, B-spline by control points, Periodic B-spline by control points, B-spline by knots, Periodic B-spline by knots, Toggle construction geometry
- Sketcher constraints:
- Dimensional constraints: Dimension, Horizontal distance, Vertical distance, Distance, Auto radius/diameter, Radius, Diameter, Angle, Lock
- Geometric constraints: Coincident (unified), Coincident, Point on object, Horizontal/vertical, Horizontal, Vertical, Parallel, Perpendicular, Tangent or collinear, Equal, Symmetric, Block
- Other constraints: Refraction (Snell's law)
- Constraint tools: Toggle driving/reference constraint, Activate/deactivate constraint
- Sketcher tools: Fillet, Chamfer, Trim, Split, Extend, External geometry, Carbon copy, Select origin, Select horizontal axis, Select vertical axis, Array transform, Polar transform, Scale transform, Offset geometry, Symmetry, Remove axes alignment, Delete all geometry, Delete all constraints
- Sketcher B-spline tools: Convert geometry to B-spline, Increase B-spline degree, Decrease B-spline degree, Increase knot multiplicity, Decrease knot multiplicity, Insert knot, Join curves
- Sketcher visual: Select unconstrained DoF, Select associated constraints, Select associated geometry, Select redundant constraints, Select conflicting constraints, Show/hide circular helper for arcs, Show/hide B-spline degree, Show/hide B-spline control polygon, Show/hide B-spline curvature comb, Show/hide B-spline knot multiplicity, Show/hide B-spline control point weight, Show/hide internal geometry, Switch virtual space
- Additional: Sketcher Dialog, Preferences, Sketcher scripting
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub