You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
from cadquery import exporters
|
|
from cq_warehouse.extensions import Workplane
|
|
from cq_warehouse.fastener import *
|
|
from cq_warehouse.thread import *
|
|
from cqmore.curve import archimedeanSpiral, circle
|
|
from cqmore.polygon import regularPolygon, star
|
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid
|
|
from svg_path import addSvgPath
|
|
from svgpathtools import svg2paths
|
|
import cadquery as cq
|
|
import cqmore
|
|
from math import ceil, floor
|
|
|
|
side_width = 5
|
|
bottom_width = 5
|
|
middle_width = 2
|
|
|
|
amp_bottom_height = 19 + bottom_width + middle_width # how tall the pcb is
|
|
battery_width = 26
|
|
battery_height = 17
|
|
amp_width = 62
|
|
amp_length = 60
|
|
amp_height = battery_height + amp_bottom_height
|
|
|
|
result = Workplane().box(amp_length, amp_width, middle_width)
|
|
|
|
result = (
|
|
result.workplane(offset=0)
|
|
.center(0, -(amp_width / 2))
|
|
.line(0, amp_width, forConstruction=True)
|
|
.vertices()
|
|
.box(amp_length, side_width, amp_height)
|
|
)
|
|
|
|
result = (
|
|
result.workplane(offset=amp_height/2)
|
|
.center(0, amp_width / 2)
|
|
.box(amp_length, amp_width + bottom_width, bottom_width)
|
|
)
|
|
|
|
result = result.workplane(offset=-(side_width*2) + middle_width).center((amp_width/2)-(side_width/2)-1, 0).box(side_width, amp_width, amp_height-0.45)
|
|
|
|
cq.exporters.export(result, "/home/deck/model_files/amp_case.step")
|
|
|
|
try:
|
|
show_object(result)
|
|
except NameError:
|
|
pass
|
|
|