Skip to content

Commit 75da53f

Browse files
committed
Fixed cadquery package requirement.
Reverted the geometry generation that was compensating for the wrong cadquery version. Uncertain why the versions were dramatically different, will have to watch carefully on new releases or considering switching environment to a specific version of cadquery instead of "master".
1 parent 37cd60e commit 75da53f

File tree

4 files changed

+82
-69
lines changed

4 files changed

+82
-69
lines changed

docker/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ dependencies:
2525
- pip
2626
- numpy=1
2727
- scipy=1
28-
- cadquery
28+
- cadquery=master
2929
- pip:
3030
- solidpython

src/dactyl_manuform.py

Lines changed: 78 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,8 @@ def connectors():
647647
hulls.append(triangle_hulls(places))
648648

649649

650-
# return union(hulls)
651-
return add(hulls)
650+
return union(hulls)
651+
#return add(hulls)
652652

653653

654654
############
@@ -938,10 +938,10 @@ def default_thumbcaps():
938938
def default_thumb(side="right"):
939939
print('thumb()')
940940
shape = default_thumb_1x_layout(rotate(single_plate(side=side), (0, 0, -90)))
941-
# shape = union([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
942-
# shape = union([shape, default_thumb_15x_layout(double_plate(), plate=False)])
943-
shape = add([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
944-
shape = add([shape, default_thumb_15x_layout(double_plate(), plate=False)])
941+
shape = union([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
942+
shape = union([shape, default_thumb_15x_layout(double_plate(), plate=False)])
943+
#shape = add([shape, default_thumb_15x_layout(rotate(single_plate(side=side), (0, 0, -90)))])
944+
#shape = add([shape, default_thumb_15x_layout(double_plate(), plate=False)])
945945
shape = difference(shape, [default_thumb_pcb_plate_cutouts()])
946946
return shape
947947

@@ -1130,8 +1130,8 @@ def default_thumb_connectors():
11301130
)
11311131
)
11321132

1133-
return add(hulls)
1134-
# return union(hulls)
1133+
#return add(hulls)
1134+
return union(hulls)
11351135

11361136
############################
11371137
# MINI THUMB CLUSTER
@@ -1174,8 +1174,8 @@ def mini_thumb_bl_place(shape):
11741174

11751175

11761176
def mini_thumb_1x_layout(shape):
1177-
# return union([
1178-
return add([
1177+
return union([
1178+
#return add([
11791179
mini_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
11801180
mini_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
11811181
mini_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
@@ -1184,8 +1184,8 @@ def mini_thumb_1x_layout(shape):
11841184

11851185

11861186
def mini_thumb_15x_layout(shape):
1187-
# return union([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
1188-
return add([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
1187+
return union([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
1188+
#return add([mini_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation]))])
11891189

11901190

11911191
def mini_thumbcaps():
@@ -1196,15 +1196,15 @@ def mini_thumbcaps():
11961196

11971197
def mini_thumb(side="right"):
11981198
shape = mini_thumb_1x_layout(single_plate(side=side))
1199-
# shape = union([shape, mini_thumb_15x_layout(single_plate(side=side))])
1200-
shape = add([shape, mini_thumb_15x_layout(single_plate(side=side))])
1199+
shape = union([shape, mini_thumb_15x_layout(single_plate(side=side))])
1200+
#shape = add([shape, mini_thumb_15x_layout(single_plate(side=side))])
12011201

12021202
return shape
12031203

12041204
def mini_thumb_pcb_plate_cutouts(side="right"):
12051205
shape = mini_thumb_1x_layout(plate_pcb_cutout(side=side))
1206-
# shape = union([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
1207-
shape = add([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
1206+
shape = union([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
1207+
#shape = add([shape, mini_thumb_15x_layout(plate_pcb_cutout(side=side))])
12081208
return shape
12091209

12101210

@@ -1326,8 +1326,8 @@ def mini_thumb_connectors():
13261326
)
13271327
)
13281328

1329-
# return union(hulls)
1330-
return add(hulls)
1329+
return union(hulls)
1330+
#return add(hulls)
13311331

13321332

13331333
############################
@@ -1374,17 +1374,17 @@ def minidox_thumb_br_place(shape):
13741374

13751375

13761376
def minidox_thumb_1x_layout(shape):
1377-
# return union([
1378-
return add([
1377+
return union([
1378+
#return add([
13791379
minidox_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
13801380
minidox_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
13811381
minidox_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
13821382
])
13831383

13841384

13851385
def minidox_thumb_fx_layout(shape):
1386-
# return union([
1387-
return add([
1386+
return union([
1387+
#return add([
13881388
minidox_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
13891389
minidox_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
13901390
minidox_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
@@ -1399,15 +1399,15 @@ def minidox_thumbcaps():
13991399
def minidox_thumb(side="right"):
14001400

14011401
shape = minidox_thumb_fx_layout(rotate(single_plate(side=side), [0.0, 0.0, -90]))
1402-
# shape = union([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
1403-
shape = add([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
1402+
shape = union([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
1403+
#shape = add([shape, minidox_thumb_fx_layout(adjustable_plate(minidox_Usize))])
14041404
# shape = minidox_thumb_1x_layout(single_plate(side=side))
14051405
return shape
14061406

14071407
def minidox_thumb_pcb_plate_cutouts(side="right"):
14081408
shape = minidox_thumb_fx_layout(plate_pcb_cutout(side=side))
1409-
# shape = union([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
1410-
shape = add([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
1409+
shape = union([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
1410+
#shape = add([shape, minidox_thumb_fx_layout(plate_pcb_cutout())])
14111411
return shape
14121412

14131413
def minidox_thumb_post_tr():
@@ -1488,8 +1488,8 @@ def minidox_thumb_connectors():
14881488
)
14891489
)
14901490

1491-
# return union(hulls)
1492-
return add(hulls)
1491+
return union(hulls)
1492+
#return add(hulls)
14931493

14941494

14951495
############################
@@ -1535,8 +1535,8 @@ def carbonfet_thumb_bl_place(shape):
15351535

15361536

15371537
def carbonfet_thumb_1x_layout(shape):
1538-
# return union([
1539-
return add([
1538+
return union([
1539+
#return add([
15401540
carbonfet_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
15411541
carbonfet_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
15421542
carbonfet_thumb_br_place(rotate(shape, [0, 0, thumb_plate_br_rotation])),
@@ -1546,14 +1546,14 @@ def carbonfet_thumb_1x_layout(shape):
15461546

15471547
def carbonfet_thumb_15x_layout(shape, plate=True):
15481548
if plate:
1549-
# return union([
1550-
return add([
1549+
return union([
1550+
#return add([
15511551
carbonfet_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
15521552
carbonfet_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation]))
15531553
])
15541554
else:
1555-
# return union([
1556-
return add([
1555+
return union([
1556+
#return add([
15571557
carbonfet_thumb_bl_place(shape),
15581558
carbonfet_thumb_ml_place(shape)
15591559
])
@@ -1567,17 +1567,17 @@ def carbonfet_thumbcaps():
15671567

15681568
def carbonfet_thumb(side="right"):
15691569
shape = carbonfet_thumb_1x_layout(single_plate(side=side))
1570-
# shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
1571-
# shape = union([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
1572-
shape = add([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
1573-
shape = add([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
1570+
shape = union([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
1571+
shape = union([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
1572+
#shape = add([shape, carbonfet_thumb_15x_layout(double_plate_half(), plate=False)])
1573+
#shape = add([shape, carbonfet_thumb_15x_layout(single_plate(side=side))])
15741574

15751575
return shape
15761576

15771577
def carbonfet_thumb_pcb_plate_cutouts(side="right"):
15781578
shape = carbonfet_thumb_1x_layout(plate_pcb_cutout(side=side))
1579-
# shape = union([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
1580-
shape = add([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
1579+
shape = union([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
1580+
#shape = add([shape, carbonfet_thumb_15x_layout(plate_pcb_cutout())])
15811581
return shape
15821582

15831583
def carbonfet_thumb_post_tr():
@@ -1715,8 +1715,8 @@ def carbonfet_thumb_connectors():
17151715
)
17161716
)
17171717

1718-
# return union(hulls)
1719-
return add(hulls)
1718+
return union(hulls)
1719+
#return add(hulls)
17201720

17211721

17221722
############################
@@ -1793,8 +1793,8 @@ def tbjs_thumb_bl_place(shape):
17931793

17941794

17951795
def tbjs_thumb_1x_layout(shape):
1796-
# return union([
1797-
return add([
1796+
return union([
1797+
#return add([
17981798
tbjs_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
17991799
tbjs_thumb_mr_place(rotate(shape, [0, 0, thumb_plate_mr_rotation])),
18001800
tbjs_thumb_bl_place(rotate(shape, [0, 0, thumb_plate_bl_rotation])),
@@ -1814,8 +1814,8 @@ def tbjs_thumb_fx_layout(shape):
18141814
]
18151815

18161816
def trackball_layout(shape):
1817-
# return union([
1818-
return add([
1817+
return union([
1818+
#return add([
18191819
tbjs_place(shape),
18201820
])
18211821

@@ -1831,8 +1831,8 @@ def tbjs_thumb(side="right"):
18311831
# shape = tbjs_thumb_fx_layout(rotate(single_plate(side=side), [0.0, 0.0, -90]))
18321832
shape = tbjs_thumb_1x_layout(single_plate(side=side))
18331833
# shape = tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))
1834-
# shape = union([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
1835-
shape = add([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
1834+
shape = union([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
1835+
#shape = add([shape, *tbjs_thumb_fx_layout(adjustable_square_plate(Uwidth=tbjs_Uwidth, Uheight=tbjs_Uheight))])
18361836

18371837
# shape = union([shape, trackball_layout(trackball_socket())])
18381838
# shape = tbjs_thumb_1x_layout(single_plate(side=side))
@@ -1981,8 +1981,8 @@ def tbjs_thumb_connectors():
19811981
)
19821982
)
19831983

1984-
# return union(hulls)
1985-
return add(hulls)
1984+
return union(hulls)
1985+
#return add(hulls)
19861986

19871987

19881988

@@ -2019,8 +2019,8 @@ def tbcj_thumb_bl_place(shape):
20192019
return shape
20202020

20212021
def tbcj_thumb_layout(shape):
2022-
# return union([
2023-
return add([
2022+
return union([
2023+
#return add([
20242024
tbcj_thumb_tr_place(rotate(shape, [0, 0, thumb_plate_tr_rotation])),
20252025
tbcj_thumb_tl_place(rotate(shape, [0, 0, thumb_plate_tl_rotation])),
20262026
tbcj_thumb_ml_place(rotate(shape, [0, 0, thumb_plate_ml_rotation])),
@@ -2094,8 +2094,8 @@ def tbcj_place(shape):
20942094
def tbcj_thumb(side="right"):
20952095
t = tbcj_thumb_layout(single_plate(side=side))
20962096
tb = tbcj_place(tbcj_holder())
2097-
# return union([t, tb])
2098-
return add([t, tb])
2097+
return union([t, tb])
2098+
#return add([t, tb])
20992099

21002100
def tbcj_thumb_pcb_plate_cutouts(side="right"):
21012101
t = tbcj_thumb_layout(plate_pcb_cutout(side=side))
@@ -2241,8 +2241,8 @@ def tbcj_thumb_connectors():
22412241
)
22422242
)
22432243

2244-
# return union(hulls)
2245-
return add(hulls)
2244+
return union(hulls)
2245+
#return add(hulls)
22462246

22472247

22482248

@@ -2341,15 +2341,17 @@ def wall_brace(place1, dx1, dy1, post1, place2, dx2, dy2, post2, back=False, ske
23412341
hulls = []
23422342
if not skeleton:
23432343
hulls.append(place1(translate(post1, wall_locate2(dx1, dy1))))
2344-
hulls.append(place2(translate(post2, wall_locate2(dx2, dy2))))
23452344
if not skeleton or skel_bottom:
23462345
hulls.append(place1(translate(post1, wall_locate3(dx1, dy1, back))))
2346+
if not skeleton:
2347+
hulls.append(place2(translate(post2, wall_locate2(dx2, dy2))))
2348+
if not skeleton or skel_bottom:
23472349
hulls.append(place2(translate(post2, wall_locate3(dx2, dy2, back))))
23482350

23492351
if len(hulls)>0:
23502352
shape2 = bottom_hull(hulls)
2351-
# shape1 = union([shape1, shape2])
2352-
shape1 = add([shape1, shape2])
2353+
shape1 = union([shape1, shape2])
2354+
#shape1 = add([shape1, shape2])
23532355

23542356
return shape1
23552357

@@ -3925,8 +3927,8 @@ def wire_posts():
39253927

39263928
def model_side(side="right"):
39273929
print('model_right()')
3928-
shape = add([key_holes(side=side)])
3929-
# shape = union([key_holes(side=side)])
3930+
#shape = add([key_holes(side=side)])
3931+
shape = union([key_holes(side=side)])
39303932
if debug_exports:
39313933
export_file(shape=shape, fname=path.join(r"..", "things", r"debug_key_plates"))
39323934
connector_shape = connectors()
@@ -4087,16 +4089,25 @@ def model_side(side="right"):
40874089

40884090

40894091
# NEEDS TO BE SPECIAL FOR CADQUERY
4092+
#def baseplate(main_shape, base_shape, wedge_angle=None, side='right'):
40904093
def baseplate(wedge_angle=None, side='right'):
40914094
if ENGINE == 'cadquery':
40924095
# shape = mod_r
4096+
4097+
4098+
thumb_shape = thumb(side=side)
4099+
thumb_wall_shape = thumb_walls(side=side, skeleton=skeletal)
4100+
thumb_wall_shape = union([thumb_wall_shape, *thumb_screw_insert_outers(side=side)])
4101+
thumb_connector_shape = thumb_connectors(side=side)
4102+
thumb_connection_shape = thumb_connection(side=side, skeleton=skeletal)
4103+
thumb_section = union([thumb_shape, thumb_connector_shape, thumb_wall_shape, thumb_connection_shape])
4104+
thumb_section = difference(thumb_section, [union(thumb_screw_insert_holes(side=side))])
4105+
40934106
shape = union([
40944107
case_walls(side=side),
40954108
*screw_insert_outers(side=side),
4096-
thumb_walls(side=side),
4097-
*thumb_screw_insert_outers(side=side),
4109+
thumb_section
40984110
])
4099-
# tool = translate(screw_insert_screw_holes(side=side), [0, 0, -10])
41004111
tool = screw_insert_all_shapes(screw_hole_diameter/2., screw_hole_diameter/2., 350, side=side)
41014112
for item in tool:
41024113
item = translate(item, [0, 0, -10])
@@ -4107,7 +4118,7 @@ def baseplate(wedge_angle=None, side='right'):
41074118
item = translate(item, [0, 0, -10])
41084119
shape = difference(shape, [item])
41094120

4110-
4121+
#shape = union([main_shape, thumb_shape])
41114122

41124123
shape = translate(shape, (0, 0, -0.0001))
41134124

@@ -4191,6 +4202,7 @@ def run():
41914202
export_file(shape=mod_r, fname=path.join(save_path, config_name + r"_right"))
41924203
export_file(shape=tmb_r, fname=path.join(save_path, config_name + r"_thumb_right"))
41934204

4205+
#base = baseplate(mod_r, tmb_r, side='right')
41944206
base = baseplate(side='right')
41954207
export_file(shape=base, fname=path.join(save_path, config_name + r"_right_plate"))
41964208
export_dxf(shape=base, fname=path.join(save_path, config_name + r"_right_plate"))
@@ -4200,6 +4212,7 @@ def run():
42004212
export_file(shape=mod_l, fname=path.join(save_path, config_name + r"_left"))
42014213
export_file(shape=tmb_l, fname=path.join(save_path, config_name + r"_thumb_left"))
42024214

4215+
#base_l = mirror(baseplate(mod_l, tmb_l, side='left'), 'YZ')
42034216
base_l = mirror(baseplate(side='left'), 'YZ')
42044217
export_file(shape=base_l, fname=path.join(save_path, config_name + r"_left_plate"))
42054218
export_dxf(shape=base_l, fname=path.join(save_path, config_name + r"_left_plate"))

src/generate_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
##############################
6060

6161
# 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ'
62-
'thumb_style': 'TRACKBALL_ORBYL',
62+
'thumb_style': 'DEFAULT',
6363
'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U
6464
# Thumb key size. May need slight oversizing, check w/ caps. Additional spacing will be automatically added for larger keys.
6565
'minidox_Usize': 1.6,
@@ -501,4 +501,4 @@ def save_config():
501501

502502
## HERE FOR QUICK TESTING, SHOULD BE COMMENTED ON COMMIT
503503
# from dactyl_manuform import *
504-
# run()
504+
# run()

0 commit comments

Comments
 (0)