Skip to content

Commit 7f4980f

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.FlowerPetal ( Fixes #124 )
1 parent a8f7647 commit 7f4980f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Turtle.types.ps1xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,45 @@ $null = foreach ($n in 1..$StepCount) {
391391
$this.Rotate($Rotation)
392392
}
393393

394+
return $this
395+
</Script>
396+
</ScriptMethod>
397+
<ScriptMethod>
398+
<Name>FlowerPetal</Name>
399+
<Script>
400+
&lt;#
401+
.SYNOPSIS
402+
Draws a flower made of petals
403+
.DESCRIPTION
404+
Draws a flower made of a series of petals.
405+
406+
Each petal is a combination of two arcs and rotations.
407+
.EXAMPLE
408+
turtle FlowerPetal 60
409+
#&gt;
410+
param(
411+
# The radius of the flower
412+
[double]
413+
$Radius = 10,
414+
415+
# The rotation per step
416+
[double]
417+
$Rotation = 30,
418+
419+
# The angle of the petal.
420+
[double]
421+
$PetalAngle = 60,
422+
423+
# The number of steps.
424+
[ValidateRange(1,1mb)]
425+
[int]
426+
$StepCount = 12
427+
)
428+
429+
foreach ($n in 1..$stepCount) {
430+
$this = $this.Petal($radius, $PetalAngle).Rotate($Rotation)
431+
}
432+
394433
return $this
395434
</Script>
396435
</ScriptMethod>

0 commit comments

Comments
 (0)