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 Workplane = cqmore.extend(Workplane) Workplane.addSvgPath = addSvgPath simple = False width = 120 length = 120 height = 30 screw = ButtonHeadScrew( size="M16-2", fastener_type="iso7380_1", length=(height - 2) * MM, simple=simple ) stand_base = Workplane().box(width, length, height) stand_base = stand_base.workplane(offset=23.8).threadedHole( screw, height - 2, simple=simple, fit="Loose" ) stand_base = ( stand_base.workplane(offset=-(height / 2.0)) .rect(width - 15, length - 15, forConstruction=True) .vertices() .cylinder(0.6, 6 / 2.0, combine="cut") ) stand_top = Workplane().union(screw).workplane(offset=11).cylinder(10.0, 60.0) stand_top = ( stand_top.workplane(offset=3.2389) .rect(width - 30, length - 30, forConstruction=True) .vertices() .cylinder(5.0, 10.0) ) cq.exporters.export(stand_base, "/home/deck/model_files/microscope_platform_base.stl") cq.exporters.export(stand_top, "/home/deck/model_files/microscope_platform_top.stl") try: show_object(stand_top) except NameError: pass