sketchup-api-stubs 0.7.10 → 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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +6 -0
  3. data/lib/sketchup-api-stubs/stubs/Array.rb +1 -1
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +2 -2
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +25 -15
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +17 -32
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +62 -39
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +136 -104
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +56 -30
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +76 -52
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +35 -31
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +8 -16
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +135 -110
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +207 -222
  16. data/lib/sketchup-api-stubs/stubs/Geom.rb +6 -6
  17. data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +1 -1
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +1 -1
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +11 -7
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +1 -1
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
  22. data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
  23. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +124 -10
  24. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
  26. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +112 -4
  27. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
  28. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
  29. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +4 -4
  30. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
  31. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
  33. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
  34. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
  35. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +56 -9
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
  37. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
  38. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +100 -1
  39. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +13 -14
  40. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
  41. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +5 -3
  42. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
  43. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +1 -1
  44. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +1 -1
  45. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +47 -1
  46. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
  49. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
  50. data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
  51. data/lib/sketchup-api-stubs/stubs/Length.rb +9 -1
  52. data/lib/sketchup-api-stubs/stubs/Numeric.rb +1 -1
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +65 -13
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +2 -7
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +16 -3
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +13 -13
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +8 -14
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +10 -15
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +2 -2
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +28 -14
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +15 -8
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +7 -12
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +4 -10
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +17 -15
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +17 -17
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +3 -3
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +11 -14
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +2 -2
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +10 -10
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +59 -19
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +1 -1
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +3 -3
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
  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 +3 -6
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +94 -25
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +2 -2
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +16 -26
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +24 -17
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +11 -9
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +4 -67
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +2 -2
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +2 -2
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +34 -8
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +4 -3
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +14 -8
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +3 -45
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -19
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -9
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +10 -3
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -1
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +831 -130
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +35 -22
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +146 -88
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +20 -5
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +14 -11
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +1 -1
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +17 -44
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +1 -13
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +158 -16
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +48 -21
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +61 -40
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +13 -1
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +84 -91
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -2
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +9 -5
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +1 -1
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +20 -1
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +59 -13
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +29 -8
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +13 -31
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +9 -9
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +229 -139
  143. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
  144. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
  145. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
  146. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +23 -22
  147. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +336 -99
  148. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +34 -8
  149. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +71 -36
  150. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +11 -11
  151. data/lib/sketchup-api-stubs/stubs/String.rb +1 -1
  152. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +21 -9
  153. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +80 -5
  154. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +14 -3
  155. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +20 -3
  156. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +9 -6
  157. data/lib/sketchup-api-stubs/stubs/UI.rb +77 -14
  158. data/lib/sketchup-api-stubs/stubs/_top_level.rb +7 -7
  159. metadata +10 -24
@@ -0,0 +1,113 @@
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This observer interface is implemented to react to {Sketchup::Environment} events.
5
+ #
6
+ # @abstract To implement this observer, create a Ruby class of this type,
7
+ # override the desired methods, and add an instance of the observer to the
8
+ # {Sketchup::Environment} object.
9
+ #
10
+ # @example
11
+ # class MyEnvironmentsObserver < Sketchup::EnvironmentsObserver
12
+ # def onEnvironmentChange(environments, environment)
13
+ # puts "onEnvironmentChange: #{environment}"
14
+ # end
15
+ # end
16
+ #
17
+ # Sketchup.active_model.environments.add_observer(MyEnvironmentsObserver.new)
18
+ #
19
+ # @see Sketchup::Environments#add_observer
20
+ #
21
+ # @version SketchUp 2025.0
22
+ class Sketchup::EnvironmentsObserver
23
+
24
+ # Instance Methods
25
+
26
+ # The {#onEnvironmentAdd} method is called whenever an environment is added to the
27
+ # {Sketchup::Environments}.
28
+ #
29
+ # @example
30
+ # class MyEnvironmentsObserver < Sketchup::EnvironmentsObserver
31
+ # def onEnvironmentAdd(environments, environment)
32
+ # puts "onEnvironmentAdd: #{environment}"
33
+ # end
34
+ # end
35
+ #
36
+ # Sketchup.active_model.environments.add_observer(MyEnvironmentsObserver.new)
37
+ #
38
+ # @param [Sketchup::Environments] environments
39
+ #
40
+ # @param [Sketchup::Environment] environment
41
+ #
42
+ # @return [nil]
43
+ #
44
+ # @version SketchUp 2025.0
45
+ def onEnvironmentAdd(environments, environment)
46
+ end
47
+
48
+ # The {#onEnvironmentChange} method is called whenever the environment properties
49
+ # are changed.
50
+ #
51
+ # @example
52
+ # class MyEnvironmentsObserver < Sketchup::EnvironmentsObserver
53
+ # def onEnvironmentChange(environments, environment)
54
+ # puts "onEnvironmentChange: #{environment}"
55
+ # end
56
+ # end
57
+ #
58
+ # Sketchup.active_model.environments.add_observer(MyEnvironmentsObserver.new)
59
+ #
60
+ # @param [Sketchup::Environments] environments
61
+ #
62
+ # @param [Sketchup::Environment] environment
63
+ #
64
+ # @return [nil]
65
+ #
66
+ # @version SketchUp 2025.0
67
+ def onEnvironmentChange(environments, environment)
68
+ end
69
+
70
+ # The {#onEnvironmentRemove} method is called whenever an environment is removed from the
71
+ # {Sketchup::Environments}.
72
+ #
73
+ # @example
74
+ # class MyEnvironmentsObserver < Sketchup::EnvironmentsObserver
75
+ # def onEnvironmentRemove(environments, environment)
76
+ # puts "onEnvironmentRemove: #{environment}"
77
+ # end
78
+ # end
79
+ #
80
+ # Sketchup.active_model.environments.add_observer(MyEnvironmentsObserver.new)
81
+ #
82
+ # @param [Sketchup::Environments] environments
83
+ #
84
+ # @param [Sketchup::Environment] environment
85
+ #
86
+ # @return [nil]
87
+ #
88
+ # @version SketchUp 2025.0
89
+ def onEnvironmentRemove(environments, environment)
90
+ end
91
+
92
+ # The {#onEnvironmentSetCurrent} method is called whenever the current environment is changed.
93
+ #
94
+ # @example
95
+ # class MyEnvironmentsObserver < Sketchup::EnvironmentsObserver
96
+ # def onEnvironmentSetCurrent(environments, environment)
97
+ # puts "onEnvironmentSetCurrent: #{environment}"
98
+ # end
99
+ # end
100
+ #
101
+ # Sketchup.active_model.environments.add_observer(MyEnvironmentsObserver.new)
102
+ #
103
+ # @param [Sketchup::Environments] environments
104
+ #
105
+ # @param [Sketchup::Environment] environment
106
+ #
107
+ # @return [nil]
108
+ #
109
+ # @version SketchUp 2025.0
110
+ def onEnvironmentSetCurrent(environments, environment)
111
+ end
112
+
113
+ end
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The ExtensionsManager class provides a way of accessing the
@@ -21,7 +21,7 @@ class Sketchup::ExtensionsManager
21
21
  #
22
22
  # @example
23
23
  # manager = Sketchup.extensions
24
- # extension = manager[1]
24
+ # extension = manager[0]
25
25
  # if (extension)
26
26
  # puts extension.name
27
27
  # else
@@ -34,7 +34,7 @@ class Sketchup::ExtensionsManager
34
34
  # # You can also get extensions by ID.
35
35
  # my_extension = manager['2475A758-6503-46D5-AC5E-16AEA0A3162A']
36
36
  #
37
- # @note Index starts at 1.
37
+ # @note Index starts at 0.
38
38
  #
39
39
  # @param [Integer, String] index_or_name
40
40
  # The index, name or ID of the SketchupExtension object.
@@ -83,9 +83,6 @@ class Sketchup::ExtensionsManager
83
83
  # @example
84
84
  # manager = Sketchup.extensions
85
85
  # keys = manager.keys
86
- # for key in keys
87
- # UI.messagebox('The next extension is named: ' + key)
88
- # end
89
86
  #
90
87
  # @return keys - Array of string keys
91
88
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Faces in SketchUp are flat, 2-sided polygons with 3 or more sides.
@@ -162,7 +162,7 @@ class Sketchup::Face < Sketchup::Drawingelement
162
162
  # puts "#{pt.to_s} is outside the face"
163
163
  # end
164
164
  #
165
- # # Check a point that should be outside inside the face.
165
+ # # Check a point that should be inside the face.
166
166
  # pt = Geom::Point3d.new(1, 1, 0)
167
167
  # result = face.classify_point(pt)
168
168
  # if result == Sketchup::Face::PointInside
@@ -227,6 +227,27 @@ class Sketchup::Face < Sketchup::Drawingelement
227
227
  def clear_texture_projection(frontside)
228
228
  end
229
229
 
230
+ # The {#coplanar_with?} method is used determine whether a face is coplanar with `other_face`.
231
+ #
232
+ # @example
233
+ # model = Sketchup.active_model
234
+ # entities = model.active_entities
235
+ #
236
+ # # Add the faces to the entities in the model
237
+ # face = entities.add_face([0, 0, 0], [4, 0, 0], [4, 5, 0])
238
+ # other_face = entities.add_face([5, 0, 0], [9, 0, 0], [9, 6, 0])
239
+ #
240
+ # face.coplanar_with?(other_face)
241
+ #
242
+ # @param [Sketchup::Face] other_face
243
+ # The face to compare with.
244
+ #
245
+ # @return [Boolean]
246
+ #
247
+ # @version SketchUp 2025.0
248
+ def coplanar_with?(other_face)
249
+ end
250
+
230
251
  # The edges method is used to get an array of edges that bound the face.
231
252
  #
232
253
  # @example
@@ -337,12 +358,12 @@ class Sketchup::Face < Sketchup::Drawingelement
337
358
  # The get_glued_instances method returns an Array any ComponentInstances
338
359
  # that are glued to the face.
339
360
  #
340
- # ComponentInstance objects that are currently glued to the face.
341
- #
342
361
  # @example
343
362
  # # Create a series of points that define a new face.
344
363
  # model = Sketchup.active_model
345
364
  # entities = model.active_entities
365
+ #
366
+ # # Create a rectangle face
346
367
  # pts = []
347
368
  # pts[0] = [0, 0, 0]
348
369
  # pts[1] = [9, 0, 0]
@@ -351,9 +372,27 @@ class Sketchup::Face < Sketchup::Drawingelement
351
372
  #
352
373
  # # Add the face to the entities in the model
353
374
  # face = entities.add_face(pts)
375
+ #
376
+ # # Create a component definition with 3D geometry
377
+ # component_definition = model.definitions.add("ComponentExample")
378
+ # component_entities = component_definition.entities
379
+ #
380
+ # comp_face = component_entities.add_face([0, 0, 0], [2, 0, 0], [2, 2, 0], [0, 2, 0])
381
+ # comp_face.pushpull(2)
382
+ #
383
+ # # Place the component instance on the face
384
+ # component_instance = entities.add_instance(component_definition, Geom::Transformation.new([3,
385
+ # 3, 0]))
386
+ #
387
+ # # Enable gluing behavior and glue component to face
388
+ # component_definition.behavior.is2d = true
389
+ # component_instance.glued_to = face
390
+ #
391
+ # # Get all component instances glued to the face
354
392
  # glued_array = face.get_glued_instances
355
393
  #
356
394
  # @return [Array<Sketchup::ComponentInstance, Sketchup::Group, Sketchup::Image>] An array of
395
+ # ComponentInstance objects that are currently glued to the face.
357
396
  #
358
397
  # @version SketchUp 7.0 M1
359
398
  def get_glued_instances
@@ -372,25 +411,37 @@ class Sketchup::Face < Sketchup::Drawingelement
372
411
  # pts[0] = [0, 0, 1]
373
412
  # pts[1] = [10, 0, 1]
374
413
  # pts[2] = [10, 10, 1]
414
+ # pts[3] = [0, 10, 1]
375
415
  # face = entities.add_face(pts)
376
416
  #
377
- # # Export an image to use as a texture
378
- # path = Sketchup.temp_dir
379
- # full_name = File.join(path, "temp_image.jpg")
380
- # model.active_view.write_image(full_name, 500, 500, false, 0.0)
417
+ # view = model.active_view
418
+ # screenshot_path = File.join(Dir.tmpdir,"screenshot.png")
419
+ # view.write_image(screenshot_path)
381
420
  #
382
- # # Create a material and assign the texture to it
383
421
  # material = materials.add("Test Material")
384
- # material.texture = full_name
422
+ # material.texture = screenshot_path
385
423
  #
386
424
  # # Assign the new material to our face we created
387
425
  # face.material = material
388
426
  #
389
427
  # # Set the projection of the applied material
390
- # face.set_texture_projection(face.normal, true)
428
+ # mapping = [
429
+ # Geom::Point3d.new(0, 0, 0), # Model coordinate
430
+ # Geom::Point3d.new(0, 0, 0), # UV coordinate
431
+ # Geom::Point3d.new(10, 0, 0), # Model coordinate
432
+ # Geom::Point3d.new(1, 0, 0), # UV coordinate
433
+ # Geom::Point3d.new(0, 10, 0), # Model coordinate
434
+ # Geom::Point3d.new(0, 1, 0) # UV coordinate
435
+ # ]
436
+ #
437
+ # direction = Geom::Vector3d.new(0, 0, 1) # Adjust direction vector
438
+ #
439
+ # on_front = true
440
+ # face.position_material(material, mapping, on_front, direction)
391
441
  #
392
442
  # # Get the projection of the applied material
393
443
  # vector = face.get_texture_projection(true)
444
+ # puts "Texture projection vector : #{vector.inspect}"
394
445
  #
395
446
  # @param [Boolean] frontside
396
447
  # +true+ for front side, +false+ for back side.
@@ -410,19 +461,32 @@ class Sketchup::Face < Sketchup::Drawingelement
410
461
  # face.
411
462
  #
412
463
  # @example
413
- # depth = 100
414
- # width = 100
415
464
  # model = Sketchup.active_model
416
- # entities = model.active_entities
417
- # pts = []
418
- # pts[0] = [0, 0, 0]
419
- # pts[1] = [width, 0, 0]
420
- # pts[2] = [width, depth, 0]
421
- # pts[3] = [0, depth, 0]
465
+ # entities= model.active_entities
422
466
  #
423
- # # Add the face to the entities in the model
424
- # face = entities.add_face(pts)
425
- # loops = face.loops
467
+ # # Define points for the outer loop
468
+ # outer_points = []
469
+ # outer_points << Geom::Point3d.new(0, 0, 0)
470
+ # outer_points << Geom::Point3d.new(100, 0, 0)
471
+ # outer_points << Geom::Point3d.new(100, 100, 0)
472
+ # outer_points << Geom::Point3d.new(0, 100, 0)
473
+ #
474
+ # # Create the outer face
475
+ # outer_face = entities.add_face(outer_points)
476
+ #
477
+ # # Define points for the inner loop (hole)
478
+ # inner_points = []
479
+ # inner_points << Geom::Point3d.new(25, 25, 0)
480
+ # inner_points << Geom::Point3d.new(75, 25, 0)
481
+ # inner_points << Geom::Point3d.new(75, 75, 0)
482
+ # inner_points << Geom::Point3d.new(25, 75, 0)
483
+ #
484
+ # # Create the inner face and erase it to create a second loop
485
+ # inner_face = entities.add_face(inner_points)
486
+ # inner_face.erase!
487
+ #
488
+ # # Get all loops of the outer face
489
+ # loops = outer_face.loops
426
490
  #
427
491
  # @return [Array<Sketchup::Loop>] an array of Loop objects if successful
428
492
  #
@@ -644,6 +708,7 @@ class Sketchup::Face < Sketchup::Drawingelement
644
708
  # @overload position_material(material, points, on_front)
645
709
  #
646
710
  # This variant positions a material on the face's plane without projection.
711
+ # @version SketchUp 6.0
647
712
  #
648
713
  # @param [Sketchup::Material] material
649
714
  #
@@ -658,7 +723,7 @@ class Sketchup::Face < Sketchup::Drawingelement
658
723
  #
659
724
  # @overload position_material(material, points, on_front, projection)
660
725
  #
661
- # @version SketchUp 2021.1
726
+ # @version SketchUp 6.0
662
727
  #
663
728
  # This variant positions a material on the face's plane with projection.
664
729
  #
@@ -691,8 +756,6 @@ class Sketchup::Face < Sketchup::Drawingelement
691
756
  # @see #get_texture_projection
692
757
  #
693
758
  # @see #clear_texture_projection
694
- #
695
- # @version SketchUp 6.0
696
759
  def position_material(*args)
697
760
  end
698
761
 
@@ -794,10 +857,16 @@ class Sketchup::Face < Sketchup::Drawingelement
794
857
  # @example
795
858
  # model = Sketchup.active_model
796
859
  # entities = model.active_entities
860
+ #
861
+ # # Filter the entities to get only the faces
797
862
  # faces = entities.grep(Sketchup::Face).select { |face|
863
+ # # Select faces that have manually positioned textures
864
+ # # Check both in front face (true) and the back face (false)
798
865
  # face.texture_positioned?(true) || face.texture_positioned?(false)
799
866
  # }
800
867
  #
868
+ # # 'faces' will contain all faces with manually positioned textures
869
+ #
801
870
  # @param [Boolean] front
802
871
  # +true+ Checks the front side of the face, +false+
803
872
  # the back side.
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to changes in camera
@@ -75,7 +75,7 @@ class Sketchup::FrameChangeObserver
75
75
  # if percent_done == 0.0
76
76
  # puts "Animating to scene '#{to_scene.name}':"
77
77
  # else
78
- # puts format("% 7.2f %",percent_done*100)
78
+ # puts format("% 7.2f %%",percent_done*100)
79
79
  # end
80
80
  # end
81
81
  # end
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # A Group class contains methods for manipulating groups of entities.
@@ -113,11 +113,6 @@ class Sketchup::Group < Sketchup::Drawingelement
113
113
  # face = entities2.add_face pts
114
114
  # group.description = "This is a Group with a 2d Face"
115
115
  # description = group.description
116
- # if (description)
117
- # UI.messagebox description
118
- # else
119
- # UI.messagebox "Failure"
120
- # end
121
116
  #
122
117
  # @param [String] description
123
118
  # A string description.
@@ -150,11 +145,6 @@ class Sketchup::Group < Sketchup::Drawingelement
150
145
  # # Add a face to within the group
151
146
  # face = entities2.add_face pts
152
147
  # entities = group.entities
153
- # if (entities)
154
- # UI.messagebox entities
155
- # else
156
- # UI.messagebox "Failure"
157
- # end
158
148
  #
159
149
  # @return [Sketchup::Entities] an Entities object if successful
160
150
  #
@@ -188,11 +178,6 @@ class Sketchup::Group < Sketchup::Drawingelement
188
178
  # group.entities.add_line([0,0,0],[100,100,100])
189
179
  #
190
180
  # array = group.explode
191
- # if array
192
- # UI.messagebox "Exploded the group"
193
- # else
194
- # UI.messagebox "Failure"
195
- # end
196
181
  #
197
182
  # @return [Array<Sketchup::Drawingelement>] An array of entity objects if successful, false if
198
183
  # unsuccessful.
@@ -346,7 +331,6 @@ class Sketchup::Group < Sketchup::Drawingelement
346
331
  # # Add the group to the entities in the model
347
332
  # group = entities.add_group
348
333
  # status = group.locked?
349
- # UI.messagebox status
350
334
  #
351
335
  # @return [Boolean]
352
336
  #
@@ -449,7 +433,7 @@ class Sketchup::Group < Sketchup::Drawingelement
449
433
  def name
450
434
  end
451
435
 
452
- # The name= method is used to set the description for the group.
436
+ # The {#name=} method is used to set the name for the group.
453
437
  #
454
438
  # @example
455
439
  # # Add a group to the model.
@@ -632,13 +616,8 @@ class Sketchup::Group < Sketchup::Drawingelement
632
616
  # # Add a face to within the group
633
617
  # face = entities2.add_face pts
634
618
  # UI.messagebox "Group before Move"
635
- # group = group.transform! t
636
- # if (group)
637
- # UI.messagebox "Group after move"
638
- # UI.messagebox group
639
- # else
640
- # UI.messagebox "Failure"
641
- # end
619
+ # group.transform! t
620
+ # puts "Group after move\r\n" + group.to_s
642
621
  #
643
622
  # @param [Geom::Transformation] transform
644
623
  # A Transformation object.
@@ -676,13 +655,19 @@ class Sketchup::Group < Sketchup::Drawingelement
676
655
  # new_transformation = Geom::Transformation.new([100,0,0])
677
656
  # group.transformation = new_transformation
678
657
  #
658
+ # @note As of SketchUp 2026, this will raise an error if the
659
+ # {Geom::Transformation} is not invertible. Prior to 2026 this would silently set the
660
+ # transformation possibly causing rendering or editing problems.
661
+ #
679
662
  # @param [Geom::Transformation] transformation
680
663
  #
664
+ # @raise ArgumentError if the {Geom::Transformation} is not invertible (as of Sketchup 2026)
665
+ #
681
666
  # @version SketchUp 6.0
682
667
  def transformation=(transformation)
683
668
  end
684
669
 
685
- # The trim method is used to compute the (non-destructive) boolean difference
670
+ # The {#trim} method is used to compute the (non-destructive) boolean difference
686
671
  # of the two groups representing manifold solid volumes (this - arg). If
687
672
  # the specified objects (this and arg) do not represent manifold volumes, this
688
673
  # method fails.
@@ -693,6 +678,11 @@ class Sketchup::Group < Sketchup::Drawingelement
693
678
  # group2 = entities[1]
694
679
  # result = group1.trim(group2)
695
680
  #
681
+ # @note Trimming object group2 using group1 results in a new trimmed version of group2.
682
+ # If the trim is successful the original group2 is erased and a newly trimmed
683
+ # version is created. This new version, derived from the trimming operation,
684
+ # will possess a new GUID and will be returned.
685
+ #
696
686
  # @note This method is not available in SketchUp Make.
697
687
  #
698
688
  # @param [Sketchup::Group, Sketchup::ComponentInstance] group
@@ -1,7 +1,7 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # Http::Request objects allows you to send HTTP request to HTTP servers.
4
+ # {Sketchup::Http::Request} objects allows you to send HTTP request to HTTP servers.
5
5
  #
6
6
  # @version SketchUp 2017
7
7
  class Sketchup::Http::Request
@@ -52,6 +52,8 @@ class Sketchup::Http::Request
52
52
  #
53
53
  # @request.cancel
54
54
  #
55
+ # @note Do not {#cancel} the request in the response callback.
56
+ #
55
57
  # @return [true]
56
58
  #
57
59
  # @version SketchUp 2017
@@ -93,17 +95,17 @@ class Sketchup::Http::Request
93
95
  def headers=(headers)
94
96
  end
95
97
 
96
- # The default port is 80, to use a different port define it in the URL when
98
+ # The default port is +80+, to use a different port define it in the URL when
97
99
  # creating a new {Sketchup::Http::Request}.
98
100
  #
99
- # The +method+ parameter accepts any custom HTTP method or one of the
101
+ # The {#method} parameter accepts any custom HTTP method or one of the
100
102
  # following:
101
- # * +Sketchup::Http::GET+
102
- # * +Sketchup::Http::POST+
103
- # * +Sketchup::Http::PUT+
104
- # * +Sketchup::Http::DELETE+
105
- # * +Sketchup::Http::HEAD+
106
- # * +Sketchup::Http::OPTIONS+
103
+ # - {Sketchup::Http::GET}
104
+ # - {Sketchup::Http::POST}
105
+ # - {Sketchup::Http::PUT}
106
+ # - {Sketchup::Http::DELETE}
107
+ # - {Sketchup::Http::HEAD}
108
+ # - {Sketchup::Http::OPTIONS}
107
109
  #
108
110
  # @example
109
111
  # @request = Sketchup::Http::Request.new("http://localhost:8080", Sketchup::Http::GET)
@@ -116,6 +118,8 @@ class Sketchup::Http::Request
116
118
  # making the download silently fail. This is especially noticeable for larger downloads that
117
119
  # takes longer time.
118
120
  #
121
+ # @note Do not {#cancel} the request in the response callback.
122
+ #
119
123
  # @param [String] url
120
124
  #
121
125
  # @param [String] method
@@ -142,13 +146,14 @@ class Sketchup::Http::Request
142
146
  end
143
147
 
144
148
  # Sets the HTTP method that is going to be used when sending the request.
149
+ #
145
150
  # The value can be any custom HTTP method or one of the following:
146
- # * +Sketchup::Http::GET+
147
- # * +Sketchup::Http::POST+
148
- # * +Sketchup::Http::PUT+
149
- # * +Sketchup::Http::DELETE+
150
- # * +Sketchup::Http::HEAD+
151
- # * +Sketchup::Http::OPTIONS+
151
+ # - {Sketchup::Http::GET}
152
+ # - {Sketchup::Http::POST}
153
+ # - {Sketchup::Http::PUT}
154
+ # - {Sketchup::Http::DELETE}
155
+ # - {Sketchup::Http::HEAD}
156
+ # - {Sketchup::Http::OPTIONS}
152
157
  #
153
158
  # @example
154
159
  # @request = Sketchup::Http::Request.new("http://localhost:8080")
@@ -184,7 +189,7 @@ class Sketchup::Http::Request
184
189
  #
185
190
  # @request.start
186
191
  #
187
- # @note +total+ is -1 if the server doesn't specify a file size in the response header.
192
+ # @note +total+ is +-1+ if the server doesn't specify a file size in the response header.
188
193
  #
189
194
  # @return [Boolean]
190
195
  #
@@ -236,6 +241,8 @@ class Sketchup::Http::Request
236
241
  # puts "body: #{response.body}"
237
242
  # end
238
243
  #
244
+ # @note Do not {#cancel} the request in the response callback.
245
+ #
239
246
  # @return [Boolean]
240
247
  #
241
248
  # @version SketchUp 2017
@@ -1,18 +1,20 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # Http::Response objects allows you to get the response information from the
5
- # server, you can only receive the Http::Response if you have attached a
6
- # callback block when calling start from the Http::Request object.
4
+ # {Sketchup::Http::Response} objects allows you to get the response information from the
5
+ # server, you can only receive the {Sketchup::Http::Response} if you have attached a
6
+ # callback block when calling start from the {Sketchup::Http::Request} object.
7
+ #
8
+ # @note Do not {Sketchup::Http::Request#cancel} the request in the response callback.
7
9
  #
8
10
  # @version SketchUp 2017
9
11
  class Sketchup::Http::Response
10
12
 
11
13
  # Instance Methods
12
14
 
13
- # Gets the http body that was received from the server as a string encoded
14
- # using the charset provided in the Content-Type of the server response, if
15
- # no charset is specified, ASCII-8BIT will be used.
15
+ # Gets the HTTP body that was received from the server as a string encoded
16
+ # using the charset provided in the +"Content-Type"+ header of the server response,
17
+ # if no charset is specified, +Encoding::ASCII_8BIT+ will be used.
16
18
  #
17
19
  # @example
18
20
  # @request = Sketchup::Http::Request.new("http://localhost:8080")
@@ -27,7 +29,7 @@ class Sketchup::Http::Response
27
29
  def body
28
30
  end
29
31
 
30
- # Returns the http headers that were sent by the server.
32
+ # Returns the HTTP headers that were sent by the server.
31
33
  #
32
34
  # @example
33
35
  # @request = Sketchup::Http::Request.new("http://localhost:8080")
@@ -50,7 +52,7 @@ class Sketchup::Http::Response
50
52
  # @request = Sketchup::Http::Request.new("http://localhost:8080")
51
53
  #
52
54
  # @request.start do |request, response|
53
- # puts "http status code: #{response.status_code}"
55
+ # puts "HTTP status code: #{response.status_code}"
54
56
  # end
55
57
  #
56
58
  # @return [Integer]
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2024 Trimble Inc.
1
+ # Copyright:: Copyright 2026 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The {Sketchup::Http} module provides interfaces to create asynchronous HTTP