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,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {#Geom::PolygonMesh} class contains methods to create polygon mesh
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
#
|
|
16
16
|
# @example
|
|
17
17
|
# entities = Sketchup.active_model.active_entities
|
|
18
|
-
# face = entities.
|
|
18
|
+
# face = entities.add_face([1, 1, 1], [1, 2, 1], [2, 2, 1])
|
|
19
19
|
#
|
|
20
20
|
# mesh = face.mesh
|
|
21
21
|
#
|
|
@@ -80,7 +80,6 @@ class Geom::PolygonMesh
|
|
|
80
80
|
# Adds a polygon from a list of the mesh's vertex indices.
|
|
81
81
|
# @example
|
|
82
82
|
# mesh = Geom::PolygonMesh.new
|
|
83
|
-
# # add points to mesh...
|
|
84
83
|
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
|
|
85
84
|
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
|
|
86
85
|
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
|
|
@@ -95,7 +94,6 @@ class Geom::PolygonMesh
|
|
|
95
94
|
# Adds a polygon from an Array of the mesh's vertex indices.
|
|
96
95
|
# @example
|
|
97
96
|
# mesh = Geom::PolygonMesh.new
|
|
98
|
-
# # add points to mesh...
|
|
99
97
|
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
|
|
100
98
|
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
|
|
101
99
|
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
|
|
@@ -143,7 +141,7 @@ class Geom::PolygonMesh
|
|
|
143
141
|
# mesh = Geom::PolygonMesh.new
|
|
144
142
|
# point = Geom::Point3d.new(0, 1, 2)
|
|
145
143
|
# mesh.add_point(point)
|
|
146
|
-
#
|
|
144
|
+
# number_points = mesh.count_points
|
|
147
145
|
#
|
|
148
146
|
# @return [Integer] the number of points in a mesh
|
|
149
147
|
#
|
|
@@ -159,7 +157,7 @@ class Geom::PolygonMesh
|
|
|
159
157
|
# point2 = Geom::Point3d.new(1, 0, 2)
|
|
160
158
|
# point3 = Geom::Point3d.new(2, 0, 1)
|
|
161
159
|
# mesh.add_polygon(point1, point2, point3)
|
|
162
|
-
#
|
|
160
|
+
# number_polygons = mesh.count_polygons
|
|
163
161
|
#
|
|
164
162
|
# @return [Integer] the number of polygons in the mesh
|
|
165
163
|
#
|
|
@@ -188,15 +186,15 @@ class Geom::PolygonMesh
|
|
|
188
186
|
#
|
|
189
187
|
# @return [Geom::PolygonMesh]
|
|
190
188
|
#
|
|
191
|
-
# @overload initialize(
|
|
189
|
+
# @overload initialize(number_points)
|
|
192
190
|
#
|
|
193
|
-
# @param [Integer]
|
|
191
|
+
# @param [Integer] number_points How many points will be in the mesh.
|
|
194
192
|
# @return [Geom::PolygonMesh]
|
|
195
193
|
#
|
|
196
|
-
# @overload initialize(
|
|
194
|
+
# @overload initialize(number_points, number_polygons)
|
|
197
195
|
#
|
|
198
|
-
# @param [Integer]
|
|
199
|
-
# @param [Integer]
|
|
196
|
+
# @param [Integer] number_points How many points will be in the mesh.
|
|
197
|
+
# @param [Integer] number_polygons How many polygons will be in the mesh.
|
|
200
198
|
# @return [Geom::PolygonMesh]
|
|
201
199
|
#
|
|
202
200
|
# @raise [RangeError] If number of points or polygons are negative numbers.
|
|
@@ -210,8 +208,13 @@ class Geom::PolygonMesh
|
|
|
210
208
|
# {Sketchup::Face#mesh} with the +PolygonMeshNormals+ flag.
|
|
211
209
|
#
|
|
212
210
|
# @example
|
|
211
|
+
# model = Sketchup.active_model
|
|
212
|
+
# entity = model.active_entities
|
|
213
|
+
# face = entity.add_face([1, 1, 1], [2, 2, 1], [2, 1, 1])
|
|
214
|
+
#
|
|
213
215
|
# flags = 4 # PolygonMeshNormals
|
|
214
216
|
# mesh = face.mesh(flags)
|
|
217
|
+
# # The result is a Vector3d(0, 0, -1)
|
|
215
218
|
# normal = mesh.normal_at(1)
|
|
216
219
|
#
|
|
217
220
|
# @note Index starts at 1.
|
|
@@ -310,7 +313,7 @@ class Geom::PolygonMesh
|
|
|
310
313
|
# @param [Integer] index
|
|
311
314
|
# The index of the desired polygon.
|
|
312
315
|
#
|
|
313
|
-
# @return [Array<
|
|
316
|
+
# @return [Array<Integer>, nil]
|
|
314
317
|
#
|
|
315
318
|
# @version SketchUp 6.0
|
|
316
319
|
def polygon_at(index)
|
|
@@ -346,7 +349,14 @@ class Geom::PolygonMesh
|
|
|
346
349
|
# indicates that the edge from +1+ to +2+ is hidden.
|
|
347
350
|
#
|
|
348
351
|
# @example
|
|
349
|
-
#
|
|
352
|
+
# mesh = Geom::PolygonMesh.new
|
|
353
|
+
# mesh.add_point([0, 0, 0])
|
|
354
|
+
# mesh.add_point([1, 0, 0])
|
|
355
|
+
# mesh.add_point([1, 1, 0])
|
|
356
|
+
#
|
|
357
|
+
# mesh.add_polygon(1, 2, 3)
|
|
358
|
+
# mesh.add_polygon(-1, 3, 2)
|
|
359
|
+
# polygons = mesh.polygons
|
|
350
360
|
#
|
|
351
361
|
# @return [Array<Array<Integer>>]
|
|
352
362
|
#
|
|
@@ -395,26 +405,25 @@ class Geom::PolygonMesh
|
|
|
395
405
|
#
|
|
396
406
|
# @example
|
|
397
407
|
# mesh = Geom::PolygonMesh.new(4)
|
|
398
|
-
# # Create points for a triangle.
|
|
399
408
|
# point1 = Geom::Point3d.new(0, 0, 0)
|
|
400
409
|
# point2 = Geom::Point3d.new(9, 0, 0)
|
|
401
410
|
# point3 = Geom::Point3d.new(9, 9, 0)
|
|
402
411
|
# point4 = Geom::Point3d.new(0, 9, 0)
|
|
403
|
-
#
|
|
404
|
-
#
|
|
405
|
-
#
|
|
406
|
-
#
|
|
407
|
-
#
|
|
408
|
-
#
|
|
412
|
+
#
|
|
413
|
+
# uv_point1 = Geom::Point3d.new(0, 0, 0)
|
|
414
|
+
# uv_point2 = Geom::Point3d.new(2, 0, 0)
|
|
415
|
+
# uv_point3 = Geom::Point3d.new(2, 2, 0)
|
|
416
|
+
# uv_point4 = Geom::Point3d.new(0, 2, 0)
|
|
417
|
+
#
|
|
409
418
|
# index1 = mesh.add_point(point1)
|
|
410
419
|
# index2 = mesh.add_point(point2)
|
|
411
420
|
# index3 = mesh.add_point(point3)
|
|
412
421
|
# index4 = mesh.add_point(point4)
|
|
413
|
-
# mesh.set_uv(index1,
|
|
414
|
-
# mesh.set_uv(index2,
|
|
415
|
-
# mesh.set_uv(index3,
|
|
416
|
-
# mesh.set_uv(index4,
|
|
417
|
-
#
|
|
422
|
+
# mesh.set_uv(index1, uv_point1, true)
|
|
423
|
+
# mesh.set_uv(index2, uv_point2, true)
|
|
424
|
+
# mesh.set_uv(index3, uv_point3, true)
|
|
425
|
+
# mesh.set_uv(index4, uv_point4, true)
|
|
426
|
+
#
|
|
418
427
|
# mesh.add_polygon(index1, index2, index3)
|
|
419
428
|
# mesh.add_polygon(index1, index3, index4)
|
|
420
429
|
#
|
|
@@ -442,11 +451,12 @@ class Geom::PolygonMesh
|
|
|
442
451
|
#
|
|
443
452
|
# @example
|
|
444
453
|
# point1 = Geom::Point3d.new(100, 200, 300)
|
|
445
|
-
#
|
|
454
|
+
# transformation = Geom::Transformation.new(point1)
|
|
446
455
|
# mesh = Geom::PolygonMesh.new
|
|
447
456
|
# point2 = Geom::Point3d.new(0, 1, 2)
|
|
448
457
|
# mesh.add_point(point2)
|
|
449
|
-
#
|
|
458
|
+
# # The PolygonMesh contains a Point3d(100, 201, 302)
|
|
459
|
+
# mesh.transform!(transformation)
|
|
450
460
|
#
|
|
451
461
|
# @param [Geom::Transformation] transformation
|
|
452
462
|
#
|
|
@@ -471,7 +481,12 @@ class Geom::PolygonMesh
|
|
|
471
481
|
# referred to as UV mapping.
|
|
472
482
|
#
|
|
473
483
|
# @example
|
|
474
|
-
#
|
|
484
|
+
# mesh = Geom::PolygonMesh.new
|
|
485
|
+
# index = mesh.add_point([2, 2, 2])
|
|
486
|
+
# uv_point = Geom::Point3d.new(1, 1, 0)
|
|
487
|
+
#
|
|
488
|
+
# mesh.set_uv(index, uv_point, true)
|
|
489
|
+
# point = mesh.uv_at(index, true)
|
|
475
490
|
#
|
|
476
491
|
# @note Index starts at 1.
|
|
477
492
|
#
|
|
@@ -494,9 +509,20 @@ class Geom::PolygonMesh
|
|
|
494
509
|
# mesh.
|
|
495
510
|
#
|
|
496
511
|
# @example
|
|
497
|
-
#
|
|
512
|
+
# model = Sketchup.active_model
|
|
513
|
+
# entity = model.active_entities
|
|
514
|
+
#
|
|
515
|
+
# face = entity.add_face([1, 1, 1], [1, 3, 1], [3, 3, 1])
|
|
498
516
|
# mesh = face.mesh(1 | 2)
|
|
499
|
-
#
|
|
517
|
+
#
|
|
518
|
+
# uv_point1 = Geom::Point3d.new(0, 0, 0)
|
|
519
|
+
# uv_point2 = Geom::Point3d.new(1, 0, 0)
|
|
520
|
+
# uv_point3 = Geom::Point3d.new(1, 1, 0)
|
|
521
|
+
# mesh.set_uv(1, uv_point1, true)
|
|
522
|
+
# mesh.set_uv(2, uv_point2, true)
|
|
523
|
+
# mesh.set_uv(3, uv_point3, true)
|
|
524
|
+
#
|
|
525
|
+
# uv_points = mesh.uvs(true)
|
|
500
526
|
#
|
|
501
527
|
# @param [Boolean] front
|
|
502
528
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Transformations are a standard construct in the 3D world for representing
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
# transformations in 3 dimensions which is covered extensively on
|
|
12
12
|
# the internet.
|
|
13
13
|
#
|
|
14
|
+
# @note Translation convenience: In contexts expecting a pure translation,
|
|
15
|
+
# you can pass a {Geom::Point3d}, {Geom::Vector3d}, or a 3-element
|
|
16
|
+
# Array [dx, dy, dz] and it will be converted to a translation
|
|
17
|
+
# {Geom::Transformation}. For full matrices, pass a 16-element Array.
|
|
18
|
+
#
|
|
14
19
|
# @version SketchUp 6.0
|
|
15
20
|
class Geom::Transformation
|
|
16
21
|
|
|
@@ -24,7 +29,7 @@ class Geom::Transformation
|
|
|
24
29
|
# # Creates a transformation that "flips" the axes from XYZ to XZY. Something
|
|
25
30
|
# # one often need for importers/exporters when dealing with applications
|
|
26
31
|
# # that threat Y as "up".
|
|
27
|
-
#
|
|
32
|
+
# transformation = Geom::Transformation.axes(ORIGIN, X_AXIS, Z_AXIS, Y_AXIS.reverse)
|
|
28
33
|
#
|
|
29
34
|
# @overload axes(origin, xaxis, yaxis, zaxis)
|
|
30
35
|
#
|
|
@@ -52,31 +57,31 @@ class Geom::Transformation
|
|
|
52
57
|
# The {.interpolate} method is used to create a new transformation that is the
|
|
53
58
|
# result of interpolating between two other transformations.
|
|
54
59
|
#
|
|
55
|
-
# Parameter is a
|
|
56
|
-
# `transformation1`
|
|
60
|
+
# Parameter weight is a value (between 0.0 and 1.0) that represents the percentage given to
|
|
61
|
+
# `transformation1` and `transformation2`.
|
|
57
62
|
#
|
|
58
63
|
# @example
|
|
59
64
|
# origin = Geom::Point3d.new(0, 0, 0)
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
-
#
|
|
65
|
+
# xaxis = Geom::Vector3d.new(0, 1, 0)
|
|
66
|
+
# yaxis = Geom::Vector3d.new(1, 0, 0)
|
|
67
|
+
# zaxis = Geom::Vector3d.new(0, 0, 1)
|
|
63
68
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
# # This produce a transformation that is a mix of 75%
|
|
67
|
-
#
|
|
69
|
+
# transformation1 = Geom::Transformation.new(point)
|
|
70
|
+
# transformation2 = Geom::Transformation.axes(origin, xaxis, yaxis, zaxis)
|
|
71
|
+
# # This produce a transformation that is a mix of 75% transformation1 and 25% transformation2.
|
|
72
|
+
# new_transformation = Geom::Transformation.interpolate(transformation1, transformation2, 0.25)
|
|
68
73
|
#
|
|
69
|
-
# @param [Geom::Transformation]
|
|
74
|
+
# @param [Geom::Transformation] transformation1
|
|
70
75
|
#
|
|
71
|
-
# @param [Geom::Transformation]
|
|
76
|
+
# @param [Geom::Transformation] transformation2
|
|
72
77
|
#
|
|
73
78
|
# @param [Float] weight
|
|
74
|
-
# A value between 0.0 and 1.0
|
|
79
|
+
# A value between 0.0 and 1.0.
|
|
75
80
|
#
|
|
76
81
|
# @return [Geom::Transformation]
|
|
77
82
|
#
|
|
78
83
|
# @version SketchUp 6.0
|
|
79
|
-
def self.interpolate(
|
|
84
|
+
def self.interpolate(transformation1, transformation2, weight)
|
|
80
85
|
end
|
|
81
86
|
|
|
82
87
|
# The {.rotation} method is used to create a transformation that does rotation
|
|
@@ -108,7 +113,7 @@ class Geom::Transformation
|
|
|
108
113
|
# @example
|
|
109
114
|
# point = Geom::Point3d.new(20, 30, 0)
|
|
110
115
|
# scale = 10
|
|
111
|
-
#
|
|
116
|
+
# transformation = Geom::Transformation.scaling(point, scale)
|
|
112
117
|
#
|
|
113
118
|
# @overload scaling(scale)
|
|
114
119
|
#
|
|
@@ -154,7 +159,7 @@ class Geom::Transformation
|
|
|
154
159
|
#
|
|
155
160
|
# @example
|
|
156
161
|
# vector = Geom::Vector3d.new(0, 1, 0)
|
|
157
|
-
#
|
|
162
|
+
# transformation = Geom::Transformation.translation(vector)
|
|
158
163
|
#
|
|
159
164
|
# @overload translation(vector)
|
|
160
165
|
#
|
|
@@ -177,9 +182,9 @@ class Geom::Transformation
|
|
|
177
182
|
# @example
|
|
178
183
|
# point1 = Geom::Point3d.new(10, 20, 30)
|
|
179
184
|
# point2 = Geom::Point3d.new(2, 2, 2)
|
|
180
|
-
#
|
|
181
|
-
# #
|
|
182
|
-
#
|
|
185
|
+
# transformation = Geom::Transformation.new(point1)
|
|
186
|
+
# # The result is a Point3d(12, 22, 32)
|
|
187
|
+
# new_point = transformation * point2
|
|
183
188
|
#
|
|
184
189
|
# @overload *(point)
|
|
185
190
|
#
|
|
@@ -219,8 +224,8 @@ class Geom::Transformation
|
|
|
219
224
|
#
|
|
220
225
|
# @example
|
|
221
226
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
222
|
-
#
|
|
223
|
-
#
|
|
227
|
+
# transformation = Geom::Transformation.new(point)
|
|
228
|
+
# new_transformation = transformation.clone
|
|
224
229
|
#
|
|
225
230
|
# @return [Geom::Transformation]
|
|
226
231
|
#
|
|
@@ -233,22 +238,22 @@ class Geom::Transformation
|
|
|
233
238
|
#
|
|
234
239
|
# @example
|
|
235
240
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
236
|
-
#
|
|
237
|
-
# # Returns false
|
|
238
|
-
# status =
|
|
241
|
+
# transformation = Geom::Transformation.new(point)
|
|
242
|
+
# # Returns false
|
|
243
|
+
# status = transformation.identity?
|
|
239
244
|
#
|
|
240
245
|
# @example
|
|
241
|
-
#
|
|
242
|
-
# # Returns
|
|
243
|
-
# status =
|
|
246
|
+
# transformation = Geom::Transformation.new(ORIGIN)
|
|
247
|
+
# # Returns true
|
|
248
|
+
# status = transformation.identity?
|
|
244
249
|
#
|
|
245
250
|
# @example
|
|
246
|
-
#
|
|
247
|
-
# # Returns true
|
|
248
|
-
# status =
|
|
251
|
+
# transformation = Geom::Transformation.new
|
|
252
|
+
# # Returns true
|
|
253
|
+
# status = transformation.identity?
|
|
249
254
|
#
|
|
250
255
|
# @example
|
|
251
|
-
# # Returns true
|
|
256
|
+
# # Returns true
|
|
252
257
|
# status = IDENTITY.identity?
|
|
253
258
|
#
|
|
254
259
|
# @note As of SketchUp 2018, this now looks at the data to determine if the
|
|
@@ -267,7 +272,18 @@ class Geom::Transformation
|
|
|
267
272
|
#
|
|
268
273
|
# @example
|
|
269
274
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
270
|
-
#
|
|
275
|
+
# transformation = Geom::Transformation.new(point)
|
|
276
|
+
#
|
|
277
|
+
# @example
|
|
278
|
+
# origin = Geom::Point3d.new(10, 10, 10)
|
|
279
|
+
# zaxis = Geom::Vector3d.new(1, 2, 3)
|
|
280
|
+
# transformation = Geom::Transformation.new(origin, zaxis)
|
|
281
|
+
#
|
|
282
|
+
# @example
|
|
283
|
+
# origin = Geom::Point3d.new(1, 1, 1)
|
|
284
|
+
# axis = Geom::Vector3d.new(1, 0, 0)
|
|
285
|
+
# angle = 45.degrees # Return 45 degrees in radians.
|
|
286
|
+
# transformation = Geom::Transformation.new(origin, axis, angle)
|
|
271
287
|
#
|
|
272
288
|
# @overload initialize
|
|
273
289
|
#
|
|
@@ -306,8 +322,8 @@ class Geom::Transformation
|
|
|
306
322
|
#
|
|
307
323
|
# @overload initialize(origin, zaxis)
|
|
308
324
|
#
|
|
309
|
-
# Creates a Transformation where origin is the new origin, and
|
|
310
|
-
# z axis. The x and y axes are determined using an arbitrary axis rule.
|
|
325
|
+
# Creates a Transformation where origin is the new origin, and z axis is the
|
|
326
|
+
# new z axis. The x and y axes are determined using an arbitrary axis rule.
|
|
311
327
|
# @param [Geom::Point3d] origin
|
|
312
328
|
# @param [Geom::Vector3d] zaxis
|
|
313
329
|
# @return [Geom::Transformation]
|
|
@@ -345,8 +361,14 @@ class Geom::Transformation
|
|
|
345
361
|
#
|
|
346
362
|
# @example
|
|
347
363
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
348
|
-
#
|
|
349
|
-
#
|
|
364
|
+
# transformation = Geom::Transformation.new(point)
|
|
365
|
+
# new_transformation = transformation.inverse
|
|
366
|
+
#
|
|
367
|
+
# @note As of SketchUp 2026, this will raise an error if the
|
|
368
|
+
# {Geom::Transformation} is not invertible. Prior to 2026 this would silently attempt
|
|
369
|
+
# to invert the transformation possibly returning in an invalid transformation.
|
|
370
|
+
#
|
|
371
|
+
# @raise ArgumentError if the {Geom::Transformation} is not invertible (as of Sketchup 2026)
|
|
350
372
|
#
|
|
351
373
|
# @return [Geom::Transformation]
|
|
352
374
|
#
|
|
@@ -358,8 +380,14 @@ class Geom::Transformation
|
|
|
358
380
|
#
|
|
359
381
|
# @example
|
|
360
382
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
361
|
-
#
|
|
362
|
-
#
|
|
383
|
+
# transformation = Geom::Transformation.new(point)
|
|
384
|
+
# new_transformation = transformation.invert!
|
|
385
|
+
#
|
|
386
|
+
# @note As of SketchUp 2026, this will raise an error if the
|
|
387
|
+
# {Geom::Transformation} is not invertible. Prior to 2026 this would silently attempt
|
|
388
|
+
# to invert the transformation possibly creating in an invalid transformation.
|
|
389
|
+
#
|
|
390
|
+
# @raise ArgumentError if the {Geom::Transformation} is not invertible (as of Sketchup 2026)
|
|
363
391
|
#
|
|
364
392
|
# @return [Geom::Transformation]
|
|
365
393
|
#
|
|
@@ -370,9 +398,9 @@ class Geom::Transformation
|
|
|
370
398
|
# The {#origin} method retrieves the origin of a rigid transformation.
|
|
371
399
|
#
|
|
372
400
|
# @example
|
|
373
|
-
#
|
|
374
|
-
#
|
|
375
|
-
#
|
|
401
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
|
402
|
+
# transformation = Geom::Transformation.new(point)
|
|
403
|
+
# new_point = transformation.origin
|
|
376
404
|
#
|
|
377
405
|
# @return [Geom::Point3d] the origin of the transformation.
|
|
378
406
|
#
|
|
@@ -386,9 +414,9 @@ class Geom::Transformation
|
|
|
386
414
|
#
|
|
387
415
|
# @example
|
|
388
416
|
# point1 = Geom::Point3d.new(10, 20, 30)
|
|
389
|
-
#
|
|
417
|
+
# transformation = Geom::Transformation.new(point1)
|
|
390
418
|
# point2 = Geom::Point3d.new(60, 40, 70)
|
|
391
|
-
#
|
|
419
|
+
# transformation.set!(point2)
|
|
392
420
|
#
|
|
393
421
|
# @overload set!(transformation)
|
|
394
422
|
#
|
|
@@ -424,9 +452,10 @@ class Geom::Transformation
|
|
|
424
452
|
#
|
|
425
453
|
# @example
|
|
426
454
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
427
|
-
#
|
|
455
|
+
# transformation = Geom::Transformation.new(point)
|
|
428
456
|
# # This splits the 16 items into a string of 4x4 elements for easier reading.
|
|
429
|
-
#
|
|
457
|
+
# matrix = transformation.to_a.each_slice(4).inject { |str, row|"#{str}\r\n#{row}"}
|
|
458
|
+
# puts matrix
|
|
430
459
|
#
|
|
431
460
|
# @return [Array<Float>]
|
|
432
461
|
#
|
|
@@ -438,8 +467,8 @@ class Geom::Transformation
|
|
|
438
467
|
#
|
|
439
468
|
# @example
|
|
440
469
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
441
|
-
#
|
|
442
|
-
# x =
|
|
470
|
+
# transformation = Geom::Transformation.new(point)
|
|
471
|
+
# x = transformation.xaxis
|
|
443
472
|
#
|
|
444
473
|
# @return [Geom::Vector3d]
|
|
445
474
|
#
|
|
@@ -451,8 +480,8 @@ class Geom::Transformation
|
|
|
451
480
|
#
|
|
452
481
|
# @example
|
|
453
482
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
454
|
-
#
|
|
455
|
-
#
|
|
483
|
+
# transformation = Geom::Transformation.new(point)
|
|
484
|
+
# y = transformation.yaxis
|
|
456
485
|
#
|
|
457
486
|
# @return [Geom::Vector3d]
|
|
458
487
|
#
|
|
@@ -464,8 +493,8 @@ class Geom::Transformation
|
|
|
464
493
|
#
|
|
465
494
|
# @example
|
|
466
495
|
# point = Geom::Point3d.new(10, 20, 30)
|
|
467
|
-
#
|
|
468
|
-
#
|
|
496
|
+
# transformation = Geom::Transformation.new(point)
|
|
497
|
+
# z = transformation.zaxis
|
|
469
498
|
#
|
|
470
499
|
# @return [Geom::Vector3d]
|
|
471
500
|
#
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
|
+
# {Geom::Transformation2d} represents 2D affine transforms used by LayOut.
|
|
5
|
+
# The internal representation is a 2x3 matrix +[m11, m12, m21, m22, tx, ty]+.
|
|
6
|
+
# Use {.translation}, {.rotation}, and {.scaling} to construct common transforms,
|
|
7
|
+
# or pass a 6-element Array to {.new} or {#set!} for a custom matrix.
|
|
8
|
+
#
|
|
9
|
+
# @see Geom::Point2d
|
|
10
|
+
#
|
|
11
|
+
# @see Geom::Vector2d
|
|
12
|
+
#
|
|
13
|
+
# @see IDENTITY_2D
|
|
4
14
|
#
|
|
5
15
|
# @version LayOut 2018
|
|
6
16
|
class Geom::Transformation2d
|
|
@@ -29,9 +39,9 @@ class Geom::Transformation2d
|
|
|
29
39
|
# The {.scaling} method is used to create a transformation that does scaling.
|
|
30
40
|
#
|
|
31
41
|
# @example
|
|
32
|
-
# point = Geom::
|
|
42
|
+
# point = Geom::Point2d.new(20, 30)
|
|
33
43
|
# scale = 10
|
|
34
|
-
#
|
|
44
|
+
# transformation = Geom::Transformation2d.scaling(point, scale)
|
|
35
45
|
#
|
|
36
46
|
# @overload scaling(scale)
|
|
37
47
|
#
|
|
@@ -70,7 +80,7 @@ class Geom::Transformation2d
|
|
|
70
80
|
#
|
|
71
81
|
# @example
|
|
72
82
|
# vector = Geom::Vector2d.new(0, 1)
|
|
73
|
-
#
|
|
83
|
+
# transformation = Geom::Transformation2d.translation(vector)
|
|
74
84
|
#
|
|
75
85
|
# @overload translation(vector)
|
|
76
86
|
#
|
|
@@ -93,9 +103,9 @@ class Geom::Transformation2d
|
|
|
93
103
|
# @example
|
|
94
104
|
# point1 = Geom::Point2d.new(5, 10)
|
|
95
105
|
# point2 = Geom::Point2d.new(2, 2)
|
|
96
|
-
#
|
|
97
|
-
# #
|
|
98
|
-
#
|
|
106
|
+
# transformation = Geom::Transformation2d.translation(point1)
|
|
107
|
+
# # The result is a Point2d(7, 12)
|
|
108
|
+
# new_point = transformation * point2
|
|
99
109
|
#
|
|
100
110
|
# @overload *(point)
|
|
101
111
|
#
|
|
@@ -114,8 +124,8 @@ class Geom::Transformation2d
|
|
|
114
124
|
#
|
|
115
125
|
# @overload *(point)
|
|
116
126
|
#
|
|
117
|
-
# @param [Array
|
|
118
|
-
# @return [Array
|
|
127
|
+
# @param [Array(Float, Float)] point
|
|
128
|
+
# @return [Array(Float, Float)]
|
|
119
129
|
#
|
|
120
130
|
# @version LayOut 2019
|
|
121
131
|
def *(arg)
|
|
@@ -125,8 +135,10 @@ class Geom::Transformation2d
|
|
|
125
135
|
# This checks whether the values of the transformations are the same.
|
|
126
136
|
#
|
|
127
137
|
# @example
|
|
128
|
-
#
|
|
129
|
-
#
|
|
138
|
+
# transformation1 = Geom::Transformation2d.new([1.0, 0.0, 0.0, 1.0, 1.0, 1.0])
|
|
139
|
+
# transformation2 = Geom::Transformation2d.translation([1, 1])
|
|
140
|
+
# # Returns true
|
|
141
|
+
# transformation1 == transformation2
|
|
130
142
|
#
|
|
131
143
|
# @param [Geom::Transformation2d] other
|
|
132
144
|
#
|
|
@@ -139,8 +151,8 @@ class Geom::Transformation2d
|
|
|
139
151
|
# The {#clone} method creates a copy of the {Geom::Transformation2d}.
|
|
140
152
|
#
|
|
141
153
|
# @example
|
|
142
|
-
#
|
|
143
|
-
#
|
|
154
|
+
# transformation = Geom::Transformation2d.new
|
|
155
|
+
# new_transformation = transformation.clone
|
|
144
156
|
#
|
|
145
157
|
# @return [Geom::Transformation2d]
|
|
146
158
|
#
|
|
@@ -152,18 +164,18 @@ class Geom::Transformation2d
|
|
|
152
164
|
# {IDENTITY_2D} transform.
|
|
153
165
|
#
|
|
154
166
|
# @example
|
|
155
|
-
# array =
|
|
156
|
-
#
|
|
157
|
-
# # Returns false
|
|
158
|
-
# status =
|
|
167
|
+
# array = [1.0, 0.0, 0.0, 1.0, 1.0, 0.0]
|
|
168
|
+
# transformation = Geom::Transformation2d.new(array)
|
|
169
|
+
# # Returns false
|
|
170
|
+
# status = transformation.identity?
|
|
159
171
|
#
|
|
160
172
|
# @example
|
|
161
|
-
#
|
|
162
|
-
# # Returns true
|
|
163
|
-
# status =
|
|
173
|
+
# transformation = Geom::Transformation2d.new
|
|
174
|
+
# # Returns true
|
|
175
|
+
# status = transformation.identity?
|
|
164
176
|
#
|
|
165
177
|
# @example
|
|
166
|
-
# # Returns true
|
|
178
|
+
# # Returns true
|
|
167
179
|
# status = IDENTITY_2D.identity?
|
|
168
180
|
#
|
|
169
181
|
# @return [Boolean] +true+ if the transform is the identity
|
|
@@ -177,7 +189,9 @@ class Geom::Transformation2d
|
|
|
177
189
|
# of {Geom::Transformation2d}.
|
|
178
190
|
#
|
|
179
191
|
# @example
|
|
180
|
-
#
|
|
192
|
+
# transformation1 = Geom::Transformation2d.new
|
|
193
|
+
#
|
|
194
|
+
# transformation2 = Geom::Transformation2d.new([1.0, 0.0, 0.0, 1.0, 1.0, 1.0])
|
|
181
195
|
#
|
|
182
196
|
# @overload initialize
|
|
183
197
|
#
|
|
@@ -203,8 +217,8 @@ class Geom::Transformation2d
|
|
|
203
217
|
#
|
|
204
218
|
# @example
|
|
205
219
|
# point = Geom::Point2d.new(5, 10)
|
|
206
|
-
#
|
|
207
|
-
#
|
|
220
|
+
# transformation = Geom::Transformation2d.translation(point)
|
|
221
|
+
# new_transformation = transformation.inverse
|
|
208
222
|
#
|
|
209
223
|
# @return [Geom::Transformation2d]
|
|
210
224
|
#
|
|
@@ -216,8 +230,8 @@ class Geom::Transformation2d
|
|
|
216
230
|
#
|
|
217
231
|
# @example
|
|
218
232
|
# point = Geom::Point2d.new(5, 10)
|
|
219
|
-
#
|
|
220
|
-
#
|
|
233
|
+
# transformation = Geom::Transformation2d.translation(point)
|
|
234
|
+
# transformation.invert!
|
|
221
235
|
#
|
|
222
236
|
# @return [Geom::Transformation2d]
|
|
223
237
|
#
|
|
@@ -229,9 +243,9 @@ class Geom::Transformation2d
|
|
|
229
243
|
# The argument is anything that can be converted into a {Geom::Transformation2d}.
|
|
230
244
|
#
|
|
231
245
|
# @example
|
|
232
|
-
#
|
|
233
|
-
#
|
|
234
|
-
#
|
|
246
|
+
# transformation = Geom::Transformation2d.new
|
|
247
|
+
# matrix = [2.0, 0.0, 0.0, 2.0, 0.0, 0.0]
|
|
248
|
+
# transformation.set!(matrix)
|
|
235
249
|
#
|
|
236
250
|
# @overload set!(transformation)
|
|
237
251
|
#
|
|
@@ -251,8 +265,8 @@ class Geom::Transformation2d
|
|
|
251
265
|
# define the Transformation2d.
|
|
252
266
|
#
|
|
253
267
|
# @example
|
|
254
|
-
#
|
|
255
|
-
#
|
|
268
|
+
# transformation = Geom::Transformation2d.new
|
|
269
|
+
# transformation.to_a.each_slice(2) {|a| p a}
|
|
256
270
|
#
|
|
257
271
|
# @return [Array<Float>] an array of 6 elements
|
|
258
272
|
#
|