import cadquery2 as cq from cadquery2 import exporters thickness = 12 width = 60 depth = 10 holes = 6 screws = 2 cable_radius = 1.5 # Threaded insert hole dimensions ti_radius = 2.35 ti_depth = 6.5 # M3x8 screw screw_l = 10 screw_shaft = 8 screw_head_h = 2.5 screw_head_radius = 3.25 screw_radius = 1.5 # Constants here are fudge factors to make things look nice screw_hole_positions = [(6 - width / 2, 0), (width / 2 - 6, 0)] cable_hole_positions = [((i + 1.5) * width / 8 - width / 2, 0) for i in range(holes)] def clamp(): return ( cq.Workplane("XY") .box(width, depth, thickness) .edges("|Z") .fillet(2) # Screw holes .faces("Z") .workplane() .pushPoints(screw_hole_positions) .circle(screw_radius) .cutBlind(-thickness) .faces(">Z") .workplane() .pushPoints(screw_hole_positions) .circle(screw_head_radius) .cutBlind(-screw_head_h) # Cable holes .faces(">Y") .workplane(centerOption="CenterOfBoundBox") .pushPoints(cable_hole_positions) .circle(cable_radius) .cutBlind(-depth) ) exporters.export(clamp(), "full_clamp.stl") top_clamp = clamp().faces("