Browse Source

adding a bunch of stuff

master
wes 4 months ago
parent
commit
3493f44b67
  1. 64
      air_quality_sensor_enclosure.py
  2. 63
      fan_control_box.py
  3. 56
      hakko_fr301_case_hooks.py
  4. 37
      modified_enclosure_back.py
  5. 36
      ssd_bracket.py

64
air_quality_sensor_enclosure.py

@ -16,6 +16,16 @@ Workplane.addSvgPath = addSvgPath
bottom = Workplane()
screw_length = 7
simple = False
screw = ButtonHeadScrew(
size="M3-0.5", fastener_type="iso7380_1", length=screw_length * MM, simple=simple
)
board_thickness = 1.64
wall_offset = 5
w = 26
h = 26
t = 2
@ -26,19 +36,63 @@ screw_radius = screw_diameter / 2.0
hole_dist_from_side = 1.36
bottom = bottom.box(w, h, t)
bottom = bottom.box(w + wall_offset, h + wall_offset, screw_length + t + 3)
bottom = bottom.workplane(offset=t).box(
w + (wall_offset - 2), h + (wall_offset - 2), screw_length + 3, combine="cut"
)
bottom = (
bottom.faces(">Z[1]")
bottom.workplane(offset=1.5)
.rect(
w - hole_dist_from_side - screw_diameter,
h - hole_dist_from_side - screw_diameter,
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.hole(screw_diameter, t)
.cylinder(screw_length - 1, screw_radius + 1)
)
bottom = (
bottom.workplane(offset=4.5)
.rect(
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.threadedHole(screw, screw_length - 1, simple=simple)
)
top = Workplane()
top = top.box(w + wall_offset, h + wall_offset, t)
top = (
top.workplane(offset=3.10)
.rect(
w / 4,
h / 2,
)
.vertices()
.cylinder(5.810 - board_thickness, 1.2) # 5.810 = 9 - 3.189
)
top = (
top.faces(">Z[1]")
.rect(
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.hole(screw_diameter, 10)
)
top = top.workplane().move(0, 13).box(9.7, 3, 10, combine="cut")
top = top.workplane(offset=3).center(0, 0).cylinder(4.17, (4.13 / 2.0) + 0.5)
top = top.workplane(offset=0).center(0, 0).cylinder(15, (4.13 / 2.0), combine="cut")
cq.exporters.export(bottom, "/home/deck/model_files/air_quality_enclosure_bottom.step")
cq.exporters.export(top, "/home/deck/model_files/air_quality_enclosure_top.step")
try:
show_object(lower_box)
show_object(top)
except NameError:
pass

63
fan_control_box.py

@ -14,6 +14,16 @@ 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
pole_height = 24.5
pole_dist = 10
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
)
gland_diameter = 15
barrel_diameter = 11
@ -50,16 +60,27 @@ box_height = 115 + wall_thickness
box_width = 157 + wall_thickness
box_thickness = 25
pole_dist = 15
pole_dist = 15
pole_height = 24.5
lower_box = Workplane()
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)
.rect(
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)
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)
.vertices()
.threadedHole(top_screw, pole_height*0.4, simple=screw_simple)
)
lower_box = (
lower_box.box(box_height, box_width, box_thickness)
.workplane(offset=1)
.workplane(offset=wall_thickness)
.box(
box_height - wall_thickness,
box_width - wall_thickness,
@ -68,20 +89,22 @@ lower_box = (
)
)
lower_box = (
lower_box.workplane(offset=(pole_height / 4))
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)
.vertices()
.cylinder(pole_height, 5)
.workplane(offset=(pole_height / 4))
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)
.vertices()
.cylinder(pole_height, 1, combine="cut")
)
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")

56
hakko_fr301_case_hooks.py

@ -0,0 +1,56 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
import cadquery as cq
result = Workplane()
hole_diameter = 7.1
hole_radius = hole_diameter / 2.0
hole_dist_from_side = 12
holder_thickness = 12
bar_width = 51
bar_thickness = 55
case_thickness = 40
result = result.box(
bar_width + holder_thickness * 3, bar_thickness + holder_thickness, holder_thickness * 3
)
result = (
result.workplane(offset=0)
.center(5, -6)
.box(bar_width, bar_thickness, holder_thickness * 3, combine="cut")
)
result = (
result.workplane()
.move(bar_width + bar_thickness - 24, 6)
.box(
bar_width + holder_thickness * 3,
bar_thickness + holder_thickness,
holder_thickness * 3,
)
)
result = (
result.workplane()
.move(bar_width + bar_thickness - 24, 12)
.box(
case_thickness,
bar_thickness,
holder_thickness * 3,
combine="cut"
)
)
try:
show_object(result)
except NameError:
pass
cq.exporters.export(result, "/home/deck/model_files/hakko_hooks.step")

37
modified_enclosure_back.py

@ -17,6 +17,8 @@ Workplane.addSvgPath = addSvgPath
width = 154
height = 182
poop_chute_dist_from_side = 59
holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
@ -28,26 +30,13 @@ holes_plane = (
.cylinder(8, 17 / 2)
)
magnet_holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
.center(20, height - 100)
.cylinder(12, 2)
.center(0, -90)
.cylinder(12, 2)
)
cover_usb = (
Workplane("XZ").workplane(offset=-4.5).center(-4, height - 77).box(11, 5.3, 1.0)
)
result = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part3.stp")
result_part1 = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part1.stp")
result = result.cut(holes_plane)
# result = result.union(magnet_holes_plane)
result = result.union(cover_usb)
# magnet distance should be 90 mm apart
@ -60,6 +49,28 @@ cq.exporters.export(
test_piece, "/home/deck/model_files/modified_backpanel_test_piece.step"
)
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
magnet_holes_plane = (
Workplane("XZ")
.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)
.center(0, 24)
.rect(24, 24, forConstruction=True)
.vertices()
.cylinder(5, magnet_radius)
)
result_part1 = result_part1.cut(magnet_holes_plane)
cq.exporters.export(result_part1, "/home/deck/model_files/modified_backpanel_part_1.step")
try:
show_object(result_part1)
except NameError:

36
ssd_bracket.py

@ -0,0 +1,36 @@
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)
Workplane.addSvgPath = addSvgPath
hole_diameter = 3.66
hole_radius = hole_diameter / 2.0
screw_dist = 76
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)
holes = Workplane("XZ").workplane(offset=-6).move(-37, 1).line(screw_dist, 0, forConstruction=True).vertices().cylinder(4, hole_radius)
result = result.cut(holes)
cq.exporters.export(result, "/home/deck/model_files/ssd_bracket.step")
try:
show_object(result)
except NameError:
pass
Loading…
Cancel
Save