Mechanical Integration With KiCad

Eagle and Fusion are getting all the respect for integrating electronic and mechanical design, but what about KiCad? Are there any tools out there that allow you to easily build an enclosure for your next printed circuit board? [Maurice] has one solution, and it seamlessly synchronizes KiCad and FreeCAD. KiCad will give you the board, FreeCAD will give you the enclosure, and together you have full ECAD and MCAD synchronization.

This trick comes in the form of a FreeCAD macro (on the Github, with a bunch of documentation) that loads a KiCad board and components into FreeCAD and export them as a STEP file. You can align the KiCad board in FreeCAD, convert STEPs to VRMLs, check interference and collision, and create an enclosure around a KiCad board.

KiCad has gotten some really great visualization tools over the past few years, and we would be remiss if we didn’t mention it’s one of the best ways to visualize a completed circuit board before heading to production. Taking that leap from electronic CAD to mechanical CAD is still something that’s relatively rare in the KiCad ecosystem, and more tools to make this happen is always wanted.

20 thoughts on “Mechanical Integration With KiCad

  1. I keep trying to learn FreeCAD, but always fall back to Fusion or other commercial apps in utter frustration. KiCAD, on the other hand, was easy enough to pick up and become at least moderately proficient in a few sessions. FreeCAD is kind of the stereotypical free software application in it’s total disregard for an accessible user interface/experience. Some day I’ll get it, but it just shouldn’t be this difficult.

      1. You’ll get v0.18.1 from the repo at the moment. I come from electronics and started MCAD mainly for 3D printing enclosures and I have to say, I’m quite satisfied with the ease of use in FreeCAD. Especially since the v0.18 update

      1. I would not call FreeCAD impenetrable, just ugly. But try to design something in it and then make a change, as is almost always necessary when designing things. You’ll be pleasantly surprised how a minor adjustment breaks your model apart without any chances for recovery.

        1. Yeah, even trying to revert changes can break stuff;
          Ctrl+z after boolean operations will remove the group but all members remain invisible even if they weren’t beforehand. The members will also attach themselves to the root node even if they are still a part of a previous boolean operation.

          Regardless it does the job once you manage to navigate around its quirks and accept that it still is in beta.

          1. Beta is when you have most of the stuff figured out but there are some bugs and maybe a couple of checkboxes need renaming, a next big feature is planned, but behind the horizon. OpenSCAD is beta. Blender is beta.

            FreeCAD isn’t even pre-alpha. There’s absolutely no design behind this project, it’s a bunch of really advanced features slapped together. Each feature is impressive, but together they don’t work well, if at all, a bloody pulp of software. I would classify it as a functioning prototype. Something you do to learn the problem inside out, then throw away completely before actually solving the problem. They need resources obvously, but most importantly someone with a good vision to coordinate these resources.

    1. Hi @June Tate-Gans
      at a first glance this may seem to be just a STEP exporter, but if you have a deeper look at the project, you could realize that StepUp is offering a real bidirectional ECAD and MCAD collaboration.

      This ECAD / MCAD process is a bi-directional PCB Data Integration with the ability to propose, accept or reject changes synchronously or asynchronously as seen on most powerful commercial CADs.

      Please have a look at these two videos:

      1) kicad StepUp: ECAD MCAD Synchronization
      https://youtu.be/6R6UEUScjgA

      2) kicad StepUp: the Sketcher for Getting to Blinky
      https://youtu.be/n44iBpu_YjY

  2. Brian,

    Nowadays FreeCAD has an add-on manager (under the Tools menu), which can painlessly install/update the StepUP script you are referring to (but not mentioning) as well as many other scripts. StepUP also needs the Manipulator workbench, also authored by the prolific [Maurice]. Once a pcb has been imported into FreeCAD, the assembly2 workbench (or its more modern sibling A2plus) can be used to, say, check clearances in the system the pcb is going to be installed. StepUP helps a lot with the 3D models of components. I have personally used these tools extensively.

    Using StepUP to import a pcb into FreeCAD, some people claim they can do finite-element analysis (FEM) using FreeCAD’s FEM engine and run a thermal simulation of the pcb. (I have not tried that.) Then, there is pyrate, which brings optical design into FreeCAD! There has been talk of using OpenEMS (http://www.openems.de/start/index.php), a full 3D electromagnetics simulator, with FreeCAD/KiCAD, but I am not sure where that stands.

    What many people don’t realize is that there is a whole ecosystem around KiCAD and FreeCAD because they are open-source and many can write add-ons.

    1. Yeah this is kind of ”old hat’ for those of us working with borhctools for a while now. Granted, constant improvements to borhctools, the stepup script, and integration has made it all much easier.

      I think combining Contextual’s getting to blinkie series with a good freecad tutorial and calling it ‘getting to product’s would be super helpful.

      Fusion is less of a pain, but freecad is slowly making its way.

  3. Or if you actually want professional software you use altium and its SolidWorks integration.

    Eagle is shit and shouldn’t be used when you have such a good and free alternative like KiCad.

  4. Hi Brian,
    thanks for reviewing my project.

    What I’ve noticed from some of the comments is that the first impression is limited to what it was done more than 3 years ago with StepUp:
    Converting KiCAD pcb and parts to 3D mechanical counterpart.
    Here a link of what StepUp did it on 2015:
    https://hackaday.com/2015/11/08/kicad-script-hack-for-better-mechanical-cad-export/

    Now, this recent upgrade is pushing the mechanical interaction much further.

    It is now possible to Push & Pull pcb Edge and 3D part positions between KiCAD and FreeCAD.

    StepUp is allowing a Mechanical Collaboration as you can find only on very high end commercial software.

    Following a link to a document describing what is used in the industry for implementing this process:
    https://www.prostep.org/fileadmin/downloads/ProSTEP-iViP_Use-Case_ECAD-MCAD-Collaboration_1.0.pdf

    Would you please consider to update this Blog post adding few tips and also the following two videos?

    1) Push & Pull pcb Edge between KiCAD & FreeCAD (03m.30s):
    (useful for complex board edges)
    https://youtu.be/n44iBpu_YjY

    2) Push & Pull kicad footprint modules position between KiCAD & FreeCAD (05m.00s):
    (useful for best enclosure designing)
    https://youtu.be/6R6UEUScjgA

    Thanks in advance
    Maurice

  5. FreeCAD exports all settings
    All the settings of FreeCAD, all in the FreeCAD folder.

    C:\Users\a←When installing the operating system, the name entered.\AppData←File Manager ~ “Hidden project” to open, the AppData folder will be displayed.\Roaming\FreeCAD

    Back up the FreeCAD folder, when reinstalling, put the FreeCAD folder in its original place.

    Note: To clear all settings, just delete the FreeCAD folder, then open the program, a new FreeCAD folder will be created.

    FreeCAD exports toolbars and macros I made
    Common path
    C:\Users\a←When installing the operating system, the name entered.\AppData←File Manager ~ “Hidden project” to open, the AppData folder will be displayed.\Roaming\FreeCAD\Please take the branch path below.

    Branch path
    \FreeCAD\user.cfg←The “toolbar” I made is placed here.

    \FreeCAD\Macro←The “Macro” I made is placed here.

    Back up the file and folder, when reinstalling, put the file and folder in its original place.

    Record settings with screenshots
    In the event that there is no way to export the settings, Record settings with a screenshot, It is the best way.

    For example: Desktop location, toolbar location, and more…

    Record settings with a screenshot, When reinstalling, It will be restored soon.

    The same is true for mobile phones.

  6. Yeah, FreeCad … The best thing to happen to it is the RealThunder fork (github) which solves the Topology Naming Problem. Then you go back to the main fork to do other things better/at all. That said, once you learn the pitfalls it rocks pretty well.

Leave a Reply to June Tate-GansCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.