summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Bucklow <patches@elsie.org.uk>2021-07-25 10:21:21 +0100
committerHenry Bucklow <patches@elsie.org.uk>2021-07-25 10:21:21 +0100
commitbef669da28b97dbb1f96cb5950b42bdd293863e4 (patch)
tree57b1331664f7567cd0807cd7b459b98b57a419c1 /src
parent56c1d0b38702372b8cf35c6bf3ec3b0e3b00b62c (diff)
parent0456cbbf49c195842d3420fa540a7965a9e35697 (diff)
Merge https://github.com/joshreve/dactyl-keyboard
Diffstat (limited to 'src')
-rw-r--r--src/dactyl_manuform.py443
-rw-r--r--src/generate_configuration.py12
-rw-r--r--src/run_config.json11
3 files changed, 272 insertions, 194 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py
index 283bbab..3948c98 100644
--- a/src/dactyl_manuform.py
+++ b/src/dactyl_manuform.py
@@ -102,12 +102,17 @@ if 'HS_' in plate_style:
mount_width = keyswitch_width + 2 * plate_rim
mount_height = keyswitch_height + 2 * plate_rim
mount_thickness = plate_thickness
-double_plate_height = (sa_double_length - mount_height) / 3
+
+if default_1U_cluster:
+ double_plate_height = (.7*sa_double_length - mount_height) / 3
+else:
+ double_plate_height = (.95*sa_double_length - mount_height) / 3
if oled_mount_type is not None and oled_mount_type != "NONE":
left_wall_x_offset = oled_left_wall_x_offset_override
left_wall_z_offset = oled_left_wall_z_offset_override
-
+ left_wall_lower_y_offset = oled_left_wall_lower_y_offset
+ left_wall_lower_z_offset = oled_left_wall_lower_z_offset
cap_top_height = plate_thickness + sa_profile_key_height
row_radius = ((mount_height + extra_height) / 2) / (np.sin(alpha / 2)) + cap_top_height
@@ -541,7 +546,7 @@ def thumborigin():
def thumb_tr_place(shape):
debugprint('thumb_tr_place()')
- shape = rotate(shape, [10, -23, 10])
+ shape = rotate(shape, [10, -15, 10])
shape = translate(shape, thumborigin())
shape = translate(shape, [-12, -16, 3])
return shape
@@ -549,9 +554,9 @@ def thumb_tr_place(shape):
def thumb_tl_place(shape):
debugprint('thumb_tl_place()')
- shape = rotate(shape, [10, -23, 10])
+ shape = rotate(shape, [7.5, -18, 10])
shape = translate(shape, thumborigin())
- shape = translate(shape, [-32, -15, -2])
+ shape = translate(shape, [-32.5, -14.5, -2.5])
return shape
@@ -590,19 +595,28 @@ def thumb_bl_place(shape):
def thumb_1x_layout(shape, cap=False):
debugprint('thumb_1x_layout()')
if cap:
- shapes = thumb_mr_place(shape)
- shapes = shapes.add(thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])))
- shapes = shapes.add(thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])))
- shapes = shapes.add(thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])))
+ shape_list = [
+ thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
+ thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
+ thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
+ thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
+ ]
+
+ if default_1U_cluster:
+ shape_list.append(thumb_tr_place(rotate(rotate(shape, (0, 0, 90)), [0, 0, thumb_plate_tr_rotation])))
+ shape_list.append(thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])))
+ shapes = add(shape_list)
+
else:
- shapes = union(
- [
+ shape_list = [
thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
]
- )
+ if default_1U_cluster:
+ shape_list.append(thumb_tr_place(rotate(rotate(shape, (0, 0, 90)), [0, 0, thumb_plate_tr_rotation])))
+ shapes = union(shape_list)
return shapes
@@ -611,27 +625,32 @@ def thumb_15x_layout(shape, cap=False, plate=True):
if plate:
if cap:
shape = rotate(shape, (0, 0, 90))
- return add([
- thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
- thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])).solids().objects[0]
- ])
+ cap_list = [thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation]))]
+ cap_list.append(thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])))
+ return add(cap_list)
else:
- return union([
- thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
- thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
- ])
+ shape_list = [thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation]))]
+ if not default_1U_cluster:
+ shape_list.append(thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])))
+ return union(shape_list)
else:
if cap:
shape = rotate(shape, (0, 0, 90))
- return add([
- thumb_tr_place(shape),
- thumb_tl_place(shape).solids().objects[0]
- ])
+ shape_list = [
+ thumb_tl_place(shape),
+ ]
+ shape_list.append(thumb_tr_place(shape))
+
+ return add(shape_list)
else:
- return union([
- thumb_tr_place(shape),
+ shape_list = [
thumb_tl_place(shape),
- ])
+ ]
+ if not default_1U_cluster:
+ shape_list.append(thumb_tr_place(shape))
+
+ return union(shape_list)
+
def double_plate_half():
@@ -677,8 +696,9 @@ def thumb_connectors():
def default_thumbcaps():
t1 = thumb_1x_layout(sa_cap(1), cap=True)
- t15 = thumb_15x_layout(sa_cap(1.5), cap=True)
- return t1.add(t15)
+ if not default_1U_cluster:
+ t1.add(thumb_15x_layout(sa_cap(1.5), cap=True))
+ return t1
def default_thumb(side="right"):
@@ -722,16 +742,28 @@ def default_thumb_connectors():
hulls = []
# Top two
- hulls.append(
- triangle_hulls(
- [
- thumb_tl_place(thumb_post_tr()),
- thumb_tl_place(thumb_post_br()),
- thumb_tr_place(thumb_post_tl()),
- thumb_tr_place(thumb_post_bl()),
- ]
+ if default_1U_cluster:
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tr()),
+ thumb_tl_place(thumb_post_br()),
+ thumb_tr_place(web_post_tl()),
+ thumb_tr_place(web_post_bl()),
+ ]
+ )
+ )
+ else:
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tr()),
+ thumb_tl_place(thumb_post_br()),
+ thumb_tr_place(thumb_post_tl()),
+ thumb_tr_place(thumb_post_bl()),
+ ]
+ )
)
- )
# bottom two on the right
hulls.append(
@@ -784,50 +816,96 @@ def default_thumb_connectors():
)
)
- # top two to the main keyboard, starting on the left
- hulls.append(
- triangle_hulls(
- [
- thumb_tl_place(thumb_post_tl()),
- thumb_ml_place(web_post_tr()),
- thumb_tl_place(thumb_post_bl()),
- thumb_ml_place(web_post_br()),
- thumb_tl_place(thumb_post_br()),
- thumb_mr_place(web_post_tr()),
- thumb_tr_place(thumb_post_bl()),
- thumb_mr_place(web_post_br()),
- thumb_tr_place(thumb_post_br()),
- ]
+ if default_1U_cluster:
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tl()),
+ thumb_ml_place(web_post_tr()),
+ thumb_tl_place(thumb_post_bl()),
+ thumb_ml_place(web_post_br()),
+ thumb_tl_place(thumb_post_br()),
+ thumb_mr_place(web_post_tr()),
+ thumb_tr_place(web_post_bl()),
+ thumb_mr_place(web_post_br()),
+ thumb_tr_place(web_post_br()),
+ ]
+ )
+ )
+ else:
+ # top two to the main keyboard, starting on the left
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tl()),
+ thumb_ml_place(web_post_tr()),
+ thumb_tl_place(thumb_post_bl()),
+ thumb_ml_place(web_post_br()),
+ thumb_tl_place(thumb_post_br()),
+ thumb_mr_place(web_post_tr()),
+ thumb_tr_place(thumb_post_bl()),
+ thumb_mr_place(web_post_br()),
+ thumb_tr_place(thumb_post_br()),
+ ]
+ )
)
- )
- hulls.append(
- triangle_hulls(
- [
- thumb_tl_place(thumb_post_tl()),
- key_place(web_post_bl(), 0, cornerrow),
- thumb_tl_place(thumb_post_tr()),
- key_place(web_post_br(), 0, cornerrow),
- thumb_tr_place(thumb_post_tl()),
- key_place(web_post_bl(), 1, cornerrow),
- thumb_tr_place(thumb_post_tr()),
- key_place(web_post_br(), 1, cornerrow),
- key_place(web_post_tl(), 2, lastrow),
- key_place(web_post_bl(), 2, lastrow),
- thumb_tr_place(thumb_post_tr()),
- key_place(web_post_bl(), 2, lastrow),
- thumb_tr_place(thumb_post_br()),
- key_place(web_post_br(), 2, lastrow),
- key_place(web_post_bl(), 3, lastrow),
- key_place(web_post_tr(), 2, lastrow),
- key_place(web_post_tl(), 3, lastrow),
- key_place(web_post_bl(), 3, cornerrow),
- key_place(web_post_tr(), 3, lastrow),
- key_place(web_post_br(), 3, cornerrow),
- key_place(web_post_bl(), 4, cornerrow),
- ]
+ if default_1U_cluster:
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tl()),
+ key_place(web_post_bl(), 0, cornerrow),
+ thumb_tl_place(thumb_post_tr()),
+ key_place(web_post_br(), 0, cornerrow),
+ thumb_tr_place(web_post_tl()),
+ key_place(web_post_bl(), 1, cornerrow),
+ thumb_tr_place(web_post_tr()),
+ key_place(web_post_br(), 1, cornerrow),
+ key_place(web_post_tl(), 2, lastrow),
+ key_place(web_post_bl(), 2, lastrow),
+ thumb_tr_place(web_post_tr()),
+ key_place(web_post_bl(), 2, lastrow),
+ thumb_tr_place(web_post_br()),
+ key_place(web_post_br(), 2, lastrow),
+ key_place(web_post_bl(), 3, lastrow),
+ key_place(web_post_tr(), 2, lastrow),
+ key_place(web_post_tl(), 3, lastrow),
+ key_place(web_post_bl(), 3, cornerrow),
+ key_place(web_post_tr(), 3, lastrow),
+ key_place(web_post_br(), 3, cornerrow),
+ key_place(web_post_bl(), 4, cornerrow),
+ ]
+ )
+ )
+ else:
+ hulls.append(
+ triangle_hulls(
+ [
+ thumb_tl_place(thumb_post_tl()),
+ key_place(web_post_bl(), 0, cornerrow),
+ thumb_tl_place(thumb_post_tr()),
+ key_place(web_post_br(), 0, cornerrow),
+ thumb_tr_place(thumb_post_tl()),
+ key_place(web_post_bl(), 1, cornerrow),
+ thumb_tr_place(thumb_post_tr()),
+ key_place(web_post_br(), 1, cornerrow),
+ key_place(web_post_tl(), 2, lastrow),
+ key_place(web_post_bl(), 2, lastrow),
+ thumb_tr_place(thumb_post_tr()),
+ key_place(web_post_bl(), 2, lastrow),
+ thumb_tr_place(thumb_post_br()),
+ key_place(web_post_br(), 2, lastrow),
+ key_place(web_post_bl(), 3, lastrow),
+ key_place(web_post_tr(), 2, lastrow),
+ key_place(web_post_tl(), 3, lastrow),
+ key_place(web_post_bl(), 3, cornerrow),
+ key_place(web_post_tr(), 3, lastrow),
+ key_place(web_post_br(), 3, cornerrow),
+ key_place(web_post_bl(), 4, cornerrow),
+ ]
+ )
)
- )
hulls.append(
triangle_hulls(
@@ -1405,17 +1483,24 @@ def bottom_hull(p, height=0.001):
return shape
-def left_key_position(row, direction):
+def left_key_position(row, direction, low_corner=False):
debugprint("left_key_position()")
pos = np.array(
key_position([-mount_width * 0.5, direction * mount_height * 0.5, 0], 0, row)
)
- return list(pos - np.array([left_wall_x_offset, 0, left_wall_z_offset]))
+ if low_corner:
+ y_offset = left_wall_lower_y_offset
+ z_offset = left_wall_lower_z_offset
+ else:
+ y_offset = 0.0
+ z_offset = 0.0
+
+ return list(pos - np.array([left_wall_x_offset, -y_offset, left_wall_z_offset + z_offset]))
-def left_key_place(shape, row, direction):
+def left_key_place(shape, row, direction, low_corner=False):
debugprint("left_key_place()")
- pos = left_key_position(row, direction)
+ pos = left_key_position(row, direction, low_corner=low_corner)
return translate(shape, pos)
@@ -1527,77 +1612,47 @@ def right_wall():
)])
#STRANGE PARTIAL OFFSET
- shape = union([shape,key_wall_brace(
- lastcol,
- cornerrow,
- 0,
- -1,
- web_post_br(),
- lastcol,
- cornerrow,
- 1,
- 0,
- web_post_br(),
- )])
+ shape = union([
+ shape,
+ key_wall_brace(lastcol, cornerrow, 0, -1, web_post_br(), lastcol, cornerrow, 1, 0, web_post_br())
+ ])
return shape
def left_wall():
print('left_wall()')
shape = union([wall_brace(
- (lambda sh: key_place(sh, 0, 0)),
- 0,
- 1,
- web_post_tl(),
- (lambda sh: left_key_place(sh, 0, 1)),
- 0,
- 1,
- web_post(),
+ (lambda sh: key_place(sh, 0, 0)), 0, 1, web_post_tl(),
+ (lambda sh: left_key_place(sh, 0, 1)), 0, 1, web_post(),
)])
- shape = union([shape,wall_brace(
- (lambda sh: left_key_place(sh, 0, 1)),
- 0,
- 1,
- web_post(),
- (lambda sh: left_key_place(sh, 0, 1)),
- -1,
- 0,
- web_post(),
+ shape = union([shape, wall_brace(
+ (lambda sh: left_key_place(sh, 0, 1)), 0, 1, web_post(),
+ (lambda sh: left_key_place(sh, 0, 1)), -1, 0, web_post(),
)])
for i in range(lastrow):
y = i
+ low = (y == (lastrow-1))
temp_shape1 = wall_brace(
- (lambda sh: left_key_place(sh, y, 1)),
- -1,
- 0,
- web_post(),
- (lambda sh: left_key_place(sh, y, -1)),
- -1,
- 0,
- web_post(),
+ (lambda sh: left_key_place(sh, y, 1,)), -1, 0, web_post(),
+ (lambda sh: left_key_place(sh, y, -1, low_corner=low)), -1, 0, web_post(),
)
temp_shape2 = hull_from_shapes((
key_place(web_post_tl(), 0, y),
key_place(web_post_bl(), 0, y),
left_key_place(web_post(), y, 1),
- left_key_place(web_post(), y, -1),
+ left_key_place(web_post(), y, -1, low_corner=low),
))
- shape = union([shape,temp_shape1])
- shape = union([shape,temp_shape2])
+ shape = union([shape, temp_shape1])
+ shape = union([shape, temp_shape2])
for i in range(lastrow - 1):
y = i + 1
+ low = (y == (lastrow-1))
temp_shape1 = wall_brace(
- (lambda sh: left_key_place(sh, y - 1, -1)),
- -1,
- 0,
- web_post(),
- (lambda sh: left_key_place(sh, y, 1)),
- -1,
- 0,
- web_post(),
+ (lambda sh: left_key_place(sh, y - 1, -1)), -1, 0, web_post(),
+ (lambda sh: left_key_place(sh, y, 1)), -1, 0, web_post(),
)
temp_shape2 = hull_from_shapes((
key_place(web_post_tl(), 0, y),
@@ -1605,8 +1660,8 @@ def left_wall():
left_key_place(web_post(), y, 1),
left_key_place(web_post(), y - 1, -1),
))
- shape = union([shape,temp_shape1])
- shape = union([shape,temp_shape2])
+ shape = union([shape, temp_shape1])
+ shape = union([shape, temp_shape2])
return shape
@@ -1656,7 +1711,10 @@ def thumb_connection():
def default_thumb_walls():
print('thumb_walls()')
# thumb, walls
- shape = union([wall_brace(thumb_mr_place, 0, -1, web_post_br(), thumb_tr_place, 0, -1, thumb_post_br())])
+ if default_1U_cluster:
+ shape = union([wall_brace(thumb_mr_place, 0, -1, web_post_br(), thumb_tr_place, 0, -1, web_post_br())])
+ else:
+ shape = union([wall_brace(thumb_mr_place, 0, -1, web_post_br(), thumb_tr_place, 0, -1, thumb_post_br())])
shape = union([shape, wall_brace(thumb_mr_place, 0, -1, web_post_br(), thumb_mr_place, 0, -1, web_post_bl())])
shape = union([shape, wall_brace(thumb_br_place, 0, -1, web_post_br(), thumb_br_place, 0, -1, web_post_bl())])
shape = union([shape, wall_brace(thumb_ml_place, -0.3, 1, web_post_tr(), thumb_ml_place, 0, 1, web_post_tl())])
@@ -1670,7 +1728,10 @@ def default_thumb_walls():
shape = union([shape, wall_brace(thumb_mr_place, 0, -1, web_post_bl(), thumb_br_place, 0, -1, web_post_br())])
shape = union([shape, wall_brace(thumb_ml_place, 0, 1, web_post_tl(), thumb_bl_place, 0, 1, web_post_tr())])
shape = union([shape, wall_brace(thumb_bl_place, -1, 0, web_post_bl(), thumb_br_place, -1, 0, web_post_tl())])
- shape = union([shape, wall_brace(thumb_tr_place, 0, -1, thumb_post_br(), (lambda sh: key_place(sh, 3, lastrow)), 0, -1, web_post_bl())])
+ if default_1U_cluster:
+ shape = union([shape, wall_brace(thumb_tr_place, 0, -1, web_post_br(), (lambda sh: key_place(sh, 3, lastrow)), 0, -1, web_post_bl())])
+ else:
+ shape = union([shape, wall_brace(thumb_tr_place, 0, -1, thumb_post_br(), (lambda sh: key_place(sh, 3, lastrow)), 0, -1, web_post_bl())])
return shape
@@ -1680,8 +1741,8 @@ def default_thumb_connection():
# clunky bit on the top left thumb connection (normal connectors don't work well)
shape = union([bottom_hull(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
thumb_ml_place(translate(web_post_tr(), wall_locate2(-0.3, 1))),
thumb_ml_place(translate(web_post_tr(), wall_locate3(-0.3, 1))),
]
@@ -1690,8 +1751,8 @@ def default_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
thumb_ml_place(translate(web_post_tr(), wall_locate2(-0.3, 1))),
thumb_ml_place(translate(web_post_tr(), wall_locate3(-0.3, 1))),
thumb_tl_place(thumb_post_tl()),
@@ -1701,20 +1762,18 @@ def default_thumb_connection():
shape = union([shape, hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
thumb_tl_place(thumb_post_tl()),
]
)])
shape = union([shape, hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
+ left_key_place(web_post(), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
key_place(web_post_bl(), 0, cornerrow),
- key_place(translate(web_post_bl(), wall_locate1(-1, 0)), 0, cornerrow),
thumb_tl_place(thumb_post_tl()),
]
)])
@@ -1753,8 +1812,8 @@ def mini_thumb_connection():
# clunky bit on the top left thumb connection (normal connectors don't work well)
shape = union([bottom_hull(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
mini_thumb_bl_place(translate(web_post_tr(), wall_locate2(-0.3, 1))),
mini_thumb_bl_place(translate(web_post_tr(), wall_locate3(-0.3, 1))),
]
@@ -1763,8 +1822,8 @@ def mini_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
mini_thumb_bl_place(translate(web_post_tr(), wall_locate2(-0.3, 1))),
mini_thumb_bl_place(translate(web_post_tr(), wall_locate3(-0.3, 1))),
mini_thumb_tl_place(web_post_tl()),
@@ -1774,10 +1833,10 @@ def mini_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(web_post(), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
mini_thumb_tl_place(web_post_tl()),
]
)])
@@ -1785,8 +1844,8 @@ def mini_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
+ left_key_place(web_post(), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
key_place(web_post_bl(), 0, cornerrow),
mini_thumb_tl_place(web_post_tl()),
]
@@ -1828,8 +1887,8 @@ def carbonfet_thumb_connection():
# clunky bit on the top left thumb connection (normal connectors don't work well)
shape = bottom_hull(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
carbonfet_thumb_bl_place(translate(thumb_post_tr(), wall_locate2(-0.3, 1))),
carbonfet_thumb_bl_place(translate(thumb_post_tr(), wall_locate3(-0.3, 1))),
]
@@ -1838,8 +1897,8 @@ def carbonfet_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
carbonfet_thumb_bl_place(translate(thumb_post_tr(), wall_locate2(-0.3, 1))),
carbonfet_thumb_bl_place(translate(thumb_post_tr(), wall_locate3(-0.3, 1))),
carbonfet_thumb_ml_place(thumb_post_tl()),
@@ -1849,10 +1908,10 @@ def carbonfet_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1),
+ left_key_place(web_post(), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True),
carbonfet_thumb_ml_place(thumb_post_tl()),
]
)])
@@ -1860,8 +1919,8 @@ def carbonfet_thumb_connection():
shape = union([shape,
hull_from_shapes(
[
- left_key_place(web_post(), cornerrow, -1),
- left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1),
+ left_key_place(web_post(), cornerrow, -1, low_corner=True),
+ left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
key_place(web_post_bl(), 0, cornerrow),
carbonfet_thumb_ml_place(thumb_post_tl()),
]
@@ -2410,7 +2469,7 @@ def screw_insert_all_shapes(bottom_radius, top_radius, height, offset=0):
print('screw_insert_all_shapes()')
shape = (
translate(screw_insert(0, 0, bottom_radius, top_radius, height), (0, 0, offset)),
- translate(screw_insert(0, lastrow-1, bottom_radius, top_radius, height), (0, 0, offset)),
+ translate(screw_insert(0, lastrow-1, bottom_radius, top_radius, height), (0, left_wall_lower_y_offset, offset)),
translate(screw_insert(3, lastrow, bottom_radius, top_radius, height), (0, 0, offset)),
translate(screw_insert(3, 0, bottom_radius, top_radius, height), (0,0, offset)),
translate(screw_insert(lastcol, 0, bottom_radius, top_radius, height), (0, 0, offset)),
@@ -2555,7 +2614,7 @@ def model_side(side="right"):
# NEEDS TO BE SPECIAL FOR CADQUERY
-def baseplate():
+def baseplate(wedge_angle=None):
if ENGINE == 'cadquery':
# shape = mod_r
shape = union([case_walls(), *screw_insert_outers()])
@@ -2594,30 +2653,32 @@ def baseplate():
inner_wire = base_wires[inner_index]
# inner_plate = cq.Workplane('XY').add(cq.Face.makeFromWires(inner_wire))
-
- inner_shape = cq.Workplane('XY').add(cq.Solid.extrudeLinear(outerWire=inner_wire, innerWires=[], vecNormal=cq.Vector(0, 0, base_thickness)))
- inner_shape = translate(inner_shape, (0, 0, -base_rim_thickness))
-
- holes = []
- for i in range(len(base_wires)):
- if i not in [inner_index, outer_index]:
- holes.append(base_wires[i])
- cutout = [*holes, inner_wire]
-
- shape = cq.Workplane('XY').add(cq.Solid.extrudeLinear(outer_wire, cutout, cq.Vector(0, 0, base_rim_thickness)))
- hole_shapes=[]
- for hole in holes:
- loc = hole.Center()
- hole_shapes.append(
- translate(
- cylinder(screw_cbore_diameter, screw_cbore_depth),
- (loc.x, loc.y, 0)
- # (loc.x, loc.y, screw_cbore_depth/2)
+ if wedge_angle is not None:
+ cq.Workplane('XY').add(cq.Solid.revolve(outerWire, innerWires, angleDegrees, axisStart, axisEnd))
+ else:
+ inner_shape = cq.Workplane('XY').add(cq.Solid.extrudeLinear(outerWire=inner_wire, innerWires=[], vecNormal=cq.Vector(0, 0, base_thickness)))
+ inner_shape = translate(inner_shape, (0, 0, -base_rim_thickness))
+
+ holes = []
+ for i in range(len(base_wires)):
+ if i not in [inner_index, outer_index]:
+ holes.append(base_wires[i])
+ cutout = [*holes, inner_wire]
+
+ shape = cq.Workplane('XY').add(cq.Solid.extrudeLinear(outer_wire, cutout, cq.Vector(0, 0, base_rim_thickness)))
+ hole_shapes=[]
+ for hole in holes:
+ loc = hole.Center()
+ hole_shapes.append(
+ translate(
+ cylinder(screw_cbore_diameter, screw_cbore_depth),
+ (loc.x, loc.y, 0)
+ # (loc.x, loc.y, screw_cbore_depth/2)
+ )
)
- )
- shape = difference(shape, hole_shapes)
- shape = translate(shape, (0, 0, -base_rim_thickness))
- shape = union([shape, inner_shape])
+ shape = difference(shape, hole_shapes)
+ shape = translate(shape, (0, 0, -base_rim_thickness))
+ shape = union([shape, inner_shape])
return shape
diff --git a/src/generate_configuration.py b/src/generate_configuration.py
index c8d9fb1..5c08b15 100644
--- a/src/generate_configuration.py
+++ b/src/generate_configuration.py
@@ -18,7 +18,7 @@ shape_config = {
'save_dir': '.',
'config_name': "DM",
- 'show_caps': False,
+ 'show_caps': True,
'nrows': 5, #5, # key rows
'ncols': 6, #6, # key columns
@@ -44,7 +44,7 @@ shape_config = {
# THUMB PARAMETERS
##############################
'thumb_style': 'DEFAULT', # 'DEFAULT', 'MINI', 'CARBONFET'
-
+ 'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U
# Thumb plate rotations, anything other than 90 degree increments WILL NOT WORK.
'thumb_plate_tr_rotation': 0.0, # Top right plate rotation tweaks as thumb cluster is crowded for hot swap, etc.
'thumb_plate_tl_rotation': 0.0, # Top left plate rotation tweaks as thumb cluster is crowded for hot swap, etc.
@@ -70,6 +70,8 @@ shape_config = {
'wall_y_offset': 6, # offset in the x and/or y direction for the first downward_sloping part of the wall (negative)
'left_wall_x_offset': 12, # specific values for the left side due to the minimal wall.
'left_wall_z_offset': 3, # specific values for the left side due to the minimal wall.
+ 'left_wall_lower_y_offset': 0, # specific values for the lower left corner.
+ 'left_wall_lower_z_offset': 0,
'wall_thickness': 4.5, # wall thickness parameter used on upper/mid stage of the wall
'wall_base_y_thickness': 4.5, # wall thickness at the lower stage
'wall_base_x_thickness': 4.5, # wall thickness at the lower stage
@@ -154,6 +156,8 @@ shape_config = {
'oled_mount_rotation_xyz': (13.0, 0.0, -6.0), # will be overwritten if oled_center_row is not None
'oled_left_wall_x_offset_override': 28.0,
'oled_left_wall_z_offset_override': 0.0,
+ 'oled_left_wall_lower_y_offset': 12.0,
+ 'oled_left_wall_lower_z_offset': 5.0,
# 'UNDERCUT' Parameters
'oled_mount_undercut': 1.0,
@@ -170,6 +174,8 @@ shape_config = {
'oled_mount_rotation_xyz': (6.0, 0.0, -3.0), # will be overwritten if oled_center_row is not None
'oled_left_wall_x_offset_override': 24.0,
'oled_left_wall_z_offset_override': 0.0,
+ 'oled_left_wall_lower_y_offset': 12.0,
+ 'oled_left_wall_lower_z_offset': 5.0,
# 'SLIDING' Parameters
'oled_thickness': 4.2, # thickness of OLED, plus clearance. Must include components
@@ -190,6 +196,8 @@ shape_config = {
'oled_mount_rotation_xyz': (12.0, 0.0, -6.0), # will be overwritten if oled_center_row is not None
'oled_left_wall_x_offset_override': 24.0,
'oled_left_wall_z_offset_override': 0.0,
+ 'oled_left_wall_lower_y_offset': 12.0,
+ 'oled_left_wall_lower_z_offset': 5.0,
# 'CLIP' Parameters
'oled_thickness': 4.2, # thickness of OLED, plus clearance. Must include components
diff --git a/src/run_config.json b/src/run_config.json
index 1017d26..7a22860 100644
--- a/src/run_config.json
+++ b/src/run_config.json
@@ -2,7 +2,7 @@
"ENGINE": "solid",
"save_dir": ".",
"config_name": "DM",
- "show_caps": false,
+ "show_caps": true,
"nrows": 5,
"ncols": 6,
"alpha": 0.26179916666666664,
@@ -20,6 +20,7 @@
],
"keyboard_z_offset": 11,
"thumb_style": "DEFAULT",
+ "default_1U_cluster": true,
"thumb_plate_tr_rotation": 0.0,
"thumb_plate_tl_rotation": 0.0,
"thumb_plate_mr_rotation": 0.0,
@@ -36,6 +37,8 @@
"wall_y_offset": 6,
"left_wall_x_offset": 12,
"left_wall_z_offset": 3,
+ "left_wall_lower_y_offset": 0,
+ "left_wall_lower_z_offset": 0,
"wall_thickness": 4.5,
"wall_base_y_thickness": 4.5,
"wall_base_x_thickness": 4.5,
@@ -117,6 +120,8 @@
],
"oled_left_wall_x_offset_override": 28.0,
"oled_left_wall_z_offset_override": 0.0,
+ "oled_left_wall_lower_y_offset": 12.0,
+ "oled_left_wall_lower_z_offset": 5.0,
"oled_mount_undercut": 1.0,
"oled_mount_undercut_thickness": 2.0
},
@@ -138,6 +143,8 @@
],
"oled_left_wall_x_offset_override": 24.0,
"oled_left_wall_z_offset_override": 0.0,
+ "oled_left_wall_lower_y_offset": 12.0,
+ "oled_left_wall_lower_z_offset": 5.0,
"oled_thickness": 4.2,
"oled_edge_overlap_end": 6.5,
"oled_edge_overlap_connector": 5.5,
@@ -163,6 +170,8 @@
],
"oled_left_wall_x_offset_override": 24.0,
"oled_left_wall_z_offset_override": 0.0,
+ "oled_left_wall_lower_y_offset": 12.0,
+ "oled_left_wall_lower_z_offset": 5.0,
"oled_thickness": 4.2,
"oled_mount_bezel_thickness": 3.5,
"oled_mount_bezel_chamfer": 2.0,