1 | <?php |
||
29 | final class Torus extends Entity implements EntityInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Init <a-torus> |
||
34 | * |
||
35 | * The torus primitive creates a donut or circular tube shape. It is an entity that prescribes the geometry with |
||
36 | * its |
||
37 | * geometric primitive set to torus. |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | 1 | public function reset() |
|
42 | { |
||
43 | 1 | parent::reset(); |
|
44 | /* Load defaults */ |
||
45 | 1 | $this->component('Geometry')->primitive('torus'); |
|
46 | |||
47 | 1 | $this->radius(); |
|
48 | 1 | $this->radiusTubular(); |
|
49 | 1 | $this->segmentsRadial(); |
|
50 | 1 | $this->segmentsTubular(); |
|
51 | 1 | $this->arc(); |
|
52 | 1 | } |
|
53 | |||
54 | /** |
||
55 | * Radius of the outer edge of the torus. |
||
56 | * |
||
57 | * @param int|float $radius |
||
58 | * @return TorusPrimitiveIF |
||
|
|||
59 | */ |
||
60 | 1 | public function radius(float $radius = 1): self |
|
65 | |||
66 | /** |
||
67 | * Radius of the tube. |
||
68 | * |
||
69 | * @param float $radiusTubular |
||
70 | * @return self |
||
71 | */ |
||
72 | 1 | public function radiusTubular(float $radiusTubular = 0.2): self |
|
77 | |||
78 | /** |
||
79 | * Number of segments along the circumference of the tube ends. |
||
80 | * A higher number means the tube will be more round. |
||
81 | * |
||
82 | * @param int $segmentsRadial |
||
83 | * @return self |
||
84 | */ |
||
85 | 1 | public function segmentsRadial(int $segmentsRadial = 36): self |
|
90 | |||
91 | /** |
||
92 | * Number of segments along the circumference of the tube face. |
||
93 | * A higher number means the tube will be more round. |
||
94 | * |
||
95 | * @param int $segmentsTubular |
||
96 | * @return self |
||
97 | */ |
||
98 | 1 | public function segmentsTubular(int $segmentsTubular = 32): self |
|
103 | |||
104 | /** |
||
105 | * Central angle. |
||
106 | * |
||
107 | * @param int|float $arc |
||
108 | * @return self |
||
109 | */ |
||
110 | 1 | public function arc(float $arc = 360): self |
|
115 | } |
||
116 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.