sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,643 @@
|
|
1
|
+
# Copyright:: Copyright 2017 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. This method is generally used to get a point at
|
36
|
+
# some percentage along a line connecting the two points.
|
37
|
+
#
|
38
|
+
# A linear combination is a standard term for vector math. It is defined as
|
39
|
+
# point = weight1 * point1 + weight2 * point2.
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# point1 = Geom::Point3d.new 1,1,1
|
43
|
+
# point2 = Geom::Point3d.new 10,10,10
|
44
|
+
# # Gets the point on the line segment connecting point1 and point2 that is
|
45
|
+
# # 3/4 the way from point1 to point2.
|
46
|
+
# point = Geom::Point3d.linear_combination 0.25, point1, 0.75, point2
|
47
|
+
# if (point)
|
48
|
+
# UI.messagebox point
|
49
|
+
# else
|
50
|
+
# UI.messagebox "Failure"
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @param weight1
|
54
|
+
# A weight or percentage.
|
55
|
+
#
|
56
|
+
# @param point1
|
57
|
+
# The start point on the line.
|
58
|
+
#
|
59
|
+
# @param point2
|
60
|
+
# The end point of the line.
|
61
|
+
#
|
62
|
+
# @param weight2
|
63
|
+
# A weight or percentage.
|
64
|
+
#
|
65
|
+
# @return point - a Point3d object
|
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 point, or to set the values of a point by adding to other points together.
|
75
|
+
#
|
76
|
+
# @example
|
77
|
+
# pt2 = pt + vec
|
78
|
+
# pt = pt + [10,10,10]
|
79
|
+
#
|
80
|
+
# @param point2
|
81
|
+
# A Point3d object.
|
82
|
+
#
|
83
|
+
# @return point - a Point3d object
|
84
|
+
#
|
85
|
+
# @version SketchUp 6.0
|
86
|
+
def +(point2)
|
87
|
+
end
|
88
|
+
|
89
|
+
# The '-' operator is a fast way to subtract from the current x, y and z values
|
90
|
+
# of a point.
|
91
|
+
#
|
92
|
+
# @example
|
93
|
+
# pt2 = pt - vec
|
94
|
+
# pt = pt - [10,10,10]
|
95
|
+
#
|
96
|
+
# @param point2
|
97
|
+
# A Point3d object.
|
98
|
+
#
|
99
|
+
# @return vector - a Vector object
|
100
|
+
#
|
101
|
+
# @version SketchUp 6.0
|
102
|
+
def -(point2)
|
103
|
+
end
|
104
|
+
|
105
|
+
# The '<' operator is a fast way to determine if another point is closer to the
|
106
|
+
# origin.
|
107
|
+
#
|
108
|
+
# @example
|
109
|
+
# pt1 = Geom::Point3d.new(10,10,10)
|
110
|
+
# pt2 = Geom::Point3d.new(20,20,20)
|
111
|
+
# result = pt1 < pt2
|
112
|
+
#
|
113
|
+
# @param point2
|
114
|
+
# A Point3d object.
|
115
|
+
#
|
116
|
+
# @return true if the point2 is closer to the origin.
|
117
|
+
#
|
118
|
+
# @version SketchUp 6.0
|
119
|
+
def <(point2)
|
120
|
+
end
|
121
|
+
|
122
|
+
# The == method is used to compare two points for equality.
|
123
|
+
#
|
124
|
+
# This uses the standard SketchUp tolerance to determine if two points are the
|
125
|
+
# same.
|
126
|
+
#
|
127
|
+
# Points can be compared to one another or to an array representing
|
128
|
+
# x, y and z coordinates, as in the following examples:
|
129
|
+
#
|
130
|
+
# @example
|
131
|
+
# if( pt1 == pt2 )
|
132
|
+
# UI.messagebox('equal')
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# # ... or ...
|
136
|
+
# if( pt1 == [100,200,300] ) ...
|
137
|
+
# UI.messagebox('equal')
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
# @example
|
141
|
+
# point1 = Geom::Point3d.new 1,1,1
|
142
|
+
# point2 = Geom::Point3d.new 10,10,10
|
143
|
+
# status = point1 == point2
|
144
|
+
#
|
145
|
+
# @param point2
|
146
|
+
# A Point3d object.
|
147
|
+
#
|
148
|
+
# @return status - true if both points are equal; false if points are not
|
149
|
+
# equal
|
150
|
+
#
|
151
|
+
# @version SketchUp 6.0
|
152
|
+
def ==(point2)
|
153
|
+
end
|
154
|
+
|
155
|
+
# The [] method is used to retrieve the value of the point at the specified
|
156
|
+
# index.
|
157
|
+
#
|
158
|
+
# @example
|
159
|
+
# point = Geom::Point3d.new 1, 2, 3
|
160
|
+
#
|
161
|
+
# # retrieves the y value of 2
|
162
|
+
# yvalue = point[1]
|
163
|
+
#
|
164
|
+
# @param index
|
165
|
+
# The index for a specific x, y, or z value within the
|
166
|
+
# Point3d.
|
167
|
+
#
|
168
|
+
# @return value - an x, y, or z value if successful
|
169
|
+
#
|
170
|
+
# @version SketchUp 6.0
|
171
|
+
def [](index)
|
172
|
+
end
|
173
|
+
|
174
|
+
# The []= method is used to set the x, y, or z value of the point based on the
|
175
|
+
# specific index of the value.
|
176
|
+
#
|
177
|
+
# @example
|
178
|
+
# point = Geom::Point3d.new 1,2,3
|
179
|
+
# yvalue = point[1] = 4
|
180
|
+
#
|
181
|
+
# @param new_value
|
182
|
+
# New x, y, or z value.
|
183
|
+
#
|
184
|
+
# @return status - the newly set x, y, or z value if successful
|
185
|
+
#
|
186
|
+
# @version SketchUp 6.0
|
187
|
+
def []=(new_value)
|
188
|
+
end
|
189
|
+
|
190
|
+
# The clone method is used to create another point identical to the point
|
191
|
+
# being cloned.
|
192
|
+
#
|
193
|
+
# @example
|
194
|
+
# point = Geom::Point3d.new 1,2,3
|
195
|
+
# newpoint = point.clone
|
196
|
+
#
|
197
|
+
# @return point2 - the cloned Point3d object
|
198
|
+
#
|
199
|
+
# @version SketchUp 6.0
|
200
|
+
def clone
|
201
|
+
end
|
202
|
+
|
203
|
+
# The distance method is used to compute the distance from a point to another
|
204
|
+
# point.
|
205
|
+
#
|
206
|
+
# @example
|
207
|
+
# point1 = Geom::Point3d.new 1,1,1
|
208
|
+
# point2 = Geom::Point3d.new 10,10,10
|
209
|
+
# distance = point1.distance point2
|
210
|
+
#
|
211
|
+
# @param point2
|
212
|
+
# The Point3d object to compute the distance to.
|
213
|
+
#
|
214
|
+
# @return distance - the distance in current units
|
215
|
+
#
|
216
|
+
# @version SketchUp 6.0
|
217
|
+
def distance(point2)
|
218
|
+
end
|
219
|
+
|
220
|
+
# The distance_to_line method is used to compute the distance from a point to
|
221
|
+
# a line.
|
222
|
+
#
|
223
|
+
# See Geom module for how to specify a line.
|
224
|
+
#
|
225
|
+
# @example
|
226
|
+
# point1 = Geom::Point3d.new 1,1,1
|
227
|
+
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
228
|
+
# distance = point1.distance_to_line line
|
229
|
+
#
|
230
|
+
# @param line
|
231
|
+
# A line (see Geom for information on creating lines).
|
232
|
+
#
|
233
|
+
# @return distance - the distance between a point and line in
|
234
|
+
# current units if successful
|
235
|
+
#
|
236
|
+
# @version SketchUp 6.0
|
237
|
+
def distance_to_line(line)
|
238
|
+
end
|
239
|
+
|
240
|
+
# The distance_to_plane method is used to compute the distance from the point
|
241
|
+
# to a plane.
|
242
|
+
#
|
243
|
+
# See module Geom for how to specify a plane.
|
244
|
+
#
|
245
|
+
# @example
|
246
|
+
# distance = point.distance_to_plane plane
|
247
|
+
#
|
248
|
+
# @param plane
|
249
|
+
# A plane (see Geom for how to create a plane).
|
250
|
+
#
|
251
|
+
# @return distance - a distance between a point and a plane in
|
252
|
+
# current units if successful
|
253
|
+
#
|
254
|
+
# @version SketchUp 6.0
|
255
|
+
def distance_to_plane(plane)
|
256
|
+
end
|
257
|
+
|
258
|
+
# The new method is used to create a new 3D point.
|
259
|
+
#
|
260
|
+
# @example
|
261
|
+
# # No arguments, creates a point at the origin [0,0,0]
|
262
|
+
# pt1 = Geom::Point3d.new
|
263
|
+
#
|
264
|
+
# # Creates a point at x of 100, y of 200, z of 300.
|
265
|
+
# pt2 = Geom::Point3d.new(100,200,300)
|
266
|
+
#
|
267
|
+
# # You can also create a point directly by simply assigning the x, y and z
|
268
|
+
# # values to a variable as an array:
|
269
|
+
# pt3 = [100,200,300]
|
270
|
+
#
|
271
|
+
# @overload initialize
|
272
|
+
#
|
273
|
+
# @return [Geom::Point3d]
|
274
|
+
#
|
275
|
+
# @overload initialize(x, y, z = 0.0)
|
276
|
+
#
|
277
|
+
# @param [Numeric] x The location along the x axis.
|
278
|
+
# @param [Numeric] y The location along the y axis.
|
279
|
+
# @param [Numeric] z The location along the z axis.
|
280
|
+
# @return [Geom::Point3d]
|
281
|
+
#
|
282
|
+
# @overload initialize(point3d)
|
283
|
+
#
|
284
|
+
# @param [Geom::Point3d] point3d
|
285
|
+
# @return [Geom::Point3d]
|
286
|
+
#
|
287
|
+
# @overload initialize(vertex)
|
288
|
+
#
|
289
|
+
# @param [Sketchup::Vertex] vertex
|
290
|
+
# @return [Geom::Point3d]
|
291
|
+
#
|
292
|
+
# @overload initialize(array2d)
|
293
|
+
#
|
294
|
+
# @param [Array(Numeric, Numeric)] array2d
|
295
|
+
# @return [Geom::Point3d]
|
296
|
+
#
|
297
|
+
# @overload initialize(input_point)
|
298
|
+
#
|
299
|
+
# @param [Sketchup::InputPoint] input_point
|
300
|
+
# @return [Geom::Point3d]
|
301
|
+
#
|
302
|
+
# @overload initialize(array3d)
|
303
|
+
#
|
304
|
+
# @param [Array(Numeric, Numeric, Numeric)] array3d
|
305
|
+
# @return [Geom::Point3d]
|
306
|
+
#
|
307
|
+
# @version SketchUp 6.0
|
308
|
+
def initialize(*args)
|
309
|
+
end
|
310
|
+
|
311
|
+
# The inspect method is used to format a 3D point as a string.
|
312
|
+
#
|
313
|
+
# You will not often use these function directly. Instead, they are called
|
314
|
+
# automatically when an object is output using a print command like 'puts',
|
315
|
+
# which writes to the Ruby console.
|
316
|
+
#
|
317
|
+
# @example
|
318
|
+
# point = Geom::Point3d.new 10,10,10
|
319
|
+
# string = point.inspect
|
320
|
+
#
|
321
|
+
# @return point - a string point representation
|
322
|
+
#
|
323
|
+
# @version SketchUp 6.0
|
324
|
+
def inspect
|
325
|
+
end
|
326
|
+
|
327
|
+
# The offset method is used to offset a point by a vector and return a new
|
328
|
+
# point. The length of the vector must not be zero.
|
329
|
+
#
|
330
|
+
# @example
|
331
|
+
# point1 = Geom::Point3d.new(10,10,10)
|
332
|
+
# vector = Geom::Vector3d.new(0,0,1)
|
333
|
+
# point2 = point1.offset! vector
|
334
|
+
#
|
335
|
+
# @param vector
|
336
|
+
# A Vector3d object to offset the point by.
|
337
|
+
#
|
338
|
+
# @param length
|
339
|
+
# the distance to offset. If not provided, the
|
340
|
+
# offset is my a distance equal to the vector length.
|
341
|
+
#
|
342
|
+
# @return point2 - a new Point3d object
|
343
|
+
#
|
344
|
+
# @version SketchUp 6.0
|
345
|
+
def offset(vector, length = vector.length)
|
346
|
+
end
|
347
|
+
|
348
|
+
# The offset! method is used to offset a point by a vector. The point itself
|
349
|
+
# is modified.
|
350
|
+
#
|
351
|
+
# Unlike offset, the point itself is modified.
|
352
|
+
#
|
353
|
+
# @example
|
354
|
+
# point1 = Geom::Point3d.new(10,10,10)
|
355
|
+
# vector = Geom::Vector3d.new(0,0,1)
|
356
|
+
# point2 = point1.offset! vector
|
357
|
+
#
|
358
|
+
# @param vector
|
359
|
+
# A Vector3d object to offset the point by.
|
360
|
+
#
|
361
|
+
# @param length
|
362
|
+
# the distance to offset. If not provided, the
|
363
|
+
# offset is my a distance equal to the vector length.
|
364
|
+
#
|
365
|
+
# @return point2 - a new Point3d object
|
366
|
+
#
|
367
|
+
# @version SketchUp 6.0
|
368
|
+
def offset!(vector, length = vector.length)
|
369
|
+
end
|
370
|
+
|
371
|
+
# The on_line? method is used to determine if the point is on a line.
|
372
|
+
#
|
373
|
+
# See module Geom for the various ways to specify a line.
|
374
|
+
#
|
375
|
+
# @example
|
376
|
+
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
377
|
+
# point = Geom::Point3d.new 10,10,10
|
378
|
+
# status = point.on_line? line
|
379
|
+
#
|
380
|
+
# @param line
|
381
|
+
# A line (see Geom for how to create a line).
|
382
|
+
#
|
383
|
+
# @return status - true if the point is on the line; false if the
|
384
|
+
# point is not on the line
|
385
|
+
#
|
386
|
+
# @return [Boolean]
|
387
|
+
#
|
388
|
+
# @version SketchUp 6.0
|
389
|
+
def on_line?(line)
|
390
|
+
end
|
391
|
+
|
392
|
+
# The on_plane? method is used to determine if the point is on a plane.
|
393
|
+
#
|
394
|
+
# See module Geom for the various ways to specify a plane.
|
395
|
+
#
|
396
|
+
# @example
|
397
|
+
# plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
398
|
+
# point = Geom::Point3d.new 10,10,10
|
399
|
+
# status = point.on_plane? plane
|
400
|
+
#
|
401
|
+
# @param plane
|
402
|
+
#
|
403
|
+
# @return status - true if the point is on the plane; false if
|
404
|
+
# the point is not on the plane
|
405
|
+
#
|
406
|
+
# @return [Boolean]
|
407
|
+
#
|
408
|
+
# @version SketchUp 6.0
|
409
|
+
def on_plane?(plane)
|
410
|
+
end
|
411
|
+
|
412
|
+
# The project_to_line method is used to retrieve the point on a line that is
|
413
|
+
# closest to this point.
|
414
|
+
#
|
415
|
+
# The line may be defined by either a point and a vector or by two points.
|
416
|
+
#
|
417
|
+
# @example
|
418
|
+
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
419
|
+
# point = Geom::Point3d.new 10,10,10
|
420
|
+
# projected_point = point.project_to_line line
|
421
|
+
#
|
422
|
+
# @param line
|
423
|
+
# - see Geom for how to specify a line
|
424
|
+
#
|
425
|
+
# @return point - the Point3d that is on a line closest to the
|
426
|
+
# point
|
427
|
+
#
|
428
|
+
# @version SketchUp 6.0
|
429
|
+
def project_to_line(line)
|
430
|
+
end
|
431
|
+
|
432
|
+
# The project_to_plane method is used to retrieve the point on a plane that is
|
433
|
+
# closest to the point.
|
434
|
+
#
|
435
|
+
# The plane may be defined by either a point on the plane and a vector
|
436
|
+
# perpendicular to the plane or by the coeficients to the plane equation AX +
|
437
|
+
# BY + CZ + D = 0. See Geom for details.
|
438
|
+
#
|
439
|
+
# @example
|
440
|
+
# plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
441
|
+
# point = Geom::Point3d.new 10,10,10
|
442
|
+
# projected_point = point.project_to_plane plane
|
443
|
+
#
|
444
|
+
# @param plane
|
445
|
+
# A plane (see Geom for how to create a plane).
|
446
|
+
#
|
447
|
+
# @return point - the Point3d that is on a plane closest to the
|
448
|
+
# point
|
449
|
+
#
|
450
|
+
# @version SketchUp 6.0
|
451
|
+
def project_to_plane(plane)
|
452
|
+
end
|
453
|
+
|
454
|
+
# The {#set!} method is used to set the values of the Point3d.
|
455
|
+
#
|
456
|
+
# @example
|
457
|
+
# point = Geom::Point3d.new 10,10,10
|
458
|
+
# point = point.set! 100,200,300
|
459
|
+
#
|
460
|
+
# @overload set!(point3d)
|
461
|
+
#
|
462
|
+
# @param [Geom::Point3d] point3d
|
463
|
+
# @return [Geom::Point3d]
|
464
|
+
#
|
465
|
+
# @overload set!(array3d)
|
466
|
+
#
|
467
|
+
# @param [Array(Numeric, Numeric, Numeric)] array3d
|
468
|
+
# @return [Geom::Point3d]
|
469
|
+
#
|
470
|
+
# @version SketchUp 6.0
|
471
|
+
def set!(*args)
|
472
|
+
end
|
473
|
+
|
474
|
+
# The to_a method is used to convert the point to an array of 3 numbers
|
475
|
+
#
|
476
|
+
# @example
|
477
|
+
# point = Geom::Point3d.new 10,20,30
|
478
|
+
# array = point.to_a
|
479
|
+
#
|
480
|
+
# pt = [100,200,300]
|
481
|
+
# # outputs [100.0,200.0,300.0]
|
482
|
+
# UI.messagebox(pt.to_a)
|
483
|
+
#
|
484
|
+
# @return array - an array of three numbers representing x,y,z of
|
485
|
+
# the Point3d
|
486
|
+
#
|
487
|
+
# @version SketchUp 6.0
|
488
|
+
def to_a
|
489
|
+
end
|
490
|
+
|
491
|
+
# The to_s method is used to retrieve a string representation of a point.
|
492
|
+
#
|
493
|
+
# @example
|
494
|
+
# point = Geom::Point3d.new 10,10,10
|
495
|
+
# str = point.to_s
|
496
|
+
#
|
497
|
+
# @return string - the string representation of the Point3d
|
498
|
+
#
|
499
|
+
# @version SketchUp 6.0
|
500
|
+
def to_s
|
501
|
+
end
|
502
|
+
|
503
|
+
# The transform! method is used to apply a Transformation to a point.
|
504
|
+
#
|
505
|
+
# Unlike the transform method, the point itself is modified.
|
506
|
+
#
|
507
|
+
# @example
|
508
|
+
# transform = Geom::Transformation.new(point2)
|
509
|
+
# point2 = Geom::Point3d.new 100,200,300
|
510
|
+
# point1 = Geom::Point3d.new 10,10,10
|
511
|
+
# point1.transform! transform
|
512
|
+
#
|
513
|
+
# @param transform
|
514
|
+
# A Transformation object.
|
515
|
+
#
|
516
|
+
# @return nil
|
517
|
+
#
|
518
|
+
# @version SketchUp 6.0
|
519
|
+
def transform(transform)
|
520
|
+
end
|
521
|
+
|
522
|
+
# The transform! method is used to apply a Transformation to a point to create
|
523
|
+
# a new point.
|
524
|
+
#
|
525
|
+
# @example
|
526
|
+
# transform = Geom::Transformation.new(point2)
|
527
|
+
# point2 = Geom::Point3d.new 100,200,300
|
528
|
+
# point1 = Geom::Point3d.new 10,10,10
|
529
|
+
# point3 = point1.transform transform
|
530
|
+
#
|
531
|
+
# @param transform
|
532
|
+
# A Transformation object.
|
533
|
+
#
|
534
|
+
# @return transformed_point - the new point
|
535
|
+
#
|
536
|
+
# @version SketchUp 6.0
|
537
|
+
def transform!(transform)
|
538
|
+
end
|
539
|
+
|
540
|
+
# The vector_to team method retrieves the vector between points.
|
541
|
+
#
|
542
|
+
# @example
|
543
|
+
# point2 = Geom::Point3d.new 100,200,300
|
544
|
+
# point1 = Geom::Point3d.new 10,10,10
|
545
|
+
# vector = point1.vector_to point2
|
546
|
+
#
|
547
|
+
# # Another example...
|
548
|
+
# pt1 = [1,1,0]
|
549
|
+
# pt2 = [3,1,0]
|
550
|
+
# pt1.vector_to( pt2 ) # returns the vector (2,0,0)
|
551
|
+
# pt1.vector_to(pt2) # is equivalent to (pt2 - pt1)
|
552
|
+
#
|
553
|
+
# @param point2
|
554
|
+
# A Point3d object.
|
555
|
+
#
|
556
|
+
# @return vector - a Vector object
|
557
|
+
#
|
558
|
+
# @version SketchUp 6.0
|
559
|
+
def vector_to(point2)
|
560
|
+
end
|
561
|
+
|
562
|
+
# The x method retrieves the x value of the 3D point.
|
563
|
+
#
|
564
|
+
# @example
|
565
|
+
# point = Geom::Point3d.new 1,2,3
|
566
|
+
# x = point.x
|
567
|
+
#
|
568
|
+
# @return x - the new x value
|
569
|
+
#
|
570
|
+
# @version SketchUp 6.0
|
571
|
+
def x
|
572
|
+
end
|
573
|
+
|
574
|
+
# The x= method is used to set the x value of a 3D point.
|
575
|
+
#
|
576
|
+
# @example
|
577
|
+
# point = Geom::Point3d.new 1,2,3
|
578
|
+
# x = point.x = 2
|
579
|
+
#
|
580
|
+
# @param value
|
581
|
+
# The new x value.
|
582
|
+
#
|
583
|
+
# @return x - the newly set x value
|
584
|
+
#
|
585
|
+
# @version SketchUp 6.0
|
586
|
+
def x=(value)
|
587
|
+
end
|
588
|
+
|
589
|
+
# The y method retrieves the y value of the 3D point.
|
590
|
+
#
|
591
|
+
# @example
|
592
|
+
# point = Geom::Point3d.new 1,2,3
|
593
|
+
# y = point.y
|
594
|
+
#
|
595
|
+
# @return y - the new y value
|
596
|
+
#
|
597
|
+
# @version SketchUp 6.0
|
598
|
+
def y
|
599
|
+
end
|
600
|
+
|
601
|
+
# The y= method is used to set the y value of a 3D point.
|
602
|
+
#
|
603
|
+
# @example
|
604
|
+
# point = Geom::Point3d.new 1,2,3
|
605
|
+
# y = point.y = 2
|
606
|
+
#
|
607
|
+
# @param value
|
608
|
+
# The new y value.
|
609
|
+
#
|
610
|
+
# @return y - the newly set y value
|
611
|
+
#
|
612
|
+
# @version SketchUp 6.0
|
613
|
+
def y=(value)
|
614
|
+
end
|
615
|
+
|
616
|
+
# The z method retrieves the z value of the 3D point.
|
617
|
+
#
|
618
|
+
# @example
|
619
|
+
# point = Geom::Point3d.new 1,2,3
|
620
|
+
# z = point.x
|
621
|
+
#
|
622
|
+
# @return z - the z value
|
623
|
+
#
|
624
|
+
# @version SketchUp 6.0
|
625
|
+
def z
|
626
|
+
end
|
627
|
+
|
628
|
+
# The z= method is used to set the z value of a 3D point.
|
629
|
+
#
|
630
|
+
# @example
|
631
|
+
# point = Geom::Point3d.new 1,2,3
|
632
|
+
# z = point.z = 2
|
633
|
+
#
|
634
|
+
# @param value
|
635
|
+
# The new z value.
|
636
|
+
#
|
637
|
+
# @return z - the newly set z value
|
638
|
+
#
|
639
|
+
# @version SketchUp 6.0
|
640
|
+
def z=(value)
|
641
|
+
end
|
642
|
+
|
643
|
+
end
|