Skip to content

Instantly share code, notes, and snippets.

@bakirillov
Created April 19, 2022 14:57
Show Gist options
  • Save bakirillov/e0256b9be8504c84e74accf38ab9b1fc to your computer and use it in GitHub Desktop.
Save bakirillov/e0256b9be8504c84e74accf38ab9b1fc to your computer and use it in GitHub Desktop.
HedgeStick v1
from sdf import *
s = tetrahedron(0.75)
s = s.translate(Z * -3) | s.translate(Z * 3)
f = sphere(3).union(
s.orient(X), s.orient(Y), s.orient(Z),
s.orient(X+Y), s.orient(Y+Z), s.orient(X+Y+Z),
k=1
)
d = box((30, 30, 2)).translate(Z*-2)
stick = rounded_cylinder(1, 1, 30).rotate(pi / 2, X).translate(Y*10)
circle_of_needles = rounded_cone(0.3, 0.1, 3).circular_array(10, 1)
needles = circle_of_needles.scale((4, 4, 2)) | circle_of_needles.scale((2, 2, 2))
k = difference(f, d)
hs = stick.union(k).union(needles)
hs.save('hedgestick_v1.stl', samples=2**10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment