diff options
author | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-29 21:07:35 -0400 |
---|---|---|
committer | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-29 21:07:35 -0400 |
commit | 8409bdb6187a6d6e7def10b7fe7bded18e546e43 (patch) | |
tree | 60ca216a1c55d64939f10b4a105c371c559f00aa | |
parent | 7bebd909e1f02ed08b02ba06de30dd53e77c4b6d (diff) |
Fixed keyswitch nubs. Error came from code consolidation between cadquery and solid python. One centered the cylinder, the other generated it in the positive Z direction. Both now fully center the cylinder and the two models generate consistently.
-rw-r--r-- | src/dactyl_manuform.py | 16 | ||||
-rw-r--r-- | src/helpers_cadquery.py | 4 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/dactyl_manuform.py b/src/dactyl_manuform.py index 55bb4ac..527d43b 100644 --- a/src/dactyl_manuform.py +++ b/src/dactyl_manuform.py @@ -173,11 +173,11 @@ def single_plate(cylinder_segments=100, side="right"): left_wall = translate(left_wall, ((lr_border / 2) + (keyswitch_width / 2), 0, plate_thickness / 2)) side_nub = cylinder(radius=1, height=2.75) - side_nub = translate(side_nub, (0, 0, -2.75 / 2.0)) side_nub = rotate(side_nub, (90, 0, 0)) side_nub = translate(side_nub, (keyswitch_width / 2, 0, 1)) + nub_cube = box(1.5, 2.75, plate_thickness) - nub_cube = translate(nub_cube, ((1.5 / 2) + (keyswitch_width / 2), 0, plate_thickness / 2)) + nub_cube = translate(nub_cube, ((1.5 / 2) + (keyswitch_width / 2), 0, plate_thickness / 2)) side_nub2 = tess_hull(shapes=(side_nub, nub_cube)) side_nub2 = union([side_nub2, side_nub, nub_cube]) @@ -1027,9 +1027,6 @@ def mini_thumbcaps(): def mini_thumb(side="right"): - - # shape = thumb_1x_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) - # shape += thumb_15x_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) shape = mini_thumb_1x_layout(single_plate(side=side)) shape = union([shape, mini_thumb_15x_layout(single_plate(side=side))]) @@ -1259,12 +1256,12 @@ def minidox_thumbcaps(): def minidox_thumb(side="right"): - shape = minidox_thumb_fx_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) + 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 += thumb_15x_layout(sl.rotate([0.0, 0.0, -90])(single_plate(side=side))) # shape = minidox_thumb_1x_layout(single_plate(side=side)) + return shape def minidox_thumb_post_tr(): @@ -1667,10 +1664,6 @@ def bottom_hull(p, height=0.001): if ENGINE == 'cadquery': shape = None for item in p: - # proj = sl.projection()(p) - # t_shape = sl.linear_extrude(height=height, twist=0, convexity=0, center=True)( - # proj - # ) vertices = [] verts = item.faces('<Z').vertices() for vert in verts.objects: @@ -2439,7 +2432,6 @@ def oled_sliding_mount_frame(): ) top_chamfer_1 = translate(top_chamfer_1, (0, 0, -oled_edge_chamfer - .05)) - # top_chamfer_1 = sl.hull()(top_chamfer_1, top_chamfer_2) top_chamfer_1 = hull_from_shapes([top_chamfer_1, top_chamfer_2]) top_chamfer_1 = translate(top_chamfer_1, ( diff --git a/src/helpers_cadquery.py b/src/helpers_cadquery.py index 44553e6..5fb3886 100644 --- a/src/helpers_cadquery.py +++ b/src/helpers_cadquery.py @@ -15,7 +15,9 @@ def box(width, height, depth): def cylinder(radius, height, segments=100): - return cq.Workplane("XY").union(cq.Solid.makeCylinder(radius=radius, height=height)) + shape = cq.Workplane("XY").union(cq.Solid.makeCylinder(radius=radius, height=height)) + shape = translate(shape, (0, 0, -height/2)) + return shape def sphere(radius): |