Using tweaks to polygon repeats can make pretty patterns.
Small changes to the angle and big changes to the repeat can generate some interesting patterns. Try changing sides
and gap
to other small numbers.
setps 5 setpc red
make "sides 3
make "gap 5
rpt 360/:gap [ fd 8 rt 360/:sides - :gap ]
This code puts the repeat pattern for a square inside the repeat pattern for an octagon.
repeat 8 [ repeat 4 [ rt 90 fd 4 ] bk 4 lt 45 ]
What would happen if you changed the 8
to a 6
and the 45
to a 60
? Predict the shape and then try the code.
Make this procedure and call it leaf
:
make "x 3
make "a 90/:x
make "c (90-:a)/2
make "s 2
fd :s
lt :c
rpt 2 [ rpt :x [ fd 8/:x rt :a ] rt 90 ]
rt :c
bk :s
Call it like this in multiline view:
setpc red setps 2
make "n 12
rpt :n [ leaf rt 360/:n ]
Try changing the variables
inside the leaf
procedure and in the caller. Can you predict the shape for the different numbers you choose?