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 base_diameter = 100 base_radius = base_diameter / 2 band_diameter = 50 band_radius = band_diameter / 2 clock_diameter = 35 clock_radius = clock_diameter / 2 winding_knob_dist = clock_radius band_width = 18.13 first_circle_height = 120 # how tall the horizontal circle part will be Workplane = cqmore.extend(Workplane) Workplane.addSvgPath = addSvgPath stand_base = Workplane() stand_base = stand_base.cylinder(first_circle_height, band_radius) simple = False screw = ButtonHeadScrew( size="M16-2", fastener_type="iso7380_1", length=50 * MM, simple=simple ) scaled_screw = screw.scale(0.90) screw_thread = Workplane("YZ").workplane(offset=60).move(0, 40).cylinder(100, 10).threadedHole( screw, 30, simple=simple, fit="Loose" ) screw_thread = screw_thread.workplane(offset=50).center(0, 50).sphere(60, combine="cut") stand_base = stand_base.union(screw_thread) stand_base = stand_base.faces(">Z[0]").sphere(base_radius) stand_base = stand_base.workplane(offset=base_radius).box( base_diameter, base_radius * 2, base_radius * 2, combine="cut" ) stand_base = ( stand_base.workplane(offset=base_radius - 10) .rect(base_radius, base_radius, forConstruction=True) .vertices() .cylinder(5, 5, combine="cut") ) cq.exporters.export(stand_base, "/home/deck/model_files/watch_stand_base.step") try: show_object(stand_base) except NameError: pass