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.

36 lines
1.2 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
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
hole_diameter = 3.66
hole_radius = hole_diameter / 2.0
screw_dist = 76
bracket_height = 5
result = Workplane()
result = result.box(60, bracket_height, 7)
result = result.workplane(offset=-bracket_height + 4).box(60, 1.2, 7, combine="cut")
result = result.workplane(offset=-bracket_height+2.38).move(0, 4).box(100, 5, 2)
result = result.workplane(offset=(bracket_height/2)-1).move(0, 5.5).box(100, 2, 6)
holes = Workplane("XZ").workplane(offset=-6).move(-37, 1).line(screw_dist, 0, forConstruction=True).vertices().cylinder(4, hole_radius)
result = result.cut(holes)
cq.exporters.export(result, "/home/deck/model_files/ssd_bracket.step")
try:
show_object(result)
except NameError:
pass