Compare commits

...

9 Commits

  1. 149
      carlson_amp_enclosure.py
  2. 90
      carlson_amp_probe.py
  3. 232
      organizer.py
  4. 30
      potentiometer_knobs.py

149
carlson_amp_enclosure.py

@ -14,12 +14,32 @@ from math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing
screw_simple = False # 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
gland_shim = (
Workplane().cylinder(2.5, gland_radius + 3).cylinder(3, gland_radius, combine="cut")
)
screw_length = 10
top_screw = ButtonHeadScrew(
size="M3-0.5",
fastener_type="iso7380_1",
top_screw = CounterSunkScrew(
size="M2.5-0.45",
fastener_type="iso7046",
length=screw_length * MM,
simple=screw_simple,
)
battery_screw = CounterSunkScrew(
size="M3.5-0.6",
fastener_type="iso7046",
length=screw_length * MM,
simple=screw_simple,
)
@ -35,7 +55,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
@ -68,23 +88,23 @@ result = (
top = result.workplane(offset=(box_height / 2) - 2).split(keepTop=True)
top = top.workplane(offset=-1.5).box(
box_length + wall_thickness, box_width + wall_thickness, 2, combine="cut"
top = top.workplane(offset=-2.6).box(
box_length + wall_thickness - 2, box_width + wall_thickness - 2, 2, combine="cut"
)
top = top.workplane(offset=-0.8).box(
box_length - wall_thickness - 0.05, box_width - wall_thickness - 0.05, 1
top = top.workplane(offset=-1.7).box(
box_length - wall_thickness - 0.05, box_width - wall_thickness - 0.05, 2
)
top = (
top.faces(">Z[3]")
top.faces(">Z[4]")
.rect(
box_length - 5.5,
box_width - 5.5,
box_length - 6.5,
box_width - 6.5,
forConstruction=True,
)
.vertices()
.cboreHole(2.0, 3.0, 1.1)
.cboreHole(2.4, 4.2, 2.1)
)
speaker_length = (
@ -93,8 +113,10 @@ speaker_length = (
speaker_width = 14.5 - 2.75
speaker_thickness = 5
top = top.faces(">Z[0]").box(
speaker_length, speaker_width, speaker_thickness, combine="cut"
top = (
top.faces(">Z[0]")
.workplane(offset=-1)
.box(speaker_length, speaker_width, speaker_thickness, combine="cut")
)
top = (
@ -102,12 +124,30 @@ top = (
.move(speaker_length / 2.0, 0)
.cylinder(5, speaker_width / 2.0, combine="cut")
)
top = (
top.workplane()
.move(-(speaker_length / 2.0), 0)
.cylinder(5, speaker_width / 2.0, combine="cut")
)
top = top.workplane(offset=2).box(10, 20.8, 5.0, combine="cut")
top = (
top.workplane(offset=2).move(10.5 / 2.0, 0).cylinder(5.0, 20.8 / 2.0, combine="cut")
)
top = (
top.workplane(offset=1)
.move(-(10.5 / 2.0), 0)
.cylinder(3.0, 20.8 / 2.0, combine="cut")
)
for i in range(0, 11, 2):
top = top.workplane(offset=-1.1).move(i, 0).box(1.0, 15, 0.9)
for i in range(0, 11, 2):
top = top.workplane(offset=-1.1).move(-i, 0).box(1.0, 15, 0.9)
bottom = result.workplane(offset=(box_height / 2) - 2).split(keepBottom=True)
@ -117,60 +157,66 @@ bottom = bottom.workplane(offset=box_height + 5).box(
bottom = (
bottom.workplane(offset=(box_height / 2) - 9)
.rect(box_length - 5.5, box_width - 5.5)
.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)
.rect(box_length - 5.5, box_width - 5.5)
bottom.workplane(offset=(box_height / 2) + 3.6)
.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)
.box(battery_holder_slot_width, battery_holder_slot_length, 4.0)
bottom.workplane(offset=-(box_height / 2.0) + 9.8)
.move(box_length / 2.0 - wall_thickness * battery_holder_offset_factor, 0)
.box(battery_holder_slot_width, battery_holder_slot_length, 6.0)
)
bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0)
bottom.workplane(offset=-(box_height / 2.0) + 10.0)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
-(battery_holder_slot_length / 6.5),
)
.vLine(battery_holder_hole_dist)
.vertices()
.cylinder(4, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10)
.cylinder(6, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 13.10)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
-(battery_holder_slot_length / 6.5),
)
.vLine(battery_holder_hole_dist)
.vertices()
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False)
.threadedHole(
battery_screw, 4.0, simple=screw_simple, fit="Loose", counterSunk=False
)
)
bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0)
bottom.workplane(offset=-(box_height / 2.0) + 10.0)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
(battery_holder_hole_dist * 2) - 8,
)
.vLine(-(battery_holder_hole_dist * 3))
.vertices()
.cylinder(4, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10)
.cylinder(6, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 13.10)
.move(
(box_length / 2.0 - wall_thickness * 4) - 24.0,
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
(battery_holder_hole_dist * 2) - 8,
)
.vLine(-(battery_holder_hole_dist * 3))
.vertices()
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False)
.threadedHole(
battery_screw, 4.0, simple=screw_simple, fit="Loose", counterSunk=False
)
)
bottom = (
@ -192,11 +238,44 @@ 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")
cq.exporters.export(
gland_shim, "/home/deck/model_files/carlson_amp_cable_gland_shim.stl"
)
try:
show_object(top)
show_object(gland_shim)
except NameError:
pass

90
carlson_amp_probe.py

@ -26,60 +26,84 @@ 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"
probe_tip_cover = (
Workplane()
.cylinder(15, coax_radius + 0.1)
.workplane(offset=1)
.cylinder(15, coax_radius - 0.6, combine="cut")
)
full_probe = Workplane()
full_probe = full_probe.cylinder(
probe_length + wall_width * 2, probe_radius + wall_width
)
probe_middle = (
probe_middle.workplane(offset=probe_length / 2.0)
# 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_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 = (
probe_end_cap_inner_cut = (
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")
.workplane(offset=-3)
.cylinder(3, probe_radius + wall_width)
.cylinder(3, probe_radius - 1.0, combine="cut")
)
probe_end_cap_inner_fitting = (
probe_end_cap.workplane(offset=-25)
.split(keepBottom=True)
.cut(probe_end_cap_inner_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"
)
cq.exporters.export(
probe_end_cap, "/home/deck/model_files/carlson_probe_probe_end_cap.stl"
)
cq.exporters.export(
probe_tip_cover, "/home/deck/model_files/carlson_probe_probe_tip_cover.stl"
)
cq.exporters.export(
probe_end_cap_inner_fitting,
"/home/deck/model_files/carlons_probe_end_cap_inner_fitting.stl",
)
try:
show_object(probe_middle)
# show_object(probe_end_cap)
# show_object(cable_end_cap)
# show_object(probe_tip_cover)
show_object(probe_end_cap_inner_fitting)
except NameError:
pass

232
organizer.py

@ -0,0 +1,232 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
import cadquery as cq
screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
screw_length = 15 # FIXME need different ones for different holes
handle_screw = ButtonHeadScrew(
size="M6-1",
fastener_type="iso7380_1",
length=screw_length * MM,
simple=screw_simple,
hand="left",
)
magnet_diameter = 4.92
magnet_radius = magnet_diameter / 2.0
prong_width = 20.0
prong_dist = 228 - prong_width
prong_height = 23.5
prong_thickness = 7.7
wall_thickness = 5.4
depth = 128
width = 240
height = 133
magnet_buffer_space = 0.3
foot_diameter = 8.8
foot_radius = foot_diameter / 2.0
result = Workplane()
result = result.box(
width + wall_thickness, depth + wall_thickness, height + wall_thickness
)
result = (
result.workplane(offset=0)
.move(wall_thickness, 0)
.box(
width + wall_thickness,
depth - wall_thickness,
height - wall_thickness,
combine="cut",
)
)
# Magnet holes
result = (
result.workplane(offset=wall_thickness)
.move(width / 2.0 - magnet_diameter, 0)
.box(
magnet_diameter + magnet_buffer_space + 1.5,
depth,
height + wall_thickness * 2,
combine="cut",
)
)
result = (
result.workplane(offset=-(height / 2.0) + 1.5)
.move(
width / 2.0 - wall_thickness + (magnet_buffer_space / 2.0),
-(depth / 2.0) + wall_thickness,
)
.line(0, depth - wall_thickness * 2)
.vertices()
.cylinder(6.6, magnet_radius, combine="cut")
)
door_side_magnet_cut_left = (
Workplane("XZ")
.workplane(offset=depth / 2.0)
.move(
width / 2.0 - wall_thickness + (magnet_buffer_space / 2.0),
-depth / 2.0 + wall_thickness + 7,
)
.cylinder(4.3, magnet_radius)
)
door_side_magnet_cut_right = (
Workplane("XZ")
.workplane(offset=-(depth / 2.0))
.move(
width / 2.0 - wall_thickness + (magnet_buffer_space / 2.0),
-depth / 2.0 + wall_thickness + 7,
)
.cylinder(4.3, magnet_radius)
)
result = result.cut(door_side_magnet_cut_left)
result = result.cut(door_side_magnet_cut_right)
door_side_magnet_cut_left_top = (
Workplane("XZ")
.workplane(offset=depth / 2.0)
.move(
width / 2.0 - wall_thickness + (magnet_buffer_space / 2.0),
depth / 2.0 - wall_thickness - 7,
)
.cylinder(4.3, magnet_radius)
)
door_side_magnet_cut_right_top = (
Workplane("XZ")
.workplane(offset=-(depth / 2.0))
.move(
width / 2.0 - wall_thickness + (magnet_buffer_space / 2.0),
depth / 2.0 - wall_thickness - 7,
)
.cylinder(4.3, magnet_radius)
)
result = result.cut(door_side_magnet_cut_left_top)
result = result.cut(door_side_magnet_cut_right_top)
# slots to fit the oscilloscope in
# move 38 mm back
scope_slots = (
Workplane("ZX")
.workplane(offset=(height / 2.0))
.move(depth / 2.0 - wall_thickness - 38, -(width / 2.0) + 13)
.line(0, prong_dist)
.vertices()
.box(prong_thickness, prong_width, wall_thickness * 3)
)
result = result.cut(scope_slots)
feet_cut = (
Workplane("ZX")
.workplane(offset=-depth / 2.0 - 2)
.move(0, 0)
.rect(height - wall_thickness * 6, width - wall_thickness * 6)
.vertices()
.cylinder(1.4, foot_radius)
)
result = result.cut(feet_cut)
## Doors
door = Workplane()
door = door.box(wall_thickness, depth, height)
## Door magnets
door = (
door.workplane(offset=-(height / 2.0) - 1)
.move(
0,
-(depth / 2.0) + wall_thickness,
)
.line(0, depth - wall_thickness * 2)
.vertices()
.cylinder(6.6, magnet_radius, combine="cut")
)
_door_side_magnet_cut_left = (
Workplane("XZ")
.workplane(offset=(depth / 2.0))
.move(
0,
-depth / 2.0 + wall_thickness + 7,
)
.cylinder(4.3, magnet_radius)
)
_door_side_magnet_cut_right = (
Workplane("XZ")
.workplane(offset=-(depth / 2.0))
.move(
0,
-depth / 2.0 + wall_thickness + 7,
)
.cylinder(4.3, magnet_radius)
)
door = door.cut(_door_side_magnet_cut_left)
door = door.cut(_door_side_magnet_cut_right)
_door_side_magnet_cut_left_top = (
Workplane("XZ")
.workplane(offset=depth / 2.0)
.move(
0,
depth / 2.0 - wall_thickness - 7,
)
.cylinder(4.3, magnet_radius)
)
_door_side_magnet_cut_right_top = (
Workplane("XZ")
.workplane(offset=-(depth / 2.0))
.move(
0,
depth / 2.0 - wall_thickness - 7,
)
.cylinder(4.3, magnet_radius)
)
door = door.cut(_door_side_magnet_cut_left_top)
door = door.cut(_door_side_magnet_cut_right_top)
# door_handle_cut = Workplane().union(screw_thread.rotate((0, 0, 0), (0, 1, 0), 270))
door = (
door.rotate((0, 0, 0), (0, 1, 0), 270)
.workplane(offset=6.0)
.move(60, 0)
.threadedHole(handle_screw, 8, simple=screw_simple, fit="Close")
)
handle = (
Workplane()
.union(handle_screw)
.workplane(offset=5)
.cylinder(8, 6, combine="cut")
.workplane(offset=5)
.cylinder(5, 3.5)
)
cq.exporters.export(result, "/home/deck/model_files/organizer.stl")
cq.exporters.export(door, "/home/deck/model_files/organizer_door.stl")
cq.exporters.export(handle, "/home/deck/model_files/organizer_door_handle.stl")
try:
show_object(handle)
except NameError:
pass

30
potentiometer_knobs.py

@ -0,0 +1,30 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from svg_path import addSvgPath
from svgpathtools import svg2paths
from cqmore.polygon import regularPolygon
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
pot_knob = cq.importers.importStep("/home/deck/Downloads/pot_knob.step")
gain_result = Workplane()
probe_result = Workplane()
gain_result = gain_result.workplane(offset=13.7).center(0, -2).text("AUDIO", 3.5, 2)
gain_result = pot_knob.cut(gain_result)
probe_result = probe_result.workplane(offset=13.7).center(0, -2).text("PROBE", 3.5, 2)
probe_result = pot_knob.cut(probe_result)
cq.exporters.export(gain_result, "/home/deck/model_files/pot_knob_gain.stl")
cq.exporters.export(probe_result, "/home/deck/model_files/pot_knob_probe.stl")
try:
show_object(gain_result)
except NameError:
pass
Loading…
Cancel
Save