Browse Source

screws almost fitting

master
wes 4 months ago
parent
commit
2a3f202c5f
  1. 59
      fan_control_box.py

59
fan_control_box.py

@ -29,12 +29,11 @@ barrel_diameter = 11
# digikey perfboard # digikey perfboard
# It's the distance to the *middle* of the hole # It's the distance to the *middle* of the hole
breadboard_height = 81 breadboard_height = 68.68
breadboard_width = 50.8 breadboard_width = 50.8
bb_hole_dist_from_top = 5.37 bb_hole_dist_from_top = 5.37
bb_hole_dist_from_side = 25.23 bb_hole_dist_from_side = 25.23
bb_hole_diameter = 2.76 bb_hole_diameter = 2.76
# buck converter # buck converter
@ -53,7 +52,7 @@ lbc_width = 57.8
lbc_hole_dist_from_top = 4.5 lbc_hole_dist_from_top = 4.5
lbc_hole_dist_from_side = 25.8 lbc_hole_dist_from_side = 25.8
lbc_hole_diameter = 7.0 lbc_hole_diameter = 5.8
lbc_hole_radius = lbc_hole_diameter / 2.0 lbc_hole_radius = lbc_hole_diameter / 2.0
wall_thickness = 3 wall_thickness = 3
@ -65,7 +64,8 @@ wall_thickness = 3
box_radius = 87 + wall_thickness box_radius = 87 + wall_thickness
box_thickness = 25 box_thickness = 25
pole_height = box_thickness - 2 pole_height = box_thickness - 3
inner_pole_height = 13
pole_dist = 3 pole_dist = 3
lower_box = Workplane() lower_box = Workplane()
@ -105,64 +105,66 @@ def make_component_holder_octogon(
) )
) )
.vertices() .vertices()
.threadedHole(top_screw, pole_height * 0.4, simple=screw_simple) .threadedHole(top_screw, pole_height * 0.6, simple=screw_simple, fit="Close")
) )
def make_component_holder_line( def make_component_holder_line(
result, result,
pole_height=0, pole_height=0,
pole_radius=3,
line_x_dist=0, line_x_dist=0,
line_y_dist=0, line_y_dist=0,
x_offset=0, x_offset=0,
y_offset=0, y_offset=0,
): ):
return ( return (
result.workplane(offset=(pole_height / 2) - wall_thickness) result.workplane(offset=(wall_thickness / 2.0))
.move(x_offset, y_offset) .move(x_offset, y_offset)
.line( .line(
line_x_dist, line_x_dist,
line_y_dist, line_y_dist,
) )
.vertices() .vertices()
.cylinder(pole_height, 3) .cylinder(inner_pole_height, pole_radius)
.workplane(offset=(pole_height - wall_thickness + 1.5)) .workplane(offset=(wall_thickness * 2) + 3.7)
.move(x_offset, y_offset) .move(x_offset, y_offset)
.line( .line(
line_x_dist, line_x_dist,
line_y_dist, line_y_dist,
) )
.vertices() .vertices()
.threadedHole(top_screw, pole_height * 0.4, simple=screw_simple) .threadedHole(top_screw, inner_pole_height, simple=screw_simple, fit="Close")
) )
def make_component_holder( def make_component_holder(
result, result,
pole_dist, pole_dist,
pole_height, pole_height=0,
box_width, pole_radius=3,
box_height, box_width=None,
box_height=None,
x_offset=0, x_offset=0,
y_offset=0, y_offset=0,
): ):
return ( return (
result.workplane(offset=(pole_height / 2) - wall_thickness) result.workplane(offset=(wall_thickness / 2.0))
.move(x_offset, y_offset) .move(x_offset, y_offset)
.rect( .rect(
box_height, box_height,
box_width, box_width,
) )
.vertices() .vertices()
.cylinder(pole_height, 3) .cylinder(inner_pole_height, pole_radius)
.workplane(offset=(pole_height - wall_thickness + 1.5)) .workplane(offset=(wall_thickness * 2) + 3.7)
.move(x_offset, y_offset) .move(x_offset, y_offset)
.rect( .rect(
box_height, box_height,
box_width, box_width,
) )
.vertices() .vertices()
.threadedHole(top_screw, pole_height * 0.4, simple=screw_simple) .threadedHole(top_screw, inner_pole_height, simple=screw_simple, fit="Close")
) )
@ -218,23 +220,38 @@ lower_box = make_component_holder(
lower_box = make_component_holder( lower_box = make_component_holder(
lower_box, lower_box,
pole_dist, pole_dist,
10, pole_height=5,
breadboard_width, box_width=breadboard_width,
breadboard_height, box_height=breadboard_height,
x_offset=0, x_offset=0,
y_offset=40, y_offset=40,
) )
lower_box = make_component_holder_line( lower_box = make_component_holder_line(
lower_box, lower_box,
pole_height=8, pole_height=5,
line_x_dist=breadboard_height,
line_y_dist=0,
x_offset=-(breadboard_height / 2.0),
y_offset=40,
)
bc_pole_radius = 4
lower_box = lower_box.workplane(offset=(wall_thickness / 2.0)).move(-(lbc_height/2.0), -25).box(5, lbc_width-5, 13)
lower_box = lower_box.workplane(offset=(wall_thickness / 2.0)).move(lbc_height/2.0 - bc_pole_radius*2, -25).box(5, lbc_width-5, 13)
lower_box = make_component_holder_line(
lower_box,
pole_height=6,
pole_radius=bc_pole_radius,
line_x_dist=lbc_height - lbc_hole_diameter - lbc_hole_radius, line_x_dist=lbc_height - lbc_hole_diameter - lbc_hole_radius,
line_y_dist=0, line_y_dist=0,
x_offset=-(lbc_height / 2.0), x_offset=-(lbc_height / 2.0),
y_offset=-(lbc_width / 2.5), y_offset=-(lbc_width / 2.5),
) )
cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.step") #lower_box = lower_box.workplane(offset=(wall_thickness / 2.0)).box(lbc_height, 5, 13)
cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.stl")
try: try:
show_object(lower_box) show_object(lower_box)

Loading…
Cancel
Save