sketchup-api-stubs 0.7.4 → 0.7.8

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