diff --git a/paths2openscad.py b/paths2openscad.py index 52100b5..15e56aa 100755 --- a/paths2openscad.py +++ b/paths2openscad.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # openscad.py @@ -240,7 +240,7 @@ class OpenSCAD( inkex.Effect ): help="The active tab when Apply was pressed" ) self.OptionParser.add_option('--smoothness', dest='smoothness', - type='float', default=float( 0.2 ), action='store', + type='float', default=float( 0.02 ), action='store', help='Curve smoothing (less for more)' ) self.OptionParser.add_option('--fname', dest='fname', diff --git a/sc4_polygons.scad b/sc4.gen.scad similarity index 100% rename from sc4_polygons.scad rename to sc4.gen.scad index 1e488d7..bf1903c 100644 --- a/sc4_polygons.scad +++ b/sc4.gen.scad @@ -4,15 +4,15 @@ // OpenSCAD program with the corresponding SVG element in the Inkscape document // by looking for the XML element with the attribute id="inkscape-path-id". -emboss_points = [[-17.046637, 12.700313], [-17.046637, -12.743046], [-16.781007, -12.743046], [-16.781007, 12.700313], [-20.750369, 12.718243], [-20.750369, -12.725116], [-20.484744, -12.725116], [-20.484744, 12.718242], [-22.189041, 12.701703], [-22.189041, -12.741646], [-21.923416, -12.741646], [-21.923416, 12.701705], [-23.627712, 12.743043], [-23.627712, -12.700316], [-23.362087, -12.700316], [-23.362087, 12.743047], [-27.819705, 12.734743], [-27.819705, -12.708576], [-27.554080, -12.708576], [-27.554080, 12.734779], [-29.369184, 12.723873], [-29.369184, -12.719486], [-29.103559, -12.719486], [-29.103559, 12.723905]]; -emboss_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]]; - outline_points = [[-12.048077, -5.717807], [-12.088247, -5.881416], [-12.195456, -6.018707], [-12.349756, -6.113179], [-12.531197, -6.148337], [-16.188977, -6.238937], [-16.358242, -6.271735], [-16.558561, -6.367007], [-16.728233, -6.520066], [-16.782295, -6.616801], [-16.805557, -6.726227], [-16.830970, -6.873712], [-16.887297, -7.003340], [-17.059163, -7.206795], [-17.254102, -7.332136], [-17.405057, -7.374907], [-19.734005, -7.386507], [-19.852107, -7.407706], [-19.978884, -7.462960], [-20.190575, -7.629437], [-20.639656, -8.095852], [-21.005688, -8.358263], [-21.312745, -8.515173], [-21.584899, -8.665087], [-21.748442, -8.825258], [-21.852912, -9.026556], [-21.914786, -9.256604], [-21.950541, -9.503027], [-22.009604, -9.995495], [-22.065866, -10.216789], [-22.161920, -10.404957], [-22.284901, -10.538816], [-22.410320, -10.616126], [-22.664611, -10.665268], [-22.917078, -10.680729], [-23.040218, -10.715938], [-23.160009, -10.790857], [-23.261967, -10.932990], [-23.343531, -11.141588], [-23.513154, -11.652872], [-23.635053, -11.902903], [-23.804236, -12.114093], [-24.037623, -12.260113], [-24.183681, -12.300457], [-24.352135, -12.314637], [-26.715326, -12.314637], [-27.062806, -12.267809], [-27.185912, -12.213166], [-27.280510, -12.141164], [-27.399922, -11.955464], [-27.452528, -11.731468], [-27.483260, -11.251625], [-27.524357, -11.037299], [-27.624588, -10.867717], [-27.759582, -10.761486], [-27.901957, -10.694943], [-28.199008, -10.628007], [-28.496059, -10.561070], [-28.638434, -10.494527], [-28.773427, -10.388297], [-28.923218, -10.180245], [-28.993477, -9.956389], [-29.010715, -9.721997], [-29.001442, -9.482337], [-28.992169, -9.242676], [-29.009407, -9.008284], [-29.079665, -8.784428], [-29.229456, -8.576377], [-29.365388, -8.469483], [-29.496659, -8.414771], [-29.751429, -8.392302], [-30.006199, -8.369787], [-30.137469, -8.315019], [-30.273401, -8.208047], [-30.416720, -8.000376], [-30.490156, -7.755972], [-30.514440, -7.487233], [-30.510304, -7.206558], [-30.499698, -6.658990], [-30.534692, -6.416895], [-30.624192, -6.212457], [-30.731620, -6.095522], [-30.863549, -6.010702], [-31.166270, -5.908069], [-31.463071, -5.845895], [-31.684671, -5.765517], [-35.921242, -3.300826], [-36.244445, -3.051116], [-36.420288, -2.790954], [-36.493206, -2.517078], [-36.507637, -2.226226], [-36.507626, 2.325254], [-36.493194, 2.616105], [-36.420275, 2.889981], [-36.244433, 3.150143], [-35.921231, 3.399854], [-31.684660, 5.864544], [-31.463060, 5.944925], [-31.166259, 6.007104], [-30.863538, 6.109737], [-30.731609, 6.194555], [-30.624181, 6.311484], [-30.534681, 6.515922], [-30.499687, 6.758017], [-30.510293, 7.305585], [-30.514429, 7.586260], [-30.490145, 7.854999], [-30.416709, 8.099403], [-30.273390, 8.307074], [-30.137458, 8.414036], [-30.006188, 8.468780], [-29.751418, 8.491239], [-29.496648, 8.513697], [-29.365377, 8.568441], [-29.229445, 8.675404], [-29.079654, 8.883455], [-29.009395, 9.107311], [-28.992158, 9.341703], [-29.001431, 9.581364], [-29.010703, 9.821024], [-28.993466, 10.055416], [-28.923207, 10.279272], [-28.773416, 10.487324], [-28.638423, 10.593554], [-28.496048, 10.660097], [-28.198997, 10.727034], [-27.901946, 10.793970], [-27.759571, 10.860513], [-27.624577, 10.966744], [-27.524346, 11.136326], [-27.483249, 11.350652], [-27.452517, 11.830495], [-27.399911, 12.054491], [-27.280499, 12.240191], [-27.185901, 12.312193], [-27.062795, 12.366836], [-26.715315, 12.413664], [-24.352124, 12.413664], [-24.183670, 12.399484], [-24.037612, 12.359140], [-23.804225, 12.213120], [-23.635042, 12.001930], [-23.513143, 11.751899], [-23.343520, 11.240615], [-23.261956, 11.032017], [-23.159998, 10.889884], [-23.040207, 10.814964], [-22.917067, 10.779753], [-22.664600, 10.764287], [-22.410309, 10.715144], [-22.284890, 10.637837], [-22.161909, 10.503984], [-22.065856, 10.315816], [-22.009593, 10.094522], [-21.950531, 9.602053], [-21.914777, 9.355631], [-21.852903, 9.125583], [-21.748433, 8.924285], [-21.584888, 8.764114], [-21.312734, 8.614200], [-21.005677, 8.457290], [-20.639645, 8.194879], [-20.190564, 7.728464], [-19.978874, 7.561987], [-19.852097, 7.506733], [-19.733994, 7.485534], [-17.405047, 7.473934], [-17.254092, 7.431163], [-17.059153, 7.305822], [-16.887287, 7.102367], [-16.830960, 6.972739], [-16.805547, 6.825254], [-16.782288, 6.715828], [-16.728227, 6.619093], [-16.558555, 6.466033], [-16.358233, 6.370762], [-16.188967, 6.337964], [-12.531187, 6.247364], [-12.349746, 6.212206], [-12.195446, 6.117733], [-12.088237, 5.980443], [-12.048067, 5.816834], [-12.026867, 4.535244], [13.592243, 4.535644], [18.673063, -0.565658], [18.673063, -1.863596], [16.250473, -4.181356], [-12.047637, -4.177356], [-28.090168, -3.642437], [-28.098526, -3.881257], [-28.136605, -4.035677], [-28.209060, -4.143618], [-28.320547, -4.243007], [-28.526194, -4.324325], [-28.829918, -4.349512], [-29.159551, -4.313671], [-29.442927, -4.211907], [-33.529647, -1.914227], [-33.793045, -1.743630], [-33.987570, -1.566928], [-34.108067, -1.373863], [-34.149378, -1.154179], [-34.149367, 1.253165], [-34.108056, 1.472850], [-33.987559, 1.665915], [-33.793034, 1.842617], [-33.529636, 2.013213], [-29.442916, 4.310893], [-29.159540, 4.412663], [-28.829907, 4.448506], [-28.526183, 4.423318], [-28.320536, 4.341993], [-28.209053, 4.242605], [-28.136602, 4.134663], [-28.098524, 3.980244], [-28.090157, 3.741423]]; 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, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187], [215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188]]; +emboss_points = [[-17.046637, 12.700313], [-17.046637, -12.743046], [-16.781007, -12.743046], [-16.781007, 12.700313], [-20.750369, 12.718243], [-20.750369, -12.725116], [-20.484744, -12.725116], [-20.484744, 12.718242], [-22.189041, 12.701703], [-22.189041, -12.741646], [-21.923416, -12.741646], [-21.923416, 12.701705], [-23.627712, 12.743043], [-23.627712, -12.700316], [-23.362087, -12.700316], [-23.362087, 12.743047], [-27.819705, 12.734743], [-27.819705, -12.708576], [-27.554080, -12.708576], [-27.554080, 12.734779], [-29.369184, 12.723873], [-29.369184, -12.719486], [-29.103559, -12.719486], [-29.103559, 12.723905]]; +emboss_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]]; + warding_points = [[34.597676, 4.535861], [34.597676, 0.151633], [35.469973, -0.230774], [35.667138, -0.352517], [35.751594, -0.489447], [35.732447, -0.660339], [35.618801, -0.883964], [34.597676, -2.570165], [34.597676, -4.181437], [36.507637, -4.181437], [36.507637, -3.346346], [35.935063, -3.064708], [35.779957, -2.936419], [35.700383, -2.775179], [35.691122, -2.602124], [35.746960, -2.438392], [36.507637, -1.124259], [36.507637, 0.619821], [35.618801, 0.897840], [35.618801, 4.535861]]; warding_paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]]; -//polygon(points=emboss_points, paths=emboss_paths); //polygon(points=outline_points, paths=outline_paths); +//polygon(points=emboss_points, paths=emboss_paths); //polygon(points=warding_points, paths=warding_paths); diff --git a/sc4.scad b/sc4.scad index b4325c8..8f6140c 100644 --- a/sc4.scad +++ b/sc4.scad @@ -1,5 +1,5 @@ use -include +include key_blank(outline_points, warding_points, @@ -8,4 +8,4 @@ key_blank(outline_points, emboss_right_paths=emboss_paths, emboss_left_points=emboss_points, emboss_left_paths=emboss_paths, - offset=-outline_points[187]); \ No newline at end of file + offset=-outline_points[187]);