KiCad and FreeCAD collaboration!

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

realthunder wrote: Yes, solid. Not only that, the solid can optionally come from a sketch, which makes it possible to edit the PCB in FC. Doing copper feature and additionally with holes is exceptionally challenging in FC because it needs lots of 2D offset and tangential cut operation, which FC is not good at. I had to write my own extension to do the heavy lifting.
Is there a repo to test i.e. converting a kicad board with tracks like in your attached image pcb_combo?
Maurice
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: KiCad and FreeCAD collaboration!

Post by realthunder »

easyw-fc wrote:Is there a repo to test i.e. converting a kicad board with tracks like in your attached image pcb_combo?
I'll add the document soon. I'm currently doing some optimization on path sorting for PCB milling. You can try my repo with any kicad_pcb file. Some pad shapes are not implemented yet, e.g. trapezoid pad. If you encounter any error, please send me your kicad_pcb file. I can try to fix it. No technical layers support yet (silkscreen and stuff), but it should be trivial to add. Here is a brief instruction.

First, you will need the latest 0.17 snapshot of FreeCAD.

Clone my repo into your freecad macro directory. After clone, cd to fcad_pcb, and checkout the submodules

Code: Select all

git submodule update --init --recursive
Start FreeCAD, in the console, the simplest usage,

Code: Select all

form fcad_pcb import kicad
pcb = kicad.KicadFcad(<full_path_to_your_kicad_pcb_file>)
pcb.makeCoppers()
You will get all copper layers as faces. The copper merges together all the pads, tracks, and zones. You can extrude those faces to solid using Part Extrude feature. Or, select the copper item in treeview, and click 'make path from shape' button in Path workbench to convert to gcode. The copper item is a Path.FeatureArea, so you can mess around with offset and stuff to get PCB milling.

You can make single copper layer by

Code: Select all

pcb.setLayer('F.Cu')
pcb.makeCopper()
You can also makePads, makeZones, makeTracks, separately.

If you want holes, add holes=True into any of the above method calls, e.g.

Code: Select all

pcb.makeCopper(holes=True)
And if you want the whole PCB board in 3D,

Code: Select all

pcb.make()
make() internally calls makePads, makeZones and makeTracks to get separate faces, and extrude them into separator solids. If you have matching step files at the same location as your vml model files, the make command will load those models as well. You can checkout my various 3dshapes repository containing the step files in github (which I used your StepUp script to generate, and also the cadquery repo, BTW :D ). If you don't have those model files, then you'll get a bare board with all the tracks, pads, and zones, with holes. Maybe that's what you want.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

a quick update...
a bunch of other FreeCAD script generated models available at KiCad repo
Image
Image
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

other Through hole components... the MCAD KiCad library is growing again!!!
Image
Image
Image
Image
Image
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: KiCad and FreeCAD collaboration!

Post by ian.rees »

Nice work Maurice! Keep it up! -Ian-
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: KiCad and FreeCAD collaboration!

Post by Kunda1 »

Nice!! Well done!
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: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

ian.rees wrote: Mon Jul 31, 2017 9:16 pm Nice work Maurice! Keep it up! -Ian-
Kunda1 wrote: Mon Jul 31, 2017 9:21 pm Nice!! Well done!
Thx, I started the main script CQ framework; but now there is a powerful MCAD squad for KiCad :D
you can see them as contributors here
https://github.com/easyw/kicad-3d-model ... ntributors

and other 3D models I forgot ;)
Image
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: KiCad and FreeCAD collaboration!

Post by Kunda1 »

It looks like the makings for the next Pixar movie :D
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
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: KiCad and FreeCAD collaboration!

Post by Jee-Bee »

REQUIREMENTS

FreeCAD 0.15 (best for step single object result)
CadQuery 0.5.2
If you would like to share your models, I'll be happy to add these to the 3D repo!!! :)
Only the requirements are a pity @Maurice :lol:
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

Jee-Bee wrote: Tue Aug 01, 2017 5:10 am Only the requirements are a pity @Maurice :lol:
Till few time ago, FC0.15 was the only FC release that had no bugs when exporting STEP models.
FC 0.16 has been patched recently thx @ wmayer with release >=6710 (not available for windows or osx) and FC0.17 has been patched just now by @vejmarie, but still waiting to be merged.
So that statement was correct to generate good STEP models.
😉
Post Reply