-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig file.txt
141 lines (125 loc) · 3.91 KB
/
config file.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
"parameterized Koch" #from p1,0 to 1.5,sqrt(3)/2
$dx = 1.5-p1
$dy = 1.5+(p1*(sqrt(3)/2-1.5))
$ang = atan2d($dy,$dx)
$dist = sqrt($dx*$dx+$dy*$dy)
a : a@ p1 left $ang a@ $dist right 2*$ang ~a@ $dist left $ang a@ p1
system ? rotationsteps 6
"parameterized dragon"
A : A right 90-90*p1 ~A
niner
a : a + |a - a + |a - a right 60 |a - a + |a left 60 a
system ? rotationangle 120 #drawmethod midpoint
sevener
$sm = asind(1/(2*sqrt(7)))
$sm2 = asind(sqrt(3)/(2*sqrt(7)))
a : a \
right 90+$sm-$sm2 a \
right 90+$sm2-$sm ~a \
left 2*$sm2 a \
right 2*$sm2 ~a \
left 90+$sm2-$sm a \
left 90+$sm-$sm2 a
13.1
a : a - a a - a + a - a a a + a - a + a a + a
system ? rotationangle 120
dragon
A : A - ~A
Hilbert2
S : A - forward - A - forward -
A : + ~A forward - A forward A - forward ~A +
A ? nodraw localscale 1/2
forward : forward
forward ? localscale 1/2
AltDragon-p
$a = 90*p1
$len1 = sind($a)
$len2 = cosd($a)
S : left 90-$a ~S@ $len1 right 90 S@ $len2 left $a
#A : left acosd(1/sqrt(5)) |A right 90 ~|A@ 2 left asind(1/sqrt(5))
#A ? localscale 1/sqrt(5)
bisquare
system ? drawmethod drop 45 sqrt(2)/2
a : + |a@ 2 - a a a - |a |a +
Terdragon
A : A - A + A
system ? rotationangle 120
sevener.1
$sm2 = asind(sqrt(3)/(2*sqrt(7)))
$tilang = 120-$sm2
start : a
e : a left 120 a left 120 a left 120
d : [ a ] left 60 \
[ a ] left 60 \
[ a ] left 60 \
[ a ] left 60 \
[ a ] left 60 \
[ a ] left 60
c : [ a ] left $tilang invis@ 1/sqrt(7) right $tilang-60*p1 a
a : a - a a - a + a a + a
b : [ a ] left 120 [ a ] left 120 [ a ] left 120
invis ? invisible
invis : invis
system ? rotationangle 120
"Tree test"
start : left 90 A
start ? nofix
A : [ left 49 B ] [ right 68 B ] B A@ 1/2
B : B
"Parameterized Sierpinski gasket"
A : + ~A@ $cosang - A@ 1-2*$cosang*$cosang - ~A@ $cosang +
s : A left 60 A left 60 A left 60 A left 60 A left 60 A
$ang = (p1*45+45)
$cosang = cosd($ang)
system ? rotationangle $ang
#system ? drawmethod drop 0 1/2
"Hilbert curve"
system ? drawmethod drop 45 1/sqrt(2)
seg : |seg - seg seg + |seg
s : seg left 180 seg left 180
"Wikipedia Sierpinski Triangle"
start : F left 120 G left 120 G
F : F left 120 G right 120 F right 120 G left 120 F
G : G
F ? localscale 1/2
Tromino #63.43... is acos(1/sqrt(5))
s : lc
start : right 90 invis left 90 \
line left 90 line left 90 line@ 1/2 left 90 line@ 1/2 right 90 line@ 1/2 \
left 90 line@ 1/2 left 90 startlc
startlt : left 63.43494882 lt@ sqrt(5)/2
startlm : left 45 lm@ 1/sqrt(2)
startlc : lc
startll : left 45 ll@ sqrt(2)
startct : invis left 180-63.43494882 ct@ sqrt(5)/2
ll : right 45 ~|lc@ 1/(2*sqrt(2)) \
left 45 lm@ 1/4 \
left 135-63.43494882 ct@ sqrt(5/32) \
right 90 ~ct@ sqrt(5/32) left 63.43494882-45
tt : right 90 ll left 90 lm@ 1/2 left 45 ~|lc@ 1/sqrt(2) left 45 ~|lm@ 1/2 right 90
ct : left 63.43494882 ~lc@ 1/sqrt(5) \
right 63.43494882 |lt@ 1/2 \
right 90 ~|lt@ 1/2 \
left 63.43494882+45 ~|lm@ 1/sqrt(10) right 63.43494882-45
lm : right 45 ~|lc@ sqrt(2)/2 left 45 ll left 90 lm@ 1/2 left 90 |lm@ 1/2 right 180
lc : left 63.43494882 |ct@ sqrt(5)/4 \
right 63.43494882-45 tt@ sqrt(2)/4 \
right 135-63.43494882 ~lt@ sqrt(5)/4 \
right 63.43494882 |lc@ 1/2 left 90
lt : right 63.43494882 ~|lc@ 1/sqrt(5) \
left 45 lm@ 1/sqrt(10) \
left 45 ~|lc@ 1/sqrt(5) \
left 45 ~|lm@ 1/sqrt(10) right 135-63.43494882
line : line
invis : invis
invis ? invisible
#ll ? drawmethod midpoint
#tt ? drawmethod midpoint
#ct ? drawmethod midpoint
#lm ? drawmethod midpoint
#lc ? drawmethod midpoint
#lt ? drawmethod midpoint
"Menger sponge"
A : invis + A A A - |A - A A A - |A + + invis invis
invis : invis
invis ? invisible