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,406 +1,432 @@
1
- # Copyright:: Copyright 2023 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The {Sketchup::InputPoint} class is used to pick 3d points and/or entities
5
- # that reside under the current cursor location, similar to native Line tool
6
- # and other drawing tools. Unlike {Sketchup::PickHelper},
7
- # {Sketchup::InputPoint} uses inference, i.e. "snaps" to vertices and other
8
- # entities when the cursor is close to them.
9
- #
10
- # Only {Sketchup::Tool}s react to cursor location and most of these methods are
11
- # only useful in the context of a tool. For example, if you want to determine
12
- # the 3d point you just moved the cursor over, you would use
13
- # {#pick} from within your {Sketchup::Tool#onMouseMove} method.
14
- # {Sketchup::InputPoints} are best picked from mouse move, as you want them to
15
- # draw them to the view.
16
- #
17
- # For an example, see
18
- # {Tool
19
- # Example}[https://github.com/SketchUp/sketchup-ruby-api-tutorials/tree/main/examples/02_custom_tool].
20
- #
21
- # To lock inference similar to native SketchUp tools, see
22
- # {View#lock_inference}.
23
- #
24
- # @version SketchUp 6.0
25
- class Sketchup::InputPoint
26
-
27
- # Instance Methods
28
-
29
- # The == method is used to determine if two input points are the same.
30
- #
31
- # @example
32
- # view = Sketchup.active_model.active_view
33
- # x = 100
34
- # y = 100
35
- # ip1 = Sketchup::InputPoint.new
36
- # ip2 = view.inputpoint x,y
37
- # # Copy the contents of inputpoint2 into inputpoint1
38
- # ip1.copy! ip2
39
- # # Returns true
40
- # status = ip1 == ip2
41
- #
42
- # @param inputpoint2
43
- # The second input point in the comparison.
44
- #
45
- # @return status - true if the InputPoint objects are the same
46
- # object. False if the objects are not the same.
47
- #
48
- # @version SketchUp 6.0
49
- def ==(inputpoint2)
50
- end
51
-
52
- # The clear method is used to clear the input point.
53
- #
54
- # This sets it to an empty state. After calling this, valid? will return
55
- # false.
56
- #
57
- # @example
58
- # view = Sketchup.active_model.active_view
59
- # x = 100
60
- # y = 100
61
- # ip1 = view.inputpoint x,y
62
- # # Returns true
63
- # ip = ip1.clear
64
- #
65
- # @return inputpoint - the cleared (empty) input point if this
66
- # successful
67
- #
68
- # @version SketchUp 6.0
69
- def clear
70
- end
71
-
72
- # The copy! method is used to copy the data from a second input point into
73
- # this input point.
74
- #
75
- # @example
76
- # view = Sketchup.active_model.active_view
77
- # x = 100
78
- # y = 100
79
- # ip1 = Sketchup::InputPoint.new
80
- # ip2 = view.inputpoint x,y
81
- # # Copy the contents of inputpoint2 into inputpoint1
82
- # ip = ip1.copy! ip2
83
- #
84
- # @param inputpoint
85
- # The second input point.
86
- #
87
- # @return inputpoint - the new input point that received the copy
88
- # if successful
89
- #
90
- # @version SketchUp 6.0
91
- def copy!(inputpoint)
92
- end
93
-
94
- # The degrees_of_freedom method retrieves the number of degrees of freedom
95
- # there are for an input point.
96
- #
97
- # If you are just getting a point in space, then the degrees_of_freedom will
98
- # be 3 - meaning that there is nothing about the point that would constrain
99
- # its position.
100
- #
101
- # If you are on a face, then the degrees_of_freedom will be 2
102
- # meaning that you can only move on the plane of the face.
103
- #
104
- # If you are on an Edge or an axis, then the degrees_of_freedom will be 1
105
- # meaning that you can only move in the direction of the edge or axis.
106
- #
107
- # If you get an end point of an Edge, or an intersection point, then the
108
- # degrees_of_freedom will be 0.
109
- #
110
- # @example
111
- # view = Sketchup.active_model.active_view
112
- # x = 100
113
- # y = 100
114
- # ip1 = view.inputpoint x,y
115
- # dof = ip1.degrees_of_freedom
116
- #
117
- # @return degrees_of_freedom - see comments.
118
- #
119
- # @version SketchUp 6.0
120
- def degrees_of_freedom
121
- end
122
-
123
- # The depth method retrieves the depth of an inference if it is coming from a
124
- # component.
125
- #
126
- # If the InputPoint is not getting a position from inside a component, this
127
- # method will return 0. Otherwise it returns the depth of the entity in a
128
- # nested component that is providing the position.
129
- #
130
- # @example
131
- # view = Sketchup.active_model.active_view
132
- # x = 100
133
- # y = 100
134
- # ip1 = view.inputpoint x,y
135
- # d = ip1.depth
136
- #
137
- # @return depth - a number representing the depth of the
138
- # inputpoint (inside groups and components) if successful
139
- #
140
- # @version SketchUp 6.0
141
- def depth
142
- end
143
-
144
- # The display? method is used to determine if the input point has anything to
145
- # draw.
146
- #
147
- # If the method returns true, then the draw method will draw something.
148
- #
149
- # @example
150
- # view = Sketchup.active_model.active_view
151
- # x = 100
152
- # y = 100
153
- # ip1 = view.inputpoint x,y
154
- # status = ip1.display
155
- #
156
- # @return [Boolean] status - true if the draw method will draw something,
157
- # false if the draw method has nothing to draw
158
- #
159
- # @version SketchUp 6.0
160
- def display?
161
- end
162
-
163
- # The draw method is used to draw the input point.
164
- #
165
- # This is useful for showing an InputPoint from within the draw method of a
166
- # tool that you have implemented in Ruby. Additional examples are available in
167
- # the Plugins/examples directory.
168
- #
169
- # @example
170
- # view = Sketchup.active_model.active_view
171
- # x = 100
172
- # y = 100
173
- # ip1 = view.inputpoint x,y
174
- # ip = ip1.draw view
175
- #
176
- # @param view
177
- # The current view.
178
- #
179
- # @return view
180
- #
181
- # @version SketchUp 6.0
182
- def draw(view)
183
- end
184
-
185
- # The edge method is used to retrieve the edge if the input point is getting
186
- # its position from a point on an Edge.
187
- #
188
- # @example
189
- # view = Sketchup.active_model.active_view
190
- # x = 100
191
- # y = 100
192
- # ip1 = view.inputpoint x,y
193
- # e = ip1.edge
194
- #
195
- # @return edge - an Edge object if successful, or nil if
196
- # unsuccessful
197
- #
198
- # @version SketchUp 6.0
199
- def edge
200
- end
201
-
202
- # The face method retrieves the face at or behind the input point. This can be
203
- # used to determine a plane, similar to what native Rotate tool does.
204
- #
205
- # @example
206
- # view = Sketchup.active_model.active_view
207
- # x = 100
208
- # y = 100
209
- # ip1 = view.inputpoint x,y
210
- # f = ip1.face
211
- #
212
- # @note The InputPoint doesn't necessarily lie on the face, but can be e.g. on
213
- # an edge in front of the face.
214
- #
215
- # @return [Sketchup::Face, nil]
216
- #
217
- # @version SketchUp 6.0
218
- def face
219
- end
220
-
221
- # The new method is used to create a new InputPoint object.
222
- #
223
- # @example
224
- # ip1 = Sketchup::InputPoint.new
225
- #
226
- # # Or you can construct it at an arbitrary location.
227
- # starting_point = Geom::Point3d.new(100, 200, 300)
228
- # ip2 = Sketchup::InputPoint.new(starting_point)
229
- #
230
- # @note Prior to SketchUp 2019 it was not possible to
231
- # sub-class {Sketchup::InputPoint} due to a bug in how SketchUp initialized
232
- # the class.
233
- #
234
- # @overload initialize()
235
- #
236
- # @return [Sketchup::InputPoint]
237
- #
238
- # @overload initialize(pt_or_vertex)
239
- #
240
- # @param pt_or_vertex [Geom::Point3d, Sketchup::Vertex] An optional Point3d
241
- # or Vertex where the new InputPoint should be created.
242
- # @return [Sketchup::InputPoint]
243
- #
244
- # @version SketchUp 6.0
245
- def initialize(*args)
246
- end
247
-
248
- # The {#instance_path} method retrieves the instance path for the picked point.
249
- #
250
- # The returned instance_path is a copy of what the input point is holding on to
251
- # at the moment you access it. Your copy will not update if you make new picks
252
- # with the input point.
253
- #
254
- # If there has been no valid pick it will return `nil`.
255
- #
256
- # @example
257
- # view = Sketchup.active_model.active_view
258
- # x = 100
259
- # y = 100
260
- # ip = view.inputpoint(x, y)
261
- # instance_path = ip.instance_path
262
- #
263
- # @return [Sketchup::InstancePath, nil]
264
- #
265
- # @version SketchUp 2017
266
- def instance_path
267
- end
268
-
269
- # The {#pick} method is used to get a input point at a specific screen
270
- # position.
271
- #
272
- # @example
273
- # view = Sketchup.active_model.active_view
274
- # x = 100
275
- # y = 100
276
- # inputpoint = view.inputpoint(x, y)
277
- # inputpoint2 = Sketchup::InputPoint.new(Geom::Point3d.new(100, 200, 300))
278
- # inputpoint.pick(view, x, y)
279
- # inputpoint.pick(view, x, y, inputpoint2)
280
- #
281
- # @overload pick(view, x, y)
282
- #
283
- # The first form just uses the screen position to compute the InputPoint. It
284
- # is used when you don't want the InputPoint to be dependent on another
285
- # InputPoint.
286
- # @param [Sketchup::View] view
287
- # @param [Integer] x
288
- # @param [Integer] y
289
- #
290
- # @overload pick(view, x, y, inputpoint)
291
- #
292
- # The second form uses the screen position and another InputPoint. It will
293
- # find additional inferences such as along one of the axis directions from the
294
- # first point.
295
- # @param [Sketchup::View] view
296
- # @param [Integer] x
297
- # @param [Integer] y
298
- # @param [Sketchup::InputPoint] inputpoint
299
- # A second input point used as a reference for the pick.
300
- #
301
- # @return [Boolean] +true+ if a valid input point was picked and it
302
- # is different than it was before.
303
- #
304
- # @version SketchUp 6.0
305
- def pick(*args)
306
- end
307
-
308
- # The position method is used to get the 3D point from the input point.
309
- #
310
- # @example
311
- # view = Sketchup.active_model.active_view
312
- # x = 100
313
- # y = 100
314
- # ip1 = view.inputpoint x,y
315
- # point = ip1.position
316
- #
317
- # @return point - a Point3d object position for the input point
318
- # if successful
319
- #
320
- # @version SketchUp 6.0
321
- def position
322
- end
323
-
324
- # The tooltip method is used to retrieve the string that is the tool tip to
325
- # display for the input point.
326
- #
327
- # @example
328
- # view = Sketchup.active_model.active_view
329
- # x = 100
330
- # y = 100
331
- # ip1 = view.inputpoint x,y
332
- # # Click on a face and you get "On Face"
333
- # tip = ip1.tooltip
334
- #
335
- # @return tip - a string tooltip or an empty string (if the input
336
- # point doesn't provide a tooltip).
337
- #
338
- # @version SketchUp 6.0
339
- def tooltip
340
- end
341
-
342
- # The transformation method retrieves the Transformation object for the input
343
- # point.
344
- #
345
- # If the InputPoint object is getting its position from something inside of a
346
- # component instance, this method returns the Transformation of the component
347
- # instance. Otherwise it returns the identity Transformation.
348
- #
349
- # Note that the position method on a input point always returns a point that is
350
- # transformed into model space. If you are using the edge, face or vertex
351
- # method on the InputPoint though, you will probably need to use the
352
- # transformation method to transform the data that you get back from the
353
- # selected entity.
354
- #
355
- # @example
356
- # view = Sketchup.active_model.active_view
357
- # x = 100
358
- # y = 100
359
- # ip1 = view.inputpoint x,y
360
- # # In this case, returning the identity transformation
361
- # tform = ip1.transformation
362
- #
363
- # @return transformation - the Transformation for the input point
364
- # if successful
365
- #
366
- # @version SketchUp 6.0
367
- def transformation
368
- end
369
-
370
- # The valid? method is used to determine if an input point has valid data.
371
- #
372
- # You must have called the pick method to set the data before it is valid.
373
- #
374
- # @example
375
- # view = Sketchup.active_model.active_view
376
- # x = 100
377
- # y = 100
378
- # ip1 = view.inputpoint x,y
379
- # status = ip1.valid?
380
- #
381
- # @return [Boolean] status - true if the input point has valid data, false
382
- # if it does not have valid data.
383
- #
384
- # @version SketchUp 6.0
385
- def valid?
386
- end
387
-
388
- # The vertex method returns a Vertex associated with the InputPoint. If the
389
- # InputPoint is on the end of a line, then it will return the Vertex. If the
390
- # InputPoint does not select any vertices this method returns nil.
391
- #
392
- # @example
393
- # view = Sketchup.active_model.active_view
394
- # x = 100
395
- # y = 100
396
- # ip1 = view.inputpoint x,y
397
- # # Click on a face and you get "On Face"
398
- # tip = ip1.vertex
399
- #
400
- # @return vertex - The associated vertex
401
- #
402
- # @version SketchUp 6.0
403
- def vertex
404
- end
405
-
406
- end
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The {Sketchup::InputPoint} class is used to pick 3d points and/or entities
5
+ # that reside under the current cursor location, similar to native Line tool
6
+ # and other drawing tools. Unlike {Sketchup::PickHelper},
7
+ # {Sketchup::InputPoint} uses inference, i.e. "snaps" to vertices and other
8
+ # entities when the cursor is close to them.
9
+ #
10
+ # Only {Sketchup::Tool}s react to cursor location and most of these methods are
11
+ # only useful in the context of a tool. For example, if you want to determine
12
+ # the 3d point you just moved the cursor over, you would use
13
+ # {#pick} from within your {Sketchup::Tool#onMouseMove} method.
14
+ # {Sketchup::InputPoints} are best picked from mouse move, as you want them to
15
+ # draw them to the view.
16
+ #
17
+ # For an example, see
18
+ # {Tool
19
+ # Example}[https://github.com/SketchUp/sketchup-ruby-api-tutorials/tree/main/examples/02_custom_tool].
20
+ #
21
+ # To lock inference similar to native SketchUp tools, see
22
+ # {View#lock_inference}.
23
+ #
24
+ # @version SketchUp 6.0
25
+ class Sketchup::InputPoint
26
+
27
+ # Instance Methods
28
+
29
+ # The == method is used to determine if two input points are the same.
30
+ #
31
+ # @example
32
+ # view = Sketchup.active_model.active_view
33
+ # x = 100
34
+ # y = 100
35
+ # ip1 = Sketchup::InputPoint.new
36
+ # ip2 = view.inputpoint x,y
37
+ # # Copy the contents of inputpoint2 into inputpoint1
38
+ # ip1.copy! ip2
39
+ # # Returns true
40
+ # status = ip1 == ip2
41
+ #
42
+ # @param inputpoint2
43
+ # The second input point in the comparison.
44
+ #
45
+ # @return status - true if the InputPoint objects are the same
46
+ # object. False if the objects are not the same.
47
+ #
48
+ # @version SketchUp 6.0
49
+ def ==(inputpoint2)
50
+ end
51
+
52
+ # The clear method is used to clear the input point.
53
+ #
54
+ # This sets it to an empty state. After calling this, valid? will return
55
+ # false.
56
+ #
57
+ # @example
58
+ # view = Sketchup.active_model.active_view
59
+ # x = 100
60
+ # y = 100
61
+ # ip1 = view.inputpoint x,y
62
+ # # Returns true
63
+ # ip = ip1.clear
64
+ #
65
+ # @return inputpoint - the cleared (empty) input point if this
66
+ # successful
67
+ #
68
+ # @version SketchUp 6.0
69
+ def clear
70
+ end
71
+
72
+ # The copy! method is used to copy the data from a second input point into
73
+ # this input point.
74
+ #
75
+ # @example
76
+ # view = Sketchup.active_model.active_view
77
+ # x = 100
78
+ # y = 100
79
+ # ip1 = Sketchup::InputPoint.new
80
+ # ip2 = view.inputpoint x,y
81
+ # # Copy the contents of inputpoint2 into inputpoint1
82
+ # ip = ip1.copy! ip2
83
+ #
84
+ # @param inputpoint
85
+ # The second input point.
86
+ #
87
+ # @return inputpoint - the new input point that received the copy
88
+ # if successful
89
+ #
90
+ # @version SketchUp 6.0
91
+ def copy!(inputpoint)
92
+ end
93
+
94
+ # The degrees_of_freedom method retrieves the number of degrees of freedom
95
+ # there are for an input point.
96
+ #
97
+ # If you are just getting a point in space, then the degrees_of_freedom will
98
+ # be 3 - meaning that there is nothing about the point that would constrain
99
+ # its position.
100
+ #
101
+ # If you are on a face, then the degrees_of_freedom will be 2
102
+ # meaning that you can only move on the plane of the face.
103
+ #
104
+ # If you are on an Edge or an axis, then the degrees_of_freedom will be 1
105
+ # meaning that you can only move in the direction of the edge or axis.
106
+ #
107
+ # If you get an end point of an Edge, or an intersection point, then the
108
+ # degrees_of_freedom will be 0.
109
+ #
110
+ # @example
111
+ # view = Sketchup.active_model.active_view
112
+ # x = 100
113
+ # y = 100
114
+ # ip1 = view.inputpoint x,y
115
+ # dof = ip1.degrees_of_freedom
116
+ #
117
+ # @return degrees_of_freedom - see comments.
118
+ #
119
+ # @version SketchUp 6.0
120
+ def degrees_of_freedom
121
+ end
122
+
123
+ # The depth method retrieves the depth of an inference if it is coming from a
124
+ # component.
125
+ #
126
+ # If the InputPoint is not getting a position from inside a component, this
127
+ # method will return 0. Otherwise it returns the depth of the entity in a
128
+ # nested component that is providing the position.
129
+ #
130
+ # @example
131
+ # view = Sketchup.active_model.active_view
132
+ # x = 100
133
+ # y = 100
134
+ # ip1 = view.inputpoint x,y
135
+ # d = ip1.depth
136
+ #
137
+ # @return depth - a number representing the depth of the
138
+ # inputpoint (inside groups and components) if successful
139
+ #
140
+ # @version SketchUp 6.0
141
+ def depth
142
+ end
143
+
144
+ # The display? method is used to determine if the input point has anything to
145
+ # draw.
146
+ #
147
+ # If the method returns true, then the draw method will draw something.
148
+ #
149
+ # @example
150
+ # view = Sketchup.active_model.active_view
151
+ # x = 100
152
+ # y = 100
153
+ # ip1 = view.inputpoint x,y
154
+ # status = ip1.display
155
+ #
156
+ # @return [Boolean] status - true if the draw method will draw something,
157
+ # false if the draw method has nothing to draw
158
+ #
159
+ # @version SketchUp 6.0
160
+ def display?
161
+ end
162
+
163
+ # The draw method is used to draw the input point.
164
+ #
165
+ # This is useful for showing an InputPoint from within the draw method of a
166
+ # tool that you have implemented in Ruby. Additional examples are available in
167
+ # the Plugins/examples directory.
168
+ #
169
+ # @example
170
+ # view = Sketchup.active_model.active_view
171
+ # x = 100
172
+ # y = 100
173
+ # ip1 = view.inputpoint x,y
174
+ # ip = ip1.draw view
175
+ #
176
+ # @param view
177
+ # The current view.
178
+ #
179
+ # @return view
180
+ #
181
+ # @version SketchUp 6.0
182
+ def draw(view)
183
+ end
184
+
185
+ # The edge method is used to retrieve the edge if the input point is getting
186
+ # its position from a point on an Edge.
187
+ #
188
+ # @example
189
+ # view = Sketchup.active_model.active_view
190
+ # x = 100
191
+ # y = 100
192
+ # ip1 = view.inputpoint x,y
193
+ # e = ip1.edge
194
+ #
195
+ # @return edge - an Edge object if successful, or nil if
196
+ # unsuccessful
197
+ #
198
+ # @version SketchUp 6.0
199
+ def edge
200
+ end
201
+
202
+ # The face method retrieves the face at or behind the input point. This can be
203
+ # used to determine a plane, similar to what native Rotate tool does.
204
+ #
205
+ # @example
206
+ # view = Sketchup.active_model.active_view
207
+ # x = 100
208
+ # y = 100
209
+ # ip1 = view.inputpoint x,y
210
+ # f = ip1.face
211
+ #
212
+ # @note The InputPoint doesn't necessarily lie on the face, but can be e.g. on
213
+ # an edge in front of the face.
214
+ #
215
+ # @return [Sketchup::Face, nil]
216
+ #
217
+ # @version SketchUp 6.0
218
+ def face
219
+ end
220
+
221
+ # The new method is used to create a new InputPoint object.
222
+ #
223
+ # @example
224
+ # ip1 = Sketchup::InputPoint.new
225
+ #
226
+ # # Or you can construct it at an arbitrary location.
227
+ # starting_point = Geom::Point3d.new(100, 200, 300)
228
+ # ip2 = Sketchup::InputPoint.new(starting_point)
229
+ #
230
+ # @note Prior to SketchUp 2019 it was not possible to
231
+ # sub-class {Sketchup::InputPoint} due to a bug in how SketchUp initialized
232
+ # the class.
233
+ #
234
+ # @overload initialize()
235
+ #
236
+ # @return [Sketchup::InputPoint]
237
+ #
238
+ # @overload initialize(pt_or_vertex)
239
+ #
240
+ # @param pt_or_vertex [Geom::Point3d, Sketchup::Vertex] An optional Point3d
241
+ # or Vertex where the new InputPoint should be created.
242
+ # @return [Sketchup::InputPoint]
243
+ #
244
+ # @version SketchUp 6.0
245
+ def initialize(*args)
246
+ end
247
+
248
+ # The {#instance_path} method retrieves the instance path for the picked point.
249
+ #
250
+ # The returned instance_path is a copy of what the input point is holding on to
251
+ # at the moment you access it. Your copy will not update if you make new picks
252
+ # with the input point.
253
+ #
254
+ # If there has been no valid pick it will return `nil`.
255
+ #
256
+ # @example
257
+ # view = Sketchup.active_model.active_view
258
+ # x = 100
259
+ # y = 100
260
+ # ip = view.inputpoint(x, y)
261
+ # instance_path = ip.instance_path
262
+ #
263
+ # @return [Sketchup::InstancePath, nil]
264
+ #
265
+ # @version SketchUp 2017
266
+ def instance_path
267
+ end
268
+
269
+ # The {#pick} method is used to get a input point at a specific screen
270
+ # position.
271
+ #
272
+ # @example
273
+ # view = Sketchup.active_model.active_view
274
+ # x = 100 # Screen coordinate
275
+ # y = 200 # Screen coordinate
276
+ # inputpoint = view.inputpoint(x, y)
277
+ # inputpoint2 = Sketchup::InputPoint.new(Geom::Point3d.new(100, 250, 300))
278
+ # inputpoint.pick(view, x, y)
279
+ # inputpoint.pick(view, x, y, inputpoint2)
280
+ #
281
+ # @overload pick(view, x, y)
282
+ #
283
+ # @note Signature for versions prior to SketchUp 2025.0
284
+ # @version SketchUp 6.0
285
+ # The first form just uses the screen position to compute the InputPoint. It
286
+ # is used when you don't want the InputPoint to be dependent on another
287
+ # InputPoint.
288
+ # @param [Sketchup::View] view
289
+ # @param [Integer] x Screen coordinate in physical pixels.
290
+ # @param [Integer] y Screen coordinate in physical pixels.
291
+ #
292
+ # @overload pick(view, x, y, inputpoint)
293
+ #
294
+ # @note Signature for versions prior to SketchUp 2025.0
295
+ # @version SketchUp 6.0
296
+ # The second form uses the screen position and another InputPoint. It will
297
+ # find additional inferences such as along one of the axis directions from the
298
+ # first point.
299
+ # @param [Sketchup::View] view
300
+ # @param [Integer] x Screen coordinate in physical pixels.
301
+ # @param [Integer] y Screen coordinate in physical pixels.
302
+ # @param [Sketchup::InputPoint] inputpoint
303
+ # A second input point used as a reference for the pick.
304
+ #
305
+ # @overload pick(view, x, y)
306
+ #
307
+ # @version SketchUp 2025.0
308
+ # The first form just uses the screen position to compute the InputPoint. It
309
+ # is used when you don't want the InputPoint to be dependent on another
310
+ # InputPoint.
311
+ # @param [Sketchup::View] view
312
+ # @param [Float] x Screen coordinate in logical pixels.
313
+ # @param [Float] y Screen coordinate in logical pixels.
314
+ #
315
+ # @overload pick(view, x, y, inputpoint)
316
+ #
317
+ # @version SketchUp 2025.0
318
+ # The second form uses the screen position and another InputPoint. It will
319
+ # find additional inferences such as along one of the axis directions from the
320
+ # first point.
321
+ # @param [Sketchup::View] view
322
+ # @param [Float] x Screen coordinate in logical pixels.
323
+ # @param [Float] y Screen coordinate in logical pixels.
324
+ # @param [Sketchup::InputPoint] inputpoint
325
+ # A second input point used as a reference for the pick.
326
+ #
327
+ # @return [Boolean] +true+ if a valid input point was picked and it
328
+ # is different than it was before.
329
+ #
330
+ # @version SketchUp 6.0
331
+ def pick(*args)
332
+ end
333
+
334
+ # The position method is used to get the 3D point from the input point.
335
+ #
336
+ # @example
337
+ # view = Sketchup.active_model.active_view
338
+ # x = 100
339
+ # y = 100
340
+ # ip1 = view.inputpoint x,y
341
+ # point = ip1.position
342
+ #
343
+ # @return point - a Point3d object position for the input point
344
+ # if successful
345
+ #
346
+ # @version SketchUp 6.0
347
+ def position
348
+ end
349
+
350
+ # The tooltip method is used to retrieve the string that is the tool tip to
351
+ # display for the input point.
352
+ #
353
+ # @example
354
+ # view = Sketchup.active_model.active_view
355
+ # x = 100
356
+ # y = 100
357
+ # ip1 = view.inputpoint x,y
358
+ # # Click on a face and you get "On Face"
359
+ # tip = ip1.tooltip
360
+ #
361
+ # @return tip - a string tooltip or an empty string (if the input
362
+ # point doesn't provide a tooltip).
363
+ #
364
+ # @version SketchUp 6.0
365
+ def tooltip
366
+ end
367
+
368
+ # The transformation method retrieves the Transformation object for the input
369
+ # point.
370
+ #
371
+ # If the InputPoint object is getting its position from something inside of a
372
+ # component instance, this method returns the Transformation of the component
373
+ # instance. Otherwise it returns the identity Transformation.
374
+ #
375
+ # Note that the position method on a input point always returns a point that is
376
+ # transformed into model space. If you are using the edge, face or vertex
377
+ # method on the InputPoint though, you will probably need to use the
378
+ # transformation method to transform the data that you get back from the
379
+ # selected entity.
380
+ #
381
+ # @example
382
+ # view = Sketchup.active_model.active_view
383
+ # x = 100
384
+ # y = 100
385
+ # ip1 = view.inputpoint x,y
386
+ # # In this case, returning the identity transformation
387
+ # tform = ip1.transformation
388
+ #
389
+ # @return transformation - the Transformation for the input point
390
+ # if successful
391
+ #
392
+ # @version SketchUp 6.0
393
+ def transformation
394
+ end
395
+
396
+ # The valid? method is used to determine if an input point has valid data.
397
+ #
398
+ # You must have called the pick method to set the data before it is valid.
399
+ #
400
+ # @example
401
+ # view = Sketchup.active_model.active_view
402
+ # x = 100
403
+ # y = 100
404
+ # ip1 = view.inputpoint x,y
405
+ # status = ip1.valid?
406
+ #
407
+ # @return [Boolean] status - true if the input point has valid data, false
408
+ # if it does not have valid data.
409
+ #
410
+ # @version SketchUp 6.0
411
+ def valid?
412
+ end
413
+
414
+ # The vertex method returns a Vertex associated with the InputPoint. If the
415
+ # InputPoint is on the end of a line, then it will return the Vertex. If the
416
+ # InputPoint does not select any vertices this method returns nil.
417
+ #
418
+ # @example
419
+ # view = Sketchup.active_model.active_view
420
+ # x = 100
421
+ # y = 100
422
+ # ip1 = view.inputpoint x,y
423
+ # # Click on a face and you get "On Face"
424
+ # tip = ip1.vertex
425
+ #
426
+ # @return vertex - The associated vertex
427
+ #
428
+ # @version SketchUp 6.0
429
+ def vertex
430
+ end
431
+
432
+ end