diff --git a/fan_control_box.py b/fan_control_box.py index 8ed0a01..57d6a11 100644 --- a/fan_control_box.py +++ b/fan_control_box.py @@ -14,14 +14,17 @@ from math import ceil, floor Workplane = cqmore.extend(Workplane) Workplane.addSvgPath = addSvgPath -screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing +screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing pole_height = 24.5 pole_dist = 10 -screw_length = 10 # FIXME need different ones for different holes +screw_length = 10 # FIXME need different ones for different holes top_screw = ButtonHeadScrew( - size="M3-0.5", fastener_type="iso7380_1", length=screw_length * MM, simple=screw_simple + size="M3-0.5", + fastener_type="iso7380_1", + length=screw_length * MM, + simple=screw_simple, ) gland_diameter = 15 @@ -62,22 +65,37 @@ box_thickness = 25 lower_box = Workplane() -def make_component_holder(result, pole_dist, pole_height, box_width, box_height, wall_thickness, x_offset=0, y_offset=0): + +def make_component_holder( + result, + pole_dist, + pole_height, + box_width, + box_height, + wall_thickness, + x_offset=0, + y_offset=0, +): return ( - result.workplane(offset=(pole_height/2)-wall_thickness).move(x_offset, y_offset) + result.workplane(offset=(pole_height / 2) - wall_thickness) + .move(x_offset, y_offset) .rect( - box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist + box_height - wall_thickness - pole_dist, + box_width - wall_thickness - pole_dist, ) .vertices() .cylinder(pole_height, 3) - .workplane(offset=(pole_height-wall_thickness+1.5)).move(x_offset, y_offset) + .workplane(offset=(pole_height - wall_thickness + 1.5)) + .move(x_offset, y_offset) .rect( - box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist + box_height - wall_thickness - pole_dist, + box_width - wall_thickness - pole_dist, ) .vertices() - .threadedHole(top_screw, pole_height*0.4, simple=screw_simple) + .threadedHole(top_screw, pole_height * 0.4, simple=screw_simple) ) + lower_box = ( lower_box.box(box_height, box_width, box_thickness) .workplane(offset=wall_thickness) @@ -89,22 +107,18 @@ lower_box = ( ) ) -lower_box = make_component_holder(lower_box, - pole_dist, - pole_height, - box_width, - box_height, - wall_thickness, - ) - -lower_box = make_component_holder(lower_box, - pole_dist, - 10, - 50, - 30, - wall_thickness, - x_offset=10, - y_offset=15) +lower_box = make_component_holder( + lower_box, + pole_dist, + pole_height, + box_width, + box_height, + wall_thickness, +) + +lower_box = make_component_holder( + lower_box, pole_dist, 10, 50, 30, wall_thickness, x_offset=10, y_offset=15 +) cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.step") diff --git a/hakko_fr301_case_hooks.py b/hakko_fr301_case_hooks.py index 9068b4a..d209813 100644 --- a/hakko_fr301_case_hooks.py +++ b/hakko_fr301_case_hooks.py @@ -17,7 +17,9 @@ bar_thickness = 55 case_thickness = 40 result = result.box( - bar_width + holder_thickness * 3, bar_thickness + holder_thickness, holder_thickness * 3 + bar_width + holder_thickness * 3, + bar_thickness + holder_thickness, + holder_thickness * 3, ) result = ( result.workplane(offset=0) @@ -38,16 +40,10 @@ result = ( result = ( result.workplane() .move(bar_width + bar_thickness - 24, 12) - .box( - case_thickness, - bar_thickness, - holder_thickness * 3, - combine="cut" - ) + .box(case_thickness, bar_thickness, holder_thickness * 3, combine="cut") ) - try: show_object(result) except NameError: diff --git a/modified_enclosure_back.py b/modified_enclosure_back.py index 33b7968..62081db 100644 --- a/modified_enclosure_back.py +++ b/modified_enclosure_back.py @@ -54,11 +54,16 @@ result_part1 = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part1.stp magnet_diameter = 6 magnet_radius = magnet_diameter / 2.0 -poop_chute_dist_from_bottom = 14.8 # how far the poop chute is from the bottom of its piece +poop_chute_dist_from_bottom = ( + 14.8 # how far the poop chute is from the bottom of its piece +) magnet_holes_plane = ( Workplane("XZ") - .center(poop_chute_dist_from_side+8, -(poop_chute_dist_from_bottom) - (24*3 - (magnet_radius*3))) + .center( + poop_chute_dist_from_side + 8, + -(poop_chute_dist_from_bottom) - (24 * 3 - (magnet_radius * 3)), + ) .rect(24, 24, forConstruction=True) .vertices() .cylinder(5, magnet_radius) @@ -69,7 +74,9 @@ magnet_holes_plane = ( ) result_part1 = result_part1.cut(magnet_holes_plane) -cq.exporters.export(result_part1, "/home/deck/model_files/modified_backpanel_part_1.step") +cq.exporters.export( + result_part1, "/home/deck/model_files/modified_backpanel_part_1.step" +) try: show_object(result_part1) diff --git a/ssd_bracket.py b/ssd_bracket.py index fcd31f0..64044dd 100644 --- a/ssd_bracket.py +++ b/ssd_bracket.py @@ -22,10 +22,17 @@ bracket_height = 5 result = Workplane() result = result.box(60, bracket_height, 7) result = result.workplane(offset=-bracket_height + 4).box(60, 1.2, 7, combine="cut") -result = result.workplane(offset=-bracket_height+2.38).move(0, 4).box(100, 5, 2) -result = result.workplane(offset=(bracket_height/2)-1).move(0, 5.5).box(100, 2, 6) +result = result.workplane(offset=-bracket_height + 2.38).move(0, 4).box(100, 5, 2) +result = result.workplane(offset=(bracket_height / 2) - 1).move(0, 5.5).box(100, 2, 6) -holes = Workplane("XZ").workplane(offset=-6).move(-37, 1).line(screw_dist, 0, forConstruction=True).vertices().cylinder(4, hole_radius) +holes = ( + Workplane("XZ") + .workplane(offset=-6) + .move(-37, 1) + .line(screw_dist, 0, forConstruction=True) + .vertices() + .cylinder(4, hole_radius) +) result = result.cut(holes)