- Get some nice pictures of the side and tip of your key. I recommend a flatbed scanner. You may also consider finding a profile of your key in a PDF from the manufacturer.
- 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.
- Select a path and press
Control-Shift-O
. Give it a useful name, such as "outline" or "warding". - Save the result as a SVG in the
resources
folder. Runmake
to generate OpenSCAD polygons from your paths. - Look up online the various parameters of your key, such as plug diameter, cut depths and locations.
- Use the provided OpenSCAD functions
key_code_to_heights
,key_blank
andkey_bitting
to generate a 3D model of your key. Use the provided OpenSCAD files as a template. - To add your key to the database,
edit the
Makefile
to include your.scad
file in theSCAD_SRC
variable.
For this to work, your final file must look like this:
module key_name(...) {
name = "Human-readable name of your key";
/*
Description of your key, including
how to properly format a bitting,
possibly with examples
*/
...
}
// These defaults are overridden by
// -D on the command line
bitting = "default-bitting";
outline = "default-outline";
warding = "default-warding";
key_name(...);