sketchup-api-stubs 0.7.4 → 0.7.5
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.rb +1 -1
- data/lib/sketchup-api-stubs/sketchup.rb +147 -145
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
- 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 +498 -492
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -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 +691 -691
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +179 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +515 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
- 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 -371
- 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 -220
- 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 -204
- 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/SketchUpModel.rb +694 -694
- 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/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +577 -562
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +604 -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 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +362 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1126 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +751 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +699 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +417 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +405 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +327 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -456
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
- 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 +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +835 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +71 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1307 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +317 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +387 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +255 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/geom.rb +351 -348
- data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
- 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.rb +1342 -1310
- 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.rb +668 -667
- metadata +4 -2
@@ -1,62 +1,62 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# Http::Response objects allows you to get the response information from the
|
5
|
-
# server, you can only receive the Http::Response if you have attached a
|
6
|
-
# callback block when calling start from the Http::Request object.
|
7
|
-
#
|
8
|
-
# @version SketchUp 2017
|
9
|
-
class Sketchup::Http::Response
|
10
|
-
|
11
|
-
# Instance Methods
|
12
|
-
|
13
|
-
# Gets the http body that was received from the server as a string encoded
|
14
|
-
# using the charset provided in the Content-Type of the server response, if
|
15
|
-
# no charset is specified, ASCII-8BIT will be used.
|
16
|
-
#
|
17
|
-
# @example
|
18
|
-
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
19
|
-
#
|
20
|
-
# request.start do |request, response|
|
21
|
-
# puts "body: " + response.body
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# @return [String]
|
25
|
-
#
|
26
|
-
# @version SketchUp 2017
|
27
|
-
def body
|
28
|
-
end
|
29
|
-
|
30
|
-
# Returns the http headers that were sent by the server.
|
31
|
-
#
|
32
|
-
# @example
|
33
|
-
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
34
|
-
#
|
35
|
-
# request.start do |request, response|
|
36
|
-
# response.headers.each do |key, value|
|
37
|
-
# puts "#{key}: #{value}"
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
#
|
41
|
-
# @return [Hash]
|
42
|
-
#
|
43
|
-
# @version SketchUp 2017
|
44
|
-
def headers
|
45
|
-
end
|
46
|
-
|
47
|
-
# Returns the HTTP response status code as defined in rfc2616.
|
48
|
-
#
|
49
|
-
# @example
|
50
|
-
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
51
|
-
#
|
52
|
-
# request.start do |request, response|
|
53
|
-
# puts "http status code: #{response.status_code}"
|
54
|
-
# end
|
55
|
-
#
|
56
|
-
# @return [int]
|
57
|
-
#
|
58
|
-
# @version SketchUp 2017
|
59
|
-
def status_code
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# Http::Response objects allows you to get the response information from the
|
5
|
+
# server, you can only receive the Http::Response if you have attached a
|
6
|
+
# callback block when calling start from the Http::Request object.
|
7
|
+
#
|
8
|
+
# @version SketchUp 2017
|
9
|
+
class Sketchup::Http::Response
|
10
|
+
|
11
|
+
# Instance Methods
|
12
|
+
|
13
|
+
# Gets the http body that was received from the server as a string encoded
|
14
|
+
# using the charset provided in the Content-Type of the server response, if
|
15
|
+
# no charset is specified, ASCII-8BIT will be used.
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
19
|
+
#
|
20
|
+
# request.start do |request, response|
|
21
|
+
# puts "body: " + response.body
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
#
|
26
|
+
# @version SketchUp 2017
|
27
|
+
def body
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns the http headers that were sent by the server.
|
31
|
+
#
|
32
|
+
# @example
|
33
|
+
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
34
|
+
#
|
35
|
+
# request.start do |request, response|
|
36
|
+
# response.headers.each do |key, value|
|
37
|
+
# puts "#{key}: #{value}"
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# @return [Hash]
|
42
|
+
#
|
43
|
+
# @version SketchUp 2017
|
44
|
+
def headers
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns the HTTP response status code as defined in rfc2616.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# request = Sketchup::Http::Request.new("http://localhost:8080")
|
51
|
+
#
|
52
|
+
# request.start do |request, response|
|
53
|
+
# puts "http status code: #{response.status_code}"
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# @return [int]
|
57
|
+
#
|
58
|
+
# @version SketchUp 2017
|
59
|
+
def status_code
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -1,409 +1,417 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# An Image object represents a raster image placed in the Model.
|
5
|
-
#
|
6
|
-
# @
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# @
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
#
|
197
|
-
#
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
#
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
#
|
217
|
-
# pixels
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
228
|
-
#
|
229
|
-
#
|
230
|
-
#
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
#
|
239
|
-
#
|
240
|
-
# @
|
241
|
-
#
|
242
|
-
#
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
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
|
-
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
# image
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
330
|
-
#
|
331
|
-
#
|
332
|
-
#
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
337
|
-
#
|
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
|
-
|
386
|
-
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
404
|
-
#
|
405
|
-
#
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# An Image object represents a raster image placed in the Model.
|
5
|
+
#
|
6
|
+
# @example Create material from image (SU 2018 and later)
|
7
|
+
# model = Sketchup.active_model
|
8
|
+
# entities = model.active_entities
|
9
|
+
# image = entities.grep(Sketchup::Image).first
|
10
|
+
# img_rep = image.image_rep
|
11
|
+
# material = model.materials.add("New Name")
|
12
|
+
# material.texture = img_rep
|
13
|
+
#
|
14
|
+
# @version SketchUp 6.0
|
15
|
+
class Sketchup::Image < Sketchup::Drawingelement
|
16
|
+
|
17
|
+
# Instance Methods
|
18
|
+
|
19
|
+
# The explode method is used to explode an image into a face with a texture
|
20
|
+
# on it.
|
21
|
+
#
|
22
|
+
# Note that current versions of SketchUp will return an empty array here.
|
23
|
+
# To work around this limitation you can iterate over your entities collection
|
24
|
+
# to determine which new entities were created.
|
25
|
+
#
|
26
|
+
# Versions prior to SketchUp 2015 returned an empty array due to a bug.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# model = Sketchup.active_model
|
30
|
+
# path = "Plugins/su_dynamiccomponents/images"
|
31
|
+
# image_file = Sketchup.find_support_file("report_tool.png", path)
|
32
|
+
# image = model.active_entities.add_image(image_file, ORIGIN, 300)
|
33
|
+
# entities = image.explode
|
34
|
+
#
|
35
|
+
# @return entitiesarray - an Array object of entities if
|
36
|
+
# successful
|
37
|
+
#
|
38
|
+
# @version SketchUp 6.0
|
39
|
+
def explode
|
40
|
+
end
|
41
|
+
|
42
|
+
# The height method is used to retrieve the height of the image.
|
43
|
+
#
|
44
|
+
# The height is given in inches.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
# model = Sketchup.active_model
|
48
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
49
|
+
# pt = Geom::Point3d.new
|
50
|
+
# entities = model.active_entities
|
51
|
+
# image = entities.add_image path, pt, 300
|
52
|
+
# height = image.height
|
53
|
+
# if (height)
|
54
|
+
# UI.messagebox height
|
55
|
+
# else
|
56
|
+
# UI.messagebox "Failure"
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# @return height - the height of the model if successful
|
60
|
+
#
|
61
|
+
# @version SketchUp 6.0
|
62
|
+
def height
|
63
|
+
end
|
64
|
+
|
65
|
+
# The height= method is used to set the height of the image.
|
66
|
+
#
|
67
|
+
# The height is set in inches.
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# model = Sketchup.active_model
|
71
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
72
|
+
# pt = Geom::Point3d.new
|
73
|
+
# entities = model.active_entities
|
74
|
+
# image = entities.add_image path, pt, 300
|
75
|
+
# UI.messagebox "Before adjustment"
|
76
|
+
# height = image.height = 400
|
77
|
+
# if (height)
|
78
|
+
# UI.messagebox height
|
79
|
+
# else
|
80
|
+
# UI.messagebox "Failure"
|
81
|
+
# end
|
82
|
+
#
|
83
|
+
# @param height
|
84
|
+
# The height, in inches, to set the image.
|
85
|
+
#
|
86
|
+
# @return height - the new height if successful
|
87
|
+
#
|
88
|
+
# @version SketchUp 6.0
|
89
|
+
def height=(height)
|
90
|
+
end
|
91
|
+
|
92
|
+
# The {#image_rep} method returns a copy of a {Sketchup::ImageRep} object
|
93
|
+
# representing the pixel data.
|
94
|
+
#
|
95
|
+
# @example
|
96
|
+
# model = Sketchup.active_model
|
97
|
+
# path = "Plugins/su_dynamiccomponents/images"
|
98
|
+
# image_file = Sketchup.find_support_file("report_tool.png", path)
|
99
|
+
# image = model.active_entities.add_image(image_file, ORIGIN, 300)
|
100
|
+
# image_rep = image.image_rep
|
101
|
+
#
|
102
|
+
# @return [Sketchup::ImageRep]
|
103
|
+
#
|
104
|
+
# @version SketchUp 2018
|
105
|
+
def image_rep
|
106
|
+
end
|
107
|
+
|
108
|
+
# The normal method is used to retrieve the 3D Vector that is perpendicular to
|
109
|
+
# the plane of the image.
|
110
|
+
#
|
111
|
+
# @example
|
112
|
+
# model = Sketchup.active_model
|
113
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
114
|
+
# pt = Geom::Point3d.new
|
115
|
+
# entities = model.active_entities
|
116
|
+
# image = entities.add_image path, pt, 300
|
117
|
+
# vector = image.normal
|
118
|
+
# if (vector)
|
119
|
+
# UI.messagebox vector
|
120
|
+
# else
|
121
|
+
# UI.messagebox "Failure"
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# @return vector - a Vector3d object if successful
|
125
|
+
#
|
126
|
+
# @version SketchUp 6.0
|
127
|
+
def normal
|
128
|
+
end
|
129
|
+
|
130
|
+
# The origin method is used to retrieve the 3D point that defines the origin
|
131
|
+
# of the image.
|
132
|
+
#
|
133
|
+
# @example
|
134
|
+
# model = Sketchup.active_model
|
135
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
136
|
+
# pt = Geom::Point3d.new
|
137
|
+
# entities = model.active_entities
|
138
|
+
# image = entities.add_image path, pt, 300
|
139
|
+
# origin = image.origin
|
140
|
+
# if (origin)
|
141
|
+
# UI.messagebox origin
|
142
|
+
# else
|
143
|
+
# UI.messagebox "Failure"
|
144
|
+
# end
|
145
|
+
#
|
146
|
+
# @return point - a Point3d object containing the origin location
|
147
|
+
# if successful
|
148
|
+
#
|
149
|
+
# @version SketchUp 6.0
|
150
|
+
def origin
|
151
|
+
end
|
152
|
+
|
153
|
+
# The origin= method is used to set the 3D point as the origin of the image.
|
154
|
+
#
|
155
|
+
# @example
|
156
|
+
# model = Sketchup.active_model
|
157
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
158
|
+
# pt = Geom::Point3d.new
|
159
|
+
# pt2 = Geom::Point3d.new 100,100,100
|
160
|
+
# entities = model.active_entities
|
161
|
+
# image = entities.add_image path, pt, 300
|
162
|
+
# UI.messagebox "Before Move"
|
163
|
+
# origin = image.origin=pt2
|
164
|
+
# if (origin)
|
165
|
+
# UI.messagebox origin
|
166
|
+
# else
|
167
|
+
# UI.messagebox "Failure"
|
168
|
+
# end
|
169
|
+
#
|
170
|
+
# @param point
|
171
|
+
# A Point3d object with the new origin.
|
172
|
+
#
|
173
|
+
# @return point - the Point3d object representing the newly
|
174
|
+
# established origin if successful
|
175
|
+
#
|
176
|
+
# @version SketchUp 6.0
|
177
|
+
def origin=(point)
|
178
|
+
end
|
179
|
+
|
180
|
+
# The path method is used to retrieve the path of the file defining the image.
|
181
|
+
#
|
182
|
+
# @example
|
183
|
+
# model = Sketchup.active_model
|
184
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
185
|
+
# pt = Geom::Point3d.new
|
186
|
+
# entities = model.active_entities
|
187
|
+
# image = entities.add_image path, pt, 300
|
188
|
+
# path = image.path
|
189
|
+
# if (path)
|
190
|
+
# UI.messagebox path
|
191
|
+
# else
|
192
|
+
# UI.messagebox "Failure"
|
193
|
+
# end
|
194
|
+
#
|
195
|
+
# @return path - the path for the image file if successful
|
196
|
+
#
|
197
|
+
# @version SketchUp 6.0
|
198
|
+
def path
|
199
|
+
end
|
200
|
+
|
201
|
+
# The pixelheight method is used to retrieve the height of the image file in
|
202
|
+
# pixels.
|
203
|
+
#
|
204
|
+
# @example
|
205
|
+
# model = Sketchup.active_model
|
206
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
207
|
+
# pt = Geom::Point3d.new
|
208
|
+
# entities = model.active_entities
|
209
|
+
# image = entities.add_image path, pt, 300
|
210
|
+
# pixelheight = image.pixelheight
|
211
|
+
# if (pixelheight)
|
212
|
+
# UI.messagebox pixelheight
|
213
|
+
# else
|
214
|
+
# UI.messagebox "Failure"
|
215
|
+
# end
|
216
|
+
#
|
217
|
+
# @return height - the height of the image in pixels if
|
218
|
+
# successful
|
219
|
+
#
|
220
|
+
# @version SketchUp 6.0
|
221
|
+
def pixelheight
|
222
|
+
end
|
223
|
+
|
224
|
+
# The pixelwidth method is used to retrieve the width of the image file in
|
225
|
+
# pixels.
|
226
|
+
#
|
227
|
+
# @example
|
228
|
+
# model = Sketchup.active_model
|
229
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
230
|
+
# pt = Geom::Point3d.new
|
231
|
+
# entities = model.active_entities
|
232
|
+
# image = entities.add_image path, pt, 300
|
233
|
+
# pixelwidth = image.pixelwidth
|
234
|
+
# if (pixelwidth)
|
235
|
+
# UI.messagebox pixelwidth
|
236
|
+
# else
|
237
|
+
# UI.messagebox "Failure"
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
# @return width - the width of the image in pixels if successful
|
241
|
+
#
|
242
|
+
# @version SketchUp 6.0
|
243
|
+
def pixelwidth
|
244
|
+
end
|
245
|
+
|
246
|
+
# The size= method is used to set the width and height of the image, in inches.
|
247
|
+
#
|
248
|
+
# @example
|
249
|
+
# model = Sketchup.active_model
|
250
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
251
|
+
# pt = Geom::Point3d.new
|
252
|
+
# entities = model.active_entities
|
253
|
+
# image = entities.add_image path, pt, 300
|
254
|
+
# UI.messagebox "Before Resize"
|
255
|
+
# size = image.size= 500,500
|
256
|
+
# if (size)
|
257
|
+
# UI.messagebox size
|
258
|
+
# else
|
259
|
+
# UI.messagebox "Failure"
|
260
|
+
# end
|
261
|
+
#
|
262
|
+
# @param width
|
263
|
+
# The width of the image.
|
264
|
+
#
|
265
|
+
# @param height
|
266
|
+
# The height of the image.
|
267
|
+
#
|
268
|
+
# @return size - the new width and height of the image if
|
269
|
+
# successful
|
270
|
+
#
|
271
|
+
# @version SketchUp 6.0
|
272
|
+
def size=(width, height)
|
273
|
+
end
|
274
|
+
|
275
|
+
# The transform! method is used to apply a transformation to the image.
|
276
|
+
#
|
277
|
+
# @example
|
278
|
+
# model = Sketchup.active_model
|
279
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
280
|
+
# point = Geom::Point3d.new 100,100,100
|
281
|
+
# t = Geom::Transformation.new point
|
282
|
+
# pt = Geom::Point3d.new
|
283
|
+
# entities = model.active_entities
|
284
|
+
# image = entities.add_image path, pt, 300
|
285
|
+
# UI.messagebox "Before Move"
|
286
|
+
# image = image.transform! t
|
287
|
+
# if (image)
|
288
|
+
# UI.messagebox image
|
289
|
+
# else
|
290
|
+
# UI.messagebox "Failure"
|
291
|
+
# end
|
292
|
+
#
|
293
|
+
# @param transform
|
294
|
+
# A Transformation object.
|
295
|
+
#
|
296
|
+
# @return image - the transformed Image object if successful
|
297
|
+
#
|
298
|
+
# @version SketchUp 6.0
|
299
|
+
def transform!(transform)
|
300
|
+
end
|
301
|
+
|
302
|
+
# The transformation method is used to retrieve the transformation for the
|
303
|
+
# image.
|
304
|
+
#
|
305
|
+
# @example
|
306
|
+
# # Add an image to the model.
|
307
|
+
# model = Sketchup.active_model
|
308
|
+
# entities = model.active_entities
|
309
|
+
# path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
|
310
|
+
# point = Geom::Point3d.new(100,100,100)
|
311
|
+
# image = entities.add_image(path, point, 300)
|
312
|
+
#
|
313
|
+
# trans = image.transformation
|
314
|
+
#
|
315
|
+
# @return transformation - a Transformation object if successful
|
316
|
+
#
|
317
|
+
# @version SketchUp 2014
|
318
|
+
def transformation
|
319
|
+
end
|
320
|
+
|
321
|
+
# The transformation= method is used to set the transformation for the
|
322
|
+
# image.
|
323
|
+
#
|
324
|
+
# @example
|
325
|
+
# # Add an image to the model.
|
326
|
+
# model = Sketchup.active_model
|
327
|
+
# entities = model.active_entities
|
328
|
+
# path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
|
329
|
+
# point = Geom::Point3d.new(100,100,100)
|
330
|
+
# image = entities.add_image(path, point, 300)
|
331
|
+
#
|
332
|
+
# new_transform = Geom::Transformation.new([100,0,0])
|
333
|
+
# image.transformation = new_transform
|
334
|
+
#
|
335
|
+
# @param transform
|
336
|
+
# The Transformation object to apply
|
337
|
+
#
|
338
|
+
# @return image - the newly transformed image
|
339
|
+
#
|
340
|
+
# @version SketchUp 2014
|
341
|
+
def transformation=(transform)
|
342
|
+
end
|
343
|
+
|
344
|
+
# The width method is used to retrieve the width of the image.
|
345
|
+
#
|
346
|
+
# The width is given in inches.
|
347
|
+
#
|
348
|
+
# @example
|
349
|
+
# model = Sketchup.active_model
|
350
|
+
# path = Sketchup.find_support_file "report_tool.png",
|
351
|
+
# "Tools/DynamicComponents/images"
|
352
|
+
# pt = Geom::Point3d.new
|
353
|
+
# entities = model.active_entities
|
354
|
+
# image = entities.add_image path, pt, 300
|
355
|
+
# width = image.width
|
356
|
+
# if (width)
|
357
|
+
# UI.messagebox width
|
358
|
+
# else
|
359
|
+
# UI.messagebox "Failure"
|
360
|
+
# end
|
361
|
+
#
|
362
|
+
# @return width - the width of the image if successful
|
363
|
+
#
|
364
|
+
# @version SketchUp 6.0
|
365
|
+
def width
|
366
|
+
end
|
367
|
+
|
368
|
+
# The width= method is used to set the width of the image.
|
369
|
+
#
|
370
|
+
# The width is set in inches.
|
371
|
+
#
|
372
|
+
# @example
|
373
|
+
# model = Sketchup.active_model
|
374
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
375
|
+
# pt = Geom::Point3d.new
|
376
|
+
# entities = model.active_entities
|
377
|
+
# image = entities.add_image path, pt, 300
|
378
|
+
# UI.messagebox "Before adjustment"
|
379
|
+
# width = image.width=400
|
380
|
+
# if (width)
|
381
|
+
# UI.messagebox width
|
382
|
+
# else
|
383
|
+
# UI.messagebox "Failure"
|
384
|
+
# end
|
385
|
+
#
|
386
|
+
# @param width
|
387
|
+
# The width, in inches, to set the image.
|
388
|
+
#
|
389
|
+
# @return width - the new width if successful
|
390
|
+
#
|
391
|
+
# @version SketchUp 6.0
|
392
|
+
def width=(width)
|
393
|
+
end
|
394
|
+
|
395
|
+
# The zrotation method is used to get the angle that the image is rotated
|
396
|
+
# about the normal vector from an arbitrary X axis.
|
397
|
+
#
|
398
|
+
# @example
|
399
|
+
# model = Sketchup.active_model
|
400
|
+
# path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
|
401
|
+
# pt = Geom::Point3d.new
|
402
|
+
# entities = model.active_entities
|
403
|
+
# image = entities.add_image path, pt, 300
|
404
|
+
# zrotation = image.zrotation
|
405
|
+
# if (zrotation)
|
406
|
+
# UI.messagebox zrotation
|
407
|
+
# else
|
408
|
+
# UI.messagebox "Failure"
|
409
|
+
# end
|
410
|
+
#
|
411
|
+
# @return vector - a Vector3d object if successful
|
412
|
+
#
|
413
|
+
# @version SketchUp 6.0
|
414
|
+
def zrotation
|
415
|
+
end
|
416
|
+
|
417
|
+
end
|