sketchup-api-stubs 0.7.9 → 0.7.11

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