Make keygen more make-friendly

This commit is contained in:
Eric Van Albert
2017-06-17 16:08:42 -04:00
parent 096f831b1a
commit 76c0a80fd7
12 changed files with 40 additions and 85 deletions

34
Makefile Normal file
View File

@@ -0,0 +1,34 @@
# Makefile for keygen
# Executables
SCAD = OPENSCADPATH=src:build openscad
POLY = PYTHONPATH=/usr/share/inkscape/extensions bin/paths2openscad.py
SCAD_DIR = src
SVG_DIR = resources
POLY_DIR = build
STL_DIR = build
# Files to include
SVG_SRC = $(wildcard $(SVG_DIR)/*.svg)
SCAD_SRC = $(wildcard $(SCAD_DIR)/*.scad)
# Generated polygon files
POLY_OBJ = $(patsubst $(SVG_DIR)/%.svg,$(POLY_DIR)/%.gen.scad,$(SVG_SRC))
# Generated STL
STL_OBJ =
OBJECTS = $(POLYGON_OBJ) $(STL_OBJ)
# Assembler, compiler, and linker flags
POLYFLAGS =
SCADFLAGS =
# Targets
all: $(STL_OBJ)
poly: $(POLY_OBJ)
clean:
-rm -f $(OBJECTS)
$(POLY_DIR)/%.gen.scad: $(SVG_DIR)/%.svg
$(POLY) $(POLYFLAGS) --fname $@ $<

2
build/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -1,18 +0,0 @@
// Automatically generated using the Inkscape to OpenSCAD Converter
// Variable names are of the form <inkscape-path-id>_points and
// <inkscape-path-id>_paths. As a result, you can associate a polygon in this
// OpenSCAD program with the corresponding SVG element in the Inkscape document
// by looking for the XML element with the attribute id="inkscape-path-id".
warding_points = [[37.765387, 4.245608], [37.632502, 2.251501], [37.593172, 1.168714], [37.599510, 0.794794], [37.630507, 0.604488], [38.043981, 0.121178], [38.683677, -0.531872], [38.683677, -1.397452], [38.020135, -2.176881], [37.772078, -2.508262], [37.675987, -2.704872], [37.697425, -3.017870], [37.722717, -3.141794], [37.764387, -3.220602], [37.995563, -3.312207], [38.175207, -3.353412], [38.299237, -4.260332], [36.702437, -4.260332], [36.702437, -2.916742], [37.422512, -2.015049], [37.693177, -1.633853], [37.827947, -1.379372], [37.884006, -1.090405], [37.890691, -0.808635], [37.850229, -0.535763], [37.764847, -0.273492], [37.629756, -0.043769], [37.378390, 0.312923], [36.702387, 1.203418], [36.702387, 4.245608]];
warding_paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]];
outline_points = [[-26.772734, 12.666803], [-27.736668, 12.642298], [-28.674473, 12.565120], [-29.562000, 12.434385], [-30.375102, 12.249212], [-31.089630, 12.008719], [-31.681438, 11.712023], [-31.923775, 11.542324], [-32.126376, 11.358243], [-32.286223, 11.159670], [-32.400298, 10.946496], [-32.638730, 10.154615], [-32.924895, 8.949666], [-33.411091, 6.589655], [-33.498555, 6.206573], [-33.604244, 5.892542], [-33.728679, 5.638731], [-33.872382, 5.436311], [-34.035873, 5.276450], [-34.219674, 5.150317], [-34.650290, 4.963915], [-35.105382, 4.822846], [-35.535376, 4.651464], [-35.939846, 4.451709], [-36.318365, 4.225522], [-36.670508, 3.974841], [-36.995849, 3.701607], [-37.293960, 3.407759], [-37.564415, 3.095238], [-37.806789, 2.765983], [-38.020655, 2.421934], [-38.205586, 2.065032], [-38.361157, 1.697215], [-38.486940, 1.320424], [-38.582510, 0.936599], [-38.647441, 0.547680], [-38.681305, 0.155606], [-38.683677, -0.237682], [-38.654131, -0.630245], [-38.592239, -1.020144], [-38.497577, -1.405437], [-38.369716, -1.784185], [-38.208232, -2.154448], [-38.012698, -2.514287], [-37.782687, -2.861761], [-37.517774, -3.194931], [-37.217531, -3.511856], [-36.881533, -3.810598], [-36.509353, -4.089215], [-36.100565, -4.345768], [-35.654743, -4.578318], [-35.171460, -4.784924], [-34.650290, -4.963646], [-34.219674, -5.150129], [-34.035873, -5.276344], [-33.872382, -5.436300], [-33.728679, -5.638815], [-33.604244, -5.892708], [-33.498555, -6.206798], [-33.411091, -6.589902], [-32.924895, -8.949913], [-32.638730, -10.154862], [-32.400298, -10.946743], [-32.286225, -11.159915], [-32.126382, -11.358480], [-31.923788, -11.542550], [-31.681460, -11.712235], [-31.089675, -12.008895], [-30.375169, -12.249346], [-29.562086, -12.434475], [-28.674568, -12.565170], [-27.736760, -12.642317], [-26.772804, -12.666803], [-25.806844, -12.639516], [-24.863022, -12.561342], [-23.965481, -12.433169], [-23.138366, -12.255882], [-22.405818, -12.030370], [-21.791982, -11.757519], [-21.537125, -11.603619], [-21.321000, -11.438216], [-21.146624, -11.261423], [-21.017015, -11.073349], [-20.882041, -10.718538], [-20.735422, -10.158724], [-20.438716, -8.683267], [-20.189831, -7.165329], [-20.051699, -6.123264], [-19.990868, -5.801322], [-19.871630, -5.476294], [-19.696203, -5.162365], [-19.466806, -4.873718], [-19.185657, -4.624537], [-18.854976, -4.429008], [-18.476980, -4.301313], [-18.053888, -4.255637], [16.359516, -4.260346], [16.514950, -4.244327], [16.669034, -4.198666], [16.949267, -4.033042], [17.152440, -3.792727], [17.210200, -3.653701], [17.230781, -3.506972], [17.230781, -1.017711], [17.978022, -1.017711], [18.145261, -0.991218], [18.278469, -0.919522], [18.381264, -0.814300], [18.457261, -0.687229], [18.543323, -0.414247], [18.565582, -0.193989], [18.565582, 1.025573], [15.453111, 4.121698], [-17.959321, 4.121698], [-18.234982, 4.138658], [-18.521285, 4.197719], [-18.810891, 4.311154], [-19.096465, 4.491233], [-19.370669, 4.750231], [-19.626167, 5.100419], [-19.855623, 5.554069], [-20.051699, 6.123454], [-20.214830, 6.794268], [-20.354220, 7.520568], [-20.585026, 8.998869], [-20.790627, 10.276855], [-20.898509, 10.752760], [-21.017531, 11.073022], [-21.147134, 11.261099], [-21.321494, 11.437902], [-21.537595, 11.603317], [-21.792419, 11.757234], [-22.406173, 12.030127], [-23.138623, 12.255686], [-23.965636, 12.433019], [-24.863081, 12.561232], [-25.806825, 12.639431], [-26.772734, 12.666724], [-33.632264, 2.756298], [-33.075296, 2.700140], [-32.556535, 2.539099], [-32.087093, 2.284290], [-31.678083, 1.946823], [-31.340617, 1.537813], [-31.085807, 1.068371], [-30.924767, 0.549610], [-30.868609, -0.007357], [-30.924767, -0.564325], [-31.085807, -1.083087], [-31.340616, -1.552529], [-31.678082, -1.961540], [-32.087092, -2.299007], [-32.556534, -2.553816], [-33.075296, -2.714857], [-33.632264, -2.771015], [-34.189232, -2.714857], [-34.707993, -2.553816], [-35.177436, -2.299007], [-35.586447, -1.961540], [-35.923913, -1.552529], [-36.178723, -1.083087], [-36.339763, -0.564325], [-36.395921, -0.007357], [-36.339763, 0.549611], [-36.178723, 1.068372], [-35.923913, 1.537814], [-35.586447, 1.946824], [-35.177436, 2.284291], [-34.707993, 2.539100], [-34.189232, 2.700140], [-33.632264, 2.756298]];
outline_paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137], [170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138]];
engrave_points = [[-26.774285, 11.587801], [-27.679908, 11.563925], [-28.554027, 11.490936], [-29.366389, 11.371552], [-30.086744, 11.208494], [-30.664846, 11.002980], [-31.073763, 10.788463], [-31.318221, 10.616013], [-31.402943, 10.536701], [-31.578980, 9.913920], [-31.871649, 8.714590], [-32.350172, 6.392252], [-32.459987, 5.914089], [-32.608397, 5.478407], [-32.803522, 5.085590], [-33.053488, 4.736021], [-33.351599, 4.446061], [-33.672702, 4.224386], [-33.997227, 4.059832], [-34.305610, 3.941237], [-34.371756, 3.921605], [-34.747122, 3.805635], [-35.099717, 3.666020], [-35.736303, 3.322111], [-36.280927, 2.902405], [-36.733002, 2.419427], [-37.091945, 1.885701], [-37.357168, 1.313755], [-37.528087, 0.716112], [-37.604115, 0.105300], [-37.587774, -0.506578], [-37.476335, -1.108770], [-37.261332, -1.690798], [-37.112350, -1.970975], [-36.934302, -2.242181], [-36.726131, -2.503106], [-36.486779, -2.752439], [-36.215188, -2.988872], [-35.910300, -3.211093], [-35.571057, -3.417793], [-35.196400, -3.607661], [-34.785271, -3.779389], [-34.336614, -3.931665], [-34.305610, -3.942010], [-33.997225, -4.060605], [-33.672699, -4.225158], [-33.351597, -4.446832], [-33.053488, -4.736792], [-32.803524, -5.086367], [-32.608398, -5.479184], [-32.459988, -5.914862], [-32.350172, -6.393023], [-31.871649, -8.715361], [-31.578922, -9.916039], [-31.402943, -10.539539], [-31.318451, -10.618965], [-31.074648, -10.791430], [-30.666460, -11.005898], [-30.088813, -11.211334], [-29.368287, -11.374234], [-28.555271, -11.493394], [-27.680394, -11.566220], [-26.774285, -11.590122], [-25.865423, -11.563783], [-24.981562, -11.490079], [-24.152254, -11.372216], [-23.407049, -11.213401], [-22.810511, -11.016339], [-22.365711, -10.805646], [-21.974579, -10.563311], [-21.785960, -9.914773], [-21.500705, -8.494704], [-21.256258, -6.995169], [-21.125534, -6.017852], [-21.032617, -5.510627], [-20.855179, -5.022735], [-20.594199, -4.561759], [-20.250652, -4.135281], [-20.441483, -3.673034], [-20.603809, -3.190040], [-20.737308, -2.690014], [-20.841655, -2.176673], [-20.916524, -1.653731], [-20.961593, -1.124906], [-20.976536, -0.593914], [-20.961029, -0.064470], [-20.914748, 0.459710], [-20.837368, 0.974909], [-20.728565, 1.477411], [-20.588014, 1.963501], [-20.415391, 2.429462], [-20.210372, 2.871578], [-19.972633, 3.286133], [-19.701848, 3.669412], [-19.929605, 3.843071], [-20.143167, 4.045145], [-20.525135, 4.532916], [-20.842595, 5.129470], [-21.090395, 5.831555], [-21.271327, 6.570479], [-21.419386, 7.337682], [-21.653150, 8.839640], [-21.850037, 10.071606], [-21.976646, 10.560982], [-22.367530, 10.803477], [-22.811481, 11.013757], [-23.407049, 11.210553], [-24.152012, 11.369419], [-24.981419, 11.487320], [-25.865451, 11.561019], [-26.774285, 11.587274], [-33.657537, 3.627563], [-33.304037, 3.610072], [-32.956524, 3.558225], [-32.617344, 3.472993], [-32.288841, 3.355347], [-31.973362, 3.206259], [-31.673251, 3.026700], [-31.390854, 2.817642], [-31.128517, 2.580056], [-30.890931, 2.317719], [-30.681873, 2.035322], [-30.502314, 1.735211], [-30.353226, 1.419732], [-30.235580, 1.091229], [-30.150348, 0.752049], [-30.098501, 0.404536], [-30.081010, 0.051036], [-30.099514, -0.314609], [-30.153743, -0.669689], [-30.241901, -1.012406], [-30.362189, -1.340964], [-30.512811, -1.653564], [-30.691968, -1.948410], [-30.897863, -2.223705], [-31.128699, -2.477650], [-31.382678, -2.708449], [-31.658002, -2.914305], [-31.952874, -3.093420], [-32.265496, -3.243996], [-32.594071, -3.364237], [-32.936801, -3.452345], [-33.291889, -3.506523], [-33.657537, -3.524974], [-34.023145, -3.506474], [-34.378192, -3.452255], [-34.720879, -3.364113], [-35.049411, -3.243847], [-35.361990, -3.093252], [-35.656818, -2.914126], [-35.932101, -2.708265], [-36.186039, -2.477467], [-36.416837, -2.223528], [-36.622697, -1.948246], [-36.801823, -1.653417], [-36.952418, -1.340838], [-37.072684, -1.012306], [-37.160826, -0.669619], [-37.215045, -0.314572], [-37.233544, 0.051036], [-37.215094, 0.416684], [-37.160916, 0.771771], [-37.072807, 1.114501], [-36.952567, 1.443076], [-36.801990, 1.755698], [-36.622876, 2.050570], [-36.417020, 2.325894], [-36.186221, 2.579873], [-35.932276, 2.810709], [-35.656982, 3.016604], [-35.362136, 3.195761], [-35.049536, 3.346383], [-34.720978, 3.466671], [-34.378261, 3.554829], [-34.023182, 3.609059], [-33.657537, 3.627563], [-33.657537, 3.627563], [-21.976646, 10.560990], [-21.963734, 10.552206], [-21.976646, 10.560990], [-21.974529, -10.563303], [-21.961617, -10.555048], [-21.974529, -10.563303]];
engrave_paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110], [176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111], [177, 178, 179], [180, 181, 182]];
//polygon(points=warding_points, paths=warding_paths);
//polygon(points=outline_points, paths=outline_paths);
//polygon(points=engrave_points, paths=engrave_paths);

View File

Before

Width:  |  Height:  |  Size: 634 KiB

After

Width:  |  Height:  |  Size: 634 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because one or more lines are too long

View File

@@ -68,4 +68,7 @@ module schlage_classic(bitting="",
}
}
schlage_classic("25467");
bitting="";
outline="5pin";
warding="c";
schlage_classic(bitting, outline, warding);