I’ve been making some personalized stuff for people here at home using tbuser’s awesome bitmap module for OpenSCAD (an open source 3D modeling software) to write names and random words on the things I print out. (I’ll put them all together in one post someday) And yesterday it came to mind how cool it would be to be able to write in Japanese as well, so I dove into the code to see what could be done.
For those unfamiliar with Japanese, the language uses 3 alphabets: one has the famous ideograms which came from Chinese, the kanji, and there are about 2000 official characters in Japanese; the other two are the phonetic hiragana and katakana, with about 40 characters each, hiragana being used to write some words and grammatical structures in Japanese while katakana is used for words of foreign origin. I’m not crazy enough to write code for 2000 kanjis, in fact, I doubt they can all be written in the 8×8 grid which tbuser used in his bitmap. So I decided to try writing all the katakana, because with of all the foreign words and names, onomatopoeia, etc, I thought it would be more useful for people owning 3D printers around the world. It can also be used to write Japanese words to give them emphasis, and katakana should be easier to write in bits than hiragana, because it isn’t so curvy.
I didn’t want to copy from an existing font, so I wrote all the characters by myself one by one, with 1s and 0s. Maybe there’s an easier way to do it, but I don’t know it and I have some free time, so yeah, I didn’t mind spending a couple of hours on this. Actually I didn’t take nearly as long as I thought I would and finished the whole thing in one night. Apparently, the bits which form the letters cannot be connected only by their diagonals (even though I was able to render files like this, go figure), so I avoided it in all letters, which made some of them a bit messy. For example, I didn’t like much the タ (ta) and ヌ (nu), but I was kinda proud of the rest of them. If you understand Japanese, some feedback would be cool so I can improve some characters 🙂 Here they are:How to use it
You can download the module for free from http://www.thingiverse.com/thing:10195 . You save it in the same folder as your OpenSCAD project and include <bitmap_katakana.scad>. You just gotta insert the following lines into your project:
include <bitmap_katakana.scad>
block_size = 2;
height = 2;
chars = [“ra”,”bu”];
char_count = 2;
8bit_str(chars, char_count, block_size, height);
The block size is the size of each bit forming the letter, in mm. Remember each letter has 8×8 of them 😉 The height is the thickness of the letters in the perpendicular direction and the char_count is the total number of characters you’re writing. The line with 8bit_str is your object, you can rotate, translate and do anything you want with it in the middle of your design.
Now, the chars… OpenSCAD doesn’t seem to support Japanese characters, so I made the input as romaji (Roman alphabet – this one right now). Katakana is syllabic, so most “chars” will have 2 letters. Here’s a table of the char you can write to get each katakana:
char | katakana | char | katakana | char | katakana | char | katakana | char | katakana |
a | ア | i | イ | u | ウ | e | エ | o | オ |
ka ca |
カ | ki | キ | ku cu |
ク | ke | ケ | ko co |
コ |
sa | サ |
si |
シ | su | ス | se ce |
セ | so | ソ |
ta | タ | chi ch ti |
チ | tsu tu |
ツ | te | テ | to | ト |
na | ナ | ni | ニ | nu | ヌ | ne | ネ | no | ノ |
ha | ハ | hi | ヒ | hu fu |
フ | he | ヘ | ho | ホ |
ma | マ | mi | ミ | mu | ム | me | メ | mo | モ |
ya | ヤ | yu | ユ | yo | ヨ | ||||
ra | ラ | ri | リ | ru | ル | re | レ | ro | ロ |
wa | ワ | wo | ヲ | ||||||
ga | ガ | gi | ギ | gu | グ | ge | ゲ | go | ゴ |
za | ザ | ji zi |
ジ | zu | ズ | ze | ゼ | zo | ゾ |
da | ダ | di | ヂ | du | ヅ | de | デ | do | ド |
ba | バ | bi | ビ | bu | ブ | be | ベ | bo | ボ |
pa | パ | pi | ピ | pu | プ | pe | ペ | po | ポ |
lya | ャ (little ya) |
lyu | ュ (little yu) |
lyo | ョ (little yo) |
||||
la | ァ (little a) |
li |
ィ (little i) |
lu | ゥ (little u) |
le | ェ (little e) |
lo | ォ (little o) |
n | ン | – _ |
ー |
ltsu |
ッ (little tsu) |
v | ヴ | dot | ・ |
Certain syllables require 2 katakanas, like cha, nya, ja… So fto write rya (リャ) for example, you use ri + little ya: “ri”,”lya”. If you write “rya” it won’t come up, so be careful! Also notice that you can choose how to write some characters, shi (シ) can be “si”, “ci”, “shi” or “sh” (the options are mostly based on the way you’d type katakana on a keyboard).
Oh, and I’ve kept the capital letters and other symbols from tbuser’s original bitmap.scad, I’ve only deleted the small letters because they overlap some romaji I’m using, so if you want to mix some alphabet in, use caps.
And finally, I’ve also made a file for writing vertically, since it’s very common in Japanese. Actually I use it in English as well, but Japanese requires more than just swapping x and y coordinates. In vertical katakana, the nobasu line which makes syllables long is vertical, and the position of the tiny ya, yo, yu, etc. are a bit higher, so I made these changes as well.
Take a look at some of the stuff I’ve printed so far. I’m experimenting with different sizes, directions and characters, and so far so good… Well, of course, very tiny stuff don’t come out well. I painted the white ABS with nail polish ihihi
So here are some examples of things you can write. I might be able to help you write other stuff, just leave a comment here 🙂
Japanese | reading | meaning | code | comment |
オタク | otaku | geek, nerd | “o”, “ta”, “ku” | |
ヤッター | yatta | I did it! | “ya”, “ltsu”, “ta”, “-“ | |
スシ | sushi | sushi… | “su”,”shi” | Sushi is also commonly written in kanji (寿司) or hiragana (すし) |
サムライ | samurai | Japanese warrior | “sa”, “mu”, “ra”, “i” | Samurai is also found in kanji (侍) |
メーカーボット | meekaabotto | Makerbot (the 3D printer I use) | “me”,”-“, “ka”, “-“, “bo”, “ltsu”, “to” | I found only a few references to Makerbot in Japanese, and they were spelled like this. It makes sense due to the spelling of maker and bot 😉 |
チャプ | chapu | my nickname, short from chapulina =P | “ch”, “lya”, “pu” | I know this is not interesting for anyone else, but it’s just in case you wonder what is written in some of my pics hehe |
オープンソース | oopunsoosu | open source | “o”, “-“, “pu”, “n”, “so”, “-“, “su” | |
シェア | shea | share | “sh”, “le”, “a” |