sketchup-api-stubs 0.7.9 → 0.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +157 -151
  3. data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +182 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +111 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +423 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +693 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +535 -509
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +500 -476
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +267 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +133 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +547 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +678 -693
  16. data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
  17. data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +751 -747
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
  23. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +683 -517
  24. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
  26. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +464 -353
  27. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
  28. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  29. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  30. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  31. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  33. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  34. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
  35. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +614 -567
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  37. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  38. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +282 -183
  39. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +458 -387
  40. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
  41. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +346 -344
  42. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  43. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
  44. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
  45. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1565 -1519
  46. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  49. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  50. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  51. data/lib/sketchup-api-stubs/stubs/Length.rb +286 -278
  52. data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +196 -144
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +145 -150
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +294 -281
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +296 -302
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +473 -478
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +673 -659
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +600 -593
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +252 -257
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +443 -449
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +167 -165
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +403 -406
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1282 -1239
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +122 -125
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1006 -937
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +740 -750
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +289 -282
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +64 -62
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +405 -468
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +432 -406
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +307 -306
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +332 -326
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +380 -422
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +409 -427
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +241 -249
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +55 -48
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1115 -414
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +330 -317
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1714 -1652
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +372 -357
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +133 -130
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +463 -490
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +104 -116
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +939 -797
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +388 -361
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +501 -478
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +385 -361
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +451 -458
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +211 -212
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +259 -255
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +88 -69
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +263 -217
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +283 -262
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +199 -217
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +924 -834
  143. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  144. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
  145. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
  146. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +143 -142
  147. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1566 -1311
  148. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +71 -45
  149. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1429 -1377
  150. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
  151. data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
  152. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +399 -389
  153. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +580 -494
  154. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +280 -269
  155. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +258 -241
  156. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +636 -635
  157. data/lib/sketchup-api-stubs/stubs/UI.rb +791 -683
  158. data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
  159. data/lib/sketchup-api-stubs.rb +1 -1
  160. metadata +10 -24
@@ -1,693 +1,678 @@
1
- # Copyright:: Copyright 2023 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The Vector3d class is used to represent vectors in a 3 dimensional space.
5
- # Vectors in SketchUp have a direction and a length, but not a starting point.
6
- #
7
- # There are numerous tutorials on 3D vectors available on the internet.
8
- #
9
- # @version SketchUp 6.0
10
- class Geom::Vector3d
11
-
12
- # Class Methods
13
-
14
- # The {.linear_combination} method is used to create a new vector as a linear
15
- # combination of other vectors. This method is generally used to get a vector
16
- # at some percentage between two vectors.
17
- #
18
- # A linear combination is a standard term for vector math. It is defined as
19
- # vector = weight1 * vector1 + weight2 * vector2.
20
- #
21
- # @example
22
- # # Create a vector that is a 50%/50% linear combination of two others.
23
- # vec1 = Geom::Vector3d.new 3,0,0
24
- # vec2 = Geom::Vector3d.new 0,3,0
25
- # new_vector = Geom::Vector3d.linear_combination(0.5, vec1, 0.5, vec2)
26
- # # new_vector will now contain a Vector3d(1.5, 1.5, 0)
27
- #
28
- # @overload linear_combination(weight1, vector1, weight2, vector2)
29
- #
30
- # @param [Numeric] weight1 A weight or percentage.
31
- # @param [Geom::Vector3d] vector1 The first vector.
32
- # @param [Numeric] weight2 A weight or percentage.
33
- # @param [Geom::Vector3d] vector2 The second vector.
34
- # @return [Geom::Vector3d]
35
- #
36
- # @overload linear_combination(x, xaxis, y, yaxis, z, zaxis)
37
- #
38
- # @param [Numeric] x A weight or percentage for the x axis.
39
- # @param [Geom::Vector3d] xaxis The x axis vector.
40
- # @param [Numeric] y A weight or percentage for the y axis.
41
- # @param [Geom::Vector3d] yaxis The y axis vector.
42
- # @param [Numeric] z A weight or percentage for the z axis.
43
- # @param [Geom::Vector3d] zaxis The z axis vector.
44
- # @return [Geom::Vector3d]
45
- #
46
- # @version SketchUp 6.0
47
- def self.linear_combination(*args)
48
- end
49
-
50
- # Instance Methods
51
-
52
- # The {#%} method is used to compute the dot product between two vectors.
53
- #
54
- # This is an alias of the {#dot} method.
55
- #
56
- # @example
57
- # vector1 = Geom::Vector3d.new(0, 0, 1)
58
- # vector2 = Geom::Vector3d.new(0, 1, 0)
59
- # dot = vector1 % vector2
60
- #
61
- # @param [Geom::Vector3d] vector
62
- #
63
- # @return [Float]
64
- #
65
- # @see #dot
66
- #
67
- # @version SketchUp 6.0
68
- def %(vector)
69
- end
70
-
71
- # The {#*} method is used to compute the cross product between two vectors.
72
- #
73
- # The cross product, also called the vector product, is an operation on two
74
- # vectors. The cross product of two vectors produces a third vector which is
75
- # perpendicular to the plane in which the first two lie.
76
- #
77
- # This is an alias of the {#cross} method.
78
- #
79
- # @example
80
- # vector1 = Geom::Vector3d.new(1, 0, 0)
81
- # vector2 = Geom::Vector3d.new(0, 1, 0)
82
- # vector3 = vector1 * vector2
83
- #
84
- # @example
85
- # vector = Geom::Vector3d.new(1, 0, 0)
86
- # vector2 = Geom::Vector3d.new(0, 1, 0)
87
- # vector3 = vector.cross(vector2)
88
- #
89
- # @param [Geom::Vector3d] vector
90
- #
91
- # @return [Geom::Vector3d] the cross of vector1 and vector2
92
- #
93
- # @see #cross
94
- #
95
- # @version SketchUp 6.0
96
- def *(vector)
97
- end
98
-
99
- # The - method is used to add a vector to this one.
100
- #
101
- # @example
102
- # vector = Geom::Vector3d.new(0,0,2)
103
- # vector2 = Geom::Vector3d.new(0,1,0)
104
- # new_vector = vector + vector2
105
- #
106
- # @param vector2
107
- # A Vector3d object.
108
- #
109
- # @return [Geom::Vector3d] the new vector.
110
- #
111
- # @version SketchUp 6.0
112
- def +(vector2)
113
- end
114
-
115
- # The - method is used to subtract a vector from this one.
116
- #
117
- # @example
118
- # vector = Geom::Vector3d.new(0,0,2)
119
- # vector2 = Geom::Vector3d.new(0,1,0)
120
- # new_vector = vector - vector2
121
- #
122
- # @param vector2
123
- # A Vector3d object.
124
- #
125
- # @return [Geom::Vector3d] the new vector.
126
- #
127
- # @version SketchUp 6.0
128
- def -(vector2)
129
- end
130
-
131
- # The < method is used to determine if a vector's x, y or z value is less
132
- # than another vector's x, y or z value.
133
- #
134
- # @example
135
- # vector = Geom::Vector3d.new(0,0,2)
136
- # vector2 = Geom::Vector3d.new(0,1,0)
137
- # lt = vector < vector2
138
- #
139
- # @param vector2
140
- # A Vector3d object.
141
- #
142
- # @return [Boolean] true if the vector's x, y or z component is less
143
- #
144
- # @version SketchUp 6.0
145
- def <(vector2)
146
- end
147
-
148
- # The == method is used to determine if two vectors are equal to within
149
- # tolerance.
150
- #
151
- # @example
152
- # vector = Geom::Vector3d.new(1,0,0)
153
- # vector2 = Geom::Vector3d.new(0,1,0)
154
- # status = vector == vector2
155
- # # Returns false
156
- # UI.messagebox status
157
- #
158
- # @param vector2
159
- # A Vector3d object.
160
- #
161
- # @return [Boolean]
162
- #
163
- # @version SketchUp 6.0
164
- def ==(vector2)
165
- end
166
-
167
- # The [] method is used to access the coordinates of a vector as if it was an
168
- # Array. The index must be 0, 1 or 2.
169
- #
170
- # The following are equivalent:
171
- #
172
- # @example
173
- # x = vector.x
174
- # x = vector[0]
175
- #
176
- # @example
177
- # vector = Geom::Vector3d.new(1,0,0)
178
- # value = vector[0]
179
- # if (value)
180
- # UI.messagebox value
181
- # else
182
- # UI.messagebox "Failure"
183
- # end
184
- #
185
- # @param [Integer] i
186
- # An index into an array of three coordinates.
187
- #
188
- # @return [Length] the value for the x, y, or z coordinate.
189
- #
190
- # @version SketchUp 6.0
191
- def [](i)
192
- end
193
-
194
- # The []= method is used to set the coordinates of a vector as if it was an
195
- # Array. The value of i must be 0, 1 or 2.
196
- #
197
- # @example
198
- # vector[i] = coordinate
199
- #
200
- # @param [Integer] index
201
- # The index for the x, y, or z coordinate.
202
- #
203
- # @param [Numeric] value
204
- # The value for the x, y, or z coordinate.
205
- #
206
- # @return [Numeric] the newly set coordinate value
207
- #
208
- # @version SketchUp 6.0
209
- def []=(index, value)
210
- end
211
-
212
- # The angle_between method is used to compute the angle (in radians) between
213
- # this vector and another vector.
214
- #
215
- # @example
216
- # vector1 = Geom::Vector3d.new(1,0,0)
217
- # vector2 = Geom::Vector3d.new(0,1,0)
218
- # angle = vector1.angle_between vector2
219
- #
220
- # @param [Geom::Vector3d] vector2
221
- # A Vector3d object.
222
- #
223
- # @return [Float] an angle (in radians)
224
- #
225
- # @version SketchUp 6.0
226
- def angle_between(vector2)
227
- end
228
-
229
- # The axes method is used to compute an arbitrary set of axes with the given
230
- # vector as the z-axis direction.
231
- #
232
- # Returns an Array of three vectors [xaxis, yaxis, zaxis]
233
- #
234
- # Vector3d objects
235
- #
236
- # @example
237
- # vector = Geom::Vector3d.new(1,0,0)
238
- # a = vector.axes
239
- #
240
- # @return [Array(Geom::Vector3d, Geom::Vector3d, Geom::Vector3d)] an Array object containing three
241
- #
242
- # @version SketchUp 6.0
243
- def axes
244
- end
245
-
246
- # The clone method is used to make a copy of a vector.
247
- #
248
- # This method is equivalent to vec2 = Geom::Vector3d.new(vec)
249
- #
250
- # @example
251
- # vector = Geom::Vector3d.new(1,0,0)
252
- # vector2 = vector.clone
253
- #
254
- # @return [Geom::Vector3d] a Vector3d object which is the clone of
255
- # vector
256
- #
257
- # @version SketchUp 6.0
258
- def clone
259
- end
260
-
261
- # The {#cross} method is used to compute the cross product between two vectors.
262
- #
263
- # The cross product, also called the vector product, is an operation on two
264
- # vectors. The cross product of two vectors produces a third vector which is
265
- # perpendicular to the plane in which the first two lie.
266
- #
267
- # @example
268
- # vector1 = Geom::Vector3d.new(1, 0, 0)
269
- # vector2 = Geom::Vector3d.new(0, 1, 0)
270
- # vector3 = vector1 * vector2
271
- #
272
- # @example
273
- # vector = Geom::Vector3d.new(1, 0, 0)
274
- # vector2 = Geom::Vector3d.new(0, 1, 0)
275
- # vector3 = vector.cross(vector2)
276
- #
277
- # @param [Geom::Vector3d] vector
278
- #
279
- # @return [Geom::Vector3d] the cross of vector1 and vector2
280
- #
281
- # @see #*
282
- #
283
- # @version SketchUp 6.0
284
- def cross(vector)
285
- end
286
-
287
- # The {#dot} method is used to compute the dot product between two vectors.
288
- #
289
- # @example
290
- # vector1 = Geom::Vector3d.new(0, 0, 1)
291
- # vector2 = Geom::Vector3d.new(0, 1, 0)
292
- # dot = vector1.dot(vector2)
293
- #
294
- # @param [Geom::Vector3d] vector
295
- #
296
- # @return [Float]
297
- #
298
- # @see #%
299
- #
300
- # @version SketchUp 6.0
301
- def dot(vector)
302
- end
303
-
304
- # The new method is used to create a new vector.
305
- #
306
- # @example
307
- # # A vector that runs up the Z axis.
308
- # vector = Geom::Vector3d.new(0,0,1)
309
- # if (vector)
310
- # UI.messagebox vector
311
- # else
312
- # UI.messagebox "Failure"
313
- # end
314
- #
315
- # @overload initialize
316
- #
317
- # @return [Geom::Vector3d]
318
- #
319
- # @overload initialize(x, y, z)
320
- #
321
- # @param [Numeric] x
322
- # @param [Numeric] y
323
- # @param [Numeric] z
324
- # @return [Geom::Vector3d]
325
- #
326
- # @overload initialize(array3d)
327
- #
328
- # @param [Array(Numeric, Numeric, Numeric)] array3d
329
- # @return [Geom::Vector3d]
330
- #
331
- # @overload initialize(array2d)
332
- #
333
- # @param [Array(Numeric, Numeric)] array2d
334
- # @return [Geom::Vector3d]
335
- #
336
- # @overload initialize(vector)
337
- #
338
- # @param [Geom::Vector3d] vector A Vector3d object.
339
- # @return [Geom::Vector3d]
340
- #
341
- # @version SketchUp 6.0
342
- def initialize(*args)
343
- end
344
-
345
- # The inspect method is used to inspect the contents of a vector as a
346
- # friendly string.
347
- #
348
- # @example
349
- # vector = Geom::Vector3d.new(0,0,1)
350
- # out_string = vector.inspect
351
- # puts out_string
352
- #
353
- # @return [Geom::Vector3d] the Vector3d object
354
- #
355
- # @version SketchUp 6.0
356
- def inspect
357
- end
358
-
359
- # The length method is used to retrieve the length of the vector.
360
- #
361
- # @example
362
- # vector = Geom::Vector3d.new(0,0,1)
363
- # l = vector.length
364
- #
365
- # @return [Length] the length of the vector
366
- #
367
- # @version SketchUp 6.0
368
- def length
369
- end
370
-
371
- # The length= method is used to set the length of the vector. The length must
372
- # be greater than 0.
373
- #
374
- # @example
375
- # vector = Geom::Vector3d.new(0,0,1)
376
- # l = vector.length
377
- # UI.messagebox(l)
378
- # newl = vector.length = 2
379
- #
380
- # @param [Numeric] length
381
- # A length for the vector.
382
- #
383
- # @return [Numeric] a newly set length
384
- #
385
- # @version SketchUp 6.0
386
- def length=(length)
387
- end
388
-
389
- # The normalize method is used to return a vector that is a unit vector
390
- # of another.
391
- #
392
- # @example
393
- # vector = Geom::Vector3d.new(0,0,2)
394
- # vector2 = vector.normalize
395
- #
396
- # @return [Geom::Vector3d] a new normalized Vector3d object
397
- #
398
- # @version SketchUp 6.0
399
- def normalize
400
- end
401
-
402
- # The normalize! method is used to convert a vector into a unit vector,
403
- # in place.
404
- #
405
- # Another way to do this is vec.length = 1
406
- #
407
- # @example
408
- # vector = Geom::Vector3d.new(0,0,2)
409
- # vector.normalize!
410
- #
411
- # @return [Geom::Vector3d] a normalized Vector3d object
412
- #
413
- # @version SketchUp 6.0
414
- def normalize!
415
- end
416
-
417
- # The parallel method is used to determine if this vector is parallel to
418
- # another vector to within tolerance.
419
- #
420
- # @example
421
- # status = vector.parallel?(vector2)
422
- #
423
- # @param [Geom::Vector3d] vector2
424
- # A Vector3d object.
425
- #
426
- # @return [Boolean]
427
- #
428
- # @version SketchUp 6.0
429
- def parallel?(vector2)
430
- end
431
-
432
- # The perpendicular? method is used to determine if this vector is
433
- # perpendicular to another vector to within tolerance.
434
- #
435
- # @example
436
- # vector = Geom::Vector3d.new(0,0,1)
437
- # vector2 = Geom::Vector3d.new(0,1,0)
438
- # status = vector.perpendicular?(vector2)
439
- #
440
- # @param [Geom::Vector3d] vector2
441
- # A Vector3d object.
442
- #
443
- # @return [Boolean]
444
- #
445
- # @version SketchUp 6.0
446
- def perpendicular?(vector2)
447
- end
448
-
449
- # The reverse method is used to return a new vector that is the reverse
450
- # of this vector, while leaving the original unchanged.
451
- #
452
- # @example
453
- # vector2 = vector.reverse
454
- #
455
- # @return [Geom::Vector3d] a Vector3d object that is the reverse of
456
- # vector
457
- #
458
- # @version SketchUp 6.0
459
- def reverse
460
- end
461
-
462
- # The reverse! method is used to reverse the vector in place.
463
- #
464
- # @example
465
- # vector.reverse!
466
- #
467
- # @return [Geom::Vector3d] a Vector3d object that is the reverse of
468
- # vector
469
- #
470
- # @version SketchUp 6.0
471
- def reverse!
472
- end
473
-
474
- # The samedirection? method is used to determine if this vector is parallel to
475
- # and in the same direction as another vector to within tolerance.
476
- #
477
- # @example
478
- # vector = Geom::Vector3d.new(0,0,1)
479
- # vector2 = Geom::Vector3d.new(0,1,0)
480
- # status = vector.samedirection?(vector2)
481
- #
482
- # @param [Geom::Vector3d] vector2
483
- # A Vector3d object.
484
- #
485
- # @return [Boolean]
486
- #
487
- # @version SketchUp 6.0
488
- def samedirection?(vector2)
489
- end
490
-
491
- # The set! method is used to set the coordinates of the vector.
492
- #
493
- # @example This is a shortcut for writing:
494
- # vec.x = x
495
- # vec.y = y
496
- # vec.z = z
497
- #
498
- # @example You may also call this method with an array or another vector:
499
- # vec.set!(x, y, z)
500
- # vec.set!([x, y, z])
501
- # vec.set!(vec2)
502
- #
503
- # @example
504
- # vector = Geom::Vector3d.new(0,0,1)
505
- # vector.set! 1,0,0
506
- #
507
- # @overload set!(array3d)
508
- #
509
- # @param [Array(Numeric, Numeric, Numeric)] array3d
510
- # @return [Geom::Vector3d]
511
- #
512
- # @overload set!(vector)
513
- #
514
- # @param [Geom::Vector3d] vector
515
- # @return [Geom::Vector3d]
516
- #
517
- # @overload set!(x, y, z)
518
- #
519
- # @param [Numeric] x
520
- # @param [Numeric] y
521
- # @param [Numeric] z
522
- # @return [Geom::Vector3d]
523
- #
524
- # @version SketchUp 6.0
525
- def set!(*args)
526
- end
527
-
528
- # The to_a method retrieves the coordinates of the vector in an Array
529
- # [x, y, z].
530
- #
531
- # @example
532
- # a = vector.to_a
533
- #
534
- # @return [Array(Length, Length, Length)] the coordinates of the vector in an array
535
- #
536
- # @version SketchUp 6.0
537
- def to_a
538
- end
539
-
540
- # The to_s method is used to format the vector as a String.
541
- #
542
- # @example
543
- # vector = Geom::Vector3d.new(0,0,1)
544
- # out_string = vector.to_s
545
- # puts out_string
546
- #
547
- # @return [String] a string representation of vector
548
- #
549
- # @version SketchUp 6.0
550
- def to_s
551
- end
552
-
553
- # Apply a Transformation to a vector, returning a new vector. The original
554
- # vector is unchanged by this method.
555
- #
556
- # @example
557
- # vector2 = vector.transform(transformation)
558
- #
559
- # @param [Geom::Transformation] transform
560
- # A Transformation object to apply to the vector.
561
- #
562
- # @return [Geom::Vector3d] the newly transformed vector
563
- #
564
- # @version SketchUp 6.0
565
- def transform(transform)
566
- end
567
-
568
- # Apply a Transformation to a vector. The vector itself is modified.
569
- #
570
- # @example
571
- # vector.transform!(transformation)
572
- #
573
- # @param [Geom::Transformation] transform
574
- # A Transformation object to apply to the vector.
575
- #
576
- # @return [Geom::Vector3d] the transformed vector
577
- #
578
- # @version SketchUp 6.0
579
- def transform!(transform)
580
- end
581
-
582
- # The unitvector? method is used to see if the vector is a unit vector.
583
- #
584
- # This is equivalent to vec.length == 1.0
585
- #
586
- # @example
587
- # vector = Geom::Vector3d.new(0,0,1)
588
- # status = vector.unitvector?
589
- #
590
- # @return [Boolean]
591
- #
592
- # @version SketchUp 6.0
593
- def unitvector?
594
- end
595
-
596
- # The valid? method is used to verify if a vector is valid. A vector is valid
597
- # if its length is not zero.
598
- #
599
- # @example
600
- # # A zero length vector will be invalid
601
- # vector = Geom::Vector3d.new(0,0,0)
602
- # status = vector.valid?
603
- # # A non-zero length vector is valid
604
- # vector = Geom::Vector3d.new(0,0,1)
605
- # status = vector.valid?
606
- #
607
- # @return [Boolean]
608
- #
609
- # @version SketchUp 6.0
610
- def valid?
611
- end
612
-
613
- # The x method is used to retrieve the x coordinate of the vector.
614
- #
615
- # @example
616
- # x = vector.x
617
- #
618
- # @return [Length] the x coordinate of the vector
619
- #
620
- # @version SketchUp 6.0
621
- def x
622
- end
623
-
624
- # The x= method is used to set the x coordinate of the vector.
625
- #
626
- # @example
627
- # vector = Geom::Vector3d.new 1,2,3
628
- # x = vector.x = 10
629
- #
630
- # @param [Numeric] x
631
- # The x coordinate for the vector.
632
- #
633
- # @return [Numeric] the newly set x coordinate for the vector
634
- #
635
- # @version SketchUp 6.0
636
- def x=(x)
637
- end
638
-
639
- # The y method is used to retrieve the y coordinate of the vector.
640
- #
641
- # @example
642
- # vector = Geom::Vector3d.new(1,2,3)
643
- # y = vector.y
644
- #
645
- # @return [Length] the y coordinate of the vector
646
- #
647
- # @version SketchUp 6.0
648
- def y
649
- end
650
-
651
- # Set the y coordinate of the vector.
652
- #
653
- # @example
654
- # vector = Geom::Vector3d.new(1,2,3)
655
- # y = vector.y = 10
656
- #
657
- # @param [Numeric] y
658
- # The y coordinate for the vector.
659
- #
660
- # @return [Numeric] the newly set y coordinate for the vector
661
- #
662
- # @version SketchUp 6.0
663
- def y=(y)
664
- end
665
-
666
- # Get the z coordinate of the vector.
667
- #
668
- # @example
669
- # vector = Geom::Vector3d.new(1,2,3)
670
- # z = vector.z
671
- #
672
- # @return [Length] the z coordinate of the vector
673
- #
674
- # @version SketchUp 6.0
675
- def z
676
- end
677
-
678
- # Set the z coordinate of the vector.
679
- #
680
- # @example
681
- # vector = Geom::Vector3d.new(1,2,3)
682
- # z = vector.z = 10
683
- #
684
- # @param [Numeric] z
685
- # The z coordinate for the vector.
686
- #
687
- # @return [Numeric] the newly set z coordinate for the vector
688
- #
689
- # @version SketchUp 6.0
690
- def z=(z)
691
- end
692
-
693
- end
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The Vector3d class is used to represent vectors in a 3 dimensional space.
5
+ # Vectors in SketchUp have a direction and a length, but not a starting point.
6
+ #
7
+ # There are numerous tutorials on 3D vectors available on the internet.
8
+ #
9
+ # @version SketchUp 6.0
10
+ class Geom::Vector3d
11
+
12
+ # Class Methods
13
+
14
+ # The {.linear_combination} method is used to create a new vector as a linear
15
+ # combination of other vectors. This method is generally used to get a vector
16
+ # at some percentage between two vectors.
17
+ #
18
+ # A linear combination is a standard term for vector math. It is defined as
19
+ # vector = weight1 * vector1 + weight2 * vector2
20
+ #
21
+ # @example
22
+ # vector1 = Geom::Vector3d.new(3, 0, 0)
23
+ # vector2 = Geom::Vector3d.new(0, 3, 0)
24
+ # # The result is a Vector3d(1.5, 1.5, 0)
25
+ # new_vector = Geom::Vector3d.linear_combination(0.5, vector1, 0.5, vector2)
26
+ #
27
+ # @overload linear_combination(weight1, vector1, weight2, vector2)
28
+ #
29
+ # @param [Float] weight1 weights
30
+ # @param [Geom::Vector3d] vector1 The first vector.
31
+ # @param [Float] weight2 weights
32
+ # @param [Geom::Vector3d] vector2 The second vector.
33
+ # @return [Geom::Vector3d]
34
+ #
35
+ # @overload linear_combination(x, xaxis, y, yaxis, z, zaxis)
36
+ #
37
+ # @param [Float] x A weight or percentage for the x axis.
38
+ # @param [Geom::Vector3d] xaxis The x axis vector.
39
+ # @param [Float] y A weight or percentage for the y axis.
40
+ # @param [Geom::Vector3d] yaxis The y axis vector.
41
+ # @param [Float] z A weight or percentage for the z axis.
42
+ # @param [Geom::Vector3d] zaxis The z axis vector.
43
+ # @return [Geom::Vector3d]
44
+ #
45
+ # @version SketchUp 6.0
46
+ def self.linear_combination(*args)
47
+ end
48
+
49
+ # Instance Methods
50
+
51
+ # The {#%} method is used to compute the dot product between two vectors.
52
+ #
53
+ # This is an alias of the {#dot} method.
54
+ #
55
+ # @example
56
+ # vector1 = Geom::Vector3d.new(2, 2, 1)
57
+ # vector2 = Geom::Vector3d.new(1, 3, 0)
58
+ # # The result is 8
59
+ # dot = vector1 % vector2
60
+ #
61
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
62
+ #
63
+ # @return [Float]
64
+ #
65
+ # @see #dot
66
+ #
67
+ # @version SketchUp 6.0
68
+ def %(vector3d)
69
+ end
70
+
71
+ # The {#*} method is used to compute the cross product between two vectors.
72
+ #
73
+ # The cross product, also called the vector product, is an operation on two
74
+ # vectors. The cross product of two vectors produces a third vector which is
75
+ # perpendicular to the plane in which the first two lie.
76
+ #
77
+ # This is an alias of the {#cross} method.
78
+ #
79
+ # @example
80
+ # vector1 = Geom::Vector3d.new(1, 0, 2)
81
+ # vector2 = Geom::Vector3d.new(3, 1, 1)
82
+ # # The result is a Vector3d(-2, 5, 1)
83
+ # cross = vector1 * vector2
84
+ #
85
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
86
+ #
87
+ # @return [Geom::Vector3d]
88
+ #
89
+ # @see #cross
90
+ #
91
+ # @version SketchUp 6.0
92
+ def *(vector3d)
93
+ end
94
+
95
+ # The {#+} method is used to add a vector to this one.
96
+ #
97
+ # @example
98
+ # vector1 = Geom::Vector3d.new(0, 0, 2)
99
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
100
+ # new_vector = vector1 + vector2
101
+ #
102
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
103
+ #
104
+ # @return [Geom::Vector3d] the new vector.
105
+ #
106
+ # @version SketchUp 6.0
107
+ def +(vector3d)
108
+ end
109
+
110
+ # The {#-} method is used to subtract a vector from this one.
111
+ #
112
+ # @example
113
+ # vector1 = Geom::Vector3d.new(0, 0, 2)
114
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
115
+ # new_vector = vector1 - vector2
116
+ #
117
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
118
+ #
119
+ # @return [Geom::Vector3d] the new vector.
120
+ #
121
+ # @version SketchUp 6.0
122
+ def -(vector3d)
123
+ end
124
+
125
+ # The {#<} compare method is used to compare two vectors to determine if the left-hand vector is
126
+ # less than the right-hand vector.
127
+ #
128
+ # @example
129
+ # vector1 = Geom::Vector3d.new(0, 1, 0)
130
+ # vector2 = Geom::Vector3d.new(0, 4, 2)
131
+ # # Returns true
132
+ # vector1 < vector2
133
+ #
134
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
135
+ #
136
+ # @return [Boolean] true if the vector1 is closer to origin than vector2
137
+ #
138
+ # @version SketchUp 6.0
139
+ def <(vector3d)
140
+ end
141
+
142
+ # The {#==} method is used to determine if two vectors are equal to within
143
+ # tolerance.
144
+ #
145
+ # @example
146
+ # vector1 = Geom::Vector3d.new(1, 0, 0)
147
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
148
+ # # Returns false
149
+ # status = vector1 == vector2
150
+ #
151
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
152
+ #
153
+ # @return [Boolean]
154
+ #
155
+ # @version SketchUp 6.0
156
+ def ==(vector3d)
157
+ end
158
+
159
+ # The {[]} method is used to access the coordinates of a vector as if it was an
160
+ # Array. The index must be 0, 1 or 2.
161
+ #
162
+ # The following are equivalent:
163
+ #
164
+ # @example
165
+ # vector = Geom::Vector3d.new(1, 1, 0)
166
+ # x = vector[0]
167
+ #
168
+ # @param [Integer] index
169
+ # An index into an array of three coordinates.
170
+ #
171
+ # @return [Length] the value for the x, y, or z coordinate.
172
+ #
173
+ # @version SketchUp 6.0
174
+ def [](index)
175
+ end
176
+
177
+ # The {[]=} method is used to set the coordinates of a vector as if it was an
178
+ # Array. The value of i must be 0, 1 or 2.
179
+ #
180
+ # @example
181
+ # vector = Geom::Vector3d.new(4, 5, 0)
182
+ #
183
+ # vector[2] = 10
184
+ #
185
+ # @param [Integer] index
186
+ # The index for the x, y, or z coordinate.
187
+ #
188
+ # @param [Float] value
189
+ # The value for the x, y, or z coordinate.
190
+ #
191
+ # @return [Float] the newly set coordinate value
192
+ #
193
+ # @version SketchUp 6.0
194
+ def []=(index, value)
195
+ end
196
+
197
+ # The {#angle_between} method is used to compute the angle (in radians) between
198
+ # this vector and another vector.
199
+ #
200
+ # @example
201
+ # vector1 = Geom::Vector3d.new(1, 0, 0)
202
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
203
+ # angle = vector1.angle_between(vector2)
204
+ #
205
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
206
+ #
207
+ # @return [Float] an angle (in radians)
208
+ #
209
+ # @version SketchUp 6.0
210
+ def angle_between(vector3d)
211
+ end
212
+
213
+ # The {#axes} method is used to compute an arbitrary set of axes with the given
214
+ # vector as the z-axis direction.
215
+ #
216
+ # Returns an Array of three vectors [xaxis, yaxis, zaxis]
217
+ #
218
+ # Vector3d objects
219
+ #
220
+ # @example
221
+ # vector = Geom::Vector3d.new(1, 0, 0)
222
+ # array = vector.axes
223
+ #
224
+ # @return [Array(Geom::Vector3d, Geom::Vector3d, Geom::Vector3d)] an Array object containing three
225
+ #
226
+ # @version SketchUp 6.0
227
+ def axes
228
+ end
229
+
230
+ # The {#clone} method is used to make a copy of a vector.
231
+ #
232
+ # @example
233
+ # vector = Geom::Vector3d.new(1, 0, 0)
234
+ # new_vector = vector.clone
235
+ #
236
+ # @return [Geom::Vector3d] a Vector3d object which is the clone of
237
+ # vector
238
+ #
239
+ # @version SketchUp 6.0
240
+ def clone
241
+ end
242
+
243
+ # The {#cross} method is used to compute the cross product between two vectors.
244
+ #
245
+ # The cross product, also called the vector product, is an operation on two
246
+ # vectors. The cross product of two vectors produces a third vector which is
247
+ # perpendicular to the plane in which the first two lie.
248
+ #
249
+ # @example
250
+ # vector1 = Geom::Vector3d.new(1, 2, 0)
251
+ # vector2 = Geom::Vector3d.new(5, 1, 3)
252
+ # # The result is a Vector3d(6, -3, -9)
253
+ # cross = vector1.cross(vector2)
254
+ #
255
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
256
+ #
257
+ # @return [Geom::Vector3d]
258
+ #
259
+ # @see #*
260
+ #
261
+ # @version SketchUp 6.0
262
+ def cross(vector3d)
263
+ end
264
+
265
+ # The {#dot} method is used to compute the dot product between two vectors.
266
+ #
267
+ # @example
268
+ # vector1 = Geom::Vector3d.new(0, 5, 1)
269
+ # vector2 = Geom::Vector3d.new(0, 1, 2)
270
+ # # The result is 7
271
+ # dot = vector1.dot(vector2)
272
+ #
273
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
274
+ #
275
+ # @return [Float]
276
+ #
277
+ # @see #%
278
+ #
279
+ # @version SketchUp 6.0
280
+ def dot(vector3d)
281
+ end
282
+
283
+ # The new method is used to create a new vector.
284
+ #
285
+ # @example
286
+ # # A vector that runs up the Z axis.
287
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
288
+ #
289
+ # vector2 = Geom::Vector3d.new([1, 1])
290
+ #
291
+ # @overload initialize
292
+ #
293
+ # @return [Geom::Vector3d]
294
+ #
295
+ # @overload initialize(x, y, z)
296
+ #
297
+ # @param [Float] x
298
+ # @param [Float] y
299
+ # @param [Float] z
300
+ # @return [Geom::Vector3d]
301
+ #
302
+ # @overload initialize(array3d)
303
+ #
304
+ # @param [Array(Float, Float, Float)] array3d
305
+ # @return [Geom::Vector3d]
306
+ #
307
+ # @overload initialize(array2d)
308
+ #
309
+ # @param [Array(Float, Float)] array2d
310
+ # @return [Geom::Vector3d]
311
+ #
312
+ # @overload initialize(vector)
313
+ #
314
+ # @param [Geom::Vector3d] vector A Vector3d object.
315
+ # @return [Geom::Vector3d]
316
+ #
317
+ # @version SketchUp 6.0
318
+ def initialize(*args)
319
+ end
320
+
321
+ # The {#inspect} method is used to inspect the contents of a vector as a
322
+ # friendly string.
323
+ #
324
+ # @example
325
+ # vector = Geom::Vector3d.new(0, 0, 1)
326
+ # string = vector.inspect
327
+ #
328
+ # @return [Geom::Vector3d] the Vector3d object
329
+ #
330
+ # @version SketchUp 6.0
331
+ def inspect
332
+ end
333
+
334
+ # The {#length} method is used to retrieve the length of the vector.
335
+ #
336
+ # @example
337
+ # vector = Geom::Vector3d.new(0, 0, 1)
338
+ # length = vector.length
339
+ #
340
+ # @return [Length] the length of the vector
341
+ #
342
+ # @version SketchUp 6.0
343
+ def length
344
+ end
345
+
346
+ # The {#length=} method is used to set the length of the vector. The length must
347
+ # be greater than 0.
348
+ #
349
+ # @example
350
+ # vector = Geom::Vector3d.new(0, 0, 1)
351
+ # vector.length = 2
352
+ #
353
+ # @param [Float] length
354
+ # A length for the vector.
355
+ #
356
+ # @return [Length] a newly set length
357
+ #
358
+ # @version SketchUp 6.0
359
+ def length=(length)
360
+ end
361
+
362
+ # The {#normalize} method is used to return a vector that is a unit vector
363
+ # of another.
364
+ #
365
+ # @example
366
+ # vector = Geom::Vector3d.new(0, 0, 2)
367
+ # new_vector = vector.normalize
368
+ #
369
+ # @return [Geom::Vector3d] a new normalized Vector3d object
370
+ #
371
+ # @version SketchUp 6.0
372
+ def normalize
373
+ end
374
+
375
+ # The {#normalize!} method is used to convert a vector into a unit vector,
376
+ # in place.
377
+ #
378
+ # Another way to do this is +vector.length = 1.0+
379
+ #
380
+ # @example
381
+ # vector = Geom::Vector3d.new(0, 0, 2)
382
+ # vector.normalize!
383
+ #
384
+ # @return [Geom::Vector3d] a normalized Vector3d object
385
+ #
386
+ # @version SketchUp 6.0
387
+ def normalize!
388
+ end
389
+
390
+ # The {#parallel?} method determines if two {Geom::Vector3d}s are parallel within a
391
+ # tolerance. Two vectors are parallel if there exists a scalar multiple between them.
392
+ #
393
+ # @example
394
+ # vector1 = Geom::Vector3d.new(1, 2, 4)
395
+ # vector2 = Geom::Vector3d.new(2, 4, 8)
396
+ # # Returns true
397
+ # status = vector1.parallel?(vector2)
398
+ #
399
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
400
+ #
401
+ # @return [Boolean]
402
+ #
403
+ # @version SketchUp 6.0
404
+ def parallel?(vector3d)
405
+ end
406
+
407
+ # The {#perpendicular?} method determines if two Geom::Vector3ds are perpendicular within a
408
+ # tolerance. Two vectors are considered perpendicular if their dot product is zero.
409
+ #
410
+ # @example
411
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
412
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
413
+ # status = vector1.perpendicular?(vector2)
414
+ #
415
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
416
+ #
417
+ # @return [Boolean]
418
+ #
419
+ # @version SketchUp 6.0
420
+ def perpendicular?(vector3d)
421
+ end
422
+
423
+ # The {#reverse} method is used to return a new vector that is the reverse
424
+ # of this vector, while leaving the original unchanged.
425
+ #
426
+ # @example
427
+ # vector = Geom::Vector3d.new(3, 1, 0)
428
+ # new_vector = vector.reverse
429
+ #
430
+ # @return [Geom::Vector3d] a reverse Vector3d object
431
+ #
432
+ # @version SketchUp 6.0
433
+ def reverse
434
+ end
435
+
436
+ # The {#reverse!} method is used to reverse the vector in place.
437
+ #
438
+ # @example
439
+ # vector = Geom::Vector3d.new(3, 1, 0)
440
+ # vector.reverse!
441
+ #
442
+ # @return [Geom::Vector3d] a reverse Vector3d object
443
+ #
444
+ # @version SketchUp 6.0
445
+ def reverse!
446
+ end
447
+
448
+ # The {#samedirection?} method is used to determine if this vector is parallel to
449
+ # and in the same direction as another vector to within tolerance.
450
+ #
451
+ # @example
452
+ # vector1 = Geom::Vector3d.new(2, 4, 1)
453
+ # vector2 = Geom::Vector3d.new(2, 0, 1)
454
+ # # Returns false
455
+ # status = vector1.samedirection?(vector2)
456
+ #
457
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
458
+ #
459
+ # @return [Boolean]
460
+ #
461
+ # @version SketchUp 6.0
462
+ def samedirection?(vector3d)
463
+ end
464
+
465
+ # The {#set!} method is used to set the coordinates of the vector.
466
+ #
467
+ # @example This is a shortcut for writing:
468
+ # vector = Geom::Vector3d.new(0, 0, 1)
469
+ # vector.x = 2
470
+ # vector.y = 4
471
+ # vector.z = 0
472
+ #
473
+ # @example You may also call this method with an array or another vector:
474
+ # vector1 = Geom::Vector3d.new
475
+ # vector2 = Geom::Vector3d.new(2, 4, 0)
476
+ # vector1.set!(vector2)
477
+ #
478
+ # @example
479
+ # vector = Geom::Vector3d.new(0, 0, 1)
480
+ # vector.set!(2, 4, 0) # is equivalent to vector.set!([2, 4, 0])
481
+ #
482
+ # @overload set!(vector)
483
+ #
484
+ # @param [Geom::Vector3d] vector
485
+ # @return [Geom::Vector3d]
486
+ #
487
+ # @overload set!(x, y, z)
488
+ #
489
+ # @param [Float] x
490
+ # @param [Float] y
491
+ # @param [Float] z
492
+ # @return [Geom::Vector3d]
493
+ #
494
+ # @overload set!(array3d)
495
+ #
496
+ # @param [Array(Float, Float, Float)] array3d
497
+ # @return [Geom::Vector3d]
498
+ #
499
+ # @version SketchUp 6.0
500
+ def set!(*args)
501
+ end
502
+
503
+ # The {#to_a} method retrieves the coordinates of the vector in an Array[x, y, z].
504
+ #
505
+ # @example
506
+ # vector = Geom::Vector3d.new(3, 0, 6)
507
+ # array = vector.to_a
508
+ #
509
+ # @return [Array(Float, Float, Float)] the coordinates of the vector in an array
510
+ #
511
+ # @version SketchUp 6.0
512
+ def to_a
513
+ end
514
+
515
+ # The {#to_s} method is used to format the vector as a String.
516
+ #
517
+ # @example
518
+ # vector = Geom::Vector3d.new(0, 0, 1)
519
+ # string = vector.to_s
520
+ #
521
+ # @return [String] a string representation of vector
522
+ #
523
+ # @version SketchUp 6.0
524
+ def to_s
525
+ end
526
+
527
+ # The {#transform} method applies a Transformation to a vector, returning a new vector. The
528
+ # original vector is unchanged by this method.
529
+ #
530
+ # @example
531
+ # vector = Geom::Vector3d.new(0, 2, 1)
532
+ # point = Geom::Point3d.new(2, 3, 1)
533
+ # transformation = Geom::Transformation.scaling(point, 2)
534
+ # # The result is a Vector3d(0, 4, 2)
535
+ # new_vector = vector.transform(transformation)
536
+ #
537
+ # @param [Geom::Transformation] transform
538
+ # A Transformation object to apply to the vector.
539
+ #
540
+ # @return [Geom::Vector3d] the newly transformed vector
541
+ #
542
+ # @version SketchUp 6.0
543
+ def transform(transform)
544
+ end
545
+
546
+ # The {#transform!} method applies a Transformation to a vector. The vector itself is modified.
547
+ #
548
+ # @example
549
+ # vector = Geom::Vector3d.new(0, 2, 1)
550
+ # point = Geom::Point3d.new(2, 3, 1)
551
+ # transformation = Geom::Transformation.scaling(point, 2)
552
+ # # The result is a Vector3d(0, 4, 2)
553
+ # vector.transform!(transformation)
554
+ #
555
+ # @param [Geom::Transformation] transform
556
+ # A Transformation object to apply to the vector.
557
+ #
558
+ # @return [Geom::Vector3d] the transformed vector
559
+ #
560
+ # @version SketchUp 6.0
561
+ def transform!(transform)
562
+ end
563
+
564
+ # The {#unitvector?} method is used to see if the vector is a unit vector.
565
+ #
566
+ # This is equivalent to +vector.length == 1.0+
567
+ #
568
+ # @example
569
+ # vector = Geom::Vector3d.new(0, 0, 1)
570
+ # # Return false
571
+ # status = vector.unitvector?
572
+ #
573
+ # @return [Boolean]
574
+ #
575
+ # @version SketchUp 6.0
576
+ def unitvector?
577
+ end
578
+
579
+ # The {#valid?} method is used to verify if a vector is valid. A vector is valid
580
+ # if its length is not zero.
581
+ #
582
+ # @example
583
+ # # A zero length vector will be invalid
584
+ # vector = Geom::Vector3d.new
585
+ # status = vector.valid?
586
+ #
587
+ # # A non-zero length vector is valid
588
+ # vector = Geom::Vector3d.new(0, 0, 1)
589
+ # status = vector.valid?
590
+ #
591
+ # @return [Boolean]
592
+ #
593
+ # @version SketchUp 6.0
594
+ def valid?
595
+ end
596
+
597
+ # The {#x} method is used to retrieve the x coordinate of the vector.
598
+ #
599
+ # @example
600
+ # vector = Geom::Vector3d.new(1, 2, 3)
601
+ # x = vector.x
602
+ #
603
+ # @return [Float] the x coordinate of the vector
604
+ #
605
+ # @version SketchUp 6.0
606
+ def x
607
+ end
608
+
609
+ # The {#x=} method is used to set the x coordinate of the vector.
610
+ #
611
+ # @example
612
+ # vector = Geom::Vector3d.new(1, 2, 3)
613
+ # vector.x = 10
614
+ #
615
+ # @param [Float] x
616
+ # The x coordinate for the vector.
617
+ #
618
+ # @return [Float] the newly set x coordinate for the vector
619
+ #
620
+ # @version SketchUp 6.0
621
+ def x=(x)
622
+ end
623
+
624
+ # The {#y} method is used to retrieve the y coordinate of the vector.
625
+ #
626
+ # @example
627
+ # vector = Geom::Vector3d.new(1, 2, 3)
628
+ # y = vector.y
629
+ #
630
+ # @return [Float] the y coordinate of the vector
631
+ #
632
+ # @version SketchUp 6.0
633
+ def y
634
+ end
635
+
636
+ # Set the {#y=} coordinate of the vector.
637
+ #
638
+ # @example
639
+ # vector = Geom::Vector3d.new(1, 2, 3)
640
+ # vector.y = 10
641
+ #
642
+ # @param [Float] y
643
+ # The y coordinate for the vector.
644
+ #
645
+ # @return [Float] the newly set y coordinate for the vector
646
+ #
647
+ # @version SketchUp 6.0
648
+ def y=(y)
649
+ end
650
+
651
+ # Get the {#z} coordinate of the vector.
652
+ #
653
+ # @example
654
+ # vector = Geom::Vector3d.new(1, 2, 3)
655
+ # z = vector.z
656
+ #
657
+ # @return [Float] the z coordinate of the vector
658
+ #
659
+ # @version SketchUp 6.0
660
+ def z
661
+ end
662
+
663
+ # Set the {#z=} coordinate of the vector.
664
+ #
665
+ # @example
666
+ # vector = Geom::Vector3d.new(1, 2, 3)
667
+ # vector.z = 10
668
+ #
669
+ # @param [Float] z
670
+ # The z coordinate for the vector.
671
+ #
672
+ # @return [Float] the newly set z coordinate for the vector
673
+ #
674
+ # @version SketchUp 6.0
675
+ def z=(z)
676
+ end
677
+
678
+ end