Exporting pcb tracks to mechanical cad for FEM


#1

I’ve not been able to find much information on exporting the track information in cad format. I am aware of some software for converting gerbers to DXF, but was wondering if any work was being done to natively export the tracks as CAD.

The reason that i’m interested in doing this is that I want to investigate the possibility of using the open source ELMER finite element software [https://www.csc.fi/web/elmer] to model run simulations of pulse shape through different tracks.


#2

I am not sure there is a direct way to get a dxf.


A side note:
We might be lucky in some distant future. There is a guy who wants to implement such a solver into kicad: https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg26747.html


#3

Thanks, that is pretty much what i had in mind for generating the analysis mesh. I’ll have a read of that thread.


#4

Has anybody tried pcb->svg and then either svg->openscad->stl and stl->step via FreeCAD or svg->step directly in FreeCAD?


#5

The most direct way is to import PCB and track in FreeCAD.
There is already some work done. And in FreeCAD you can mesh and analyze the model.
FreeCAD has also a FEM environment and Elmer as Solver.


#6

The excellent StepUP script (hats off to maui for his pioneering work!) for FreeCAD directly reads kicad_pcb files and imports the assorted 3D step models into FreeCAD and also can push board edges and other items directly from FreeCAD to the kicad_pcb file. It can also directly import a KiCAD footprint into FreeCAD and very easily align the VRML and STEP 3D models to it. The StepUP script essentially “marries” KiCAD to FreeCAD. BUT, does the StepUP script export the copper layers into FreeCAD? If yes, how?


#7

StepUp doesn’t export tracks (copper layers) into FreeCAD… StepUp is aimed to mechanical integration, so tracks are just dropped for better performance.
The file size and loading time of the board would increase a lot adding those items, that are not useful for mechanical designing…

But there is a way to import tracks as solid in FreeCAD
The linked tool was developed for PCB CAD/CAM but can be used for FEM, thermal analysis and Meshing tracks
https://forum.freecadweb.org/viewtopic.php?f=24&t=20892#p165954

I tested the tool and it worked fine… in some case (i.e. complex pads or fill zones) you may find a stop, but this could be an occasion to fine tune it :smiley:


#8

Awesome stuff about the finite element analysis, but I can’t find any step-by-step documentation on how to do it.


#9

there is very little documentation ATM
https://forum.freecadweb.org/viewtopic.php?f=24&t=20892&start=10#p166347

anyway that is how the project example KiCad board can be loaded in FreeCAD:

For those interested in FEM of kicad_pcb there is already a good start! :smiley:


#10

Hi Maui,

I’m having problems with fcad_pcb installation

  1. git clone [SOLVED] How do I override +3.3V with local label?
  2. cd fcad_pcb/
  3. ~/.FreeCAD/fcad_pcb$ git submodule update --init --recursive
    Submodule ‘kicad_parser’ (git@github.com:realthunder/kicad_parser.git) registered for path ‘kicad_parser’
    Clonar en «kicad_parser»…
    Permission denied (publickey).
    fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of ‘git@github.com:realthunder/kicad_parser.git’ into submodule path ‘kicad_parser’ failed

— Did I miss any step?

Thanks.


#11

You can fork all these repos an try to do the process with your repos…
An other approach is to clone all the 3 repos and build the directories structure by hands…
Then you should be able to test it…

Sorry not to be more specific… I have no access to pc ATM :wink:


#12

no issue on my side:

~\Documents\GitHub> cd fcp
~\Documents\GitHub\fcp> git clone https://github.com/realthunder/fcad_pcb.git
Cloning into ‘fcad_pcb’…
remote: Counting objects: 51, done.
remote: Total 51 (delta 0), reused 0 (delta 0), pack-reused 51
Unpacking objects: 100% (51/51), done.
~\Documents\GitHub\fcp> cd fcad_pcb
~\Documents\GitHub\fcp\fcad_pcb [master ≡]> git submodule update --init --recursive
Submodule ‘kicad_parser’ (git@github.com:realthunder/kicad_parser.git) registered for path ‘kicad_parser’
Cloning into ‘C:/Users/userC/Documents/GitHub/fcp/fcad_pcb/kicad_parser’…
Warning: Permanently added ‘github.com,192.30.253.113’ (RSA) to the list of known hosts.
Submodule path ‘kicad_parser’: checked out ‘a3335a75e1d57bd7148181a0706f7c778ca9fe08’
Submodule ‘sexp_parser’ (git@github.com:realthunder/sexp_parser.git) registered for path ‘kicad_parser/sexp_parser’
Cloning into ‘C:/Users/userC/Documents/GitHub/fcp/fcad_pcb/kicad_parser/sexp_parser’…
Warning: Permanently added ‘github.com,192.30.253.113’ (RSA) to the list of known hosts.
Submodule path ‘kicad_parser/sexp_parser’: checked out ‘9c7ee7d6910f9e7c0ec6869f7acf4e9126ec4559’
~\Documents\GitHub\fcp\fcad_pcb [master ≡]>

EDIT:
I have also updated the readme.md


#13

Thanks @maui
I had to generate my ssh key. git submodule update --init --recursive worked fine.

Now I have another issue
Python 2.7.6 (default, Oct 26 2016, 20:33:43)
[GCC 4.8.4] on linux2
Type ‘help’, ‘copyright’, ‘credits’ or ‘license’ for more information.

form fcad_pcb import kicad
File “”, line 1
form fcad_pcb import kicad
^
SyntaxError: invalid syntax


#14

‘form’ is ‘from’ :slight_smile: and some chars


#15

Thanks again, @maui

I did copy/paste from the Readme.md