Skip to content

Instantly share code, notes, and snippets.

@rpanachi
Forked from tbuser/char.scad
Created December 17, 2018 01:06
Show Gist options
  • Save rpanachi/e1977361b06f31df92322be514ac7951 to your computer and use it in GitHub Desktop.
Save rpanachi/e1977361b06f31df92322be514ac7951 to your computer and use it in GitHub Desktop.
latest version now at: http://github.com/tbuser/openscad-bitmap
module make_atari_bitmap(char, block_size, height, include_base) {
if (char == "0") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "1") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "2") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "3") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "4") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,1,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,1,1,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "5") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,0,0,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "6") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "7") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,0,0,0,0,
0,0,1,1,0,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "8") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "9") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,1,1,0,0,
0,0,1,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "A") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "B") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "C") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "D") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,0,0,0,
0,1,1,0,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,0,0,
0,1,1,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "E") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "F") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "G") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,1,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "H") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "I") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "J") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,1,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "K") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,0,0,
0,1,1,1,1,0,0,0,
0,1,1,1,1,0,0,0,
0,1,1,0,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "L") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "M") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,1,1,
0,1,1,1,0,1,1,1,
0,1,1,1,1,1,1,1,
0,1,1,0,1,0,1,1,
0,1,1,0,0,0,1,1,
0,1,1,0,0,0,1,1,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "N") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,1,0,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,0,1,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "O") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "P") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "Q") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,0,1,1,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "R") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,1,1,0,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "S") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "T") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "U") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "V") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "W") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,1,1,
0,1,1,0,0,0,1,1,
0,1,1,0,1,0,1,1,
0,1,1,1,1,1,1,1,
0,1,1,1,0,1,1,1,
0,1,1,0,0,0,1,1,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "X") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "Y") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "Z") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "a") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "b") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "c") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "d") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "e") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "f") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "g") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,1,1,0,
0,1,1,1,1,1,0,0
], block_size, height, 8);
} else if (char == "h") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "i") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "j") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0,
0,0,1,1,1,1,0,0
], block_size, height, 8);
} else if (char == "k") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,1,1,0,0,
0,1,1,1,1,0,0,0,
0,1,1,0,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "l") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "m") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,1,1,
0,1,1,1,1,1,1,1,
0,1,1,0,1,0,1,1,
0,1,1,0,0,0,1,1,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "n") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "o") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "p") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0
], block_size, height, 8);
} else if (char == "q") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,1,1,0
], block_size, height, 8);
} else if (char == "r") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,1,1,0,0,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "s") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,1,0,
0,1,1,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,1,1,0,
0,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "t") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "u") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "v") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "w") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,0,1,1,
0,1,1,0,1,0,1,1,
0,1,1,1,1,1,1,1,
0,0,1,1,1,1,1,0,
0,0,1,1,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "x") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "y") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,1,1,0,0,1,1,0,
0,0,1,1,1,1,1,0,
0,0,0,0,1,1,0,0,
0,1,1,1,1,0,0,0
], block_size, height, 8);
} else if (char == "z") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,0,0,0,0,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else if (char == "+") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,1,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0
], block_size, height, 8);
} else {
echo("Invalid Character: ", char);
}
}
module make_bitmap(bitmap, block_size, height, row_size) {
width = block_size * row_size;
bitmap_size = row_size * row_size;
function loc_x(loc) = floor(loc / row_size) * block_size;
function loc_y(loc) = loc % row_size * block_size;
translate(v = [-width/2+block_size/2,-width/2+block_size/2,height/2]) {
for (loc = [0:bitmap_size - 1]) {
if (bitmap[loc] == 1) {
union() {
translate(v = [loc_x(loc), loc_y(loc), 0]) {
cube(size = [block_size, block_size, height], center = true);
}
}
}
}
}
}
module make_atari_bitmap_str(chars, char_count, block_size, height) {
union() {
for (count = [0:char_count-1]) {
translate(v = [0, count * block_size * 8, 0]) {
make_atari_bitmap(chars[count], block_size, height);
}
}
}
}
/*
<bitmap.scad>
block_size = 5;
height = 10;
union() {
translate(v = [0,0,5]) {
make_atari_bitmap("A", block_size, height);
//make_bitmap([
// 1,1,1,1,1,1,1,1,
// 1,0,0,1,1,0,0,1,
// 1,0,1,1,1,1,0,1,
// 1,1,1,0,0,1,1,1,
// 1,1,1,0,0,1,1,1,
// 1,0,1,1,1,1,0,1,
// 1,0,0,1,1,0,0,1,
// 1,1,1,1,1,1,1,1
//], block_size, height, 8);
//make_bitmap([
// 1,1,1,1,
// 1,0,0,1,
// 1,0,0,1,
// 1,1,1,1
//], block_size, height, 4);
}
translate(v = [0,0,5/2]) {
color([0,0,1,1]) {
cube(size = [block_size * 8, block_size * 8, 5], center = true);
}
}
}
<bitmap.scad>
chars = ["T","O","N","Y","","B","U","S","E","R"];
char_count = 10;
block_size = 5;
height = 10;
union() {
translate(v = [0,-block_size*8*char_count/2+block_size*8/2,5]) {
make_atari_bitmap_str(chars, char_count, block_size, height);
}
translate(v = [0,0,5/2]) {
color([0,0,1,1]) {
cube(size = [block_size * 8, block_size * 8 * char_count, 5], center = true);
}
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment