sketchup-api-stubs 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardopts +7 -7
- data/SketchUp/Geom/BoundingBox.rb +7 -15
- data/SketchUp/Geom/Bounds2d.rb +18 -18
- data/SketchUp/Geom/LatLong.rb +6 -6
- data/SketchUp/Geom/OrientedBounds2d.rb +1 -1
- data/SketchUp/Geom/Point2d.rb +42 -6
- data/SketchUp/Geom/Point3d.rb +32 -21
- data/SketchUp/Geom/PolygonMesh.rb +22 -17
- data/SketchUp/Geom/Transformation.rb +35 -35
- data/SketchUp/Geom/Transformation2d.rb +153 -13
- data/SketchUp/Geom/UTM.rb +1 -1
- data/SketchUp/Geom/Vector2d.rb +45 -9
- data/SketchUp/Geom/Vector3d.rb +11 -11
- data/SketchUp/Layout.rb +1 -1
- data/SketchUp/Layout/AngularDimension.rb +25 -25
- data/SketchUp/Layout/AutoTextDefinition.rb +5 -5
- data/SketchUp/Layout/AutoTextDefinitions.rb +1 -1
- data/SketchUp/Layout/ConnectionPoint.rb +1 -1
- data/SketchUp/Layout/Document.rb +6 -5
- data/SketchUp/Layout/Ellipse.rb +1 -1
- data/SketchUp/Layout/Entities.rb +1 -1
- data/SketchUp/Layout/Entity.rb +16 -16
- data/SketchUp/Layout/FormattedText.rb +21 -21
- data/SketchUp/Layout/Grid.rb +1 -1
- data/SketchUp/Layout/Group.rb +18 -18
- data/SketchUp/Layout/Image.rb +6 -6
- data/SketchUp/Layout/Label.rb +15 -15
- data/SketchUp/Layout/Layer.rb +5 -5
- data/SketchUp/Layout/LayerInstance.rb +3 -3
- data/SketchUp/Layout/Layers.rb +1 -1
- data/SketchUp/Layout/LinearDimension.rb +25 -25
- data/SketchUp/Layout/LockedEntityError.rb +1 -1
- data/SketchUp/Layout/LockedLayerError.rb +1 -1
- data/SketchUp/Layout/Page.rb +3 -3
- data/SketchUp/Layout/PageInfo.rb +1 -1
- data/SketchUp/Layout/Pages.rb +1 -1
- data/SketchUp/Layout/Path.rb +47 -27
- data/SketchUp/Layout/Rectangle.rb +8 -8
- data/SketchUp/Layout/SketchUpModel.rb +61 -26
- data/SketchUp/Layout/Style.rb +18 -17
- data/SketchUp/Layout/Table.rb +14 -14
- data/SketchUp/Layout/TableCell.rb +5 -5
- data/SketchUp/Layout/TableColumn.rb +7 -7
- data/SketchUp/Layout/TableRow.rb +7 -7
- data/SketchUp/Sketchup/Animation.rb +1 -1
- data/SketchUp/Sketchup/AppObserver.rb +1 -1
- data/SketchUp/Sketchup/ArcCurve.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionaries.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionary.rb +7 -7
- data/SketchUp/Sketchup/Axes.rb +4 -4
- data/SketchUp/Sketchup/Behavior.rb +1 -1
- data/SketchUp/Sketchup/Camera.rb +30 -41
- data/SketchUp/Sketchup/ClassificationSchema.rb +1 -1
- data/SketchUp/Sketchup/Classifications.rb +1 -1
- data/SketchUp/Sketchup/Color.rb +1 -1
- data/SketchUp/Sketchup/ComponentDefinition.rb +3 -3
- data/SketchUp/Sketchup/ComponentInstance.rb +10 -10
- data/SketchUp/Sketchup/Console.rb +5 -5
- data/SketchUp/Sketchup/ConstructionLine.rb +11 -11
- data/SketchUp/Sketchup/ConstructionPoint.rb +1 -1
- data/SketchUp/Sketchup/Curve.rb +1 -1
- data/SketchUp/Sketchup/DefinitionList.rb +12 -9
- data/SketchUp/Sketchup/DefinitionObserver.rb +6 -7
- data/SketchUp/Sketchup/DefinitionsObserver.rb +3 -3
- data/SketchUp/Sketchup/Dimension.rb +1 -1
- data/SketchUp/Sketchup/DimensionLinear.rb +81 -1
- data/SketchUp/Sketchup/DimensionObserver.rb +1 -1
- data/SketchUp/Sketchup/DimensionRadial.rb +1 -1
- data/SketchUp/Sketchup/Drawingelement.rb +1 -1
- data/SketchUp/Sketchup/Edge.rb +13 -16
- data/SketchUp/Sketchup/EdgeUse.rb +1 -1
- data/SketchUp/Sketchup/Entities.rb +181 -100
- data/SketchUp/Sketchup/EntitiesObserver.rb +1 -1
- data/SketchUp/Sketchup/Entity.rb +29 -26
- data/SketchUp/Sketchup/EntityObserver.rb +1 -1
- data/SketchUp/Sketchup/ExtensionsManager.rb +1 -1
- data/SketchUp/Sketchup/Face.rb +7 -7
- data/SketchUp/Sketchup/FrameChangeObserver.rb +4 -4
- data/SketchUp/Sketchup/Group.rb +1 -1
- data/SketchUp/Sketchup/Http.rb +1 -1
- data/SketchUp/Sketchup/Http/Request.rb +3 -3
- data/SketchUp/Sketchup/Http/Response.rb +1 -1
- data/SketchUp/Sketchup/Image.rb +1 -1
- data/SketchUp/Sketchup/ImageRep.rb +16 -16
- data/SketchUp/Sketchup/Importer.rb +1 -1
- data/SketchUp/Sketchup/InputPoint.rb +8 -4
- data/SketchUp/Sketchup/InstanceObserver.rb +1 -1
- data/SketchUp/Sketchup/InstancePath.rb +15 -12
- data/SketchUp/Sketchup/Layer.rb +27 -1
- data/SketchUp/Sketchup/Layers.rb +1 -1
- data/SketchUp/Sketchup/LayersObserver.rb +1 -1
- data/SketchUp/Sketchup/Licensing.rb +1 -1
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/SketchUp/Sketchup/LineStyle.rb +24 -0
- data/SketchUp/Sketchup/LineStyles.rb +123 -0
- data/SketchUp/Sketchup/Loop.rb +1 -1
- data/SketchUp/Sketchup/Material.rb +16 -10
- data/SketchUp/Sketchup/Materials.rb +9 -1
- data/SketchUp/Sketchup/MaterialsObserver.rb +3 -3
- data/SketchUp/Sketchup/Menu.rb +1 -1
- data/SketchUp/Sketchup/Model.rb +47 -21
- data/SketchUp/Sketchup/ModelObserver.rb +3 -3
- data/SketchUp/Sketchup/OptionsManager.rb +1 -1
- data/SketchUp/Sketchup/OptionsProvider.rb +5 -5
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +1 -1
- data/SketchUp/Sketchup/Page.rb +1 -1
- data/SketchUp/Sketchup/Pages.rb +13 -8
- data/SketchUp/Sketchup/PagesObserver.rb +1 -1
- data/SketchUp/Sketchup/PickHelper.rb +49 -50
- data/SketchUp/Sketchup/RegionalSettings.rb +1 -1
- data/SketchUp/Sketchup/RenderingOptions.rb +4 -4
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +3 -3
- data/SketchUp/Sketchup/SectionPlane.rb +1 -1
- data/SketchUp/Sketchup/Selection.rb +3 -3
- data/SketchUp/Sketchup/SelectionObserver.rb +3 -3
- data/SketchUp/Sketchup/Set.rb +1 -1
- data/SketchUp/Sketchup/ShadowInfo.rb +3 -3
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +1 -1
- data/SketchUp/Sketchup/Style.rb +1 -1
- data/SketchUp/Sketchup/Styles.rb +1 -1
- data/SketchUp/Sketchup/Text.rb +28 -1
- data/SketchUp/Sketchup/Texture.rb +1 -1
- data/SketchUp/Sketchup/TextureWriter.rb +13 -13
- data/SketchUp/Sketchup/Tool.rb +68 -64
- data/SketchUp/Sketchup/Tools.rb +13 -1
- data/SketchUp/Sketchup/ToolsObserver.rb +13 -13
- data/SketchUp/Sketchup/UVHelper.rb +1 -1
- data/SketchUp/Sketchup/Vertex.rb +1 -1
- data/SketchUp/Sketchup/View.rb +57 -56
- data/SketchUp/Sketchup/ViewObserver.rb +2 -2
- data/SketchUp/UI/Command.rb +4 -1
- data/SketchUp/UI/HtmlDialog.rb +23 -14
- data/SketchUp/UI/Notification.rb +10 -10
- data/SketchUp/UI/Toolbar.rb +1 -1
- data/SketchUp/UI/WebDialog.rb +38 -20
- data/SketchUp/_top_level.rb +32 -34
- data/SketchUp/array.rb +125 -112
- data/SketchUp/geom.rb +2 -2
- data/SketchUp/languagehandler.rb +1 -1
- data/SketchUp/length.rb +1 -1
- data/SketchUp/numeric.rb +3 -3
- data/SketchUp/sketchup.rb +11 -11
- data/SketchUp/sketchupextension.rb +6 -2
- data/SketchUp/string.rb +1 -1
- data/SketchUp/ui.rb +14 -14
- data/autoload/sketchup.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a743ad1c6d1c7150a4eb0adcc8888ffbc65dd9c
|
4
|
+
data.tar.gz: e3630910a907338ae16857ec747c73aa6b75035f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf38818748b0d56d4bfed840039b0a5cf7647cfe807ea25bf43ac5c5f44fe972e15d9414e044aa38a6b569e77b749b6c0bca6ac4299a349550390ceaecc241f
|
7
|
+
data.tar.gz: 386d1a9096e721fd4bf1ae587fc33b001e573bfe805d25ad5b08959900a9df8d53dbfe71ab3e5704974256f8b14ddd9c4522352418c66add645fe6ba6c5c58f3
|
data/.yardopts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
--title "SketchUp Ruby API Documentation"
|
2
|
-
--no-api
|
3
|
-
--no-private
|
4
|
-
-p su-template
|
5
|
-
SketchUp/**/*.rb
|
6
|
-
-
|
7
|
-
pages/*.md
|
1
|
+
--title "SketchUp Ruby API Documentation"
|
2
|
+
--no-api
|
3
|
+
--no-private
|
4
|
+
-p su-template
|
5
|
+
SketchUp/**/*.rb
|
6
|
+
-
|
7
|
+
pages/*.md
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
|
@@ -156,9 +156,7 @@ class Geom::BoundingBox
|
|
156
156
|
def corner(corner_index)
|
157
157
|
end
|
158
158
|
|
159
|
-
# The depth method is used to retrieve the depth of the bounding box.
|
160
|
-
#
|
161
|
-
# The depth is returned in the currently set units (inches, by default).
|
159
|
+
# The {#depth} method is used to retrieve the depth of the bounding box.
|
162
160
|
#
|
163
161
|
# @example
|
164
162
|
# boundingbox = Geom::BoundingBox.new
|
@@ -166,17 +164,15 @@ class Geom::BoundingBox
|
|
166
164
|
# # This will return a Length of 500.0.
|
167
165
|
# length = boundingbox.depth
|
168
166
|
#
|
169
|
-
# @return [Length] the depth of the bounding box
|
167
|
+
# @return [Length] the depth of the bounding box
|
170
168
|
#
|
171
169
|
# @version SketchUp 6.0
|
172
170
|
def depth
|
173
171
|
end
|
174
172
|
|
175
|
-
# The diagonal method is used to get the length of the diagonal of the
|
173
|
+
# The {#diagonal} method is used to get the length of the diagonal of the
|
176
174
|
# bounding box.
|
177
175
|
#
|
178
|
-
# The diagonal is returned in the currently set units (inches, by default).
|
179
|
-
#
|
180
176
|
# @example
|
181
177
|
# boundingbox = Geom::BoundingBox.new
|
182
178
|
# boundingbox.add([100, 200, -400], [200, 400, 100])
|
@@ -184,7 +180,7 @@ class Geom::BoundingBox
|
|
184
180
|
# length = boundingbox.diagonal
|
185
181
|
#
|
186
182
|
# @return [Length] the size of the diagonal for the bounding
|
187
|
-
# box
|
183
|
+
# box
|
188
184
|
#
|
189
185
|
# @version SketchUp 6.0
|
190
186
|
def diagonal
|
@@ -208,9 +204,7 @@ class Geom::BoundingBox
|
|
208
204
|
def empty?
|
209
205
|
end
|
210
206
|
|
211
|
-
# The height method is used to retrieve the height of the bounding box.
|
212
|
-
#
|
213
|
-
# The height is returned in the currently set units (inches, by default).
|
207
|
+
# The {#height} method is used to retrieve the height of the bounding box.
|
214
208
|
#
|
215
209
|
# @example
|
216
210
|
# boundingbox = Geom::BoundingBox.new
|
@@ -313,9 +307,7 @@ class Geom::BoundingBox
|
|
313
307
|
def valid?
|
314
308
|
end
|
315
309
|
|
316
|
-
# The width method is used to retrieve the width of the bounding box.
|
317
|
-
#
|
318
|
-
# The width is returned in the currently set units (inches, by default).
|
310
|
+
# The {#width} method is used to retrieve the width of the bounding box.
|
319
311
|
#
|
320
312
|
# @example
|
321
313
|
# boundingbox = Geom::BoundingBox.new
|
data/SketchUp/Geom/Bounds2d.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The bounds2d class represents an axis aligned bounding box represented by
|
@@ -39,7 +39,7 @@ class Geom::Bounds2d
|
|
39
39
|
# The {#initialize} method creates a new {Geom::Bounds2d}.
|
40
40
|
#
|
41
41
|
# @example
|
42
|
-
# bounds = Geom::Bounds2d.new(
|
42
|
+
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
|
43
43
|
#
|
44
44
|
# @overload initialize(other_bounds)
|
45
45
|
#
|
@@ -52,10 +52,12 @@ class Geom::Bounds2d
|
|
52
52
|
# @param [Geom::Point2d] lower_right
|
53
53
|
# @return [Geom::Bounds2d]
|
54
54
|
#
|
55
|
-
# @overload initialize(
|
55
|
+
# @overload initialize(x, y, width, height)
|
56
56
|
#
|
57
|
-
# @param [
|
58
|
-
#
|
57
|
+
# @param [Float] x
|
58
|
+
# @param [Float] y
|
59
|
+
# @param [Float] width
|
60
|
+
# @param [Float] height
|
59
61
|
# @return [Geom::Bounds2d]
|
60
62
|
#
|
61
63
|
# @overload initialize(point_array)
|
@@ -64,12 +66,10 @@ class Geom::Bounds2d
|
|
64
66
|
# {Geom::Point2d}s
|
65
67
|
# @return [Geom::Bounds2d]
|
66
68
|
#
|
67
|
-
# @overload initialize(
|
69
|
+
# @overload initialize(float_array)
|
68
70
|
#
|
69
|
-
# @param [Float]
|
70
|
-
#
|
71
|
-
# @param [Float] width
|
72
|
-
# @param [Float] height
|
71
|
+
# @param [Array(Float, Float, Float, Float)] float_array An array of four
|
72
|
+
# floats (x, y, width, height)
|
73
73
|
# @return [Geom::Bounds2d]
|
74
74
|
#
|
75
75
|
# @version LayOut 2018
|
@@ -107,10 +107,12 @@ class Geom::Bounds2d
|
|
107
107
|
# @param [Geom::Point2d] lower_right
|
108
108
|
# @return [Geom::Bounds2d]
|
109
109
|
#
|
110
|
-
# @overload set!(
|
110
|
+
# @overload set!(x, y, width, height)
|
111
111
|
#
|
112
|
-
# @param [
|
113
|
-
#
|
112
|
+
# @param [Float] x
|
113
|
+
# @param [Float] y
|
114
|
+
# @param [Float] width
|
115
|
+
# @param [Float] height
|
114
116
|
# @return [Geom::Bounds2d]
|
115
117
|
#
|
116
118
|
# @overload set!(point_array)
|
@@ -119,12 +121,10 @@ class Geom::Bounds2d
|
|
119
121
|
# {Geom::Point2d}s
|
120
122
|
# @return [Geom::Bounds2d]
|
121
123
|
#
|
122
|
-
# @overload set!(
|
124
|
+
# @overload set!(float_array)
|
123
125
|
#
|
124
|
-
# @param [Float]
|
125
|
-
#
|
126
|
-
# @param [Float] width
|
127
|
-
# @param [Float] height
|
126
|
+
# @param [Array(Float, Float, Float, Float)] float_array An array of four
|
127
|
+
# floats (x, y, width, height)
|
128
128
|
# @return [Geom::Bounds2d]
|
129
129
|
#
|
130
130
|
# @version LayOut 2018
|
data/SketchUp/Geom/LatLong.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The LatLong class contains various methods for creating and manipulating
|
@@ -29,15 +29,15 @@ class Geom::LatLong
|
|
29
29
|
# @param latlong [Geom::LatLong]
|
30
30
|
# @return [Geom::LatLong]
|
31
31
|
#
|
32
|
-
# @overload initialize(
|
32
|
+
# @overload initialize(latlong_array)
|
33
33
|
#
|
34
|
-
# @param
|
35
|
-
# @param long [Numeric]
|
34
|
+
# @param latlong_array [Array(Numeric, Numeric)]
|
36
35
|
# @return [Geom::LatLong]
|
37
36
|
#
|
38
|
-
# @overload initialize(
|
37
|
+
# @overload initialize(lat, long)
|
39
38
|
#
|
40
|
-
# @param
|
39
|
+
# @param lat [Numeric]
|
40
|
+
# @param long [Numeric]
|
41
41
|
# @return [Geom::LatLong]
|
42
42
|
#
|
43
43
|
# @version SketchUp 6.0
|
data/SketchUp/Geom/Point2d.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The {Geom::Vector2d} class allows you to work with a point in 2D space.
|
@@ -169,17 +169,17 @@ class Geom::Point2d
|
|
169
169
|
#
|
170
170
|
# @return [Geom::Point2d]
|
171
171
|
#
|
172
|
-
# @overload initialize(point)
|
173
|
-
#
|
174
|
-
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
|
175
|
-
# @return [Geom::Point2d]
|
176
|
-
#
|
177
172
|
# @overload initialize(x, y)
|
178
173
|
#
|
179
174
|
# @param [Numeric] x The location along the x axis
|
180
175
|
# @param [Numeric] y The location along the y axis
|
181
176
|
# @return [Geom::Point2d]
|
182
177
|
#
|
178
|
+
# @overload initialize(point)
|
179
|
+
#
|
180
|
+
# @param [Geom::Point2d, Array(Numeric, Numeric)] point
|
181
|
+
# @return [Geom::Point2d]
|
182
|
+
#
|
183
183
|
# @version LayOut 2018
|
184
184
|
def initialize(*args)
|
185
185
|
end
|
@@ -291,6 +291,42 @@ class Geom::Point2d
|
|
291
291
|
def to_s
|
292
292
|
end
|
293
293
|
|
294
|
+
# The {#transform} method applies a transformation to a point, returning a new
|
295
|
+
# point. The original point is unchanged by this method.
|
296
|
+
#
|
297
|
+
# @example
|
298
|
+
# point = Geom::Point2d.new(4, 5)
|
299
|
+
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
300
|
+
# # pt will be (6, 8)
|
301
|
+
# pt = point.transform(transformation)
|
302
|
+
#
|
303
|
+
# @param [Geom::Transformation2d] transform
|
304
|
+
# A Transformation object to apply to the point.
|
305
|
+
#
|
306
|
+
# @return [Geom::Point2d] the transformed point
|
307
|
+
#
|
308
|
+
# @version LayOut 2019
|
309
|
+
def transform(transform)
|
310
|
+
end
|
311
|
+
|
312
|
+
# The {#transform!} method applies a transformation to a point. The point
|
313
|
+
# itself is modified.
|
314
|
+
#
|
315
|
+
# @example
|
316
|
+
# point = Geom::Point2d.new(4, 5)
|
317
|
+
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
318
|
+
# # point will be (6, 8)
|
319
|
+
# point.transform!(transformation)
|
320
|
+
#
|
321
|
+
# @param [Geom::Transformation2d] transform
|
322
|
+
# A Transformation object to apply to the point.
|
323
|
+
#
|
324
|
+
# @return [Geom::Point2d] the transformed point
|
325
|
+
#
|
326
|
+
# @version LayOut 2019
|
327
|
+
def transform!(transform)
|
328
|
+
end
|
329
|
+
|
294
330
|
# The {#vector_to} method returns the vector between points.
|
295
331
|
#
|
296
332
|
# @example
|
data/SketchUp/Geom/Point3d.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 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.
|
@@ -53,14 +53,14 @@ class Geom::Point3d
|
|
53
53
|
# @param [Float] weight1
|
54
54
|
# A weight or percentage.
|
55
55
|
#
|
56
|
-
# @param [Float]
|
57
|
-
# The
|
56
|
+
# @param [Float] point1
|
57
|
+
# The start point on the line.
|
58
58
|
#
|
59
59
|
# @param [Float] weight2
|
60
60
|
# A weight or percentage.
|
61
61
|
#
|
62
|
-
# @param [Float]
|
63
|
-
# The
|
62
|
+
# @param [Float] point2
|
63
|
+
# The end point of the line.
|
64
64
|
#
|
65
65
|
# @return [Geom::Point3d]
|
66
66
|
#
|
@@ -70,20 +70,31 @@ class Geom::Point3d
|
|
70
70
|
|
71
71
|
# Instance Methods
|
72
72
|
|
73
|
-
# The
|
74
|
-
# a
|
73
|
+
# The {#+} operator is a fast way to add to the current x, y and z values of
|
74
|
+
# a vector.
|
75
75
|
#
|
76
|
-
# @example
|
77
|
-
#
|
78
|
-
#
|
76
|
+
# @example Using vector
|
77
|
+
# point1 = Geom::Point3d.new(1, 2, 3)
|
78
|
+
# vector = Geom::Vector3d.new(4, 5, 6)
|
79
|
+
# point2 = point1 + vector
|
79
80
|
#
|
80
|
-
# @
|
81
|
-
#
|
81
|
+
# @example Using array
|
82
|
+
# point1 = Geom::Point3d.new(1, 2, 3)
|
83
|
+
# point2 = point1 + [10,10,10]
|
84
|
+
#
|
85
|
+
# @example Using point
|
86
|
+
# point1 = Geom::Point3d.new(1, 2, 3)
|
87
|
+
# point2 = Geom::Point3d.new(4, 5, 6)
|
88
|
+
# # This works because SketchUp treats the array of tripple numerics as
|
89
|
+
# # a vector in this case.
|
90
|
+
# point3 = point1 + point2.to_a
|
91
|
+
#
|
92
|
+
# @param [Geom::Vector3d] vector
|
82
93
|
#
|
83
94
|
# @return [Geom::Point3d]
|
84
95
|
#
|
85
96
|
# @version SketchUp 6.0
|
86
|
-
def +(
|
97
|
+
def +(vector)
|
87
98
|
end
|
88
99
|
|
89
100
|
# The '-' operator is a fast way to subtract from the current x, y and z values
|
@@ -292,9 +303,9 @@ class Geom::Point3d
|
|
292
303
|
# @param [Geom::Point3d] point3d
|
293
304
|
# @return [Geom::Point3d]
|
294
305
|
#
|
295
|
-
# @overload initialize(
|
306
|
+
# @overload initialize(array3d)
|
296
307
|
#
|
297
|
-
# @param [
|
308
|
+
# @param [Array(Numeric, Numeric, Numeric)] array3d
|
298
309
|
# @return [Geom::Point3d]
|
299
310
|
#
|
300
311
|
# @overload initialize(array2d)
|
@@ -307,9 +318,9 @@ class Geom::Point3d
|
|
307
318
|
# @param [Sketchup::InputPoint] input_point
|
308
319
|
# @return [Geom::Point3d]
|
309
320
|
#
|
310
|
-
# @overload initialize(
|
321
|
+
# @overload initialize(vertex)
|
311
322
|
#
|
312
|
-
# @param [
|
323
|
+
# @param [Sketchup::Vertex] vertex
|
313
324
|
# @return [Geom::Point3d]
|
314
325
|
#
|
315
326
|
# @version SketchUp 6.0
|
@@ -470,14 +481,14 @@ class Geom::Point3d
|
|
470
481
|
# @param [Numeric] z The z value for the point.
|
471
482
|
# @return [Geom::Point3d] The newly set Point3d object
|
472
483
|
#
|
473
|
-
# @overload set!(
|
484
|
+
# @overload set!(array3d)
|
474
485
|
#
|
475
|
-
# @param
|
486
|
+
# @param [Array(Numeric, Numeric, Numeric)] array3d
|
476
487
|
# @return [Geom::Point3d]
|
477
488
|
#
|
478
|
-
# @overload set!(
|
489
|
+
# @overload set!(point3d)
|
479
490
|
#
|
480
|
-
# @param [
|
491
|
+
# @param point3d [Geom::Point3d]
|
481
492
|
# @return [Geom::Point3d]
|
482
493
|
#
|
483
494
|
# @version SketchUp 6.0
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The {#Geom::PolygonMesh} class contains methods to create polygon mesh
|
@@ -177,17 +177,19 @@ class Geom::PolygonMesh
|
|
177
177
|
#
|
178
178
|
# @return [Geom::PolygonMesh]
|
179
179
|
#
|
180
|
-
# @overload initialize(numpts
|
180
|
+
# @overload initialize(numpts)
|
181
181
|
#
|
182
182
|
# @param [Integer] numpts How many points will be in the mesh.
|
183
|
-
# @param [Integer] numpolys How many polygons will be in the mesh.
|
184
183
|
# @return [Geom::PolygonMesh]
|
185
184
|
#
|
186
|
-
# @overload initialize(numpts)
|
185
|
+
# @overload initialize(numpts, numpolys)
|
187
186
|
#
|
188
187
|
# @param [Integer] numpts How many points will be in the mesh.
|
188
|
+
# @param [Integer] numpolys How many polygons will be in the mesh.
|
189
189
|
# @return [Geom::PolygonMesh]
|
190
190
|
#
|
191
|
+
# @raise [RangeError] If number of points or polygons are negative numbers.
|
192
|
+
#
|
191
193
|
# @version SketchUp 6.0
|
192
194
|
def initialize(*args)
|
193
195
|
end
|
@@ -201,7 +203,7 @@ class Geom::PolygonMesh
|
|
201
203
|
# mesh = face.mesh(flags)
|
202
204
|
# normal = mesh.normal_at(1)
|
203
205
|
#
|
204
|
-
# @note Index
|
206
|
+
# @note Index starts at 1.
|
205
207
|
#
|
206
208
|
# @param [Integer] index
|
207
209
|
# The index in the mesh for the vertex normal to be
|
@@ -224,7 +226,7 @@ class Geom::PolygonMesh
|
|
224
226
|
# mesh.add_point(point2)
|
225
227
|
# point_from_index = mesh.point_at(1)
|
226
228
|
#
|
227
|
-
# @note Index
|
229
|
+
# @note Index starts at 1.
|
228
230
|
#
|
229
231
|
# @param [Integer] index
|
230
232
|
# The index in the mesh for the point to be retrieved
|
@@ -277,12 +279,6 @@ class Geom::PolygonMesh
|
|
277
279
|
# The {#polygon_at} method is used to retrieve an array of vertex index values
|
278
280
|
# for a polygon at a specific index.
|
279
281
|
#
|
280
|
-
# values with the sign indicating a hidden edge. For example, a return value of
|
281
|
-
# +[-1, 2, 3]+ indicates that the edge from +1+ to +2+ is hidden. The negative
|
282
|
-
# values should not be used as an index for point_at, take the positive value
|
283
|
-
# of the index value in the polygon array. So if you get +[-1, 2,3]+ use +1+
|
284
|
-
# as the argument to {#point_at}.
|
285
|
-
#
|
286
282
|
# @example
|
287
283
|
# mesh = Geom::PolygonMesh.new
|
288
284
|
# point1 = Geom::Point3d.new(0, 1, 2)
|
@@ -291,7 +287,14 @@ class Geom::PolygonMesh
|
|
291
287
|
# index = mesh.add_polygon(point1, point2, point3)
|
292
288
|
# polygon = mesh.polygon_at(index)
|
293
289
|
#
|
294
|
-
# @note Index
|
290
|
+
# @note Index starts at 1.
|
291
|
+
#
|
292
|
+
# @note The returned array can contain negative
|
293
|
+
# values with the sign indicating a hidden edge. For example, a return value
|
294
|
+
# of +[-1, 2, 3]+ indicates that the edge from +1+ to +2+ is hidden. The
|
295
|
+
# negative values should not be used as an index for {#point_at}, take the
|
296
|
+
# absolute value of the index value in the polygon array. So if you
|
297
|
+
# get +[-1, 2,3]+ use +1+ as the argument to {#point_at}.
|
295
298
|
#
|
296
299
|
# @param [Integer] index
|
297
300
|
# The index of the desired polygon.
|
@@ -313,6 +316,8 @@ class Geom::PolygonMesh
|
|
313
316
|
# index = mesh.add_polygon(point1, point2, point3)
|
314
317
|
# points = mesh.polygon_points_at(index)
|
315
318
|
#
|
319
|
+
# @note Index starts at 1.
|
320
|
+
#
|
316
321
|
# @param [Integer] index
|
317
322
|
# An index for a polygon in the mesh.
|
318
323
|
#
|
@@ -403,14 +408,14 @@ class Geom::PolygonMesh
|
|
403
408
|
# @note If you don't specify how many points you will be adding to the mesh
|
404
409
|
# when you initiate it you may risk the UV data becoming out of sync.
|
405
410
|
#
|
406
|
-
# @param [
|
407
|
-
#
|
411
|
+
# @param [Integer] index
|
412
|
+
# An Integer representing the UV index.
|
408
413
|
#
|
409
414
|
# @param [Geom::Point3d] point
|
410
415
|
# A Point3d object representing UV coordinates.
|
411
416
|
#
|
412
|
-
# @param [
|
413
|
-
#
|
417
|
+
# @param [Boolean] front
|
418
|
+
# A boolean representing the front or back.
|
414
419
|
#
|
415
420
|
# @return [nil]
|
416
421
|
#
|