Skip to content

Commit 3b9faba

Browse files
author
James Brundage
committed
fix: Turtle.BoxFractal ( Fixes PoshWeb#37 )
Adding examples and making L, LSystem
1 parent fe80d7d commit 3b9faba

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

Types/Turtle/BoxFractal.ps1

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1-
1+
<#
2+
.EXAMPLE
3+
$turtle.PatternAnimation = ''
4+
$turtle.Clear().BoxFractal().Pattern.Save("$pwd/BoxFractal.svg")
5+
6+
.EXAMPLE
7+
$turtle.Clear()
8+
$turtle.BoxFractal(10,4)
9+
$turtle.PatternTransform = @{
10+
'scale' = 0.9
11+
}
12+
$turtle.PatternAnimation = "
13+
<animateTransform attributeName='patternTransform' attributeType='XML' type='scale' values='1;0.9;1' dur='19s' repeatCount='indefinite' additive='sum' />
14+
<animateTransform attributeName='patternTransform' attributeType='XML' type='skewY' values='0;-30;30;-30;0' dur='67s' repeatCount='indefinite' additive='sum' />
15+
<animateTransform attributeName='patternTransform' attributeType='XML' type='skewX' values='0;-30;30;-30;0' dur='83s' repeatCount='indefinite' additive='sum' />
16+
"
17+
$turtle.Pattern.Save("$pwd/BoxFractal2.svg")
18+
#>
219
param(
320
[double]$Size = 20,
421
[int]$Order = 4,
522
[double]$Angle = 90
623
)
7-
return $this.L('F-F-F-F', [Ordered]@{
24+
return $this.LSystem('F-F-F-F', [Ordered]@{
825
F = 'F-F+F+F-F'
926
}, $Order, [Ordered]@{
1027
'\+' = { $this.Rotate($Angle) }

0 commit comments

Comments
 (0)