Sl-Alex home lab

3D models for KiCAD. Part 2 - FreeCAD

Views: 9379Comments: 9

Translation: RU
3D models for KiCAD. Part 2 - FreeCAD

This article is a second article describing 3D models creation for KiCAD. In the previous article we've created complete 3D model with OpenSCAD. This way, despite of its simplicity, requires you to keep complete model in your head, thus you can make a lot of mistakes, which will be hard to find later. Moreover, in many cases it's much easier to create such things in your favourite 3D editor. There are not too much 3D CADs in open-source world, and from my point of view the best is FreeCAD. Of course, there are some proprietary alternatives, but I prefer KiCAD because of its simplicity and speed. Small bonus - both OpenSCAD and FreeCAD work like a charm in Linux.

Let's begin. Start FreeCAD, create new document by pressing button. Small remark - by default FreeCAD uses only 2 decimal numbers. We need 3, so go to menu "Edit/Preferences" and in chapter "General" in tab "Units" set "Number of decimals" equal to 3.

Now it's time to draw a single pin. In toolbar from drop-down list select "Part Design" and in the task panel on the left select "Create sketch". As an alternative, you can use button . In the dialog select YZ plane and press OK.

It will be easier for us to work with smaller grid, so let's change grid size to 1mm in the left panel. Move your cursor over the sketch and use scrolling to get viewport about 3*3mm. Now we can use polyline button () and draw something similar to what we need. Do not forget to close polyline by matching start and end points. You should have something like this:

Pin sketch draft Figure 1: Pin sketch draft

I drew non-perfect sketch intentionally, just to show you how to make it perfect. Please pay your attention to small red signs near each line. These are constraints, you can see them all in the list on the left. There can be horizontal, vertical, equality, parallel and many other constraints. In my case after I finished polyline I've got "Sketch contains redundant constraints" message. Next sentence contains constraint, which can be removed. If you have such a message, just select this constraint and remove it. Yellow text should become normal. Now let's add more constraints to our sketch. Select two skewed lines and make them parallel with button. Now let's make a small trick and draw the following segment (I've selected it with mouse):

Construction mode line Figure 2: Drawing construction mode line

Select this segment and one of the skewed lines and make them perpendicular. Select this segment once again and switch it to the construction mode line with button (it should became blue). Now select this segment again together with most left and most right segments of our sketch and apply equality constraint ( button). You should get something like this (pay attention, that I've applied vertical constraint to the most right segment):

Pin sketch Figure 3: After equality constraint

Now you can try to drag any segment of our sketch. If you haven't completely constrained sketch, you probably could do so. If your sketch is completely constrained - it will become green and you will get "Fully constrained sketch" message on the left panel. Just add some constraints (vertical and horizontal lengths, angles) until you get something like this:

Pin sketch Figure 4: Completed pin sketch

On the left panel press "Close" button. FreeCAD proposes us several ways to add volume to our sketch. we will use extrusion operation ("Pad") and specify 0,3mm length. At this point we have finished our pin and we can look at it from the different points. You can rotate camera by moving mouse while holding Shift after "Shift + right mouse button click" operation. You can move camera by moving mouse while holding Ctrl after "Ctrl + right mouse button click".

One pins is great, but it seems to be annoying to draw 20 pins! Of course, everything is much easier. To do so, increase viewport and select "Draft" mode from drop-down list on the toolbar. In this mode we need array creation button . Press it and select our pin. We will get something like this:

Array Figure 5: Array with default parameters

Now it's time to modify array parameters. Select "Model" tab on the left, and in the bottom select "Data" tab. Change "Number X" to 10, "Number Y" to 1 and "Interval X" to 0,635. Now we have the following:

Array Figure 6: Final array

It's much better, right? Now let's create mirrored array. Select our array in project tree on the left panel, select "Part" mode from drop-down list on the toolbar. Press "Mirror" button. Select XZ plane and press OK. We will get something like this:

Mirror Figure 7: Mirrored array

Now let's make a gap between arrays. Select mirrored array in the project tree and change its "Placement Position Y" property to 3mm. Here is the result:

Array Figure 8: Completed pins

The only things we have to do are the case and the notch near the first pin. Switch to "Part Design" mode and press "New sketch" button. Select XY plane. Let's draw rectangle, set its dimensions and set its position relative to zero point:

Case sketch Figure 9: Case sketch

We will make pad with 1,2mm thickness from the sketch. Here is the result:

Case draft Figure 10: Case draft

It looks almost perfect, but small chamfers on the top and bottom edges will make it better. While holding Ctrl button select all segments of the top and bottom edges, then switch to "Part" mode and select "Chamfer" tool ( button). By default chamfer has angle of 45, but we need a bit different parameters. Set "Fillet type" to "Variable length" and fill 0,5 and 0,2 in the appriproate fields below the table (vertical and horizontal lengths). Press OK.

Case draft Figure 11: Case is almost done

The final part of our tutorial is notch creation. Let's make it. Switch to the "Part Design" mode, select top edge of the case and press "New sketch" button. Draw circle in any place of the top edge . Now we have to specify distances between the center of our circle and left bottom point of top edge. Press ("External geometry") button and select left segment of top edge. Press it once again and select bottom segment. Selected segments have dark-magenta color now. Specify circle size and position.

Notch sketch Figure 12: Notch sketch

Press "Close" button, but instead of "Pad" select "Pocket". Set length to 0,05mm. Here is the final result:

Final model Figure 13: Final 3D model

It is perfect, isn't it? Maybe you think that such an approach is quite hard and boring, but beleive - it's really very easy, it took me only 6 minutes to do it. The perfect bonus is that now you can modify any parameter just in few clicks. Just select an appropriate part in the design tree and modify its parameters.

If something is not clear from this text or maybe is not well-described - here is the video showing the complete tutorial.

In the final article I'll show how to prepare 3D models for KiCAD.