Via Hack-A-Day: Eagle Boards with Customized Shapes


h-a-d custom board shapesThis article was found on Hack-A-Day and is repoisted here because it's a useful technique.

Using an OpenSCAD shape as the board outline in EAGLE

Bryan Duxbury


I’ve been working on a Charlieplexed LED analog clock. The finished product will be an artfully routed PCB in a clear acrylic enclosure. Since the PCB will be the centerpiece, I want it to be pretty cool looking, including an interesting outline. The design I’m going for pictured below. It’s the union of four different rotations of the convex hull of a central circle and a smaller outer circle. Simple, right?


While EAGLE is a pretty capable CAD package, it stops short of making it easy to lay out complex shapes like this one. On the other hand, OpenSCAD is designed with exactly this use case in mind. (Check out how easy it was to make the shape above.) So we just have to find a way to get from OpenSCAD into EAGLE. Should be simple!

OpenSCAD supports exporting 2D shapes to the DXF format. Some initial Googling made it seem like EAGLE could import DXFs, but after some clicking I found myself on a plugin page that was in German and had a link to a .EXE file. (I’m on a Mac.) Not exactly what I’m looking for.

Lacking an out of the box solution, I did what any self-respecting hacker would do, and wrote a script. DXF files are text, which is helpful, though they are in an impressively goofy format. A little searching got me to the format specification, which explained how to read the sets of points that formed line segments. With the points in hand, I had my script output a set of EAGLE WIRE commands. After switching into the “dimension” layer, I pasted the WIRE commands into the command bar. Voila, I’ve got my outline!


While it works, this script is pretty hacky. It makes a bunch of assumptions about the structure of the file that might not hold in DXFs generated by programs other than OpenSCAD. But given the amount of time invested, I’m pretty comfortable with the results!

Bryan Duxbury's Blog

Posted: 1 year 5 months ago by DakLak #17734
DakLak's Avatar
Eagle seems to be written to exasperate people ... with great success. (I also use several other software packages including Cadence).

The CMD: DRAW is pretty poor compared to a free UPL CIRCULAR LAYOUT (Google it) - also search for "Circular Layout ULP for Eagle" by Darrell Tan. Do a Google for "TicTocTrac" and see an excellent example of circular application.

As you will find out from the article even AdaFruit did some hand-jobs in their PCBs!

Highly recommended!

Forum Activity

Member Access