Skip to content

Commit 2d1cf97

Browse files
feat: Turtle.FractalPlant() ( Fixes #95 )
1 parent f62e32c commit 2d1cf97

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Types/Turtle/FractalPlant.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
param(
2+
[double]$Size = 20,
3+
[int]$Order = 4,
4+
[double]$Angle = 25
5+
)
6+
return $this.Rotate(-90).LSystem('-X', [Ordered]@{
7+
'X' = 'F+[[X]-X]-F[-FX]+X'
8+
'F' = 'FF'
9+
}, $Order, [Ordered]@{
10+
'F' = { $this.Forward($Size) }
11+
'\[' = { $this.Rotate($Angle * -1).Push() }
12+
'\]' = { $this.Pop().Rotate($Angle) }
13+
})
14+

0 commit comments

Comments
 (0)