Convert Gerber (or KiCad PCB) to 2D Draft

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Weatherman
Posts: 2
Joined: Fri Oct 09, 2020 1:46 pm

Convert Gerber (or KiCad PCB) to 2D Draft

Post by Weatherman »

Hello there,

I want to put together the gerber files of multiple PCBs to one FreeCAD file. The boards are going to be mounted on one metal plate, so a 2D draft is sufficient that contains the drill holes to mount the boards and their outlines.
I tried many ways of exporting and importing, but haven't found the solution yet how to do that...
As I can't load the gerber files directly with FreeCAD, I started using KiCad to open the gerber files, export these to KiCad PCB and open the KiCad PCB in FreeCAD with the PCB Mod. Now I'm looking for some way to convert this imported 3D model (which looks fine) to a 2D version (of the Top plane). I'm sure this must be possible somehow?
Might it be necessary to export the 3D PCB as a 2D DXF (in the PCB Mod), then use the Draft or Drawing working area to import the DXF?

In the end, I'm imagining a 2D rectangle (the metal plate) including all the 2D PCB information so I can print that out and drill the mounting holes as required.

I appreciate your help, thank you in advance!
I wish you a nice weekend :)
drmacro
Veteran
Posts: 8984
Joined: Sun Mar 02, 2014 4:35 pm

Re: Convert Gerber (or KiCad PCB) to 2D Draft

Post by drmacro »

I haven't looked recently at the KiCAD workbench.

But, I thought the last time I used it, I did the PCB outline in FreeCAD, including mounting holes, and pushed it KiCAD. Then put the ratnest inside that outline (In KiCAD) and did the routing in KiCAD.

On the other hand, if it is done in KiCAD and the PCB is pushed to FreeCAD, isn't the PCB outline in FreeCAD?

As I said...been a while since I did a PCB and enclosure. :roll:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Weatherman
Posts: 2
Joined: Fri Oct 09, 2020 1:46 pm

Re: Convert Gerber (or KiCad PCB) to 2D Draft

Post by Weatherman »

I'm now doing it as follows:
  • Open Gerber files with KiCad, export the desired layers to KiCad PCB
  • Import the KiCad PCB to FreeCAD (PCB Workbench)
  • Export the Layer folder in FreeCAD as a .DXF file
  • Import the .DXF file in a second FreeCAD project (e.g. Draft)
It is working, however this seems to be quite complicated and time-consuming. Additional hints are welcome, but at least it is working.
Thank you for your help!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Convert Gerber (or KiCad PCB) to 2D Draft

Post by Kunda1 »

easyw-fc wrote: pinged by pinger macro
Maybe @easy-fc can further illuminate this topic
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Convert Gerber (or KiCad PCB) to 2D Draft

Post by easyw-fc »

Weatherman wrote: Tue Oct 13, 2020 6:03 am I'm now doing it as follows:
@Weatherman are you using PCB Mod or kicadStepUpMod?
If you are using the second, which is the one I developed,
https://wiki.freecadweb.org/KicadStepUp_Workbench
you can import a kicad pcb layer into a sketch in a FC document; doing that for the pcbs you have, you can after merge the documents and work with the merged design to handle your job.
Post Reply