Importing .stp file for geometric reference

Hello, I am trying to create a modular board, there i have created multiple mini pcb’s to place oto a larger board. The mini boards have pin headers on them and I need the pin sockets on the larger board to be exactly aligned with those on the mini board so that it can be placed properly. How can I use the .stp file i exported from the mini board as a reference on the bigger board. Is there a way to import it into the project of the larger board to ensure the correct placement of the pin sockets?

I think STP directly is not supported. You need to open your STP file in a 3D software, export a desired view as DXF and import that to KiCAD on one of the user’s layers.

I assume you mean ISO 10303-21 - Wikipedia (STEP-file format; step or STEP is a bit more widely used file name ending than stp).

KiCad supports STEP, but what does “directly” mean?

Workflow could be for example like this:

  • Export a mini board PCB project as STEP or use FreeCAD + StepUp workbench to import it to FreeCAD.
  • Create a footprint for the mini board which you can place into the main PCB. You know the X/Y dimensions and pin locations etc. of the mini board; design the footprint accordingly.
  • Attach the exported STEP file to the mini board footprint just as any 3D model is attached to a footprint. If it needs other than 0 0 0 location and rotation to align it to the footprint, I strongly recommend using StepUp again, opening the STEP file there and importing the footprint file, then doing aligning there and exporting the KiCad compatible STEP (and wrl) file. After aligning in FreeCAD/StepUp and exporting, the result is directly compatible with the footprint.
  • Now you have a footprint which you can move on the main PCB layout and look it in the KiCad 3D view.
  • StepUp has a possibility to import also the board file. I haven’t used the advanced features, but it’s possible you can do the main PCB / mini PCB alignment there. In any case I recommend looking at StepUp to find out if it can help.
2 Likes

What I Meant is - you can export STEP from KiCAD (directly or via FreeCAD/StepUp), but you can’t import STEP of other board back to KiCAD. You need to use DXF for 2D PCB shapes.

This is related to “Design Blocks”, and there are feature requests for that on gitlab, but it’s not implemented yet in KiCad, so for now you have to make do with what does work.

I have strong preference for keeping the footprints for such modules very simple For THT I prefer to make the modules matrix board and breadboard compatible. For higher density, I guess that castellated pads as commonly used for WiFi and Bluetooth modules is one of the better solutions. But again, keep the design of the footprint simple, so it’s easy to design a footprint.

In KiCad, any footprint can have a STEP file assigned. You (very likely) have to design a custom footprint for your module anyway, so you can then just assign the STEP file of the module to that footprint. In the Footprint Editor you can use: Footprint Editor / Place / Add Reference Image to add a 2d image as a reference for designing the footprint. You can export an image of the PCB of the sub project, and use it as a reference for pad locations when designing the footprint.

You beat me to that by a few seconds :slight_smile:

But it does make me wonder: Why shouldn’t KiCad be able to do that? KiCad already has: Footprint Editor / Place / Add Reference Image, and I see no reason why this should be limited to 2D images. Extending that function to enable adding a STEP file is possible. The problem here is that almost all Canvases (Schematic, PCB, Symbol, Footprint -editors) are 2D only. Only the 3D viewer can show 3D models. I guess a STEP model could be rendered as a 2D “top view” outline, but that would be only a marginal improvement to exporting a DXF or SVG of the board and using that as a reference image.

Anyway, when you have created the 2nd project, you can use the 3D viewer to check whether the 3D model from the “module” project fits with the footprint you created for the 2nd project.

STEP is 3D, DXF is 2D.

DXF can be used to get outlines (e.g. for Edge.Cuts) into KiCad, STEP can be used for adding the 3D object to the footprint.

Which is usually enough if you want to line up multiple boards together.

Depends on the software concept and developers’ priorities I guess
For me KiCAD + FreeCAD (with StepUP WB) combo works great and each of them is best in their own domain.
There are some workaround (temporary footprint with STEP file 3D model of the other module or using DXF 2D shapes).

1 Like

thank you! this is exactly what I meant

Can you be explicit? What did you mean?

If you need to have pin headers or other connectors in their right places, IMO exporting and importing between formats and programs isn’t necessarily the easiest way. In KiCad it’s for example possible to:

  • Open the mini PCB project.
  • Select and copy each wanted pad and graphics, for example pin header pads and Edge.Cuts outline.
  • Open the footprint editor and create a new footprint.
  • Paste to the footprint.
  • Select the outline graphics and change the layer to F.Fab.

Add some silk etc. and magically you have a footprint. Place it to the right place in the main board.

Currently the pcb editor is not able to directly import a 3D step file. For all who want such a feature: look at First-class 3D model object (was: Ability to add free-standing STEP files (3D models) to board) (#12929) · Issues · KiCad / KiCad Source Code / kicad · GitLab

Using FreeCAD and StepUp-workbench is the best approach but, if not having the knowledge/skill and/or interest in doing it that way, here’s another approach:

Assuming a User has the STEP/STP file (Note: that extension is ‘text’ and is interchangeable, just retype it from STP to STEP, if wanted).

• Load the STEP/STP into a Footprint and place it on the PCB as usual.
• View it in the 3D-Viewer and Export as PNG (or JPEG)
• Load it into the PCB using the Add-Bitmap Image tool
• Now, draw your stuff with the image in the backbground.
(Hide or delete the image as desired)

Pay attention to Scaling

Video shows loading an ESP32 into a Dumb Footprint I use for viewing STEP files in Kicad and for doing layouts in Kicad (Exactly what OP wants) though, 99% of the time I do it in FreeCAD/StepUp…

• I loaded the ESP32 into Footprint, placed it into a Blank Procject/PCB
• Exported PNG from the 3D-Viewer
• Changed to a Project of interest that had some parts on the PCB
• Loaded the PNG using the Add-Image tool
• I draw some lines on Silk, Edge-Cuts and Courtyard (I did not bother to set the 3D-Viewer to show Courtyards but, that’s not important…

NOTE: You can set the 3D-Viewer’s Background Color and it’s Opacity for better visibility…