File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Generates a Twin Dragon Curve.
4+ . DESCRIPTION
5+ Generates a Twin Dragon Curve using turtle graphics.
6+ . LINK
7+ https://en.wikipedia.org/wiki/Dragon_curve#Twindragon
8+ . EXAMPLE
9+ $turtle.TwinDragonCurve().Pattern.Save("$pwd/TwinDragonCurve.svg")
10+ . EXAMPLE
11+ $turtle.Clear()
12+ $turtle.TwinDragonCurve(20,7,90)
13+ $turtle.PatternTransform = @{
14+ 'scale' = 0.9
15+ 'rotate' = 45
16+ }
17+
18+ $turtle.PatternAnimation = "
19+ <animateTransform attributeName='patternTransform' attributeType='XML' type='scale' values='1;0.9;1' dur='19s' repeatCount='indefinite' additive='sum' />
20+ <animateTransform attributeName='patternTransform' attributeType='XML' type='skewY' values='30;-30;30' dur='67s' repeatCount='indefinite' additive='sum' />
21+ <animateTransform attributeName='patternTransform' attributeType='XML' type='skewX' values='30;-30;30' dur='83s' repeatCount='indefinite' additive='sum' />
22+ "
23+ $turtle.Pattern.Save("$pwd/TwinDragonCurve2.svg")
24+ #>
25+
26+ param (
27+ [double ]$Size = 20 ,
28+ [int ]$Order = 6 ,
29+ [double ]$Angle = 90
30+ )
31+ return $this.L (' FX+FX+' , [Ordered ]@ {
32+ X = ' X+YF'
33+ Y = ' FX-Y'
34+ }, $Order , [Ordered ]@ {
35+ ' \+' = { $this.Rotate ($Angle ) }
36+ ' -' = { $this.Rotate ($Angle * -1 ) }
37+ ' [F]' = { $this.Forward ($Size ) }
38+ })
You can’t perform that action at this time.
0 commit comments