Skip to content

Commit 1fa5abf

Browse files
docs: Adding more examples to README
1 parent 5a7f4f6 commit 1fa5abf

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ $turtle | Save-Turtle ./Square.svg
107107
~~~
108108

109109
This just demonstrates how we can construct shapes out of these two simple primitive steps.
110+
110111
We can also just say, make a square directly:
111112

112113
~~~PowerShell
113114
New-Turtle | Move-Turtle Square 10 | Save-Turtle ./Square.svg
114115
~~~
115-
We can use loops:
116+
117+
We can use the same techniques to construct other shapes.
118+
119+
For example, this builds us a hexagon:
116120

117121
~~~PowerShell
118122
$turtle = New-Turtle
@@ -187,7 +191,6 @@ Lets show the first three generations of the box fractal:
187191
~~~
188192

189193

190-
@"
191194
<div align='center'>
192195
<img src='./Examples/BoxFractal1.svg' alt='Box Fractal 1' width='50%' />
193196
<img src='./Examples/BoxFractal2.svg' alt='Box Fractal 2' width='50%' />
@@ -209,5 +212,13 @@ For example, here is an example of a pattern comprised of Koch Snowflakes:
209212
<div align='center'>
210213
<img src='./Examples/KochSnowflakePattern.svg' alt='Snowflake Pattern' width='50%' />
211214
</div>
215+
We can also animate the pattern, for endless variety:
216+
217+
~~~PowerShell
218+
$turtle = turtle KochSnowflake 10 4 | Set-Turtle -Property PatternTransform -Value @{scale=0.33} | set-turtle -property Fill -value '#4488ff' | Set-Turtle -Property PatternAnimation -Value " <animateTransform attributeName='patternTransform' attributeType='XML' type='scale' values='0.66;0.33;0.66' dur='23s' repeatCount='indefinite' additive='sum' /> <animateTransform attributeName='patternTransform' attributeType='XML' type='rotate' from='0' to='360' dur='41s' repeatCount='indefinite' additive='sum' /> <animateTransform attributeName='patternTransform' attributeType='XML' type='skewX' values='30;-30;30' dur='83s' repeatCount='indefinite' additive='sum' /> <animateTransform attributeName='patternTransform' attributeType='XML' type='skewY' values='30;-30;30' dur='103s' repeatCount='indefinite' additive='sum' /> <animateTransform attributeName='patternTransform' attributeType='XML' type='translate' values='0 0;42 42;0 0' dur='117s' repeatCount='indefinite' additive='sum' /> " $turtle | save-turtle -Path ./EndlessSnowflake.svg -Property Pattern Pop-Location
219+
~~~
220+
<div align='center'>
221+
<img src='./Examples/EndlessSnowflake.svg' alt='Endless Snowflake Pattern' width='100%' />
222+
</div>
212223
![SierpinskiTriangle](./Examples/EndlessSierpinskiTrianglePattern.svg)
213224

README.md.ps1

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ This just demonstrates how we can construct shapes out of these two simple primi
147147
'@
148148

149149

150-
151150
@'
151+
152152
We can also just say, make a square directly:
153153
154154
~~~PowerShell
@@ -159,7 +159,10 @@ New-Turtle | Move-Turtle Square 10 | Save-Turtle ./Square.svg
159159

160160

161161
@'
162-
We can use loops:
162+
163+
We can use the same techniques to construct other shapes.
164+
165+
For example, this builds us a hexagon:
163166
164167
~~~PowerShell
165168
$turtle = New-Turtle
@@ -274,7 +277,6 @@ $(
274277
)
275278
)
276279
277-
@"
278280
<div align='center'>
279281
<img src='./Examples/BoxFractal1.svg' alt='Box Fractal 1' width='50%' />
280282
<img src='./Examples/BoxFractal2.svg' alt='Box Fractal 2' width='50%' />
@@ -313,6 +315,22 @@ $SnowFlakePattern = . $MakeSnowflakePattern
313315
</div>
314316
"@
315317

318+
@"
319+
We can also animate the pattern, for endless variety:
320+
321+
~~~PowerShell
322+
$(
323+
Get-Content ./Examples/EndlessSnowflake.turtle.ps1 |
324+
Select-Object -Skip 1
325+
)
326+
~~~
327+
"@
328+
329+
@"
330+
<div align='center'>
331+
<img src='./Examples/EndlessSnowflake.svg' alt='Endless Snowflake Pattern' width='100%' />
332+
</div>
333+
"@
316334

317335
#endregion LSystems
318336

0 commit comments

Comments
 (0)