diff options
| author | s-ol <s+removethis@s-ol.nu> | 2022-11-19 11:21:59 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2022-12-06 20:45:39 +0000 |
| commit | 01d73648b750f6356aceb9d0f7d59489edf9fc95 (patch) | |
| tree | 59927200540d34a324ec34f74db793cad7e99389 /case/case.py | |
| parent | case: add "template" svg output (diff) | |
| download | hardware-alu-case.tar.gz hardware-alu-case.zip | |
aluminum case optionalu-case
Diffstat (limited to 'case/case.py')
| -rw-r--r-- | case/case.py | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/case/case.py b/case/case.py index cb49f0a..9311581 100644 --- a/case/case.py +++ b/case/case.py @@ -74,11 +74,10 @@ top_thick = 1.3 top_space = switch_sit - top_thick pcb_thick = 1.6 bottom_space = 2 -bottom_thick = 3 -oled_thick = 6.05 +bottom_thick = 3 -feet_d = 11 +feet_d = 10.5 def shape2points(shape): lines = shape.strip('\n').split('\n') @@ -171,7 +170,12 @@ def make_plate( '''))) gap = 0.25 - cover_thick = oled_thick + gap + 1.5 - top_thick - top_space + cover_inner_h = 6 + cover_top_thick = 1.5 + cover_h = cover_inner_h + cover_top_thick + + cover_inner_h -= top_space+top_thick + cover_h -= top_space+top_thick cover = ( cq.Workplane("XY") @@ -196,11 +200,14 @@ def make_plate( .wires() .toPending() .offset2D(-gap, kind='intersection') - .extrude(cover_thick, combine=False) - + .extrude(cover_h, combine=False) + # fillets .edges('|Z') - .fillet(fillet) + .filletChamferComp(fillet, 0.5) + + .edges('>Z and %Line') + .chamfer(0.5) ) if 'oled_cutout' in kwargs: @@ -216,7 +223,7 @@ def make_plate( .edges('|Z') .fillet(cutout['fillet']) - .edges(get_box_selector(pt=(cutout['pos'][0], cutout['pos'][1], cover_thick), dp=(cutout['h']+1, cutout['w']+1, 1))) + .edges(get_box_selector(pt=(cutout['pos'][0], cutout['pos'][1], cover_h), dp=(cutout['h']+1, cutout['w']+1, 1))) .chamfer(cutout['chamfer']) ) @@ -230,7 +237,7 @@ def make_plate( .rect(13.5, 2.5*spacing) .moveTo(*gridpos((16, 5), oy=4.3, ox=2)) .rect(13.5, 2.2*spacing + 4) - .cutBlind(cover_thick - 1.5) + .cutBlind(cover_inner_h) .edges('|Z') .fillet(0.7) @@ -242,7 +249,7 @@ def make_plate( (-99.5 - 5, 127.8), ]) .rect(11, 5 + 0.35) - .cutBlind(5 + 0.35 - top_thick - top_space) + .cutBlind(5 + 0.15 - top_thick - top_space) # mounting holes .faces('>Z') @@ -442,10 +449,13 @@ def make_plate( .edges('|Z') .fillet(0.7) + + .edges('#Z') + .chamfer(0.5) # reset cutout .moveTo(-82.8, 164) - .circle(5/2) + .circle(2/2) .cutThruAll() ) @@ -479,11 +489,12 @@ def make_plate( cq.Workplane("XY") .moveTo(25.603341 - 126, 245.209203 - 26) .rect(10, 9.2 + 0.5) - .extrude(bottom_thick) + .extrude(3.4) .edges('Z') .fillet(2) .rotate((25.603341 - 126, 245.209203 - 26, 0), (25.603341 - 126, 245.209203 - 26, 1), -30) + .translate((0, 0, bottom_space + bottom_thick - 3.4)) ) plate_final = ( @@ -568,12 +579,6 @@ X X X X X X X X X X X X .moveTo(-4.5*size, 11.5*spacing) .rect(2*size, spacing) .extrude(1) - - # thicken top right corner - # thicken bottom right corner - - # .moveTo(-2.5*size, 11.5*spacing) - # .move(-size/2, -spacing/2) ), 'mounting_holes': lambda plate: ( @@ -602,6 +607,12 @@ X X X X X X X X X X X X 'fillet': 2, 'chamfer': 1, }, + 'feet': [ + gridpos((-0.2, 0.9)), + gridpos((-0.2, 5.1)), + gridpos((22.2, 0.9)), + gridpos((22.2, 5.1)), + ], } try: @@ -610,7 +621,7 @@ except NameError: show_object = None if __name__ == "__main__" or show_object: - outputs = [ 'plate.top', 'pcb.outline', 'plate.bottom', 'cover' ] + outputs = [ 'plate.bottom', 'plate.top', 'cover', 'pcb.outline' ] if show_object: result = make_plate(**design, outputs=outputs) |
