diff --git a/fan_control_box.py b/fan_control_box.py index 7f544bc..3588f7f 100644 --- a/fan_control_box.py +++ b/fan_control_box.py @@ -24,7 +24,7 @@ top_screw = ButtonHeadScrew( simple=screw_simple, ) -gland_diameter = 15.5 +gland_diameter = 13.2 gland_radius = gland_diameter / 2.0 barrel_diameter = 11 barrel_radius = barrel_diameter / 2.0 @@ -41,7 +41,7 @@ bb_hole_diameter = 2.76 # buck converter bc_height = 29.83 # from center of hole to other hole -bc_width = 15 # from center of hole to other hole, but horizontally +bc_width = 15.5 # from center of hole to other hole, but horizontally # large buck converter @@ -54,7 +54,7 @@ lbc_hole_diameter = 5.8 lbc_hole_radius = lbc_hole_diameter / 2.0 pwm_width = 13.45 -pwm_height = 34 +pwm_height = 32 wall_thickness = 3 @@ -65,8 +65,33 @@ pole_height = box_thickness - 3 inner_pole_height = 13 pole_dist = 3 +lid = Workplane() lower_box = Workplane() +lid = ( + lid.workplane() + .makePolygon( + regularPolygon( + nSides=8, + radius=box_radius - (wall_thickness / 2.0), + thetaStart=0, + thetaEnd=360, + ) + ) + .extrude(5) + .faces(">Z[1]") + .makePolygon( + regularPolygon( + nSides=8, + radius=box_radius - wall_thickness - pole_dist, + thetaStart=0, + thetaEnd=360, + ) + ) + .vertices() + .cskHole(3, 5, pole_height) +) + def make_component_holder_octogon( result, @@ -335,15 +360,16 @@ lower_box = add_gland_holes( lower_box, 8, [ - (-15, barrel_radius * 4.0, 5, barrel_radius), + (-15, barrel_radius * 3.6, 5, barrel_radius), (15, gland_radius * 3.0, 5, gland_radius), ], ) cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.stl") +cq.exporters.export(lid, "/home/deck/model_files/fan_control_box_lid.stl") try: - show_object(lower_box) + show_object(lid) except NameError: pass diff --git a/xmas_spinner.py b/xmas_spinner.py new file mode 100644 index 0000000..a2b94a8 --- /dev/null +++ b/xmas_spinner.py @@ -0,0 +1,74 @@ +from cadquery import exporters +from cq_warehouse.extensions import Workplane +from cq_warehouse.fastener import * +from cq_warehouse.thread import * +from cqmore.curve import archimedeanSpiral, circle +from cqmore.polygon import regularPolygon, star +from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid +from svg_path import addSvgPath +from svgpathtools import svg2paths +import cadquery as cq +import cqmore +from math import ceil, floor + +Workplane = cqmore.extend(Workplane) + +bearing_od = 22.0 +bearing_or = bearing_od / 2.0 +bearing_diameter = 8.0 +bearing_radius = bearing_diameter / 2.0 + +bearing_thickness = 6.93 + +spinner = ( + Workplane() + .workplane(offset=0) + .move(-37.9, 19) + .cylinder(5, 15) + .workplane(offset=-2) + .move(-37, 19) + .cylinder(10, bearing_radius) +) + +tree = cq.importers.importStep("/home/deck/Downloads/xmas_tree.step") + +spinner = tree.union(spinner) + +spinner_split_top = ( + tree.workplane(5) + .split(keepTop=True) + .workplane(offset=-10) + .move(-37, 19) + .cylinder(10, bearing_radius) + .workplane(offset=-2.9) + .move(-37, 19) + .cylinder(10, bearing_radius + 3) +) + +spinner_split_bottom = ( + tree.workplane(5) + .split(keepBottom=True) + .workplane(offset=7.8) + .move(-37.9, 19) + .cylinder(bearing_thickness, bearing_or, combine="cut") + .workplane(offset=6.8) + .move(-37.9, 19) + .cylinder(20, bearing_radius, combine="cut") + .workplane(offset=-3.0) + .move(-37.9, 19) + .cylinder(13.3, 15) + .workplane(offset=-7.12) + .move(-37.9, 19) + .cylinder(bearing_thickness + 3.3, bearing_or, combine="cut") +) + +cq.exporters.export(spinner, "/home/deck/model_files/xmas_spinner.stl") +cq.exporters.export(spinner_split_top, "/home/deck/model_files/xmas_spinner_top.stl") +cq.exporters.export( + spinner_split_bottom, "/home/deck/model_files/xmas_spinner_bottom.stl" +) + +try: + show_object(spinner_split_bottom) +except NameError: + pass