← Back to team overview

kicad-developers team mailing list archive

kicad PCB arrayer tool for multiple instances of schematic sub-sheets


Hi All,

Since I added multiple sub-sheet instancing to eeschema, we have been
able to easily duplicate schematic information. However, pcbnew does
not know about this duplication. To remedy this situation, and to
thereby save layout effort in the case of duplicated sheets, I've made
a tool for arraying segments of a board file associated with
sub-sheets in a schematic hierarchy.

The tool reads the meta-information (AR or alternate reference / sheet
timestamp path) added to the .brd file + the netlist paths embedded in
the $EQUIPOT fields to figure out the sheet timestamp & what is on a
each sheet. Then the orientation & position of the modules from a
template sheet - which should be already layed out in pcbnew - are
used to arrange the modules associated with the un-layed-out modules.
The netnumbers from the modules associated with the template sheet are
used to select tracks that are then duplicated & arrayed. The net
numbers of these new tracks are then updated to correspond to the
un-layed-out modules that they connect to.

Basically, this means that if you have a multi-channel design, you
only need to lay out one of the channels, and this tool, called
'kicadocaml' (very general since I don't know what other features may
be added to it) will do the rest. Then you can save your board, and
continue working on it in pcbnew.

I decided not to add it to the Kicad trunk, since it is written in
Ocaml, not C++ -- I've had enough of that language! -- and hence
depends on many things that kicad does not (and does not depend on
things that kicad does). For example, the gui uses Tk and OpenGL, and
is pretty snappy on my rather-cheap graphics card and average-speed
computer. Tk is pretty ugly compared to wxWidgets, but hey
functionality above facade ... Anyway, hopefully the decision to keep
it separate is a good one. It is, IMHO, must quicker to add features
using Ocaml than C++ (and Ocaml compiles to code about as fast); that
said, if people would like to contribute (please!), we should try to
only add features that pcbnew does not already have.

The project webpage is at: http://sourceforge.net/projects/kicadocaml/
svn co https://kicadocaml.svn.sourceforge.net/svnroot/kicadocaml kicadocaml
you need to install at least these packages to build it (unless you
want a binary, which maybe i can do) :

ocaml ocaml-interp ocaml-base libpcre-ocaml-dev liblablgl-ocaml-dev
libextlib-ocaml-dev tk8.4-dev

Have not tried building it on windows yet. Actually, I've only built
it on Debian.
I hope others may find this useful. I've had a good time learning
Ocaml and coding it up :)


Follow ups