sketchup-api-stubs 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +151 -148
- data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +509 -523
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -693
- data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +747 -698
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +517 -516
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -692
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Length.rb +278 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +150 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -286
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -619
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -426
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -396
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -502
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1239 -1205
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -272
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -126
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -292
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -407
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -318
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1652 -1651
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -131
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -363
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -477
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +361 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -459
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +255 -260
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -837
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1311 -1317
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1377 -1360
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +494 -496
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +683 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -7
@@ -1,478 +1,476 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# Transformations are a standard construct in the 3D world for representing
|
5
|
-
# the position, rotation, and sizing of a given entity. In the SketchUp
|
6
|
-
# world, {Sketchup::ComponentInstance} and {Sketchup::Group} have a
|
7
|
-
# +.transformation+ method that reports their current state and various methods
|
8
|
-
# (+.move!+, +transformation=+, etc.) that allow them to be manipulated.
|
9
|
-
#
|
10
|
-
# Use of the transformation class requires a knowledge of geometrical
|
11
|
-
# transformations in 3 dimensions which is covered extensively on
|
12
|
-
# the
|
13
|
-
#
|
14
|
-
# @version SketchUp 6.0
|
15
|
-
class Geom::Transformation
|
16
|
-
|
17
|
-
# Class Methods
|
18
|
-
|
19
|
-
# The axes method creates a transformation that goes from world coordinates
|
20
|
-
# to an arbitrary coordinate system defined by an origin and three axis
|
21
|
-
# vectors.
|
22
|
-
#
|
23
|
-
# @example
|
24
|
-
# # Creates a transformation that "flips" the axes from XYZ to XZY. Something
|
25
|
-
# # one often need for importers/exporters when dealing with applications
|
26
|
-
# # that threat Y as "up".
|
27
|
-
# tr = Geom::Transformation.axes(ORIGIN, X_AXIS, Z_AXIS, Y_AXIS.reverse)
|
28
|
-
#
|
29
|
-
# @overload axes(origin, xaxis, yaxis, zaxis)
|
30
|
-
#
|
31
|
-
# @param [Geom::Point3d] origin
|
32
|
-
# @param [Geom::Vector3d] xaxis
|
33
|
-
# @param [Geom::Vector3d] yaxis
|
34
|
-
# @param [Geom::Vector3d] zaxis
|
35
|
-
# @return [Geom::Transformation]
|
36
|
-
#
|
37
|
-
# @overload axes(origin, xaxis, yaxis)
|
38
|
-
#
|
39
|
-
# When the Z axis is omitted and arbitrary axis is computed from the X and Y
|
40
|
-
# axes.
|
41
|
-
# @param [Geom::Point3d] origin
|
42
|
-
# @param [Geom::Vector3d] xaxis
|
43
|
-
# @param [Geom::Vector3d] yaxis
|
44
|
-
# @return [Geom::Transformation]
|
45
|
-
#
|
46
|
-
# @raise [ArgumentError] if any of the vectors are zero length.
|
47
|
-
#
|
48
|
-
# @version SketchUp 6.0
|
49
|
-
def self.axes(*args)
|
50
|
-
end
|
51
|
-
|
52
|
-
# The interpolate method is used to create a new transformation that is the
|
53
|
-
# result of interpolating between two other transformations.
|
54
|
-
#
|
55
|
-
# Parameter is a weight (between 0.0 and 1.0) that identifies whether to favor
|
56
|
-
# transformation1 or transformation2
|
57
|
-
#
|
58
|
-
# @example
|
59
|
-
# origin = Geom::Point3d.new(0, 0, 0)
|
60
|
-
# x = Geom::Vector3d.new(0, 1, 0)
|
61
|
-
# y = Geom::Vector3d.new(1, 0, 0)
|
62
|
-
# z = Geom::Vector3d.new(0, 0, 1)
|
63
|
-
# point = Geom::Point3d.new(10, 20, 30)
|
64
|
-
# t1 = Geom::Transformation.new(point)
|
65
|
-
# t2 = Geom::Transformation.axes(origin, x, y, z)
|
66
|
-
# # This produce a transformation that is a mix of 75% t1 and 25% t2.
|
67
|
-
# t3 = Geom::Transformation.interpolate(t1, t2, 0.25)
|
68
|
-
#
|
69
|
-
# @param [Geom::Transformation] transform1
|
70
|
-
#
|
71
|
-
# @param [Geom::Transformation] transform2
|
72
|
-
#
|
73
|
-
# @param [Float] weight
|
74
|
-
# A value between 0.0 and 1.0 (see comments).
|
75
|
-
#
|
76
|
-
# @return [Geom::Transformation]
|
77
|
-
#
|
78
|
-
# @version SketchUp 6.0
|
79
|
-
def self.interpolate(transform1, transform2, weight)
|
80
|
-
end
|
81
|
-
|
82
|
-
# The rotation method is used to create a transformation that does rotation
|
83
|
-
# about an axis.
|
84
|
-
#
|
85
|
-
# The axis is defined by a point and a vector. The angle is given in radians.
|
86
|
-
#
|
87
|
-
# @example
|
88
|
-
# point = Geom::Point3d.new(10, 20, 0)
|
89
|
-
# vector = Geom::Vector3d.new(0, 0, 1)
|
90
|
-
# angle = 45.degrees # Return 45 degrees in radians.
|
91
|
-
# transformation = Geom::Transformation.rotation(point, vector, angle)
|
92
|
-
#
|
93
|
-
# @param [Geom::Point3d] point
|
94
|
-
#
|
95
|
-
# @param [Geom::Vector3d] vector
|
96
|
-
#
|
97
|
-
# @param [Float] angle
|
98
|
-
# The angle in radians.
|
99
|
-
#
|
100
|
-
# @return [Geom::Transformation]
|
101
|
-
#
|
102
|
-
# @version SketchUp 6.0
|
103
|
-
def self.rotation(point, vector, angle)
|
104
|
-
end
|
105
|
-
|
106
|
-
# The scaling method is used to create a transformation that does scaling.
|
107
|
-
#
|
108
|
-
# @example
|
109
|
-
# point = Geom::Point3d.new(20, 30, 0)
|
110
|
-
# scale = 10
|
111
|
-
# tr = Geom::Transformation.scaling(point, scale)
|
112
|
-
#
|
113
|
-
# @overload scaling(scale)
|
114
|
-
#
|
115
|
-
# @note This has been fixed in SketchUp 2018 but in previous versions it
|
116
|
-
# might yield an unexpected transformation. It sets the 16th value
|
117
|
-
# to the scaling factor. Something not all extensions reading the
|
118
|
-
# transformation expects. Consider using +scaling(xscale, yscale, zscale)+
|
119
|
-
# instead.
|
120
|
-
# With one argument, it does a uniform scale about the origin.
|
121
|
-
# @param [Float] scale The global scale factor for the transform.
|
122
|
-
# @return [Geom::Transformation]
|
123
|
-
#
|
124
|
-
# @overload scaling(xscale, yscale, zscale)
|
125
|
-
#
|
126
|
-
# With three arguments, it does a non-uniform scale about the origin.
|
127
|
-
# @param [Float] xscale The scale factor in the x direction for the transform.
|
128
|
-
# @param [Float] yscale The scale factor in the y direction for the transform.
|
129
|
-
# @param [Float] zscale The scale factor in the z direction for the transform.
|
130
|
-
# @return [Geom::Transformation]
|
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
|
-
#
|
139
|
-
# @overload scaling(point, xscale, yscale, zscale)
|
140
|
-
#
|
141
|
-
# With four arguments it does a non-uniform scale about an arbitrary point.
|
142
|
-
# @param [Geom::Point3d] point
|
143
|
-
# @param [Float] xscale The scale factor in the x direction for the transform.
|
144
|
-
# @param [Float] yscale The scale factor in the y direction for the transform.
|
145
|
-
# @param [Float] zscale The scale factor in the z direction for the transform.
|
146
|
-
# @return [Geom::Transformation]
|
147
|
-
#
|
148
|
-
# @version SketchUp 6.0
|
149
|
-
def self.scaling(*args)
|
150
|
-
end
|
151
|
-
|
152
|
-
# The translation method is used to create a transformation that does
|
153
|
-
# translation.
|
154
|
-
#
|
155
|
-
# @example
|
156
|
-
# vector = Geom::Vector3d.new(0, 1, 0)
|
157
|
-
# tr = Geom::Transformation.translation(vector)
|
158
|
-
#
|
159
|
-
# @overload translation(vector)
|
160
|
-
#
|
161
|
-
# @param [Geom::Vector3d] vector
|
162
|
-
# @return [Geom::Transformation]
|
163
|
-
#
|
164
|
-
# @overload translation(point)
|
165
|
-
#
|
166
|
-
# @param [Geom::Point3d] point
|
167
|
-
# @return [Geom::Transformation]
|
168
|
-
#
|
169
|
-
# @version SketchUp 6.0
|
170
|
-
def self.translation(arg)
|
171
|
-
end
|
172
|
-
|
173
|
-
# Instance Methods
|
174
|
-
|
175
|
-
# The {#*} method is used to do matrix multiplication using the transform.
|
176
|
-
#
|
177
|
-
# @example
|
178
|
-
# point1 = Geom::Point3d.new(10, 20, 30)
|
179
|
-
# point2 = Geom::Point3d.new(2, 2, 2)
|
180
|
-
# tr = Geom::Transformation.new(point1)
|
181
|
-
# # Returns Point3d(12, 22, 32)
|
182
|
-
# point3 = tr * point2
|
183
|
-
#
|
184
|
-
# @overload *(point)
|
185
|
-
#
|
186
|
-
# @param [Geom::Point3d] point
|
187
|
-
# @return [Geom::Point3d]
|
188
|
-
#
|
189
|
-
# @overload *(vector)
|
190
|
-
#
|
191
|
-
# @param [Geom::Vector3d] vector
|
192
|
-
# @return [Geom::Vector3d]
|
193
|
-
#
|
194
|
-
# @overload *(transformation)
|
195
|
-
#
|
196
|
-
# @param [Geom::Transformation] transformation
|
197
|
-
# @return [Geom::Transformation]
|
198
|
-
#
|
199
|
-
# @overload *(point)
|
200
|
-
#
|
201
|
-
# @param [Array
|
202
|
-
# @return [Array
|
203
|
-
#
|
204
|
-
# @overload *(plane)
|
205
|
-
#
|
206
|
-
# @param [Array
|
207
|
-
# @return [Array
|
208
|
-
#
|
209
|
-
# @overload *(plane)
|
210
|
-
#
|
211
|
-
# @param [Array
|
212
|
-
# @return [Array
|
213
|
-
#
|
214
|
-
# @version SketchUp 6.0
|
215
|
-
def *(arg)
|
216
|
-
end
|
217
|
-
|
218
|
-
# The {#clone} method is used to create a copy of a transformation.
|
219
|
-
#
|
220
|
-
# @example
|
221
|
-
# point = Geom::Point3d.new(10, 20, 30)
|
222
|
-
# tr1 = Geom::Transformation.new(point)
|
223
|
-
# tr2 = tr1.clone
|
224
|
-
#
|
225
|
-
# @return [Geom::Transformation]
|
226
|
-
#
|
227
|
-
# @version SketchUp 6.0
|
228
|
-
def clone
|
229
|
-
end
|
230
|
-
|
231
|
-
# The {#identity?} method is used to determine if a transformation is the
|
232
|
-
# {IDENTITY} transform.
|
233
|
-
#
|
234
|
-
# @example
|
235
|
-
# point = Geom::Point3d.new(10, 20, 30)
|
236
|
-
# tr = Geom::Transformation.new(point)
|
237
|
-
# # Returns false.
|
238
|
-
# status = tr.identity?
|
239
|
-
#
|
240
|
-
# @example
|
241
|
-
# tr = Geom::Transformation.new(ORIGIN)
|
242
|
-
# # Returns false.
|
243
|
-
# status = tr.identity?
|
244
|
-
#
|
245
|
-
# @example
|
246
|
-
# tr = Geom::Transformation.new
|
247
|
-
# # Returns true.
|
248
|
-
# status = tr.identity?
|
249
|
-
#
|
250
|
-
# @example
|
251
|
-
# # Returns true.
|
252
|
-
# status = IDENTITY.identity?
|
253
|
-
#
|
254
|
-
# @note As of SketchUp 2018, this now looks at the data to determine if the
|
255
|
-
# transformation is identity. Prior to SU2018, this only looks at the flag to
|
256
|
-
# see if the transform has not been modified. If the transform has been
|
257
|
-
# changed, this will return false even if it is really the identity.
|
258
|
-
#
|
259
|
-
# @return [Boolean] +true+ if the transformation is the identity
|
260
|
-
#
|
261
|
-
# @version SketchUp 6.0
|
262
|
-
def identity?
|
263
|
-
end
|
264
|
-
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
#
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
#
|
301
|
-
#
|
302
|
-
#
|
303
|
-
#
|
304
|
-
# @
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
# @
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
# @param [Geom::
|
321
|
-
# @
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
# @param [
|
330
|
-
# @
|
331
|
-
#
|
332
|
-
#
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
336
|
-
# @param [Geom::Vector3d]
|
337
|
-
# @param [Geom::
|
338
|
-
# @
|
339
|
-
#
|
340
|
-
#
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
#
|
347
|
-
#
|
348
|
-
#
|
349
|
-
#
|
350
|
-
#
|
351
|
-
#
|
352
|
-
#
|
353
|
-
# @
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
# @
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
#
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
#
|
379
|
-
# @
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
# The
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
# tr1
|
392
|
-
#
|
393
|
-
#
|
394
|
-
#
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
404
|
-
#
|
405
|
-
#
|
406
|
-
#
|
407
|
-
#
|
408
|
-
#
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
#
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
# @
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
#
|
440
|
-
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
446
|
-
# @
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
#
|
453
|
-
#
|
454
|
-
#
|
455
|
-
#
|
456
|
-
#
|
457
|
-
#
|
458
|
-
#
|
459
|
-
# @
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
#
|
466
|
-
#
|
467
|
-
#
|
468
|
-
#
|
469
|
-
#
|
470
|
-
#
|
471
|
-
#
|
472
|
-
# @
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
end
|
1
|
+
# Copyright:: Copyright 2023 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# Transformations are a standard construct in the 3D world for representing
|
5
|
+
# the position, rotation, and sizing of a given entity. In the SketchUp
|
6
|
+
# world, {Sketchup::ComponentInstance} and {Sketchup::Group} have a
|
7
|
+
# +.transformation+ method that reports their current state and various methods
|
8
|
+
# (+.move!+, +transformation=+, etc.) that allow them to be manipulated.
|
9
|
+
#
|
10
|
+
# Use of the transformation class requires a knowledge of geometrical
|
11
|
+
# transformations in 3 dimensions which is covered extensively on
|
12
|
+
# the internet.
|
13
|
+
#
|
14
|
+
# @version SketchUp 6.0
|
15
|
+
class Geom::Transformation
|
16
|
+
|
17
|
+
# Class Methods
|
18
|
+
|
19
|
+
# The {.axes} method creates a transformation that goes from world coordinates
|
20
|
+
# to an arbitrary coordinate system defined by an origin and three axis
|
21
|
+
# vectors.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# # Creates a transformation that "flips" the axes from XYZ to XZY. Something
|
25
|
+
# # one often need for importers/exporters when dealing with applications
|
26
|
+
# # that threat Y as "up".
|
27
|
+
# tr = Geom::Transformation.axes(ORIGIN, X_AXIS, Z_AXIS, Y_AXIS.reverse)
|
28
|
+
#
|
29
|
+
# @overload axes(origin, xaxis, yaxis, zaxis)
|
30
|
+
#
|
31
|
+
# @param [Geom::Point3d] origin
|
32
|
+
# @param [Geom::Vector3d] xaxis
|
33
|
+
# @param [Geom::Vector3d] yaxis
|
34
|
+
# @param [Geom::Vector3d] zaxis
|
35
|
+
# @return [Geom::Transformation]
|
36
|
+
#
|
37
|
+
# @overload axes(origin, xaxis, yaxis)
|
38
|
+
#
|
39
|
+
# When the Z axis is omitted and arbitrary axis is computed from the X and Y
|
40
|
+
# axes.
|
41
|
+
# @param [Geom::Point3d] origin
|
42
|
+
# @param [Geom::Vector3d] xaxis
|
43
|
+
# @param [Geom::Vector3d] yaxis
|
44
|
+
# @return [Geom::Transformation]
|
45
|
+
#
|
46
|
+
# @raise [ArgumentError] if any of the vectors are zero length.
|
47
|
+
#
|
48
|
+
# @version SketchUp 6.0
|
49
|
+
def self.axes(*args)
|
50
|
+
end
|
51
|
+
|
52
|
+
# The {.interpolate} method is used to create a new transformation that is the
|
53
|
+
# result of interpolating between two other transformations.
|
54
|
+
#
|
55
|
+
# Parameter is a weight (between `0.0` and `1.0`) that identifies whether to favor
|
56
|
+
# `transformation1` or `transformation2`.
|
57
|
+
#
|
58
|
+
# @example
|
59
|
+
# origin = Geom::Point3d.new(0, 0, 0)
|
60
|
+
# x = Geom::Vector3d.new(0, 1, 0)
|
61
|
+
# y = Geom::Vector3d.new(1, 0, 0)
|
62
|
+
# z = Geom::Vector3d.new(0, 0, 1)
|
63
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
64
|
+
# t1 = Geom::Transformation.new(point)
|
65
|
+
# t2 = Geom::Transformation.axes(origin, x, y, z)
|
66
|
+
# # This produce a transformation that is a mix of 75% t1 and 25% t2.
|
67
|
+
# t3 = Geom::Transformation.interpolate(t1, t2, 0.25)
|
68
|
+
#
|
69
|
+
# @param [Geom::Transformation] transform1
|
70
|
+
#
|
71
|
+
# @param [Geom::Transformation] transform2
|
72
|
+
#
|
73
|
+
# @param [Float] weight
|
74
|
+
# A value between 0.0 and 1.0 (see comments).
|
75
|
+
#
|
76
|
+
# @return [Geom::Transformation]
|
77
|
+
#
|
78
|
+
# @version SketchUp 6.0
|
79
|
+
def self.interpolate(transform1, transform2, weight)
|
80
|
+
end
|
81
|
+
|
82
|
+
# The {.rotation} method is used to create a transformation that does rotation
|
83
|
+
# about an axis.
|
84
|
+
#
|
85
|
+
# The axis is defined by a point and a vector. The angle is given in radians.
|
86
|
+
#
|
87
|
+
# @example
|
88
|
+
# point = Geom::Point3d.new(10, 20, 0)
|
89
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
90
|
+
# angle = 45.degrees # Return 45 degrees in radians.
|
91
|
+
# transformation = Geom::Transformation.rotation(point, vector, angle)
|
92
|
+
#
|
93
|
+
# @param [Geom::Point3d] point
|
94
|
+
#
|
95
|
+
# @param [Geom::Vector3d] vector
|
96
|
+
#
|
97
|
+
# @param [Float] angle
|
98
|
+
# The angle in radians.
|
99
|
+
#
|
100
|
+
# @return [Geom::Transformation]
|
101
|
+
#
|
102
|
+
# @version SketchUp 6.0
|
103
|
+
def self.rotation(point, vector, angle)
|
104
|
+
end
|
105
|
+
|
106
|
+
# The {.scaling} method is used to create a transformation that does scaling.
|
107
|
+
#
|
108
|
+
# @example
|
109
|
+
# point = Geom::Point3d.new(20, 30, 0)
|
110
|
+
# scale = 10
|
111
|
+
# tr = Geom::Transformation.scaling(point, scale)
|
112
|
+
#
|
113
|
+
# @overload scaling(scale)
|
114
|
+
#
|
115
|
+
# @note This has been fixed in SketchUp 2018 but in previous versions it
|
116
|
+
# might yield an unexpected transformation. It sets the 16th value
|
117
|
+
# to the scaling factor. Something not all extensions reading the
|
118
|
+
# transformation expects. Consider using +scaling(xscale, yscale, zscale)+
|
119
|
+
# instead.
|
120
|
+
# With one argument, it does a uniform scale about the origin.
|
121
|
+
# @param [Float] scale The global scale factor for the transform.
|
122
|
+
# @return [Geom::Transformation]
|
123
|
+
#
|
124
|
+
# @overload scaling(xscale, yscale, zscale)
|
125
|
+
#
|
126
|
+
# With three arguments, it does a non-uniform scale about the origin.
|
127
|
+
# @param [Float] xscale The scale factor in the x direction for the transform.
|
128
|
+
# @param [Float] yscale The scale factor in the y direction for the transform.
|
129
|
+
# @param [Float] zscale The scale factor in the z direction for the transform.
|
130
|
+
# @return [Geom::Transformation]
|
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
|
+
#
|
139
|
+
# @overload scaling(point, xscale, yscale, zscale)
|
140
|
+
#
|
141
|
+
# With four arguments it does a non-uniform scale about an arbitrary point.
|
142
|
+
# @param [Geom::Point3d] point
|
143
|
+
# @param [Float] xscale The scale factor in the x direction for the transform.
|
144
|
+
# @param [Float] yscale The scale factor in the y direction for the transform.
|
145
|
+
# @param [Float] zscale The scale factor in the z direction for the transform.
|
146
|
+
# @return [Geom::Transformation]
|
147
|
+
#
|
148
|
+
# @version SketchUp 6.0
|
149
|
+
def self.scaling(*args)
|
150
|
+
end
|
151
|
+
|
152
|
+
# The {.translation} method is used to create a transformation that does
|
153
|
+
# translation.
|
154
|
+
#
|
155
|
+
# @example
|
156
|
+
# vector = Geom::Vector3d.new(0, 1, 0)
|
157
|
+
# tr = Geom::Transformation.translation(vector)
|
158
|
+
#
|
159
|
+
# @overload translation(vector)
|
160
|
+
#
|
161
|
+
# @param [Geom::Vector3d] vector
|
162
|
+
# @return [Geom::Transformation]
|
163
|
+
#
|
164
|
+
# @overload translation(point)
|
165
|
+
#
|
166
|
+
# @param [Geom::Point3d] point
|
167
|
+
# @return [Geom::Transformation]
|
168
|
+
#
|
169
|
+
# @version SketchUp 6.0
|
170
|
+
def self.translation(arg)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Instance Methods
|
174
|
+
|
175
|
+
# The {#*} method is used to do matrix multiplication using the transform.
|
176
|
+
#
|
177
|
+
# @example
|
178
|
+
# point1 = Geom::Point3d.new(10, 20, 30)
|
179
|
+
# point2 = Geom::Point3d.new(2, 2, 2)
|
180
|
+
# tr = Geom::Transformation.new(point1)
|
181
|
+
# # Returns Point3d(12, 22, 32)
|
182
|
+
# point3 = tr * point2
|
183
|
+
#
|
184
|
+
# @overload *(point)
|
185
|
+
#
|
186
|
+
# @param [Geom::Point3d] point
|
187
|
+
# @return [Geom::Point3d]
|
188
|
+
#
|
189
|
+
# @overload *(vector)
|
190
|
+
#
|
191
|
+
# @param [Geom::Vector3d] vector
|
192
|
+
# @return [Geom::Vector3d]
|
193
|
+
#
|
194
|
+
# @overload *(transformation)
|
195
|
+
#
|
196
|
+
# @param [Geom::Transformation] transformation
|
197
|
+
# @return [Geom::Transformation]
|
198
|
+
#
|
199
|
+
# @overload *(point)
|
200
|
+
#
|
201
|
+
# @param [Array(Float, Float, Float)] point
|
202
|
+
# @return [Array(Float, Float, Float)]
|
203
|
+
#
|
204
|
+
# @overload *(plane)
|
205
|
+
#
|
206
|
+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane
|
207
|
+
# @return [Array(Float, Float, Float, Float)] transformed plane
|
208
|
+
#
|
209
|
+
# @overload *(plane)
|
210
|
+
#
|
211
|
+
# @param [Array(Float, Float, Float, Float)] plane
|
212
|
+
# @return [Array(Float, Float, Float, Float)] transformed plane
|
213
|
+
#
|
214
|
+
# @version SketchUp 6.0
|
215
|
+
def *(arg)
|
216
|
+
end
|
217
|
+
|
218
|
+
# The {#clone} method is used to create a copy of a transformation.
|
219
|
+
#
|
220
|
+
# @example
|
221
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
222
|
+
# tr1 = Geom::Transformation.new(point)
|
223
|
+
# tr2 = tr1.clone
|
224
|
+
#
|
225
|
+
# @return [Geom::Transformation]
|
226
|
+
#
|
227
|
+
# @version SketchUp 6.0
|
228
|
+
def clone
|
229
|
+
end
|
230
|
+
|
231
|
+
# The {#identity?} method is used to determine if a transformation is the
|
232
|
+
# {IDENTITY} transform.
|
233
|
+
#
|
234
|
+
# @example
|
235
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
236
|
+
# tr = Geom::Transformation.new(point)
|
237
|
+
# # Returns false.
|
238
|
+
# status = tr.identity?
|
239
|
+
#
|
240
|
+
# @example
|
241
|
+
# tr = Geom::Transformation.new(ORIGIN)
|
242
|
+
# # Returns false.
|
243
|
+
# status = tr.identity?
|
244
|
+
#
|
245
|
+
# @example
|
246
|
+
# tr = Geom::Transformation.new
|
247
|
+
# # Returns true.
|
248
|
+
# status = tr.identity?
|
249
|
+
#
|
250
|
+
# @example
|
251
|
+
# # Returns true.
|
252
|
+
# status = IDENTITY.identity?
|
253
|
+
#
|
254
|
+
# @note As of SketchUp 2018, this now looks at the data to determine if the
|
255
|
+
# transformation is identity. Prior to SU2018, this only looks at the flag to
|
256
|
+
# see if the transform has not been modified. If the transform has been
|
257
|
+
# changed, this will return false even if it is really the identity.
|
258
|
+
#
|
259
|
+
# @return [Boolean] +true+ if the transformation is the identity
|
260
|
+
#
|
261
|
+
# @version SketchUp 6.0
|
262
|
+
def identity?
|
263
|
+
end
|
264
|
+
|
265
|
+
# You can use this method or one of the more specific methods for creating
|
266
|
+
# specific kinds of Transformations.
|
267
|
+
#
|
268
|
+
# @example
|
269
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
270
|
+
# tr = Geom::Transformation.new(point)
|
271
|
+
#
|
272
|
+
# @overload initialize
|
273
|
+
#
|
274
|
+
# @return [Geom::Transformation] identity transformation.
|
275
|
+
#
|
276
|
+
# @overload initialize(point)
|
277
|
+
#
|
278
|
+
# Translates the origin to point.
|
279
|
+
# @param [Geom::Point3d] point
|
280
|
+
# @return [Geom::Transformation]
|
281
|
+
#
|
282
|
+
# @overload initialize(vector)
|
283
|
+
#
|
284
|
+
# @param [Geom::Vector3d] vector
|
285
|
+
# @return [Geom::Transformation]
|
286
|
+
#
|
287
|
+
# @overload initialize(transform)
|
288
|
+
#
|
289
|
+
# Creates a transformation that is a copy of another transformation. This is
|
290
|
+
# equivalent to {#clone}.
|
291
|
+
# @param [Geom::Transformation] transform
|
292
|
+
# @return [Geom::Transformation]
|
293
|
+
#
|
294
|
+
# @overload initialize(array)
|
295
|
+
#
|
296
|
+
# @param [Array<Float>] Creates a Transformation from a 16 element Array.
|
297
|
+
# @return [Geom::Transformation]
|
298
|
+
#
|
299
|
+
# @overload initialize(scale)
|
300
|
+
#
|
301
|
+
# Creates a transformation that does uniform scaling.
|
302
|
+
# @note Versions prior to SU2018 would produce transformations which
|
303
|
+
# didn't always work right in SketchUp. See {.scaling} for more info.
|
304
|
+
# @param [Float] scale
|
305
|
+
# @return [Geom::Transformation]
|
306
|
+
#
|
307
|
+
# @overload initialize(origin, zaxis)
|
308
|
+
#
|
309
|
+
# Creates a Transformation where origin is the new origin, and zaxis is the
|
310
|
+
# z axis. The x and y axes are determined using an arbitrary axis rule.
|
311
|
+
# @param [Geom::Point3d] origin
|
312
|
+
# @param [Geom::Vector3d] zaxis
|
313
|
+
# @return [Geom::Transformation]
|
314
|
+
#
|
315
|
+
# @overload initialize(origin, xaxis, yaxis)
|
316
|
+
#
|
317
|
+
# Creates a Transformation given a new origin, x axis and y axis.
|
318
|
+
# @param [Geom::Point3d] origin
|
319
|
+
# @param [Geom::Vector3d] xaxis
|
320
|
+
# @param [Geom::Vector3d] yaxis
|
321
|
+
# @return [Geom::Transformation]
|
322
|
+
#
|
323
|
+
# @overload initialize(pt, axis, angle)
|
324
|
+
#
|
325
|
+
# Creates a Transformation that rotates by angle (given in radians) about a
|
326
|
+
# line defined by pt and axis.
|
327
|
+
# @param [Geom::Point3d] origin
|
328
|
+
# @param [Geom::Vector3d] axis
|
329
|
+
# @param [Float] angle
|
330
|
+
# @return [Geom::Transformation]
|
331
|
+
#
|
332
|
+
# @overload initialize(xaxis, yaxis, zaxis, origin)
|
333
|
+
#
|
334
|
+
# @param [Geom::Vector3d] xaxis
|
335
|
+
# @param [Geom::Vector3d] yaxis
|
336
|
+
# @param [Geom::Vector3d] zaxis
|
337
|
+
# @param [Geom::Point3d] origin
|
338
|
+
# @return [Geom::Transformation]
|
339
|
+
#
|
340
|
+
# @version SketchUp 6.0
|
341
|
+
def initialize(*args)
|
342
|
+
end
|
343
|
+
|
344
|
+
# The {#inverse} method is used to retrieve the inverse of a transformation.
|
345
|
+
#
|
346
|
+
# @example
|
347
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
348
|
+
# tr1 = Geom::Transformation.new(point)
|
349
|
+
# tr2 = tr1.inverse
|
350
|
+
#
|
351
|
+
# @return [Geom::Transformation]
|
352
|
+
#
|
353
|
+
# @version SketchUp 6.0
|
354
|
+
def inverse
|
355
|
+
end
|
356
|
+
|
357
|
+
# The {#invert!} method sets the transformation to its inverse.
|
358
|
+
#
|
359
|
+
# @example
|
360
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
361
|
+
# tr = Geom::Transformation.new(point)
|
362
|
+
# tr.invert!
|
363
|
+
#
|
364
|
+
# @return [Geom::Transformation]
|
365
|
+
#
|
366
|
+
# @version SketchUp 6.0
|
367
|
+
def invert!
|
368
|
+
end
|
369
|
+
|
370
|
+
# The {#origin} method retrieves the origin of a rigid transformation.
|
371
|
+
#
|
372
|
+
# @example
|
373
|
+
# point1 = Geom::Point3d.new(10, 20, 30)
|
374
|
+
# tr = Geom::Transformation.new(point1)
|
375
|
+
# point2 = tr.origin
|
376
|
+
#
|
377
|
+
# @return [Geom::Point3d] the origin of the transformation.
|
378
|
+
#
|
379
|
+
# @version SketchUp 6.0
|
380
|
+
def origin
|
381
|
+
end
|
382
|
+
|
383
|
+
# The {#set!} method is used to set this transformation to match another one.
|
384
|
+
#
|
385
|
+
# The argument is anything that can be converted into a transformation.
|
386
|
+
#
|
387
|
+
# @example
|
388
|
+
# point1 = Geom::Point3d.new(10, 20, 30)
|
389
|
+
# tr1 = Geom::Transformation.new(point)
|
390
|
+
# point2 = Geom::Point3d.new(60, 40, 70)
|
391
|
+
# tr1.set!(point2)
|
392
|
+
#
|
393
|
+
# @overload set!(transformation)
|
394
|
+
#
|
395
|
+
# @param [Geom::Transformation] transformation
|
396
|
+
# @return [Geom::Transformation]
|
397
|
+
#
|
398
|
+
# @overload set!(point)
|
399
|
+
#
|
400
|
+
# @param [Geom::Point3d] point
|
401
|
+
# @return [Geom::Transformation]
|
402
|
+
#
|
403
|
+
# @overload set!(vector)
|
404
|
+
#
|
405
|
+
# @param [Geom::Vector3d] vector
|
406
|
+
# @return [Geom::Transformation]
|
407
|
+
#
|
408
|
+
# @overload set!(matrix)
|
409
|
+
#
|
410
|
+
# @param [Array<Float>] matrix Array of 16 floats.
|
411
|
+
# @return [Geom::Transformation]
|
412
|
+
#
|
413
|
+
# @overload set!(scale)
|
414
|
+
#
|
415
|
+
# @param [Float] scale
|
416
|
+
# @return [Geom::Transformation]
|
417
|
+
#
|
418
|
+
# @version SketchUp 6.0
|
419
|
+
def set!(arg)
|
420
|
+
end
|
421
|
+
|
422
|
+
# The {#to_a} method retrieves a 16 element array which contains the values that
|
423
|
+
# define the transformation.
|
424
|
+
#
|
425
|
+
# @example
|
426
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
427
|
+
# tr = Geom::Transformation.new(point)
|
428
|
+
# # This splits the 16 items into a string of 4x4 elements for easier reading.
|
429
|
+
# str4x4 = tr.to_a.each_slice(4).inject { |str, row| "#{str}\r\n#{row}" }
|
430
|
+
#
|
431
|
+
# @return [Array<Float>]
|
432
|
+
#
|
433
|
+
# @version SketchUp 6.0
|
434
|
+
def to_a
|
435
|
+
end
|
436
|
+
|
437
|
+
# The {#xaxis} method retrieves the x axis of a rigid transformation.
|
438
|
+
#
|
439
|
+
# @example
|
440
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
441
|
+
# tr = Geom::Transformation.new(point)
|
442
|
+
# x = tr.xaxis
|
443
|
+
#
|
444
|
+
# @return [Geom::Vector3d]
|
445
|
+
#
|
446
|
+
# @version SketchUp 6.0
|
447
|
+
def xaxis
|
448
|
+
end
|
449
|
+
|
450
|
+
# The {#yaxis} method retrieves the y axis of a rigid transformation.
|
451
|
+
#
|
452
|
+
# @example
|
453
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
454
|
+
# tr = Geom::Transformation.new(point)
|
455
|
+
# x = tr.yaxis
|
456
|
+
#
|
457
|
+
# @return [Geom::Vector3d]
|
458
|
+
#
|
459
|
+
# @version SketchUp 6.0
|
460
|
+
def yaxis
|
461
|
+
end
|
462
|
+
|
463
|
+
# The {#zaxis} method retrieves the z axis of a rigid transformation.
|
464
|
+
#
|
465
|
+
# @example
|
466
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
467
|
+
# tr = Geom::Transformation.new(point)
|
468
|
+
# x = tr.zaxis
|
469
|
+
#
|
470
|
+
# @return [Geom::Vector3d]
|
471
|
+
#
|
472
|
+
# @version SketchUp 6.0
|
473
|
+
def zaxis
|
474
|
+
end
|
475
|
+
|
476
|
+
end
|