Skip to content

Commit

Permalink
Testing fix for linux geometry varying from windows geometry.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshreve committed Oct 23, 2021
1 parent d958945 commit b64d5b8
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 42 deletions.
92 changes: 61 additions & 31 deletions src/dactyl_manuform.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ def connectors():
hulls.append(triangle_hulls(places))


return union(hulls)
# return union(hulls)
return add(hulls)


############
Expand Down Expand Up @@ -937,8 +938,10 @@ def default_thumbcaps():
def default_thumb(side="right"):
print('thumb()')
shape = default_thumb_1x_layout(rotate(single_plate(side=side), (0, 0, -90)))
shape = union([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
shape = union([shape, default_thumb_15x_layout(double_plate(), plate=False)])
# shape = union([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
# shape = union([shape, default_thumb_15x_layout(double_plate(), plate=False)])
shape = add([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
shape = add([shape, default_thumb_15x_layout(double_plate(), plate=False)])
shape = difference(shape, [default_thumb_pcb_plate_cutouts()])
return shape

Expand Down Expand Up @@ -1127,7 +1130,8 @@ def default_thumb_connectors():
)
)

return union(hulls)
return add(hulls)
# return union(hulls)

############################
# MINI THUMB CLUSTER
Expand Down Expand Up @@ -1170,7 +1174,8 @@ def mini_thumb_bl_place(shape):


def mini_thumb_1x_layout(shape):
return union([
# return union([
return add([
mini_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
mini_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
mini_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
Expand All @@ -1179,7 +1184,8 @@ def mini_thumb_1x_layout(shape):


def mini_thumb_15x_layout(shape):
return union([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
# return union([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
return add([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])


def mini_thumbcaps():
Expand All @@ -1190,13 +1196,15 @@ def mini_thumbcaps():

def mini_thumb(side="right"):
shape = mini_thumb_1x_layout(single_plate(side=side))
shape = union([shape, mini_thumb_15x_layout(single_plate(side=side))])
# shape = union([shape, mini_thumb_15x_layout(single_plate(side=side))])
shape = add([shape, mini_thumb_15x_layout(single_plate(side=side))])

return shape

def mini_thumb_pcb_plate_cutouts(side="right"):
shape = mini_thumb_1x_layout(plate_pcb_cutout(side=side))
shape = union([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
# shape = union([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
shape = add([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
return shape


Expand Down Expand Up @@ -1318,7 +1326,8 @@ def mini_thumb_connectors():
)
)

return union(hulls)
# return union(hulls)
return add(hulls)


############################
Expand Down Expand Up @@ -1365,15 +1374,17 @@ def minidox_thumb_br_place(shape):


def minidox_thumb_1x_layout(shape):
return union([
# return union([
return add([
minidox_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
minidox_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
minidox_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
])


def minidox_thumb_fx_layout(shape):
return union([
# return union([
return add([
minidox_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
minidox_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
minidox_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
Expand All @@ -1388,13 +1399,15 @@ def minidox_thumbcaps():
def minidox_thumb(side="right"):

shape = minidox_thumb_fx_layout(rotate(single_plate(side=side), [0.0, 0.0, -90]))
shape = union([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
# shape = union([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
shape = add([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
# shape = minidox_thumb_1x_layout(single_plate(side=side))
return shape

def minidox_thumb_pcb_plate_cutouts(side="right"):
shape = minidox_thumb_fx_layout(plate_pcb_cutout(side=side))
shape = union([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
# shape = union([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
shape = add([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
return shape

def minidox_thumb_post_tr():
Expand Down Expand Up @@ -1475,7 +1488,8 @@ def minidox_thumb_connectors():
)
)

return union(hulls)
# return union(hulls)
return add(hulls)


############################
Expand Down Expand Up @@ -1521,7 +1535,8 @@ def carbonfet_thumb_bl_place(shape):


def carbonfet_thumb_1x_layout(shape):
return union([
# return union([
return add([
carbonfet_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
carbonfet_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
carbonfet_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
Expand All @@ -1531,12 +1546,14 @@ def carbonfet_thumb_1x_layout(shape):

def carbonfet_thumb_15x_layout(shape, plate=True):
if plate:
return union([
# return union([
return add([
carbonfet_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
carbonfet_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation]))
])
else:
return union([
# return union([
return add([
carbonfet_thumb_bl_place(shape),
carbonfet_thumb_ml_place(shape)
])
Expand All @@ -1550,14 +1567,17 @@ def carbonfet_thumbcaps():

def carbonfet_thumb(side="right"):
shape = carbonfet_thumb_1x_layout(single_plate(side=side))
shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
shape = union([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
# shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
# shape = union([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
shape = add([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
shape = add([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])

return shape

def carbonfet_thumb_pcb_plate_cutouts(side="right"):
shape = carbonfet_thumb_1x_layout(plate_pcb_cutout(side=side))
shape = union([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
# shape = union([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
shape = add([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
return shape

def carbonfet_thumb_post_tr():
Expand Down Expand Up @@ -1695,7 +1715,8 @@ def carbonfet_thumb_connectors():
)
)

return union(hulls)
# return union(hulls)
return add(hulls)


############################
Expand Down Expand Up @@ -1772,7 +1793,8 @@ def tbjs_thumb_bl_place(shape):


def tbjs_thumb_1x_layout(shape):
return union([
# return union([
return add([
tbjs_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
tbjs_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
tbjs_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
Expand All @@ -1792,7 +1814,8 @@ def tbjs_thumb_fx_layout(shape):
]

def trackball_layout(shape):
return union([
# return union([
return add([
tbjs_place(shape),
])

Expand All @@ -1808,7 +1831,8 @@ def tbjs_thumb(side="right"):
# shape = tbjs_thumb_fx_layout(rotate(single_plate(side=side), [0.0, 0.0, -90]))
shape = tbjs_thumb_1x_layout(single_plate(side=side))
# shape = tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))
shape = union([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
# shape = union([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
shape = add([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])

# shape = union([shape, trackball_layout(trackball_socket())])
# shape = tbjs_thumb_1x_layout(single_plate(side=side))
Expand Down Expand Up @@ -1957,7 +1981,8 @@ def tbjs_thumb_connectors():
)
)

return union(hulls)
# return union(hulls)
return add(hulls)



Expand Down Expand Up @@ -1994,7 +2019,8 @@ def tbcj_thumb_bl_place(shape):
return shape

def tbcj_thumb_layout(shape):
return union([
# return union([
return add([
tbcj_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
tbcj_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
tbcj_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
Expand Down Expand Up @@ -2068,7 +2094,8 @@ def tbcj_place(shape):
def tbcj_thumb(side="right"):
t = tbcj_thumb_layout(single_plate(side=side))
tb = tbcj_place(tbcj_holder())
return union([t, tb])
# return union([t, tb])
return add([t, tb])

def tbcj_thumb_pcb_plate_cutouts(side="right"):
t = tbcj_thumb_layout(plate_pcb_cutout(side=side))
Expand Down Expand Up @@ -2214,7 +2241,8 @@ def tbcj_thumb_connectors():
)
)

return union(hulls)
# return union(hulls)
return add(hulls)



Expand Down Expand Up @@ -2320,7 +2348,8 @@ def wall_brace(place1, dx1, dy1, post1, place2, dx2, dy2, post2, back=False, ske

if len(hulls)>0:
shape2 = bottom_hull(hulls)
shape1 = union([shape1, shape2])
# shape1 = union([shape1, shape2])
shape1 = add([shape1, shape2])

return shape1

Expand Down Expand Up @@ -2380,7 +2409,7 @@ def right_wall(skeleton=False):

shape = None

shape = union([shape,key_wall_brace(
shape = union([shape, key_wall_brace(
lastcol, y, 1, 0, web_post_tr(), lastcol, y, 1, 0, web_post_br(),
skeleton=skeleton,
)])
Expand Down Expand Up @@ -3896,7 +3925,8 @@ def wire_posts():

def model_side(side="right"):
print('model_right()')
shape = union([key_holes(side=side)])
shape = add([key_holes(side=side)])
# shape = union([key_holes(side=side)])
if debug_exports:
export_file(shape=shape, fname=path.join(r"..", "things", r"debug_key_plates"))
connector_shape = connectors()
Expand Down
4 changes: 2 additions & 2 deletions src/generate_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'show_caps': False,
'show_pcbs': False, #only runs if caps are shown, easist place to initially inject geometry

'nrows': 5, #5, # key rows
'nrows': 6, #5, # key rows
'ncols': 6, #6, # key columns

'alpha': pi / 12.0, # curvature of the columns
Expand Down Expand Up @@ -89,7 +89,7 @@
'thumb_plate_bl_rotation': 0.0, # Bottom right plate rotation tweaks as thumb cluster is crowded for hot swap, etc.
##############################
# EXPERIMENTAL
'separable_thumb': True, #creates a separable thumb section with additional screws to hold it down. Only attached at base.
'separable_thumb': False, #creates a separable thumb section with additional screws to hold it down. Only attached at base.
##############################

###################################
Expand Down
6 changes: 3 additions & 3 deletions src/generate_configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

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


######################
Expand All @@ -24,7 +24,7 @@
'show_caps': False,
'show_pcbs': False, #only runs if caps are shown, easist place to initially inject geometry

'nrows': 5, #5, # key rows
'nrows': 6, #5, # key rows
'ncols': 6, #6, # key columns

'alpha': pi / 12.0, # curvature of the columns
Expand Down
12 changes: 6 additions & 6 deletions src/run_config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"ENGINE": "cadquery",
"save_dir": "DM_4x5_NOTCHPLT_DEFTMB_OLED_EXTCTRL",
"config_name": "DM_4x5_NOTCHPLT_DEFTMB_OLED_EXTCTRL",
"save_dir": ".",
"config_name": "DM",
"show_caps": false,
"show_pcbs": false,
"nrows": 4,
"ncols": 5,
"nrows": 6,
"ncols": 6,
"alpha": 0.26179916666666664,
"beta": 0.08726638888888888,
"centercol": 3,
Expand All @@ -25,7 +25,7 @@
"web_thickness": 5.1,
"post_size": 0.1,
"post_adj": 0,
"thumb_style": "DEFAULT",
"thumb_style": "TRACKBALL_ORBYL",
"default_1U_cluster": true,
"minidox_Usize": 1.6,
"default_thumb_screw_xy_locations": [
Expand Down Expand Up @@ -146,7 +146,7 @@
"thumb_plate_ml_rotation": 0.0,
"thumb_plate_br_rotation": 0.0,
"thumb_plate_bl_rotation": 0.0,
"separable_thumb": true,
"separable_thumb": false,
"trackball_in_wall": false,
"tbiw_ball_center_row": 0.2,
"tbiw_translational_offset": [
Expand Down

0 comments on commit b64d5b8

Please sign in to comment.