So, I go by many names. [Hayashi] is only the 2nd name in a list of 33 names we’ve exposed somewhere, not counting variants. So with this, we need a name badge that supports changing names (and looks cool).

So here’s how to make a (somewhat impractical (but cool!)) changeable name badge.

Design

There were some requirements.

  • Changeable name and pronouns fields
  • Badge must display contents without electronics
  • Kerning support (both negative as in “Ta” and positive as in “gj”)
  • Attached with magnets, not a safety pin
  • Transparent backing, so it doesn’t interfere with the color theme of my shirt

With this in mind, I made a draft (sorry, got carried away again):

Lingering extrusion sacrifice
Initial plans for the badge. I got carried away, thinking I wasn't going to document this at first. Blue labels are explained later.

I went with a frame with 2 linear slides, and pieces for each letter that can slide into the slides.

  • A: Side view of a linear slide. Chamfers for reducing corner stress.
  • B: Front view of a linear slide.
  • C: Side & front views of a magnet chamber, to be attached to a frame edge piece.
  • D: Side view of a letter board. Profile complements the linear slide.
  • E: Front view of a letter board.
  • F: Front view of a letter board that needs kerning. The letter sticks out from the board.
  • G: Front view of a whitespace board. Needed to handle kerning.
  • H: Side & front views of a frame edge piece magnet chamber.
  • I: Top view of a letter board. Perhaps there will be a little fillet between the letter and the board.
  • J: The interface between a linear slide magnet chamber and a frame edge piece magnet chamber.
  • K: Side view of the whole frame middle, both linear slides (new design) included. A back magnet is planned.
  • L: Side view of a letter board (new design). Big fillets.

I planned to make everything out of acrylic.

Letter Board

First I needed to model a letter board and CAM it. The model was made in FreeCAD, then it was brought over to Fusion for CAM. The CAM process involved double-sided milling, which has a section in my advanced machine usage post. For the indent at the top of the letter, I used an engraving bit to get some opacity on there. I milled this with 3mm clear cast acrylic.

Letter board A design
Design for a letter board. Ignore the squiggly edge on the right; that's not relevant now and will be explained later.
M milled with clear acrylic
Letter board M milled on clear acrylic. The indent was engraved.

Alas, the engraving wasn’t as opaque as I wanted it to be. So I did a little deviation and tried with black acrylic to see if it’s just a problem with clear acrylic.

M milled with black acrylic
Letter board M milled on black acrylic.

The engraving is still suboptimal, and now the backing is opaque on top of that. Back to clear acrylic.

Intercession

That happened in the very middle of last semester. Then HTMAA basically took over my life for the rest of the semester. Then EDS was closed over winter break (of course). But I was finally able to continue.

During the winter break, though, I thought about…

Kerning

The cap height of the font I used (and previously made!) is 720pt, which is 8mm in the letter board design. Now let’s look at the kern table for my font. All values are in pt.

ft vwy x cdegoq a mnprz s u
beop 0 -7 -13 0 0 0 0 0
ahmn 0 -7 0 0 0 0 0 0
ctz 0 0 0 -13 -13 0 0 0
fr 0 0 0 -13 -39 0 -13 0
kx 0 0 0 -13 -13 0 0 0
vwy 0 0 0 -7 -7 0 -7 0
A 0 -66 0 -7 -7 0 0 -7
CLZ -26 -40 0 -27 -27 0 0 -27
E 0 -27 0 -13 -13 0 0 -13
I 0 -7 0 -13 -13 0 0 -13
JU 0 0 0 0 -7 0 0 0
KX 0 -40 0 -26 -26 0 0 -26
P 0 0 0 -40 -40 0 -40 0
R 0 0 0 -7 -7 0 0 0
S 0 -13 -7 0 0 0 -7 0
T -80 -71 -71 -71 -71 -71 -71 -71
VW -27 -27 -27 -53 -53 -27 -53 -27
Y -67 -67 -67 -93 -93 -67 -93 -67
First kerning table
j
gjq 107
Second kerning table

To figure out the kerning between two characters, look for the first character on the left side and the second character on the top side. The resulting entry is the kerning. If it’s negative, the characters are brought closer together (which is what usually happens). If a character cannot be found on the respective side, there is no kerning between those two characters.

But anyway, 90pt = 1mm. A lof these values are such small sizes that I’d rather not make spacers for them. (Consider the lowercase ‘v’, which only kerns either 0pt or -7pt when it’s on the left side. That’s about 0.078mm. No way that’s happening with a spacer. The tape I use to attach stuff to the mill is much thicker, at 0.24mm. Nope, nope, nope!)

So I needed a different solution: jag the edges of the left and right sides of the letter boards. If you jag them just right, then when you bring 2 boards together, they fit together with the right kerning! Here’s an example involving the letters ‘a’ and ‘f’:

First, let’s review the kern table.

f a
a 0 0
f 0 -39
First kerning table, with just 'a' and 'f'. Only the pair 'fa' kerns.

Now let’s build some tiles. They need their edges jagged in such a way that ‘f’ and ‘a’ kerns by -39 but no other combination kerns.

'a' and 'f' board sketches with jagged edges
'a' and 'f' boards sketched with jagged edges, along with combinations. Only in the case of 'fa' is the total width not the sum of the widths of the component boards. It is in fact, that sum plus -39, exactly as intended.

Remember, though, that these pieces are going to be slided into a linear slide. Rotation is scary. It would be nice to have a connection between each pair of letters both above and below the centerline.

'a' and 'f' board sketches with more jagged edges
'a' and 'f' boards sketched with more jagged edges, along with combinations. No matter the combination, there are support points on both sides (above and below) of the centerline.

This is a simple example of how jagging edges to support kerning works. But, considering just the first kerning table, we have 18×8 kerning entries, not just 2×2 entries, making the jagging more complicated. And let’s be clear: the height of a letter board is ~17mm, with the indent holding the letter being 13mm tall. The outlines will be milled with a 1/32” end mill, which can only go into crevices that are 0.8mm wide or wider. So there’s only space for 10 data slots in the jagging pattern (assuming the double-support trick). The naïve (TODO: ï) way to do this is to have 18×8 data slots per edge, but that’s very much not going to work. So I thought about this (surely 18 on one side and 8 on the other should be enough, but good luck getting each of the 18 to interact with each of the 8), and then remembered that the key to optimizing this is realizing why we kern in the first place. To remove ugly extra space between letters whose side outlines kind of match. So we can have a certain number of data slots, each corresponding to some y-position, and figure out the correct values of those points for each letter. Hopefully, in the end, we can match the kerning table exactly with just a few data slots.

(By the way, I’m ignoring the second kerning table. That kerning of 107 punishes every letter that’s not a ‘g’, ‘j’, or ‘q’, and it’s better to just have a spacer in case the ‘gj’, ‘jj’, or ‘qj’ come up instead of indenting nearly every letter at the bottom.)

The 8 data slots
The 8 data slots used and the vertical positions they're inspired by. On the left and right are the actual values for the slots for 'T's right side and 'a's left side. Note how they roughly fit the shape of the letters.
Real 'a' left side jag
The actual left-side kerning used by 'a'. Note the repeated data slots to guard against rotation.

I decided to go with 8 data slots: 7 for important vertical positions and 1 for surroundings. Now the problem is figuring out the values of those data slots for each side of each letter. Let \(k_i(λ, s)\) be the value of data slot \(k_i\) for letter \(λ\) and side \(s\in\{\leftarrow, \rightarrow\}\). Let \(K(λ_a, λ_b)\) be the kerning from letter \(λ_a\) to letter \(λ_b\). Then

\[K(λ_a, λ_b) = \max_{i\in\{0..7\}} \big(k_i(λ_a, \rightarrow) + k_i(λ_b, \leftarrow)\big)\]

This models the fact that pieces only come as close to each other as their shapes will allow.

So, time to manually enter values for \(k_i(λ, s)\) and match the intended kernings as much as posssible. Oh, before that, it’s important to remember that the kerning between two characters, at least one which doesn’t appear in a kerning table, is 0. That means1

\[\forall λ\ \forall s\in\{\leftarrow, \rightarrow\}\ \exists i\in\{0..7\}\ k_i(λ, s) = 0\]

Each side of each letter’s piece must have a kerning slot with a value of 0. In the example shown above, that’s \(k_1\) for \((\)T\(, \rightarrow)\) and \(k_5\) for \((\)a\(, \leftarrow)\). (TODO: Mathjax custom font). I forgot to ensure this when building the kerning slot table, but got lucky anyway. (Or maybe I remembered and I forgot that I remembered.)

So, I actually manually wrote some values into a spreadsheet and had a checker to check if resulting kernings matched. Then I built a system to make these entries as close to 0 as possible (remember, there’s only negative kerning) while still respecting the intended kerning. Along the way, I fudged some intended kerning values to make it easier to match them. I also realized that my font didn’t have kerning for the left side of ‘s’ or ‘u’, so I had to fix that (you know, in case a name like [Tsukuri] came along). The Google sheets is here, and a copy of the spreadsheet is here2.

It’s called an End Mill, not a Corner Mill 2: Smoothing the Kerning Jag

Now that we have values for all the slots, it’s time to smooth the curve, since the letter boards will be manufactured with a regular ol’ 3-axis CNC mill and cylinder-shaped end mills. Specifically, a 1/32” flat end mill. I decided to use arcs for this. The arc diameter must be greater than 1/32” (because otherwise the mill won’t fit) and less than 13/15 mm (because that’s the height of a kerning data slot), so I chose 0.8mm. The logic was pretty simple: use 2 arcs to replace each horizontal line. The only time this doesn’t work is with ‘Tt’ or ‘Tf’, where the gap between \(k_0\) and \(k_1\) is 80pt (8/9 mm), which is too long to just replace with 2 (acute) arcs, so a piece of the horizontal line must be kept there.

Smoothing a jagged line
Smoothing the jagged lines generated by kerning. The yellow line is the smoothed result.
Smooth right side of T
The smoothed right side of the 'T' kerning curve. Apparently I forgot to do the actual 'Tt'/'Tf' conpensation.

Modelling

Winter break’s over, so now it’s time to continue modelling the models that will be milled. I applied the kern curve to the already modelled letter board. We decided that the letters themselves will be 3D printed (inspired by our final project) so the engraving indent was removed, and some hole joints were added.

Some of the letters’ outlines (which are 0.2mm) go past the width of their letter boards (defined by the advance width of the letter), so they had to get chopped to width to avoid running to adjacent letters. This was most egregious with ‘k’. (Techinally, the box the letters were chopped to was a little to the right of the letter board box, and the chopping only happened from the baseline to the x-height.)

'k' with right side chopped
The letter board for 'k'. Notice that the right side of the outline was chopped a bit.

I also needed to model the frame and its endpieces. Because I didn’t have a special tool for milling sideways slots, I needed to split the frame into a front and back side and set up hole joints to join them together.

  1. Technically not necessarily true, as there could be positive kerning. However, the only positive kerning is in the 2nd kerning table, which we’re ignoring for this. 

  2. The copy exists so there can be a copy in the repository for archival purposes, just in case. Neil likes it that way.