diff options
author | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-03 15:55:16 -0400 |
---|---|---|
committer | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-03 15:55:16 -0400 |
commit | 8610ca2a3c8e052e6822dbec09e66db86c07762a (patch) | |
tree | 943fcf80fbb618148f53d6e6fe8d63e436fe5dfd /src/dactyl_manuform.py | |
parent | 1866c114f144b6fc828716b00782ec8d516c3e41 (diff) |
Cadquery set to plate only in previous commit, fixed to create all geometry. Added features for screw mount positions.
Diffstat (limited to 'src/dactyl_manuform.py')
-rw-r--r-- | src/dactyl_manuform.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py index 4e58bd4..780c23a 100644 --- a/src/dactyl_manuform.py +++ b/src/dactyl_manuform.py @@ -1430,25 +1430,47 @@ def screw_insert(column, row, bottom_radius, top_radius, height): shift_up = (not (shift_right or shift_left)) and (row == 0) shift_down = (not (shift_right or shift_left)) and (row >= lastrow) + if screws_offset == 'INSIDE': + # print('Shift Inside') + shift_left_adjust = wall_base_x_thickness + shift_right_adjust = -wall_base_x_thickness/2 + shift_down_adjust = -wall_base_y_thickness/2 + shift_up_adjust = -wall_base_y_thickness/3 + + elif screws_offset == 'OUTSIDE': + print('Shift Outside') + shift_left_adjust = 0 + shift_right_adjust = wall_base_x_thickness/2 + shift_down_adjust = wall_base_y_thickness*2/3 + shift_up_adjust = wall_base_y_thickness*2/3 + + else: + # print('Shift Origin') + shift_left_adjust = 0 + shift_right_adjust = 0 + shift_down_adjust = 0 + shift_up_adjust = 0 + if shift_up: position = key_position( - list(np.array(wall_locate2(0, 1)) + np.array([0, (mount_height / 2), 0])), + list(np.array(wall_locate2(0, 1)) + np.array([0, (mount_height / 2) + shift_up_adjust, 0])), column, row, ) elif shift_down: position = key_position( - list(np.array(wall_locate2(0, -1)) - np.array([0, (mount_height / 2), 0])), + list(np.array(wall_locate2(0, -1)) - np.array([0, (mount_height / 2) + shift_down_adjust, 0])), column, row, ) elif shift_left: position = list( - np.array(left_key_position(row, 0)) + np.array(wall_locate3(-1, 0)) + np.array(left_key_position(row, 0)) + np.array(wall_locate3(-1, 0)) + np.array((shift_left_adjust,0,0)) ) else: position = key_position( - list(np.array(wall_locate2(1, 0)) + np.array([(mount_height / 2), 0, 0])), + list(np.array(wall_locate2(1, 0)) + np.array([(mount_height / 2), 0, 0]) + np.array((shift_right_adjust,0,0)) + ), column, row, ) |