import cadquery as cq from cq_warehouse.fastener import SocketHeadCapScrew from cq_warehouse.bearing import SingleRowDeepGrooveBallBearing from cq_warehouse.thread import * from cq_warehouse.fastener import * from cq_warehouse.extensions import Workplane from random import randint, choice import functools as fnc import itertools as it # must be 17 mm wide # gap must be at least 4 mm pole_length = 50*MM plate = ( cq.Workplane() .circle(8) .extrude(pole_length) ) simple = False screw = HexHeadScrew("M8-1.25", length=pole_length/2, fastener_type="din931", simple=simple) threaded_hole = plate.faces(">Z[1]").threadedHole(screw, pole_length/2, simple=simple, fit="Loose") show_object(threaded_hole) cq.exporters.export(threaded_hole, "/home/deck/cad_files/threaded_tool_holder.step") cq.exporters.export(screw, "/home/deck/cad_files/threaded_tool_holder_screw.step")