File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Gets the Start Vector a Turtle
4+ . DESCRIPTION
5+ Gets the starting vector for a Turtle.
6+
7+ Setting this value avoids an automatic calculation of a starting position.
8+ . EXAMPLE
9+ turtle width 300 height 300 start 50 square 200 start
10+ #>
11+ return $this .' .Start'
Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Sets the Start Vector for a Turtle
4+ . DESCRIPTION
5+ Sets the starting vector for a Turtle.
6+
7+ This avoids an automatic calculation of a starting position
8+ . EXAMPLE
9+ turtle width 300 height 300 start 50 square 200
10+ #>
11+ param (
12+ [PSObject ]
13+ $Value
14+ )
15+
16+
17+ $aNewStart =
18+ if ($value -is [object []] -and $value -as [float []]) {
19+ [Numerics.Vector2 ]::new($value -as [float []])
20+ } elseif ($value.GetType -and $value.GetType ().IsPrimitive) {
21+ [Numerics.Vector2 ]::new($value , $value )
22+ } elseif ($value.X -and $value.Y ) {
23+ [Numerics.Vector2 ]::new($value.X , $value.Y )
24+ }
25+
26+ if ($aNewStart ) {
27+ $this | Add-Member NoteProperty ' .Start' $aNewStart - Force
28+ }
29+
30+
31+
You can’t perform that action at this time.
0 commit comments