sketchup-api-stubs 0.7.8 → 0.7.10

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +3 -0
  3. data/lib/sketchup-api-stubs/stubs/Array.rb +1 -1
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +1 -1
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +1 -1
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +1 -1
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +1 -1
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +4 -18
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +17 -19
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +1 -1
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +1 -1
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -1
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +3 -3
  16. data/lib/sketchup-api-stubs/stubs/Geom.rb +1 -1
  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 +50 -1
  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/Document.rb +56 -3
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +4 -1
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +1 -1
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +1 -1
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +73 -1
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +7 -7
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
  42. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -0
  43. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +24 -2
  44. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
  45. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
  49. data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
  50. data/lib/sketchup-api-stubs/stubs/Length.rb +1 -1
  51. data/lib/sketchup-api-stubs/stubs/Numeric.rb +1 -1
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +1 -1
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +18 -1
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +3 -5
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +4 -9
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +1 -1
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +1 -1
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +4 -5
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +44 -4
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +2 -2
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +1 -1
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +25 -2
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +1 -1
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +13 -3
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +62 -167
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +246 -209
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +3 -14
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +10 -36
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +4 -5
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1 -1
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -3
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +1 -1
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +16 -26
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +2 -2
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +1 -1
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +1 -1
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +1 -1
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +29 -30
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +2 -2
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +1 -1
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +1 -1
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -1
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -1
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +2 -2
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +9 -7
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1 -1
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +2 -3
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +28 -23
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +1 -1
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +4 -5
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +5 -18
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +1 -1
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +15 -17
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +21 -18
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +18 -9
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +4 -5
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +15 -20
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +1 -1
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +1 -1
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +1 -1
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +1 -1
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +17 -20
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +30 -18
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +1 -1
  143. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +48 -14
  144. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +2 -2
  145. data/lib/sketchup-api-stubs/stubs/String.rb +1 -1
  146. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +29 -31
  147. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +18 -9
  148. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +3 -3
  149. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +5 -4
  150. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +16 -18
  151. data/lib/sketchup-api-stubs/stubs/UI.rb +71 -26
  152. data/lib/sketchup-api-stubs/stubs/_top_level.rb +1 -9
  153. metadata +10 -7
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # A DefinitionList object holds a list of all of the ComponentDefinition
@@ -149,7 +149,7 @@ class Sketchup::DefinitionList < Sketchup::Entity
149
149
  #
150
150
  # @version SketchUp 6.0
151
151
  #
152
- # @yield [Sketchup::ComponentDefinition] definition
152
+ # @yieldparam [Sketchup::ComponentDefinition] definition
153
153
  def each
154
154
  end
155
155
 
@@ -203,6 +203,11 @@ class Sketchup::DefinitionList < Sketchup::Entity
203
203
  # if you tried to open a newer model instead of raising the expected
204
204
  # +RuntimeError+.
205
205
  #
206
+ # @bug Prior to SketchUp 2023.0 this method silently failed to load a component if the model
207
+ # already contained a different component associated with the same path.
208
+ # Instead the existing component was returned.
209
+ # Making arbitrary changes to the existing component would allow the new one to be loaded.
210
+ #
206
211
  # @example
207
212
  # path = Sketchup.find_support_file("Bed.skp",
208
213
  # "Components/Components Sampler/")
@@ -210,6 +215,19 @@ class Sketchup::DefinitionList < Sketchup::Entity
210
215
  # definitions = model.definitions
211
216
  # definition = definitions.load(path)
212
217
  #
218
+ # @example Workaround for loading from the same path twice
219
+ # path = "some/location/on/your/computer.skp"
220
+ # definition1 = Sketchup.active_model.definitions.load(path)
221
+ #
222
+ # # Now open the external file and make some changes to it.
223
+ #
224
+ # # HACK: Prior to version 2023.0 SketchUp wouldn't load components from the same path twice.
225
+ # # Instead it silently returned the existing, outdated component.
226
+ # # Making an arbitrary change to the existing component allows a new one to be loaded.
227
+ # definition1.entities.add_cpoint(ORIGIN) if Sketchup.version.to_i < 23
228
+ #
229
+ # definition2 = Sketchup.active_model.definitions.load(path)
230
+ #
213
231
  # @overload load(path)
214
232
  #
215
233
  # @param [String] path
@@ -362,6 +380,9 @@ class Sketchup::DefinitionList < Sketchup::Entity
362
380
  # definition list with the given component definition. This will remove all
363
381
  # instances of the definition.
364
382
  #
383
+ # @bug Prior to SketchUp 2023.0 this could crash SketchUp if you erased an
384
+ # definition used by the active edit path.
385
+ #
365
386
  # @example
366
387
  # model = Sketchup.active_model
367
388
  # definitions = model.definitions
@@ -370,6 +391,8 @@ class Sketchup::DefinitionList < Sketchup::Entity
370
391
  #
371
392
  # @param [Sketchup::ComponentDefinition] definition
372
393
  #
394
+ # @raise [ArgumentError] if the given definition is used by {Sketchup::Model#active_path}.
395
+ #
373
396
  # @return [Boolean]
374
397
  #
375
398
  # @version SketchUp 2018
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to component definition
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to events on a definitions
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Dimension class provides base functionality for classes DimensionLinear
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The DimensionLinear class represents linear dimensions.
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to changes in dimension text.
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The DimensionRadial class represents radius and diameter dimensions on
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Drawingelement is a base class for an item in the model that can be
@@ -97,10 +97,13 @@ class Sketchup::Drawingelement < Sketchup::Entity
97
97
  def casts_shadows?
98
98
  end
99
99
 
100
- # The erase! method is used to erase an element from the model.
100
+ # The {#erase!} method is used to erase an element from the model.
101
101
  #
102
102
  # Erasing an Edge also erases all of the Face objects that use the Edge.
103
103
  #
104
+ # @bug Prior to SketchUp 2023.0 this could crash SketchUp if you erased an
105
+ # instance used by the active edit path.
106
+ #
104
107
  # @example
105
108
  # depth = 100
106
109
  # width = 100
@@ -115,7 +118,14 @@ class Sketchup::Drawingelement < Sketchup::Entity
115
118
  # face = entities.add_face pts
116
119
  # status = face.erase!
117
120
  #
118
- # @return [Boolean] true if successful, false if unsuccessful
121
+ # @note When erasing multiple elements, it's faster to
122
+ # use {Sketchup::Entities#erase_entities} and erase in bulk than to iterate
123
+ # individual drawing elements calling {Sketchup::Drawingelement#erase!}.
124
+ #
125
+ # @raise [ArgumentError] if the drawing element is an instance used
126
+ # by {Sketchup::Model#active_path}.
127
+ #
128
+ # @return [nil]
119
129
  #
120
130
  # @version SketchUp 6.0
121
131
  def erase!
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Edge class contains methods modifying and extracting information for
@@ -13,27 +13,17 @@ class Sketchup::Edge < Sketchup::Drawingelement
13
13
  # including the edge itself.
14
14
  #
15
15
  # @example
16
- # depth = 100
17
- # width = 100
18
16
  # model = Sketchup.active_model
19
17
  # entities = model.active_entities
20
- # pts = []
21
- # pts[0] = [0, 0, 0]
22
- # pts[1] = [width, 0, 0]
23
- # pts[2] = [width, depth, 0]
24
- # pts[3] = [0, depth, 0]
25
- # # Add the face to the entities in the model
26
- # face = entities.add_face pts
27
- # # I just happen to know that the second and third entities in the
28
- # # entities objects are edges.
29
- # entity1 = entities[1]
30
- # entity2 = entities[2]
31
- # edges = entity1.all_connected
32
- # if (edges)
33
- # UI.messagebox edges.to_s
34
- # else
35
- # UI.messagebox "Failure"
36
- # end
18
+ # points = [
19
+ # Geom::Point3d.new(0, 0, 0),
20
+ # Geom::Point3d.new(100, 0, 0),
21
+ # Geom::Point3d.new(100, 100, 0),
22
+ # Geom::Point3d.new(200, 100, 0)
23
+ # ]
24
+ # # Add the edges to the model
25
+ # edges = entities.add_edges(points)
26
+ # connected_entities = edges.first.all_connected
37
27
  #
38
28
  # @return [Array<Sketchup::Entity>] the edge and entities connected to that edge
39
29
  #
@@ -45,28 +35,19 @@ class Sketchup::Edge < Sketchup::Drawingelement
45
35
  # edges.
46
36
  #
47
37
  # @example
48
- # depth = 100
49
- # width = 100
50
38
  # model = Sketchup.active_model
51
39
  # entities = model.active_entities
52
- # pts = []
53
- # pts[0] = [0,0,0]
54
- # pts[1] = [width,0,0]
55
- # pts[2] = [width,depth,0]
56
- # pts[3] = [0,depth,0]
40
+ # points = [
41
+ # Geom::Point3d.new(0, 0, 0),
42
+ # Geom::Point3d.new(100, 0, 0),
43
+ # Geom::Point3d.new(100, 100, 0),
44
+ # Geom::Point3d.new(0, 100, 0)
45
+ # ]
57
46
  # # Add the face to the entities in the model
58
- # face = entities.add_face pts
59
- # # I know that the second and third entity objects are edges
60
- # entity1 = entities[1]
61
- # entity2 = entities[2]
62
- # UI.messagebox entity1
63
- # UI.messagebox entity2
64
- # face = entity1.common_face entity2
65
- # if (face)
66
- # UI.messagebox face
67
- # else
68
- # UI.messagebox "Failure: No Common Face"
69
- # end
47
+ # face = entities.add_face(points)
48
+ # edge1 = face.edges[0]
49
+ # edge2 = face.edges[1]
50
+ # face = edge1.common_face(edge2)
70
51
  #
71
52
  # @param [Sketchup::Edge] edge2
72
53
  # The face whose edge you are checking for commonality.
@@ -83,14 +64,9 @@ class Sketchup::Edge < Sketchup::Drawingelement
83
64
  # curve, then this method will return an ArcCurve object.
84
65
  #
85
66
  # @example
86
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
87
- # curve = edge.curve
88
- # if (curve)
89
- # # If it is a curve, display a pointer to the curve
90
- # UI.messagebox curve
91
- # else
92
- # UI.messagebox "Failure: Not a Curve"
93
- # end
67
+ # entities = Sketchup.active_model.entities
68
+ # edges = entities.add_curve([0, 0, 0], [100, 100, 0], [100, 200, 0])
69
+ # curve = edges[0].curve
94
70
  #
95
71
  # @return [Sketchup::Curve, nil] returns a Curve object if it is a
96
72
  # curve, nil if it is not a curve
@@ -102,21 +78,8 @@ class Sketchup::Edge < Sketchup::Drawingelement
102
78
  # The end method is used to retrieve the Vertex object at the end of the edge.
103
79
  #
104
80
  # @example
105
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
81
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
106
82
  # vertex = edge.end
107
- # if (vertex)
108
- # # display a pointer to the Vertex
109
- # UI.messagebox vertex
110
- # else
111
- # UI.messagebox "Failure"
112
- # end
113
- # point = vertex.position
114
- # # Let's get the Point3d of the vertex
115
- # if (point)
116
- # UI.messagebox point
117
- # else
118
- # UI.messagebox "Failure"
119
- # end
120
83
  #
121
84
  # @return [Sketchup::Vertex] a Vertex object if successful
122
85
  #
@@ -124,30 +87,15 @@ class Sketchup::Edge < Sketchup::Drawingelement
124
87
  def end
125
88
  end
126
89
 
127
- # The explode_curve method is used to explode an edge as though it were an
128
- # ArcCurve.
90
+ # The explode_curve method is used to explode the curve that the given edge
91
+ # is a part of.
129
92
  #
130
93
  # @example
131
- # depth = 100
132
- # width = 100
133
94
  # model = Sketchup.active_model
134
95
  # entities = model.active_entities
135
- # pts = []
136
- # pts[0] = [0, 0, 0]
137
- # pts[1] = [width, 0, 0]
138
- # pts[2] = [width, depth, 0]
139
- # pts[3] = [0, depth, 0]
140
- # # Add the face to the entities in the model
141
- # face = entities.add_face pts
142
- # # I just happen to know that the second entity in the
143
- # # entities objects is an edge.
144
- # entity1 = entities[1]
145
- # curve = entity1.explode_curve
146
- # if (curve)
147
- # UI.messagebox curve
148
- # else
149
- # UI.messagebox "Failure"
150
- # end
96
+ # edges = entities.add_curve([0, 0, 0], [100, 0, 0], [100, 100, 0])
97
+ # edge = edges[0]
98
+ # exploded_edge = edge.explode_curve
151
99
  #
152
100
  # @return [Sketchup::Edge] an exploded edge object if successful
153
101
  #
@@ -174,27 +122,17 @@ class Sketchup::Edge < Sketchup::Drawingelement
174
122
  # be filled in.
175
123
  #
176
124
  # @example
177
- # depth = 100
178
- # width = 100
179
125
  # model = Sketchup.active_model
180
126
  # entities = model.active_entities
181
- # pts = []
182
- # pts[0] = [0, 0, 0]
183
- # pts[1] = [width, 0, 0]
184
- # pts[2] = [width, depth, 0]
185
- # pts[3] = [0, depth, 0]
186
- # # Add the face to the entities in the model
187
- # face = entities.add_face pts
188
- # # I just happen to know that the second entity in the
189
- # # entities objects is an edge.
190
- # entity1 = entities[1]
191
- # # Getting zero.
192
- # number = entity1.find_faces
193
- # if (number)
194
- # UI.messagebox "I created " + number.to_s + " faces."
195
- # else
196
- # UI.messagebox "Failure"
197
- # end
127
+ # points = [
128
+ # Geom::Point3d.new(0, 0, 0),
129
+ # Geom::Point3d.new(100, 0, 0),
130
+ # Geom::Point3d.new(100, 100, 0),
131
+ # Geom::Point3d.new(0, 100, 0),
132
+ # Geom::Point3d.new(0, 0, 0)
133
+ # ]
134
+ # edges = entities.add_curve(points)
135
+ # number_of_faces_found = edges[0].find_faces
198
136
  #
199
137
  # @return [Integer] the number of faces found
200
138
  #
@@ -214,7 +152,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
214
152
  #
215
153
  # @example
216
154
  # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
217
- # puts "#{edge.length} (#{edge.length.inspect})"
155
+ # edge.length
218
156
  #
219
157
  # @overload length
220
158
  #
@@ -237,14 +175,8 @@ class Sketchup::Edge < Sketchup::Drawingelement
237
175
  # class for more information on lines.
238
176
  #
239
177
  # @example
240
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
241
- # # Returns a 3D ray
178
+ # edge = Sketchup.active_model.entities.add_line([0,0,0], [100, 100, 0])
242
179
  # line = edge.line
243
- # if (line)
244
- # UI.messagebox line
245
- # else
246
- # UI.messagebox "Failure"
247
- # end
248
180
  #
249
181
  # @return [Array(Geom::Point3d, Geom::Vector3d)] an array with a Point3d object
250
182
  # and a Vector3d object.
@@ -257,23 +189,11 @@ class Sketchup::Edge < Sketchup::Drawingelement
257
189
  # of the edge.
258
190
  #
259
191
  # @example
260
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
192
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0],[100, 100, 0])
261
193
  # # Get the end vertex of an edge
262
194
  # vertex = edge.end
263
195
  # # Should find the starting vertex
264
- # othervertex = edge.other_vertex vertex
265
- # if (othervertex)
266
- # UI.messagebox othervertex
267
- # else
268
- # UI.messagebox "Failure"
269
- # end
270
- # # The Point3d for the vertex
271
- # point = othervertex.position
272
- # if (point)
273
- # UI.messagebox point
274
- # else
275
- # UI.messagebox "Failure"
276
- # end
196
+ # other_vertex = edge.other_vertex(vertex)
277
197
  #
278
198
  # @param [Sketchup::Vertex] vertex1
279
199
  # One of the Vertex objects associated with the edge.
@@ -295,12 +215,10 @@ class Sketchup::Edge < Sketchup::Drawingelement
295
215
  # points[1] = [9, 0, 0]
296
216
  # points[2] = [9, 9, 0]
297
217
  # points[3] = [0, 9, 0]
298
- # # Add the face to the entities in the model
218
+ # # Add the face to the entities in the model.
299
219
  # face = entities.add_face(points)
300
220
  # edge = face.edges[0]
301
- # if edge.reversed_in?(face)
302
- # face.reverse!
303
- # end
221
+ # edge.reversed_in?(face)
304
222
  #
305
223
  # @param [Sketchup::Face] face
306
224
  # The face that is bounded by the edge.
@@ -322,8 +240,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
322
240
  # smooth transition. The edge will still be visible.
323
241
  #
324
242
  # @example
325
- # edge = Sketchup.active_model.entities.add_line([0,0,0], [100,100,0])
326
- # # Soft and Smooth are normally set in pairs.
243
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
327
244
  # edge.soft = true
328
245
  # edge.smooth = true
329
246
  #
@@ -348,10 +265,9 @@ class Sketchup::Edge < Sketchup::Drawingelement
348
265
  # smooth transition. The edge will still be visible.
349
266
  #
350
267
  # @example
351
- # edge = Sketchup.active_model.entities.add_line([0,0,0], [100,100,0])
352
- # # Soft and Smooth are normally set in pairs.
353
- # edge.smooth = !edge.smooth?
354
- # edge.soft = edge.smooth?
268
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
269
+ # edge.smooth = true
270
+ # edge.smooth?
355
271
  #
356
272
  # @return [Boolean]
357
273
  #
@@ -369,13 +285,12 @@ class Sketchup::Edge < Sketchup::Drawingelement
369
285
  # hidden.
370
286
  #
371
287
  # @example
372
- # edge = Sketchup.active_model.entities.add_line([0,0,0], [100,100,0])
373
- # # Soft and Smooth are normally set in pairs.
374
- # edge.soft = true
288
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
375
289
  # edge.smooth = true
290
+ # edge.soft = true
376
291
  #
377
292
  # @note The soft and smooth properties are normally set in pairs. You can
378
- # observer this when the Soften/Smooth Edges feature or holding down Ctrl
293
+ # observe this when the Soften/Smooth Edges feature or holding down Ctrl
379
294
  # when using the Eraser Tool.
380
295
  #
381
296
  # @param [Boolean] value
@@ -388,7 +303,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
388
303
  def soft=(value)
389
304
  end
390
305
 
391
- # The {#soft?} method is used to retrieve the current smooth setting for an
306
+ # The {#soft?} method is used to retrieve the current soft setting for an
392
307
  # edge.
393
308
  #
394
309
  # A soft edge will cause the connected faces to be treated as a surface. This
@@ -397,10 +312,9 @@ class Sketchup::Edge < Sketchup::Drawingelement
397
312
  # hidden.
398
313
  #
399
314
  # @example
400
- # edge = Sketchup.active_model.entities.add_line([0,0,0], [100,100,0])
401
- # # Soft and Smooth are normally set in pairs.
402
- # edge.soft = !edge.soft?
403
- # edge.smooth = edge.soft?
315
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
316
+ # edge.soft = true
317
+ # edge.soft?
404
318
  #
405
319
  # @return [Boolean]
406
320
  #
@@ -421,9 +335,8 @@ class Sketchup::Edge < Sketchup::Drawingelement
421
335
  # Returns the new Edge that was created as a result of splitting this one.
422
336
  #
423
337
  # @example
424
- # # Split a line in half.
425
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
426
- # new_edge = edge.split 0.5
338
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
339
+ # new_edge = edge.split(0.5)
427
340
  #
428
341
  # @param [Geom::Point3d] position
429
342
  # A Point3d object whose location is along the edge, or
@@ -437,25 +350,12 @@ class Sketchup::Edge < Sketchup::Drawingelement
437
350
  def split(position)
438
351
  end
439
352
 
440
- # The end method is used to retrieve the Vertex object at the start of the
353
+ # The start method is used to retrieve the Vertex object at the start of the
441
354
  # edge.
442
355
  #
443
356
  # @example
444
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
357
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
445
358
  # vertex = edge.start
446
- # if (vertex)
447
- # # display a pointer to the Vertex
448
- # UI.messagebox vertex
449
- # else
450
- # UI.messagebox "Failure"
451
- # end
452
- # point = vertex.position
453
- # # Let's get the Point3d of the vertex
454
- # if (point)
455
- # UI.messagebox point
456
- # else
457
- # UI.messagebox "Failure"
458
- # end
459
359
  #
460
360
  # @return [Sketchup::Vertex] a Vertex object if successful
461
361
  #
@@ -467,16 +367,11 @@ class Sketchup::Edge < Sketchup::Drawingelement
467
367
  # Vertex.
468
368
  #
469
369
  # @example
470
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
370
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0],[100, 100, 0])
471
371
  # # Returns a vertex
472
372
  # vertex = edge.start
473
373
  # # Check to see if the edge is used by the Vertex.
474
- # status = edge.used_by? vertex
475
- # if (status)
476
- # UI.messagebox status
477
- # else
478
- # UI.messagebox "Failure"
479
- # end
374
+ # edge.used_by?(vertex)
480
375
  #
481
376
  # @param [Sketchup::Vertex, Sketchup::Face] element
482
377
  # A Vertex or Face object.
@@ -490,7 +385,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
490
385
  # The vertices method is used to retrieve the vertices on the edge.
491
386
  #
492
387
  # @example
493
- # edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
388
+ # edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
494
389
  # vertices = edge.vertices
495
390
  #
496
391
  # @return [Array<Sketchup::Vertex>] an array of Vertex objects
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2022 Trimble Inc.
1
+ # Copyright:: Copyright 2024 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The EdgeUse class defines how an Edge is used in the definition of a Face.