Tutorial: How to make a footprint in KiCad 5.1.x?

3D-Model handling

Disclaimer: Screenshots from current nightly (will become version 5.1). Version 5.0.x looks slightly different.

Preparing the 3D Model for KiCad

Molex offers 3d models for their connectors on their website, so we will continue with our picoblade connector. Go to the product site and navigate to the engineering documents section where you will find 3d model files. Download the step file (some subpages later).

Selecting the file format

KiCad supports both wrl (tessellated surface model) and step (CAD exchange format). More details see: What is the difference between step and wrl 3d models? All official footprints are setup for wrl but KiCad will replace the file ending with step if it needs it (on step export)

Aligning the model to the footprint

Most models you download will not be aligned in the way kicad expects it to be aligned.
You can of course use the settings of the footprint to align it but this is quite fiddly so the suggestion is to already align the model in your 3d CAD program. In this tutorial we will use freecad 0.18 with the extension kicad-stepup

Import elements

With stepup we can import both the footprint and the downloaded step model into freecad. First we load the footprint as shown in the screenshot.

The step file is imported via the normal freecad import tools found in the file menu or shortcut crtl+i. The result of importing both will look like the following screenshot.

Aligning the model to the footprint

As you notice the model is not aligned to the footprint right now. Many tools can be used to achieve this but this tutorial will only use the stepup internal tools. First we use the rotation options to get the model rotated correctly.


Next we can put the model onto the board. For SMD models we can use the put on z tool to easily achieve this.

Now only alignment in y direction is necessary. We will use the measure tool of the part workbench to find the distance required, enter it into stepup for the y direction movement and then move the model in place.

The final result will look like this

Export to KiCad

We now need to export the aligned model to step and (or) wrl. Stepup offers a one click tool that generates both a coloured step file and a correctly scaled wrl model. These can then be both used by kicad with scaling set to 1 (and if you aligned it correctly then offset and rotation set to 0)

3D-Model assignment (adding a model to the footprint)

3D-models unlike footprints and symbols are not really managed by KiCad. A footprint points directly to a file via a 3d path field. It is suggested to use path variables within the 3d path to increase portability.

Path variables for the 3d model path

Much more detailed description found in: Library management in KiCad version 5

Managing path variables is done via the path configuration tool found in the kicad main window -> preferences -> configure paths.

Using path variables means adding them with the syntayx ${path variable} (replace “path variable” with the name of your path variable)

Kicad will do this automatically for you if you have a fitting variable for your file path and use the browse button. (see below)

Adding the 3d model to the footprint

To assign a model open the footprints properties dialog and switch to the 3D-model dialog. (This dialog is found via edit-> footprint properties or as a button in the top toolbar)

Use the browse button (looks like the typical open button) or the add button (a plus symbol) to add 3d models.

The browse button is useful if you already have a 3d model for this path. Simply navigate to this button with the file browser opened by this dialog and select it. KiCad will take care of adding a fitting 3d path (Including the addition of path variables if there is one pointing to parts of the required path.)

The add button for manual entry is useful if you do not have a 3d model at the time of making the footprint. It allows for fully manual path entry.

The browse dialog even has a nice file preview that works for both wrl and step 3d files.

When the file is added you will be able to see it in the preview window. You can even change the scaling, position offset and rotation of the model to align it correctly with the footprint. (I would however suggest to align the 3d model to the footprint within a proper 3d modeling software and export already correctly aligned files. One way to do this is by using freecad plus the kicad stepup extension.)

8 Likes