Skip to content

Commit

Permalink
First pass at USB-C and TRRS mount points.
Browse files Browse the repository at this point in the history
  • Loading branch information
bullwinkle3000 committed Mar 20, 2023
1 parent 96cd584 commit 25de4a7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 36 deletions.
71 changes: 42 additions & 29 deletions src/dactyl_manuform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,14 +1190,25 @@ def usb_holder_hole():
def trrs_mount_point():
shape = box(6.2, 14, 5.2)
jack = translate(rotate(cylinder(2.6, 5), (90, 0, 0)), (0, 9, 0))
jack_entry = translate(rotate(cylinder(4, 5), (90, 0, 0)), (0, 10.5, 0))
shape = translate(union([shape, jack, jack_entry]), (0, 0, 10))

jack_entry = translate(rotate(cylinder(4, 5), (90, 0, 0)), (0, 11, 0))
shape = rotate(translate(union([shape, jack, jack_entry]), (0, 0, 10)), (0, 0, 75))

# shape = translate(shape,
# (
# usb_holder_position[0] + trrs_hole_xoffset,
# usb_holder_position[1] + trrs_hole_yoffset,
# trrs_hole_zoffset,
# )
# )

pos = screw_position(0, 0, 5, 5, 5) # wall_locate2(0, 1)
# trans = wall_locate2(1, 1)
# pos = [pos[0] + trans[0], pos[1] + trans[1], pos[2]]
shape = translate(shape,
(
usb_holder_position[0] - 18,
usb_holder_position[1] - 8,
-4,
pos[0] + trrs_hole_xoffset,
pos[1] + trrs_hole_yoffset + screw_offsets[0][1],
trrs_hole_zoffset,
)
)
return shape
Expand All @@ -1213,15 +1224,15 @@ def usb_c_hole():
return usb_c_shape(usb_c_width, usb_c_height, 20)

def usb_c_mount_point():
width = usb_c_width * 1.4
height = usb_c_height * 1.4
width = usb_c_width * 1.2
height = usb_c_height * 1.2
front_bit = translate(usb_c_shape(usb_c_width + 2, usb_c_height + 2, wall_thickness / 2), (0, (wall_thickness / 2) + 1, 0))
shape = union([front_bit, usb_c_hole()])
shape = translate(shape,
(
usb_holder_position[0] - 3,
usb_holder_position[1] ,
5,
usb_holder_position[0] + usb_c_xoffset,
usb_holder_position[1] + usb_c_yoffset,
usb_c_zoffset,
)
)
return shape
Expand Down Expand Up @@ -1946,29 +1957,31 @@ def model_side(side="right"):
s2 = union([walls_shape])
s2 = union([s2, *screw_insert_outers(side=side)])

if controller_mount_type in ['RJ9_USB_TEENSY', 'USB_TEENSY']:
s2 = union([s2, teensy_holder()])
if trrs_hole:
s2 = difference(s2, [trrs_mount_point()])

if controller_mount_type in ['RJ9_USB_TEENSY', 'RJ9_USB_WALL', 'USB_WALL', 'USB_TEENSY']:
s2 = union([s2, usb_holder()])
s2 = difference(s2, [usb_holder_hole()])
if side == "both" or side == controller_side:
if controller_mount_type in ['RJ9_USB_TEENSY', 'USB_TEENSY']:
s2 = union([s2, teensy_holder()])

if controller_mount_type in ['USB_C_WALL']:
# s2 = union([s2, usb_holder()])
s2 = difference(s2, [usb_c_mount_point(),trrs_mount_point()])
# s2 = union([s2, trrs_mount_point()])
if controller_mount_type in ['RJ9_USB_TEENSY', 'RJ9_USB_WALL', 'USB_WALL', 'USB_TEENSY']:
s2 = union([s2, usb_holder()])
s2 = difference(s2, [usb_holder_hole()])

if controller_mount_type in ['RJ9_USB_TEENSY', 'RJ9_USB_WALL']:
s2 = difference(s2, [rj9_space()])
if controller_mount_type in ['USB_C_WALL']:
s2 = difference(s2, [usb_c_mount_point()])

if controller_mount_type in ['RJ9_USB_TEENSY', 'RJ9_USB_WALL']:
s2 = difference(s2, [rj9_space()])

if controller_mount_type in ['BLACKPILL_EXTERNAL']:
s2 = difference(s2, [blackpill_mount_hole()])
if controller_mount_type in ['BLACKPILL_EXTERNAL']:
s2 = difference(s2, [blackpill_mount_hole()])

if controller_mount_type in ['EXTERNAL']:
s2 = difference(s2, [external_mount_hole()])
if controller_mount_type in ['EXTERNAL']:
s2 = difference(s2, [external_mount_hole()])

if controller_mount_type in ['None']:
0 # do nothing, only here to expressly state inaction.
if controller_mount_type in ['None']:
0 # do nothing, only here to expressly state inaction.

s2 = difference(s2, [union(screw_insert_holes(side=side))])
shape = union([shape, s2])
Expand Down Expand Up @@ -2129,7 +2142,7 @@ def baseplate(wedge_angle=None, side='right'):
shape = difference(shape, hole_shapes)
shape = translate(shape, (0, 0, -base_rim_thickness))
shape = union([shape, inner_shape])
if magnet_bottom: # was 0.05, now 0.2, trying nothi
if magnet_bottom:
shape = difference(shape, [translate(magnet, (0, 0, 0.05 - (screw_insert_height / 2))) for magnet in list(tool)])

return shape
Expand Down
19 changes: 17 additions & 2 deletions src/generate_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,20 @@
# connector options are
# 'RJ9_USB_WALL' = Standard internal plate with RJ9 opening and square cutout for connection.
# 'USB_WALL' = Standard internal plate with a square cutout for connection, no RJ9.
# 'USB-C-WALL' = Simple hole for usb-c connector.
# 'RJ9_USB_TEENSY' = Teensy holder
# 'USB_TEENSY' = Teensy holder, no RJ9
# 'EXTERNAL' = square cutout for a holder such as the one from lolligagger.
# 'BLACKPILL_EXTERNAL' = larger square cutout for lolligagger type holder modified for the blackpill.

# 'NONE' = No openings in the back.
'controller_mount_type': 'EXTERNAL',

'controller_side': 'both', # usually on both sides, but set this to have the holder/mount only one one side
# eg. both, right, or left
'external_holder_height': 12.5,
'external_holder_width': 28.75,
'external_holder_xoffset': -5.0,
'external_holder_yoffset': -4.5, #Tweak this value to get the right undercut for the tray engagement.
'external_holder_yoffset': -4.5, #Tweak this value to get the right undercut for the tray engagement.

# Offset is from the top inner corner of the top inner key.

Expand All @@ -347,6 +350,18 @@
"blackpill_holder_width": 32.0,
"blackpill_holder_xoffset": -6.5,

##### USB-C MOUNT # uses external mount point location
"usb_c_width": 9.5,
"usb_c_height": 3.5,
"usb_c_xoffset": -3, # offsets from the external mount position
"usb_c_yoffset": 0,
"usb_c_zoffset": 5,

##### TRRS MOUNT POINT
"trrs_hole": False, # this will include a hole for a TRRS jack mount on both sides
"trrs_hole_xoffset": -18, # These are offset from the external mount position
"trrs_hole_yoffset": -8,
"trrs_hole_zoffset": -4,

###################################
## Bottom Plate Dimensions
Expand Down
18 changes: 13 additions & 5 deletions src/run_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"show_caps": false,
"show_pcbs": false,
"resin": false,
"shift_column": 0,
"nrows": 6,
"ncols": 6,
"alpha": 0.26179916666666664,
Expand All @@ -20,9 +19,10 @@
"symmetry": "symmetric",
"column_style_gt5": "orthographic",
"column_style": "standard",
"full_last_rows": false,
"all_last_rows": false,
"shift_column": 0,
"inner_column": false,
"all_last_rows": false,
"full_last_rows": false,
"keyboard_z_offset": 12,
"thumb_style": "TRACKBALL_WILD",
"right_side_only": false,
Expand Down Expand Up @@ -111,8 +111,6 @@
"wall_base_y_thickness": 4.5,
"wall_base_x_thickness": 4.5,
"wall_base_back_thickness": 4.5,
"usb_c_width": 9.5,
"usb_c_height": 3.5,
"fixed_angles": [
0.17453277777777776,
0.17453277777777776,
Expand Down Expand Up @@ -189,12 +187,22 @@
"wire_post_overhang": 3.5,
"wire_post_diameter": 2.6,
"controller_mount_type": "EXTERNAL",
"controller_side": "both",
"external_holder_height": 12.5,
"external_holder_width": 29.2,
"blackpill_holder_width": 32.0,
"blackpill_holder_xoffset": -6.5,
"external_holder_xoffset": -5.0,
"external_holder_yoffset": -4.5,
"usb_c_width": 9.5,
"usb_c_height": 3.5,
"usb_c_xoffset": -3,
"usb_c_yoffset": 0,
"usb_c_zoffset": 5,
"trrs_hole": false,
"trrs_hole_xoffset": 6,
"trrs_hole_yoffset": -1.5,
"trrs_hole_zoffset": 3,
"screw_hole_diameter": 3.3,
"base_thickness": 3.0,
"base_offset": 3.0,
Expand Down

0 comments on commit 25de4a7

Please sign in to comment.