Browse Source

formatting

master
wes 9 months ago
parent
commit
fbb9c8fc6f
  1. 26
      amp_case.py

26
amp_case.py

@ -11,6 +11,13 @@ import cadquery as cq
import cqmore import cqmore
from math import ceil, floor from math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
headphone_paths, headphone_attributes = svg2paths(
"/home/deck/cad_files/svgs/headphones.svg"
)
side_width = 5 side_width = 5
bottom_width = 5 bottom_width = 5
middle_width = 2 middle_width = 2
@ -57,6 +64,24 @@ result = (
.box(panel_width, amp_width + 5, amp_height + 2.5) .box(panel_width, amp_width + 5, amp_height + 2.5)
) )
in_text = (
Workplane("YZ")
.workplane(offset=(amp_width / 2) - 3.5)
.center(-15, -2)
.text("IN", 4, 1)
.rotateAboutCenter((1, 0, 0), 180)
)
out_text = (
Workplane("YZ")
.workplane(offset=(amp_width / 2) - 3.5)
.center(15, -2)
.text("OUT", 4, 1)
.rotateAboutCenter((1, 0, 0), 180)
)
result = result.cut(in_text)
result = result.cut(out_text)
panel_holes = ( panel_holes = (
Workplane("ZY") Workplane("ZY")
.workplane(offset=-(amp_length / 2)) .workplane(offset=-(amp_length / 2))
@ -117,6 +142,7 @@ cq.exporters.export(back, "/home/deck/model_files/amp_case_back.step")
try: try:
# show_object(back) # show_object(back)
# show_object(front_text)
show_object(result) show_object(result)
except NameError: except NameError:
pass pass

Loading…
Cancel
Save