from extruder_turtle import ExtruderTurtle
import math

## Parameters for the spiral
N = 40  ## Number of subdivisions of one round-trip
radius = 20  ## Outer radius of the spiral
dtheta = 2 * math.pi / N  ## Change in heading after each step
dx = radius * dtheta  ## Forward movement during each step
dr = -0.5 / N  ## Change in radius with each step

t = ExtruderTurtle()

t.name("alien-tree.gcode")
t.setup(x=100, y=100)
t.set_density(0.07)  # 0.05
t.rate(500)

while radius > 0:
    t.forward(dx)
    t.right(dtheta)
    radius += dr
    dx = radius * dtheta

for l in range(50):
    t.extrude(0.1)
    t.dwell(100)
    t.lift(0.05)  # 0.1

for x in range(60):
    for l in range(10):
        t.extrude(0.1)
Пример #2
0
from extruder_turtle import ExtruderTurtle
import math

## Parameters for the spiral
N = 40                 ## Number of subdivisions of one round-trip
RADIUS = 5             ## Outer radius of the spiral
dtheta = 2*math.pi/N    ## Change in heading after each step
dx = RADIUS * dtheta    ## Forward movement during each step
dr = -0.5/N             ## Change in radius with each step

t = ExtruderTurtle()

t.name("hair-pillar.gcode")
t.setup(x=150, y=150)
t.set_density(0.07) # 0.05
t.rate(500)

radius = RADIUS
while radius>0:
    t.forward(dx)
    t.right(dtheta)
    radius += dr
    dx = radius * dtheta

for l in range(200):
    t.extrude(0.1)
    t.dwell(200)
    t.lift(0.1) # 0.1

t.penup()
t.forward(80)