aUCBLogo Demos and Tests / fractal_tiling_tess
to fractal_tiling_tess
ct cs ht setpensize 0
updategraph
setpc rgb 0 0 0
backc=rgb 1 1 1
let[[size 200]
[f (sqrt (4-2*sqrt 2))/2]
[n0 10]]
pu bk :size/2
localmake "k0 1
tile n0 :size (list (list pos Heading))
make "k0 -1
home pu bk :size/2
tile n0 :size (list (list pos Heading))
end
to tile :n :size :list1 [:k :k0][:list2 []]
if :n==0[stop]
setpc rgb 0 0 0
if empty? :list1[(tile :n-1 :size/sqrt 2 :list2 0-:k [] ) stop]
;(show "list1 :list1)
local [posn posn1] make "posn first :list1
pu setpos first :posn seth last :posn
;comment[
make "posn1 list pos heading
rt :k*22.5 fd :size*:f
if or not pixel == rgb 1 1 1 (signum xcor) == 0-:k0
[setpos first :posn1 seth last :posn1
(tile :n :size bf :list1 :k :list2 ) stop]
setpos first :posn1 seth last :posn1
;]
pd
Tesselation
[
setpc rgb 1 n/n0 0
pd fd :size rt :k*135
make "list2 fput list pos heading :list2
fd :size/sqrt 2 rt :k*90
make "list2 fput list pos heading :list2
fd :size/sqrt 2 rt :k*135
]
pu
(tile :n :size bf :list1 :k :list2 )
;comment[
setpos first :posn1 seth last :posn1
pd
fd :size rt :k*135
fd :size/sqrt 2 rt :k*90
fd :size/sqrt 2 rt :k*135
pu
;]
end