From 1d6607bccd0b195e84dd23f4fb44e57a0a8d8be5 Mon Sep 17 00:00:00 2001 From: ursaw Date: Tue, 19 Apr 2022 19:02:46 +0200 Subject: [PATCH] Monoblock based on left_wall_x_offset --- src/dactyl_manuform.py | 69 ++++++++++++++++++------ src/generate_configuration.py | 8 +++ src/generate_configuration_mklasklasd.py | 8 +++ src/generate_configuration_orbyl_test.py | 8 +++ src/generate_configuration_test.py | 8 +++ src/run_config.json | 5 +- 6 files changed, 88 insertions(+), 18 deletions(-) diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py index 72135e7b4..00aa3c8b8 100644 --- a/src/dactyl_manuform.py +++ b/src/dactyl_manuform.py @@ -4307,15 +4307,65 @@ def baseplate(wedge_angle=None, side='right'): def run(): + # general files + if oled_mount_type == 'UNDERCUT': + export_file(shape=oled_undercut_mount_frame()[1], fname=path.join(save_path, config_name + r"_oled_undercut_test")) + + if oled_mount_type == 'SLIDING': + export_file(shape=oled_sliding_mount_frame()[1], fname=path.join(save_path, config_name + r"_oled_sliding_test")) + + if oled_mount_type == 'CLIP': + oled_mount_location_xyz = (0.0, 0.0, -oled_mount_depth / 2) + oled_mount_rotation_xyz = (0.0, 0.0, 0.0) + export_file(shape=oled_clip(), fname=path.join(save_path, config_name + r"_oled_clip")) + export_file(shape=oled_clip_mount_frame()[1], + fname=path.join(save_path, config_name + r"_oled_clip_test")) + export_file(shape=union((oled_clip_mount_frame()[1], oled_clip())), + fname=path.join(save_path, config_name + r"_oled_clip_assy_test")) + + # generate right side. Export after monoblock mod_r, tmb_r = model_side(side="right") - export_file(shape=mod_r, fname=path.join(save_path, config_name + r"_right")) - export_file(shape=tmb_r, fname=path.join(save_path, config_name + r"_thumb_right")) #base = baseplate(mod_r, tmb_r, side='right') base = baseplate(side='right') + + if monoblock: + if left_wall_x_offset < monoblock_spread: + print(f"MONOBLOCK double check left_wall_x_offset={left_wall_x_offset}") + # prepare right side + mod_r = rotate(translate(mod_r, [monoblock_spread, 0, 0]), (0, 0, monoblock_angle)) + base = rotate(translate(base, [monoblock_spread, 0, 0]), (0, 0, monoblock_angle)) + # cut off in the middle + cutdim = max(20000, monoblock_spread) + cutobj = translate(box(cutdim, cutdim, cutdim), (-cutdim/2, 0, 0)) + mod_r = difference(mod_r,[cutobj]) + base = difference(base,[cutobj]) + + # left side ......... no controller ... HACK with globals... + tmp_cmt = globals()['controller_mount_type'] + globals()['controller_mount_type'] = 'None' + mod_l, tmb_l = model_side(side="left") + mod_l = rotate(translate(mod_l, [-monoblock_spread, 0, 0]), (0, 0, -monoblock_angle)) + globals()['controller_mount_type'] = tmp_cmt + + cutobj = translate(box(cutdim, cutdim, cutdim), (cutdim/2, 0, 0)) + mod_l = difference(mod_l,[cutobj]) + + # base plat + export_file(shape=union([mod_r, mod_l]), fname=path.join(save_path, config_name + r"_monoblock")) + export_file(shape=union([base, mirror(base, 'YZ')]), fname=path.join(save_path, config_name + r"_monoblock_plate")) + + return + + + export_file(shape=mod_r, fname=path.join(save_path, config_name + r"_right")) + export_file(shape=tmb_r, fname=path.join(save_path, config_name + r"_thumb_right")) + + export_file(shape=base, fname=path.join(save_path, config_name + r"_right_plate")) export_dxf(shape=base, fname=path.join(save_path, config_name + r"_right_plate")) + if symmetry == "asymmetric": mod_l, tmb_l = model_side(side="left") export_file(shape=mod_l, fname=path.join(save_path, config_name + r"_left")) @@ -4336,21 +4386,6 @@ def run(): - if oled_mount_type == 'UNDERCUT': - export_file(shape=oled_undercut_mount_frame()[1], fname=path.join(save_path, config_name + r"_oled_undercut_test")) - - if oled_mount_type == 'SLIDING': - export_file(shape=oled_sliding_mount_frame()[1], fname=path.join(save_path, config_name + r"_oled_sliding_test")) - - if oled_mount_type == 'CLIP': - oled_mount_location_xyz = (0.0, 0.0, -oled_mount_depth / 2) - oled_mount_rotation_xyz = (0.0, 0.0, 0.0) - export_file(shape=oled_clip(), fname=path.join(save_path, config_name + r"_oled_clip")) - export_file(shape=oled_clip_mount_frame()[1], - fname=path.join(save_path, config_name + r"_oled_clip_test")) - export_file(shape=union((oled_clip_mount_frame()[1], oled_clip())), - fname=path.join(save_path, config_name + r"_oled_clip_assy_test")) - # base = baseplate() # export_file(shape=base, fname=path.join(save_path, config_name + r"_plate")) if __name__ == '__main__': diff --git a/src/generate_configuration.py b/src/generate_configuration.py index c6ed586b7..5da3b2e05 100644 --- a/src/generate_configuration.py +++ b/src/generate_configuration.py @@ -467,6 +467,14 @@ [0, -6, 5],# NOT USED IN MOST FORMATS (7th column) ], + ################################### + ## MONOBLOCK + #################################### + # CHECK that 'left_wall_x_offset' fits to 'monoblock_spread' + 'monoblock': True, + 'monoblock_spread': 100, # move outside from center: not easy to measure this number: just try... + 'monoblock_angle': 20, # angle in degrees for each side out of X-axis + } #################################### diff --git a/src/generate_configuration_mklasklasd.py b/src/generate_configuration_mklasklasd.py index 4263a1f75..5fc8219b7 100644 --- a/src/generate_configuration_mklasklasd.py +++ b/src/generate_configuration_mklasklasd.py @@ -464,6 +464,14 @@ [0, -6, 5],# NOT USED IN MOST FORMATS (7th column) ], + ################################### + ## MONOBLOCK + #################################### + # CHECK that 'left_wall_x_offset' fits to 'monoblock_spread' + 'monoblock': False, + 'monoblock_spread': 100, # move outside from center: not easy to measure this number: just try... + 'monoblock_angle': 20, # angle in degrees for each side out of X-axis + } #################################### diff --git a/src/generate_configuration_orbyl_test.py b/src/generate_configuration_orbyl_test.py index 383b8cff6..1a3e5cfdd 100644 --- a/src/generate_configuration_orbyl_test.py +++ b/src/generate_configuration_orbyl_test.py @@ -459,6 +459,14 @@ [0, -6, 5],# NOT USED IN MOST FORMATS (7th column) ], + ################################### + ## MONOBLOCK + #################################### + # CHECK that 'left_wall_x_offset' fits to 'monoblock_spread' + 'monoblock': False, + 'monoblock_spread': 100, # move outside from center: not easy to measure this number: just try... + 'monoblock_angle': 20, # angle in degrees for each side out of X-axis + } #################################### diff --git a/src/generate_configuration_test.py b/src/generate_configuration_test.py index 26ad0961a..ffba825a3 100644 --- a/src/generate_configuration_test.py +++ b/src/generate_configuration_test.py @@ -460,6 +460,14 @@ [0, -6, 5],# REDUCED STAGGER [0, -6, 5],# NOT USED IN MOST FORMATS (7th column) ], + + ################################### + ## MONOBLOCK + #################################### + # CHECK that 'left_wall_x_offset' fits to 'monoblock_spread' + 'monoblock': False, + 'monoblock_spread': 100, # move outside from center: not easy to measure this number: just try... + 'monoblock_angle': 20, # angle in degrees for each side out of X-axis } diff --git a/src/run_config.json b/src/run_config.json index 8337c8e9f..7c6b3551d 100644 --- a/src/run_config.json +++ b/src/run_config.json @@ -570,5 +570,8 @@ -6, 5 ] - ] + ], + "monoblock": true, + "monoblock_spread": 100, + "monoblock_angle": 20 } \ No newline at end of file