sketchup-api-stubs 0.3.1 → 0.4.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 +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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Transformations are a standard construct in the 3D world for representing
|
|
@@ -129,6 +129,13 @@ class Geom::Transformation
|
|
|
129
129
|
# @param [Float] zscale The scale factor in the z direction for the transform.
|
|
130
130
|
# @return [Geom::Transformation]
|
|
131
131
|
#
|
|
132
|
+
# @overload scaling(point, scale)
|
|
133
|
+
#
|
|
134
|
+
# With two arguments, it does a uniform scale about an arbitrary point.
|
|
135
|
+
# @param [Geom::Point3d] point
|
|
136
|
+
# @param [Float] scale The global scale factor for the transform.
|
|
137
|
+
# @return [Geom::Transformation]
|
|
138
|
+
#
|
|
132
139
|
# @overload scaling(point, xscale, yscale, zscale)
|
|
133
140
|
#
|
|
134
141
|
# With four arguments it does a non-uniform scale about an arbitrary point.
|
|
@@ -138,13 +145,6 @@ class Geom::Transformation
|
|
|
138
145
|
# @param [Float] zscale The scale factor in the z direction for the transform.
|
|
139
146
|
# @return [Geom::Transformation]
|
|
140
147
|
#
|
|
141
|
-
# @overload scaling(point, scale)
|
|
142
|
-
#
|
|
143
|
-
# With two arguments, it does a uniform scale about an arbitrary point.
|
|
144
|
-
# @param [Geom::Point3d] point
|
|
145
|
-
# @param [Float] scale The global scale factor for the transform.
|
|
146
|
-
# @return [Geom::Transformation]
|
|
147
|
-
#
|
|
148
148
|
# @version SketchUp 6.0
|
|
149
149
|
def self.scaling(*args)
|
|
150
150
|
end
|
|
@@ -196,20 +196,20 @@ class Geom::Transformation
|
|
|
196
196
|
# @param [Geom::Transformation] transformation
|
|
197
197
|
# @return [Geom::Transformation]
|
|
198
198
|
#
|
|
199
|
-
# @overload *(
|
|
199
|
+
# @overload *(point)
|
|
200
200
|
#
|
|
201
|
-
# @param [Array<Float, Float, Float
|
|
202
|
-
# @return [Array<Float, Float, Float
|
|
201
|
+
# @param [Array<Float, Float, Float>] point
|
|
202
|
+
# @return [Array<Float, Float, Float>]
|
|
203
203
|
#
|
|
204
204
|
# @overload *(plane)
|
|
205
205
|
#
|
|
206
206
|
# @param [Array<Geom::Point3d, Geom::Vector3d>] plane
|
|
207
207
|
# @return [Array<Float, Float, Float, Float>] transformed plane
|
|
208
208
|
#
|
|
209
|
-
# @overload *(
|
|
209
|
+
# @overload *(plane)
|
|
210
210
|
#
|
|
211
|
-
# @param [Array<Float, Float, Float>]
|
|
212
|
-
# @return [
|
|
211
|
+
# @param [Array<Float, Float, Float, Float>] plane
|
|
212
|
+
# @return [Array<Float, Float, Float, Float>] transformed plane
|
|
213
213
|
#
|
|
214
214
|
# @version SketchUp 6.0
|
|
215
215
|
def *(arg)
|
|
@@ -232,13 +232,15 @@ class Geom::Transformation
|
|
|
232
232
|
# {IDENTITY} transform.
|
|
233
233
|
#
|
|
234
234
|
# @example
|
|
235
|
-
#
|
|
235
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
|
236
|
+
# tr = Geom::Transformation.new(point)
|
|
236
237
|
# # Returns false.
|
|
237
238
|
# status = tr.identity?
|
|
238
239
|
#
|
|
239
240
|
# @example
|
|
240
|
-
#
|
|
241
|
-
#
|
|
241
|
+
# tr = Geom::Transformation.new(ORIGIN)
|
|
242
|
+
# # Returns false.
|
|
243
|
+
# status = tr.identity?
|
|
242
244
|
#
|
|
243
245
|
# @example
|
|
244
246
|
# tr = Geom::Transformation.new
|
|
@@ -246,10 +248,8 @@ class Geom::Transformation
|
|
|
246
248
|
# status = tr.identity?
|
|
247
249
|
#
|
|
248
250
|
# @example
|
|
249
|
-
#
|
|
250
|
-
#
|
|
251
|
-
# # Returns false.
|
|
252
|
-
# status = tr.identity?
|
|
251
|
+
# # Returns true.
|
|
252
|
+
# status = IDENTITY.identity?
|
|
253
253
|
#
|
|
254
254
|
# @note As of SketchUp 2018, this now looks at the data to determine if the
|
|
255
255
|
# transformation is identity. Prior to SU2018, this only looks at the flag to
|
|
@@ -300,12 +300,12 @@ class Geom::Transformation
|
|
|
300
300
|
# @param [Array<Float>] Creates a Transformation from a 16 element Array.
|
|
301
301
|
# @return [Geom::Transformation]
|
|
302
302
|
#
|
|
303
|
-
# @overload initialize(
|
|
303
|
+
# @overload initialize(scale)
|
|
304
304
|
#
|
|
305
|
-
#
|
|
306
|
-
# @
|
|
307
|
-
#
|
|
308
|
-
# @param [
|
|
305
|
+
# Creates a transformation that does uniform scaling.
|
|
306
|
+
# @note Versions prior to SU2018 would produce transformations which
|
|
307
|
+
# didn't always work right in SketchUp. See {.scaling} for more info.
|
|
308
|
+
# @param [Float] scale
|
|
309
309
|
# @return [Geom::Transformation]
|
|
310
310
|
#
|
|
311
311
|
# @overload initialize(origin, zaxis)
|
|
@@ -333,12 +333,12 @@ class Geom::Transformation
|
|
|
333
333
|
# @param [Float] angle
|
|
334
334
|
# @return [Geom::Transformation]
|
|
335
335
|
#
|
|
336
|
-
# @overload initialize(
|
|
336
|
+
# @overload initialize(xaxis, yaxis, zaxis, origin)
|
|
337
337
|
#
|
|
338
|
-
#
|
|
339
|
-
# @
|
|
340
|
-
#
|
|
341
|
-
# @param [
|
|
338
|
+
# @param [Geom::Vector3d] xaxis
|
|
339
|
+
# @param [Geom::Vector3d] yaxis
|
|
340
|
+
# @param [Geom::Vector3d] zaxis
|
|
341
|
+
# @param [Geom::Point3d] origin
|
|
342
342
|
# @return [Geom::Transformation]
|
|
343
343
|
#
|
|
344
344
|
# @version SketchUp 6.0
|
|
@@ -404,9 +404,9 @@ class Geom::Transformation
|
|
|
404
404
|
# @param [Geom::Point3d] point
|
|
405
405
|
# @return [Geom::Transformation]
|
|
406
406
|
#
|
|
407
|
-
# @overload set!(
|
|
407
|
+
# @overload set!(vector)
|
|
408
408
|
#
|
|
409
|
-
# @param [
|
|
409
|
+
# @param [Geom::Vector3d] vector
|
|
410
410
|
# @return [Geom::Transformation]
|
|
411
411
|
#
|
|
412
412
|
# @overload set!(matrix)
|
|
@@ -414,9 +414,9 @@ class Geom::Transformation
|
|
|
414
414
|
# @param [Array<Float>] matrix Array of 16 floats.
|
|
415
415
|
# @return [Geom::Transformation]
|
|
416
416
|
#
|
|
417
|
-
# @overload set!(
|
|
417
|
+
# @overload set!(scale)
|
|
418
418
|
#
|
|
419
|
-
# @param [
|
|
419
|
+
# @param [Float] scale
|
|
420
420
|
# @return [Geom::Transformation]
|
|
421
421
|
#
|
|
422
422
|
# @version SketchUp 6.0
|
|
@@ -1,12 +1,126 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
#
|
|
5
5
|
# @version LayOut 2018
|
|
6
6
|
class Geom::Transformation2d
|
|
7
7
|
|
|
8
|
+
# Class Methods
|
|
9
|
+
|
|
10
|
+
# The {.rotation} method is used to create a transformation that does rotation
|
|
11
|
+
# about a point.
|
|
12
|
+
#
|
|
13
|
+
# @example
|
|
14
|
+
# point = Geom::Point2d.new(10, 5)
|
|
15
|
+
# angle = 45.degrees # Return 45 degrees in radians.
|
|
16
|
+
# transformation = Geom::Transformation2d.rotation(point, angle)
|
|
17
|
+
#
|
|
18
|
+
# @param [Geom::Point2d] point
|
|
19
|
+
#
|
|
20
|
+
# @param [Float] angle
|
|
21
|
+
# The angle in radians.
|
|
22
|
+
#
|
|
23
|
+
# @return [Geom::Transformation2d]
|
|
24
|
+
#
|
|
25
|
+
# @version LayOut 2019
|
|
26
|
+
def self.rotation(point, angle)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# The {.scaling} method is used to create a transformation that does scaling.
|
|
30
|
+
#
|
|
31
|
+
# @example
|
|
32
|
+
# point = Geom::Point3d.new(20, 30, 0)
|
|
33
|
+
# scale = 10
|
|
34
|
+
# tr = Geom::Transformation2d.scaling(point, scale)
|
|
35
|
+
#
|
|
36
|
+
# @overload scaling(scale)
|
|
37
|
+
#
|
|
38
|
+
# With one argument, it does a uniform scale about the origin.
|
|
39
|
+
# @param [Float] scale The global scale factor for the transform.
|
|
40
|
+
# @return [Geom::Transformation2d]
|
|
41
|
+
#
|
|
42
|
+
# @overload scaling(xscale, yscale)
|
|
43
|
+
#
|
|
44
|
+
# With two arguments, it does a non-uniform scale about the origin.
|
|
45
|
+
# @param [Float] xscale The scale factor in the x direction for the transform.
|
|
46
|
+
# @param [Float] yscale The scale factor in the y direction for the transform.
|
|
47
|
+
# @return [Geom::Transformation2d]
|
|
48
|
+
#
|
|
49
|
+
# @overload scaling(point, scale)
|
|
50
|
+
#
|
|
51
|
+
# With two arguments, it does a uniform scale about an arbitrary point.
|
|
52
|
+
# @param [Geom::Point2d] point
|
|
53
|
+
# @param [Float] scale The global scale factor for the transform.
|
|
54
|
+
# @return [Geom::Transformation2d]
|
|
55
|
+
#
|
|
56
|
+
# @overload scaling(point, xscale, yscale)
|
|
57
|
+
#
|
|
58
|
+
# With three arguments it does a non-uniform scale about an arbitrary point.
|
|
59
|
+
# @param [Geom::Point2d] point
|
|
60
|
+
# @param [Float] xscale The scale factor in the x direction for the transform.
|
|
61
|
+
# @param [Float] yscale The scale factor in the y direction for the transform.
|
|
62
|
+
# @return [Geom::Transformation2d]
|
|
63
|
+
#
|
|
64
|
+
# @version LayOut 2019
|
|
65
|
+
def self.scaling(*args)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# The {.translation} method is used to create a transformation that does
|
|
69
|
+
# translation.
|
|
70
|
+
#
|
|
71
|
+
# @example
|
|
72
|
+
# vector = Geom::Vector2d.new(0, 1)
|
|
73
|
+
# tr = Geom::Transformation2d.translation(vector)
|
|
74
|
+
#
|
|
75
|
+
# @overload translation(vector)
|
|
76
|
+
#
|
|
77
|
+
# @param [Geom::Vector2d] vector
|
|
78
|
+
# @return [Geom::Transformation2d]
|
|
79
|
+
#
|
|
80
|
+
# @overload translation(point)
|
|
81
|
+
#
|
|
82
|
+
# @param [Geom::Point2d] point
|
|
83
|
+
# @return [Geom::Transformation2d]
|
|
84
|
+
#
|
|
85
|
+
# @version LayOut 2019
|
|
86
|
+
def self.translation(vector)
|
|
87
|
+
end
|
|
88
|
+
|
|
8
89
|
# Instance Methods
|
|
9
90
|
|
|
91
|
+
# The {#*} method is used to do matrix multiplication using the transform.
|
|
92
|
+
#
|
|
93
|
+
# @example
|
|
94
|
+
# point1 = Geom::Point2d.new(5, 10)
|
|
95
|
+
# point2 = Geom::Point2d.new(2, 2)
|
|
96
|
+
# tr = Geom::Transformation2d.new(point1)
|
|
97
|
+
# # Returns Point2d(7, 12)
|
|
98
|
+
# point3 = tr * point2
|
|
99
|
+
#
|
|
100
|
+
# @overload *(point)
|
|
101
|
+
#
|
|
102
|
+
# @param [Geom::Point2d] point
|
|
103
|
+
# @return [Geom::Point2d]
|
|
104
|
+
#
|
|
105
|
+
# @overload *(vector)
|
|
106
|
+
#
|
|
107
|
+
# @param [Geom::Vector2d] vector
|
|
108
|
+
# @return [Geom::Vector2d]
|
|
109
|
+
#
|
|
110
|
+
# @overload *(transformation)
|
|
111
|
+
#
|
|
112
|
+
# @param [Geom::Transformation2d] transformation
|
|
113
|
+
# @return [Geom::Transformation2d]
|
|
114
|
+
#
|
|
115
|
+
# @overload *(point)
|
|
116
|
+
#
|
|
117
|
+
# @param [Array<Float, Float>] point
|
|
118
|
+
# @return [Array<Float, Float>]
|
|
119
|
+
#
|
|
120
|
+
# @version LayOut 2019
|
|
121
|
+
def *(arg)
|
|
122
|
+
end
|
|
123
|
+
|
|
10
124
|
# The {#==} method checks to see if the two {Geom::Transformation2d}s are equal.
|
|
11
125
|
# This checks whether the values of the transformations are the same.
|
|
12
126
|
#
|
|
@@ -38,19 +152,19 @@ class Geom::Transformation2d
|
|
|
38
152
|
# {IDENTITY_2D} transform.
|
|
39
153
|
#
|
|
40
154
|
# @example
|
|
41
|
-
#
|
|
42
|
-
#
|
|
155
|
+
# array = {1.0, 0.0, 0.0, 1.0, 1.0, 0.0}
|
|
156
|
+
# tr = Geom::Transformation2d.new(array)
|
|
157
|
+
# # Returns false.
|
|
43
158
|
# status = tr.identity?
|
|
44
159
|
#
|
|
45
160
|
# @example
|
|
161
|
+
# tr = Geom::Transformation2d.new
|
|
46
162
|
# # Returns true.
|
|
47
|
-
# status =
|
|
163
|
+
# status = tr.identity?
|
|
48
164
|
#
|
|
49
165
|
# @example
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
# # Returns false.
|
|
53
|
-
# status = tr.identity?
|
|
166
|
+
# # Returns true.
|
|
167
|
+
# status = IDENTITY_2D.identity?
|
|
54
168
|
#
|
|
55
169
|
# @return [Boolean] +true+ if the transform is the identity
|
|
56
170
|
#
|
|
@@ -71,11 +185,6 @@ class Geom::Transformation2d
|
|
|
71
185
|
#
|
|
72
186
|
# @return [Geom::Transformation2d] identity Transformation2d.
|
|
73
187
|
#
|
|
74
|
-
# @overload initialize(array)
|
|
75
|
-
#
|
|
76
|
-
# @param [Array<Float>] array A 6 element Array.
|
|
77
|
-
# @return [Geom::Transformation2d]
|
|
78
|
-
#
|
|
79
188
|
# @overload initialize(transformation)
|
|
80
189
|
#
|
|
81
190
|
# Creates a Transformation2d that is a copy of another Transformation2d.
|
|
@@ -83,10 +192,41 @@ class Geom::Transformation2d
|
|
|
83
192
|
# @param [Geom::Transformation2d] transform
|
|
84
193
|
# @return [Geom::Transformation2d]
|
|
85
194
|
#
|
|
195
|
+
# @overload initialize(array)
|
|
196
|
+
#
|
|
197
|
+
# @param [Array<Float>] array A 6 element Array.
|
|
198
|
+
# @return [Geom::Transformation2d]
|
|
199
|
+
#
|
|
86
200
|
# @version LayOut 2018
|
|
87
201
|
def initialize(*args)
|
|
88
202
|
end
|
|
89
203
|
|
|
204
|
+
# The {#inverse} method is used to retrieve the inverse of a transformation.
|
|
205
|
+
#
|
|
206
|
+
# @example
|
|
207
|
+
# point = Geom::Point2d.new(5, 10)
|
|
208
|
+
# tr1 = Geom::Transformation2d.new(point)
|
|
209
|
+
# tr2 = tr1.inverse
|
|
210
|
+
#
|
|
211
|
+
# @return [Geom::Transformation2d]
|
|
212
|
+
#
|
|
213
|
+
# @version LayOut 2019
|
|
214
|
+
def inverse
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# The {#invert!} method sets the transformation to its inverse.
|
|
218
|
+
#
|
|
219
|
+
# @example
|
|
220
|
+
# point = Geom::Point2d.new(5, 10)
|
|
221
|
+
# tr = Geom::Transformation2d.new(point)
|
|
222
|
+
# tr.invert!
|
|
223
|
+
#
|
|
224
|
+
# @return [Geom::Transformation2d]
|
|
225
|
+
#
|
|
226
|
+
# @version LayOut 2019
|
|
227
|
+
def invert!
|
|
228
|
+
end
|
|
229
|
+
|
|
90
230
|
# The {#set!} method sets the {Geom::Transformation2d} to match another one.
|
|
91
231
|
# The argument is anything that can be converted into a {Geom::Transformation2d}.
|
|
92
232
|
#
|
data/SketchUp/Geom/UTM.rb
CHANGED
data/SketchUp/Geom/Vector2d.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 Vector2d class represents vectors in a 2 dimensional space.
|
|
@@ -98,7 +98,7 @@ class Geom::Vector2d
|
|
|
98
98
|
# # retrieves the y value of 2
|
|
99
99
|
# yvalue = vector[1]
|
|
100
100
|
#
|
|
101
|
-
# @param [
|
|
101
|
+
# @param [Integer] index
|
|
102
102
|
# The index into an array of two coordinates.
|
|
103
103
|
#
|
|
104
104
|
# @return [Numeric] The value for the x or y coordinate.
|
|
@@ -199,17 +199,17 @@ class Geom::Vector2d
|
|
|
199
199
|
#
|
|
200
200
|
# @return [Geom::Vector2d]
|
|
201
201
|
#
|
|
202
|
-
# @overload initialize(vector)
|
|
203
|
-
#
|
|
204
|
-
# @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
|
|
205
|
-
# @return [Geom::Vector2d]
|
|
206
|
-
#
|
|
207
202
|
# @overload initialize(x, y)
|
|
208
203
|
#
|
|
209
204
|
# @param [Numeric] x The length in the x direction
|
|
210
205
|
# @param [Numeric] y The length in the y direction
|
|
211
206
|
# @return [Geom::Vector2d]
|
|
212
207
|
#
|
|
208
|
+
# @overload initialize(vector)
|
|
209
|
+
#
|
|
210
|
+
# @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
|
|
211
|
+
# @return [Geom::Vector2d]
|
|
212
|
+
#
|
|
213
213
|
# @version LayOut 2018
|
|
214
214
|
def initialize(*args)
|
|
215
215
|
end
|
|
@@ -233,14 +233,14 @@ class Geom::Vector2d
|
|
|
233
233
|
# # returns 4
|
|
234
234
|
# l = vector.length
|
|
235
235
|
#
|
|
236
|
-
# @return [
|
|
236
|
+
# @return [Length] The length of the {Geom::Vector2d}
|
|
237
237
|
#
|
|
238
238
|
# @version LayOut 2018
|
|
239
239
|
def length
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
# The {#length=} method sets the length of the {Geom::Vector2d}. The new length
|
|
243
|
-
# must be
|
|
243
|
+
# must not be 0.
|
|
244
244
|
#
|
|
245
245
|
# @example
|
|
246
246
|
# vector = Geom::Vector2d.new(0, 4)
|
|
@@ -409,6 +409,42 @@ class Geom::Vector2d
|
|
|
409
409
|
def to_s
|
|
410
410
|
end
|
|
411
411
|
|
|
412
|
+
# The {#transform} method applies a transformation to a vector, returning a new
|
|
413
|
+
# vector. The original vector is unchanged by this method.
|
|
414
|
+
#
|
|
415
|
+
# @example
|
|
416
|
+
# vector = Geom::Vector2d.new(4, 5)
|
|
417
|
+
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
|
418
|
+
# # vector2 will be (6, 8)
|
|
419
|
+
# vector2 = vector.transform(transformation)
|
|
420
|
+
#
|
|
421
|
+
# @param [Geom::Transformation2d] transform
|
|
422
|
+
# A transformation object to apply to the vector.
|
|
423
|
+
#
|
|
424
|
+
# @return [Geom::Vector2d] the newly transformed vector
|
|
425
|
+
#
|
|
426
|
+
# @version LayOut 2019
|
|
427
|
+
def transform(transform)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# The {#transform!} method applies a transformation to a vector. The vector
|
|
431
|
+
# itself is modified.
|
|
432
|
+
#
|
|
433
|
+
# @example
|
|
434
|
+
# vector = Geom::Vector2d.new(4, 5)
|
|
435
|
+
# transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
|
|
436
|
+
# # vector will be (6, 8)
|
|
437
|
+
# vector.transform!(transformation)
|
|
438
|
+
#
|
|
439
|
+
# @param [Geom::Transformation2d] transform
|
|
440
|
+
# A Transformation object to apply to the vector.
|
|
441
|
+
#
|
|
442
|
+
# @return [Geom::Vector2d] the transformed vector
|
|
443
|
+
#
|
|
444
|
+
# @version LayOut 2019
|
|
445
|
+
def transform!(transform)
|
|
446
|
+
end
|
|
447
|
+
|
|
412
448
|
# The {#unit_vector?} method returns whether the {Geom::Vector2d} is a unit
|
|
413
449
|
# vector. This is equivalent to vector.length == 1.0
|
|
414
450
|
#
|