sketchup-api-stubs 0.7.9 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +151 -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 +172 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +509 -509
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -476
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -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 +747 -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/Document.rb +569 -517
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +356 -353
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +459 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
  43. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
  44. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  45. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  49. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  50. data/lib/sketchup-api-stubs/stubs/Length.rb +278 -278
  51. data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -144
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +150 -150
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -659
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -449
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -406
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1242 -1239
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -937
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -282
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -468
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -406
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -326
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -317
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1656 -1652
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -130
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -490
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -116
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -361
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +480 -478
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +373 -361
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -458
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +255 -255
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -834
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1329 -1311
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
  143. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1394 -1377
  144. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
  145. data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
  146. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +387 -389
  147. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +505 -494
  148. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
  149. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -241
  150. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -635
  151. data/lib/sketchup-api-stubs/stubs/UI.rb +728 -683
  152. data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
  153. data/lib/sketchup-api-stubs.rb +1 -1
  154. metadata +3 -3
@@ -1,693 +1,693 @@
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 2024 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