Skip to content

Commit

Permalink
Minor wall correction. Minor directory fix with openscad imports.
Browse files Browse the repository at this point in the history
Need to prioritize trackball geometry generation.  OS and workflow path differences are causing import issues with OpenSCAD as it imports from the scad file ion OpenSCAD not during generation.
  • Loading branch information
joshreve committed Nov 15, 2021
1 parent 01a3ff8 commit e0f6c67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
31 changes: 23 additions & 8 deletions src/dactyl_manuform.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def rad2deg(rad: float) -> float:
####################################################


debug_exports = False
debug_exports = False
debug_trace = False

def debugprint(info):
Expand Down Expand Up @@ -2486,15 +2486,19 @@ def front_wall(skeleton=False):
3, lastrow, 0, -1, web_post_bl(), 3, lastrow, 0.5, -1, web_post_br()
)])
shape = union([shape,key_wall_brace(
3, lastrow, 0.5, -1, web_post_br(), 4, cornerrow, 1, -1, web_post_bl()
3, lastrow, 0.5, -1, web_post_br(), 4, cornerrow, .5, -1, web_post_bl()
)])
for i in range(ncols - 4):
x = i + 4
shape = union([shape,key_wall_brace(
4, cornerrow, .5, -1, web_post_bl(), 4, cornerrow, 0, -1, web_post_br()
)])

for i in range(ncols - 5):
x = i + 5

shape = union([shape,key_wall_brace(
x, cornerrow, 0, -1, web_post_bl(), x, cornerrow, 0, -1, web_post_br()
)])
for i in range(ncols - 5):
x = i + 5

shape = union([shape, key_wall_brace(
x, cornerrow, 0, -1, web_post_bl(), x - 1, cornerrow, 0, -1, web_post_br()
)])
Expand Down Expand Up @@ -4013,12 +4017,21 @@ def model_side(side="right"):

has_trackball = False
if ('TRACKBALL' in thumb_style) and (side == ball_side or ball_side == 'both'):
print("Has Trackball")
tbprecut, tb, tbcutout, sensor, ball = generate_trackball_in_cluster()
has_trackball = True
thumb_section = difference(thumb_section, [tbprecut])
if debug_exports:
export_file(shape=thumb_section, fname=path.join(r"..", "things", r"debug_thumb_test_1_shape".format(side)))
thumb_section = union([thumb_section, tb])
if debug_exports:
export_file(shape=thumb_section, fname=path.join(r"..", "things", r"debug_thumb_test_2_shape".format(side)))
thumb_section = difference(thumb_section, [tbcutout])
if debug_exports:
export_file(shape=thumb_section, fname=path.join(r"..", "things", r"debug_thumb_test_3_shape".format(side)))
thumb_section = union([thumb_section, sensor])
if debug_exports:
export_file(shape=thumb_section, fname=path.join(r"..", "things", r"debug_thumb_test_4_shape".format(side)))

if plate_pcb_clear:
thumb_section = difference(thumb_section, [thumb_pcb_plate_cutouts(side=side)])
Expand All @@ -4027,8 +4040,8 @@ def model_side(side="right"):
block = translate(block, (0, 0, -20))
main_shape = difference(main_shape, [block])
thumb_section = difference(thumb_section, [block])


if debug_exports:
export_file(shape=thumb_section, fname=path.join(r"..", "things", r"debug_thumb_test_5_shape".format(side)))

if separable_thumb:
thumb_section = difference(thumb_section, [main_shape])
Expand All @@ -4038,6 +4051,8 @@ def model_side(side="right"):
thumb_section = add([thumb_section, ball])
else:
main_shape = union([main_shape, thumb_section])
if debug_exports:
export_file(shape=main_shape, fname=path.join(r"..", "things", r"debug_thumb_test_6_shape".format(side)))
if show_caps:
main_shape = add([main_shape, thumbcaps(side=side)])
if has_trackball:
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 @@ -24,8 +24,8 @@
'show_caps': False,
'show_pcbs': False, #only runs if caps are shown, easist place to initially inject geometry

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

'alpha': pi / 12.0, # curvature of the columns
'beta': pi / 36.0, # curvature of the rows
Expand Down Expand Up @@ -61,7 +61,7 @@
##############################

# 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ'
'thumb_style': 'MINIDOX',
'thumb_style': 'CARBONFET',
'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,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers_solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def extrude_poly(outer_poly, inner_polys=None, height=1):

def import_file(fname, convexity=2):
print("IMPORTING FROM {}".format(fname))
return sl.import_stl(fname + ".stl", convexity=convexity)
return sl.import_stl(fname.replace("\\", "/") + ".stl", convexity=convexity)


def export_file(shape, fname):
Expand Down

0 comments on commit e0f6c67

Please sign in to comment.