Skip to content

Commit 2c93459

Browse files
author
James Brundage
committed
feat: Turtle.get/set_Fill ( Fixes PoshWeb#54 )
2 parents b5d6706 + c5c687e commit 2c93459

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Turtle.types.ps1xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,48 @@ return $this.LSystem('F', @{
167167
})
168168
</Script>
169169
</ScriptMethod>
170+
<ScriptMethod>
171+
<Name>KochIsland</Name>
172+
<Script>
173+
&lt;#
174+
.SYNOPSIS
175+
Generates a Koch Island
176+
.DESCRIPTION
177+
Generates a Koch Island using turtle graphics.
178+
.EXAMPLE
179+
$turtle.KochIsland().Pattern.Save("$pwd/KochIsland.svg")
180+
.EXAMPLE
181+
$turtle.Clear()
182+
$turtle.KochIsland(10,4)
183+
$turtle.PatternTransform = @{
184+
'scale' = 0.9
185+
}
186+
$turtle.PatternAnimation = "
187+
&lt;animateTransform attributeName='patternTransform' attributeType='XML' type='scale' values='1;0.9;1' dur='19s' repeatCount='indefinite' additive='sum' /&gt;
188+
&lt;animateTransform attributeName='patternTransform' attributeType='XML' type='skewY' values='0;-30;30;-30;0' dur='67s' repeatCount='indefinite' additive='sum' /&gt;
189+
&lt;animateTransform attributeName='patternTransform' attributeType='XML' type='skewX' values='0;-30;30;-30;0' dur='83s' repeatCount='indefinite' additive='sum' /&gt;
190+
&lt;animateTransform attributeName='patternTransform' attributeType='XML' type='rotate' values='0;360' dur='163s' repeatCount='indefinite' additive='sum' /&gt;
191+
&lt;animateTransform attributeName='patternTransform' attributeType='XML' type='translate' values='0 0;200 200;0 0' dur='283s' repeatCount='indefinite' additive='sum' /&gt;
192+
"
193+
$turtle.Pattern.Save("$pwd/KochIsland2.svg")
194+
#&gt;
195+
param(
196+
[double]$Size = 20,
197+
[int]$Order = 3,
198+
[double]$Angle = 90
199+
)
200+
201+
return $this.LSystem('W', [Ordered]@{
202+
W = 'F+F+F+F'
203+
F = 'F+F-F-FF+F+F-F'
204+
}, $Order, [Ordered]@{
205+
'\+' = { $this.Rotate($Angle) }
206+
'-' = { $this.Rotate($Angle * -1) }
207+
'[FG]' = { $this.Forward($Size) }
208+
})
209+
210+
</Script>
211+
</ScriptMethod>
170212
<ScriptMethod>
171213
<Name>KochSnowflake</Name>
172214
<Script>

0 commit comments

Comments
 (0)