standard logo    Personal Education


Keyring Fob

First things first, a "fob" is the thing hanging next to your key on a keyring. Some are decorative like this one, and some are fancy like the ones which can lock and unlock your car.

This project was my first "real" one. I decided that I needed some cool thing to give to my family members to commemorate my good luck in winning the Lulzbot Mini from They had run a contest at the beginning of December. I won, and a new hobby for my retirement was born.

I'd been experimenting with OpenSCAD between the time I was notified of my good fortune and the day the printer arrived. I am a raw beginner with 3D printing, but was fortunate to have done BASIC programming back in the 1980s and some Python in recent times. OpenSCAD is an integrated development environment (IDE) to the extent that it has a text editor, but it also has a preview window and a compiler to generate the kind of instructions which a 3D printer needs. It's a very powerful free software tool. I like that. I am a strong advocate of software freedom which is sometimes also called "open source". Whichever term you use, the software is powerful, useful stuff!

I began by making more than a flat, sharp-cornered slab for the base of the fob. I'd gotten far enough with OpenSCAD to know about cutting a hole through a shape, and I'd learned about surrounding a group of shapes with hull() in order to get a fancier shape. I laid down four small cylinders for the corners and put the hull command around them.

blank fob

fudge = 0.1;

// key fob base
{ translate([35,0,0])
// keyring hole

Initially, I'd assumed I would create the text and outline in Inkscape, but it turned out later in my study of OpenSCAD that I could do the text directly, even choosing fonts and sizes. There is a built-in font called Liberation Sans to which OpenSCAD will default if you do not specify any other font. The font will also default to a 10 point size. Note that the text command must also use linear_extrude() with a height specified which is tall enough to stand out from the slab. I've done 4mm here to have 2mm stand above the fob. Text is a 2D, flat command in OpenSCAD. Without extrusion, the text would sit invisibly inside the fob.


As you can see, from the illustration to the right, the lettering normally sits on the x axis, beginning at the origin point. But a small modification to the text command solves the problem. Using halign and valign with "center" for their value makes using "translate" unnecessary for positioning.

text("ANN", halign="center", valign="center");

Even when we change the font and the size, the positioning stays automated. You can choose any font on your system. Mainframe BB is not typically part of a Linux, Windows or Mac install. It is a font from the site of Nate Piekos who is also a superb professional letterer for comics and graphic novels. He has produced dozens of fonts like Mainframe BB which are free for personal use, in addition to many pay fonts.

text("ANN", font="Mainframe BB", size=12, halign="center", valign="center");

Available Files:

keyfob.scad - use, study, modify, reshare as you wish
keyfob-ann.stl - If your name is Ann or you just want to print for a friend of that name, use this file on your 3D printer.
GPL3 License