mirror of
https://github.com/ervanalb/keygen.git
synced 2025-12-14 20:35:25 +00:00
add kwikset, and fix a bug in keygen.scad bitting cutter
This commit is contained in:
3
Makefile
3
Makefile
@@ -10,7 +10,8 @@ JSON_DIR = build
|
||||
|
||||
# Files to include
|
||||
SVG_SRC = $(wildcard $(SVG_DIR)/*.svg)
|
||||
SCAD_SRC = $(SCAD_DIR)/schlage_classic.scad
|
||||
SCAD_SRC = $(SCAD_DIR)/schlage_classic.scad \
|
||||
$(SCAD_DIR)/kwikset.scad \
|
||||
|
||||
# Generated polygon files
|
||||
POLY_OBJ = $(patsubst $(SVG_DIR)/%.svg,$(POLY_DIR)/%.gen.scad,$(SVG_SRC))
|
||||
|
||||
88
resources/kwikset.svg
Normal file
88
resources/kwikset.svg
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
viewBox="0 0 210 297"
|
||||
version="1.1"
|
||||
id="svg19312"
|
||||
sodipodi:docname="kwikset.svg"
|
||||
inkscape:version="0.92.1 r">
|
||||
<defs
|
||||
id="defs19306" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="302.81964"
|
||||
inkscape:cy="843.89558"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3200"
|
||||
inkscape:window-height="1767"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata19309">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
style="fill:#ff0000;stroke:#000000;stroke-width:0.33333325;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 169.20508,222.11328 -4.80078,0.64063 -4.79883,1.91992 -4.16016,3.19922 -2.88086,3.84179 -12.80078,21.75977 -1.91992,4.79883 -0.63867,4.80078 0.63867,5.11914 1.91992,4.48047 12.80078,21.75976 2.88086,4.16016 4.16016,2.88086 4.79883,2.24023 4.80078,0.63868 h 29.75976 l 5.43946,-0.95899 5.43945,-2.24023 4.16016,-3.83985 3.20117,-4.80078 1.91992,-2.8789 2.87891,-1.91993 3.52148,-0.64062 h 1.91992 l 0.95899,-0.32031 0.64062,-1.2793 v -6.08008 h 96.63867 l 7.36133,-7.36133 1.2793,-1.91992 0.64062,-2.55859 -0.64062,-2.24024 -1.2793,-1.91992 -14.32031,-16.16051 -88.7207,3.6e-4 v -6.56055 l -0.63868,-0.95899 -0.96093,-0.64062 h -2.87891 l -3.52148,-0.64063 -2.87891,-1.91992 -1.91992,-2.56055 -3.20117,-4.79882 -4.16016,-3.83985 -5.43945,-2.56054 -5.43946,-0.64063 z m 1.2793,9.59961 h 10.88085 l 0.95899,0.32031 0.32031,1.28125 v 21.43946 l -0.32031,1.27929 -1.2793,0.32032 -1.12109,-0.47852 -18.08008,-18.40039 -0.63867,-0.96094 0.63867,-0.95898 2.56055,-2.24024 2.88086,-1.28125 z m -15.03907,15.04102 1.2793,0.64062 14.7207,14.71875 0.63867,0.96094 -0.63867,1.2793 -14.7207,14.7207 -1.2793,0.32031 -0.96093,-0.64062 -5.75977,-9.59961 -1.2793,-3.83985 v -4.16015 l 1.2793,-3.83985 5.75977,-9.60156 z m 25.59961,23.04101 1.2793,0.63867 0.32031,0.96094 v 21.75977 l -0.32031,0.95898 -0.95899,0.64063 h -10.88085 l -3.19922,-0.64063 -2.88086,-1.2793 -2.56055,-1.91992 -0.63867,-1.27929 0.63867,-0.96094 18.08008,-18.08008 z"
|
||||
transform="scale(0.26458333)"
|
||||
id="outline"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
|
||||
inkscape:label="#path606" />
|
||||
<path
|
||||
id="warding_kw1"
|
||||
style="fill:#0000ff;stroke:#000000;stroke-width:0.08572952;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 94.75378,71.04445 v 2.87867 l 2.000002,1.5e-5 V 73.24582 l -0.960006,-0.0847 v -1.439315 h 0.960006 v -1.778 l -0.56,-0.761985 V 65.414 h -1.280005 v 3.93715 h 0.480001 l 0.399998,0.59267 v 0.762 h -0.559995 l -0.480001,0.33867"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccccccc"
|
||||
inkscape:label="#path508" />
|
||||
<path
|
||||
id="engrave"
|
||||
style="opacity:0.36500005;fill:#00ff00;stroke:#000000;stroke-width:0.08819442;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 60.093818,63.755907 -0.76245,0.007 -0.93133,-0.254 -0.84667,-0.59266 -0.508,-0.84667 -0.762,-1.10067 -1.10067,-0.93132 -1.18533,-0.59267 -1.35467,-0.16933 h -7.873995 l -1.185333,0.16933 -1.100667,0.42333 -1.016,0.762 -0.677333,0.93134 -3.301998,5.75733 -0.508,1.10066 -0.169333,1.18534 0.169333,1.18533 0.465667,1.10067 3.344331,5.75733 0.677333,1.016 1.016,0.67733 1.100667,0.508 1.185333,0.16933 h 7.873995 l 1.35467,-0.254 1.18533,-0.508 1.10067,-0.93133 0.762,-1.18533 0.508,-0.762 0.67733,-0.59267 0.93134,-0.254 h 0.93178 z"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccccccccccccccccccccccccccc"
|
||||
inkscape:label="#path594" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="87.397141"
|
||||
y="60.266018"
|
||||
id="text24090"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan24088"
|
||||
x="87.397141"
|
||||
y="60.266018"
|
||||
style="stroke-width:0.26458332px">KW1</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.3 KiB |
@@ -141,7 +141,7 @@ module key_bitting_cutter(flat, angle, tool_height) {
|
||||
polygon([[-0.5 * flat, 0],
|
||||
[0.5 * flat, 0],
|
||||
[0.5 * flat + tan(0.5 * angle) * tool_height, tool_height],
|
||||
[0.5 * flat - tan(0.5 * angle) * tool_height, tool_height]]);
|
||||
[-0.5 * flat - tan(0.5 * angle) * tool_height, tool_height]]);
|
||||
}
|
||||
|
||||
module key_bitting(heights,
|
||||
|
||||
60
scad/kwikset.scad
Normal file
60
scad/kwikset.scad
Normal file
@@ -0,0 +1,60 @@
|
||||
use <keygen.scad>
|
||||
include <kwikset.gen.scad>
|
||||
|
||||
module kwikset(bitting="",
|
||||
outline_name="KW1",
|
||||
warding_name="KW1") {
|
||||
|
||||
name = "Kwikset";
|
||||
|
||||
/*
|
||||
Bitting is specified from bow to tip, 1-7, with 1 being the shallowest cut and 7 being the deepest.
|
||||
Example: 25363
|
||||
*/
|
||||
|
||||
outlines_k = ["KW1"];
|
||||
outlines_v = [[outline_points, outline_paths,
|
||||
[-outline_points[34][0], -outline_points[26][1]],
|
||||
engrave_points,
|
||||
engrave_paths]];
|
||||
wardings_k = ["KW1"];
|
||||
wardings_v = [warding_kw1_points];
|
||||
|
||||
outline_param = key_lkup(outlines_k, outlines_v, outline_name);
|
||||
outline_points = outline_param[0];
|
||||
outline_paths = outline_param[1];
|
||||
offset = outline_param[2];
|
||||
engrave_points = outline_param[3];
|
||||
engrave_paths = outline_param[4];
|
||||
|
||||
warding_points = key_lkup(wardings_k, wardings_v, warding_name);
|
||||
|
||||
cut_locations = [for(i=[.247, .397, .547, .697, .847]) i*25.4];
|
||||
// Kwikset starts with 1??
|
||||
depth_table = [for(i=[0.329+0.023:-0.023:0.190]) i*25.4];
|
||||
|
||||
heights = key_code_to_heights(bitting, depth_table);
|
||||
|
||||
difference() {
|
||||
if($children == 0) {
|
||||
key_blank(outline_points,
|
||||
warding_points,
|
||||
outline_paths=outline_paths,
|
||||
engrave_right_points=engrave_points,
|
||||
engrave_right_paths=engrave_paths,
|
||||
engrave_left_points=engrave_points,
|
||||
engrave_left_paths=engrave_paths,
|
||||
offset=offset,
|
||||
plug_diameter=12.7);
|
||||
} else {
|
||||
children(0);
|
||||
}
|
||||
key_bitting(heights, cut_locations, 2.1336, 90);
|
||||
}
|
||||
}
|
||||
|
||||
// Defaults
|
||||
bitting="";
|
||||
outline="KW1";
|
||||
warding="KW1";
|
||||
kwikset(bitting, outline, warding);
|
||||
Reference in New Issue
Block a user