Eagle to OpenSCAD

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Eagle to OpenSCAD

Steve Kelly
I figured I could share the Eagle ULP I wrote for to generate OpenSCAD files here...
We are using this to generate boards to receive pogo pins. There is some functionality to generate calls to board components, however I have not written a library for this. 


OpenSCAD mailing list
[hidden email]
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view

Re: Eagle to OpenSCAD

Well, this is a surprising coincidence. I have spent yesterday writing a exporter from eagle to openscad.

The code is based on the code from eagleup ( http://eagleup.wordpress.com/ ). In my case, i'm not really interested in rendering the board or the parts as eagleup / sketchup does this just fine. What i want to do is to generate enclosures or restrictions for enclosures in openscad.

So eagle parts would be mapped to openscad modules (one file per module) via an attribute of the component. The module file can describe different restrictions or inclusions :
* a hole in the case for connectors, leds, buttons and whatever, generated by <partname>_exclude.
* a part of the case for standoffs, extra support behind connectors and even lettering and logo's described in <partname>_casepart.

Wall and board thickness and text and partname are available to the module as parameters so i can for instance generate click-on board standoffs that take the board thickness into account. I used the Buspirate from dangerous prototypes as an example below.

OpenSCAD generated case and eaglup generated board in sketchup

OpenSCAD generated case

I have included the openscad files for the case EagleOSCAD.zip and the .skp of the board BusPirate-v3.6a-SSOP.skp.zip

The case in the example is acually closed, i cut the top off to see what is going on.

I'm still trying to figure some stuff out :
* Eagle describes board outlines as a string of lines, circular arcs and circles. Boards can have inner cutouts. There is no easy way to go from the description in eagle to what's needed in openscad. I'm kindof hoping the svg importer for openscad from Felipe and the svg exporter for eagle will be of help there.
* generate the case in two parts : the bottom and the lid.
* the generated openscad script uses other openscad files, one per relevant part. EagleOpenSCAD and openscad have no way of knowing where these files actually are. I put everything in one directory for now, both generated and modules.
* putting stuff on the surface of an object like lettering.

Then there are some things that would be usefull later on..
* Collision detection. If a part describes a keep-out or exclusion, you'd really like to know if it touches something other than the case.
* Being able to give openscad include directories in the UI or via environment variables.