KiCad and FreeCAD collaboration!

Show off your FreeCAD projects here!
User avatar
PrzemoF
Posts: 3008
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: KiCad and FreeCAD collaboration!

Postby PrzemoF » Tue Aug 01, 2017 9:23 am

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: 5
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Postby solidTrace » Wed Jun 03, 2020 2:43 pm

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
Posts: 1591
Joined: Tue Jan 03, 2017 10:55 am

Re: KiCad and FreeCAD collaboration!

Postby realthunder » Wed Jun 03, 2020 9:31 pm

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 (latest version 0.11) along 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: 5
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Postby solidTrace » Thu Jun 04, 2020 7:39 am

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: 5
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Postby solidTrace » Sun Jun 07, 2020 7:18 pm

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
Posts: 4355
Joined: Thu Oct 18, 2018 9:18 pm

Re: KiCad and FreeCAD collaboration!

Postby vocx » 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.

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.
To support the documentation effort, and code development, your donation is appreciated: paypal.
realthunder
Posts: 1591
Joined: Tue Jan 03, 2017 10:55 am

Re: KiCad and FreeCAD collaboration!

Postby realthunder » Mon Jun 08, 2020 7:14 am

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 (latest version 0.11) along 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: 5
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Postby solidTrace » Mon Jun 08, 2020 12:19 pm

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: 5
Joined: Wed Jun 03, 2020 2:29 pm

Re: KiCad and FreeCAD collaboration!

Postby solidTrace » Tue Jun 09, 2020 11:07 am

@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