aUCBLogo Demos and Tests / mandala
to mandala [size 297]
clearScreen
PenDown
red=rgb 1 0 0
green=rgb 0 1 0
blue=rgb 0 0 1
yellow=rgb 1 1 0
setPenSize [2 2]
disableLineSmooth
drawOutline
setPenColor RGB 1 1 1
repeat 4
[
fillSegment
rt 90
]
setPenSize [2 2]
enableLineSmooth
setPenColor RGB 0 0 0
drawOutline
hideTurtle
end
to drawOutline
pd
circle size
circle size/5
circle size/5.5
circle size/7
circle size/9
repeat 4
[ segment
rt 90
]
end
to segment
repeat 2
[ innerline
backleaf
connections
lt 45/2 leaf ring rt 45/2
rt 45
]
lt 90
end
to innerline
pd fd size/9 pu bk size/9
end
to backleaf
local [p hd]
p=pos hd=heading
pu fd size lt 45 bk size*2/3
pd arc -28.5 size*2/3
pu setPos p setHeading hd
pu fd size rt 45 bk size*2/3
pd arc 28.5 size*2/3
pu setPos p setHeading hd
end
to connections
local [p hd]
p=pos hd=heading
pu fd size lt 123.2
pd fd size*0.39
pu setPos p setHeading hd
pu fd size rt 123.2
pd fd size*0.39
pu setPos p setHeading hd
end
to leaf
local [p hd]
p=pos hd=heading
pu fd size/2 rt 100 fd size*0.3 rt 90+43.3
pd arc 90.5 size/2
pu setPos p setHeading hd
pu fd size/2 lt 100 fd size*0.3 lt 90+43.3
pd arc -90.5 size/2
pu setPos p setHeading hd
end
to ring
local [p hd]
p=pos hd=heading
pu fd size*0.85 lt 78.5
pd arc 2*78.5 size/6.7 arc 2*78.5 size/12
pu setPos p setHeading hd
end
to fill2
; fill
(fill FILL_SURFACE)
end
to fillSegment
local [p hd]
p=pos hd=heading
pu lt 45/2 fd size/10
pd setfc blue fill2
pu fd size/30
pd setfc green fill2
pu fd size/30
pd setfc blue fill2
pu fd size/40
pd setfc red fill2
pu fd size/2
pd setfc yellow fill2
pu fd size/5
pd setfc red fill2
pu fd size/15
pd setfc yellow fill2
pu setPos p setHeading hd
pu rt 45/2 fd size/10
pd setfc red fill2
pu fd size/30
pd setfc green fill2
pu fd size/30
pd setfc blue fill2
pu fd size/40
pd setfc yellow fill2
pu fd size/2
pd setfc red fill2
pu fd size/5
pd setfc red fill2
pu fd size/15
pd setfc yellow fill2
pu setPos p setHeading hd
midFill
rt 45
midFill
end
to midFill
local [p2 hd2]
pu fd size/5.2
pd setfc blue fill2
pu fd size/5
pd setfc blue fill2
pu fd size/2.5
pd setfc green fill2
p2=pos hd2=heading
pu lt 90 fd size/6
pd setfc blue fill2
pu rt 90 fd size/8
pd setfc green fill2
pu setPos p2 setHeading hd2
pu rt 90 fd size/6
pd setfc blue fill2
pu lt 90 fd size/8
pd setfc green fill2
pu setPos p setHeading hd
end