diff --git a/.github/workflows/rake.yaml b/.github/workflows/rake.yaml
index 7e7ce44..c73ae14 100644
--- a/.github/workflows/rake.yaml
+++ b/.github/workflows/rake.yaml
@@ -27,8 +27,8 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [ macos-12, windows-2022 ]
- ruby: [ 2.7 ]
+ os: [ macos-latest, windows-latest ]
+ ruby: [ 3.2 ]
steps:
- name: Checkout source
@@ -45,4 +45,4 @@ jobs:
- name: Run rake
timeout-minutes: 10
- run: bundle exec rake
\ No newline at end of file
+ run: bundle exec rake
diff --git a/README.md b/README.md
index 3165001..57e3487 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,9 @@
The SketchUp Ruby API allows you to interact with SketchUp models and the SketchUp application. It is available from within SketchUp, it cannot be used by itself.
-
- Get started with the Ruby API Overview.
-
+ All interactions with the SketchUp Ruby API must be performed from the main thread to avoid unexpected behavior and application instability.
+
+Get started with the [Ruby API Overview](_index.html).
Visit our [SketchUp Developer Center](https://developer.sketchup.com) for more information and resources on SketchUp's APIs.
diff --git a/lib/sketchup-api-stubs/sketchup.rb b/lib/sketchup-api-stubs/sketchup.rb
index efd8bf3..4c1a7a3 100644
--- a/lib/sketchup-api-stubs/sketchup.rb
+++ b/lib/sketchup-api-stubs/sketchup.rb
@@ -21,6 +21,7 @@
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb'
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb'
require 'sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb'
+require 'sketchup-api-stubs/stubs/Layout/Dictionary.rb'
require 'sketchup-api-stubs/stubs/Layout/Document.rb'
require 'sketchup-api-stubs/stubs/Layout/Ellipse.rb'
require 'sketchup-api-stubs/stubs/Layout/Entities.rb'
@@ -82,6 +83,9 @@
require 'sketchup-api-stubs/stubs/Sketchup/Entities.rb'
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb'
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb'
+require 'sketchup-api-stubs/stubs/Sketchup/Environment.rb'
+require 'sketchup-api-stubs/stubs/Sketchup/Environments.rb'
+require 'sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb'
require 'sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Face.rb'
require 'sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb'
@@ -103,6 +107,7 @@
require 'sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb'
require 'sketchup-api-stubs/stubs/Sketchup/LineStyle.rb'
require 'sketchup-api-stubs/stubs/Sketchup/LineStyles.rb'
+require 'sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Loop.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Material.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Materials.rb'
@@ -129,6 +134,7 @@
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
+require 'sketchup-api-stubs/stubs/Sketchup/Snap.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'
diff --git a/lib/sketchup-api-stubs/stubs/Array.rb b/lib/sketchup-api-stubs/stubs/Array.rb
index f6a7736..4ee9f76 100644
--- a/lib/sketchup-api-stubs/stubs/Array.rb
+++ b/lib/sketchup-api-stubs/stubs/Array.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The SketchUp Array class adds additional methods to the standard Ruby Array
diff --git a/lib/sketchup-api-stubs/stubs/Geom.rb b/lib/sketchup-api-stubs/stubs/Geom.rb
index 8db0774..1c7b10b 100644
--- a/lib/sketchup-api-stubs/stubs/Geom.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The Geom module defines a number of Module methods that let you perform
@@ -73,12 +73,12 @@ def self.closest_points(line1, line2)
# @param [Geom::Point3d] point1
# @param [Geom::Point3d] point2
# @param [Geom::Point3d] point3
- # @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
+ # @return [Array(Float, Float, Float, Float)] A plane
#
# @overload fit_plane_to_points(points)
#
# @param [Array] points
- # @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
+ # @return [Array(Float, Float, Float, Float)] A plane
#
# @version SketchUp 6.0
def self.fit_plane_to_points(*args)
@@ -125,7 +125,7 @@ def self.intersect_line_line(line1, line2)
#
# @param [Array(Geom::Point3d, Geom::Vector3d)] line
#
- # @param [Array(Geom::Point3d, Geom::Point3d)] plane
+ # @param [Array(Geom::Point3d, Geom::Vector3d)] plane
#
# @return [Geom::Point3d, nil] A Point3d object. Returns +nil+ if they do not
# intersect.
@@ -149,11 +149,11 @@ def self.intersect_line_plane(line, plane)
# # This will return a line [Point3d(10, 20, 0), Vector3d(0, 0, 1)].
# line = Geom.intersect_plane_plane(plane1, plane2)
#
- # @param [Array(Geom::Point3d, Geom::Point3d)] plane1
+ # @param [Array(Geom::Point3d, Geom::Vector3d)] plane1
# The first plane to
# intersect
#
- # @param [Array(Geom::Point3d, Geom::Point3d)] plane2
+ # @param [Array(Geom::Point3d, Geom::Vector3d)] plane2
# The second plane to
# intersect
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb b/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
index c68793b..03e4649 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
@@ -141,7 +141,7 @@ def contains?(point_or_bb)
# boundingbox.add([100, 200, -400], [200, 400, 100])
# # This will return Point3d(100, 200, -400).
# boundingbox.corner(0)
- # # This will return Point3d(100, 200, -400).
+ # # This will return Point3d(100, 400, 100).
# boundingbox.corner(6)
#
# @param [Integer] corner_index
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb
index 1374516..153515d 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The bounds2d class represents an axis aligned bounding box represented by
@@ -14,7 +14,10 @@ class Geom::Bounds2d
# checks whether the point values are the same
#
# @example
- # entity.bounds == entity.untransformed_bounds
+ # bounds1 = Geom::Bounds2d.new(0.0, 0.0, 5.0, 5.0)
+ # bounds2 = Geom::Bounds2d.new([0, 0], [5, 5])
+ # # Return true
+ # bounds1 == bounds2
#
# @param [Geom::Bounds2d] other
#
@@ -27,10 +30,10 @@ def ==(other)
# The {#height} method returns the height of the {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
+ # bounds = Geom::Bounds2d.new(5.0, 5.0, 1.0, 7.0)
# height = bounds.height
#
- # @return [Geom::Point2d]
+ # @return [Float]
#
# @version LayOut 2018
def height
@@ -39,7 +42,11 @@ def height
# The {#initialize} method creates a new {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
+ # bounds1 = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
+ #
+ # upper_left = Geom::Point2d.new(1, 1) # is equivalent to upper_left = [1, 1]
+ # lower_right = Geom::Point2d.new(3, 3) # is equivalent to lower_right = [3, 3]
+ # bounds2 = Geom::Bounds2d.new(upper_left, lower_right)
#
# @overload initialize(other_bounds)
#
@@ -80,8 +87,9 @@ def initialize(*args)
# corner of the {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
- # l_r = bounds.lower_right
+ # bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
+ # # The result is a Point2d(3, 3)
+ # lower_right = bounds.lower_right
#
# @return [Geom::Point2d]
#
@@ -89,8 +97,9 @@ def initialize(*args)
def lower_right
end
- # The {#set!} method sets the {Geom::Bounds2d} to match another one.
- # The argument is anything that can be converted into a {Geom::Bounds2d}.
+ # The {#set!} method is used to update the dimensions and position of a {Geom::Bounds2d} object so
+ # that it matches the specified bounds. The argument is anything that can be converted into a
+ # {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(3.0, 3.0, 5.0, 5.0)
@@ -131,11 +140,11 @@ def lower_right
def set!(*args)
end
- # The {#to_a} method returns an array which contains the {Geom::Point2d} that
+ # The {#to_a} method returns an array which contains the {Geom::Point2d}s that
# define the {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new
+ # bounds = Geom::Bounds2d.new(2.0, 2.0, 5.0, 5.0)
# bounds.to_a.each { |point| p point.to_s }
#
# @return [Array(Geom::Point2d, Geom::Point2d)]
@@ -148,8 +157,9 @@ def to_a
# of the {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
- # u_l = bounds.upper_left
+ # bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
+ # # The result is a Point2d(2, 2)
+ # upper_left = bounds.upper_left
#
# @return [Geom::Point2d]
#
@@ -160,10 +170,10 @@ def upper_left
# The {#width} method returns the width of the {Geom::Bounds2d}.
#
# @example
- # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
+ # bounds = Geom::Bounds2d.new(5.0, 5.0, 7.0, 1.0)
# width = bounds.width
#
- # @return [Geom::Point2d]
+ # @return [Float]
#
# @version LayOut 2018
def width
diff --git a/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb b/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb
index 6e21c13..e8fbc22 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The LatLong class contains various methods for creating and manipulating
@@ -12,13 +12,13 @@ class Geom::LatLong
# The new method creates a LatLong object.
#
# @example
- # ll = [40.01700, 105.28300]
- # latlong = Geom::LatLong.new(ll)
- # if (latlong)
- # UI.messagebox(latlong)
- # else
- # UI.messagebox("Failure")
- # end
+ # # No arguments, creates a latlong with (0, 0)
+ # latlong1 = Geom::LatLong.new
+ #
+ # latlong2 = Geom::LatLong.new(40.01700, 105.28300)
+ #
+ # array = [40.01700, 105.28300]
+ # latlong3 = Geom::LatLong.new(array)
#
# @overload initialize
#
@@ -36,8 +36,8 @@ class Geom::LatLong
#
# @overload initialize(lat, long)
#
- # @param [Numeric] lat
- # @param [Numeric] long
+ # @param [Numeric] latitude
+ # @param [Numeric] longitude
# @return [Geom::LatLong]
#
# @version SketchUp 6.0
@@ -47,14 +47,9 @@ def initialize(*args)
# The Latitude method retrieves the latitude coordinate from a LatLong object.
#
# @example
- # ll = [40.01700, 105.28300]
- # latlong = Geom::LatLong.new(ll)
+ # latlong = Geom::LatLong.new(40.01700, 105.28300)
+ # # The result is 40.01700
# latitude = latlong.latitude
- # if (latitude)
- # UI.messagebox(latitude)
- # else
- # UI.messagebox("Failure")
- # end
#
# @return [Float] a latitude coordinate value
#
@@ -66,14 +61,9 @@ def latitude
# object.
#
# @example
- # ll = [40.01700, 105.28300]
- # latlong = Geom::LatLong.new(ll)
+ # latlong = Geom::LatLong.new(40.01700, 105.28300)
+ # # The result is 105.28300
# longitude = latlong.longitude
- # if (longitude)
- # UI.messagebox(longitude)
- # else
- # UI.messagebox("Failure")
- # end
#
# @return [Float] a latitude coordinate value
#
@@ -84,7 +74,7 @@ def longitude
# The {#to_a} method converts a LatLong object to an array of two values.
#
# @example
- # latlong = Geom::LatLong.new([40.01700, 105.28300])
+ # latlong = Geom::LatLong.new(40.01700, 105.28300)
# array = latlong.to_a
#
# @return [Array(Float, Float)] an array of latitude and longitude
@@ -108,14 +98,9 @@ def to_s
# The to_utm method converts a LatLong object to a UTM object.
#
# @example
- # ll = [40.01700, 105.28300]
- # latlong = Geom::LatLong.new(ll)
+ # latlong = Geom::LatLong.new(40.01700, 105.28300)
+ # # The result is UTM(48 T 524150.82056 4429682.40743)
# utm = latlong.to_utm
- # if (utm)
- # UI.messagebox(utm)
- # else
- # UI.messagebox("Failure")
- # end
#
# @return [Geom::UTM]
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb b/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb
index 66ac2b8..b2c0161 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The OrientedBounds2d class is a bounding box represented by four
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb
index b8103c4..818d020 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The {Geom::Point2d} class allows you to work with a point in 2D space.
@@ -10,14 +10,14 @@
#
# @example
# # No arguments, creates a point at the origin [0, 0]
-# pt1 = Geom::Point2d.new
+# point1 = Geom::Point2d.new
#
# # Creates a point at x of 1, y of 2.
-# pt2 = Geom::Point2d.new(1, 2)
+# point2 = Geom::Point2d.new(1, 2)
#
# # You can also create a point directly by simply assigning the x, and y
# # values to a variable as an array:
-# pt3 = [1, 2]
+# point3 = [1, 2]
#
# @version LayOut 2018
class Geom::Point2d
@@ -28,10 +28,16 @@ class Geom::Point2d
# {Geom::Point2d}, or to set the values of the {Geom::Point2d} by adding a
# {Geom::Vector2d} to the {Geom::Point2d}.
#
- # @example
- # pt = [1, 1]
- # # the result is a Point2d(2, 3)
- # pt2 = pt + [1, 2]
+ # @example Translate Point2d with Vector2d
+ # point = Geom::Point2d.new(1, 1)
+ # vector = Geom::Vector2d.new(1, 2)
+ # # The result is a Point2d(2, 3)
+ # new_point = point + vector
+ #
+ # @example Translate Point2d with vector in Array form
+ # point = Geom::Point2d.new(1, 1)
+ # # The result is a Point2d(2, 3)
+ # new_point = point + [1, 2]
#
# @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
#
@@ -44,23 +50,37 @@ def +(vector)
# The {#-} operator is a simple way to subtract from the current x and y values
# of the {Geom::Point2d}.
#
- # @example
- # vec = Geom::Vector2d.new(1, 2)
- # # result is a Point2d(3, 0)
- # pt = [4, 2] - vec
- # # result is a Vector2d(1, 2)
- # vec2 = [4, 2] - pt
+ # @example Translate Point2d by vector in Array form
+ # point = Geom::Point2d.new(4, 2)
+ # # The result is a Vector2d(3, 0)
+ # vector = point - [1, 2]
#
- # @overload -(vector)
+ # @example Calculate the Vector2d between two Point2d
+ # point1 = Geom::Point2d.new(4, 2)
+ # point2 = Geom::Point2d.new(1, 2)
+ # # The result is a Vector2d(3, 0)
+ # vector = point1 - point2
#
- # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
- # @return [Geom::Point2d]
+ # @example Translate Point2d with Vector2d
+ # point = Geom::Point2d.new(4, 2)
+ # vector = Geom::Vector2d.new(3, 0)
+ # # The result is a Point2d(1, 2)
+ # new_point = point - vector
+ #
+ # @overload -(array2d)
#
- # @overload -(point)
+ # @param [Array(Numeric, Numeric)] array2d
+ # @return [Geom::Vector2d]
+ #
+ # @overload -(point2d)
#
# @param [Geom::Point2d] point2d
- # @return [Geom::Vector2d] a vector indicating the difference between the two
- # points
+ # @return [Geom::Vector2d]
+ #
+ # @overload -(vector2d)
+ #
+ # @param [Geom::Vector2d] vector2d
+ # @return [Geom::Point2d]
#
# @version LayOut 2018
def -(arg)
@@ -72,6 +92,7 @@ def -(arg)
# @example
# point1 = Geom::Point2d.new(1, 1)
# point2 = Geom::Point2d.new(0, 1)
+ # # Return false
# status = point1 == point2
#
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
@@ -88,7 +109,7 @@ def ==(point)
# @example
# point = Geom::Point2d.new(1, 2)
#
- # # returns the y value of 2
+ # # Returns the y value of 2
# yvalue = point[1]
#
# @param [Integer] index
@@ -126,7 +147,7 @@ def []=(index, value)
#
# @example
# point = Geom::Point2d.new(1, 2)
- # newpoint = point.clone
+ # new_point = point.clone
#
# @return [Geom::Point2d] the cloned {Geom::Point2d} object
#
@@ -140,7 +161,7 @@ def clone
# @example
# point1 = Geom::Point2d.new(1, 1)
# point2 = Geom::Point2d.new(1, 4)
- # # result is a value of 3
+ # # The result is 3
# distance = point1.distance(point2)
#
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
@@ -155,14 +176,14 @@ def distance(point)
#
# @example
# # No arguments, creates a point at the origin [0, 0]
- # pt1 = Geom::Point2d.new
+ # point1 = Geom::Point2d.new
#
# # Creates a point at x of 1 and y of 2.
- # pt2 = Geom::Point2d.new(1, 2)
+ # point2 = Geom::Point2d.new(1, 2)
#
# # You can also create a point directly by simply assigning the x and y
# # values to a variable as an array:
- # pt3 = [1, 2]
+ # point3 = [1, 2]
#
# @overload initialize
#
@@ -201,8 +222,8 @@ def inspect
# @example
# point = Geom::Point2d.new
# vector = Geom::Vector2d.new(0, 2)
- # # result is a Point2d(0, 1)
- # point2 = point1.offset(vector, 1)
+ # # The result is a Point2d(0, 1)
+ # new_point = point.offset(vector, 1)
#
# @overload offset(vector)
#
@@ -226,8 +247,8 @@ def offset(*args)
# @example
# point = Geom::Point2d.new
# vector = Geom::Vector2d.new(0, 2)
- # # result is a Point2d(0, 1)
- # point1.offset!(vector, 1)
+ # # The result is a Point2d(0, 1)
+ # point.offset!(vector, 1)
#
# @overload offset!(vector)
#
@@ -270,6 +291,8 @@ def set!(*args)
# @example
# point = Geom::Point2d.new(1, 2)
# array = point.to_a
+ # # The result is [1, 2]
+ # p array
#
# @return [Array(Numeric, Numeric)] an array of two numbers representing x, y
# of the {Geom::Point2d}
@@ -282,7 +305,7 @@ def to_a
#
# @example
# point = Geom::Point2d.new(1, 2)
- # str = point.to_s
+ # string = point.to_s
#
# @return [String]
#
@@ -296,8 +319,8 @@ def to_s
# @example
# point = Geom::Point2d.new(4, 5)
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
- # # pt will be (6, 8)
- # pt = point.transform(transformation)
+ # # The result is a Point2d(6, 8)
+ # transformed_point = point.transform(transformation)
#
# @param [Geom::Transformation2d] transform
# A Transformation object to apply to the point.
@@ -314,7 +337,7 @@ def transform(transform)
# @example
# point = Geom::Point2d.new(4, 5)
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
- # # point will be (6, 8)
+ # # The result is a Point2d(6, 8)
# point.transform!(transformation)
#
# @param [Geom::Transformation2d] transform
@@ -329,13 +352,13 @@ def transform!(transform)
# The {#vector_to} method returns the vector between points.
#
# @example
- # pt1 = Geom::Point2d.new(1, 1)
- # pt2 = Geom::Point2d.new(3, 1)
+ # point1 = Geom::Point2d.new(1, 1)
+ # point2 = Geom::Point2d.new(3, 1)
#
- # # result is a Vector2d(2, 0)
- # vec = pt1.vector_to(pt2) # is equivalent to (pt2 - pt1)
+ # # The result is a Vector2d(2, 0)
+ # vector = point1.vector_to(point2) # is equivalent to (point2 - point1)
#
- # @param [Geom::Point2d] point
+ # @param [Geom::Point2d, Array(Numeric, Numeric)] point
#
# @return [Geom::Vector2d]
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb b/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb
index e9eb0d7..cc763b0 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The Point3d class allows you to work with a point in 3D space.
@@ -16,15 +16,15 @@
# See the Array class for details.
#
# @example
-# # No arguments, creates a point at the origin [0,0,0]
-# pt1 = Geom::Point3d.new
+# # No arguments, creates a point at the origin [0, 0, 0]
+# point1 = Geom::Point3d.new
#
# # Creates a point at x of 100, y of 200, z of 300.
-# pt2 = Geom::Point3d.new(100,200,300)
+# point2 = Geom::Point3d.new(100, 200, 300)
#
# # You can also create a point directly by simply assigning the x, y and z
# # values to a variable as an array:
-# pt3 = [100,200,300]
+# point3 = [100, 200, 300]
#
# @version SketchUp 6.0
class Geom::Point3d
@@ -41,8 +41,8 @@ class Geom::Point3d
# point = weight1 * point1 + weight2 * point2.
#
# @example
- # point1 = Geom::Point3d.new(1,1,1)
- # point2 = Geom::Point3d.new(10,10,10)
+ # point1 = Geom::Point3d.new(1, 1, 1)
+ # point2 = Geom::Point3d.new(10, 10, 10)
#
# # Get the point that is half the way from point1 to point2.
# points = Geom::Point3d.linear_combination(0.5, point1, 0.5, point2)
@@ -73,23 +73,25 @@ def self.linear_combination(weight1, point1, weight2, point2)
# The {#+} operator is a fast way to add to the current x, y and z values of
# a vector.
#
- # @example Using vector
- # point1 = Geom::Point3d.new(1, 2, 3)
+ # @example Translate Point3d with Vector3d
+ # point = Geom::Point3d.new(1, 2, 3)
# vector = Geom::Vector3d.new(4, 5, 6)
- # point2 = point1 + vector
+ # # The result is a Point3d(5, 7, 9)
+ # new_point = point + vector
#
- # @example Using array
- # point1 = Geom::Point3d.new(1, 2, 3)
- # point2 = point1 + [10,10,10]
+ # @example Translate Point3d with vector in Array form
+ # point = Geom::Point3d.new(1, 2, 3)
+ # # the result is a Point3d(11, 12, 13)
+ # new_point = point + [10, 10, 10]
#
- # @example Using point
+ # @example Translate Point3d with function in Array form
# point1 = Geom::Point3d.new(1, 2, 3)
# point2 = Geom::Point3d.new(4, 5, 6)
- # # This works because SketchUp treats the array of triple numerics as
- # # a vector in this case.
- # point3 = point1 + point2.to_a
+ # # This works because SketchUp treats the array of triple numerics as a vector in this case.
+ # # The result is a Point3d(5, 7, 9)
+ # new_point = point1 + point2.to_a
#
- # @param [Geom::Vector3d] vector
+ # @param [Geom::Vector3d, Array(Numeric, Numeric, Numeric)] vector
#
# @return [Geom::Point3d]
#
@@ -100,31 +102,56 @@ def +(vector)
# The '-' operator is a fast way to subtract from the current x, y and z values
# of a point.
#
- # @example
- # pt2 = pt - vec
- # pt = pt - [10,10,10]
+ # @example Translate a point by a vector in array form
+ # point = Geom::Point3d.new(12, 11, 12)
+ # # The result is a Vector3d(2, 1, 2)
+ # new_point = point - [10, 10, 10]
#
- # @param [Geom::Point3d] point2
- # A Point3d object.
+ # @example Calculate the Vector3d between two Point2d
+ # point1 = Geom::Point2d.new(4, 2, 5)
+ # point2 = Geom::Point2d.new(1, 2, 4)
+ # # The result is a Vector3d(3, 0, 1)
+ # vector = point1 - point2
+ #
+ # @example Translate Point3d with Vector3d
+ # point = Geom::Point2d.new(4, 2)
+ # vector = Geom::Vector2d.new(3, 0)
+ # # The result is a Point3d(1, 2)
+ # new_point = point - vector
+ #
+ # @overload -(array3d)
+ #
+ # @param [Array(Numeric, Numeric, Numeric)] array3d
+ # @return [Geom::Vector3d]
+ #
+ # @overload -(point3d)
+ #
+ # @param [Geom::Point3d] point3d A Point3d object.
+ # @return [Geom::Vector3d]
+ #
+ # @overload -(vector3d)
#
- # @return [Geom::Vector3d]
+ # @param [Geom::Vector3d] vector3d A Vector3d object.
+ # @return [Geom::Point3d]
#
# @version SketchUp 6.0
- def -(point2)
+ def -(arg)
end
- # The '<' operator is a fast way to determine if another point is closer to the
- # origin.
+ # The {#<} compare method is used to compare two points to determine if
+ # the left-hand point is less than the right-hand point.
#
# @example
- # pt1 = Geom::Point3d.new(10,10,10)
- # pt2 = Geom::Point3d.new(20,20,20)
- # result = pt1 < pt2
+ # point1 = Geom::Point3d.new(10, 10, 10)
+ # point2 = Geom::Point3d.new(20, 20, 20)
+ # result = point1 < point2
#
- # @param [Geom::Point3d] point2
+ # @note The comparison is performed in the order x, y and z coordinates.
+ #
+ # @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point2
# A Point3d object.
#
- # @return [Boolean] true if the point2 is closer to the origin.
+ # @return [Boolean] true if the point1 is smaller than point2
#
# @version SketchUp 6.0
def <(point2)
@@ -139,28 +166,30 @@ def <(point2)
# x, y and z coordinates, as in the following examples:
#
# @example
- # if( pt1 == pt2 )
- # UI.messagebox('equal')
- # end
+ # point1 = Geom::Point3d.new(3, 4, 3)
+ # point2 = Geom::Point3d.new(3, 4, 3)
+ # # Return true
+ # point1 == point2
#
# # ... or ...
- # if( pt1 == [100,200,300] ) ...
- # UI.messagebox('equal')
- # end
+ # point3 = Geom::Point3d.new(100, 200, 301)
+ # # Return false
+ # point3 == [100, 200, 300]
#
# @example
- # point1 = Geom::Point3d.new(1,1,1)
- # point2 = Geom::Point3d.new(10,10,10)
+ # point1 = Geom::Point3d.new(1, 1, 1)
+ # point2 = Geom::Point3d.new(10, 10, 10)
+ # # Return false
# status = point1 == point2
#
- # @param [Geom::Point3d] point2
+ # @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point
# A Point3d object.
#
# @return [Boolean] true if both points are equal; false if points are not
# equal
#
# @version SketchUp 6.0
- def ==(point2)
+ def ==(point)
end
# The [] method is used to retrieve the value of the point at the specified
@@ -169,7 +198,7 @@ def ==(point2)
# @example
# point = Geom::Point3d.new(1, 2, 3)
#
- # # retrieves the y value of 2
+ # # Retrieves the y value of 2
# yvalue = point[1]
#
# @param [Integer] index
@@ -186,7 +215,7 @@ def [](index)
# specific index of the value.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# yvalue = point[1] = 4
#
# @param [Integer] index
@@ -206,8 +235,8 @@ def []=(index, new_value)
# being cloned.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
- # newpoint = point.clone
+ # point = Geom::Point3d.new(1, 2, 3)
+ # new_point = point.clone
#
# @return [Geom::Point3d] the cloned Point3d object
#
@@ -219,8 +248,8 @@ def clone
# point.
#
# @example
- # point1 = Geom::Point3d.new(1,1,1)
- # point2 = Geom::Point3d.new(10,10,10)
+ # point1 = Geom::Point3d.new(1, 1, 1)
+ # point2 = Geom::Point3d.new(10, 10, 10)
# distance = point1.distance(point2)
#
# @param [Geom::Point3d] point2
@@ -238,9 +267,9 @@ def distance(point2)
# See Geom module for how to specify a line.
#
# @example
- # point1 = Geom::Point3d.new(1,1,1)
- # line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
- # distance = point1.distance_to_line(line)
+ # point = Geom::Point3d.new(1, 1, 1)
+ # line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # distance = point.distance_to_line(line)
#
# @note This function returns a `Float` value, not a `Length`.
#
@@ -260,6 +289,9 @@ def distance_to_line(line)
# See module Geom for how to specify a plane.
#
# @example
+ # point = Geom::Point3d.new(10, 10, 10)
+ # plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # # The result is 10
# distance = point.distance_to_plane(plane)
#
# @note This function returns a `Float` value, not a `Length`.
@@ -278,14 +310,14 @@ def distance_to_plane(plane)
#
# @example
# # No arguments, creates a point at the origin [0,0,0]
- # pt1 = Geom::Point3d.new
+ # point1 = Geom::Point3d.new
#
# # Creates a point at x of 100, y of 200, z of 300.
- # pt2 = Geom::Point3d.new(100,200,300)
+ # point2 = Geom::Point3d.new(100, 200, 300)
#
# # You can also create a point directly by simply assigning the x, y and z
# # values to a variable as an array:
- # pt3 = [100,200,300]
+ # point3 = [100, 200, 300]
#
# @overload initialize
#
@@ -334,7 +366,7 @@ def initialize(*args)
# which writes to the Ruby console.
#
# @example
- # point = Geom::Point3d.new(10,10,10)
+ # point = Geom::Point3d.new(10, 10, 10)
# string = point.inspect
#
# @return [String] a string point representation
@@ -347,9 +379,9 @@ def inspect
# point. The length of the vector must not be zero.
#
# @example
- # point1 = Geom::Point3d.new(10,10,10)
+ # point = Geom::Point3d.new(10, 10, 10)
# vector = Geom::Vector3d.new(0, 0, 1)
- # point2 = point1.offset(vector)
+ # new_point = point.offset(vector)
#
# @param [Geom::Vector3d] vector
# A Vector3d object to offset the point by.
@@ -370,9 +402,9 @@ def offset(vector, length = vector.length)
# Unlike offset, the point itself is modified.
#
# @example
- # point1 = Geom::Point3d.new(10,10,10)
- # vector = Geom::Vector3d.new(0,0,1)
- # point2 = point1.offset!(vector)
+ # point = Geom::Point3d.new(10, 10, 10)
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # new_point = point.offset!(vector)
#
# @param [Geom::Vector3d] vector
# A Vector3d object to offset the point by.
@@ -392,8 +424,8 @@ def offset!(vector, length = vector.length)
# See module Geom for the various ways to specify a line.
#
# @example
- # line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
- # point = Geom::Point3d.new(10,10,10)
+ # line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # point = Geom::Point3d.new(10, 10, 10)
# status = point.on_line?(line)
#
# @param line
@@ -410,8 +442,8 @@ def on_line?(line)
# See module Geom for the various ways to specify a plane.
#
# @example
- # plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
- # point = Geom::Point3d.new(10,10,10)
+ # plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # point = Geom::Point3d.new(10, 10, 10)
# status = point.on_plane?(plane)
#
# @param plane
@@ -428,8 +460,8 @@ def on_plane?(plane)
# The line may be defined by either a point and a vector or by two points.
#
# @example
- # line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
- # point = Geom::Point3d.new(10,10,10)
+ # line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # point = Geom::Point3d.new(10, 10, 10)
# projected_point = point.project_to_line(line)
#
# @param line
@@ -450,8 +482,8 @@ def project_to_line(line)
# BY + CZ + D = 0. See Geom for details.
#
# @example
- # plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
- # point = Geom::Point3d.new(10,10,10)
+ # plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
+ # point = Geom::Point3d.new(10, 10, 10)
# projected_point = point.project_to_plane(plane)
#
# @param plane
@@ -467,8 +499,8 @@ def project_to_plane(plane)
# The {#set!} method is used to set the values of the Point3d.
#
# @example
- # point = Geom::Point3d.new(10,10,10)
- # point = point.set!(100,200,300)
+ # point = Geom::Point3d.new(10, 10, 10)
+ # point = point.set!(100, 200, 300)
#
# @overload set!(x, y, z)
#
@@ -494,14 +526,12 @@ def set!(*args)
# The to_a method is used to convert the point to an array of 3 numbers
#
# @example
- # point = Geom::Point3d.new(10,20,30)
+ # point = Geom::Point3d.new(10, 20, 30)
# array = point.to_a
+ # # The result is [10, 20, 30]
+ # p array
#
- # pt = [100,200,300]
- # # outputs [100.0,200.0,300.0]
- # UI.messagebox(pt.to_a)
- #
- # @return [Array(Length, Length, Length)] an array of three numbers representing x,y,z of
+ # @return [Array(Length, Length, Length)] an array of three numbers representing x, y, z of
# the Point3d
#
# @version SketchUp 6.0
@@ -511,8 +541,8 @@ def to_a
# The to_s method is used to retrieve a string representation of a point.
#
# @example
- # point = Geom::Point3d.new(10,10,10)
- # str = point.to_s
+ # point = Geom::Point3d.new(10, 10, 10)
+ # string = point.to_s
#
# @return [String] the string representation of the Point3d
#
@@ -524,10 +554,11 @@ def to_s
# vector is unchanged by this method.
#
# @example
+ # point1 = Geom::Point3d.new(10, 10, 10)
+ # point2 = Geom::Point3d.new(100, 200, 300)
# transform = Geom::Transformation.new(point2)
- # point2 = Geom::Point3d.new(100,200,300)
- # point1 = Geom::Point3d.new(10,10,10)
- # point3 = point1.transform(transform)
+ # # The result is a Point3d(110, 210, 310)
+ # transformed_point = point1.transform(transform)
#
# @param [Geom::Transformation] transform
# A Transformation object.
@@ -541,9 +572,10 @@ def transform(transform)
# Apply a Transformation to a point. The point itself is modified.
#
# @example
+ # point1 = Geom::Point3d.new(10, 10, 10)
+ # point2 = Geom::Point3d.new(100, 200, 300)
# transform = Geom::Transformation.new(point2)
- # point2 = Geom::Point3d.new(100,200,300)
- # point1 = Geom::Point3d.new(10,10,10)
+ # # The result is a Point3d(110, 210, 310)
# point1.transform!(transform)
#
# @param [Geom::Transformation] transform
@@ -558,29 +590,29 @@ def transform!(transform)
# The vector_to team method retrieves the vector between points.
#
# @example
- # point2 = Geom::Point3d.new(100,200,300)
- # point1 = Geom::Point3d.new(10,10,10)
+ # point2 = Geom::Point3d.new(100, 200, 300)
+ # point1 = Geom::Point3d.new(10, 10, 10)
# vector = point1.vector_to(point2)
#
# # Another example...
- # pt1 = [1,1,0]
- # pt2 = [3,1,0]
- # pt1.vector_to(pt2) # returns the vector (2,0,0)
- # pt1.vector_to(pt2) # is equivalent to (pt2 - pt1)
+ # point1 = [1, 1, 0]
+ # point2 = [3, 1, 0]
+ # # The result is a Vector3d(2, 0, 0)
+ # point1.vector_to(point2) # is equivalent to (point2 - point1)
#
- # @param [Geom::Point3d] point2
+ # @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point3d
# A Point3d object.
#
# @return [Geom::Vector3d] a Vector object
#
# @version SketchUp 6.0
- def vector_to(point2)
+ def vector_to(point3d)
end
- # The x method retrieves the x value of the 3D point.
+ # The {#x} method retrieves the x value of the 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# x = point.x
#
# @return [Length] the x value
@@ -589,10 +621,10 @@ def vector_to(point2)
def x
end
- # The x= method is used to set the x value of a 3D point.
+ # The {#x=} method is used to set the x value of a 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# x = point.x = 2
#
# @param [Numeric] value
@@ -604,10 +636,10 @@ def x
def x=(value)
end
- # The y method retrieves the y value of the 3D point.
+ # The {#y} method retrieves the y value of the 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# y = point.y
#
# @return [Length] the y value
@@ -616,10 +648,10 @@ def x=(value)
def y
end
- # The y= method is used to set the y value of a 3D point.
+ # The {#y=} method is used to set the y value of a 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# y = point.y = 2
#
# @param [Numeric] value
@@ -631,11 +663,11 @@ def y
def y=(value)
end
- # The z method retrieves the z value of the 3D point.
+ # The {#z} method retrieves the z value of the 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
- # z = point.x
+ # point = Geom::Point3d.new(1, 2, 3)
+ # z = point.z
#
# @return [Length] the z value
#
@@ -643,10 +675,10 @@ def y=(value)
def z
end
- # The z= method is used to set the z value of a 3D point.
+ # The {#z=} method is used to set the z value of a 3D point.
#
# @example
- # point = Geom::Point3d.new(1,2,3)
+ # point = Geom::Point3d.new(1, 2, 3)
# z = point.z = 2
#
# @param [Numeric] value
diff --git a/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb b/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb
index 5762a59..c91edd7 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The {#Geom::PolygonMesh} class contains methods to create polygon mesh
@@ -15,7 +15,7 @@
#
# @example
# entities = Sketchup.active_model.active_entities
-# face = entities.grep(Sketchup::Face).first
+# face = entities.add_face([1, 1, 1], [1, 2, 1], [2, 2, 1])
#
# mesh = face.mesh
#
@@ -80,7 +80,6 @@ def add_point(point)
# Adds a polygon from a list of the mesh's vertex indices.
# @example
# mesh = Geom::PolygonMesh.new
- # # add points to mesh...
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
@@ -95,7 +94,6 @@ def add_point(point)
# Adds a polygon from an Array of the mesh's vertex indices.
# @example
# mesh = Geom::PolygonMesh.new
- # # add points to mesh...
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
@@ -143,7 +141,7 @@ def add_polygon(*args)
# mesh = Geom::PolygonMesh.new
# point = Geom::Point3d.new(0, 1, 2)
# mesh.add_point(point)
- # num = mesh.count_points
+ # number_points = mesh.count_points
#
# @return [Integer] the number of points in a mesh
#
@@ -159,7 +157,7 @@ def count_points
# point2 = Geom::Point3d.new(1, 0, 2)
# point3 = Geom::Point3d.new(2, 0, 1)
# mesh.add_polygon(point1, point2, point3)
- # nump = mesh.count_polygons
+ # number_polygons = mesh.count_polygons
#
# @return [Integer] the number of polygons in the mesh
#
@@ -188,15 +186,15 @@ def count_polygons
#
# @return [Geom::PolygonMesh]
#
- # @overload initialize(numpts)
+ # @overload initialize(number_points)
#
- # @param [Integer] numpts How many points will be in the mesh.
+ # @param [Integer] number_points How many points will be in the mesh.
# @return [Geom::PolygonMesh]
#
- # @overload initialize(numpts, numpolys)
+ # @overload initialize(number_points, number_polygons)
#
- # @param [Integer] numpts How many points will be in the mesh.
- # @param [Integer] numpolys How many polygons will be in the mesh.
+ # @param [Integer] number_points How many points will be in the mesh.
+ # @param [Integer] number_polygons How many polygons will be in the mesh.
# @return [Geom::PolygonMesh]
#
# @raise [RangeError] If number of points or polygons are negative numbers.
@@ -210,8 +208,13 @@ def initialize(*args)
# {Sketchup::Face#mesh} with the +PolygonMeshNormals+ flag.
#
# @example
+ # model = Sketchup.active_model
+ # entity = model.active_entities
+ # face = entity.add_face([1, 1, 1], [2, 2, 1], [2, 1, 1])
+ #
# flags = 4 # PolygonMeshNormals
# mesh = face.mesh(flags)
+ # # The result is a Vector3d(0, 0, -1)
# normal = mesh.normal_at(1)
#
# @note Index starts at 1.
@@ -310,7 +313,7 @@ def points
# @param [Integer] index
# The index of the desired polygon.
#
- # @return [Array, nil]
+ # @return [Array, nil]
#
# @version SketchUp 6.0
def polygon_at(index)
@@ -346,7 +349,14 @@ def polygon_points_at(index)
# indicates that the edge from +1+ to +2+ is hidden.
#
# @example
- # polygons = polygonmesh.polygons
+ # mesh = Geom::PolygonMesh.new
+ # mesh.add_point([0, 0, 0])
+ # mesh.add_point([1, 0, 0])
+ # mesh.add_point([1, 1, 0])
+ #
+ # mesh.add_polygon(1, 2, 3)
+ # mesh.add_polygon(-1, 3, 2)
+ # polygons = mesh.polygons
#
# @return [Array>]
#
@@ -395,26 +405,25 @@ def set_point(index, point)
#
# @example
# mesh = Geom::PolygonMesh.new(4)
- # # Create points for a triangle.
# point1 = Geom::Point3d.new(0, 0, 0)
# point2 = Geom::Point3d.new(9, 0, 0)
# point3 = Geom::Point3d.new(9, 9, 0)
# point4 = Geom::Point3d.new(0, 9, 0)
- # # Create UV mapping to tile 2x cross triangle.
- # uv1 = Geom::Point3d.new(0, 0, 0)
- # uv2 = Geom::Point3d.new(2, 0, 0)
- # uv3 = Geom::Point3d.new(2, 2, 0)
- # uv4 = Geom::Point3d.new(0, 2, 0)
- # # Add points and UV data to mesh.
+ #
+ # uv_point1 = Geom::Point3d.new(0, 0, 0)
+ # uv_point2 = Geom::Point3d.new(2, 0, 0)
+ # uv_point3 = Geom::Point3d.new(2, 2, 0)
+ # uv_point4 = Geom::Point3d.new(0, 2, 0)
+ #
# index1 = mesh.add_point(point1)
# index2 = mesh.add_point(point2)
# index3 = mesh.add_point(point3)
# index4 = mesh.add_point(point4)
- # mesh.set_uv(index1, uv1, true)
- # mesh.set_uv(index2, uv2, true)
- # mesh.set_uv(index3, uv3, true)
- # mesh.set_uv(index4, uv4, true)
- # # Add polygons.
+ # mesh.set_uv(index1, uv_point1, true)
+ # mesh.set_uv(index2, uv_point2, true)
+ # mesh.set_uv(index3, uv_point3, true)
+ # mesh.set_uv(index4, uv_point4, true)
+ #
# mesh.add_polygon(index1, index2, index3)
# mesh.add_polygon(index1, index3, index4)
#
@@ -442,11 +451,12 @@ def set_uv(index, point, front)
#
# @example
# point1 = Geom::Point3d.new(100, 200, 300)
- # tr = Geom::Transformation.new(point1)
+ # transformation = Geom::Transformation.new(point1)
# mesh = Geom::PolygonMesh.new
# point2 = Geom::Point3d.new(0, 1, 2)
# mesh.add_point(point2)
- # mesh.transform!(tr)
+ # # The PolygonMesh contains a Point3d(100, 201, 302)
+ # mesh.transform!(transformation)
#
# @param [Geom::Transformation] transformation
#
@@ -471,7 +481,12 @@ def transform!(transformation)
# referred to as UV mapping.
#
# @example
- # point = mesh.uv_at(1, true)
+ # mesh = Geom::PolygonMesh.new
+ # index = mesh.add_point([2, 2, 2])
+ # uv_point = Geom::Point3d.new(1, 1, 0)
+ #
+ # mesh.set_uv(index, uv_point, true)
+ # point = mesh.uv_at(index, true)
#
# @note Index starts at 1.
#
@@ -494,9 +509,20 @@ def uv_at(index, front)
# mesh.
#
# @example
- # # Get a mesh with front and back UVs.
+ # model = Sketchup.active_model
+ # entity = model.active_entities
+ #
+ # face = entity.add_face([1, 1, 1], [1, 3, 1], [3, 3, 1])
# mesh = face.mesh(1 | 2)
- # uvs = mesh.uvs(true)
+ #
+ # uv_point1 = Geom::Point3d.new(0, 0, 0)
+ # uv_point2 = Geom::Point3d.new(1, 0, 0)
+ # uv_point3 = Geom::Point3d.new(1, 1, 0)
+ # mesh.set_uv(1, uv_point1, true)
+ # mesh.set_uv(2, uv_point2, true)
+ # mesh.set_uv(3, uv_point3, true)
+ #
+ # uv_points = mesh.uvs(true)
#
# @param [Boolean] front
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb b/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb
index f7299ec..0e9ff77 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# Transformations are a standard construct in the 3D world for representing
@@ -24,7 +24,7 @@ class Geom::Transformation
# # Creates a transformation that "flips" the axes from XYZ to XZY. Something
# # one often need for importers/exporters when dealing with applications
# # that threat Y as "up".
- # tr = Geom::Transformation.axes(ORIGIN, X_AXIS, Z_AXIS, Y_AXIS.reverse)
+ # transformation = Geom::Transformation.axes(ORIGIN, X_AXIS, Z_AXIS, Y_AXIS.reverse)
#
# @overload axes(origin, xaxis, yaxis, zaxis)
#
@@ -52,31 +52,31 @@ def self.axes(*args)
# The {.interpolate} method is used to create a new transformation that is the
# result of interpolating between two other transformations.
#
- # Parameter is a weight (between `0.0` and `1.0`) that identifies whether to favor
- # `transformation1` or `transformation2`.
+ # Parameter weight is a value (between 0.0 and 1.0) that represents the percentage given to
+ # `transformation1` and `transformation2`.
#
# @example
# origin = Geom::Point3d.new(0, 0, 0)
- # x = Geom::Vector3d.new(0, 1, 0)
- # y = Geom::Vector3d.new(1, 0, 0)
- # z = Geom::Vector3d.new(0, 0, 1)
+ # xaxis = Geom::Vector3d.new(0, 1, 0)
+ # yaxis = Geom::Vector3d.new(1, 0, 0)
+ # zaxis = Geom::Vector3d.new(0, 0, 1)
# point = Geom::Point3d.new(10, 20, 30)
- # t1 = Geom::Transformation.new(point)
- # t2 = Geom::Transformation.axes(origin, x, y, z)
- # # This produce a transformation that is a mix of 75% t1 and 25% t2.
- # t3 = Geom::Transformation.interpolate(t1, t2, 0.25)
+ # transformation1 = Geom::Transformation.new(point)
+ # transformation2 = Geom::Transformation.axes(origin, xaxis, yaxis, zaxis)
+ # # This produce a transformation that is a mix of 75% transformation1 and 25% transformation2.
+ # new_transformation = Geom::Transformation.interpolate(transformation1, transformation2, 0.25)
#
- # @param [Geom::Transformation] transform1
+ # @param [Geom::Transformation] transformation1
#
- # @param [Geom::Transformation] transform2
+ # @param [Geom::Transformation] transformation2
#
# @param [Float] weight
- # A value between 0.0 and 1.0 (see comments).
+ # A value between 0.0 and 1.0.
#
# @return [Geom::Transformation]
#
# @version SketchUp 6.0
- def self.interpolate(transform1, transform2, weight)
+ def self.interpolate(transformation1, transformation2, weight)
end
# The {.rotation} method is used to create a transformation that does rotation
@@ -108,7 +108,7 @@ def self.rotation(point, vector, angle)
# @example
# point = Geom::Point3d.new(20, 30, 0)
# scale = 10
- # tr = Geom::Transformation.scaling(point, scale)
+ # transformation = Geom::Transformation.scaling(point, scale)
#
# @overload scaling(scale)
#
@@ -154,7 +154,7 @@ def self.scaling(*args)
#
# @example
# vector = Geom::Vector3d.new(0, 1, 0)
- # tr = Geom::Transformation.translation(vector)
+ # transformation = Geom::Transformation.translation(vector)
#
# @overload translation(vector)
#
@@ -177,9 +177,9 @@ def self.translation(arg)
# @example
# point1 = Geom::Point3d.new(10, 20, 30)
# point2 = Geom::Point3d.new(2, 2, 2)
- # tr = Geom::Transformation.new(point1)
- # # Returns Point3d(12, 22, 32)
- # point3 = tr * point2
+ # transformation = Geom::Transformation.new(point1)
+ # # The result is a Point3d(12, 22, 32)
+ # new_point = transformation * point2
#
# @overload *(point)
#
@@ -219,8 +219,8 @@ def *(arg)
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr1 = Geom::Transformation.new(point)
- # tr2 = tr1.clone
+ # transformation = Geom::Transformation.new(point)
+ # new_transformation = transformation.clone
#
# @return [Geom::Transformation]
#
@@ -233,22 +233,22 @@ def clone
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
- # # Returns false.
- # status = tr.identity?
+ # transformation = Geom::Transformation.new(point)
+ # # Returns false
+ # status = transformation.identity?
#
# @example
- # tr = Geom::Transformation.new(ORIGIN)
- # # Returns false.
- # status = tr.identity?
+ # transformation = Geom::Transformation.new(ORIGIN)
+ # # Returns true
+ # status = transformation.identity?
#
# @example
- # tr = Geom::Transformation.new
- # # Returns true.
- # status = tr.identity?
+ # transformation = Geom::Transformation.new
+ # # Returns true
+ # status = transformation.identity?
#
# @example
- # # Returns true.
+ # # Returns true
# status = IDENTITY.identity?
#
# @note As of SketchUp 2018, this now looks at the data to determine if the
@@ -267,7 +267,18 @@ def identity?
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
+ # transformation = Geom::Transformation.new(point)
+ #
+ # @example
+ # origin = Geom::Point3d.new(10, 10, 10)
+ # zaxis = Geom::Vector3d.new(1, 2, 3)
+ # transformation = Geom::Transformation.new(origin, zaxis)
+ #
+ # @example
+ # origin = Geom::Point3d.new(1, 1, 1)
+ # axis = Geom::Vector3d.new(1, 0, 0)
+ # angle = 45.degrees # Return 45 degrees in radians.
+ # transformation = Geom::Transformation.new(origin, axis, angle)
#
# @overload initialize
#
@@ -306,8 +317,8 @@ def identity?
#
# @overload initialize(origin, zaxis)
#
- # Creates a Transformation where origin is the new origin, and zaxis is the
- # z axis. The x and y axes are determined using an arbitrary axis rule.
+ # Creates a Transformation where origin is the new origin, and z axis is the
+ # new z axis. The x and y axes are determined using an arbitrary axis rule.
# @param [Geom::Point3d] origin
# @param [Geom::Vector3d] zaxis
# @return [Geom::Transformation]
@@ -345,8 +356,14 @@ def initialize(*args)
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr1 = Geom::Transformation.new(point)
- # tr2 = tr1.inverse
+ # transformation = Geom::Transformation.new(point)
+ # new_transformation = transformation.inverse
+ #
+ # @note As of SketchUp 2026, this will raise an error if the
+ # {Geom::Transformation} is not invertible. Prior to 2026 this would silently attempt
+ # to invert the transformation possibly returning in an invalid transformation.
+ #
+ # @raise ArgumentError if the {Geom::Transformation} is not invertible (as of Sketchup 2026)
#
# @return [Geom::Transformation]
#
@@ -358,8 +375,14 @@ def inverse
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
- # tr.invert!
+ # transformation = Geom::Transformation.new(point)
+ # new_transformation = transformation.invert!
+ #
+ # @note As of SketchUp 2026, this will raise an error if the
+ # {Geom::Transformation} is not invertible. Prior to 2026 this would silently attempt
+ # to invert the transformation possibly creating in an invalid transformation.
+ #
+ # @raise ArgumentError if the {Geom::Transformation} is not invertible (as of Sketchup 2026)
#
# @return [Geom::Transformation]
#
@@ -370,9 +393,9 @@ def invert!
# The {#origin} method retrieves the origin of a rigid transformation.
#
# @example
- # point1 = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point1)
- # point2 = tr.origin
+ # point = Geom::Point3d.new(10, 20, 30)
+ # transformation = Geom::Transformation.new(point)
+ # new_point = transformation.origin
#
# @return [Geom::Point3d] the origin of the transformation.
#
@@ -386,9 +409,9 @@ def origin
#
# @example
# point1 = Geom::Point3d.new(10, 20, 30)
- # tr1 = Geom::Transformation.new(point)
+ # transformation = Geom::Transformation.new(point1)
# point2 = Geom::Point3d.new(60, 40, 70)
- # tr1.set!(point2)
+ # transformation.set!(point2)
#
# @overload set!(transformation)
#
@@ -424,9 +447,10 @@ def set!(arg)
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
+ # transformation = Geom::Transformation.new(point)
# # This splits the 16 items into a string of 4x4 elements for easier reading.
- # str4x4 = tr.to_a.each_slice(4).inject { |str, row| "#{str}\r\n#{row}" }
+ # matrix = transformation.to_a.each_slice(4).inject { |str, row|"#{str}\r\n#{row}"}
+ # puts matrix
#
# @return [Array]
#
@@ -438,8 +462,8 @@ def to_a
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
- # x = tr.xaxis
+ # transformation = Geom::Transformation.new(point)
+ # x = transformation.xaxis
#
# @return [Geom::Vector3d]
#
@@ -451,8 +475,8 @@ def xaxis
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
- # x = tr.yaxis
+ # transformation = Geom::Transformation.new(point)
+ # y = transformation.yaxis
#
# @return [Geom::Vector3d]
#
@@ -464,8 +488,8 @@ def yaxis
#
# @example
# point = Geom::Point3d.new(10, 20, 30)
- # tr = Geom::Transformation.new(point)
- # x = tr.zaxis
+ # transformation = Geom::Transformation.new(point)
+ # z = transformation.zaxis
#
# @return [Geom::Vector3d]
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb
index a60e094..be6d71e 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
#
@@ -29,9 +29,9 @@ def self.rotation(point, angle)
# The {.scaling} method is used to create a transformation that does scaling.
#
# @example
- # point = Geom::Point3d.new(20, 30, 0)
+ # point = Geom::Point2d.new(20, 30)
# scale = 10
- # tr = Geom::Transformation2d.scaling(point, scale)
+ # transformation = Geom::Transformation2d.scaling(point, scale)
#
# @overload scaling(scale)
#
@@ -70,7 +70,7 @@ def self.scaling(*args)
#
# @example
# vector = Geom::Vector2d.new(0, 1)
- # tr = Geom::Transformation2d.translation(vector)
+ # transformation = Geom::Transformation2d.translation(vector)
#
# @overload translation(vector)
#
@@ -93,9 +93,9 @@ def self.translation(vector)
# @example
# point1 = Geom::Point2d.new(5, 10)
# point2 = Geom::Point2d.new(2, 2)
- # tr = Geom::Transformation2d.new(point1)
- # # Returns Point2d(7, 12)
- # point3 = tr * point2
+ # transformation = Geom::Transformation2d.translation(point1)
+ # # The result is a Point2d(7, 12)
+ # new_point = transformation * point2
#
# @overload *(point)
#
@@ -114,8 +114,8 @@ def self.translation(vector)
#
# @overload *(point)
#
- # @param [Array] point
- # @return [Array]
+ # @param [Array(Float, Float)] point
+ # @return [Array(Float, Float)]
#
# @version LayOut 2019
def *(arg)
@@ -125,8 +125,10 @@ def *(arg)
# This checks whether the values of the transformations are the same.
#
# @example
- # tr = Geom::Transformation2d.new({1.0, 0.0, 0.0, 1.0, 1.0, 1.0})
- # tr == tr.clone
+ # transformation1 = Geom::Transformation2d.new([1.0, 0.0, 0.0, 1.0, 1.0, 1.0])
+ # transformation2 = Geom::Transformation2d.translation([1, 1])
+ # # Returns true
+ # transformation1 == transformation2
#
# @param [Geom::Transformation2d] other
#
@@ -139,8 +141,8 @@ def ==(other)
# The {#clone} method creates a copy of the {Geom::Transformation2d}.
#
# @example
- # tr1 = Geom::Transformation2d.new
- # tr2 = tr1.clone
+ # transformation = Geom::Transformation2d.new
+ # new_transformation = transformation.clone
#
# @return [Geom::Transformation2d]
#
@@ -152,18 +154,18 @@ def clone
# {IDENTITY_2D} transform.
#
# @example
- # array = {1.0, 0.0, 0.0, 1.0, 1.0, 0.0}
- # tr = Geom::Transformation2d.new(array)
- # # Returns false.
- # status = tr.identity?
+ # array = [1.0, 0.0, 0.0, 1.0, 1.0, 0.0]
+ # transformation = Geom::Transformation2d.new(array)
+ # # Returns false
+ # status = transformation.identity?
#
# @example
- # tr = Geom::Transformation2d.new
- # # Returns true.
- # status = tr.identity?
+ # transformation = Geom::Transformation2d.new
+ # # Returns true
+ # status = transformation.identity?
#
# @example
- # # Returns true.
+ # # Returns true
# status = IDENTITY_2D.identity?
#
# @return [Boolean] +true+ if the transform is the identity
@@ -177,7 +179,9 @@ def identity?
# of {Geom::Transformation2d}.
#
# @example
- # tr = Geom::Transformation2d.new({1.0, 0.0, 0.0, 1.0, 1.0, 1.0})
+ # transformation1 = Geom::Transformation2d.new
+ #
+ # transformation2 = Geom::Transformation2d.new([1.0, 0.0, 0.0, 1.0, 1.0, 1.0])
#
# @overload initialize
#
@@ -203,8 +207,8 @@ def initialize(*args)
#
# @example
# point = Geom::Point2d.new(5, 10)
- # tr1 = Geom::Transformation2d.new(point)
- # tr2 = tr1.inverse
+ # transformation = Geom::Transformation2d.translation(point)
+ # new_transformation = transformation.inverse
#
# @return [Geom::Transformation2d]
#
@@ -216,8 +220,8 @@ def inverse
#
# @example
# point = Geom::Point2d.new(5, 10)
- # tr = Geom::Transformation2d.new(point)
- # tr.invert!
+ # transformation = Geom::Transformation2d.translation(point)
+ # transformation.invert!
#
# @return [Geom::Transformation2d]
#
@@ -229,9 +233,9 @@ def invert!
# The argument is anything that can be converted into a {Geom::Transformation2d}.
#
# @example
- # tr1 = Geom::Transformation2d.new
- # array = {2.0, 0.0, 0.0, 2.0, 0.0, 0.0}
- # tr1.set!(array)
+ # transformation = Geom::Transformation2d.new
+ # matrix = [2.0, 0.0, 0.0, 2.0, 0.0, 0.0]
+ # transformation.set!(matrix)
#
# @overload set!(transformation)
#
@@ -251,8 +255,8 @@ def set!(arg)
# define the Transformation2d.
#
# @example
- # tr = Geom::Transformation2d.new
- # tr.to_a.each_slice(2) {|a| p a}
+ # transformation = Geom::Transformation2d.new
+ # transformation.to_a.each_slice(2) {|a| p a}
#
# @return [Array] an array of 6 elements
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/UTM.rb b/lib/sketchup-api-stubs/stubs/Geom/UTM.rb
index 2590b25..e1c3bbc 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/UTM.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/UTM.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The UTM class lets you work with UTM map coordinates.
@@ -16,11 +16,10 @@ class Geom::UTM
# instead of calling this method.
#
# @example
- # # Create a copy of an existing UTM object.
- # utm = Geom::UTM.new(utm2)
+ # utm1 = Geom::UTM.new
#
# # Create a new UTM object from scratch.
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
+ # utm2 = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
#
# @overload initialize(zone_number, zone_letter, x, y)
#
@@ -35,7 +34,7 @@ class Geom::UTM
#
# @overload initialize(array)
#
- # @param [Array(Integer, String, Float, Float)] An array containing the zone
+ # @param [Array(Integer, String, Float, Float)] array contains the zone
# number, zone letter, x and y positions.
#
# @return [Geom::UTM]
@@ -49,9 +48,8 @@ def initialize(*args)
# coordinate.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
- # a = utm.to_a
+ # array = utm.to_a
#
# @return [Array(Integer, String, Float, Float)]
#
@@ -63,9 +61,8 @@ def to_a
# and longitude. See the LatLong class for more information.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
- # ll = utm.to_latlong
+ # latlong = utm.to_latlong
#
# @return [Geom::LatLong]
#
@@ -76,7 +73,6 @@ def to_latlong
# The {#to_s} method is used to retrieve a string representation of a UTM.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
# string = utm.to_s
#
@@ -89,7 +85,6 @@ def to_s
# The {#x} method returns the UTM x coordinate.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
# x = utm.x
#
@@ -102,7 +97,6 @@ def x
# The {#y} method returns the UTM y coordinate.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
# y = utm.y
#
@@ -115,9 +109,8 @@ def y
# The {#zone_letter} method returns the UTM zone letter.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
- # zl = utm.zone_letter
+ # zone_letter = utm.zone_letter
#
# @return [String]
#
@@ -128,9 +121,8 @@ def zone_letter
# The {#zone_number} method returns the UTM zone number.
#
# @example
- # # Create a new UTM object from scratch.
# utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
- # zn = utm.zone_number
+ # zone_number = utm.zone_number
#
# @return [Integer]
#
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb
index 1227e07..0cc04b0 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The {Geom::Vector2d} class represents vectors in a 2 dimensional space.
@@ -10,19 +10,23 @@ class Geom::Vector2d
# Instance Methods
- # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
- # an alias of the dot method.
+ # The {#%} method is used to compute the dot product between two vectors.
+ #
+ # This is an alias of the {#dot} method.
#
# @example
- # vector = Geom::Vector2d.new(0, 2)
- # vector2 = Geom::Vector2d.new(1, 0)
- # d2 = vector % vector2
+ # vector1 = Geom::Vector2d.new(4, 5)
+ # vector2 = Geom::Vector2d.new(7, 1)
+ # # The result is 33
+ # dot = vector1 % vector2
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
- # @return The dot product of the vectors
+ # @return [Float]
#
- # @version LayOut 2018
+ # @see #dot
+ #
+ # @version SketchUp 6.0
def %(vector)
end
@@ -30,13 +34,16 @@ def %(vector)
# is an alias of the cross method.
#
# @example
- # vector = Geom::Vector2d.new(1, 0)
- # vector2 = Geom::Vector2d.new(0, 1)
- # cross = vector * vector
+ # vector1 = Geom::Vector2d.new(2, 5)
+ # vector2 = Geom::Vector2d.new(5, 1)
+ # # The result is -23
+ # cross = vector1 * vector2
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
- # @return [Geom::Vector2d]
+ # @return [Float]
+ #
+ # @see #cross
#
# @version LayOut 2018
def *(vector)
@@ -45,11 +52,11 @@ def *(vector)
# The {#+} method adds a {Geom::Vector2d} to this one.
#
# @example
- # vector = Geom::Vector2d.new(0, 2)
+ # vector1 = Geom::Vector2d.new(0, 2)
# vector2 = Geom::Vector2d.new(1, 0)
- # new_vector = vector + vector2
+ # new_vector = vector1 + vector2
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Geom::Vector2d]
#
@@ -60,11 +67,11 @@ def +(vector)
# The {#-} method subtracts a {Geom::Vector2d} from this one.
#
# @example
- # vector = Geom::Vector2d.new(0, 2)
+ # vector1 = Geom::Vector2d.new(0, 2)
# vector2 = Geom::Vector2d.new(1, 0)
- # new_vector = vector - vector2
+ # new_vector = vector1 - vector2
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Geom::Vector2d]
#
@@ -76,12 +83,12 @@ def -(vector)
# tolerance.
#
# @example
- # vector = Geom::Vector2d.new(1, 0)
- # vector2 = Geom::Vector2d.new(0,1)
+ # vector1 = Geom::Vector2d.new(1, 0)
+ # vector2 = Geom::Vector2d.new(0, 1)
# # Returns false
- # status = vector == vector2
+ # status = vector1 == vector2
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Boolean]
#
@@ -94,13 +101,13 @@ def ==(vector)
#
# @example
# vector = Geom::Vector2d.new(1, 2)
- # # retrieves the y value of 2
+ # # Retrieves the y value of 2
# yvalue = vector[1]
#
# @param [Integer] index
# The index into an array of two coordinates.
#
- # @return [Numeric] The value for the x or y coordinate.
+ # @return [Float] The value for the x or y coordinate.
#
# @version LayOut 2018
def [](index)
@@ -110,17 +117,17 @@ def [](index)
# specific index of the value.
#
# @example
- # point = Geom::Vector2d.new(1,2)
- # point[1] = 4
+ # vector = Geom::Vector2d.new(1, 2)
+ # vector[1] = 4
#
- # @param [Numeric] index
+ # @param [Integer] index
# The index for a specific x or y value in the
# {Geom::Vector2d} to set
#
- # @param [Numeric] value
+ # @param [Float] value
# The value to set for x or y
#
- # @return [Numeric] The new x or y value if successful
+ # @return [Float] The new x or y value if successful
#
# @version LayOut 2018
def []=(index, value)
@@ -130,14 +137,14 @@ def []=(index, value)
# the {Geom::Vector2d} and another {Geom::Vector2d}.
#
# @example
- # vector = Geom::Vector2d.new(1, 0)
+ # vector1 = Geom::Vector2d.new(1, 0)
# vector2 = Geom::Vector2d.new(-1, 0)
- # # returns PI
- # angle = vector.angle_between(vector2)
+ # # Returns PI
+ # angle = vector1.angle_between(vector2)
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
- # @return [Numeric] The angle (in radians)
+ # @return [Float] The angle (in radians)
#
# @version LayOut 2018
def angle_between(vector)
@@ -148,7 +155,7 @@ def angle_between(vector)
#
# @example
# vector = Geom::Vector2d.new(1, 0)
- # vector2 = vector.clone
+ # new_vector = vector.clone
#
# @return [Geom::Vector2d]
#
@@ -156,35 +163,43 @@ def angle_between(vector)
def clone
end
- # The {#*} method returns the cross product between two {Geom::Vector2d}. This
- # is an alias of the cross method.
+ # The {#cross} method returns the cross product between two {Geom::Vector2d}s.
+ #
+ # The cross product, also called the vector product, is an operation on two
+ # vectors. The cross product of two vectors produces a third vector which is
+ # perpendicular to the plane in which the first two lie.
#
# @example
- # vector = Geom::Vector2d.new(1, 0)
- # vector2 = Geom::Vector2d.new(0, 1)
- # cross = vector * vector
+ # vector1 = Geom::Vector2d.new(3, 3)
+ # vector2 = Geom::Vector2d.new(2, 5)
+ # # The result is 9
+ # cross = vector1.cross(vector2)
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
- # @return [Geom::Vector2d]
+ # @return [Float]
+ #
+ # @see #*
#
# @version LayOut 2018
def cross(vector)
end
- # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
- # an alias of the dot method.
+ # The {#dot} method is used to compute the dot product between two vectors.
#
# @example
- # vector = Geom::Vector2d.new(0, 2)
- # vector2 = Geom::Vector2d.new(1, 0)
- # d2 = vector % vector2
+ # vector1 = Geom::Vector2d.new(4, 1)
+ # # The result is 14
+ # vector2 = Geom::Vector2d.new(3, 2)
+ # dot = vector1.dot(vector2)
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
- # @return The dot product of the vectors
+ # @return [Float]
#
- # @version LayOut 2018
+ # @see #%
+ #
+ # @version SketchUp 6.0
def dot(vector)
end
@@ -192,7 +207,9 @@ def dot(vector)
#
# @example
# # A vector that runs along the X axis.
- # vector = Geom::Vector2d.new(1, 0)
+ # vector1 = Geom::Vector2d.new(1, 0)
+ #
+ # vector2 = Geom::Vector2d.new([5, 6])
#
# @overload initialize
#
@@ -200,13 +217,13 @@ def dot(vector)
#
# @overload initialize(x, y)
#
- # @param [Numeric] x The length in the x direction
- # @param [Numeric] y The length in the y direction
+ # @param [Float] x The length in the x direction
+ # @param [Float] y The length in the y direction
# @return [Geom::Vector2d]
#
# @overload initialize(vector)
#
- # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
# @return [Geom::Vector2d]
#
# @version LayOut 2018
@@ -216,8 +233,8 @@ def initialize(*args)
# The {#inspect} method formats the {Geom::Vector2d} as a string.
#
# @example
- # point = Geom::Point2d.new(1, 2)
- # string = point.inspect
+ # vector = Geom::Vector2d.new(1, 2)
+ # string = vector.inspect
#
# @return [String] the string representation of the {Geom::Vector2d}
#
@@ -229,8 +246,8 @@ def inspect
#
# @example
# vector = Geom::Vector2d.new(0, 4)
- # # returns 4
- # l = vector.length
+ # # The result is 4
+ # length = vector.length
#
# @return [Length] The length of the {Geom::Vector2d}
#
@@ -243,13 +260,12 @@ def length
#
# @example
# vector = Geom::Vector2d.new(0, 4)
- # l = vector.length
# vector.length = 2
#
- # @param [Numeric] length
+ # @param [Float] length
# The new length for the {Geom::Vector2d}
#
- # @return [Numeric] The new length
+ # @return [Length] The new length
#
# @version LayOut 2018
def length=(length)
@@ -260,8 +276,8 @@ def length=(length)
#
# @example
# vector = Geom::Vector2d.new(0, 4)
- # # returns a new Vector2d(0, 1)
- # vector2 = vector.normalize
+ # # The result is a Vector2d(0, 1)
+ # new_vector = vector.normalize
#
# @return [Geom::Vector2d]
#
@@ -270,27 +286,27 @@ def normalize
end
# The {#normalize!} method converts a {Geom::Vector2d} vector into a unit
- # vector. Another way to do this is vector.length = 1
+ # vector. Another way to do this is +vector.length = 1.0+
#
# @example
# vector = Geom::Vector2d.new(0, 4)
- # # modifies vector to be the Vector2d(0, 1)
+ # # Modifies vector to be the Vector2d(0, 1)
# vector.normalize!
#
# @version LayOut 2018
def normalize!
end
- # The {#parallel?} method determines if the {Geom::Vector2d} is parallel to
- # another {Geom::Vector2d} to within tolerance.
+ # The {#parallel?} method determines if two {Geom::Vector2d}s are parallel within a
+ # tolerance. Two vectors are parallel if there exists a scalar multiple between them.
#
# @example
- # vector = Geom::Vector2d.new(0, 1)
- # vector2 = Geom::Vector2d.new(1, 2)
- # # returns true
- # status = vector.parallel?(vector2)
+ # vector1 = Geom::Vector2d.new(0, 1)
+ # vector2 = Geom::Vector2d.new(0, -9)
+ # # Returns true
+ # status = vector1.parallel?(vector2)
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Boolean]
#
@@ -298,16 +314,17 @@ def normalize!
def parallel?(vector)
end
- # The {#perpendicular?} method determines if the {Geom::Vector2d} is
- # perpendicular to another {Geom::Vector2d} to within tolerance.
+ # The {#perpendicular?} method determines if two {Geom::Vector2d}s are
+ # perpendicular within a tolerance. Two vectors are considered
+ # perpendicular if their dot product is zero.
#
# @example
- # vector = Geom::Vector2d.new(0, 1)
- # vector2 = Geom::Vector2d.new(1, 2)
- # # returns false
- # status = vector.perpendicular?(vector2)
+ # vector1 = Geom::Vector2d.new(0, 5)
+ # vector2 = Geom::Vector2d.new(1, 0)
+ # # Returns true
+ # status = vector1.perpendicular?(vector2)
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Boolean]
#
@@ -320,8 +337,8 @@ def perpendicular?(vector)
#
# @example
# vector = Geom::Vector2d.new(1, 2)
- # # returns the Vector2d(-1, -2)
- # vector2 = vector.reverse
+ # # The result is a Vector2d(-1, -2)
+ # new_vector = vector.reverse
#
# @return [Geom::Vector2d]
#
@@ -333,7 +350,7 @@ def reverse
#
# @example
# vector = Geom::Vector2d.new(1, 2)
- # # modifies vector to be the Vector2d(-1, -2)
+ # # Modifies vector to be the Vector2d(-1, -2)
# vector.reverse!
#
# @version LayOut 2018
@@ -344,12 +361,17 @@ def reverse!
# to and in the same direction as another {Geom::Vector2d} within tolerance.
#
# @example
- # vector = Geom::Vector2d.new(0, 1)
+ # vector1 = Geom::Vector2d.new(0, 1)
# vector2 = Geom::Vector2d.new(1, 2)
- # # returns true
- # status = vector.sime_direction?(vector2)
+ # # Returns false
+ # status = vector1.same_direction?(vector2)
+ #
+ # @example
+ # vector = Geom::Vector2d.new(0, 2)
+ # # Returns true
+ # status = vector.same_direction?([0, 4])
#
- # @param [Geom::Vector2d] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
#
# @return [Boolean]
#
@@ -365,13 +387,13 @@ def same_direction?(vector)
#
# @overload set!(vector)
#
- # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
+ # @param [Geom::Vector2d, Array(Float, Float)] vector
# @return [Geom::Vector2d]
#
# @overload set!(x, y)
#
- # @param [Numeric] x
- # @param [Numeric] y
+ # @param [Float] x
+ # @param [Float] y
# @return [Geom::Vector2d]
#
# @version LayOut 2018
@@ -382,9 +404,10 @@ def set!(*args)
# Array.
#
# @example
- # a = vector.to_a
+ # vector = Geom::Vector2d.new(1, 2)
+ # array = vector.to_a
#
- # @return [Array(Numeric, Numeric)]
+ # @return [Array(Float, Float)]
#
# @version LayOut 2018
def to_a
@@ -393,8 +416,8 @@ def to_a
# The {#to_s} method returns a string representation of the {Geom::Vector2d}.
#
# @example
- # point = Geom::Vector2d.new(1, 2)
- # str = point.to_s
+ # vector = Geom::Vector2d.new(1, 2)
+ # string = vector.to_s
#
# @return [String] the string representation of the {Geom::Vector2d}
#
@@ -406,10 +429,11 @@ def to_s
# vector. The original vector is unchanged by this method.
#
# @example
- # vector = Geom::Vector2d.new(4, 5)
- # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
- # # vector2 will be (6, 8)
- # vector2 = vector.transform(transformation)
+ # vector = Geom::Vector2d.new(3, 2)
+ # point = Geom::Point2d.new(0, 1)
+ # transformation = Geom::Transformation2d.scaling(point, 2)
+ # # The result is a Vector2d(6, 4)
+ # new_vector = vector.transform(transformation)
#
# @param [Geom::Transformation2d] transform
# A transformation object to apply to the vector.
@@ -425,8 +449,9 @@ def transform(transform)
#
# @example
# vector = Geom::Vector2d.new(4, 5)
- # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
- # # vector will be (6, 8)
+ # point = Geom::Point2d.new(8, 9)
+ # transformation = Geom::Transformation2d.scaling(point, 3)
+ # # The result is a Vector2d(12, 15)
# vector.transform!(transformation)
#
# @param [Geom::Transformation2d] transform
@@ -443,8 +468,8 @@ def transform!(transform)
#
# @example
# vector = Geom::Vector2d.new(1, 0)
- # # returns true
- # status = vector.unit_vector
+ # # Returns true
+ # status = vector.unit_vector?
#
# @return [Boolean]
#
@@ -457,7 +482,7 @@ def unit_vector?
#
# @example
# vector = Geom::Vector2d.new(0, 4)
- # status = vector.valid
+ # status = vector.valid?
#
# @return [Boolean]
#
@@ -471,7 +496,7 @@ def valid?
# vector = Geom::Vector2d.new(1, 2)
# x = vector.x
#
- # @return [Numeric]
+ # @return [Float]
#
# @version LayOut 2018
def x
@@ -483,10 +508,10 @@ def x
# vector = Geom::Vector2d.new(1, 2)
# vector.x = 7
#
- # @param [Numeric] x
+ # @param [Float] x
# The desired x value of the {Geom::Vector2d}
#
- # @return [Numeric] The new x value of the {Geom::Vector2d}
+ # @return [Float] The new x value of the {Geom::Vector2d}
#
# @version LayOut 2018
def x=(x)
@@ -498,7 +523,7 @@ def x=(x)
# vector = Geom::Vector2d.new(1, 2)
# y = vector.y
#
- # @return [Numeric]
+ # @return [Float]
#
# @version LayOut 2018
def y
@@ -510,10 +535,10 @@ def y
# vector = Geom::Vector2d.new(1, 2)
# vector.y = 7
#
- # @param [Numeric] y
+ # @param [Float] y
# The desired y value of the {Geom::Vector2d}
#
- # @return [Numeric] The new y value of the {Geom::Vector2d}
+ # @return [Float] The new y value of the {Geom::Vector2d}
#
# @version LayOut 2018
def y=(y)
diff --git a/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb b/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb
index c2bb855..7925a0d 100644
--- a/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb
+++ b/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The Vector3d class is used to represent vectors in a 3 dimensional space.
@@ -16,30 +16,29 @@ class Geom::Vector3d
# at some percentage between two vectors.
#
# A linear combination is a standard term for vector math. It is defined as
- # vector = weight1 * vector1 + weight2 * vector2.
+ # vector = weight1 * vector1 + weight2 * vector2
#
# @example
- # # Create a vector that is a 50%/50% linear combination of two others.
- # vec1 = Geom::Vector3d.new 3,0,0
- # vec2 = Geom::Vector3d.new 0,3,0
- # new_vector = Geom::Vector3d.linear_combination(0.5, vec1, 0.5, vec2)
- # # new_vector will now contain a Vector3d(1.5, 1.5, 0)
+ # vector1 = Geom::Vector3d.new(3, 0, 0)
+ # vector2 = Geom::Vector3d.new(0, 3, 0)
+ # # The result is a Vector3d(1.5, 1.5, 0)
+ # new_vector = Geom::Vector3d.linear_combination(0.5, vector1, 0.5, vector2)
#
# @overload linear_combination(weight1, vector1, weight2, vector2)
#
- # @param [Numeric] weight1 A weight or percentage.
+ # @param [Float] weight1 weights
# @param [Geom::Vector3d] vector1 The first vector.
- # @param [Numeric] weight2 A weight or percentage.
+ # @param [Float] weight2 weights
# @param [Geom::Vector3d] vector2 The second vector.
# @return [Geom::Vector3d]
#
# @overload linear_combination(x, xaxis, y, yaxis, z, zaxis)
#
- # @param [Numeric] x A weight or percentage for the x axis.
+ # @param [Float] x A weight or percentage for the x axis.
# @param [Geom::Vector3d] xaxis The x axis vector.
- # @param [Numeric] y A weight or percentage for the y axis.
+ # @param [Float] y A weight or percentage for the y axis.
# @param [Geom::Vector3d] yaxis The y axis vector.
- # @param [Numeric] z A weight or percentage for the z axis.
+ # @param [Float] z A weight or percentage for the z axis.
# @param [Geom::Vector3d] zaxis The z axis vector.
# @return [Geom::Vector3d]
#
@@ -54,18 +53,19 @@ def self.linear_combination(*args)
# This is an alias of the {#dot} method.
#
# @example
- # vector1 = Geom::Vector3d.new(0, 0, 1)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # vector1 = Geom::Vector3d.new(2, 2, 1)
+ # vector2 = Geom::Vector3d.new(1, 3, 0)
+ # # The result is 8
# dot = vector1 % vector2
#
- # @param [Geom::Vector3d] vector
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Float]
#
# @see #dot
#
# @version SketchUp 6.0
- def %(vector)
+ def %(vector3d)
end
# The {#*} method is used to compute the cross product between two vectors.
@@ -77,156 +77,140 @@ def %(vector)
# This is an alias of the {#cross} method.
#
# @example
- # vector1 = Geom::Vector3d.new(1, 0, 0)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
- # vector3 = vector1 * vector2
- #
- # @example
- # vector = Geom::Vector3d.new(1, 0, 0)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
- # vector3 = vector.cross(vector2)
+ # vector1 = Geom::Vector3d.new(1, 0, 2)
+ # vector2 = Geom::Vector3d.new(3, 1, 1)
+ # # The result is a Vector3d(-2, 5, 1)
+ # cross = vector1 * vector2
#
- # @param [Geom::Vector3d] vector
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
- # @return [Geom::Vector3d] the cross of vector1 and vector2
+ # @return [Geom::Vector3d]
#
# @see #cross
#
# @version SketchUp 6.0
- def *(vector)
+ def *(vector3d)
end
- # The - method is used to add a vector to this one.
+ # The {#+} method is used to add a vector to this one.
#
# @example
- # vector = Geom::Vector3d.new(0,0,2)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # new_vector = vector + vector2
+ # vector1 = Geom::Vector3d.new(0, 0, 2)
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # new_vector = vector1 + vector2
#
- # @param vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Geom::Vector3d] the new vector.
#
# @version SketchUp 6.0
- def +(vector2)
+ def +(vector3d)
end
- # The - method is used to subtract a vector from this one.
+ # The {#-} method is used to subtract a vector from this one.
#
# @example
- # vector = Geom::Vector3d.new(0,0,2)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # new_vector = vector - vector2
+ # vector1 = Geom::Vector3d.new(0, 0, 2)
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # new_vector = vector1 - vector2
#
- # @param vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Geom::Vector3d] the new vector.
#
# @version SketchUp 6.0
- def -(vector2)
+ def -(vector3d)
end
- # The < method is used to determine if a vector's x, y or z value is less
- # than another vector's x, y or z value.
+ # The {#<} compare method is used to compare two vectors to determine if the left-hand vector is
+ # less than the right-hand vector.
#
# @example
- # vector = Geom::Vector3d.new(0,0,2)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # lt = vector < vector2
+ # vector1 = Geom::Vector3d.new(0, 1, 0)
+ # vector2 = Geom::Vector3d.new(0, 4, 2)
+ # # Returns true
+ # vector1 < vector2
#
- # @param vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
- # @return [Boolean] true if the vector's x, y or z component is less
+ # @return [Boolean] true if the vector1 is closer to origin than vector2
#
# @version SketchUp 6.0
- def <(vector2)
+ def <(vector3d)
end
- # The == method is used to determine if two vectors are equal to within
+ # The {#==} method is used to determine if two vectors are equal to within
# tolerance.
#
# @example
- # vector = Geom::Vector3d.new(1,0,0)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # status = vector == vector2
+ # vector1 = Geom::Vector3d.new(1, 0, 0)
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
# # Returns false
- # UI.messagebox status
+ # status = vector1 == vector2
#
- # @param vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Boolean]
#
# @version SketchUp 6.0
- def ==(vector2)
+ def ==(vector3d)
end
- # The [] method is used to access the coordinates of a vector as if it was an
+ # The {[]} method is used to access the coordinates of a vector as if it was an
# Array. The index must be 0, 1 or 2.
#
# The following are equivalent:
#
# @example
- # x = vector.x
+ # vector = Geom::Vector3d.new(1, 1, 0)
# x = vector[0]
#
- # @example
- # vector = Geom::Vector3d.new(1,0,0)
- # value = vector[0]
- # if (value)
- # UI.messagebox value
- # else
- # UI.messagebox "Failure"
- # end
- #
- # @param [Integer] i
+ # @param [Integer] index
# An index into an array of three coordinates.
#
# @return [Length] the value for the x, y, or z coordinate.
#
# @version SketchUp 6.0
- def [](i)
+ def [](index)
end
- # The []= method is used to set the coordinates of a vector as if it was an
+ # The {[]=} method is used to set the coordinates of a vector as if it was an
# Array. The value of i must be 0, 1 or 2.
#
# @example
- # vector[i] = coordinate
+ # vector = Geom::Vector3d.new(4, 5, 0)
+ #
+ # vector[2] = 10
#
# @param [Integer] index
# The index for the x, y, or z coordinate.
#
- # @param [Numeric] value
+ # @param [Float] value
# The value for the x, y, or z coordinate.
#
- # @return [Numeric] the newly set coordinate value
+ # @return [Float] the newly set coordinate value
#
# @version SketchUp 6.0
def []=(index, value)
end
- # The angle_between method is used to compute the angle (in radians) between
+ # The {#angle_between} method is used to compute the angle (in radians) between
# this vector and another vector.
#
# @example
- # vector1 = Geom::Vector3d.new(1,0,0)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # angle = vector1.angle_between vector2
+ # vector1 = Geom::Vector3d.new(1, 0, 0)
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # angle = vector1.angle_between(vector2)
#
- # @param [Geom::Vector3d] vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Float] an angle (in radians)
#
# @version SketchUp 6.0
- def angle_between(vector2)
+ def angle_between(vector3d)
end
- # The axes method is used to compute an arbitrary set of axes with the given
+ # The {#axes} method is used to compute an arbitrary set of axes with the given
# vector as the z-axis direction.
#
# Returns an Array of three vectors [xaxis, yaxis, zaxis]
@@ -234,8 +218,8 @@ def angle_between(vector2)
# Vector3d objects
#
# @example
- # vector = Geom::Vector3d.new(1,0,0)
- # a = vector.axes
+ # vector = Geom::Vector3d.new(1, 0, 0)
+ # array = vector.axes
#
# @return [Array(Geom::Vector3d, Geom::Vector3d, Geom::Vector3d)] an Array object containing three
#
@@ -243,13 +227,11 @@ def angle_between(vector2)
def axes
end
- # The clone method is used to make a copy of a vector.
- #
- # This method is equivalent to vec2 = Geom::Vector3d.new(vec)
+ # The {#clone} method is used to make a copy of a vector.
#
# @example
- # vector = Geom::Vector3d.new(1,0,0)
- # vector2 = vector.clone
+ # vector = Geom::Vector3d.new(1, 0, 0)
+ # new_vector = vector.clone
#
# @return [Geom::Vector3d] a Vector3d object which is the clone of
# vector
@@ -265,52 +247,46 @@ def clone
# perpendicular to the plane in which the first two lie.
#
# @example
- # vector1 = Geom::Vector3d.new(1, 0, 0)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
- # vector3 = vector1 * vector2
- #
- # @example
- # vector = Geom::Vector3d.new(1, 0, 0)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
- # vector3 = vector.cross(vector2)
+ # vector1 = Geom::Vector3d.new(1, 2, 0)
+ # vector2 = Geom::Vector3d.new(5, 1, 3)
+ # # The result is a Vector3d(6, -3, -9)
+ # cross = vector1.cross(vector2)
#
- # @param [Geom::Vector3d] vector
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
- # @return [Geom::Vector3d] the cross of vector1 and vector2
+ # @return [Geom::Vector3d]
#
# @see #*
#
# @version SketchUp 6.0
- def cross(vector)
+ def cross(vector3d)
end
# The {#dot} method is used to compute the dot product between two vectors.
#
# @example
- # vector1 = Geom::Vector3d.new(0, 0, 1)
- # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # vector1 = Geom::Vector3d.new(0, 5, 1)
+ # vector2 = Geom::Vector3d.new(0, 1, 2)
+ # # The result is 7
# dot = vector1.dot(vector2)
#
- # @param [Geom::Vector3d] vector
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Float]
#
# @see #%
#
# @version SketchUp 6.0
- def dot(vector)
+ def dot(vector3d)
end
# The new method is used to create a new vector.
#
# @example
# # A vector that runs up the Z axis.
- # vector = Geom::Vector3d.new(0,0,1)
- # if (vector)
- # UI.messagebox vector
- # else
- # UI.messagebox "Failure"
- # end
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
+ #
+ # vector2 = Geom::Vector3d.new([1, 1])
#
# @overload initialize
#
@@ -318,19 +294,19 @@ def dot(vector)
#
# @overload initialize(x, y, z)
#
- # @param [Numeric] x
- # @param [Numeric] y
- # @param [Numeric] z
+ # @param [Float] x
+ # @param [Float] y
+ # @param [Float] z
# @return [Geom::Vector3d]
#
# @overload initialize(array3d)
#
- # @param [Array(Numeric, Numeric, Numeric)] array3d
+ # @param [Array(Float, Float, Float)] array3d
# @return [Geom::Vector3d]
#
# @overload initialize(array2d)
#
- # @param [Array(Numeric, Numeric)] array2d
+ # @param [Array(Float, Float)] array2d
# @return [Geom::Vector3d]
#
# @overload initialize(vector)
@@ -342,13 +318,12 @@ def dot(vector)
def initialize(*args)
end
- # The inspect method is used to inspect the contents of a vector as a
+ # The {#inspect} method is used to inspect the contents of a vector as a
# friendly string.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # out_string = vector.inspect
- # puts out_string
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # string = vector.inspect
#
# @return [Geom::Vector3d] the Vector3d object
#
@@ -356,11 +331,11 @@ def initialize(*args)
def inspect
end
- # The length method is used to retrieve the length of the vector.
+ # The {#length} method is used to retrieve the length of the vector.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # l = vector.length
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # length = vector.length
#
# @return [Length] the length of the vector
#
@@ -368,30 +343,28 @@ def inspect
def length
end
- # The length= method is used to set the length of the vector. The length must
+ # The {#length=} method is used to set the length of the vector. The length must
# be greater than 0.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # l = vector.length
- # UI.messagebox(l)
- # newl = vector.length = 2
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # vector.length = 2
#
- # @param [Numeric] length
+ # @param [Float] length
# A length for the vector.
#
- # @return [Numeric] a newly set length
+ # @return [Length] a newly set length
#
# @version SketchUp 6.0
def length=(length)
end
- # The normalize method is used to return a vector that is a unit vector
+ # The {#normalize} method is used to return a vector that is a unit vector
# of another.
#
# @example
- # vector = Geom::Vector3d.new(0,0,2)
- # vector2 = vector.normalize
+ # vector = Geom::Vector3d.new(0, 0, 2)
+ # new_vector = vector.normalize
#
# @return [Geom::Vector3d] a new normalized Vector3d object
#
@@ -399,13 +372,13 @@ def length=(length)
def normalize
end
- # The normalize! method is used to convert a vector into a unit vector,
+ # The {#normalize!} method is used to convert a vector into a unit vector,
# in place.
#
- # Another way to do this is vec.length = 1
+ # Another way to do this is +vector.length = 1.0+
#
# @example
- # vector = Geom::Vector3d.new(0,0,2)
+ # vector = Geom::Vector3d.new(0, 0, 2)
# vector.normalize!
#
# @return [Geom::Vector3d] a normalized Vector3d object
@@ -414,100 +387,97 @@ def normalize
def normalize!
end
- # The parallel method is used to determine if this vector is parallel to
- # another vector to within tolerance.
+ # The {#parallel?} method determines if two {Geom::Vector3d}s are parallel within a
+ # tolerance. Two vectors are parallel if there exists a scalar multiple between them.
#
# @example
- # status = vector.parallel?(vector2)
+ # vector1 = Geom::Vector3d.new(1, 2, 4)
+ # vector2 = Geom::Vector3d.new(2, 4, 8)
+ # # Returns true
+ # status = vector1.parallel?(vector2)
#
- # @param [Geom::Vector3d] vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Boolean]
#
# @version SketchUp 6.0
- def parallel?(vector2)
+ def parallel?(vector3d)
end
- # The perpendicular? method is used to determine if this vector is
- # perpendicular to another vector to within tolerance.
+ # The {#perpendicular?} method determines if two Geom::Vector3ds are perpendicular within a
+ # tolerance. Two vectors are considered perpendicular if their dot product is zero.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # status = vector.perpendicular?(vector2)
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
+ # status = vector1.perpendicular?(vector2)
#
- # @param [Geom::Vector3d] vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Boolean]
#
# @version SketchUp 6.0
- def perpendicular?(vector2)
+ def perpendicular?(vector3d)
end
- # The reverse method is used to return a new vector that is the reverse
+ # The {#reverse} method is used to return a new vector that is the reverse
# of this vector, while leaving the original unchanged.
#
# @example
- # vector2 = vector.reverse
+ # vector = Geom::Vector3d.new(3, 1, 0)
+ # new_vector = vector.reverse
#
- # @return [Geom::Vector3d] a Vector3d object that is the reverse of
- # vector
+ # @return [Geom::Vector3d] a reverse Vector3d object
#
# @version SketchUp 6.0
def reverse
end
- # The reverse! method is used to reverse the vector in place.
+ # The {#reverse!} method is used to reverse the vector in place.
#
# @example
+ # vector = Geom::Vector3d.new(3, 1, 0)
# vector.reverse!
#
- # @return [Geom::Vector3d] a Vector3d object that is the reverse of
- # vector
+ # @return [Geom::Vector3d] a reverse Vector3d object
#
# @version SketchUp 6.0
def reverse!
end
- # The samedirection? method is used to determine if this vector is parallel to
+ # The {#samedirection?} method is used to determine if this vector is parallel to
# and in the same direction as another vector to within tolerance.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # vector2 = Geom::Vector3d.new(0,1,0)
- # status = vector.samedirection?(vector2)
+ # vector1 = Geom::Vector3d.new(2, 4, 1)
+ # vector2 = Geom::Vector3d.new(2, 0, 1)
+ # # Returns false
+ # status = vector1.samedirection?(vector2)
#
- # @param [Geom::Vector3d] vector2
- # A Vector3d object.
+ # @param [Geom::Vector3d, Array(Float, Float, Float)] vector3d
#
# @return [Boolean]
#
# @version SketchUp 6.0
- def samedirection?(vector2)
+ def samedirection?(vector3d)
end
- # The set! method is used to set the coordinates of the vector.
+ # The {#set!} method is used to set the coordinates of the vector.
#
# @example This is a shortcut for writing:
- # vec.x = x
- # vec.y = y
- # vec.z = z
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # vector.x = 2
+ # vector.y = 4
+ # vector.z = 0
#
# @example You may also call this method with an array or another vector:
- # vec.set!(x, y, z)
- # vec.set!([x, y, z])
- # vec.set!(vec2)
+ # vector1 = Geom::Vector3d.new
+ # vector2 = Geom::Vector3d.new(2, 4, 0)
+ # vector1.set!(vector2)
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # vector.set! 1,0,0
- #
- # @overload set!(array3d)
- #
- # @param [Array(Numeric, Numeric, Numeric)] array3d
- # @return [Geom::Vector3d]
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # vector.set!(2, 4, 0) # is equivalent to vector.set!([2, 4, 0])
#
# @overload set!(vector)
#
@@ -516,33 +486,37 @@ def samedirection?(vector2)
#
# @overload set!(x, y, z)
#
- # @param [Numeric] x
- # @param [Numeric] y
- # @param [Numeric] z
+ # @param [Float] x
+ # @param [Float] y
+ # @param [Float] z
+ # @return [Geom::Vector3d]
+ #
+ # @overload set!(array3d)
+ #
+ # @param [Array(Float, Float, Float)] array3d
# @return [Geom::Vector3d]
#
# @version SketchUp 6.0
def set!(*args)
end
- # The to_a method retrieves the coordinates of the vector in an Array
- # [x, y, z].
+ # The {#to_a} method retrieves the coordinates of the vector in an Array[x, y, z].
#
# @example
- # a = vector.to_a
+ # vector = Geom::Vector3d.new(3, 0, 6)
+ # array = vector.to_a
#
- # @return [Array(Length, Length, Length)] the coordinates of the vector in an array
+ # @return [Array(Float, Float, Float)] the coordinates of the vector in an array
#
# @version SketchUp 6.0
def to_a
end
- # The to_s method is used to format the vector as a String.
+ # The {#to_s} method is used to format the vector as a String.
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
- # out_string = vector.to_s
- # puts out_string
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # string = vector.to_s
#
# @return [String] a string representation of vector
#
@@ -550,11 +524,15 @@ def to_a
def to_s
end
- # Apply a Transformation to a vector, returning a new vector. The original
- # vector is unchanged by this method.
+ # The {#transform} method applies a Transformation to a vector, returning a new vector. The
+ # original vector is unchanged by this method.
#
# @example
- # vector2 = vector.transform(transformation)
+ # vector = Geom::Vector3d.new(0, 2, 1)
+ # point = Geom::Point3d.new(2, 3, 1)
+ # transformation = Geom::Transformation.scaling(point, 2)
+ # # The result is a Vector3d(0, 4, 2)
+ # new_vector = vector.transform(transformation)
#
# @param [Geom::Transformation] transform
# A Transformation object to apply to the vector.
@@ -565,9 +543,13 @@ def to_s
def transform(transform)
end
- # Apply a Transformation to a vector. The vector itself is modified.
+ # The {#transform!} method applies a Transformation to a vector. The vector itself is modified.
#
# @example
+ # vector = Geom::Vector3d.new(0, 2, 1)
+ # point = Geom::Point3d.new(2, 3, 1)
+ # transformation = Geom::Transformation.scaling(point, 2)
+ # # The result is a Vector3d(0, 4, 2)
# vector.transform!(transformation)
#
# @param [Geom::Transformation] transform
@@ -579,12 +561,13 @@ def transform(transform)
def transform!(transform)
end
- # The unitvector? method is used to see if the vector is a unit vector.
+ # The {#unitvector?} method is used to see if the vector is a unit vector.
#
- # This is equivalent to vec.length == 1.0
+ # This is equivalent to +vector.length == 1.0+
#
# @example
- # vector = Geom::Vector3d.new(0,0,1)
+ # vector = Geom::Vector3d.new(0, 0, 1)
+ # # Return false
# status = vector.unitvector?
#
# @return [Boolean]
@@ -593,15 +576,16 @@ def transform!(transform)
def unitvector?
end
- # The valid? method is used to verify if a vector is valid. A vector is valid
+ # The {#valid?} method is used to verify if a vector is valid. A vector is valid
# if its length is not zero.
#
# @example
# # A zero length vector will be invalid
- # vector = Geom::Vector3d.new(0,0,0)
+ # vector = Geom::Vector3d.new
# status = vector.valid?
+ #
# # A non-zero length vector is valid
- # vector = Geom::Vector3d.new(0,0,1)
+ # vector = Geom::Vector3d.new(0, 0, 1)
# status = vector.valid?
#
# @return [Boolean]
@@ -610,81 +594,82 @@ def unitvector?
def valid?
end
- # The x method is used to retrieve the x coordinate of the vector.
+ # The {#x} method is used to retrieve the x coordinate of the vector.
#
# @example
+ # vector = Geom::Vector3d.new(1, 2, 3)
# x = vector.x
#
- # @return [Length] the x coordinate of the vector
+ # @return [Float] the x coordinate of the vector
#
# @version SketchUp 6.0
def x
end
- # The x= method is used to set the x coordinate of the vector.
+ # The {#x=} method is used to set the x coordinate of the vector.
#
# @example
- # vector = Geom::Vector3d.new 1,2,3
- # x = vector.x = 10
+ # vector = Geom::Vector3d.new(1, 2, 3)
+ # vector.x = 10
#
- # @param [Numeric] x
+ # @param [Float] x
# The x coordinate for the vector.
#
- # @return [Numeric] the newly set x coordinate for the vector
+ # @return [Float] the newly set x coordinate for the vector
#
# @version SketchUp 6.0
def x=(x)
end
- # The y method is used to retrieve the y coordinate of the vector.
+ # The {#y} method is used to retrieve the y coordinate of the vector.
#
# @example
- # vector = Geom::Vector3d.new(1,2,3)
+ # vector = Geom::Vector3d.new(1, 2, 3)
# y = vector.y
#
- # @return [Length] the y coordinate of the vector
+ # @return [Float] the y coordinate of the vector
#
# @version SketchUp 6.0
def y
end
- # Set the y coordinate of the vector.
+ # Set the {#y=} coordinate of the vector.
#
# @example
- # vector = Geom::Vector3d.new(1,2,3)
- # y = vector.y = 10
+ # vector = Geom::Vector3d.new(1, 2, 3)
+ # vector.y = 10
#
- # @param [Numeric] y
+ # @param [Float] y
# The y coordinate for the vector.
#
- # @return [Numeric] the newly set y coordinate for the vector
+ # @return [Float] the newly set y coordinate for the vector
#
# @version SketchUp 6.0
def y=(y)
end
- # Get the z coordinate of the vector.
+ # Get the {#z} coordinate of the vector.
#
# @example
- # vector = Geom::Vector3d.new(1,2,3)
+ # vector = Geom::Vector3d.new(1, 2, 3)
# z = vector.z
#
- # @return [Length] the z coordinate of the vector
+ # @return [Float] the z coordinate of the vector
#
# @version SketchUp 6.0
def z
end
- # Set the z coordinate of the vector.
+ # Set the {#z=} coordinate of the vector.
#
# @example
- # vector = Geom::Vector3d.new(1,2,3)
- # z = vector.z = 10
+ # vector = Geom::Vector3d.new(1, 2, 3)
+ # vector.z = 10
#
- # @param [Numeric] z
+ # @param [Float] z
# The z coordinate for the vector.
#
- # @return [Numeric] the newly set z coordinate for the vector
+ # @return [Float] the newly set z coordinate for the vector
#
# @version SketchUp 6.0
def z=(z)
diff --git a/lib/sketchup-api-stubs/stubs/LanguageHandler.rb b/lib/sketchup-api-stubs/stubs/LanguageHandler.rb
index 5a6eb26..aba9068 100644
--- a/lib/sketchup-api-stubs/stubs/LanguageHandler.rb
+++ b/lib/sketchup-api-stubs/stubs/LanguageHandler.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The LanguageHandler class contains methods used to help make SketchUp
diff --git a/lib/sketchup-api-stubs/stubs/Layout.rb b/lib/sketchup-api-stubs/stubs/Layout.rb
index 5c8b161..97ca327 100644
--- a/lib/sketchup-api-stubs/stubs/Layout.rb
+++ b/lib/sketchup-api-stubs/stubs/Layout.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The LayOut module is the root of the LayOut Ruby API. Many of the classes in
diff --git a/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb b/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb
index 393924f..58d49d6 100644
--- a/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb
+++ b/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# References an angular dimension entity. An {Layout::AngularDimension} is
diff --git a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb
index c5f2e2c..72f1337 100644
--- a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb
+++ b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# References an auto-text definition. Some auto-text definitions are mandatory.
@@ -451,8 +451,8 @@ def number_style=(number_style)
# [+Layout::AutoTextDefinition::NUMBER_STYLE_LC_ROMAN+]
#
# @deprecated LayOut 2022.0 This method is deprecated in favor of the more generic {#number_style}
- # method that also works on +Layout::AutoTextDefintion::TYPE_PAGE_COUNT+ and
- # +Layout::AutoTextDefintion::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
+ # method that also works on +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+ and
+ # +Layout::AutoTextDefinition::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
#
# @example
# doc = Layout::Document.open("C:/path/to/document.layout")
@@ -460,7 +460,9 @@ def number_style=(number_style)
# Layout::AutoTextDefinition::TYPE_PAGE_NUMBER) number_style = page_number_def.number_style
#
# @raise [ArgumentError] if the {Layout::AutoTextDefinition}'s type is not
- # +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+.
+ # +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+,
+ # +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+, or
+ # +Layout::AutoTextDefinition::TYPE_SEQUENCE+.
#
# @return [Integer]
#
@@ -480,8 +482,8 @@ def page_number_style
# [+Layout::AutoTextDefinition::NUMBER_STYLE_LC_ROMAN+]
#
# @deprecated LayOut 2022.0 This method is deprecated in favor of the more generic {#number_style=}
- # method that also works on +Layout::AutoTextDefintion::TYPE_PAGE_COUNT+ and
- # +Layout::AutoTextDefintion::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
+ # method that also works on +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+ and
+ # +Layout::AutoTextDefinition::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
#
# @example
# doc = Layout::Document.open("C:/path/to/document.layout")
@@ -492,7 +494,9 @@ def page_number_style
# @param [Integer] number_style
#
# @raise [ArgumentError] if the {Layout::AutoTextDefinition}'s type is not
- # +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+.
+ # +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+,
+ # +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+, or
+ # +Layout::AutoTextDefinition::TYPE_SEQUENCE+.
#
# @raise [ArgumentError] if +number_style+ is not a valid page numbering style
#
diff --git a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb
index fdd6a2b..c9fe741 100644
--- a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb
+++ b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# The AutoTextDefinitions class is a container class for all
diff --git a/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb b/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb
index feabc2f..731520f 100644
--- a/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb
+++ b/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2024 Trimble Inc.
+# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)
# This is the interface to a LayOut Connection Point. A
diff --git a/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb b/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb
new file mode 100644
index 0000000..1380eb3
--- /dev/null
+++ b/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb
@@ -0,0 +1,234 @@
+# Copyright:: Copyright 2026 Trimble Inc.
+# License:: The MIT License (MIT)
+
+# This is the interface to a LayOut dictionary. A {Layout::Dictionary} wraps key/value pairs.
+#
+# @example
+# dict = Layout::Dictionary.new
+#
+# @version LayOut 2026.0
+class Layout::Dictionary
+
+ # Includes
+
+ include Enumerable
+
+ # Instance Methods
+
+ # The {#[]} method retrieves the value for a given key.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary['test'] = 115
+ #
+ # # value will contain 115
+ # value = dictionary["test"]
+ #
+ # @param [String] key
+ # The name of the attribute.
+ #
+ # @return [String, Boolean, Integer, Float, Layout::Dictionary, nil]
+ #
+ # @version LayOut 2026.0
+ def [](key)
+ end
+
+ # The {#[]=} method sets a value for a given key.
+ #
+ # Creates a new dictionary entry for the given key if needed.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary['test'] = 110
+ # value = dictionary['test2'] = 120
+ # p value
+ #
+ # @param [String] key
+ # The valid key.
+ #
+ # @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] value
+ #
+ # @version LayOut 2026.0
+ def []=(key, value)
+ end
+
+ # The {#delete_key} method deletes a key/value pair from the dictionary.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # Delete a key/value pair and get the deleted value.
+ # value = dictionary.delete_key("attr_one")
+ #
+ # @param [String] key
+ # The key to be deleted.
+ #
+ # @return [String, Boolean, Integer, Float, Layout::Dictionary, nil]
+ #
+ # @version LayOut 2026.0
+ def delete_key(key)
+ end
+
+ # The {#each_pair} method is an alias for {#each}.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # iterates through all attributes and prints the key to the screen
+ # dictionary.each_pair { | key, value |
+ # puts "#{key} = #{value}"
+ # }
+ #
+ # @see #each
+ #
+ # @version LayOut 2026.0
+ #
+ # @yield [key, value]
+ #
+ # @yieldparam [String] key
+ #
+ # @yieldparam [Object] value
+ def each
+ end
+
+ # The {#each_key} method iterates through all of the dictionary keys.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # iterates through all attributes and prints the key to the screen
+ # dictionary.each_key { |key| puts key }
+ #
+ # @version LayOut 2026.0
+ #
+ # @yieldparam [String] key
+ def each_key
+ end
+
+ # The {#each_pair} method is an alias for {#each}.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # iterates through all attributes and prints the key to the screen
+ # dictionary.each_pair { | key, value |
+ # puts "#{key} = #{value}"
+ # }
+ #
+ # @see #each
+ #
+ # @version LayOut 2026.0
+ #
+ # @yield [key, value]
+ #
+ # @yieldparam [String] key
+ #
+ # @yieldparam [Object] value
+ def each_pair
+ end
+
+ # The {#empty?} method checks if the dictionary is empty.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attribute_one"] = "1"
+ # dictionary.empty? # Returns false
+ #
+ # @return [Boolean]
+ #
+ # @version LayOut 2026.0
+ def empty?
+ end
+
+ # The {#initialize} method creates a new {Layout::Dictionary}.
+ #
+ # @example
+ # doc = Layout::Dictionary.new
+ # doc2 = Layout::Dictionary.new({"String key" => "string value", "Number key" => 42})
+ #
+ # @overload initialize
+ #
+ # @return [Layout::Dictionary]
+ #
+ # @overload initialize(dict)
+ #
+ # @param [Hash, Layout::Dictionary] hash
+ # @return [Layout::Dictionary]
+ #
+ # @raise [ArgumentError] if dict isn't a dictionary or hash
+ #
+ # @version LayOut 2026.0
+ def initialize(*args)
+ end
+
+ # The {#keys} method retrieves an array with all of the dictionary keys.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # Gets an array of keys
+ # keys = dictionary.keys
+ #
+ # @return [Array] an array of keys within the dictionary if successful
+ #
+ # @version LayOut 2026.0
+ def keys
+ end
+
+ # The {#length} method retrieves the size (number of elements) of a dictionary.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary['Hello'] = 'World'
+ # number = dictionary.length
+ #
+ # @return [Integer]
+ #
+ # @see #size
+ #
+ # @version LayOut 2026.0
+ def length
+ end
+
+ # The {#length} method retrieves the size (number of elements) of a dictionary.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary['Hello'] = 'World'
+ # number = dictionary.length
+ #
+ # @return [Integer]
+ #
+ # @see #size
+ #
+ # @version LayOut 2026.0
+ def size
+ end
+
+ # The {#values} method retrieves an array with all of the dictionary values.
+ #
+ # @example
+ # dictionary = Layout::Dictionary.new
+ # dictionary["attr_one"] = "one"
+ # dictionary["attr_two"] = "two"
+ #
+ # # Gets an array of values
+ # values = dictionary.values
+ #
+ # @return [Array