You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.1 KiB

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
gland_diameter = 15
barrel_diameter = 11
# digikey perfboard
# It's the distance to the *middle* of the hole
breadboard_height = 81
breadboard_width = 50.8
bb_hole_dist_from_top = 5.37
bb_hole_dist_from_side = 25.23
bb_hole_diameter = 2.76
# buck converter
bc_height = 43.18
bc_width = 31.16
bc_hole_dist_from_top = 6.44
bc_hole_dist_from_side = 2.21 # distance to middle of hole as before, also it's the distance from the closer side
bc_hole_diameter = 4.18
# large buck converter
lbc_height = 57.8
lbc_width = 57.8
lbc_hole_dist_from_top = 4.5
lbc_hole_dist_from_side = 25.8
lbc_hole_diameter = 6.83
wall_thickness = 3
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()
lower_box = (
lower_box.box(box_height, box_width, box_thickness)
.workplane(offset=1)
.box(
box_height - wall_thickness,
box_width - wall_thickness,
box_thickness,
combine="cut",
)
)
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")
)
cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.step")
try:
show_object(lower_box)
except NameError:
pass