teaching machines

Caterpillar

October 10, 2013 by . Filed under madeup, public.

If we can make 2-D art out of nothing but dots on the paper, it seems we should be able to make 3-D objects out of nothing but spheres. And we now can in Madeup. I added a dot command, such that a sphere is placed at every point the programmer visits with a move command. My test run was to build a caterpillar:

A caterpillar composed of a sine wave of dots.

On my TODO list: iterate along the wave so that the samples are evenly spaced. This requires a visit back to the lessons of calculus.

The code that produced this fellow is:

nsides = 50
delta = 20.0
radius = 20
theta = 0
amplitude = 70

-- Body
while theta <= 360
  moveto theta (amplitude * (sin theta)) 0
  theta = theta + delta
end

-- Eyes
radius = 10
moveto 0 10 -15
moveto 0 -10 -15

dot