├── .gitignore ├── pictures ├── PyErgo60_1.png ├── PyErgo60_2.png └── PyErgo60_3.jpg ├── README.md └── pyergo60.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | /dist/ 3 | /*.egg-info 4 | *.scad 5 | *.stl 6 | -------------------------------------------------------------------------------- /pictures/PyErgo60_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r4dr3fr4d/pyergo60/HEAD/pictures/PyErgo60_1.png -------------------------------------------------------------------------------- /pictures/PyErgo60_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r4dr3fr4d/pyergo60/HEAD/pictures/PyErgo60_2.png -------------------------------------------------------------------------------- /pictures/PyErgo60_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r4dr3fr4d/pyergo60/HEAD/pictures/PyErgo60_3.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PyErgo60 2 | 3 | Reference project for [Pykeeb](https://github.com/raycewest/pykeeb) and my custom keyboard. The script is a good example to see how Pykeeb is used - an actual walkthrough of the code will be added soon. Very alpha, YMMV if you try to print, so be careful - printing smaller parts or components to test isn't a bad idea. 4 | 5 | # Dependencies 6 | [Pykeeb](https://github.com/raycewest/pykeeb) 7 | 8 | # Usage 9 | 10 | For now, just clone or download, enter folder and then ```python pyergo60.py```. Left and right hand .scads will be generated, which you can export to .stls or otherwise. 11 | 12 | ![pic](/pictures/PyErgo60_1.png "Model with keycaps and switches to check for collisions") 13 | 14 | ![pic](/pictures/PyErgo60_2.png "Rendered model.") 15 | 16 | ![pic](/pictures/PyErgo60_3.jpg "Printed model.") 17 | 18 | ## Walkthrough 19 | TODO 20 | -------------------------------------------------------------------------------- /pyergo60.py: -------------------------------------------------------------------------------- 1 | from pykeeb import * 2 | from math import * 3 | 4 | columns = 7 5 | rows = 4 6 | 7 | plate = Keyboard_matrix(rows, columns, 1.5, .5, 3, [0,0,12], 0, 5) 8 | 9 | ##left to right are columns 0 and up, bottom to up are rows 0 and up 10 | plate.rm[3]=[0, 2, 7, 0, 0, 0] 11 | plate.rm[2]=[0, 2.5, 4, 0, 0, 0] 12 | plate.rm[1]=[0, 1.75, 4, -10, 0, 0] 13 | plate.rm[0]=[0, 1, 6.5, -20, 0, 0] 14 | plate.cm[0]=[0, -7, 0, 0, 0, 0] 15 | plate.cm[1]=[0, -2, 0, 0, 0, 0] 16 | plate.cm[2]=[0, -2, 0, 0, 0, 0] 17 | plate.cm[3]=[0, 5, -3, 0, 0, 0] 18 | plate.cm[5]=[0, -10, 5, 0, 0, 0] 19 | plate.cm[6]=[0, -10, 5, 0, 0, 0] 20 | plate.im[1][0]=[0, 0, 2, 0, 0, 0] 21 | plate.ik[0][0]=True 22 | plate.generate() 23 | 24 | #arc 25 | arc_columns = 1 26 | negative_arc_columns = 2 27 | arc_rows = 1 28 | arc_angle = 20 29 | arc_length = DSA_KEY_WIDTH / (2 * sin(radians(arc_angle/2))) + 12 30 | z_arc = 5 31 | z_length = DSA_KEY_WIDTH / (2 * sin(radians(z_arc/2))) + 40 32 | 33 | arc_origin = list(map(sum, zip(plate.switch_matrix[0][0].transformations[0][0:3], [-4, -1, 13]))) 34 | arc = Keyboard_arc(arc_columns, negative_arc_columns, arc_rows, arc_length, arc_angle, 0, 0, 2, 2, 3, arc_origin, 15, 4, 30) 35 | 36 | #hulls connecting arc and matrix 37 | conn_hulls = (arc.sm[0][2].get_corner('fr', .1, .1) + plate.sm[1][0].get_back()).hull() 38 | conn_hulls += (arc.sm[0][2].get_front() + plate.sm[1][0].get_corner('bl', .1, .1)).hull() 39 | conn_hulls += (arc.sm[0][2].get_right(.01, 0) + plate.sm[0][1].get_left()).hull() 40 | conn_hulls += (arc.sm[0][2].get_right(.01, 0) + plate.sm[0][1].get_corner('fl', .1, .1, 0, -3) + plate.sm[0][1].get_corner('bl', .1, .1)).hull() 41 | conn_hulls += project((arc.sm[0][2].get_corner('br', 2, 3, 2, 3) + plate.sm[0][1].get_corner('bl', .5, 3, 0, 3)).hull()) 42 | conn_hulls += project((arc.sm[0][2].get_corner('fl', .5, 3, 0, 3) + plate.sm[1][0].get_corner('bl', 3, .5, 3)).hull()) 43 | conn_hulls -= plate.sm[1][0].get_switch_at_location(True) #cuts part of hull that's near sm[1][0]'s switch hole 44 | arc.front_wall[2].disable() 45 | arc.right_wall[0].disable() 46 | arc.front_right_corner.disable() 47 | 48 | keys = arc.sm[0][2].get_keycap(True) 49 | keys += arc.sm[0][1].get_keycap(True) 50 | keys += arc.sm[0][0].get_keycap(True) 51 | keys += plate.sm[1][0].get_keycap(True) 52 | keys += plate.sm[0][1].get_keycap() 53 | keys += plate.sm[1][1].get_keycap() 54 | keys += plate.sm[2][1].get_keycap() 55 | keys += plate.sm[3][1].get_keycap() 56 | keys += plate.sm[0][2].get_keycap() 57 | keys += plate.sm[1][2].get_keycap() 58 | keys += plate.sm[2][2].get_keycap() 59 | keys += plate.sm[3][2].get_keycap() 60 | 61 | keys2 = plate.sm[0][6].get_keycap() 62 | keys2 += plate.sm[1][6].get_keycap() 63 | keys2 += plate.sm[2][6].get_keycap() 64 | keys2 += plate.sm[3][6].get_keycap(True) 65 | keys2 += plate.sm[3][5].get_keycap(True) 66 | keys2 += plate.sm[3][4].get_keycap(True) 67 | keys2 += plate.sm[3][3].get_keycap(True) 68 | 69 | switches = plate.sm[1][3].get_keyswitch() 70 | switches += plate.sm[1][2].get_keyswitch() 71 | switches += plate.sm[0][1].get_keyswitch() 72 | switches += plate.sm[0][1].get_keyswitch() 73 | 74 | cable_hole = Cylinder(30, 7, center=True).rotate([90,0,0]) 75 | cable_hole = (cable_hole + cable_hole.translate([10,0,0])).hull().translate([26,70,0]).color("Blue") 76 | right_hand = conn_hulls + arc.get_arc() + plate.get_matrix() - cable_hole 77 | left_hand = right_hand.mirror([1,0,0]) 78 | (left_hand).write("pyergo60_left.scad") 79 | (right_hand).write("pyergo60_right.scad") 80 | #(right_hand.translate([50,0,0]) + left_hand.translate([-50,0,0])).write("pyergo60.scad") 81 | --------------------------------------------------------------------------------