Compare commits

...

1 Commits

Author SHA1 Message Date
Martin Frost 07f0c8608a some changes I made on the XPS 2024-11-18 22:15:38 +01:00
11 changed files with 3421 additions and 3368 deletions

View File

@ -38,7 +38,8 @@ MOUNT_HEIGHT = KEYSWITCH_HEIGHT
MOUNT_WIDTH = KEYSWITCH_WIDTH
# use 10 for faster prototyping, 15 for real
TENTING_ANGLE = 11.0
Z_OFFSET = 9.0
# This affects the height of the keyboard
Z_OFFSET = 11.0
SHOULD_INCLUDE_RISERS = False
@ -1049,16 +1050,16 @@ def screw_insert(col, row, shape, ox, oy):
def screw_insert_all_shapes(shape):
return union(
screw_insert(2, 0, shape, -5.3, 5.9),
screw_insert(NUM_COLS - 1, 0, shape, 6.7, 5.5),
screw_insert(NUM_COLS - 1, num_rows_for_col(NUM_COLS - 1), shape, 6.8, 14.4),
screw_insert(0, 0, shape, -6.2, -8),
screw_insert(1, MAX_NUM_ROWS + 1, shape, -9.8, 3.4),
screw_insert(0, MAX_NUM_ROWS - 1, shape, -17.4, -2),
screw_insert(2, 0, shape, -5.3, 5.9), # On the same side as the usb hole
screw_insert(NUM_COLS - 1, 0, shape, 6.7, 5.5), # Upper pinky corner
screw_insert(NUM_COLS - 1, num_rows_for_col(NUM_COLS - 1), shape, 6.8, 14.4), # Lower pinky corner
screw_insert(0, 0, shape, -6.2, -8), # near the TRRS hole
screw_insert(1, MAX_NUM_ROWS + 1, shape, -9.8, 3.4), # Thumb inwards
screw_insert(0, MAX_NUM_ROWS - 1, shape, -17.4, -2), # Thumb outwards
)
TRRS_HOLDER_SIZE = [6.0, 11.0, 7.0]
TRRS_HOLDER_SIZE = [6.0, 14.0, 7.0]
TRRS_HOLE_SIZE = [2.6, 10.0]
TRRS_HOLDER_THICKNESS = 2.5
TRRS_FRONT_THICKNESS = 1.8
@ -1066,35 +1067,44 @@ TRRS_FRONT_THICKNESS = 1.8
def trrs_key_holder_position():
base_place = point_on_grid(0, 0, 0, KEYSWITCH_WIDTH / 2, 0)
return [base_place[0] - 5, base_place[1] + 1.43, 9.0]
return [base_place[0] - 5, base_place[1] + 1.43, 13.0]
def trrs_holder():
x, y, z = TRRS_HOLDER_SIZE
shape = cube(
TRRS_HOLDER_SIZE[0] + TRRS_HOLDER_THICKNESS,
TRRS_HOLDER_SIZE[1] + TRRS_FRONT_THICKNESS,
TRRS_HOLDER_SIZE[2] + TRRS_HOLDER_THICKNESS * 2,
x + TRRS_HOLDER_THICKNESS,
y + TRRS_FRONT_THICKNESS,
z + TRRS_HOLDER_THICKNESS - 3 ,
)
placed_shape = translate(
-TRRS_HOLDER_SIZE[0] / 2,
-TRRS_HOLDER_SIZE[1],
-(TRRS_HOLDER_SIZE[2] / 2 + TRRS_HOLDER_THICKNESS),
-x / 2 - 1,
-y,
-(z / 3 + TRRS_HOLDER_THICKNESS),
)(shape)
return translate(*trrs_key_holder_position())(placed_shape)
blocker = cube(x + TRRS_HOLDER_THICKNESS, 5, 5)
blocker = translate(-x, -y - 2 * TRRS_HOLDER_THICKNESS, -z + 2)(blocker)
return translate(*trrs_key_holder_position())(
union(
placed_shape,
blocker,
)
)
def trrs_holder_hole():
x, y, z = TRRS_HOLDER_SIZE
rect_hole = cube(x, y, z)
rect_hole = cube(x, y + 2, z)
rect_hole = translate(
-x / 2, -y - 1, -z / 2,
-x / 2, -y - 1.3 , -z / 2,
)(rect_hole)
rect2 = cube(x, y, z - 3)
rect2 = cube(x, y + 1, z)
rect2 = translate(
-x / 2 + 5, -y - 1, -z / 3,
-x / 2, -y - 1.5, -z + 7,
)(rect2)
cylinder_hole = cylinder(*TRRS_HOLE_SIZE, segments=30)
@ -1105,10 +1115,11 @@ def trrs_holder_hole():
*trrs_key_holder_position()
)(
union(
union(
rect_hole,
rect2,
),
rect_hole,
# union(
# rect_hole,
# rect2,
# ),
cylinder_hole
)
)
@ -1202,7 +1213,7 @@ def right_shell():
global SHOULD_INCLUDE_RISERS
SHOULD_INCLUDE_RISERS = True
cover = translate(-60, 20, 0)(cube(15, 15, 20))
# cover = translate(-60, 20, 0)(cube(15, 15, 20))
full_proto = difference(
union(
@ -1269,8 +1280,8 @@ def model_outline():
return extrude_linear(bottom_height)(bottom_2d)
weight_width = 19.5
weight_height = 16.5
weight_width = 40
weight_height = 40
weight_z_offset = 0.5
@ -1292,44 +1303,21 @@ def place_weight_hole(x, y):
def bottom_weight_cutouts():
shapes = []
base_point = point_on_grid(0, NUM_COLS - 1, 0, 0, 0)
base_x = base_point[0] - 9
base_y = base_point[1] - 4
base_point = point_on_grid(1, NUM_COLS - 1, 0, 0, 0)
base_x = base_point[0] - 13.6
base_y = base_point[1]
space_between = 1
space_between = 0
offsets = space_between + weight_width
offsets_y = space_between + weight_height
r3_y = base_y - 2 * offsets_y
weight_1 = place_weight_hole(base_x, base_y + 4)
weight_2 = place_weight_hole(base_x - offsets, base_y + 8)
topr = base_y + offsets_y
weight_1 = rotate_z(-3)(weight_1)
weight_2 = rotate_z(-3)(weight_2)
for x in range(2):
shapes.append(place_weight_hole(1 + base_x - offsets * x, base_y))
for x in range(3, 4):
shapes.append(place_weight_hole(base_x - offsets * x + 2, base_y))
for x in range(4, 5):
shapes.append(place_weight_hole(base_x - offsets * x - 8, base_y))
for x in range(2, 5):
shapes.append(place_weight_hole(base_x - offsets * x - 4, base_y - offsets_y))
for x in range(5):
shapes.append(place_weight_hole(base_x - offsets * x, base_y - 2 * offsets_y))
shapes.append(place_weight_hole(base_x - offsets * 2, topr))
shapes.append(place_weight_hole(base_x - offsets * 3, topr))
base_thumb_x = base_x - offsets * 4 + 5
base_thumb_y = base_y - offsets_y * 3 - weight_width + weight_height + 1
angled_shape = rotate_z(107)(weight_shape())
shapes.append(
translate(base_thumb_x - offsets_y - 0.4, base_thumb_y - 9.5, 0)(angled_shape)
)
shapes.append(
translate(base_thumb_x - offsets_y + 16, base_thumb_y - 1, 0)(angled_shape)
)
shapes.append(weight_1)
shapes.append(weight_2)
return union(*shapes)
@ -1337,6 +1325,28 @@ def bottom_weight_cutouts():
reset_switch_body = place_reset_switch_shape(unplaced_reset_switch_body())
reset_switch_body_hole = place_reset_switch_shape(unplaced_reset_switch_body_hole())
def liatris_stop_block():
base_place = point_on_grid(0, 0, 0, KEYSWITCH_WIDTH / 2, 0)
x = base_place[0] + 8
y = base_place[1] - 30
z = base_place[2] - 26
outer = cube(23, 4, 5)
outer = translate(-23/2, -3.5, -3/2)(outer)
inner = cube(19, 4, 6)
inner = translate(-25/2 + 3, -2, -3/2)(inner)
inner2 = cube(13, 5, 6)
inner2 = translate(-25/2 + 6, -7, -3/2)(inner2)
return translate(x, y, z)(
difference(
difference(outer, inner),
inner2
)
)
def bottom_plate():
return difference(
@ -1344,16 +1354,17 @@ def bottom_plate():
model_outline(),
# reset_switch_body,
# screw_insert_all_shapes(screw_insert_outer),
liatris_stop_block(),
),
union(
screw_insert_all_shapes(
cylinderr1r2(screw_head_radius, screw_head_radius, screw_head_height)
cylinderr1r2(screw_head_radius, screw_head_radius, screw_head_height + 2)
),
screw_insert_all_shapes(
cylinderr1r2(screw_hole_radius, screw_hole_radius, bottom_height)
cylinderr1r2(screw_hole_radius, screw_hole_radius, bottom_height + 2)
),
# bottom_weight_cutouts(),
reset_switch_body_hole,
bottom_weight_cutouts(),
# reset_switch_body_hole,
),
)

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
things/left_higher.stl Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
things/right_higher.stl Normal file

Binary file not shown.