1 | <?php |
||
17 | class STLVertex |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $coordinatesArray; |
||
23 | |||
24 | /** |
||
25 | * @return array |
||
26 | */ |
||
27 | public function getCoordinatesArray(): array |
||
31 | |||
32 | /** |
||
33 | * @param array $coordinatesArray |
||
34 | * @return STLVertex |
||
35 | */ |
||
36 | public function setCoordinatesArray(array $coordinatesArray): STLVertex |
||
41 | |||
42 | // Class should never be instantiated directly, as it emulates constructor overloading. |
||
43 | private function __construct() |
||
46 | |||
47 | /** |
||
48 | * Class constructor from an STL vertex string. |
||
49 | * |
||
50 | * Example vertex string: |
||
51 | * outerloop |
||
52 | * vertex -71.74323 47.70205 4.666243 |
||
53 | * vertex -72.13071 47.70205 4.932664 |
||
54 | * vertex -72.1506 47.2273 4.905148 |
||
55 | * endloop |
||
56 | * |
||
57 | * @param string $stlVertexString |
||
58 | * @return STLVertex |
||
59 | */ |
||
60 | public static function fromString(string $stlVertexString) : STLVertex |
||
77 | |||
78 | /** |
||
79 | * Class constructor from an STL vertex array. |
||
80 | * |
||
81 | * Example vertex array: |
||
82 | * |
||
83 | * array( |
||
84 | * array( |
||
85 | * -71.74323, 47.70205, 4.666243 |
||
86 | * ), |
||
87 | * array( |
||
88 | * -72.13071, 47.70205, 4.932664 |
||
89 | * ), |
||
90 | * array( |
||
91 | * -72.1506, 47.2273, 4.905148 |
||
92 | * ) |
||
93 | * ) |
||
94 | * |
||
95 | * @param array $stlVertexArray |
||
96 | * @return STLVertex |
||
97 | */ |
||
98 | public static function fromArray(array $stlVertexArray) : STLVertex |
||
104 | |||
105 | /** |
||
106 | * Wrapper for getCoordinatesArray. |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | public function toArray() : array |
||
114 | |||
115 | /** |
||
116 | * Returns a vertex outerloop. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function toString() : string |
||
131 | } |