File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,47 @@ return $this
686
686
687
687
</Script >
688
688
</ScriptMethod >
689
+ <ScriptMethod >
690
+ <Name >MooreCurve</Name >
691
+ <Script >
692
+ < #
693
+ .SYNOPSIS
694
+ Generates a Moore curve.
695
+ .DESCRIPTION
696
+ Generates a Moore curve using turtle graphics.
697
+ .LINK
698
+ https://en.wikipedia.org/wiki/Moore_curve
699
+ .EXAMPLE
700
+ $turtle = New-Turtle
701
+ $turtle.MooreCurve().Pattern.Save("$pwd/MooreCurvePattern.svg")
702
+ .EXAMPLE
703
+ Move-Turtle MooreCurve 15 5 |
704
+ Set-Turtle Stroke '#4488ff' |
705
+ Save-Turtle "./MooreCurve.svg"
706
+ #>
707
+ param(
708
+ [double]$Size = 10,
709
+ [int]$Order = 5,
710
+ [double]$Angle = 90
711
+ )
712
+
713
+
714
+ return $this.LSystem(
715
+ 'LFL+F+LFL',
716
+ [Ordered]@{
717
+ L = '-RF+LFL+FR-'
718
+ R = '+LF-RFR-FL+'
719
+ },
720
+ 4,
721
+ @{
722
+ F = { $this.Forward(10) }
723
+ '\+' = { $this.Rotate(90) }
724
+ '-' = { $this.Rotate(-90) }
725
+ }
726
+ )
727
+
728
+ </Script >
729
+ </ScriptMethod >
689
730
<ScriptMethod >
690
731
<Name >PeanoCurve</Name >
691
732
<Script >
You can’t perform that action at this time.
0 commit comments