sketchup-api-stubs 0.7.10 → 0.8.0
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 +12 -0
- data/lib/sketchup-api-stubs/stubs/Array.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +37 -13
- 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 +63 -40
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +145 -109
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +56 -30
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +81 -52
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +45 -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 +212 -224
- data/lib/sketchup-api-stubs/stubs/Geom.rb +8 -6
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +5 -5
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +54 -52
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +13 -8
- 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 +125 -11
- 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 +7 -9
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +54 -4
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +9 -11
- 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 +6 -4
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +9 -11
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +7 -10
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +48 -2
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +18 -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 +110 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +18 -12
- 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/CRSLocation.rb +402 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/CRSMapUnit.rb +83 -0
- 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 +247 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +100 -24
- 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 +12 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +9 -11
- 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 +23 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +36 -28
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +11 -12
- 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 +237 -49
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -6
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +10 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -6
- 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 +104 -33
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +116 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPattern.rb +277 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatternData.rb +245 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatterns.rb +155 -0
- 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 +6 -69
- 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 +148 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +20 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +15 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +3 -23
- 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 +894 -130
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +39 -26
- 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 +253 -108
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +150 -9
- 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 -2
- 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 +247 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +58 -31
- 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/Procedure.rb +452 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +40 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +31 -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 +22 -16
- 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 +36 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +59 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +103 -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 +276 -145
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +26 -13
- 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 +411 -118
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +34 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +126 -40
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +83 -69
- data/lib/sketchup-api-stubs/stubs/String.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +120 -153
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +130 -14
- 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 +13 -7
- data/lib/sketchup-api-stubs/stubs/UI.rb +92 -22
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +15 -7
- metadata +16 -28
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Point3d class allows you to work with a point in 3D space.
|
|
5
5
|
# The point is basically just a series of values representing x, y and z
|
|
6
6
|
# coordinates.
|
|
7
7
|
#
|
|
8
|
-
# The values are specified as [x,y,z]
|
|
9
|
-
# To create a point call Geom::Point3d.new
|
|
8
|
+
# The values are specified as +[x, y, z]+. For example +[100, 200, 300]+.
|
|
9
|
+
# To create a point call +Geom::Point3d.new+, where the creation method
|
|
10
10
|
# can take a variety of arguments:
|
|
11
11
|
#
|
|
12
12
|
# In addition to the methods below, there are a series of geometry
|
|
13
|
-
# related methods that are on the Array class, since Point3d objects
|
|
14
|
-
# can also be represented as a 3-element Array. These Array-level methods are
|
|
13
|
+
# related methods that are on the {Array} class, since {Geom::Point3d} objects
|
|
14
|
+
# can also be represented as a 3-element {Array}. These {Array}-level methods are
|
|
15
15
|
# for operations such as determining if a point is on a line, on a plane, etc.
|
|
16
|
-
# See the Array class for details.
|
|
16
|
+
# See the {Array} class for details.
|
|
17
17
|
#
|
|
18
18
|
# @example
|
|
19
|
-
# # No arguments, creates a point at the origin [0,0,0]
|
|
20
|
-
#
|
|
19
|
+
# # No arguments, creates a point at the origin [0, 0, 0]
|
|
20
|
+
# point1 = Geom::Point3d.new
|
|
21
21
|
#
|
|
22
22
|
# # Creates a point at x of 100, y of 200, z of 300.
|
|
23
|
-
#
|
|
23
|
+
# point2 = Geom::Point3d.new(100, 200, 300)
|
|
24
24
|
#
|
|
25
25
|
# # You can also create a point directly by simply assigning the x, y and z
|
|
26
26
|
# # values to a variable as an array:
|
|
27
|
-
#
|
|
27
|
+
# point3 = [100, 200, 300]
|
|
28
|
+
#
|
|
29
|
+
# @note Compatibility: Many API methods that accept a {Geom::Point3d} also
|
|
30
|
+
# accept a 3-element {Array} of {Numeric} values +[x, y, z]+. Arrays are
|
|
31
|
+
# implicitly converted where appropriate. See {Array} and {Geom::Vector3d}.
|
|
28
32
|
#
|
|
29
33
|
# @version SketchUp 6.0
|
|
30
34
|
class Geom::Point3d
|
|
@@ -41,8 +45,8 @@ class Geom::Point3d
|
|
|
41
45
|
# point = weight1 * point1 + weight2 * point2.
|
|
42
46
|
#
|
|
43
47
|
# @example
|
|
44
|
-
# point1 = Geom::Point3d.new(1,1,1)
|
|
45
|
-
# point2 = Geom::Point3d.new(10,10,10)
|
|
48
|
+
# point1 = Geom::Point3d.new(1, 1, 1)
|
|
49
|
+
# point2 = Geom::Point3d.new(10, 10, 10)
|
|
46
50
|
#
|
|
47
51
|
# # Get the point that is half the way from point1 to point2.
|
|
48
52
|
# points = Geom::Point3d.linear_combination(0.5, point1, 0.5, point2)
|
|
@@ -73,23 +77,25 @@ class Geom::Point3d
|
|
|
73
77
|
# The {#+} operator is a fast way to add to the current x, y and z values of
|
|
74
78
|
# a vector.
|
|
75
79
|
#
|
|
76
|
-
# @example
|
|
77
|
-
#
|
|
80
|
+
# @example Translate Point3d with Vector3d
|
|
81
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
78
82
|
# vector = Geom::Vector3d.new(4, 5, 6)
|
|
79
|
-
#
|
|
83
|
+
# # The result is a Point3d(5, 7, 9)
|
|
84
|
+
# new_point = point + vector
|
|
80
85
|
#
|
|
81
|
-
# @example
|
|
82
|
-
#
|
|
83
|
-
#
|
|
86
|
+
# @example Translate Point3d with vector in Array form
|
|
87
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
88
|
+
# # the result is a Point3d(11, 12, 13)
|
|
89
|
+
# new_point = point + [10, 10, 10]
|
|
84
90
|
#
|
|
85
|
-
# @example
|
|
91
|
+
# @example Translate Point3d with function in Array form
|
|
86
92
|
# point1 = Geom::Point3d.new(1, 2, 3)
|
|
87
93
|
# point2 = Geom::Point3d.new(4, 5, 6)
|
|
88
|
-
# # This works because SketchUp treats the array of triple numerics as
|
|
89
|
-
# # a
|
|
90
|
-
#
|
|
94
|
+
# # This works because SketchUp treats the array of triple numerics as a vector in this case.
|
|
95
|
+
# # The result is a Point3d(5, 7, 9)
|
|
96
|
+
# new_point = point1 + point2.to_a
|
|
91
97
|
#
|
|
92
|
-
# @param [Geom::Vector3d] vector
|
|
98
|
+
# @param [Geom::Vector3d, Array(Numeric, Numeric, Numeric)] vector
|
|
93
99
|
#
|
|
94
100
|
# @return [Geom::Point3d]
|
|
95
101
|
#
|
|
@@ -100,31 +106,56 @@ class Geom::Point3d
|
|
|
100
106
|
# The '-' operator is a fast way to subtract from the current x, y and z values
|
|
101
107
|
# of a point.
|
|
102
108
|
#
|
|
103
|
-
# @example
|
|
104
|
-
#
|
|
105
|
-
#
|
|
109
|
+
# @example Translate a point by a vector in array form
|
|
110
|
+
# point = Geom::Point3d.new(12, 11, 12)
|
|
111
|
+
# # The result is a Vector3d(2, 1, 2)
|
|
112
|
+
# new_point = point - [10, 10, 10]
|
|
106
113
|
#
|
|
107
|
-
# @
|
|
108
|
-
#
|
|
114
|
+
# @example Calculate the Vector3d between two Point2d
|
|
115
|
+
# point1 = Geom::Point2d.new(4, 2, 5)
|
|
116
|
+
# point2 = Geom::Point2d.new(1, 2, 4)
|
|
117
|
+
# # The result is a Vector3d(3, 0, 1)
|
|
118
|
+
# vector = point1 - point2
|
|
119
|
+
#
|
|
120
|
+
# @example Translate Point3d with Vector3d
|
|
121
|
+
# point = Geom::Point2d.new(4, 2)
|
|
122
|
+
# vector = Geom::Vector2d.new(3, 0)
|
|
123
|
+
# # The result is a Point3d(1, 2)
|
|
124
|
+
# new_point = point - vector
|
|
125
|
+
#
|
|
126
|
+
# @overload -(array3d)
|
|
127
|
+
#
|
|
128
|
+
# @param [Array(Numeric, Numeric, Numeric)] array3d
|
|
129
|
+
# @return [Geom::Vector3d]
|
|
130
|
+
#
|
|
131
|
+
# @overload -(point3d)
|
|
109
132
|
#
|
|
110
|
-
#
|
|
133
|
+
# @param [Geom::Point3d] point3d A Point3d object.
|
|
134
|
+
# @return [Geom::Vector3d]
|
|
135
|
+
#
|
|
136
|
+
# @overload -(vector3d)
|
|
137
|
+
#
|
|
138
|
+
# @param [Geom::Vector3d] vector3d A Vector3d object.
|
|
139
|
+
# @return [Geom::Point3d]
|
|
111
140
|
#
|
|
112
141
|
# @version SketchUp 6.0
|
|
113
|
-
def -(
|
|
142
|
+
def -(arg)
|
|
114
143
|
end
|
|
115
144
|
|
|
116
|
-
# The
|
|
117
|
-
#
|
|
145
|
+
# The {#<} compare method is used to compare two points to determine if
|
|
146
|
+
# the left-hand point is less than the right-hand point.
|
|
118
147
|
#
|
|
119
148
|
# @example
|
|
120
|
-
#
|
|
121
|
-
#
|
|
122
|
-
# result =
|
|
149
|
+
# point1 = Geom::Point3d.new(10, 10, 10)
|
|
150
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
|
151
|
+
# result = point1 < point2
|
|
123
152
|
#
|
|
124
|
-
# @
|
|
153
|
+
# @note The comparison is performed in the order x, y and z coordinates.
|
|
154
|
+
#
|
|
155
|
+
# @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point2
|
|
125
156
|
# A Point3d object.
|
|
126
157
|
#
|
|
127
|
-
# @return [Boolean] true if the
|
|
158
|
+
# @return [Boolean] true if the point1 is smaller than point2
|
|
128
159
|
#
|
|
129
160
|
# @version SketchUp 6.0
|
|
130
161
|
def <(point2)
|
|
@@ -139,28 +170,30 @@ class Geom::Point3d
|
|
|
139
170
|
# x, y and z coordinates, as in the following examples:
|
|
140
171
|
#
|
|
141
172
|
# @example
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
#
|
|
173
|
+
# point1 = Geom::Point3d.new(3, 4, 3)
|
|
174
|
+
# point2 = Geom::Point3d.new(3, 4, 3)
|
|
175
|
+
# # Return true
|
|
176
|
+
# point1 == point2
|
|
145
177
|
#
|
|
146
178
|
# # ... or ...
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
179
|
+
# point3 = Geom::Point3d.new(100, 200, 301)
|
|
180
|
+
# # Return false
|
|
181
|
+
# point3 == [100, 200, 300]
|
|
150
182
|
#
|
|
151
183
|
# @example
|
|
152
|
-
# point1 = Geom::Point3d.new(1,1,1)
|
|
153
|
-
# point2 = Geom::Point3d.new(10,10,10)
|
|
184
|
+
# point1 = Geom::Point3d.new(1, 1, 1)
|
|
185
|
+
# point2 = Geom::Point3d.new(10, 10, 10)
|
|
186
|
+
# # Return false
|
|
154
187
|
# status = point1 == point2
|
|
155
188
|
#
|
|
156
|
-
# @param [Geom::Point3d]
|
|
189
|
+
# @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point
|
|
157
190
|
# A Point3d object.
|
|
158
191
|
#
|
|
159
192
|
# @return [Boolean] true if both points are equal; false if points are not
|
|
160
193
|
# equal
|
|
161
194
|
#
|
|
162
195
|
# @version SketchUp 6.0
|
|
163
|
-
def ==(
|
|
196
|
+
def ==(point)
|
|
164
197
|
end
|
|
165
198
|
|
|
166
199
|
# The [] method is used to retrieve the value of the point at the specified
|
|
@@ -169,7 +202,7 @@ class Geom::Point3d
|
|
|
169
202
|
# @example
|
|
170
203
|
# point = Geom::Point3d.new(1, 2, 3)
|
|
171
204
|
#
|
|
172
|
-
# #
|
|
205
|
+
# # Retrieves the y value of 2
|
|
173
206
|
# yvalue = point[1]
|
|
174
207
|
#
|
|
175
208
|
# @param [Integer] index
|
|
@@ -186,7 +219,7 @@ class Geom::Point3d
|
|
|
186
219
|
# specific index of the value.
|
|
187
220
|
#
|
|
188
221
|
# @example
|
|
189
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
222
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
190
223
|
# yvalue = point[1] = 4
|
|
191
224
|
#
|
|
192
225
|
# @param [Integer] index
|
|
@@ -206,8 +239,8 @@ class Geom::Point3d
|
|
|
206
239
|
# being cloned.
|
|
207
240
|
#
|
|
208
241
|
# @example
|
|
209
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
210
|
-
#
|
|
242
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
243
|
+
# new_point = point.clone
|
|
211
244
|
#
|
|
212
245
|
# @return [Geom::Point3d] the cloned Point3d object
|
|
213
246
|
#
|
|
@@ -219,8 +252,8 @@ class Geom::Point3d
|
|
|
219
252
|
# point.
|
|
220
253
|
#
|
|
221
254
|
# @example
|
|
222
|
-
# point1 = Geom::Point3d.new(1,1,1)
|
|
223
|
-
# point2 = Geom::Point3d.new(10,10,10)
|
|
255
|
+
# point1 = Geom::Point3d.new(1, 1, 1)
|
|
256
|
+
# point2 = Geom::Point3d.new(10, 10, 10)
|
|
224
257
|
# distance = point1.distance(point2)
|
|
225
258
|
#
|
|
226
259
|
# @param [Geom::Point3d] point2
|
|
@@ -238,9 +271,9 @@ class Geom::Point3d
|
|
|
238
271
|
# See Geom module for how to specify a line.
|
|
239
272
|
#
|
|
240
273
|
# @example
|
|
241
|
-
#
|
|
242
|
-
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
|
243
|
-
# distance =
|
|
274
|
+
# point = Geom::Point3d.new(1, 1, 1)
|
|
275
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
276
|
+
# distance = point.distance_to_line(line)
|
|
244
277
|
#
|
|
245
278
|
# @note This function returns a `Float` value, not a `Length`.
|
|
246
279
|
#
|
|
@@ -260,6 +293,9 @@ class Geom::Point3d
|
|
|
260
293
|
# See module Geom for how to specify a plane.
|
|
261
294
|
#
|
|
262
295
|
# @example
|
|
296
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
297
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
298
|
+
# # The result is 10
|
|
263
299
|
# distance = point.distance_to_plane(plane)
|
|
264
300
|
#
|
|
265
301
|
# @note This function returns a `Float` value, not a `Length`.
|
|
@@ -278,14 +314,14 @@ class Geom::Point3d
|
|
|
278
314
|
#
|
|
279
315
|
# @example
|
|
280
316
|
# # No arguments, creates a point at the origin [0,0,0]
|
|
281
|
-
#
|
|
317
|
+
# point1 = Geom::Point3d.new
|
|
282
318
|
#
|
|
283
319
|
# # Creates a point at x of 100, y of 200, z of 300.
|
|
284
|
-
#
|
|
320
|
+
# point2 = Geom::Point3d.new(100, 200, 300)
|
|
285
321
|
#
|
|
286
322
|
# # You can also create a point directly by simply assigning the x, y and z
|
|
287
323
|
# # values to a variable as an array:
|
|
288
|
-
#
|
|
324
|
+
# point3 = [100, 200, 300]
|
|
289
325
|
#
|
|
290
326
|
# @overload initialize
|
|
291
327
|
#
|
|
@@ -334,7 +370,7 @@ class Geom::Point3d
|
|
|
334
370
|
# which writes to the Ruby console.
|
|
335
371
|
#
|
|
336
372
|
# @example
|
|
337
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
373
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
338
374
|
# string = point.inspect
|
|
339
375
|
#
|
|
340
376
|
# @return [String] a string point representation
|
|
@@ -347,9 +383,9 @@ class Geom::Point3d
|
|
|
347
383
|
# point. The length of the vector must not be zero.
|
|
348
384
|
#
|
|
349
385
|
# @example
|
|
350
|
-
#
|
|
386
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
351
387
|
# vector = Geom::Vector3d.new(0, 0, 1)
|
|
352
|
-
#
|
|
388
|
+
# new_point = point.offset(vector)
|
|
353
389
|
#
|
|
354
390
|
# @param [Geom::Vector3d] vector
|
|
355
391
|
# A Vector3d object to offset the point by.
|
|
@@ -370,9 +406,9 @@ class Geom::Point3d
|
|
|
370
406
|
# Unlike offset, the point itself is modified.
|
|
371
407
|
#
|
|
372
408
|
# @example
|
|
373
|
-
#
|
|
374
|
-
# vector = Geom::Vector3d.new(0,0,1)
|
|
375
|
-
#
|
|
409
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
410
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
|
411
|
+
# new_point = point.offset!(vector)
|
|
376
412
|
#
|
|
377
413
|
# @param [Geom::Vector3d] vector
|
|
378
414
|
# A Vector3d object to offset the point by.
|
|
@@ -392,8 +428,8 @@ class Geom::Point3d
|
|
|
392
428
|
# See module Geom for the various ways to specify a line.
|
|
393
429
|
#
|
|
394
430
|
# @example
|
|
395
|
-
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
|
396
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
431
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
432
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
397
433
|
# status = point.on_line?(line)
|
|
398
434
|
#
|
|
399
435
|
# @param line
|
|
@@ -410,8 +446,8 @@ class Geom::Point3d
|
|
|
410
446
|
# See module Geom for the various ways to specify a plane.
|
|
411
447
|
#
|
|
412
448
|
# @example
|
|
413
|
-
# plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
|
414
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
449
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
450
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
415
451
|
# status = point.on_plane?(plane)
|
|
416
452
|
#
|
|
417
453
|
# @param plane
|
|
@@ -428,8 +464,8 @@ class Geom::Point3d
|
|
|
428
464
|
# The line may be defined by either a point and a vector or by two points.
|
|
429
465
|
#
|
|
430
466
|
# @example
|
|
431
|
-
# line = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
|
432
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
467
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
468
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
433
469
|
# projected_point = point.project_to_line(line)
|
|
434
470
|
#
|
|
435
471
|
# @param line
|
|
@@ -450,8 +486,8 @@ class Geom::Point3d
|
|
|
450
486
|
# BY + CZ + D = 0. See Geom for details.
|
|
451
487
|
#
|
|
452
488
|
# @example
|
|
453
|
-
# plane = [Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1)]
|
|
454
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
489
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
|
490
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
455
491
|
# projected_point = point.project_to_plane(plane)
|
|
456
492
|
#
|
|
457
493
|
# @param plane
|
|
@@ -467,8 +503,8 @@ class Geom::Point3d
|
|
|
467
503
|
# The {#set!} method is used to set the values of the Point3d.
|
|
468
504
|
#
|
|
469
505
|
# @example
|
|
470
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
471
|
-
# point = point.set!(100,200,300)
|
|
506
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
507
|
+
# point = point.set!(100, 200, 300)
|
|
472
508
|
#
|
|
473
509
|
# @overload set!(x, y, z)
|
|
474
510
|
#
|
|
@@ -494,14 +530,12 @@ class Geom::Point3d
|
|
|
494
530
|
# The to_a method is used to convert the point to an array of 3 numbers
|
|
495
531
|
#
|
|
496
532
|
# @example
|
|
497
|
-
# point = Geom::Point3d.new(10,20,30)
|
|
533
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
|
498
534
|
# array = point.to_a
|
|
535
|
+
# # The result is [10, 20, 30]
|
|
536
|
+
# p array
|
|
499
537
|
#
|
|
500
|
-
#
|
|
501
|
-
# # outputs [100.0,200.0,300.0]
|
|
502
|
-
# UI.messagebox(pt.to_a)
|
|
503
|
-
#
|
|
504
|
-
# @return [Array(Length, Length, Length)] an array of three numbers representing x,y,z of
|
|
538
|
+
# @return [Array(Length, Length, Length)] an array of three numbers representing x, y, z of
|
|
505
539
|
# the Point3d
|
|
506
540
|
#
|
|
507
541
|
# @version SketchUp 6.0
|
|
@@ -511,8 +545,8 @@ class Geom::Point3d
|
|
|
511
545
|
# The to_s method is used to retrieve a string representation of a point.
|
|
512
546
|
#
|
|
513
547
|
# @example
|
|
514
|
-
# point = Geom::Point3d.new(10,10,10)
|
|
515
|
-
#
|
|
548
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
|
549
|
+
# string = point.to_s
|
|
516
550
|
#
|
|
517
551
|
# @return [String] the string representation of the Point3d
|
|
518
552
|
#
|
|
@@ -524,10 +558,11 @@ class Geom::Point3d
|
|
|
524
558
|
# vector is unchanged by this method.
|
|
525
559
|
#
|
|
526
560
|
# @example
|
|
561
|
+
# point1 = Geom::Point3d.new(10, 10, 10)
|
|
562
|
+
# point2 = Geom::Point3d.new(100, 200, 300)
|
|
527
563
|
# transform = Geom::Transformation.new(point2)
|
|
528
|
-
#
|
|
529
|
-
#
|
|
530
|
-
# point3 = point1.transform(transform)
|
|
564
|
+
# # The result is a Point3d(110, 210, 310)
|
|
565
|
+
# transformed_point = point1.transform(transform)
|
|
531
566
|
#
|
|
532
567
|
# @param [Geom::Transformation] transform
|
|
533
568
|
# A Transformation object.
|
|
@@ -541,9 +576,10 @@ class Geom::Point3d
|
|
|
541
576
|
# Apply a Transformation to a point. The point itself is modified.
|
|
542
577
|
#
|
|
543
578
|
# @example
|
|
579
|
+
# point1 = Geom::Point3d.new(10, 10, 10)
|
|
580
|
+
# point2 = Geom::Point3d.new(100, 200, 300)
|
|
544
581
|
# transform = Geom::Transformation.new(point2)
|
|
545
|
-
#
|
|
546
|
-
# point1 = Geom::Point3d.new(10,10,10)
|
|
582
|
+
# # The result is a Point3d(110, 210, 310)
|
|
547
583
|
# point1.transform!(transform)
|
|
548
584
|
#
|
|
549
585
|
# @param [Geom::Transformation] transform
|
|
@@ -558,29 +594,29 @@ class Geom::Point3d
|
|
|
558
594
|
# The vector_to team method retrieves the vector between points.
|
|
559
595
|
#
|
|
560
596
|
# @example
|
|
561
|
-
# point2 = Geom::Point3d.new(100,200,300)
|
|
562
|
-
# point1 = Geom::Point3d.new(10,10,10)
|
|
597
|
+
# point2 = Geom::Point3d.new(100, 200, 300)
|
|
598
|
+
# point1 = Geom::Point3d.new(10, 10, 10)
|
|
563
599
|
# vector = point1.vector_to(point2)
|
|
564
600
|
#
|
|
565
601
|
# # Another example...
|
|
566
|
-
#
|
|
567
|
-
#
|
|
568
|
-
#
|
|
569
|
-
#
|
|
602
|
+
# point1 = [1, 1, 0]
|
|
603
|
+
# point2 = [3, 1, 0]
|
|
604
|
+
# # The result is a Vector3d(2, 0, 0)
|
|
605
|
+
# point1.vector_to(point2) # is equivalent to (point2 - point1)
|
|
570
606
|
#
|
|
571
|
-
# @param [Geom::Point3d]
|
|
607
|
+
# @param [Geom::Point3d, Array(Numeric, Numeric, Numeric)] point3d
|
|
572
608
|
# A Point3d object.
|
|
573
609
|
#
|
|
574
610
|
# @return [Geom::Vector3d] a Vector object
|
|
575
611
|
#
|
|
576
612
|
# @version SketchUp 6.0
|
|
577
|
-
def vector_to(
|
|
613
|
+
def vector_to(point3d)
|
|
578
614
|
end
|
|
579
615
|
|
|
580
|
-
# The x method retrieves the x value of the 3D point.
|
|
616
|
+
# The {#x} method retrieves the x value of the 3D point.
|
|
581
617
|
#
|
|
582
618
|
# @example
|
|
583
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
619
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
584
620
|
# x = point.x
|
|
585
621
|
#
|
|
586
622
|
# @return [Length] the x value
|
|
@@ -589,10 +625,10 @@ class Geom::Point3d
|
|
|
589
625
|
def x
|
|
590
626
|
end
|
|
591
627
|
|
|
592
|
-
# The x= method is used to set the x value of a 3D point.
|
|
628
|
+
# The {#x=} method is used to set the x value of a 3D point.
|
|
593
629
|
#
|
|
594
630
|
# @example
|
|
595
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
631
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
596
632
|
# x = point.x = 2
|
|
597
633
|
#
|
|
598
634
|
# @param [Numeric] value
|
|
@@ -604,10 +640,10 @@ class Geom::Point3d
|
|
|
604
640
|
def x=(value)
|
|
605
641
|
end
|
|
606
642
|
|
|
607
|
-
# The y method retrieves the y value of the 3D point.
|
|
643
|
+
# The {#y} method retrieves the y value of the 3D point.
|
|
608
644
|
#
|
|
609
645
|
# @example
|
|
610
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
646
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
611
647
|
# y = point.y
|
|
612
648
|
#
|
|
613
649
|
# @return [Length] the y value
|
|
@@ -616,10 +652,10 @@ class Geom::Point3d
|
|
|
616
652
|
def y
|
|
617
653
|
end
|
|
618
654
|
|
|
619
|
-
# The y= method is used to set the y value of a 3D point.
|
|
655
|
+
# The {#y=} method is used to set the y value of a 3D point.
|
|
620
656
|
#
|
|
621
657
|
# @example
|
|
622
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
658
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
623
659
|
# y = point.y = 2
|
|
624
660
|
#
|
|
625
661
|
# @param [Numeric] value
|
|
@@ -631,11 +667,11 @@ class Geom::Point3d
|
|
|
631
667
|
def y=(value)
|
|
632
668
|
end
|
|
633
669
|
|
|
634
|
-
# The z method retrieves the z value of the 3D point.
|
|
670
|
+
# The {#z} method retrieves the z value of the 3D point.
|
|
635
671
|
#
|
|
636
672
|
# @example
|
|
637
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
638
|
-
# z = point.
|
|
673
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
674
|
+
# z = point.z
|
|
639
675
|
#
|
|
640
676
|
# @return [Length] the z value
|
|
641
677
|
#
|
|
@@ -643,10 +679,10 @@ class Geom::Point3d
|
|
|
643
679
|
def z
|
|
644
680
|
end
|
|
645
681
|
|
|
646
|
-
# The z= method is used to set the z value of a 3D point.
|
|
682
|
+
# The {#z=} method is used to set the z value of a 3D point.
|
|
647
683
|
#
|
|
648
684
|
# @example
|
|
649
|
-
# point = Geom::Point3d.new(1,2,3)
|
|
685
|
+
# point = Geom::Point3d.new(1, 2, 3)
|
|
650
686
|
# z = point.z = 2
|
|
651
687
|
#
|
|
652
688
|
# @param [Numeric] value
|