summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Shreve <j.a.shreve@gmail.com>2021-10-29 20:55:07 -0400
committerJoshua Shreve <j.a.shreve@gmail.com>2021-10-29 20:55:07 -0400
commit01a3ff885863369e55664553b681ccb4619f498b (patch)
tree89496e8e50043e82567394870954e8a5dc7c5b4c
parent75da53f96e389d837055921bd2eb61b58b7787e2 (diff)
Added setting for constant rows across.
Works okay, may have issues with some staggers due to thumb cluster details.
-rw-r--r--src/dactyl_manuform.py92
-rw-r--r--src/generate_configuration.py6
-rw-r--r--src/generate_configuration_test.py14
3 files changed, 50 insertions, 62 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py
index 3cdf362..ca9a3c2 100644
--- a/src/dactyl_manuform.py
+++ b/src/dactyl_manuform.py
@@ -94,7 +94,10 @@ if nrows > 5:
centerrow = nrows - centerrow_offset
lastrow = nrows - 1
-cornerrow = lastrow - 1
+if reduced_outer_keys:
+ cornerrow = lastrow - 1
+else:
+ cornerrow = lastrow
lastcol = ncols - 1
@@ -507,7 +510,7 @@ def key_holes(side="right"):
holes = []
for column in range(ncols):
for row in range(nrows):
- if (column in [2, 3]) or (not row == lastrow):
+ if (column in [2, 3]) or (not row == lastrow) or (not reduced_outer_keys):
holes.append(key_place(single_plate(side=side), column, row))
shape = union(holes)
@@ -592,7 +595,7 @@ def connectors():
debugprint('connectors()')
hulls = []
for column in range(ncols - 1):
- if (column in [2]):
+ if (column in [2]) or (not reduced_outer_keys):
iterrows = lastrow+1
else:
iterrows = lastrow
@@ -606,7 +609,7 @@ def connectors():
hulls.append(triangle_hulls(places))
for column in range(ncols):
- if (column in [2, 3]):
+ if (column in [2, 3]) or (not reduced_outer_keys):
iterrows = lastrow
else:
iterrows = cornerrow
@@ -619,7 +622,7 @@ def connectors():
hulls.append(triangle_hulls(places))
for column in range(ncols - 1):
- if (column in [2]):
+ if (column in [2]) or (not reduced_outer_keys):
iterrows = lastrow
else:
iterrows = cornerrow
@@ -631,20 +634,21 @@ def connectors():
places.append(key_place(web_post_tl(), column + 1, row + 1))
hulls.append(triangle_hulls(places))
- if column == 1:
- places = []
- places.append(key_place(web_post_bl(), column + 1, iterrows))
- places.append(key_place(web_post_br(), column, iterrows))
- places.append(key_place(web_post_tl(), column + 1, iterrows + 1))
- places.append(key_place(web_post_bl(), column + 1, iterrows + 1))
- hulls.append(triangle_hulls(places))
- if column == 3:
- places = []
- places.append(key_place(web_post_br(), column, iterrows))
- places.append(key_place(web_post_bl(), column + 1, iterrows))
- places.append(key_place(web_post_tr(), column, iterrows + 1))
- places.append(key_place(web_post_br(), column, iterrows + 1))
- hulls.append(triangle_hulls(places))
+ if reduced_outer_keys:
+ if column == 1:
+ places = []
+ places.append(key_place(web_post_bl(), column + 1, iterrows))
+ places.append(key_place(web_post_br(), column, iterrows))
+ places.append(key_place(web_post_tl(), column + 1, iterrows + 1))
+ places.append(key_place(web_post_bl(), column + 1, iterrows + 1))
+ hulls.append(triangle_hulls(places))
+ if column == 3:
+ places = []
+ places.append(key_place(web_post_br(), column, iterrows))
+ places.append(key_place(web_post_bl(), column + 1, iterrows))
+ places.append(key_place(web_post_tr(), column, iterrows + 1))
+ places.append(key_place(web_post_br(), column, iterrows + 1))
+ hulls.append(triangle_hulls(places))
return union(hulls)
@@ -1352,27 +1356,6 @@ def minidox_thumb_ml_place(shape):
shape = translate(shape, [-53, -26, -12])
return shape
-def minidox_thumb_mr_place(shape):
- shape = rotate(shape, [10, -23, 25])
- shape = translate(shape, thumborigin())
- shape = translate(shape, [-23, -34, -6])
- return shape
-
-
-def minidox_thumb_bl_place(shape):
- shape = rotate(shape, [6, -32, 35])
- shape = translate(shape, thumborigin())
- shape = translate(shape, [-51, -25, -11.5])
- return shape
-
-
-def minidox_thumb_br_place(shape):
- shape = rotate(shape, [6, -32, 35])
- shape = translate(shape, thumborigin())
- shape = translate(shape, [-51, -25, -11.5])
- return shape
-
-
def minidox_thumb_1x_layout(shape):
return union([
#return add([
@@ -2416,7 +2399,7 @@ def right_wall(skeleton=False):
skeleton=skeleton,
)])
- for i in range(lastrow - 1):
+ for i in range(cornerrow):
y = i + 1
shape = union([shape, key_wall_brace(
lastcol, y - 1, 1, 0, web_post_br(), lastcol, y, 1, 0, web_post_tr(),
@@ -2453,13 +2436,14 @@ def left_wall(side='right', skeleton=False):
skeleton=skeleton,
)])
- for i in range(lastrow):
+ # for i in range(lastrow):
+ for i in range(cornerrow+1):
y = i
- low = (y == (lastrow-1))
+ low = (y == (cornerrow))
temp_shape1 = wall_brace(
(lambda sh: left_key_place(sh, y, 1, side=side)), -1, 0, web_post(),
(lambda sh: left_key_place(sh, y, -1, low_corner=low, side=side)), -1, 0, web_post(),
- skeleton=skeleton and (y < (lastrow-1)),
+ skeleton=skeleton and (y < (cornerrow)),
)
shape = union([shape, temp_shape1])
@@ -2472,13 +2456,13 @@ def left_wall(side='right', skeleton=False):
shape = union([shape, temp_shape2])
- for i in range(lastrow - 1):
+ for i in range(cornerrow):
y = i + 1
- low = (y == (lastrow-1))
+ low = (y == (cornerrow))
temp_shape1 = wall_brace(
(lambda sh: left_key_place(sh, y - 1, -1, side=side)), -1, 0, web_post(),
(lambda sh: left_key_place(sh, y, 1, side=side)), -1, 0, web_post(),
- skeleton=skeleton and (y < (lastrow - 1)),
+ skeleton=skeleton and (y < (cornerrow)),
)
shape = union([shape, temp_shape1])
@@ -2660,7 +2644,7 @@ def tbjs_thumb_connection(side='right', skeleton=False):
triangle_hulls(
[
key_place(web_post_bl(), 0, cornerrow),
- left_key_place(web_post(), lastrow - 1, -1, side=side, low_corner=True),
+ left_key_place(web_post(), cornerrow, -1, side=side, low_corner=True),
# left_key_place(translate(web_post(), wall_locate1(-1, 0)), cornerrow, -1, low_corner=True),
tbjs_place(tbjs_post_tl()),
]
@@ -2721,7 +2705,7 @@ def tbjs_thumb_walls(skeleton=False):
shape = union([shape, wall_brace(
tbjs_place, -1.5, 0, tbjs_post_tl(),
- (lambda sh: left_key_place(sh, lastrow - 1, -1, side=ball_side, low_corner=True)), -1, 0, web_post(),
+ (lambda sh: left_key_place(sh, cornerrow, -1, side=ball_side, low_corner=True)), -1, 0, web_post(),
)])
shape = union([shape, wall_brace(
tbjs_place, -1.5, 0, tbjs_post_tl(),
@@ -2918,8 +2902,8 @@ def minidox_thumb_connection(side='right', skeleton=False):
[
left_key_place(translate(web_post(), wall_locate2(-1, 0)), cornerrow, -1, low_corner=True, side=side),
left_key_place(translate(web_post(), wall_locate3(-1, 0)), cornerrow, -1, low_corner=True, side=side),
- minidox_thumb_bl_place(translate(minidox_thumb_post_tr(), wall_locate2(-0.3, 1))),
- minidox_thumb_bl_place(translate(minidox_thumb_post_tr(), wall_locate3(-0.3, 1))),
+ minidox_thumb_ml_place(translate(minidox_thumb_post_tr(), wall_locate2(-0.3, 1))),
+ minidox_thumb_ml_place(translate(minidox_thumb_post_tr(), wall_locate3(-0.3, 1))),
]
)])
@@ -3844,11 +3828,11 @@ def screw_insert_all_shapes(bottom_radius, top_radius, height, offset=0, side='r
print('screw_insert_all_shapes()')
shape = (
translate(screw_insert(0, 0, bottom_radius, top_radius, height, side=side), (0, 0, offset)),
- translate(screw_insert(0, lastrow-1, bottom_radius, top_radius, height, side=side), (0, left_wall_lower_y_offset, offset)),
+ translate(screw_insert(0, cornerrow, bottom_radius, top_radius, height, side=side), (0, left_wall_lower_y_offset, offset)),
translate(screw_insert(3, lastrow, bottom_radius, top_radius, height, side=side), (0, 0, offset)),
translate(screw_insert(3, 0, bottom_radius, top_radius, height, side=side), (0,0, offset)),
translate(screw_insert(lastcol, 0, bottom_radius, top_radius, height, side=side), (0, 0, offset)),
- translate(screw_insert(lastcol, lastrow-1, bottom_radius, top_radius, height, side=side), (0, 0, offset)),
+ translate(screw_insert(lastcol, cornerrow, bottom_radius, top_radius, height, side=side), (0, 0, offset)),
# translate(screw_insert_thumb(bottom_radius, top_radius, height), (0, 0, offset)),
)
@@ -3915,7 +3899,7 @@ def wire_posts():
shape = union([shape, default_thumb_ml_place(wire_post(1, 0).translate([5, 0, -2]))])
for column in range(lastcol):
- for row in range(lastrow - 1):
+ for row in range(cornerrow):
shape = union([
shape,
key_place(wire_post(1, 0).translate([-5, 0, 0]), column, row),
diff --git a/src/generate_configuration.py b/src/generate_configuration.py
index d22e521..024e198 100644
--- a/src/generate_configuration.py
+++ b/src/generate_configuration.py
@@ -24,8 +24,8 @@ shape_config = {
'show_caps': False,
'show_pcbs': False, #only runs if caps are shown, easist place to initially inject geometry
- 'nrows': 6, #5, # key rows
- 'ncols': 6, #6, # key columns
+ 'nrows': 5, #5, # key rows
+ 'ncols': 3, #6, # key columns
'alpha': pi / 12.0, # curvature of the columns
'beta': pi / 36.0, # curvature of the rows
@@ -38,6 +38,8 @@ shape_config = {
'column_style_gt5': "orthographic",
'column_style': "standard", # options include :standard, :orthographic, and :fixed
+ 'reduced_outer_keys': True,
+
'thumb_offsets': [6, -3, 7],
'keyboard_z_offset': (
diff --git a/src/generate_configuration_test.py b/src/generate_configuration_test.py
index c40849b..fe61709 100644
--- a/src/generate_configuration_test.py
+++ b/src/generate_configuration_test.py
@@ -10,8 +10,8 @@ r2d = 180 / pi
shape_config = {
- # 'ENGINE': 'solid', # 'solid' = solid python / OpenSCAD, 'cadquery' = cadquery / OpenCascade
- 'ENGINE': 'cadquery', # 'solid' = solid python / OpenSCAD, 'cadquery' = cadquery / OpenCascade
+ 'ENGINE': 'solid', # 'solid' = solid python / OpenSCAD, 'cadquery' = cadquery / OpenCascade
+ # 'ENGINE': 'cadquery', # 'solid' = solid python / OpenSCAD, 'cadquery' = cadquery / OpenCascade
######################
@@ -24,8 +24,8 @@ shape_config = {
'show_caps': False,
'show_pcbs': False, #only runs if caps are shown, easist place to initially inject geometry
- 'nrows': 6, #5, # key rows
- 'ncols': 6, #6, # key columns
+ 'nrows': 3, #5, # key rows
+ 'ncols': 5, #6, # key columns
'alpha': pi / 12.0, # curvature of the columns
'beta': pi / 36.0, # curvature of the rows
@@ -38,6 +38,8 @@ shape_config = {
'column_style_gt5': "orthographic",
'column_style': "standard", # options include :standard, :orthographic, and :fixed
+ 'reduced_outer_keys': True,
+
'thumb_offsets': [6, -3, 7],
'keyboard_z_offset': (
@@ -59,7 +61,7 @@ shape_config = {
##############################
# 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ'
- 'thumb_style': 'DEFAULT',
+ 'thumb_style': 'MINIDOX',
'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U
# Thumb key size. May need slight oversizing, check w/ caps. Additional spacing will be automatically added for larger keys.
'minidox_Usize': 1.6,
@@ -265,7 +267,7 @@ shape_config = {
# 'SLIDING' = Features to slide the OLED in place and use a pin or block to secure from underneath.
# 'CLIP' = Features to set the OLED in a frame a snap a bezel down to hold it in place.
- 'oled_mount_type': 'CLIP',
+ 'oled_mount_type': 'NONE',
'oled_center_row': 1.25, # if not None, this will override the oled_mount_location_xyz and oled_mount_rotation_xyz settings
'oled_translation_offset': (0, 0, 4), # Z offset tweaks are expected depending on curvature and OLED mount choice.
'oled_rotation_offset': (0, 0, 0),