get schlage key and keyways from ilco manual

This commit is contained in:
Eric Van Albert
2017-06-16 23:15:47 -04:00
parent b283f09115
commit 89c25d38e0
5 changed files with 490 additions and 24 deletions

View File

@@ -135,7 +135,7 @@ module key_blank(outline_points,
}
}
function key_code_to_heights(code, depth_table) = [for(i=[0:len(code)-1]) depth_table[search(code[i], "0123456789")[0]]];
function key_code_to_heights(code, depth_table) = [for(i=key_enum(code)) depth_table[search(code[i], "0123456789")[0]]];
module key_bitting_cutter(flat, angle, tool_height) {
polygon([[-0.5 * flat, 0],
@@ -155,7 +155,7 @@ module key_bitting(heights,
// Union together a handful of trapezoids
// that comprise the cuts
union() {
for(i=[0:len(heights)-1]) {
for(i=key_enum(heights)) {
// Move to the proper location and height
translate([locations[i], heights[i]])
linear_extrude(height=cutter_width, center=true)
@@ -163,3 +163,7 @@ module key_bitting(heights,
}
}
}
function key_lkup(ks, vs, k) = vs[search([k], [for(ki=ks) [ki]])[0]];
function key_enum(l) = len(l) > 0 ? [for(i=[0:len(l)-1]) i] : [];