Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
462c901
added windows support and some reference material
charely6 Oct 12, 2023
a3a85bb
More notes in how to model and a svg fix
charely6 Oct 12, 2023
3c665f3
modified: Makefile
Oct 13, 2023
04d6877
updated the Makefile again I think this orignially might have run on
Oct 13, 2023
19c1c9a
Added more reference material and fixed schlage.svg for generating
charely6 Dec 8, 2023
cda8855
Medeco Updates
adventuredan Dec 9, 2023
b44438c
Merge pull request #1 from adventuredan/adventuredan-updates
adventuredan Dec 9, 2023
bb9feb3
Add files via upload
adventuredan Dec 9, 2023
17ca769
Add files via upload
adventuredan Dec 9, 2023
f4fca10
Delete keygen.scad
adventuredan Dec 9, 2023
bfcc1d4
Delete medeco.scad
adventuredan Dec 9, 2023
c979f03
Delete medeco_M3.scad
adventuredan Dec 9, 2023
35d3836
Delete medeco.svg
adventuredan Dec 9, 2023
41db433
Delete medeco_biaxial.scad
adventuredan Dec 9, 2023
606d462
Delete medeco_classic.scad
adventuredan Dec 9, 2023
ebda581
Rename medeco_M3.scad.txt to medeco_M3.scad
adventuredan Dec 9, 2023
2c2548e
Add files via upload
adventuredan Dec 9, 2023
13d73ae
Delete scad/keygen.scad.txt
adventuredan Dec 9, 2023
ce4bb1f
Delete scad/medeco.scad.txt
adventuredan Dec 9, 2023
f5704df
Delete scad/medeco_biaxial.scad.txt
adventuredan Dec 9, 2023
544c887
Delete scad/medeco_classic.scad.txt
adventuredan Dec 9, 2023
f586620
Add files via upload
adventuredan Dec 9, 2023
6495c5e
Add files via upload
adventuredan Dec 9, 2023
a5a720a
Delete scad/medeco.svg
adventuredan Dec 9, 2023
4cfdc6d
added comment notes for Biax and M3
adventuredan Dec 12, 2023
c6f3be6
Merge pull request #3 from adventuredan/master
charely6 Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.stl
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Makefile for keygen

# Executables
POLY = PYTHONPATH=/usr/share/inkscape/extensions bin/paths2openscad.py
ifdef OS
POLY = python3 bin/paths2openscad.py
RM = del /Q
FixPath = $(subst /,\,$1)
else
RM = -rm -f
POLY = PYTHONPATH=/usr/share/inkscape/extensions python3 bin/paths2openscad.py
FixPath = $1
endif

SCAD_DIR = scad
SVG_DIR = resources
Expand All @@ -17,6 +25,7 @@ SCAD_SRC = $(SCAD_DIR)/schlage_classic.scad \
$(SCAD_DIR)/medeco_classic.scad \
$(SCAD_DIR)/medeco_biaxial.scad \
$(SCAD_DIR)/master.scad \
$(SCAD_DIR)/X103-KW12.scad \

# Generated polygon files
POLY_OBJ = $(patsubst $(SVG_DIR)/%.svg,$(POLY_DIR)/%.gen.scad,$(SVG_SRC))
Expand All @@ -30,10 +39,10 @@ POLYFLAGS =
all: $(JSON_DIR)/keys.json poly
poly: $(POLY_OBJ)
$(JSON_DIR)/%.json: $(SCAD_DIR)/%.scad
bin/parse.py $< $@
python3 bin/parse.py $< $@
$(POLY_DIR)/%.gen.scad: $(SVG_DIR)/%.svg
$(POLY) $(POLYFLAGS) --fname $@ $<
$(JSON_DIR)/keys.json: $(JSON_OBJ)
bin/json_merge.py $^ >$(JSON_DIR)/keys.json
python3 bin/json_merge.py $^ >$(JSON_DIR)/keys.json
clean:
-rm -f $(POLY_DIR)/*.gen.scad $(JSON_DIR)/*.json
$(RM) $(call FixPath, $(POLY_DIR)/*.gen.scad $(JSON_DIR)/*.json)
5 changes: 4 additions & 1 deletion bin/keygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
help="Key blank outline")
parser.add_argument("-w", "--warding", dest='warding',
help="Key warding")
parser.add_argument("-s", "--series_name", dest='series_name',
help="Key series_name")
parser.add_argument("-o", "--output", dest='output', default="a.stl",
help="Output file (defaults to a.stl)")

Expand All @@ -32,6 +34,7 @@ def escape(s):
opts += ["-D", 'outline="{}"'.format(escape(args.outline))]
if args.warding is not None:
opts += ["-D", 'warding="{}"'.format(escape(args.warding))]

if args.series_name is not None:
opts += ["-D", 'series_name="{}"'.format(escape(args.series_name))]
r = subprocess.call([scad, args.filename, "-o", args.output] + opts + remaining)
sys.exit(r)
8 changes: 5 additions & 3 deletions bin/paths2openscad.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ def convertPath( self, node ):

# Determine which polys contain which

contains = [ [] for i in xrange( len( path ) ) ]
contained_by = [ [] for i in xrange( len( path ) ) ]
contains = [ [] for i in range( len( path ) ) ]
contained_by = [ [] for i in range( len( path ) ) ]

for i in range( 0, len( path ) ):
for j in range( i + 1, len( path ) ):
Expand Down Expand Up @@ -876,7 +876,9 @@ def effect( self ):
self.f.write( '\n' )
for call in self.call_list:
self.f.write( call )

self.f.close()


except IOError:
inkex.errormsg( 'Unable to open the file ' + self.options.fname )

Expand Down
6 changes: 5 additions & 1 deletion doc/how_to_model_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ from the manufacturer](https://www.imlss.com/images/pdf/KBD12.pdf).
2. Using Inkscape, trace the key outline, warding, and engraving.
If you got your image from a PDF, your job is much easier,
and you only need to clean up the paths.
3. Select a path and press `Control-Shift-O`. Give it a useful name, such as "outline" or "warding".
3. Select a path and press `Control-Shift-O`. Give it a useful name, such as "outline" or "warding". (I recommend using outline, warding, and engrave)
4. Save the result as a SVG in the `resources` folder. Run `make` to generate OpenSCAD polygons from your paths.
5. Look up online the various parameters of your key, such as plug diameter,
cut depths and locations.
Many are now included by Charely6 in the referenceMaterials folder
5. Use the provided OpenSCAD functions `key_code_to_heights`,
`key_blank` and `key_bitting` to generate a 3D model of your key.
Use the provided OpenSCAD files as a template.
Note you will want to set the offset to the point at the bottom key shoulder, If you don't know which one that is I used the commented out polygons at the bottom of the gen.scad file and randomly changing values and seeing which point moves and noting which one is that spot. The points will go in one direction around the shape so you can work your way around.
Also if you want to do double sided keys look at `X103-KW12.scad` there is a comment noting it.
6. To add your key to the database,
edit the `Makefile` to include your `.scad` file in the `SCAD_SRC` variable.
To add to the Makefile be sure to set name in your module and make variables named outlines_k and wardings_k like the ones in the original `.scad` files

For this to work, your final file must look like this:

Expand Down
Binary file added referenceMaterial/029a-reference-guide.pdf
Binary file not shown.
Binary file added referenceMaterial/ASSA-Twin-Series-New-Style.pdf
Binary file not shown.
Binary file added referenceMaterial/Abus-Vitess.pdf
Binary file not shown.
Binary file added referenceMaterial/Auto depth & Space.pdf
Binary file not shown.
Binary file added referenceMaterial/B07oBBQ_d.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added referenceMaterial/Blue-Dog-Keys-Catalog.pdf
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/Corbin-Keyways.pdf
Binary file not shown.
Binary file added referenceMaterial/Corbin-Russwin-Access-3-AP.pdf
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/Corbin-Russwin-Pyramid.pdf
Binary file not shown.
Binary file added referenceMaterial/Decoding-Keys.pdf
Binary file not shown.
Binary file added referenceMaterial/FAS0ycj_d.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added referenceMaterial/Framon_key_depth_guide_v8.pdf
Binary file not shown.
Binary file added referenceMaterial/ILCO_automotive_sec_1.pdf
Binary file not shown.
Binary file added referenceMaterial/ILCO_noa_cyl_sec_2.pdf
Binary file not shown.
Binary file added referenceMaterial/ITL_spacesortver209r2.pdf
Binary file not shown.
Binary file added referenceMaterial/Kaba-Peaks-140-Family-A2.pdf
Binary file not shown.
Binary file added referenceMaterial/Kaba-Peaks-140-Family-A4.pdf
Binary file not shown.
Binary file added referenceMaterial/Kaba-Peaks-150-Family-A2.pdf
Binary file not shown.
Binary file added referenceMaterial/Kaba-Peaks-150-Family-A4.pdf
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/Medeco-Biaxial.pdf
Binary file not shown.
Binary file added referenceMaterial/Medeco-Original-75-Series.pdf
Binary file not shown.
Binary file added referenceMaterial/Medeco-Original-Full-Step.pdf
Binary file not shown.
Binary file added referenceMaterial/Medeco-Original-Half-Step.pdf
Binary file not shown.
Binary file added referenceMaterial/Medeco-X4.pdf
Binary file not shown.
Binary file added referenceMaterial/Medeco3-M3.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/SCHLAGE_KeySpecs.pdf
Binary file not shown.
Binary file added referenceMaterial/Sargent-Degree-DG1.pdf
Binary file not shown.
Binary file added referenceMaterial/Sargent-Degree-DG2-DG3.pdf
Binary file not shown.
Binary file added referenceMaterial/Sargent-Signature.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/Spacing-Block-Chart.pdf
Binary file not shown.
Binary file added referenceMaterial/Yale-KeyMark.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/dwn-motorcycle-guide-2022.pdf
Binary file not shown.
Binary file not shown.
Binary file added referenceMaterial/motorcycle_guide.pdf
Binary file not shown.
Binary file added referenceMaterial/s-l1200.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added referenceMaterial/sortedbydsdno.pdf
Binary file not shown.
Binary file added referenceMaterial/universal-manual.pdf
Binary file not shown.
Binary file added referenceMaterial/usuAEsy_d.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions resources/X103-KW12.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading