Browse Source

add hole for speaker

master
wes 1 month ago
parent
commit
f4591a2188
  1. 34
      carlson_amp_enclosure.py

34
carlson_amp_enclosure.py

@ -17,9 +17,9 @@ Workplane.addSvgPath = addSvgPath
screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing
screw_length = 10 screw_length = 10
top_screw = ButtonHeadScrew( top_screw = CounterSunkScrew(
size="M3-0.5", size="M2.5-0.45",
fastener_type="iso7380_1", fastener_type="iso7046",
length=screw_length * MM, length=screw_length * MM,
simple=screw_simple, simple=screw_simple,
) )
@ -79,12 +79,12 @@ top = top.workplane(offset=-0.8).box(
top = ( top = (
top.faces(">Z[3]") top.faces(">Z[3]")
.rect( .rect(
box_length - 5.5, box_length - 6.5,
box_width - 5.5, box_width - 6.5,
forConstruction=True, forConstruction=True,
) )
.vertices() .vertices()
.cboreHole(2.0, 3.0, 1.1) .cboreHole(2.9, 3.5, 1.1)
) )
speaker_length = ( speaker_length = (
@ -102,12 +102,30 @@ top = (
.move(speaker_length / 2.0, 0) .move(speaker_length / 2.0, 0)
.cylinder(5, speaker_width / 2.0, combine="cut") .cylinder(5, speaker_width / 2.0, combine="cut")
) )
top = ( top = (
top.workplane() top.workplane()
.move(-(speaker_length / 2.0), 0) .move(-(speaker_length / 2.0), 0)
.cylinder(5, speaker_width / 2.0, combine="cut") .cylinder(5, speaker_width / 2.0, combine="cut")
) )
top = top.workplane(offset=1).box(10, 20.8, 3.0, combine="cut")
top = (
top.workplane(offset=1).move(10.5 / 2.0, 0).cylinder(3.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=-0.69).move(i, 0).box(0.8, 15, 0.4)
for i in range(0, 11, 2):
top = top.workplane(offset=-0.69).move(-i, 0).box(0.8, 15, 0.4)
bottom = result.workplane(offset=(box_height / 2) - 2).split(keepBottom=True) bottom = result.workplane(offset=(box_height / 2) - 2).split(keepBottom=True)
@ -117,14 +135,14 @@ bottom = bottom.workplane(offset=box_height + 5).box(
bottom = ( bottom = (
bottom.workplane(offset=(box_height / 2) - 9) 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() .vertices()
.cylinder(box_height - wall_thickness * 1.5, 2.5) .cylinder(box_height - wall_thickness * 1.5, 2.5)
) )
bottom = ( bottom = (
bottom.workplane(offset=(box_height / 2) + 4.0) bottom.workplane(offset=(box_height / 2) + 4.0)
.rect(box_length - 5.5, box_width - 5.5) .rect(box_length - 6.5, box_width - 6.5)
.vertices() .vertices()
.threadedHole(top_screw, 10, simple=screw_simple, fit="Close", counterSunk=False) .threadedHole(top_screw, 10, simple=screw_simple, fit="Close", counterSunk=False)
) )

Loading…
Cancel
Save