#!/usr/bin/env python3 import cadquery as cq from cadquery import exporters camera_width = 43.4 + 0.5 camera_height = 6 cutout_width = 18 - 0.5 cutout_length = 21.5 - 0.5 cutout_straight_length = 16 - 0.5 bracket_width = cutout_length bracket_thickness = 3 bolt_hole_diameter = 3.4 bolt_hole_spacing = 10 bolt_offset_y = 9.35 # derived from bolt spacing from edge bolt_tab_width = bolt_hole_diameter * 3 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("Z").fillet(corner_radius) .faces(">Z[1]").edges(">X or Y").fillet(corner_radius) ) exporters.export(result, 'camera-bracket.stl')