clean the source a bit, add russian variant

Signed-off-by: Mirek Kratochvil <exa.exa@gmail.com>
This commit is contained in:
Stas Bushuev 2018-03-21 14:13:47 +01:00 committed by Mirek Kratochvil
parent 46e4ee7a2f
commit aaf98a3d7d
4 changed files with 369396 additions and 182363 deletions

View file

@ -4,17 +4,25 @@
//TODO: round corners? //TODO: round corners?
font = "Monospace"; //URW Bookman L looks nicely here as well font = "Consolas"; //URW Bookman L looks nicely here as well
font2 = "Droid Sans Mono"; font2 = "Droid Sans Mono";
alphabet = "en";
//inch-sized tiles look imperial. //inch-sized tiles look imperial.
tilesize=25.4; tilesize=25.4;
//you might like them a bit larger if you want to use this in nature. //you might like them a bit larger if you want to use this outdoors
//distance between tiles //distance between tiles
off=tilesize*1.05; off=tilesize*1.1;
//height 1/8" //height 1/8"
tileheight=tilesize/8; tileheight=tilesize/8;
fontheight=tileheight*0.5;
//accomodate for Ё
if (alphabet=="ru") {
fontheight=fontheight*0.9;
}
//this produces one tile //this produces one tile
module tilec(letter, x, y, c) { module tilec(letter, x, y, c) {
@ -25,7 +33,7 @@ module tilec(letter, x, y, c) {
color(c) color(c)
translate([tilesize*.4,tilesize*.4,tileheight*.51]) translate([tilesize*.4,tilesize*.4,tileheight*.51])
linear_extrude (height=tileheight/2) linear_extrude (height=tileheight/2)
text(letter, font=font, size=tilesize*.5, text(letter, font=font, size=tilesize*.45,
halign="center", valign="baseline"); halign="center", valign="baseline");
color(c) color(c)
translate([tilesize*.83, tilesize/2, tileheight*.76]) translate([tilesize*.83, tilesize/2, tileheight*.76])
@ -46,55 +54,36 @@ module tile(letter,x,y) {
tilec(letter,x,y,"darkgray"); tilec(letter,x,y,"darkgray");
} }
tile("_",0,0); module tiles(letters) {
tile("A",1,0); for(i=[0,1,2,3,4,5,6]) for (j=[0,1,2,3,4,5,6]) {
tile("B",2,0); tile(letters[i+7*j], i, j);
tile("C",3,0); }
tile("D",4,0); }
tile("E",5,0);
tile("F",6,0); if (alphabet=="en") {
tile("G",0,1); // latin variant of tiles
tile("H",1,1); tiles(
tile("I",2,1); ["_", "A", "B", "C", "D", "E", "F",
tile("J",3,1); "G", "H", "I", "J", "K", "L", "M",
tile("K",4,1); "N", "O", "P", "Q", "R", "S", "T",
tile("L",5,1); "U", "V", "W", "X", "Y", "Z", ".",
tile("M",6,1); "0", "1", "2", "3", "4", "5", "6",
tile("N",0,2); "7", "8", "9", ",", "-", "+", "*",
tile("O",1,2); "/", ":", "?", "!", "'", "(", ")"]
tile("P",2,2); );
tile("Q",3,2); } else if (alphabet=="ru") {
tile("R",4,2); // variant of tiles thanks to Stas Bushuev
tile("S",5,2); // (see https://github.com/Xitsa/ls47 for other versions)
tile("T",6,2); tiles(
tile("U",0,3); ["_", "А", "Б", "В", "Г", "Д", "Е",
tile("V",1,3); "Ё", "Ж", "З", "И", "Й", "К", "Л",
tile("W",2,3); "М", "Н", "О", "П", "Р", "С", "Т",
tile("X",3,3); "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ",
tile("Y",4,3); "Ъ", "Ы", "Ь", "Э", "Ю", "Я", "/",
tile("Z",5,3); "0", "1", "2", "3", "4", "5", "6",
tile(".",6,3); "7", "8", "9", ".", ",", "?", "!"]
tile("0",0,4); );
tile("1",1,4); }
tile("2",2,4);
tile("3",3,4);
tile("4",4,4);
tile("5",5,4);
tile("6",6,4);
tile("7",0,5);
tile("8",1,5);
tile("9",2,5);
tile(",",3,5);
tile("-",4,5);
tile("+",5,5);
tile("*",6,5);
tile("/",0,6);
tile(":",1,6);
tile("?",2,6);
tile("!",3,6);
tile("'",4,6);
tile("(",5,6);
tile(")",6,6);
//the token //the token
translate([-off/2,off/2,0]) { translate([-off/2,off/2,0]) {
@ -104,3 +93,5 @@ translate([-off/2,off/2,0]) {
cylinder(h=tileheight*1.2, d=tilesize*.7-tileheight); cylinder(h=tileheight*1.2, d=tilesize*.7-tileheight);
} }
} }

182310
LS47.stl

File diff suppressed because it is too large Load diff

182366
LS47_en.stl Normal file

File diff suppressed because it is too large Load diff

186986
LS47_ru.stl Normal file

File diff suppressed because it is too large Load diff