sketchup-api-stubs 0.7.10 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +6 -0
- data/lib/sketchup-api-stubs/stubs/Array.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +25 -15
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +17 -32
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +62 -39
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +136 -104
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +56 -30
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +76 -52
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +35 -31
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +8 -16
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +135 -110
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +207 -222
- data/lib/sketchup-api-stubs/stubs/Geom.rb +6 -6
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +11 -7
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +124 -10
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +112 -4
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +56 -9
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +100 -1
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +13 -14
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +5 -3
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +47 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Length.rb +9 -1
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +65 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +2 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +16 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +13 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +8 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +10 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +28 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +15 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +7 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +4 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +17 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +17 -17
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +11 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +59 -19
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +3 -6
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +94 -25
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +16 -26
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +24 -17
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +11 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +4 -67
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +34 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +4 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +14 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +3 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -19
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +10 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +831 -130
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +35 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +146 -88
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +20 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +14 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +17 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +1 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +158 -16
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +48 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +61 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +13 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +84 -91
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +9 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +20 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +59 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +29 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +13 -31
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +9 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +229 -139
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +23 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +336 -99
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +34 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +71 -36
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/String.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +21 -9
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +80 -5
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +14 -3
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +20 -3
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +9 -6
- data/lib/sketchup-api-stubs/stubs/UI.rb +77 -14
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +7 -7
- metadata +10 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce48bf908bfd9e91aae631e26262a1c873fb9bfe1f69398f324eca2fbed29997
|
|
4
|
+
data.tar.gz: 99704ab5d21b6eeaf4b90bd149ea79f30a4ad83180b964b396cacd9c0430cd75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4355b2185598fe0b3b164a0e1df5d2c74d0ad9cf2c9ada54eed6d30a16bac04fde6cfe0905396e78d1b51be51c2c13d387d8d25f26611406f4eeb263326c367
|
|
7
|
+
data.tar.gz: 1b23aa71bbe0cf30b6d39ce68a851a2ce1baaac29ab75b0119ba0d9aec451553cdc53db886fbe92647baac6660e0202ac6760806f9121a0b04b18f07c251085a
|
|
@@ -21,6 +21,7 @@ require 'sketchup-api-stubs/stubs/Layout/AngularDimension.rb'
|
|
|
21
21
|
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb'
|
|
22
22
|
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb'
|
|
23
23
|
require 'sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb'
|
|
24
|
+
require 'sketchup-api-stubs/stubs/Layout/Dictionary.rb'
|
|
24
25
|
require 'sketchup-api-stubs/stubs/Layout/Document.rb'
|
|
25
26
|
require 'sketchup-api-stubs/stubs/Layout/Ellipse.rb'
|
|
26
27
|
require 'sketchup-api-stubs/stubs/Layout/Entities.rb'
|
|
@@ -82,6 +83,9 @@ require 'sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb'
|
|
|
82
83
|
require 'sketchup-api-stubs/stubs/Sketchup/Entities.rb'
|
|
83
84
|
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb'
|
|
84
85
|
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb'
|
|
86
|
+
require 'sketchup-api-stubs/stubs/Sketchup/Environment.rb'
|
|
87
|
+
require 'sketchup-api-stubs/stubs/Sketchup/Environments.rb'
|
|
88
|
+
require 'sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb'
|
|
85
89
|
require 'sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb'
|
|
86
90
|
require 'sketchup-api-stubs/stubs/Sketchup/Face.rb'
|
|
87
91
|
require 'sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb'
|
|
@@ -103,6 +107,7 @@ require 'sketchup-api-stubs/stubs/Sketchup/Licensing.rb'
|
|
|
103
107
|
require 'sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb'
|
|
104
108
|
require 'sketchup-api-stubs/stubs/Sketchup/LineStyle.rb'
|
|
105
109
|
require 'sketchup-api-stubs/stubs/Sketchup/LineStyles.rb'
|
|
110
|
+
require 'sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb'
|
|
106
111
|
require 'sketchup-api-stubs/stubs/Sketchup/Loop.rb'
|
|
107
112
|
require 'sketchup-api-stubs/stubs/Sketchup/Material.rb'
|
|
108
113
|
require 'sketchup-api-stubs/stubs/Sketchup/Materials.rb'
|
|
@@ -129,6 +134,7 @@ require 'sketchup-api-stubs/stubs/Sketchup/Set.rb'
|
|
|
129
134
|
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
|
|
130
135
|
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
|
|
131
136
|
require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
|
|
137
|
+
require 'sketchup-api-stubs/stubs/Sketchup/Snap.rb'
|
|
132
138
|
require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
|
|
133
139
|
require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
|
|
134
140
|
require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
|
|
@@ -141,7 +141,7 @@ class Geom::BoundingBox
|
|
|
141
141
|
# boundingbox.add([100, 200, -400], [200, 400, 100])
|
|
142
142
|
# # This will return Point3d(100, 200, -400).
|
|
143
143
|
# boundingbox.corner(0)
|
|
144
|
-
# # This will return Point3d(100,
|
|
144
|
+
# # This will return Point3d(100, 400, 100).
|
|
145
145
|
# boundingbox.corner(6)
|
|
146
146
|
#
|
|
147
147
|
# @param [Integer] corner_index
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The bounds2d class represents an axis aligned bounding box represented by
|
|
@@ -14,7 +14,10 @@ class Geom::Bounds2d
|
|
|
14
14
|
# checks whether the point values are the same
|
|
15
15
|
#
|
|
16
16
|
# @example
|
|
17
|
-
#
|
|
17
|
+
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 5.0, 5.0)
|
|
18
|
+
# bounds2 = Geom::Bounds2d.new([0, 0], [5, 5])
|
|
19
|
+
# # Return true
|
|
20
|
+
# bounds1 == bounds2
|
|
18
21
|
#
|
|
19
22
|
# @param [Geom::Bounds2d] other
|
|
20
23
|
#
|
|
@@ -27,10 +30,10 @@ class Geom::Bounds2d
|
|
|
27
30
|
# The {#height} method returns the height of the {Geom::Bounds2d}.
|
|
28
31
|
#
|
|
29
32
|
# @example
|
|
30
|
-
# bounds = Geom::Bounds2d.new(
|
|
33
|
+
# bounds = Geom::Bounds2d.new(5.0, 5.0, 1.0, 7.0)
|
|
31
34
|
# height = bounds.height
|
|
32
35
|
#
|
|
33
|
-
# @return [
|
|
36
|
+
# @return [Float]
|
|
34
37
|
#
|
|
35
38
|
# @version LayOut 2018
|
|
36
39
|
def height
|
|
@@ -39,7 +42,11 @@ class Geom::Bounds2d
|
|
|
39
42
|
# The {#initialize} method creates a new {Geom::Bounds2d}.
|
|
40
43
|
#
|
|
41
44
|
# @example
|
|
42
|
-
#
|
|
45
|
+
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
|
|
46
|
+
#
|
|
47
|
+
# upper_left = Geom::Point2d.new(1, 1) # is equivalent to upper_left = [1, 1]
|
|
48
|
+
# lower_right = Geom::Point2d.new(3, 3) # is equivalent to lower_right = [3, 3]
|
|
49
|
+
# bounds2 = Geom::Bounds2d.new(upper_left, lower_right)
|
|
43
50
|
#
|
|
44
51
|
# @overload initialize(other_bounds)
|
|
45
52
|
#
|
|
@@ -80,8 +87,9 @@ class Geom::Bounds2d
|
|
|
80
87
|
# corner of the {Geom::Bounds2d}.
|
|
81
88
|
#
|
|
82
89
|
# @example
|
|
83
|
-
# bounds = Geom::Bounds2d.new(
|
|
84
|
-
#
|
|
90
|
+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
|
|
91
|
+
# # The result is a Point2d(3, 3)
|
|
92
|
+
# lower_right = bounds.lower_right
|
|
85
93
|
#
|
|
86
94
|
# @return [Geom::Point2d]
|
|
87
95
|
#
|
|
@@ -89,8 +97,9 @@ class Geom::Bounds2d
|
|
|
89
97
|
def lower_right
|
|
90
98
|
end
|
|
91
99
|
|
|
92
|
-
# The {#set!} method
|
|
93
|
-
# The argument is anything that can be converted into a
|
|
100
|
+
# The {#set!} method is used to update the dimensions and position of a {Geom::Bounds2d} object so
|
|
101
|
+
# that it matches the specified bounds. The argument is anything that can be converted into a
|
|
102
|
+
# {Geom::Bounds2d}.
|
|
94
103
|
#
|
|
95
104
|
# @example
|
|
96
105
|
# bounds = Geom::Bounds2d.new(3.0, 3.0, 5.0, 5.0)
|
|
@@ -131,11 +140,11 @@ class Geom::Bounds2d
|
|
|
131
140
|
def set!(*args)
|
|
132
141
|
end
|
|
133
142
|
|
|
134
|
-
# The {#to_a} method returns an array which contains the {Geom::Point2d} that
|
|
143
|
+
# The {#to_a} method returns an array which contains the {Geom::Point2d}s that
|
|
135
144
|
# define the {Geom::Bounds2d}.
|
|
136
145
|
#
|
|
137
146
|
# @example
|
|
138
|
-
# bounds = Geom::Bounds2d.new
|
|
147
|
+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 5.0, 5.0)
|
|
139
148
|
# bounds.to_a.each { |point| p point.to_s }
|
|
140
149
|
#
|
|
141
150
|
# @return [Array(Geom::Point2d, Geom::Point2d)]
|
|
@@ -148,8 +157,9 @@ class Geom::Bounds2d
|
|
|
148
157
|
# of the {Geom::Bounds2d}.
|
|
149
158
|
#
|
|
150
159
|
# @example
|
|
151
|
-
# bounds = Geom::Bounds2d.new(
|
|
152
|
-
#
|
|
160
|
+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
|
|
161
|
+
# # The result is a Point2d(2, 2)
|
|
162
|
+
# upper_left = bounds.upper_left
|
|
153
163
|
#
|
|
154
164
|
# @return [Geom::Point2d]
|
|
155
165
|
#
|
|
@@ -160,10 +170,10 @@ class Geom::Bounds2d
|
|
|
160
170
|
# The {#width} method returns the width of the {Geom::Bounds2d}.
|
|
161
171
|
#
|
|
162
172
|
# @example
|
|
163
|
-
# bounds = Geom::Bounds2d.new(
|
|
173
|
+
# bounds = Geom::Bounds2d.new(5.0, 5.0, 7.0, 1.0)
|
|
164
174
|
# width = bounds.width
|
|
165
175
|
#
|
|
166
|
-
# @return [
|
|
176
|
+
# @return [Float]
|
|
167
177
|
#
|
|
168
178
|
# @version LayOut 2018
|
|
169
179
|
def width
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The LatLong class contains various methods for creating and manipulating
|
|
@@ -12,13 +12,13 @@ class Geom::LatLong
|
|
|
12
12
|
# The new method creates a LatLong object.
|
|
13
13
|
#
|
|
14
14
|
# @example
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
15
|
+
# # No arguments, creates a latlong with (0, 0)
|
|
16
|
+
# latlong1 = Geom::LatLong.new
|
|
17
|
+
#
|
|
18
|
+
# latlong2 = Geom::LatLong.new(40.01700, 105.28300)
|
|
19
|
+
#
|
|
20
|
+
# array = [40.01700, 105.28300]
|
|
21
|
+
# latlong3 = Geom::LatLong.new(array)
|
|
22
22
|
#
|
|
23
23
|
# @overload initialize
|
|
24
24
|
#
|
|
@@ -36,8 +36,8 @@ class Geom::LatLong
|
|
|
36
36
|
#
|
|
37
37
|
# @overload initialize(lat, long)
|
|
38
38
|
#
|
|
39
|
-
# @param [Numeric]
|
|
40
|
-
# @param [Numeric]
|
|
39
|
+
# @param [Numeric] latitude
|
|
40
|
+
# @param [Numeric] longitude
|
|
41
41
|
# @return [Geom::LatLong]
|
|
42
42
|
#
|
|
43
43
|
# @version SketchUp 6.0
|
|
@@ -47,14 +47,9 @@ class Geom::LatLong
|
|
|
47
47
|
# The Latitude method retrieves the latitude coordinate from a LatLong object.
|
|
48
48
|
#
|
|
49
49
|
# @example
|
|
50
|
-
#
|
|
51
|
-
#
|
|
50
|
+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
|
|
51
|
+
# # The result is 40.01700
|
|
52
52
|
# latitude = latlong.latitude
|
|
53
|
-
# if (latitude)
|
|
54
|
-
# UI.messagebox(latitude)
|
|
55
|
-
# else
|
|
56
|
-
# UI.messagebox("Failure")
|
|
57
|
-
# end
|
|
58
53
|
#
|
|
59
54
|
# @return [Float] a latitude coordinate value
|
|
60
55
|
#
|
|
@@ -66,14 +61,9 @@ class Geom::LatLong
|
|
|
66
61
|
# object.
|
|
67
62
|
#
|
|
68
63
|
# @example
|
|
69
|
-
#
|
|
70
|
-
#
|
|
64
|
+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
|
|
65
|
+
# # The result is 105.28300
|
|
71
66
|
# longitude = latlong.longitude
|
|
72
|
-
# if (longitude)
|
|
73
|
-
# UI.messagebox(longitude)
|
|
74
|
-
# else
|
|
75
|
-
# UI.messagebox("Failure")
|
|
76
|
-
# end
|
|
77
67
|
#
|
|
78
68
|
# @return [Float] a latitude coordinate value
|
|
79
69
|
#
|
|
@@ -84,7 +74,7 @@ class Geom::LatLong
|
|
|
84
74
|
# The {#to_a} method converts a LatLong object to an array of two values.
|
|
85
75
|
#
|
|
86
76
|
# @example
|
|
87
|
-
# latlong = Geom::LatLong.new(
|
|
77
|
+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
|
|
88
78
|
# array = latlong.to_a
|
|
89
79
|
#
|
|
90
80
|
# @return [Array(Float, Float)] an array of latitude and longitude
|
|
@@ -108,14 +98,9 @@ class Geom::LatLong
|
|
|
108
98
|
# The to_utm method converts a LatLong object to a UTM object.
|
|
109
99
|
#
|
|
110
100
|
# @example
|
|
111
|
-
#
|
|
112
|
-
#
|
|
101
|
+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
|
|
102
|
+
# # The result is UTM(48 T 524150.82056 4429682.40743)
|
|
113
103
|
# utm = latlong.to_utm
|
|
114
|
-
# if (utm)
|
|
115
|
-
# UI.messagebox(utm)
|
|
116
|
-
# else
|
|
117
|
-
# UI.messagebox("Failure")
|
|
118
|
-
# end
|
|
119
104
|
#
|
|
120
105
|
# @return [Geom::UTM]
|
|
121
106
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Geom::Point2d} class allows you to work with a point in 2D space.
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
#
|
|
11
11
|
# @example
|
|
12
12
|
# # No arguments, creates a point at the origin [0, 0]
|
|
13
|
-
#
|
|
13
|
+
# point1 = Geom::Point2d.new
|
|
14
14
|
#
|
|
15
15
|
# # Creates a point at x of 1, y of 2.
|
|
16
|
-
#
|
|
16
|
+
# point2 = Geom::Point2d.new(1, 2)
|
|
17
17
|
#
|
|
18
18
|
# # You can also create a point directly by simply assigning the x, and y
|
|
19
19
|
# # values to a variable as an array:
|
|
20
|
-
#
|
|
20
|
+
# point3 = [1, 2]
|
|
21
21
|
#
|
|
22
22
|
# @version LayOut 2018
|
|
23
23
|
class Geom::Point2d
|
|
@@ -28,10 +28,16 @@ class Geom::Point2d
|
|
|
28
28
|
# {Geom::Point2d}, or to set the values of the {Geom::Point2d} by adding a
|
|
29
29
|
# {Geom::Vector2d} to the {Geom::Point2d}.
|
|
30
30
|
#
|
|
31
|
-
# @example
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
31
|
+
# @example Translate Point2d with Vector2d
|
|
32
|
+
# point = Geom::Point2d.new(1, 1)
|
|
33
|
+
# vector = Geom::Vector2d.new(1, 2)
|
|
34
|
+
# # The result is a Point2d(2, 3)
|
|
35
|
+
# new_point = point + vector
|
|
36
|
+
#
|
|
37
|
+
# @example Translate Point2d with vector in Array form
|
|
38
|
+
# point = Geom::Point2d.new(1, 1)
|
|
39
|
+
# # The result is a Point2d(2, 3)
|
|
40
|
+
# new_point = point + [1, 2]
|
|
35
41
|
#
|
|
36
42
|
# @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
|
|
37
43
|
#
|
|
@@ -44,23 +50,37 @@ class Geom::Point2d
|
|
|
44
50
|
# The {#-} operator is a simple way to subtract from the current x and y values
|
|
45
51
|
# of the {Geom::Point2d}.
|
|
46
52
|
#
|
|
47
|
-
# @example
|
|
48
|
-
#
|
|
49
|
-
# # result is a
|
|
50
|
-
#
|
|
51
|
-
# # result is a Vector2d(1, 2)
|
|
52
|
-
# vec2 = [4, 2] - pt
|
|
53
|
+
# @example Translate Point2d by vector in Array form
|
|
54
|
+
# point = Geom::Point2d.new(4, 2)
|
|
55
|
+
# # The result is a Vector2d(3, 0)
|
|
56
|
+
# vector = point - [1, 2]
|
|
53
57
|
#
|
|
54
|
-
# @
|
|
58
|
+
# @example Calculate the Vector2d between two Point2d
|
|
59
|
+
# point1 = Geom::Point2d.new(4, 2)
|
|
60
|
+
# point2 = Geom::Point2d.new(1, 2)
|
|
61
|
+
# # The result is a Vector2d(3, 0)
|
|
62
|
+
# vector = point1 - point2
|
|
55
63
|
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
64
|
+
# @example Translate Point2d with Vector2d
|
|
65
|
+
# point = Geom::Point2d.new(4, 2)
|
|
66
|
+
# vector = Geom::Vector2d.new(3, 0)
|
|
67
|
+
# # The result is a Point2d(1, 2)
|
|
68
|
+
# new_point = point - vector
|
|
69
|
+
#
|
|
70
|
+
# @overload -(array2d)
|
|
58
71
|
#
|
|
59
|
-
#
|
|
72
|
+
# @param [Array(Numeric, Numeric)] array2d
|
|
73
|
+
# @return [Geom::Vector2d]
|
|
74
|
+
#
|
|
75
|
+
# @overload -(point2d)
|
|
60
76
|
#
|
|
61
77
|
# @param [Geom::Point2d] point2d
|
|
62
|
-
# @return [Geom::Vector2d]
|
|
63
|
-
#
|
|
78
|
+
# @return [Geom::Vector2d]
|
|
79
|
+
#
|
|
80
|
+
# @overload -(vector2d)
|
|
81
|
+
#
|
|
82
|
+
# @param [Geom::Vector2d] vector2d
|
|
83
|
+
# @return [Geom::Point2d]
|
|
64
84
|
#
|
|
65
85
|
# @version LayOut 2018
|
|
66
86
|
def -(arg)
|
|
@@ -72,6 +92,7 @@ class Geom::Point2d
|
|
|
72
92
|
# @example
|
|
73
93
|
# point1 = Geom::Point2d.new(1, 1)
|
|
74
94
|
# point2 = Geom::Point2d.new(0, 1)
|
|
95
|
+
# # Return false
|
|
75
96
|
# status = point1 == point2
|
|
76
97
|
#
|
|
77
98
|
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
|
|
@@ -88,7 +109,7 @@ class Geom::Point2d
|
|
|
88
109
|
# @example
|
|
89
110
|
# point = Geom::Point2d.new(1, 2)
|
|
90
111
|
#
|
|
91
|
-
# #
|
|
112
|
+
# # Returns the y value of 2
|
|
92
113
|
# yvalue = point[1]
|
|
93
114
|
#
|
|
94
115
|
# @param [Integer] index
|
|
@@ -126,7 +147,7 @@ class Geom::Point2d
|
|
|
126
147
|
#
|
|
127
148
|
# @example
|
|
128
149
|
# point = Geom::Point2d.new(1, 2)
|
|
129
|
-
#
|
|
150
|
+
# new_point = point.clone
|
|
130
151
|
#
|
|
131
152
|
# @return [Geom::Point2d] the cloned {Geom::Point2d} object
|
|
132
153
|
#
|
|
@@ -140,7 +161,7 @@ class Geom::Point2d
|
|
|
140
161
|
# @example
|
|
141
162
|
# point1 = Geom::Point2d.new(1, 1)
|
|
142
163
|
# point2 = Geom::Point2d.new(1, 4)
|
|
143
|
-
# # result is
|
|
164
|
+
# # The result is 3
|
|
144
165
|
# distance = point1.distance(point2)
|
|
145
166
|
#
|
|
146
167
|
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
|
|
@@ -155,14 +176,14 @@ class Geom::Point2d
|
|
|
155
176
|
#
|
|
156
177
|
# @example
|
|
157
178
|
# # No arguments, creates a point at the origin [0, 0]
|
|
158
|
-
#
|
|
179
|
+
# point1 = Geom::Point2d.new
|
|
159
180
|
#
|
|
160
181
|
# # Creates a point at x of 1 and y of 2.
|
|
161
|
-
#
|
|
182
|
+
# point2 = Geom::Point2d.new(1, 2)
|
|
162
183
|
#
|
|
163
184
|
# # You can also create a point directly by simply assigning the x and y
|
|
164
185
|
# # values to a variable as an array:
|
|
165
|
-
#
|
|
186
|
+
# point3 = [1, 2]
|
|
166
187
|
#
|
|
167
188
|
# @overload initialize
|
|
168
189
|
#
|
|
@@ -201,8 +222,8 @@ class Geom::Point2d
|
|
|
201
222
|
# @example
|
|
202
223
|
# point = Geom::Point2d.new
|
|
203
224
|
# vector = Geom::Vector2d.new(0, 2)
|
|
204
|
-
# # result is a Point2d(0, 1)
|
|
205
|
-
#
|
|
225
|
+
# # The result is a Point2d(0, 1)
|
|
226
|
+
# new_point = point.offset(vector, 1)
|
|
206
227
|
#
|
|
207
228
|
# @overload offset(vector)
|
|
208
229
|
#
|
|
@@ -226,8 +247,8 @@ class Geom::Point2d
|
|
|
226
247
|
# @example
|
|
227
248
|
# point = Geom::Point2d.new
|
|
228
249
|
# vector = Geom::Vector2d.new(0, 2)
|
|
229
|
-
# # result is a Point2d(0, 1)
|
|
230
|
-
#
|
|
250
|
+
# # The result is a Point2d(0, 1)
|
|
251
|
+
# point.offset!(vector, 1)
|
|
231
252
|
#
|
|
232
253
|
# @overload offset!(vector)
|
|
233
254
|
#
|
|
@@ -270,6 +291,8 @@ class Geom::Point2d
|
|
|
270
291
|
# @example
|
|
271
292
|
# point = Geom::Point2d.new(1, 2)
|
|
272
293
|
# array = point.to_a
|
|
294
|
+
# # The result is [1, 2]
|
|
295
|
+
# p array
|
|
273
296
|
#
|
|
274
297
|
# @return [Array(Numeric, Numeric)] an array of two numbers representing x, y
|
|
275
298
|
# of the {Geom::Point2d}
|
|
@@ -282,7 +305,7 @@ class Geom::Point2d
|
|
|
282
305
|
#
|
|
283
306
|
# @example
|
|
284
307
|
# point = Geom::Point2d.new(1, 2)
|
|
285
|
-
#
|
|
308
|
+
# string = point.to_s
|
|
286
309
|
#
|
|
287
310
|
# @return [String]
|
|
288
311
|
#
|
|
@@ -296,8 +319,8 @@ class Geom::Point2d
|
|
|
296
319
|
# @example
|
|
297
320
|
# point = Geom::Point2d.new(4, 5)
|
|
298
321
|
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
|
299
|
-
# #
|
|
300
|
-
#
|
|
322
|
+
# # The result is a Point2d(6, 8)
|
|
323
|
+
# transformed_point = point.transform(transformation)
|
|
301
324
|
#
|
|
302
325
|
# @param [Geom::Transformation2d] transform
|
|
303
326
|
# A Transformation object to apply to the point.
|
|
@@ -314,7 +337,7 @@ class Geom::Point2d
|
|
|
314
337
|
# @example
|
|
315
338
|
# point = Geom::Point2d.new(4, 5)
|
|
316
339
|
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
|
317
|
-
# #
|
|
340
|
+
# # The result is a Point2d(6, 8)
|
|
318
341
|
# point.transform!(transformation)
|
|
319
342
|
#
|
|
320
343
|
# @param [Geom::Transformation2d] transform
|
|
@@ -329,13 +352,13 @@ class Geom::Point2d
|
|
|
329
352
|
# The {#vector_to} method returns the vector between points.
|
|
330
353
|
#
|
|
331
354
|
# @example
|
|
332
|
-
#
|
|
333
|
-
#
|
|
355
|
+
# point1 = Geom::Point2d.new(1, 1)
|
|
356
|
+
# point2 = Geom::Point2d.new(3, 1)
|
|
334
357
|
#
|
|
335
|
-
# # result is a Vector2d(2, 0)
|
|
336
|
-
#
|
|
358
|
+
# # The result is a Vector2d(2, 0)
|
|
359
|
+
# vector = point1.vector_to(point2) # is equivalent to (point2 - point1)
|
|
337
360
|
#
|
|
338
|
-
# @param [Geom::Point2d] point
|
|
361
|
+
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
|
|
339
362
|
#
|
|
340
363
|
# @return [Geom::Vector2d]
|
|
341
364
|
#
|