Python script to generate footprints from openscad

I wrote some openscad script to generate Dangerous Prototype sick of beige cases as dxf files for laser cutting. Looking at it further I realised it would be trivial to use this to also generate kicad footprint files. The script can be found at https://github.com/TomKeddie/python-scripts/tree/master/openscad2kicad.

It turns out to be fairly easy because, looking at the openscad source, it only generates line segments in its dxf export. Unfortunately it does not export color information so I can’t do multiple layers but I’ll work on that next.

This of course opens up the possibility of generating any crazy pcb shape you want with openscad.

Please be gentle, this is my first cut at this.

http://dangerousprototypes.com/forum/viewtopic.php?f=63&t=7201&p=61202#p61202

1 Like

It is better to have arcs for curves as much as possible (Bezier curves are sometimes found in products and those are inevitably represented as numerous straight lines). So I prefer LibreCAD (or Draftsight) for creating DXF files if I need a strange board outline. The arcs + lines are preserved when converting to an interchange format like IDF (and soon also IGES solid models) so for people who need to work with mechanical designers it is better to maintain true arcs.