Skip to content

Commit 8b1558e

Browse files
docs: Turtle.StepSpiral ( Fixes #122 )
Adding examples
1 parent f0ec39c commit 8b1558e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Examples/EndlessStepSpiral.turtle.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Push-Location $PSScriptRoot
2+
$myName = $MyInvocation.MyCommand.Name -replace '\.turtle\.ps1$'
3+
$turtle = turtle @('StepSpiral',16, 90, 16, 20, 'rotate',90 * 4) |
4+
Set-Turtle -Property PatternTransform -Value @{scale=1} |
5+
# set-turtle -property Fill -value 'currentColor' |
6+
# set-turtle -property FillRule -value 'evenodd' |
7+
Set-Turtle -Property PatternAnimation -Value ([Ordered]@{
8+
type = 'scale' ; values = 0.66,0.33, 0.66 ; repeatCount = 'indefinite' ;dur = "23s"; additive = 'sum'
9+
}, [Ordered]@{
10+
type = 'rotate' ; values = 0, 360 ;repeatCount = 'indefinite'; dur = "41s"; additive = 'sum'
11+
}, [Ordered]@{
12+
type = 'translate';values = "0 0","42 42", "0 0";repeatCount = 'indefinite';additive = 'sum';dur = "117s"
13+
})
14+
15+
$turtle | save-turtle -Path "./$myName.svg" -Property Pattern
16+
Pop-Location

Types/Turtle/StepSpiral.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
By default, this creates an outward spiral.
1010
1111
To create an inward spiral, use a negative StepSize or StepCount.
12+
.EXAMPLE
13+
turtle StepSpiral save ./StepSpiral.svg
14+
.EXAMPLE
15+
turtle @('StepSpiral',3, 120, 'rotate',120 * 3) save ./StepSpiralx3.svg
16+
.EXAMPLE
17+
turtle @('StepSpiral',3, 90, 'rotate',90 * 3) save ./StepSpiralx4.svg
1218
#>
1319
param(
1420
# The length of the first step

0 commit comments

Comments
 (0)