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 shelf_width = 4.0 driver_diameter = 19 driver_radius = driver_diameter / 2 holder_width = 35 holder_thickness = 5 holder_length = holder_width * 6 shelf_hold_height = 20 result = Workplane() result = result.box(holder_length, holder_width, holder_thickness).center( -holder_length / 2, 0 ) offset = 26 for i in range(1, 8): result = result.center(offset, 0) result = result.cylinder(holder_thickness + 1, driver_radius, combine="cut") result = ( result.workplane(offset=(shelf_hold_height / 2) - (holder_thickness / 2)) .center(-(holder_length / 2) + holder_width / 1.25, holder_width / 2 + 6) .box(holder_length, shelf_width * 3, shelf_hold_height) ) result = result.workplane(offset=(shelf_hold_height / 2) - (holder_thickness / 2)).box( holder_length, shelf_width, shelf_hold_height, combine="cut" ) result = result.center(-holder_length / 2 - offset, 0) for i in range(1, 10): result = result.center(offset, 0) result = result.box(18, shelf_width * 4, holder_width, combine="cut") cq.exporters.export(result, "/home/deck/model_files/hexdriver_holder.step") try: show_object(result) except NameError: pass