KiCad and FreeCAD collaboration!

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: KiCad and FreeCAD collaboration!

Post by PrzemoF »

easyw-fc wrote: Tue Aug 01, 2017 5:43 am
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.
😉
Beautiful work! :D
0.17 patch got merged on 1st of Aug (3h ago), so new builds will be available very soon.
solidTrace
Posts: 9
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Post by solidTrace »

realthunder wrote: Mon Mar 20, 2017 1:08 pm
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.
Hi realthunder,

I find this topic quite interesting, nice tool! Looking at your fcad_pcb repo I have seen that there is still some activity. Is the project still on? I hope so. I have seen that you recommend the use FreeCAD 0.17 to use the scripts. With V0.19 out, is this still the case?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: KiCad and FreeCAD collaboration!

Post by realthunder »

solidTrace wrote: Wed Jun 03, 2020 2:43 pm I find this topic quite interesting, nice tool! Looking at your fcad_pcb repo I have seen that there is still some activity. Is the project still on? I hope so. I have seen that you recommend the use FreeCAD 0.17 to use the scripts. With V0.19 out, is this still the case?
I'll change the readme there. The script works well with 0.19.
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
solidTrace
Posts: 9
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Post by solidTrace »

realthunder wrote: Wed Jun 03, 2020 9:31 pm I'll change the readme there. The script works well with 0.19.
Nice! :mrgreen:
solidTrace
Posts: 9
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Post by solidTrace »

realthunder wrote: Mon Mar 20, 2017 1:08 pm
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
Hi Realthunder,

I've tried to clone your repo but since my Marcro directory has already some macros in it Github complains that it can't clone the repository there because the directory is not empty (there are already other files with the files being the macros that are already installed).

I'm not sure if creating an additional directory under "Marco" will address this problem and before I start experimenting I'd prefer to see if this is a know issue.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: KiCad and FreeCAD collaboration!

Post by vocx »

solidTrace wrote: Sun Jun 07, 2020 7:18 pm I've tried to clone your repo but since my Marcro directory...
Not in the Macro folder. Create a new, empty, directory under Mod, and download there what you need.

Code: Select all

cd ~/.FreeCAD/Mod
git clone https://github.com/realthunder/fcad_pcb fcad_pcb

cd fcad_pcb
git submodule update --init --recursive
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: KiCad and FreeCAD collaboration!

Post by realthunder »

vocx wrote: Sun Jun 07, 2020 10:26 pm
solidTrace wrote: Sun Jun 07, 2020 7:18 pm I've tried to clone your repo but since my Marcro directory...
Not in the Macro folder. Create a new, empty, directory under Mod, and download there what you need.
Small correction to vocx commend line, should be '~/.FreeCAD/Macro'.

Code: Select all

cd ~/.FreeCAD/Macro
git clone https://github.com/realthunder/fcad_pcb fcad_pcb

cd fcad_pcb
git submodule update --init --recursive
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
solidTrace
Posts: 9
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Post by solidTrace »

Small correction to vocx commend line, should be '~/.FreeCAD/Macro'.

Code: Select all

cd ~/.FreeCAD/Macro
git clone https://github.com/realthunder/fcad_pcb fcad_pcb

cd fcad_pcb
git submodule update --init --recursive
thanks guys, it's working now.

@realthunder,

I have a PCB layout that fails loading with your macro (I reaches the top layer and then it fails) and I see that you have an active issue directory

Code: Select all

https://github.com/realthunder/fcad_pcb/issues
where should I post the PCB file and the output error?
solidTrace
Posts: 9
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Post by solidTrace »

@realthunder,

I have a PCB layout that fails loading with your macro (I reaches the top layer and then it fails) and I see that you have an active issue directory
where should I post the PCB file and the output error?
Found the problem, I didn't define board perimeter (layer Edge.Cuts)

Now the macro works
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: KiCad and FreeCAD collaboration!

Post by easyw-fc »

realthunder wrote: Mon Jun 08, 2020 7:14 am fcad_pcb
Hi @realthunder
recently at kicad.info forum has started a discussion about net tie footprints.

I'm also adapting my StepUp WB to handle NetTies footprints for the generation of cutom RF fp.

I found then two small issues in your fcad_pcb tools:
1) missing feature: Net Tie as tracks issue 42
2) tracks error with footprint 'gr_poly width' != 0 issue 43

would you mind to have a look at those?

thanks
Maurice
Post Reply