2010-03-24 12:56:10 -05:00
|
|
|
/*
|
|
|
|
Parametric Name Tag
|
|
|
|
Tony Buser <tbuser@gmail.com>
|
|
|
|
http://tonybuser.com
|
|
|
|
http://creativecommons.org/licenses/by/3.0/
|
|
|
|
*/
|
|
|
|
|
|
|
|
<bitmap.scad>
|
|
|
|
|
|
|
|
// change chars array and char_count
|
|
|
|
// OpenSCAD has no string or length methods :(
|
2010-12-21 10:12:08 -06:00
|
|
|
chars = ["R", "E", "P", "R", "A", "P"];
|
|
|
|
char_count = 6;
|
|
|
|
|
2010-03-24 12:56:10 -05:00
|
|
|
|
|
|
|
// block size 1 will result in 8mm per letter
|
2010-12-21 10:12:08 -06:00
|
|
|
block_size = 2;
|
2010-03-24 12:56:10 -05:00
|
|
|
// height is the Z height of each letter
|
|
|
|
height = 3;
|
2010-12-21 10:12:08 -06:00
|
|
|
// Append a hole fo a keyring, necklace etc. ?
|
|
|
|
key_ring_hole = true;
|
2010-03-24 12:56:10 -05:00
|
|
|
|
|
|
|
union() {
|
|
|
|
translate(v = [0,-block_size*8*char_count/2+block_size*8/2,3]) {
|
|
|
|
8bit_str(chars, char_count, block_size, height);
|
|
|
|
}
|
|
|
|
translate(v = [0,0,3/2]) {
|
|
|
|
color([0,0,1,1]) {
|
|
|
|
cube(size = [block_size * 8, block_size * 8 * char_count, 3], center = true);
|
|
|
|
}
|
|
|
|
}
|
2010-12-21 10:12:08 -06:00
|
|
|
if (key_ring_hole == true){
|
|
|
|
translate([0, block_size * 8 * (char_count+1)/2, 3/2])
|
|
|
|
difference(){
|
|
|
|
cube(size = [block_size * 8, block_size * 8 , 3], center = true);
|
|
|
|
cube(size = [block_size * 4, block_size * 4 , 5], center = true);
|
|
|
|
}
|
|
|
|
}
|
2010-03-24 12:56:10 -05:00
|
|
|
}
|