Browse Source

adjust sizing again

master
wes 9 months ago
parent
commit
8b783ac168
  1. 17
      amp_case.py

17
amp_case.py

@ -9,20 +9,22 @@ from svg_path import addSvgPath
from svgpathtools import svg2paths from svgpathtools import svg2paths
import cadquery as cq import cadquery as cq
import cqmore import cqmore
from math import ceil, floor
amp_bottom_height = 16 # how tall the pcb is amp_bottom_height = 16 # how tall the pcb is
battery_width = 26 battery_width = 26
battery_height = 17 battery_height = 17
amp_width = 50 amp_width = 62
amp_length = 60 amp_length = 60
amp_height = battery_height + amp_bottom_height + 4 amp_height = battery_height + amp_bottom_height + 10
side_width = 3 side_width = 3
middle_width = 2
result = Workplane().box(amp_length, amp_width, 2) result = Workplane().box(amp_length, amp_width, side_width)
result = ( result = (
result.workplane(offset=(amp_height / 2) - 1) result.workplane(offset=(floor(amp_height / 2) - 1))
.center(0, -(amp_width / 2)) .center(0, -(amp_width / 2))
.line(0, amp_width, forConstruction=True) .line(0, amp_width, forConstruction=True)
.vertices() .vertices()
@ -30,11 +32,16 @@ result = (
) )
result = ( result = (
result.workplane(offset=(amp_height / 2) + side_width * 2) result.workplane(offset=ceil((amp_height / 2) + side_width * 2) + 1)
.center(0, amp_width / 2) .center(0, amp_width / 2)
.box(amp_length, amp_width + side_width, side_width) .box(amp_length, amp_width + side_width, side_width)
) )
result = result.workplane(offset=0).box(amp_length, amp_width + side_width, middle_width)
cq.exporters.export(result, "/home/deck/model_files/amp_case.step")
try: try:
show_object(result) show_object(result)
except NameError: except NameError:

Loading…
Cancel
Save