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/
|
|
|
|
*/
|
|
|
|
|
2011-01-21 02:45:59 -06:00
|
|
|
use <bitmap.scad>
|
2010-03-24 12:56:10 -05:00
|
|
|
|
2013-08-03 03:15:16 -05:00
|
|
|
/*
|
|
|
|
chars = chars array
|
|
|
|
block_size = letter size (block size 1 will result in 8mm per letter)
|
|
|
|
height = the Z height of each letter in mm
|
|
|
|
key_ring_hole = (boolean) Append a hole to a keyring, necklace etc. ?
|
|
|
|
*/
|
2013-08-04 13:26:30 -05:00
|
|
|
module name_tag(chars = ["R", "E", "P", "R", "A", "P"],
|
2013-08-03 03:15:16 -05:00
|
|
|
block_size = 2, height = 3, key_ring_hole = true) {
|
2013-08-04 13:26:30 -05:00
|
|
|
char_count = len(chars);
|
2013-08-03 03:15:16 -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|