diff --git a/fan_control_box.py b/fan_control_box.py index 57d6a11..bbcd478 100644 --- a/fan_control_box.py +++ b/fan_control_box.py @@ -16,9 +16,6 @@ Workplane.addSvgPath = addSvgPath 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 top_screw = ButtonHeadScrew( size="M3-0.5", @@ -63,16 +60,46 @@ box_height = 115 + wall_thickness box_width = 157 + wall_thickness box_thickness = 25 +pole_height = box_thickness - 2 +pole_dist = 10 + lower_box = Workplane() +def make_component_holder_line( + result, + pole_height, + line_x_dist, + line_y_dist, + x_offset=0, + y_offset=0, +): + return ( + result.workplane(offset=(pole_height / 2) - wall_thickness) + .move(x_offset, y_offset) + .line( + line_x_dist, + line_y_dist, + ) + .vertices() + .cylinder(pole_height, 3) + .workplane(offset=(pole_height - wall_thickness + 1.5)) + .move(x_offset, y_offset) + .line( + line_x_dist, + line_y_dist, + ) + .vertices() + .threadedHole(top_screw, pole_height * 0.4, simple=screw_simple) + ) + + def make_component_holder( result, pole_dist, pole_height, box_width, box_height, - wall_thickness, x_offset=0, y_offset=0, ): @@ -113,13 +140,20 @@ lower_box = make_component_holder( 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, + pole_dist, + 10, + breadboard_width, + breadboard_height, + x_offset=0, + y_offset=50, ) +lower_box = make_component_holder_line(lower_box, 8, 0, 15, x_offset=0, y_offset=0) + cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.step") try: