Browse Source

adding holes and stuff

master
wes 1 month ago
parent
commit
5c0fdf1ac0
  1. 59
      carlson_amp_enclosure.py
  2. 66
      carlson_amp_probe.py

59
carlson_amp_enclosure.py

@ -16,6 +16,15 @@ Workplane.addSvgPath = addSvgPath
screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing
pot_diameter = 6.9
pot_radius = pot_diameter / 2.0
switch_diameter = 6.2
switch_radius = switch_diameter / 2.0
gland_diameter = 16.0
gland_radius = gland_diameter / 2.0
screw_length = 10
top_screw = CounterSunkScrew(
size="M2.5-0.45",
@ -35,7 +44,7 @@ hole_dist_y = (
hole_diameter = 3.44
hole_radius = hole_diameter / 2.0
box_width = 65.0
box_width = 72.0
box_height = 30.0
box_length = 120.0
wall_thickness = 2.0
@ -137,26 +146,28 @@ bottom = (
bottom.workplane(offset=(box_height / 2) - 9)
.rect(box_length - 6.5, box_width - 6.5)
.vertices()
.cylinder(box_height - wall_thickness * 1.5, 2.5)
.cylinder(box_height - wall_thickness * 2, 2.5)
)
bottom = (
bottom.workplane(offset=(box_height / 2) + 4.0)
bottom.workplane(offset=(box_height / 2) + 3.5)
.rect(box_length - 6.5, box_width - 6.5)
.vertices()
.threadedHole(top_screw, 10, simple=screw_simple, fit="Close", counterSunk=False)
)
battery_holder_offset_factor = 6.5
bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 8.9)
.move(box_length / 2.0 - wall_thickness * 4, 0)
.move(box_length / 2.0 - wall_thickness * battery_holder_offset_factor, 0)
.box(battery_holder_slot_width, battery_holder_slot_length, 4.0)
)
bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0,
-(battery_holder_slot_length / 6.5),
)
.vLine(battery_holder_hole_dist)
@ -164,7 +175,7 @@ bottom = (
.cylinder(4, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0,
-(battery_holder_slot_length / 6.5),
)
.vLine(battery_holder_hole_dist)
@ -175,7 +186,7 @@ bottom = (
bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0,
(battery_holder_hole_dist * 2) - 8,
)
.vLine(-(battery_holder_hole_dist * 3))
@ -183,7 +194,7 @@ bottom = (
.cylinder(4, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0,
(battery_holder_hole_dist * 2) - 8,
)
.vLine(-(battery_holder_hole_dist * 3))
@ -210,11 +221,41 @@ bottom = (
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False)
)
pot_holes = (
Workplane("YZ")
.workplane(offset=-(box_length / 2.0))
.move(12, 0)
.cylinder(wall_thickness * 2, pot_radius)
.workplane()
.move(-12, 0)
.cylinder(wall_thickness * 2, pot_radius)
)
bottom = bottom.cut(pot_holes)
switch_hole = (
Workplane("XZ")
.workplane(offset=-(box_width / 2.0))
.move(-(box_length / 2.0) + 30, 0)
.cylinder(wall_thickness * 2, switch_radius)
)
bottom = bottom.cut(switch_hole)
gland_hole = (
Workplane("XZ")
.workplane(offset=(box_width / 2.0))
.move(-(box_length / 2.0) + 30, 0)
.cylinder(wall_thickness * 2, gland_radius)
)
bottom = bottom.cut(gland_hole)
cq.exporters.export(bottom, "/home/deck/model_files/carlon_probe_amp_enclosure_box.stl")
cq.exporters.export(top, "/home/deck/model_files/carlon_probe_amp_enclosure_lid.stl")
try:
show_object(top)
show_object(bottom)
except NameError:
pass

66
carlson_amp_probe.py

@ -26,52 +26,47 @@ gland_or = gland_od / 2.0
gland_id = 16
gland_ir = gland_id / 2.0
probe_middle = Workplane()
probe_middle = probe_middle.cylinder(probe_length, probe_radius + wall_width)
probe_middle = probe_middle.cylinder(probe_length - 2, probe_radius, combine="cut")
probe_middle = probe_middle.workplane(offset=probe_length / 2.0).cylinder(
2, coax_radius, combine="cut"
full_probe = Workplane()
full_probe = full_probe.cylinder(
probe_length + wall_width * 2, probe_radius + wall_width
)
# probe end cap must be 8.8mm longer for the switch
probe_end_cap = full_probe.workplane(offset=-4).split(keepTop=True)
probe_end_cap = probe_end_cap.workplane(offset=2).cylinder(
(probe_length / 2.0) + 6, probe_radius, combine="cut"
)
probe_end_cap = probe_end_cap.workplane(offset=-(probe_length / 4.0)).cylinder(
4, coax_radius, combine="cut"
)
probe_middle = (
probe_middle.workplane(offset=probe_length / 2.0)
probe_end_cap = (
probe_end_cap.workplane(offset=-(probe_length / 4.0))
.move(3, 8)
.cylinder(2, ground_cable_radius, combine="cut")
.cylinder(4, ground_cable_radius, combine="cut")
)
probe_middle = probe_middle.workplane(offset=-(probe_length / 2.0) + 2).cylinder(
2, probe_radius
probe_end_cap = (
probe_end_cap.workplane(offset=(probe_length / 2.0) - 24.53)
.move(probe_radius, 0)
.box(5.6, 5, 9.0, combine="cut")
) # 8.85 and 5.6 are the switch dimensions
# Need to add 4.9 mm to this to account for the cable gland, it's 4.9 / 2.0 though
cable_end_cap = full_probe.workplane(offset=-4 + 7.4).split(keepBottom=True)
cable_end_cap = cable_end_cap.workplane(offset=2 + (2.9 / 2.0)).cylinder(
(probe_length / 2.0) - 2.0 + 4.68, probe_radius, combine="cut"
)
probe_middle = probe_middle.workplane(offset=-(probe_length / 2.0)).cylinder(
cable_end_cap = cable_end_cap.workplane(offset=-(probe_length / 5.0)).cylinder(
11, gland_ir, combine="cut"
)
cable_end_cap = probe_middle.workplane(offset=(-probe_length / 2.0) + 26).split(
keepBottom=True
)
# led hole should be 11.0 mm from end + width of the end ring
cable_end_cap = (
cable_end_cap.workplane(offset=(-probe_length / 2.0) + 57)
cable_end_cap.workplane(offset=-(probe_length / 6.0) + 12.74)
.move(12, 0)
.sphere(2.5, combine="cut")
)
probe_middle = probe_middle.workplane(offset=(-probe_length / 2.0) + 15).split(
keepTop=True
)
probe_end_cap = probe_middle.workplane(offset=15).split(keepTop=True)
probe_middle = (
Workplane()
.makePolygon(
regularPolygon(
nSides=6,
radius=probe_radius * 1.3,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(57.438)
) # Difference between probe length and end caps lengths
probe_middle = probe_middle.cylinder(probe_length, probe_radius + 0.12, combine="cut")
cq.exporters.export(probe_middle, "/home/deck/model_files/carlson_probe_middle.stl")
cq.exporters.export(
cable_end_cap, "/home/deck/model_files/carlson_probe_cable_end_cap.stl"
)
@ -80,6 +75,7 @@ cq.exporters.export(
)
try:
show_object(probe_middle)
# show_object(probe_end_cap)
show_object(cable_end_cap)
except NameError:
pass

Loading…
Cancel
Save