Merge remote-tracking branch 'origin/pr/10'
This commit is contained in:
commit
8db030f4ca
|
@ -7,19 +7,15 @@ http://creativecommons.org/licenses/by/3.0/
|
||||||
|
|
||||||
use <bitmap.scad>
|
use <bitmap.scad>
|
||||||
|
|
||||||
// change chars array and char_count
|
/*
|
||||||
// OpenSCAD has no string or length methods :(
|
chars = chars array
|
||||||
chars = ["R", "E", "P", "R", "A", "P"];
|
block_size = letter size (block size 1 will result in 8mm per letter)
|
||||||
char_count = 6;
|
height = the Z height of each letter in mm
|
||||||
|
key_ring_hole = (boolean) Append a hole to a keyring, necklace etc. ?
|
||||||
|
*/
|
||||||
// block size 1 will result in 8mm per letter
|
module name_tag(chars = ["R", "E", "P", "R", "A", "P"],
|
||||||
block_size = 2;
|
block_size = 2, height = 3, key_ring_hole = true) {
|
||||||
// height is the Z height of each letter
|
char_count = len(chars);
|
||||||
height = 3;
|
|
||||||
// Append a hole fo a keyring, necklace etc. ?
|
|
||||||
key_ring_hole = true;
|
|
||||||
|
|
||||||
union() {
|
union() {
|
||||||
translate(v = [0,-block_size*8*char_count/2+block_size*8/2,3]) {
|
translate(v = [0,-block_size*8*char_count/2+block_size*8/2,3]) {
|
||||||
8bit_str(chars, char_count, block_size, height);
|
8bit_str(chars, char_count, block_size, height);
|
||||||
|
@ -37,3 +33,4 @@ union() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
19
bitmap/test_name_tag.scad
Normal file
19
bitmap/test_name_tag.scad
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
include <../bitmap/name_tag.scad>;
|
||||||
|
|
||||||
|
translate([0,0,0])
|
||||||
|
name_tag("name_tag");
|
||||||
|
|
||||||
|
translate([20,0,0]) // 0 + 16/2 + 16/2 + 4
|
||||||
|
name_tag("NAME_TAG");
|
||||||
|
|
||||||
|
translate([52,0,0]) // 20 + 16/2 + 40/2 + 4
|
||||||
|
name_tag("name_tag", block_size=5);
|
||||||
|
|
||||||
|
translate([96,0,0]) // 52 + 40/2 + 40/2 + 4
|
||||||
|
name_tag("NAME_TAG", block_size=5);
|
||||||
|
|
||||||
|
translate([130,0,0]) // 92 + 40/2 + 16/2 + 4
|
||||||
|
name_tag("name_tag", height=30);
|
||||||
|
|
||||||
|
translate([150,0,0]) // 130 + 16/2 + 16/2 + 4
|
||||||
|
name_tag("NAME_TAG", height=30);
|
Loading…
Reference in a new issue