Skip to content

Commit bf26101

Browse files
committed
Merge branch 'master' into staging
2 parents 88de2db + bdf99ef commit bf26101

85 files changed

Lines changed: 2094 additions & 964 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/colors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
<td style="background-color:rgb(34,139,34)">&nbsp;</td></tr>
9393
<tr><td>Fuchsia</td><td>255,0,255</td>
9494
<td style="background-color:rgb(255,0,255)">&nbsp;</td></tr>
95-
<tr><td>Gainsboro</td><td>220,220,220,</td>
96-
<td style="background-color:rgb(220,220,220,)">&nbsp;</td></tr>
95+
<tr><td>Gainsboro</td><td>220,220,220</td>
96+
<td style="background-color:rgb(220,220,220)">&nbsp;</td></tr>
9797
<tr><td>GhostWhite</td><td>248,248,255</td>
9898
<td style="background-color:rgb(248,248,255)">&nbsp;</td></tr>
9999
<tr><td>Gold</td><td>255,215,0</td>

lib/sketchup-api-stubs/sketchup.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
require 'sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb'
9595
require 'sketchup-api-stubs/stubs/Sketchup/InstancePath.rb'
9696
require 'sketchup-api-stubs/stubs/Sketchup/Layer.rb'
97+
require 'sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb'
9798
require 'sketchup-api-stubs/stubs/Sketchup/Layers.rb'
9899
require 'sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb'
99100
require 'sketchup-api-stubs/stubs/Sketchup/Licensing.rb'
@@ -123,6 +124,7 @@
123124
require 'sketchup-api-stubs/stubs/Sketchup/Set.rb'
124125
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
125126
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
127+
require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
126128
require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
127129
require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
128130
require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'

lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License:: The MIT License (MIT)
33

44
# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
5-
# global axes, that surround entities within your model. There is a default
5+
# axes, that surround entities within your model. There is a default
66
# bounding box for any new model that will surround all entities,
77
# including all groups and components. Additionally, there are
88
# bounding boxes for Drawingelement objects, including components and groups.
@@ -154,15 +154,17 @@ def contains?(point_or_bb)
154154
def corner(corner_index)
155155
end
156156

157-
# The {#depth} method is used to retrieve the depth of the bounding box.
157+
# The {#depth} method is used to retrieve the Z extents of the bounding box.
158158
#
159159
# @example
160160
# boundingbox = Geom::BoundingBox.new
161161
# boundingbox.add([100, 200, -400], [200, 400, 100])
162162
# # This will return a Length of 500.0.
163-
# length = boundingbox.depth
163+
# height = boundingbox.depth
164164
#
165-
# @return [Length] the depth of the bounding box
165+
# @note In SketchUp's coordinate system, this corresponds to the height.
166+
#
167+
# @return [Length]
166168
#
167169
# @version SketchUp 6.0
168170
def depth
@@ -200,15 +202,17 @@ def diagonal
200202
def empty?
201203
end
202204

203-
# The {#height} method is used to retrieve the height of the bounding box.
205+
# The {#height} method is used to retrieve the Y extent of the bounding box.
204206
#
205207
# @example
206208
# boundingbox = Geom::BoundingBox.new
207209
# boundingbox.add([100, 200, -400], [200, 400, 100])
208210
# # This will return a Length of 200.0.
209-
# length = boundingbox.height
211+
# depth = boundingbox.height
212+
#
213+
# @note In SketchUp's coordinate system, this corersponds to the depth.
210214
#
211-
# @return [Length] the height of the bounding box
215+
# @return [Length]
212216
#
213217
# @version SketchUp 6.0
214218
def height
@@ -301,15 +305,15 @@ def min
301305
def valid?
302306
end
303307

304-
# The {#width} method is used to retrieve the width of the bounding box.
308+
# The {#width} method is used to retrieve the X extent of the bounding box.
305309
#
306310
# @example
307311
# boundingbox = Geom::BoundingBox.new
308312
# boundingbox.add([100, 200, -400], [200, 400, 100])
309313
# # This will return a Length of 100.0.
310-
# length = boundingbox.width
314+
# width = boundingbox.width
311315
#
312-
# @return [Length] the width of the bounding box
316+
# @return [Length]
313317
#
314318
# @version SketchUp 6.0
315319
def width

lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def ==(other)
2727
# The {#height} method returns the height of the {Geom::Bounds2d}.
2828
#
2929
# @example
30-
# bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
30+
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
3131
# height = bounds.height
3232
#
3333
# @return [Geom::Point2d]
@@ -80,7 +80,7 @@ def initialize(*args)
8080
# corner of the {Geom::Bounds2d}.
8181
#
8282
# @example
83-
# bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
83+
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
8484
# l_r = bounds.lower_right
8585
#
8686
# @return [Geom::Point2d]
@@ -148,7 +148,7 @@ def to_a
148148
# of the {Geom::Bounds2d}.
149149
#
150150
# @example
151-
# bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
151+
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
152152
# u_l = bounds.upper_left
153153
#
154154
# @return [Geom::Point2d]
@@ -160,7 +160,7 @@ def upper_left
160160
# The {#width} method returns the width of the {Geom::Bounds2d}.
161161
#
162162
# @example
163-
# bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
163+
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
164164
# width = bounds.width
165165
#
166166
# @return [Geom::Point2d]

lib/sketchup-api-stubs/stubs/Geom/LatLong.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ class Geom::LatLong
2626
#
2727
# @overload initialize(latlong)
2828
#
29-
# @param latlong [Geom::LatLong]
29+
# @param [Geom::LatLong] latlong
3030
# @return [Geom::LatLong]
3131
#
3232
# @overload initialize(latlong_array)
3333
#
34-
# @param latlong_array [Array(Numeric, Numeric)]
34+
# @param [Array(Numeric, Numeric)] latlong_array
3535
# @return [Geom::LatLong]
3636
#
3737
# @overload initialize(lat, long)
3838
#
39-
# @param lat [Numeric]
40-
# @param long [Numeric]
39+
# @param [Numeric] lat
40+
# @param [Numeric] long
4141
# @return [Geom::LatLong]
4242
#
4343
# @version SketchUp 6.0

lib/sketchup-api-stubs/stubs/Geom/Point3d.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ class Geom::Point3d
3131

3232
# Class Methods
3333

34-
# The linear_combination method is used to create a new point as a linear
35-
# combination of two points. This method is generally used to get a point at
34+
# The {.linear_combination} method is used to create a new point as a linear
35+
# combination of two points.
36+
#
37+
# This method is generally used to get a point at
3638
# some percentage along a line connecting the two points.
3739
#
3840
# A linear combination is a standard term for vector math. It is defined as
@@ -41,26 +43,24 @@ class Geom::Point3d
4143
# @example
4244
# point1 = Geom::Point3d.new(1,1,1)
4345
# point2 = Geom::Point3d.new(10,10,10)
44-
# # Gets the point on the line segment connecting point1 and point2 that is
45-
# # 3/4 the way from point1 to point2.
46+
#
47+
# # Get the point that is half the way from point1 to point2.
48+
# points = Geom::Point3d.linear_combination(0.5, point1, 0.5, point2)
49+
#
50+
# # Get the point that is 3/4 the way from point1 to point2.
4651
# point = Geom::Point3d.linear_combination(0.25, point1, 0.75, point2)
47-
# if (point)
48-
# UI.messagebox(point)
49-
# else
50-
# UI.messagebox("Failure")
51-
# end
52+
#
53+
# # Get the point that is 70% the way from point1 to point2.
54+
# percentage = 0.7
55+
# point = Geom::Point3d.linear_combination(1.0 - percentage, point1, percentage, point2)
5256
#
5357
# @param [Float] weight1
54-
# A weight or percentage.
5558
#
56-
# @param [Float] point1
57-
# The start point on the line.
59+
# @param [Geom::Point3d] point1
5860
#
5961
# @param [Float] weight2
60-
# A weight or percentage.
6162
#
62-
# @param [Float] point2
63-
# The end point of the line.
63+
# @param [Geom::Point3d] point2
6464
#
6565
# @return [Geom::Point3d]
6666
#
@@ -226,7 +226,7 @@ def clone
226226
# @param [Geom::Point3d] point2
227227
# The Point3d object to compute the distance to.
228228
#
229-
# @return [Length] the distance in current units
229+
# @return [Length]
230230
#
231231
# @version SketchUp 6.0
232232
def distance(point2)
@@ -484,7 +484,7 @@ def project_to_plane(plane)
484484
#
485485
# @overload set!(point3d)
486486
#
487-
# @param point3d [Geom::Point3d]
487+
# @param [Geom::Point3d] point3d
488488
# @return [Geom::Point3d]
489489
#
490490
# @version SketchUp 6.0

lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ def polygons
353353
# index = mesh.add_point(point1)
354354
# mesh.set_point(index, point2)
355355
#
356+
# @note Index starts at 1.
357+
#
356358
# @param [Integer] index
357359
# The index where the point will be set.
358360
#
@@ -408,6 +410,8 @@ def set_point(index, point)
408410
# @note If you don't specify how many points you will be adding to the mesh
409411
# when you initiate it you may risk the UV data becoming out of sync.
410412
#
413+
# @note Index starts at 1.
414+
#
411415
# @param [Integer] index
412416
# An Integer representing the UV index.
413417
#
@@ -458,6 +462,8 @@ def transform!(transformation)
458462
# @example
459463
# point = mesh.uv_at(1, true)
460464
#
465+
# @note Index starts at 1.
466+
#
461467
# @param [Integer] index
462468
# The index for the texture coordinate.
463469
#

lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def dot(vector)
333333
#
334334
# @overload initialize(vector)
335335
#
336-
# @param vector [Geom::Vector3d] A Vector3d object.
336+
# @param [Geom::Vector3d] vector A Vector3d object.
337337
# @return [Geom::Vector3d]
338338
#
339339
# @version SketchUp 6.0
@@ -504,12 +504,12 @@ def samedirection?(vector2)
504504
#
505505
# @overload set!(array3d)
506506
#
507-
# @param array3d [Array(Numeric, Numeric, Numeric)]
507+
# @param [Array(Numeric, Numeric, Numeric)] array3d
508508
# @return [Geom::Vector3d]
509509
#
510510
# @overload set!(vector)
511511
#
512-
# @param vector [Geom::Vector3d]
512+
# @param [Geom::Vector3d] vector
513513
# @return [Geom::Vector3d]
514514
#
515515
# @overload set!(x, y, z)

lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def add(name, type)
8888
# puts auto_text.name
8989
# }
9090
#
91+
# @note Don't remove content from this collection while iterating over it with
92+
# {#each}. This would change the size of the collection and cause elements to
93+
# be skipped as the indices change. Instead copy the current collection to an
94+
# array using +to_a+ and then use +each+ on the array, when removing content.
95+
#
9196
# @version LayOut 2018
9297
#
9398
# @yieldparam [Layout::AutoTextDefinition] auto_text

lib/sketchup-api-stubs/stubs/Layout/Document.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Layout::Document
4646
VERSION_2018 = nil # Stub value.
4747
VERSION_2019 = nil # Stub value.
4848
VERSION_2020 = nil # Stub value.
49+
VERSION_2021 = nil # Stub value.
4950
VERSION_3 = nil # Stub value.
5051
VERSION_CURRENT = nil # Stub value.
5152

@@ -402,15 +403,15 @@ def remove_entity(entity)
402403
# @example
403404
# doc = Layout::Document.open("C:/path/to/document.layout")
404405
# # Save the model using the current Layout format
405-
# filename = File.join(ENV['Home'], 'Desktop', 'mydoc.layout')
406-
# status = doc.save(filename)
406+
# path = File.join(ENV['Home'], 'Desktop', 'mydoc.layout')
407+
# status = doc.save(path)
407408
# # Save the document to the current file using the current LayOut format
408409
# status = doc.save
409410
# # Save the document to the current file in LayOut 3 format
410411
# status = doc.save(Layout::Document::VERSION_3)
411412
# # Save the document in LayOut 2013 format
412-
# filename = File.join(ENV['Home'], 'Desktop', 'mydoc_v2013.layout')
413-
# status = doc.save(filename, Layout::Document::VERSION_2013)
413+
# path = File.join(ENV['Home'], 'Desktop', 'mydoc_v2013.layout')
414+
# status = doc.save(path, Layout::Document::VERSION_2013)
414415
#
415416
# @overload save
416417
#

0 commit comments

Comments
 (0)