Misc-3D-Prints/taz-6-camera/camera-bracket.py

38 lines
902 B
Python
Raw Normal View History

2022-09-12 16:23:58 -04:00
#!/usr/bin/env python3
import cadquery as cq
from cadquery import exporters
camera_width = 36 + 1
camera_height = 5.5 + 1
bracket_width = 10
bracket_thickness = 3
bolt_hole_diameter = 3.4
corner_radius = 1
result = (
cq
.Workplane("front")
.box(camera_width + bracket_thickness * 2, bracket_width, camera_height + bracket_thickness)
.faces(">Y")
.workplane()
.move(yDist=-bracket_thickness/2)
.rect(camera_width, camera_height, True)
.cutThruAll()
.faces(">X")
.vertices("<Y and <Z")
.workplane(centerOption="CenterOfMass")
.rect(bracket_width, bracket_thickness, centered=False)
.extrude(bracket_width)
.faces(">Z[1]").workplane(centerOption="CenterOfMass").hole(bolt_hole_diameter)
.mirror("YZ", union=True)
.edges("%Line").edges("not <Z").fillet(corner_radius)
)
exporters.export(result, 'camera-bracket.stl')