Compare commits
No commits in common. "f6ccde78489cac70ec468e7657d79f810a54ff1a" and "b766fc465aec8bce1834de5abf965d57113aa1e0" have entirely different histories.
f6ccde7848
...
b766fc465a
208
src/main.py
208
src/main.py
|
|
@ -1,50 +1,47 @@
|
||||||
"""
|
import datetime
|
||||||
Generate Dactyl case
|
from math import radians, sin, cos
|
||||||
"""
|
|
||||||
|
|
||||||
from math import radians, sin
|
|
||||||
from lib import *
|
from lib import *
|
||||||
from shapes import *
|
from shapes import *
|
||||||
import lib
|
import lib
|
||||||
import mat
|
import mat
|
||||||
|
|
||||||
SWITCH_THICKNESS = 1.3
|
switch_thickness = 1.3
|
||||||
SWITCH_TOP_THICKNESS = 2.8
|
switch_top_thickness = 2.8
|
||||||
WEB_THICKNESS = 3
|
web_thickness = 3
|
||||||
SWITCH_RIM_THICKNESS = 2
|
switch_rim_thickness = 2
|
||||||
|
|
||||||
POST_WIDTH = 0.5
|
post_width = 0.5
|
||||||
POST_RAD = POST_WIDTH / 2
|
post_rad = post_width / 2
|
||||||
|
|
||||||
KEYHOLE_SIZE = 13.8
|
keyhole_size = 13.8
|
||||||
KEYSWITCH_HEIGHT = 15
|
keyswitch_height = 15
|
||||||
KEYSWITCH_WIDTH = 15
|
keyswitch_width = 15
|
||||||
|
|
||||||
PLATE_OUTER_WIDTH = KEYHOLE_SIZE + SWITCH_RIM_THICKNESS * 2
|
plate_outer_width = keyhole_size + switch_rim_thickness * 2
|
||||||
|
|
||||||
MAX_NUM_ROWS = 4
|
max_num_rows = 4
|
||||||
NUM_COLS = 6
|
num_cols = 6
|
||||||
NUM_PINKY_COLUMNS = 2
|
num_pinky_columns = 2
|
||||||
|
|
||||||
cols_with_max_rows = [2, 3]
|
cols_with_max_rows = [2, 3]
|
||||||
|
|
||||||
SA_PROFILE_KEY_HEIGHT = 2
|
sa_profile_key_height = 2
|
||||||
CAP_TOP_HEIGHT = SWITCH_TOP_THICKNESS + SA_PROFILE_KEY_HEIGHT
|
cap_top_height = switch_top_thickness + sa_profile_key_height
|
||||||
|
|
||||||
# extra space between the base of keys
|
# extra space between the base of keys
|
||||||
EXTRA_HEIGHT = 3
|
extra_height = 3
|
||||||
EXTRA_WIDTH = 3
|
extra_width = 3
|
||||||
MOUNT_HEIGHT = KEYSWITCH_HEIGHT
|
mount_height = keyswitch_height
|
||||||
MOUNT_WIDTH = KEYSWITCH_WIDTH
|
mount_width = keyswitch_width
|
||||||
# use 10 for faster prototyping, 15 for real
|
# use 10 for faster prototyping, 15 for real
|
||||||
TENTING_ANGLE = 11.0
|
tenting_angle = 11.0
|
||||||
Z_OFFSET = 9.0
|
z_offset = 9.0
|
||||||
|
|
||||||
SHOULD_INCLUDE_RISERS = False
|
should_include_risers = False
|
||||||
|
|
||||||
|
|
||||||
def is_pinky(col):
|
def is_pinky(col):
|
||||||
return col >= NUM_COLS - NUM_PINKY_COLUMNS
|
return col >= num_cols - num_pinky_columns
|
||||||
|
|
||||||
|
|
||||||
# aka: alpha
|
# aka: alpha
|
||||||
|
|
@ -56,13 +53,13 @@ def row_curve_deg(col):
|
||||||
# aka: beta
|
# aka: beta
|
||||||
col_curve_deg = 4.0
|
col_curve_deg = 4.0
|
||||||
|
|
||||||
column_radius = CAP_TOP_HEIGHT + ((MOUNT_WIDTH + EXTRA_WIDTH) / 2) / sin(
|
column_radius = cap_top_height + ((mount_width + extra_width) / 2) / sin(
|
||||||
radians(col_curve_deg) / 2
|
radians(col_curve_deg) / 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def row_radius(col):
|
def row_radius(col):
|
||||||
return CAP_TOP_HEIGHT + ((MOUNT_HEIGHT + EXTRA_HEIGHT) / 2) / sin(
|
return cap_top_height + ((mount_height + extra_height) / 2) / sin(
|
||||||
radians(row_curve_deg(col)) / 2
|
radians(row_curve_deg(col)) / 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -83,13 +80,13 @@ def column_extra_transform(col):
|
||||||
|
|
||||||
def num_rows_for_col(col):
|
def num_rows_for_col(col):
|
||||||
if col in cols_with_max_rows:
|
if col in cols_with_max_rows:
|
||||||
return MAX_NUM_ROWS
|
return max_num_rows
|
||||||
else:
|
else:
|
||||||
return MAX_NUM_ROWS - 1
|
return max_num_rows - 1
|
||||||
|
|
||||||
|
|
||||||
def does_coord_exist(row, col):
|
def does_coord_exist(row, col):
|
||||||
return col >= 0 and col < NUM_COLS and row >= 0 and row < num_rows_for_col(col)
|
return col >= 0 and col < num_cols and row >= 0 and row < num_rows_for_col(col)
|
||||||
|
|
||||||
|
|
||||||
def negative(vect):
|
def negative(vect):
|
||||||
|
|
@ -105,21 +102,21 @@ def bottom_hull(shape):
|
||||||
|
|
||||||
|
|
||||||
def single_switch_fn():
|
def single_switch_fn():
|
||||||
outer_width = KEYHOLE_SIZE + SWITCH_RIM_THICKNESS * 2
|
outer_width = keyhole_size + switch_rim_thickness * 2
|
||||||
|
|
||||||
bottom_wall = cube(outer_width, SWITCH_RIM_THICKNESS, SWITCH_THICKNESS)
|
bottom_wall = cube(outer_width, switch_rim_thickness, switch_thickness)
|
||||||
top_wall = translate(0, KEYHOLE_SIZE + SWITCH_RIM_THICKNESS, 0)(bottom_wall)
|
top_wall = translate(0, keyhole_size + switch_rim_thickness, 0)(bottom_wall)
|
||||||
|
|
||||||
left_wall = cube(SWITCH_RIM_THICKNESS, outer_width, SWITCH_THICKNESS)
|
left_wall = cube(switch_rim_thickness, outer_width, switch_thickness)
|
||||||
right_wall = translate(KEYHOLE_SIZE + SWITCH_RIM_THICKNESS, 0, 0)(left_wall)
|
right_wall = translate(keyhole_size + switch_rim_thickness, 0, 0)(left_wall)
|
||||||
|
|
||||||
nub_len = 2.75
|
nub_len = 2.75
|
||||||
nub_cyl = translate(0, 0, -1)(rotate_x(90)(cylinder(1, nub_len, 30, center=True)))
|
nub_cyl = translate(0, 0, -1)(rotate_x(90)(cylinder(1, nub_len, 30, center=True)))
|
||||||
# nub_cube = translate(-SWITCH_RIM_THICKNESS / 2, 0, 0.)(cube(SWITCH_RIM_THICKNESS, nub_len, 4, center=True))
|
# nub_cube = translate(-switch_rim_thickness / 2, 0, 0.)(cube(switch_rim_thickness, nub_len, 4, center=True))
|
||||||
# left_nub = translate(SWITCH_RIM_THICKNESS, (outer_width) / 2, 0)(hull(nub_cyl, nub_cube))
|
# left_nub = translate(switch_rim_thickness, (outer_width) / 2, 0)(hull(nub_cyl, nub_cube))
|
||||||
|
|
||||||
# right_nub_cube = translate(SWITCH_RIM_THICKNESS / 2, 0, 0)(cube(SWITCH_RIM_THICKNESS, nub_len, 4, center=True))
|
# right_nub_cube = translate(switch_rim_thickness / 2, 0, 0)(cube(switch_rim_thickness, nub_len, 4, center=True))
|
||||||
# right_nub = translate(-SWITCH_RIM_THICKNESS + outer_width, (outer_width) / 2, 0)(hull(nub_cyl, right_nub_cube))
|
# right_nub = translate(-switch_rim_thickness + outer_width, (outer_width) / 2, 0)(hull(nub_cyl, right_nub_cube))
|
||||||
|
|
||||||
return translate(-outer_width / 2, -outer_width / 2, 0)(
|
return translate(-outer_width / 2, -outer_width / 2, 0)(
|
||||||
union(
|
union(
|
||||||
|
|
@ -135,8 +132,8 @@ def single_switch_fn():
|
||||||
|
|
||||||
single_switch = single_switch_fn()
|
single_switch = single_switch_fn()
|
||||||
|
|
||||||
filled_switch = translate(0, 0, SWITCH_THICKNESS / 2.0)(
|
filled_switch = translate(0, 0, switch_thickness / 2.0)(
|
||||||
cube(PLATE_OUTER_WIDTH, PLATE_OUTER_WIDTH, SWITCH_THICKNESS, center=True)
|
cube(plate_outer_width, plate_outer_width, switch_thickness, center=True)
|
||||||
)
|
)
|
||||||
|
|
||||||
sa_length = 16.5
|
sa_length = 16.5
|
||||||
|
|
@ -163,7 +160,7 @@ def sa_cap_fn():
|
||||||
top = translate(0, 0, sa_extra_height)(top)
|
top = translate(0, 0, sa_extra_height)(top)
|
||||||
|
|
||||||
return colour(220, 163, 163, 1)(
|
return colour(220, 163, 163, 1)(
|
||||||
translate(0, 0, SWITCH_TOP_THICKNESS + 1.5)(hull(bot, mid, top))
|
translate(0, 0, switch_top_thickness + 1.5)(hull(bot, mid, top))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -171,8 +168,8 @@ sa_cap = sa_cap_fn()
|
||||||
|
|
||||||
|
|
||||||
def row_cols():
|
def row_cols():
|
||||||
for row in range(MAX_NUM_ROWS):
|
for row in range(max_num_rows):
|
||||||
for col in range(NUM_COLS):
|
for col in range(num_cols):
|
||||||
if row < num_rows_for_col(col):
|
if row < num_rows_for_col(col):
|
||||||
yield (row, col)
|
yield (row, col)
|
||||||
|
|
||||||
|
|
@ -181,11 +178,11 @@ def all_of_shape(shape):
|
||||||
return [grid_position(row, col, shape) for (row, col) in row_cols()]
|
return [grid_position(row, col, shape) for (row, col) in row_cols()]
|
||||||
|
|
||||||
|
|
||||||
web_post = translate(-POST_RAD, -POST_RAD, SWITCH_THICKNESS - WEB_THICKNESS)(
|
web_post = translate(-post_rad, -post_rad, switch_thickness - web_thickness)(
|
||||||
cube(POST_WIDTH, POST_WIDTH, WEB_THICKNESS)
|
cube(post_width, post_width, web_thickness)
|
||||||
)
|
)
|
||||||
short_web_post = translate(-POST_RAD, -POST_RAD, 0)(
|
short_web_post = translate(-post_rad, -post_rad, 0)(
|
||||||
cube(POST_WIDTH, POST_WIDTH, POST_WIDTH)
|
cube(post_width, post_width, post_width)
|
||||||
)
|
)
|
||||||
|
|
||||||
SQUARE_OFFSET_IDXS = [
|
SQUARE_OFFSET_IDXS = [
|
||||||
|
|
@ -212,7 +209,7 @@ def apply_translate_square(square, shape):
|
||||||
return square_apply(square, fn)
|
return square_apply(square, fn)
|
||||||
|
|
||||||
|
|
||||||
outer_post_delta = KEYHOLE_SIZE / 2 + SWITCH_RIM_THICKNESS # - POST_RAD/2
|
outer_post_delta = keyhole_size / 2 + switch_rim_thickness # - post_rad/2
|
||||||
|
|
||||||
outer_post_translate_square = square_translater_at_offset(outer_post_delta)
|
outer_post_translate_square = square_translater_at_offset(outer_post_delta)
|
||||||
|
|
||||||
|
|
@ -224,7 +221,7 @@ web_post_bl = translate(-outer_post_delta, -outer_post_delta, 0)(web_post)
|
||||||
web_posts = apply_translate_square(outer_post_translate_square, web_post)
|
web_posts = apply_translate_square(outer_post_translate_square, web_post)
|
||||||
short_web_posts = apply_translate_square(outer_post_translate_square, short_web_post)
|
short_web_posts = apply_translate_square(outer_post_translate_square, short_web_post)
|
||||||
|
|
||||||
inner_post_delta = KEYHOLE_SIZE / 2 + POST_RAD
|
inner_post_delta = keyhole_size / 2 + post_rad
|
||||||
inner_post_translate_square = square_translater_at_offset(inner_post_delta)
|
inner_post_translate_square = square_translater_at_offset(inner_post_delta)
|
||||||
|
|
||||||
inner_web_posts = apply_translate_square(inner_post_translate_square, web_post)
|
inner_web_posts = apply_translate_square(inner_post_translate_square, web_post)
|
||||||
|
|
@ -307,8 +304,8 @@ def place_on_grid_base(row, column, domain):
|
||||||
# Column offset
|
# Column offset
|
||||||
domain.translate(*column_offset(column)),
|
domain.translate(*column_offset(column)),
|
||||||
# Misc
|
# Misc
|
||||||
domain.rotate_y(TENTING_ANGLE),
|
domain.rotate_y(tenting_angle),
|
||||||
domain.translate(0, 0, Z_OFFSET),
|
domain.translate(0, 0, z_offset),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -334,8 +331,8 @@ def connectors():
|
||||||
return hull(*posts1, *posts2)
|
return hull(*posts1, *posts2)
|
||||||
|
|
||||||
all_connectors = []
|
all_connectors = []
|
||||||
for col in range(NUM_COLS - 1):
|
for col in range(num_cols - 1):
|
||||||
for row in range(MAX_NUM_ROWS):
|
for row in range(max_num_rows):
|
||||||
if does_coord_exist(row, col) and does_coord_exist(row, col + 1):
|
if does_coord_exist(row, col) and does_coord_exist(row, col + 1):
|
||||||
if (row, col) == (0, 3):
|
if (row, col) == (0, 3):
|
||||||
right_edge = [
|
right_edge = [
|
||||||
|
|
@ -351,8 +348,8 @@ def connectors():
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for col in range(NUM_COLS):
|
for col in range(num_cols):
|
||||||
for row in range(MAX_NUM_ROWS - 1):
|
for row in range(max_num_rows - 1):
|
||||||
if does_coord_exist(row, col) and does_coord_exist(row + 1, col):
|
if does_coord_exist(row, col) and does_coord_exist(row + 1, col):
|
||||||
all_connectors.append(
|
all_connectors.append(
|
||||||
make_edge_connection(
|
make_edge_connection(
|
||||||
|
|
@ -360,7 +357,7 @@ def connectors():
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for col in range(NUM_COLS - 1):
|
for col in range(num_cols - 1):
|
||||||
row = num_rows_for_col(col) - 1
|
row = num_rows_for_col(col) - 1
|
||||||
next_col = col + 1
|
next_col = col + 1
|
||||||
next_row = num_rows_for_col(next_col) - 1
|
next_row = num_rows_for_col(next_col) - 1
|
||||||
|
|
@ -398,8 +395,8 @@ def connectors():
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
for col in range(NUM_COLS - 1):
|
for col in range(num_cols - 1):
|
||||||
for row in range(MAX_NUM_ROWS - 1):
|
for row in range(max_num_rows - 1):
|
||||||
if does_diag_exist(row, col):
|
if does_diag_exist(row, col):
|
||||||
p1 = grid_position(row, col, web_post_br)
|
p1 = grid_position(row, col, web_post_br)
|
||||||
p2 = grid_position(row + 1, col, web_post_tr)
|
p2 = grid_position(row + 1, col, web_post_tr)
|
||||||
|
|
@ -490,7 +487,7 @@ def wall_connect_from_placer(
|
||||||
|
|
||||||
shapes = []
|
shapes = []
|
||||||
|
|
||||||
if SHOULD_INCLUDE_RISERS:
|
if should_include_risers:
|
||||||
shapes.append(hull(place_fn1(post1), place_fn2(post2)))
|
shapes.append(hull(place_fn1(post1), place_fn2(post2)))
|
||||||
|
|
||||||
if connectors:
|
if connectors:
|
||||||
|
|
@ -518,15 +515,15 @@ def case_walls():
|
||||||
all_shapes = []
|
all_shapes = []
|
||||||
|
|
||||||
# Top wall
|
# Top wall
|
||||||
for col in range(0, NUM_COLS):
|
for col in range(0, num_cols):
|
||||||
all_shapes.append(wall_connect(0, col, square_idx_tl, 0, col, square_idx_tr))
|
all_shapes.append(wall_connect(0, col, square_idx_tl, 0, col, square_idx_tr))
|
||||||
for col in range(0, NUM_COLS - 1):
|
for col in range(0, num_cols - 1):
|
||||||
all_shapes.append(
|
all_shapes.append(
|
||||||
wall_connect(0, col, square_idx_tr, 0, col + 1, square_idx_tl)
|
wall_connect(0, col, square_idx_tr, 0, col + 1, square_idx_tl)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Right wall
|
# Right wall
|
||||||
max_col = NUM_COLS - 1
|
max_col = num_cols - 1
|
||||||
for row in range(0, num_rows_for_col(max_col)):
|
for row in range(0, num_rows_for_col(max_col)):
|
||||||
all_shapes.append(
|
all_shapes.append(
|
||||||
wall_connect(row, max_col, square_idx_tr, row, max_col, square_idx_br)
|
wall_connect(row, max_col, square_idx_tr, row, max_col, square_idx_br)
|
||||||
|
|
@ -548,7 +545,7 @@ def case_walls():
|
||||||
def include_wall(col):
|
def include_wall(col):
|
||||||
return col >= 2
|
return col >= 2
|
||||||
|
|
||||||
for col in range(0, NUM_COLS):
|
for col in range(0, num_cols):
|
||||||
all_shapes.append(
|
all_shapes.append(
|
||||||
wall_connect(
|
wall_connect(
|
||||||
num_rows_for_col(col) - 1,
|
num_rows_for_col(col) - 1,
|
||||||
|
|
@ -560,7 +557,7 @@ def case_walls():
|
||||||
walls=include_wall(col),
|
walls=include_wall(col),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for col in range(0, NUM_COLS - 1):
|
for col in range(0, num_cols - 1):
|
||||||
all_shapes.append(
|
all_shapes.append(
|
||||||
wall_connect(
|
wall_connect(
|
||||||
num_rows_for_col(col) - 1,
|
num_rows_for_col(col) - 1,
|
||||||
|
|
@ -987,7 +984,7 @@ def bottom_edge_at_position(row, col):
|
||||||
|
|
||||||
|
|
||||||
def bottom_edge_iterator():
|
def bottom_edge_iterator():
|
||||||
for col in range(NUM_COLS):
|
for col in range(num_cols):
|
||||||
row = num_rows_for_col(col) - 1
|
row = num_rows_for_col(col) - 1
|
||||||
|
|
||||||
yield from bottom_edge_at_position(row, col)
|
yield from bottom_edge_at_position(row, col)
|
||||||
|
|
@ -1050,68 +1047,53 @@ def screw_insert(col, row, shape, ox, oy):
|
||||||
def screw_insert_all_shapes(shape):
|
def screw_insert_all_shapes(shape):
|
||||||
return union(
|
return union(
|
||||||
screw_insert(2, 0, shape, -5.3, 5.9),
|
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, 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(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(0, 0, shape, -6.2, -8),
|
||||||
screw_insert(1, MAX_NUM_ROWS + 1, shape, -9.8, 3.4),
|
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(0, max_num_rows - 1, shape, -17.4, -2),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
TRRS_HOLDER_SIZE = [6.0, 11.0, 7.0]
|
trrs_holder_size = [6.0, 11.0, 7.0]
|
||||||
TRRS_HOLE_SIZE = [2.6, 10.0]
|
trrs_hole_size = [2.6, 10.0]
|
||||||
TRRS_HOLDER_THICKNESS = 2.5
|
trrs_holder_thickness = 2.5
|
||||||
TRRS_FRONT_THICKNESS = 1.8
|
|
||||||
|
trrs_front_thickness = 1.8
|
||||||
|
|
||||||
|
|
||||||
def trrs_key_holder_position():
|
def trrs_key_holder_position():
|
||||||
base_place = point_on_grid(0, 0, 0, KEYSWITCH_WIDTH / 2, 0)
|
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, 9.0]
|
||||||
|
|
||||||
|
|
||||||
def trrs_holder():
|
def trrs_holder():
|
||||||
shape = cube(
|
shape = cube(
|
||||||
TRRS_HOLDER_SIZE[0] + TRRS_HOLDER_THICKNESS,
|
trrs_holder_size[0] + trrs_holder_thickness,
|
||||||
TRRS_HOLDER_SIZE[1] + TRRS_FRONT_THICKNESS,
|
trrs_holder_size[1] + trrs_front_thickness,
|
||||||
TRRS_HOLDER_SIZE[2] + TRRS_HOLDER_THICKNESS * 2,
|
trrs_holder_size[2] + trrs_holder_thickness * 2,
|
||||||
)
|
)
|
||||||
|
|
||||||
placed_shape = translate(
|
placed_shape = translate(
|
||||||
-TRRS_HOLDER_SIZE[0] / 2,
|
-trrs_holder_size[0] / 2,
|
||||||
-TRRS_HOLDER_SIZE[1],
|
-trrs_holder_size[1],
|
||||||
-(TRRS_HOLDER_SIZE[2] / 2 + TRRS_HOLDER_THICKNESS),
|
-(trrs_holder_size[2] / 2 + trrs_holder_thickness),
|
||||||
)(shape)
|
)(shape)
|
||||||
|
|
||||||
return translate(*trrs_key_holder_position())(placed_shape)
|
return translate(*trrs_key_holder_position())(placed_shape)
|
||||||
|
|
||||||
|
|
||||||
def trrs_holder_hole():
|
def trrs_holder_hole():
|
||||||
x, y, z = TRRS_HOLDER_SIZE
|
rect_hole = cube(*trrs_holder_size)
|
||||||
rect_hole = cube(x, y, z)
|
|
||||||
rect_hole = translate(
|
rect_hole = translate(
|
||||||
-x / 2, -y - 1, -z / 2,
|
-trrs_holder_size[0] / 2, -trrs_holder_size[1], -trrs_holder_size[2] / 2,
|
||||||
)(rect_hole)
|
)(rect_hole)
|
||||||
|
|
||||||
rect2 = cube(x, y, z - 3)
|
cylinder_hole = cylinder(*trrs_hole_size, segments=30)
|
||||||
rect2 = translate(
|
|
||||||
-x / 2 + 5, -y - 1, -z / 3,
|
|
||||||
)(rect2)
|
|
||||||
|
|
||||||
cylinder_hole = cylinder(*TRRS_HOLE_SIZE, segments=30)
|
|
||||||
cylinder_hole = rotate_x(90)(cylinder_hole)
|
cylinder_hole = rotate_x(90)(cylinder_hole)
|
||||||
cylinder_hole = translate(0, 5, 0)(cylinder_hole)
|
cylinder_hole = translate(0, 5, 0)(cylinder_hole)
|
||||||
|
|
||||||
return translate(
|
return translate(*trrs_key_holder_position())(union(rect_hole, cylinder_hole))
|
||||||
*trrs_key_holder_position()
|
|
||||||
)(
|
|
||||||
union(
|
|
||||||
union(
|
|
||||||
rect_hole,
|
|
||||||
rect2,
|
|
||||||
),
|
|
||||||
cylinder_hole
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
usb_holder_hole_dims = [9, 8, 3.5]
|
usb_holder_hole_dims = [9, 8, 3.5]
|
||||||
|
|
@ -1119,7 +1101,7 @@ usb_holder_thickness = 0.5
|
||||||
|
|
||||||
|
|
||||||
def usb_holder_position():
|
def usb_holder_position():
|
||||||
base_place = point_on_grid(0, 0, 0, KEYSWITCH_WIDTH / 2, 0)
|
base_place = point_on_grid(0, 0, 0, keyswitch_width / 2, 0)
|
||||||
return [base_place[0] + 8, base_place[1] + 2, 4]
|
return [base_place[0] + 8, base_place[1] + 2, 4]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1199,8 +1181,8 @@ reset_switch_body_hole = place_reset_switch_shape(unplaced_reset_switch_body_hol
|
||||||
|
|
||||||
|
|
||||||
def right_shell():
|
def right_shell():
|
||||||
global SHOULD_INCLUDE_RISERS
|
global should_include_risers
|
||||||
SHOULD_INCLUDE_RISERS = True
|
should_include_risers = True
|
||||||
|
|
||||||
cover = translate(-60, 20, 0)(cube(15, 15, 20))
|
cover = translate(-60, 20, 0)(cube(15, 15, 20))
|
||||||
|
|
||||||
|
|
@ -1250,8 +1232,8 @@ def wall_shape():
|
||||||
|
|
||||||
|
|
||||||
def model_outline():
|
def model_outline():
|
||||||
global SHOULD_INCLUDE_RISERS
|
global should_include_risers
|
||||||
SHOULD_INCLUDE_RISERS = True
|
should_include_risers = True
|
||||||
|
|
||||||
solid_bottom = project()(
|
solid_bottom = project()(
|
||||||
union(
|
union(
|
||||||
|
|
@ -1292,7 +1274,7 @@ def place_weight_hole(x, y):
|
||||||
def bottom_weight_cutouts():
|
def bottom_weight_cutouts():
|
||||||
shapes = []
|
shapes = []
|
||||||
|
|
||||||
base_point = point_on_grid(0, NUM_COLS - 1, 0, 0, 0)
|
base_point = point_on_grid(0, num_cols - 1, 0, 0, 0)
|
||||||
base_x = base_point[0] - 9
|
base_x = base_point[0] - 9
|
||||||
base_y = base_point[1] - 4
|
base_y = base_point[1] - 4
|
||||||
|
|
||||||
|
|
@ -1353,7 +1335,7 @@ def bottom_plate():
|
||||||
cylinderr1r2(screw_hole_radius, screw_hole_radius, bottom_height)
|
cylinderr1r2(screw_hole_radius, screw_hole_radius, bottom_height)
|
||||||
),
|
),
|
||||||
# bottom_weight_cutouts(),
|
# bottom_weight_cutouts(),
|
||||||
reset_switch_body_hole,
|
# reset_switch_body_hole,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1363,8 +1345,8 @@ def left_bottom_plate():
|
||||||
|
|
||||||
|
|
||||||
def thumb_corner():
|
def thumb_corner():
|
||||||
global SHOULD_INCLUDE_RISERS
|
global should_include_risers
|
||||||
SHOULD_INCLUDE_RISERS = False
|
should_include_risers = False
|
||||||
return difference(
|
return difference(
|
||||||
union(
|
union(
|
||||||
thumb_switches(),
|
thumb_switches(),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by SolidPython 0.4.8 on 2024-09-06 14:03:09
|
// Generated by SolidPython 0.4.8 on 2024-09-05 11:44:27
|
||||||
|
|
||||||
|
|
||||||
mirror(v = [-1, 0, 0]) {
|
mirror(v = [-1, 0, 0]) {
|
||||||
|
|
@ -16302,13 +16302,8 @@ mirror(v = [-1, 0, 0]) {
|
||||||
}
|
}
|
||||||
translate(v = [-55.537912117550164, 27.807955392906404, 9.0000000000]) {
|
translate(v = [-55.537912117550164, 27.807955392906404, 9.0000000000]) {
|
||||||
union() {
|
union() {
|
||||||
union() {
|
translate(v = [-3.0000000000, -11.0000000000, -3.5000000000]) {
|
||||||
translate(v = [-3.0000000000, -12.0000000000, -3.5000000000]) {
|
cube(size = [6.0000000000, 11.0000000000, 7.0000000000]);
|
||||||
cube(size = [6.0000000000, 11.0000000000, 7.0000000000]);
|
|
||||||
}
|
|
||||||
translate(v = [2.0000000000, -12.0000000000, -2.3333333333]) {
|
|
||||||
cube(size = [6.0000000000, 11.0000000000, 4.0000000000]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
translate(v = [0, 5, 0]) {
|
translate(v = [0, 5, 0]) {
|
||||||
rotate(a = 90, v = [1, 0, 0]) {
|
rotate(a = 90, v = [1, 0, 0]) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by SolidPython 0.4.8 on 2024-09-06 14:03:10
|
// Generated by SolidPython 0.4.8 on 2024-09-05 11:44:27
|
||||||
|
|
||||||
|
|
||||||
mirror(v = [-1, 0, 0]) {
|
mirror(v = [-1, 0, 0]) {
|
||||||
|
|
@ -25859,16 +25859,6 @@ mirror(v = [-1, 0, 0]) {
|
||||||
cylinder($fn = 18, h = 2, r1 = 1.7000000000, r2 = 1.7000000000);
|
cylinder($fn = 18, h = 2, r1 = 1.7000000000, r2 = 1.7000000000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
translate(v = [-35.39899073705581, 0.0, 0]) {
|
|
||||||
union() {
|
|
||||||
translate(v = [0, -2.5000000000, 4.1000000000]) {
|
|
||||||
cube(center = true, size = [6.2000000000, 6.5000000000, 4.2000000000]);
|
|
||||||
}
|
|
||||||
translate(v = [0, -2.5000000000, 1.0000000000]) {
|
|
||||||
cylinder($fn = 18, center = true, h = 2, r = 2.1500000000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by SolidPython 0.4.8 on 2024-09-06 14:03:09
|
// Generated by SolidPython 0.4.8 on 2024-09-05 11:44:27
|
||||||
|
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
|
|
@ -16301,13 +16301,8 @@ difference() {
|
||||||
}
|
}
|
||||||
translate(v = [-55.537912117550164, 27.807955392906404, 9.0000000000]) {
|
translate(v = [-55.537912117550164, 27.807955392906404, 9.0000000000]) {
|
||||||
union() {
|
union() {
|
||||||
union() {
|
translate(v = [-3.0000000000, -11.0000000000, -3.5000000000]) {
|
||||||
translate(v = [-3.0000000000, -12.0000000000, -3.5000000000]) {
|
cube(size = [6.0000000000, 11.0000000000, 7.0000000000]);
|
||||||
cube(size = [6.0000000000, 11.0000000000, 7.0000000000]);
|
|
||||||
}
|
|
||||||
translate(v = [2.0000000000, -12.0000000000, -2.3333333333]) {
|
|
||||||
cube(size = [6.0000000000, 11.0000000000, 4.0000000000]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
translate(v = [0, 5, 0]) {
|
translate(v = [0, 5, 0]) {
|
||||||
rotate(a = 90, v = [1, 0, 0]) {
|
rotate(a = 90, v = [1, 0, 0]) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by SolidPython 0.4.8 on 2024-09-06 14:03:09
|
// Generated by SolidPython 0.4.8 on 2024-09-05 11:44:27
|
||||||
|
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
|
|
@ -25858,16 +25858,6 @@ difference() {
|
||||||
cylinder($fn = 18, h = 2, r1 = 1.7000000000, r2 = 1.7000000000);
|
cylinder($fn = 18, h = 2, r1 = 1.7000000000, r2 = 1.7000000000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
translate(v = [-35.39899073705581, 0.0, 0]) {
|
|
||||||
union() {
|
|
||||||
translate(v = [0, -2.5000000000, 4.1000000000]) {
|
|
||||||
cube(center = true, size = [6.2000000000, 6.5000000000, 4.2000000000]);
|
|
||||||
}
|
|
||||||
translate(v = [0, -2.5000000000, 1.0000000000]) {
|
|
||||||
cylinder($fn = 18, center = true, h = 2, r = 2.1500000000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/***********************************************
|
/***********************************************
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue