2 changed files with 105 additions and 5 deletions
@ -0,0 +1,74 @@ |
|||||
|
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) |
||||
|
|
||||
|
bearing_od = 22.0 |
||||
|
bearing_or = bearing_od / 2.0 |
||||
|
bearing_diameter = 8.0 |
||||
|
bearing_radius = bearing_diameter / 2.0 |
||||
|
|
||||
|
bearing_thickness = 6.93 |
||||
|
|
||||
|
spinner = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=0) |
||||
|
.move(-37.9, 19) |
||||
|
.cylinder(5, 15) |
||||
|
.workplane(offset=-2) |
||||
|
.move(-37, 19) |
||||
|
.cylinder(10, bearing_radius) |
||||
|
) |
||||
|
|
||||
|
tree = cq.importers.importStep("/home/deck/Downloads/xmas_tree.step") |
||||
|
|
||||
|
spinner = tree.union(spinner) |
||||
|
|
||||
|
spinner_split_top = ( |
||||
|
tree.workplane(5) |
||||
|
.split(keepTop=True) |
||||
|
.workplane(offset=-10) |
||||
|
.move(-37, 19) |
||||
|
.cylinder(10, bearing_radius) |
||||
|
.workplane(offset=-2.9) |
||||
|
.move(-37, 19) |
||||
|
.cylinder(10, bearing_radius + 3) |
||||
|
) |
||||
|
|
||||
|
spinner_split_bottom = ( |
||||
|
tree.workplane(5) |
||||
|
.split(keepBottom=True) |
||||
|
.workplane(offset=7.8) |
||||
|
.move(-37.9, 19) |
||||
|
.cylinder(bearing_thickness, bearing_or, combine="cut") |
||||
|
.workplane(offset=6.8) |
||||
|
.move(-37.9, 19) |
||||
|
.cylinder(20, bearing_radius, combine="cut") |
||||
|
.workplane(offset=-3.0) |
||||
|
.move(-37.9, 19) |
||||
|
.cylinder(13.3, 15) |
||||
|
.workplane(offset=-7.12) |
||||
|
.move(-37.9, 19) |
||||
|
.cylinder(bearing_thickness + 3.3, bearing_or, combine="cut") |
||||
|
) |
||||
|
|
||||
|
cq.exporters.export(spinner, "/home/deck/model_files/xmas_spinner.stl") |
||||
|
cq.exporters.export(spinner_split_top, "/home/deck/model_files/xmas_spinner_top.stl") |
||||
|
cq.exporters.export( |
||||
|
spinner_split_bottom, "/home/deck/model_files/xmas_spinner_bottom.stl" |
||||
|
) |
||||
|
|
||||
|
try: |
||||
|
show_object(spinner_split_bottom) |
||||
|
except NameError: |
||||
|
pass |
Loading…
Reference in new issue