summaryrefslogtreecommitdiff
path: root/src/dactyl_manuform_cadquery.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/dactyl_manuform_cadquery.py')
-rw-r--r--src/dactyl_manuform_cadquery.py39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/dactyl_manuform_cadquery.py b/src/dactyl_manuform_cadquery.py
index 95a1905..6514353 100644
--- a/src/dactyl_manuform_cadquery.py
+++ b/src/dactyl_manuform_cadquery.py
@@ -1646,29 +1646,52 @@ 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,
)
+
shape = screw_insert_shape(bottom_radius, top_radius, height)
shape = shape.translate([position[0], position[1], height / 2])
@@ -1870,11 +1893,10 @@ def baseplate():
-base = baseplate()
-cq.exporters.export(w=base, fname=path.join(r"..", "things", save_dir, config_name + r"_plate.step"), exportType='STEP')
-cq.exporters.export(w=base, fname=path.join(r"..", "things", save_dir, config_name + r"_plate.dxf"), exportType='DXF')
+# base = baseplate()
+# cq.exporters.export(w=base, fname=path.join(r"..", "things", save_dir, config_name + r"_plate.step"), exportType='STEP')
+# cq.exporters.export(w=base, fname=path.join(r"..", "things", save_dir, config_name + r"_plate.dxf"), exportType='DXF')
-"""
mod_r = model_side(side="right")
cq.exporters.export(w=mod_r, fname=path.join(r"..", "things", save_dir, config_name + r"_right.step"), exportType='STEP')
@@ -1905,4 +1927,3 @@ if oled_mount_type == 'CLIP':
fname=path.join(r"..", "things", save_dir, config_name + r"_oled_clip_test.step"), exportType='STEP')
cq.exporters.export(w=union((oled_clip_mount_frame()[1], oled_clip())),
fname=path.join(r"..", "things", save_dir, config_name + r"_oled_clip_assy_test.step"), exportType='STEP')
-""" \ No newline at end of file