From 3e15f8564a959c0dbe73f2e71d1c916c62eb3aea Mon Sep 17 00:00:00 2001 From: Joshua Shreve Date: Tue, 13 Jul 2021 21:23:09 -0400 Subject: updates for rotating plates on thumb cluster. Created due to crowding of hotswap and other issues. --- src/dactyl_manuform.py | 84 +++++++++++++++++++++++++++---------------- src/generate_configuration.py | 13 ++++++- src/run_config.json | 8 ++++- 3 files changed, 73 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py index ade1208..b79c1fb 100644 --- a/src/dactyl_manuform.py +++ b/src/dactyl_manuform.py @@ -586,28 +586,48 @@ def thumb_1x_layout(shape, cap=False): debugprint('thumb_1x_layout()') if cap: shapes = thumb_mr_place(shape) - shapes = shapes.add(thumb_ml_place(shape)) - shapes = shapes.add(thumb_br_place(shape)) - shapes = shapes.add(thumb_bl_place(shape)) + shapes = shapes.add(thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation]))) + shapes = shapes.add(thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation]))) + shapes = shapes.add(thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation]))) else: shapes = union( [ - thumb_mr_place(shape), - thumb_ml_place(shape), - thumb_br_place(shape), - thumb_bl_place(shape), + thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])), + thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])), + thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])), + thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])), ] ) return shapes -def thumb_15x_layout(shape, cap=False): +def thumb_15x_layout(shape, cap=False, plate=True): debugprint('thumb_15x_layout()') - if cap: - shape = rotate(shape, (0, 0, 90)) - return add([thumb_tr_place(shape), thumb_tl_place(shape).solids().objects[0]]) + if plate: + if cap: + shape = rotate(shape, (0, 0, 90)) + return add([ + thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])), + thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])).solids().objects[0] + ]) + else: + return union([ + thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])), + thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])), + ]) else: - return union([thumb_tr_place(shape), thumb_tl_place(shape)]) + if cap: + shape = rotate(shape, (0, 0, 90)) + return add([ + thumb_tr_place(shape), + thumb_tl_place(shape).solids().objects[0] + ]) + else: + return union([ + thumb_tr_place(shape), + thumb_tl_place(shape), + ]) + def double_plate_half(): debugprint('double_plate()') @@ -661,7 +681,7 @@ def default_thumb(side="right"): print('thumb()') shape = thumb_1x_layout(rotate(single_plate(side=side), (0, 0, -90))) shape = union([shape, thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))]) - shape = union([shape, thumb_15x_layout(double_plate())]) + shape = union([shape, thumb_15x_layout(double_plate(), plate=False)]) return shape @@ -873,15 +893,15 @@ def mini_thumb_bl_place(shape): def mini_thumb_1x_layout(shape): return union([ - mini_thumb_mr_place(shape), - mini_thumb_br_place(shape), - mini_thumb_tl_place(shape), - mini_thumb_bl_place(shape), + mini_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])), + mini_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])), + mini_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])), + mini_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])), ]) def mini_thumb_15x_layout(shape): - return union([mini_thumb_tr_place(shape)] ) + return union([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))]) def mini_thumbcaps(): @@ -1101,18 +1121,24 @@ def carbonfet_thumb_bl_place(shape): def carbonfet_thumb_1x_layout(shape): return union([ - carbonfet_thumb_tr_place(shape), - carbonfet_thumb_mr_place(shape), - carbonfet_thumb_br_place(shape), - carbonfet_thumb_tl_place(shape), + carbonfet_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])), + carbonfet_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])), + carbonfet_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])), + carbonfet_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])), ]) -def carbonfet_thumb_15x_layout(shape): - return union([ - carbonfet_thumb_bl_place(shape), - carbonfet_thumb_ml_place(shape) - ]) +def carbonfet_thumb_15x_layout(shape, plate=True): + if plate: + return union([ + carbonfet_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])), + carbonfet_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])) + ]) + else: + return union([ + carbonfet_thumb_bl_place(shape), + carbonfet_thumb_ml_place(shape) + ]) def carbonfet_thumbcaps(): @@ -1122,10 +1148,8 @@ def carbonfet_thumbcaps(): def carbonfet_thumb(side="right"): - # shape = thumb_1x_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) - # shape += thumb_15x_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) shape = carbonfet_thumb_1x_layout(single_plate(side=side)) - shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half())]) + shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)]) shape = union([shape, carbonfet_thumb_15x_layout(single_plate(side=side))]) return shape diff --git a/src/generate_configuration.py b/src/generate_configuration.py index 69fc0c8..b7344f2 100644 --- a/src/generate_configuration.py +++ b/src/generate_configuration.py @@ -40,8 +40,19 @@ shape_config = { 13 # controls overall height# original=9 with centercol=3# use 16 for centercol=2 ), + ############################## + # THUMB PARAMETERS + ############################## 'thumb_style': 'DEFAULT', # 'DEFAULT', 'MINI', 'CARBONFET' + # Thumb plate rotations, anything other than 90 degree increments WILL NOT WORK. + 'thumb_plate_tr_rotation': 0.0, # Top right plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + 'thumb_plate_tl_rotation': 0.0, # Top left plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + 'thumb_plate_mr_rotation': 0.0, # Mid right plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + 'thumb_plate_ml_rotation': 0.0, # Mid left plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + 'thumb_plate_br_rotation': 0.0, # Bottom right plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + 'thumb_plate_bl_rotation': 0.0, # Bottom right plate rotation tweaks as thumb cluster is crowded for hot swap, etc. + ############################## # EXPERIMENTAL PARAMETERS ############################## @@ -89,7 +100,7 @@ shape_config = { # 'HS_NUB' = hot swap underside with nubs. # 'HS_UNDERCUT' = hot swap underside with undercut. Does not generate properly. Hot swap step needs to be modified. # 'HS_NOTCH' = hot swap underside with notch. Does not generate properly. Hot swap step needs to be modified. - 'plate_style': 'NOTCH', + 'plate_style': 'HS_NOTCH', 'hole_keyswitch_height': 14.0, 'hole_keyswitch_width': 14.0, diff --git a/src/run_config.json b/src/run_config.json index 2240874..2bae82c 100644 --- a/src/run_config.json +++ b/src/run_config.json @@ -20,6 +20,12 @@ ], "keyboard_z_offset": 13, "thumb_style": "DEFAULT", + "thumb_plate_tr_rotation": 0.0, + "thumb_plate_tl_rotation": 0.0, + "thumb_plate_mr_rotation": 0.0, + "thumb_plate_ml_rotation": 0.0, + "thumb_plate_br_rotation": 0.0, + "thumb_plate_bl_rotation": 0.0, "pinky_1_5U": false, "first_1_5U_row": 0, "last_1_5U_row": 5, @@ -62,7 +68,7 @@ 17.5 ], "fixed_tenting": 0.0, - "plate_style": "NOTCH", + "plate_style": "HS_NOTCH", "hole_keyswitch_height": 14.0, "hole_keyswitch_width": 14.0, "nub_keyswitch_height": 14.4, -- cgit v1.2.3