sketchup-api-stubs 0.7.4 → 0.7.8
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 +148 -145
- data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +741 -741
- 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 +523 -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 +693 -691
- data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +351 -348
- data/lib/sketchup-api-stubs/stubs/{languagehandler.rb → LanguageHandler.rb} +93 -92
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +698 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +516 -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 +354 -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 +692 -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/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/{length.rb → Length.rb} +278 -278
- data/lib/sketchup-api-stubs/stubs/{numeric.rb → Numeric.rb} +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -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 +619 -562
- 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 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +426 -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 +1205 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +272 -0
- 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 +937 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +292 -285
- 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 -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 +407 -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 +326 -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/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 +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 +477 -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 +260 -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 +837 -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 +75 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1317 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +1360 -1310
- data/lib/sketchup-api-stubs/stubs/{sketchupextension.rb → SketchupExtension.rb} +353 -353
- data/lib/sketchup-api-stubs/stubs/{string.rb → String.rb} +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +496 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -633
- data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +683 -667
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +15 -12
@@ -1,492 +1,523 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The {#Geom::PolygonMesh} class contains methods to create polygon mesh
|
5
|
-
# structures. This is useful if you need to write a custom importer/exporter in
|
6
|
-
# Ruby that works at the level of triangulated polygons. For example, you can
|
7
|
-
# determine the triangles that make up a 15-sided {#Sketchup::Face} by using
|
8
|
-
# this class, or write a {#Sketchup::Importer} that reads a data file, creates
|
9
|
-
# a mesh from it, and draws faces based on the mesh.
|
10
|
-
#
|
11
|
-
# You can construct a mesh manually using the methods of this class, or you
|
12
|
-
# can get a mesh from a face by calling the Face
|
13
|
-
# {Sketchup::Entities#add_faces_from_mesh} for an easy way to convert a mesh
|
14
|
-
# back into faces.
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# group
|
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
|
-
# @overload add_polygon(
|
79
|
-
#
|
80
|
-
# Adds a polygon from
|
81
|
-
# @example
|
82
|
-
# mesh = Geom::PolygonMesh.new
|
83
|
-
# # add points to mesh...
|
84
|
-
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
|
85
|
-
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
|
86
|
-
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
|
87
|
-
# polygon_index = mesh.add_polygon(
|
88
|
-
# @param [
|
89
|
-
# An
|
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
|
-
# @return [
|
148
|
-
#
|
149
|
-
#
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
# mesh.
|
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
|
-
|
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
|
-
# mesh.
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
#
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
# mesh.
|
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
|
-
#
|
326
|
-
#
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
# The
|
334
|
-
#
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
#
|
340
|
-
#
|
341
|
-
#
|
342
|
-
#
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
#
|
347
|
-
# mesh.
|
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
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
#
|
422
|
-
#
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
# mesh.
|
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
|
-
#
|
479
|
-
#
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
487
|
-
#
|
488
|
-
#
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {#Geom::PolygonMesh} class contains methods to create polygon mesh
|
5
|
+
# structures. This is useful if you need to write a custom importer/exporter in
|
6
|
+
# Ruby that works at the level of triangulated polygons. For example, you can
|
7
|
+
# determine the triangles that make up a 15-sided {#Sketchup::Face} by using
|
8
|
+
# this class, or write a {#Sketchup::Importer} that reads a data file, creates
|
9
|
+
# a mesh from it, and draws faces based on the mesh.
|
10
|
+
#
|
11
|
+
# You can construct a mesh manually using the methods of this class, or you
|
12
|
+
# can get a mesh from a face by calling the {Sketchup::Face#mesh} method. See
|
13
|
+
# {Sketchup::Entities#add_faces_from_mesh} for an easy way to convert a mesh
|
14
|
+
# back into faces.
|
15
|
+
#
|
16
|
+
# @example
|
17
|
+
# entities = Sketchup.active_model.active_entities
|
18
|
+
# face = entities.grep(Sketchup::Face).first
|
19
|
+
#
|
20
|
+
# mesh = face.mesh
|
21
|
+
#
|
22
|
+
# group = entities.add_group
|
23
|
+
# group.entities.add_faces_from_mesh(mesh)
|
24
|
+
#
|
25
|
+
# @note As of SketchUp 2022.0 the new {Sketchup::EntitiesBuilder} interface
|
26
|
+
# can be used to generate bulk geometry. It has similar performance as
|
27
|
+
# {Geom::PolygonMesh}, but with similar degree of per-entity control as
|
28
|
+
# {Sketchup::Entities}.
|
29
|
+
#
|
30
|
+
# @see file:pages/generating_geometry.md
|
31
|
+
# Guide on Generating Geometry
|
32
|
+
#
|
33
|
+
# @version SketchUp 6.0
|
34
|
+
class Geom::PolygonMesh
|
35
|
+
|
36
|
+
# Constants
|
37
|
+
|
38
|
+
AUTO_SOFTEN = nil # Stub value.
|
39
|
+
HIDE_BASED_ON_INDEX = nil # Stub value.
|
40
|
+
NO_SMOOTH_OR_HIDE = nil # Stub value.
|
41
|
+
SMOOTH_SOFT_EDGES = nil # Stub value.
|
42
|
+
SOFTEN_BASED_ON_INDEX = nil # Stub value.
|
43
|
+
|
44
|
+
MESH_NORMALS = nil # Stub value.
|
45
|
+
MESH_POINTS = nil # Stub value.
|
46
|
+
MESH_UVQ_BACK = nil # Stub value.
|
47
|
+
MESH_UVQ_FRONT = nil # Stub value.
|
48
|
+
|
49
|
+
# Instance Methods
|
50
|
+
|
51
|
+
# The {#add_point} method is used to add a point to the mesh.
|
52
|
+
#
|
53
|
+
# The returned index can be used for creating polygons.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# mesh = Geom::PolygonMesh.new
|
57
|
+
# point = Geom::Point3d.new(0, 1, 2)
|
58
|
+
# index = mesh.add_point(point)
|
59
|
+
#
|
60
|
+
# @note In SketchUp 2021.1 this method was improved to be faster.
|
61
|
+
# See {#initialize} for details.
|
62
|
+
#
|
63
|
+
# @param [Geom::Point3d] point
|
64
|
+
#
|
65
|
+
# @return [Integer] the index in the mesh for the point
|
66
|
+
#
|
67
|
+
# @version SketchUp 6.0
|
68
|
+
def add_point(point)
|
69
|
+
end
|
70
|
+
|
71
|
+
# The {#add_polygon} method is used for adding a polygon to a
|
72
|
+
# {Geom::PolygonMesh}. All variations of this method require at least 3 elements
|
73
|
+
# to define a polygon, although more may be given.
|
74
|
+
#
|
75
|
+
# @note In SketchUp 2021.1 this method was improved to be faster.
|
76
|
+
# See {#initialize} for details.
|
77
|
+
#
|
78
|
+
# @overload add_polygon(index, index, index, ...)
|
79
|
+
#
|
80
|
+
# Adds a polygon from a list of the mesh's vertex indices.
|
81
|
+
# @example
|
82
|
+
# mesh = Geom::PolygonMesh.new
|
83
|
+
# # add points to mesh...
|
84
|
+
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
|
85
|
+
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
|
86
|
+
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
|
87
|
+
# polygon_index = mesh.add_polygon(1, 2, 3)
|
88
|
+
# @param [Integer] index
|
89
|
+
# An index of a vertex in the mesh. Remember that mesh indices start at 1.
|
90
|
+
# @param [Integer] ...
|
91
|
+
# Additional indices (optional)
|
92
|
+
#
|
93
|
+
# @overload add_polygon(index_array)
|
94
|
+
#
|
95
|
+
# Adds a polygon from an Array of the mesh's vertex indices.
|
96
|
+
# @example
|
97
|
+
# mesh = Geom::PolygonMesh.new
|
98
|
+
# # add points to mesh...
|
99
|
+
# mesh.add_point(Geom::Point3d.new(0, 0, 0))
|
100
|
+
# mesh.add_point(Geom::Point3d.new(1, 0, 0))
|
101
|
+
# mesh.add_point(Geom::Point3d.new(1, 1, 0))
|
102
|
+
# polygon_index = mesh.add_polygon([1, 2, 3])
|
103
|
+
# @param [Array<Integer>] index_array
|
104
|
+
# An {Array} of point indices.
|
105
|
+
#
|
106
|
+
# @overload add_polygon(point3d, point3d, point3d, ...)
|
107
|
+
#
|
108
|
+
# Adds a polygon from a list of Point3d objects.
|
109
|
+
# @example
|
110
|
+
# mesh = Geom::PolygonMesh.new
|
111
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
112
|
+
# point2 = Geom::Point3d.new(1, 0, 2)
|
113
|
+
# point3 = Geom::Point3d.new(2, 0, 1)
|
114
|
+
# polygon_index = mesh.add_polygon(point1, point2, point3)
|
115
|
+
# @param [Geom::Point3d] point3d
|
116
|
+
# @raise [ArgumentError] When using Arrays in place of Point3d objects.
|
117
|
+
# Normally Arrays may be used in place of Point3d objects in most
|
118
|
+
# SketchUp methods. This method is an exception to that rule.
|
119
|
+
# @param [Geom::Point3d] ...
|
120
|
+
# Additional points (optional)
|
121
|
+
#
|
122
|
+
# @overload add_polygon(point3d_array)
|
123
|
+
#
|
124
|
+
# Adds a polygon from an Array of Point3d objects.
|
125
|
+
# @example
|
126
|
+
# mesh = Geom::PolygonMesh.new
|
127
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
128
|
+
# point2 = Geom::Point3d.new(1, 0, 2)
|
129
|
+
# point3 = Geom::Point3d.new(2, 0, 1)
|
130
|
+
# polygon_index = mesh.add_polygon([point1, point2, point3])
|
131
|
+
# @param [Array<Geom::Point3d>] point3d_array
|
132
|
+
#
|
133
|
+
# @overload add_polygon(array)
|
134
|
+
#
|
135
|
+
# Adds a polygon from an Array of 3-element Arrays.
|
136
|
+
# @example
|
137
|
+
# pts = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0.5, 2, 0], [0, 1, 0]]
|
138
|
+
# mesh = Geom::PolygonMesh.new
|
139
|
+
# polygon_index = mesh.add_polygon(pts)
|
140
|
+
# Sketchup.active_model.entities.add_faces_from_mesh(mesh)
|
141
|
+
# @param [Array<Array(3)>] array
|
142
|
+
# An array of arrays of length 3, where the inner arrays are used as if
|
143
|
+
# they were Point3d objects.
|
144
|
+
#
|
145
|
+
# @return [Integer] The index of the polygon in the mesh.
|
146
|
+
#
|
147
|
+
# @return [0] Invalid index. Returned if the method failed to create a
|
148
|
+
# polygon.
|
149
|
+
#
|
150
|
+
# @version SketchUp 6.0
|
151
|
+
def add_polygon(*args)
|
152
|
+
end
|
153
|
+
|
154
|
+
# The {#count_points} method is used to count the number of points in a mesh.
|
155
|
+
#
|
156
|
+
# @example
|
157
|
+
# mesh = Geom::PolygonMesh.new
|
158
|
+
# point = Geom::Point3d.new(0, 1, 2)
|
159
|
+
# mesh.add_point(point)
|
160
|
+
# num = mesh.count_points
|
161
|
+
#
|
162
|
+
# @return [Integer] the number of points in a mesh
|
163
|
+
#
|
164
|
+
# @version SketchUp 6.0
|
165
|
+
def count_points
|
166
|
+
end
|
167
|
+
|
168
|
+
# The {#count_polygons} count the number of polygons in the mesh.
|
169
|
+
#
|
170
|
+
# @example
|
171
|
+
# mesh = Geom::PolygonMesh.new
|
172
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
173
|
+
# point2 = Geom::Point3d.new(1, 0, 2)
|
174
|
+
# point3 = Geom::Point3d.new(2, 0, 1)
|
175
|
+
# mesh.add_polygon(point1, point2, point3)
|
176
|
+
# nump = mesh.count_polygons
|
177
|
+
#
|
178
|
+
# @return [Integer] the number of polygons in the mesh
|
179
|
+
#
|
180
|
+
# @version SketchUp 6.0
|
181
|
+
def count_polygons
|
182
|
+
end
|
183
|
+
|
184
|
+
# Create a new empty polygon mesh.
|
185
|
+
#
|
186
|
+
# The number of points and polygons are optional and are used as a hint to
|
187
|
+
# decide how much space to pre-allocate to speed up adding points and polygons.
|
188
|
+
#
|
189
|
+
# As of SketchUp 2021.1 the performance of looking up and inserting points is
|
190
|
+
# significantly better provided the mesh was initialized with roughly the
|
191
|
+
# correct number of total points.
|
192
|
+
#
|
193
|
+
# @example
|
194
|
+
# mesh = Geom::PolygonMesh.new
|
195
|
+
#
|
196
|
+
# @note When creating a mesh with normals and/or UVQ data it's critical that
|
197
|
+
# the number of points estimated is equal to or higher than the final number
|
198
|
+
# of points added. If fewer points are estimated the normals and UVQ data
|
199
|
+
# might end up out of sync.
|
200
|
+
#
|
201
|
+
# @overload initialize
|
202
|
+
#
|
203
|
+
# @return [Geom::PolygonMesh]
|
204
|
+
#
|
205
|
+
# @overload initialize(numpts)
|
206
|
+
#
|
207
|
+
# @param [Integer] numpts How many points will be in the mesh.
|
208
|
+
# @return [Geom::PolygonMesh]
|
209
|
+
#
|
210
|
+
# @overload initialize(numpts, numpolys)
|
211
|
+
#
|
212
|
+
# @param [Integer] numpts How many points will be in the mesh.
|
213
|
+
# @param [Integer] numpolys How many polygons will be in the mesh.
|
214
|
+
# @return [Geom::PolygonMesh]
|
215
|
+
#
|
216
|
+
# @raise [RangeError] If number of points or polygons are negative numbers.
|
217
|
+
#
|
218
|
+
# @version SketchUp 6.0
|
219
|
+
def initialize(*args)
|
220
|
+
end
|
221
|
+
|
222
|
+
# The {#normal_at} method is used to determine the vertex normal at a
|
223
|
+
# particular index in the mesh. This only works for meshes retrieved from
|
224
|
+
# {Sketchup::Face#mesh} with the +PolygonMeshNormals+ flag.
|
225
|
+
#
|
226
|
+
# @example
|
227
|
+
# flags = 4 # PolygonMeshNormals
|
228
|
+
# mesh = face.mesh(flags)
|
229
|
+
# normal = mesh.normal_at(1)
|
230
|
+
#
|
231
|
+
# @note Index starts at 1.
|
232
|
+
#
|
233
|
+
# @param [Integer] index
|
234
|
+
# The index in the mesh for the vertex normal to be
|
235
|
+
# retrieved
|
236
|
+
#
|
237
|
+
# @return [Geom::Vector3d, nil]
|
238
|
+
#
|
239
|
+
# @version SketchUp 6.0
|
240
|
+
def normal_at(index)
|
241
|
+
end
|
242
|
+
|
243
|
+
# The {#point_at} method is used to retrieve the point at a specific index in
|
244
|
+
# the mesh.
|
245
|
+
#
|
246
|
+
# @example
|
247
|
+
# mesh = Geom::PolygonMesh.new
|
248
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
249
|
+
# point2 = Geom::Point3d.new(10, 20, 30)
|
250
|
+
# mesh.add_point(point1)
|
251
|
+
# mesh.add_point(point2)
|
252
|
+
# point_from_index = mesh.point_at(1)
|
253
|
+
#
|
254
|
+
# @note Index starts at 1.
|
255
|
+
#
|
256
|
+
# @param [Integer] index
|
257
|
+
# The index in the mesh for the point to be retrieved
|
258
|
+
#
|
259
|
+
# @return [Geom::Point3d, nil]
|
260
|
+
#
|
261
|
+
# @version SketchUp 6.0
|
262
|
+
def point_at(index)
|
263
|
+
end
|
264
|
+
|
265
|
+
# The {#point_index} method is used to retrieve the index of a point in the
|
266
|
+
# mesh.
|
267
|
+
#
|
268
|
+
# @example
|
269
|
+
# mesh = Geom::PolygonMesh.new
|
270
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
271
|
+
# point2 = Geom::Point3d.new(10, 20, 30)
|
272
|
+
# mesh.add_point(point1)
|
273
|
+
# mesh.add_point(point2)
|
274
|
+
# index = mesh.point_index(point2)
|
275
|
+
#
|
276
|
+
# @note Returns 0 if point is not found.
|
277
|
+
#
|
278
|
+
# @param [Geom::Point3d] point
|
279
|
+
#
|
280
|
+
# @return [Integer] the index in the mesh for the {Geom::Point3d} object
|
281
|
+
#
|
282
|
+
# @version SketchUp 6.0
|
283
|
+
def point_index(point)
|
284
|
+
end
|
285
|
+
|
286
|
+
# The {#points} method is used to retrieve an array of points (vertices) in the
|
287
|
+
# mesh
|
288
|
+
#
|
289
|
+
# @example
|
290
|
+
# mesh = Geom::PolygonMesh.new
|
291
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
292
|
+
# point2 = Geom::Point3d.new(10, 20, 30)
|
293
|
+
# mesh.add_point(point1)
|
294
|
+
# mesh.add_point(point2)
|
295
|
+
# # Returns array of points in the mesh.
|
296
|
+
# points = mesh.points
|
297
|
+
#
|
298
|
+
# @return [Array<Geom::Point3d>]
|
299
|
+
#
|
300
|
+
# @version SketchUp 6.0
|
301
|
+
def points
|
302
|
+
end
|
303
|
+
|
304
|
+
# The {#polygon_at} method is used to retrieve an array of vertex index values
|
305
|
+
# for a polygon at a specific index.
|
306
|
+
#
|
307
|
+
# @example
|
308
|
+
# mesh = Geom::PolygonMesh.new
|
309
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
310
|
+
# point2 = Geom::Point3d.new(1, 0, 2)
|
311
|
+
# point3 = Geom::Point3d.new(2, 0, 1)
|
312
|
+
# index = mesh.add_polygon(point1, point2, point3)
|
313
|
+
# polygon = mesh.polygon_at(index)
|
314
|
+
#
|
315
|
+
# @note Index starts at 1.
|
316
|
+
#
|
317
|
+
# @note The returned array can contain negative
|
318
|
+
# values with the sign indicating a hidden edge. For example, a return value
|
319
|
+
# of +[-1, 2, 3]+ indicates that the edge from +1+ to +2+ is hidden. The
|
320
|
+
# negative values should not be used as an index for {#point_at}, take the
|
321
|
+
# absolute value of the index value in the polygon array. So if you
|
322
|
+
# get +[-1, 2,3]+ use +1+ as the argument to {#point_at}.
|
323
|
+
#
|
324
|
+
# @param [Integer] index
|
325
|
+
# The index of the desired polygon.
|
326
|
+
#
|
327
|
+
# @return [Array<Geom::Point3d>, nil]
|
328
|
+
#
|
329
|
+
# @version SketchUp 6.0
|
330
|
+
def polygon_at(index)
|
331
|
+
end
|
332
|
+
|
333
|
+
# The {#polygon_points_at} method is used to retrieve the points for a polygon
|
334
|
+
# that is at a specific index in the mesh.
|
335
|
+
#
|
336
|
+
# @example
|
337
|
+
# mesh = Geom::PolygonMesh.new
|
338
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
339
|
+
# point2 = Geom::Point3d.new(1, 0, 2)
|
340
|
+
# point3 = Geom::Point3d.new(2, 0, 1)
|
341
|
+
# index = mesh.add_polygon(point1, point2, point3)
|
342
|
+
# points = mesh.polygon_points_at(index)
|
343
|
+
#
|
344
|
+
# @note Index starts at 1.
|
345
|
+
#
|
346
|
+
# @param [Integer] index
|
347
|
+
# An index for a polygon in the mesh.
|
348
|
+
#
|
349
|
+
# @return [Array<Geom::Point3d>, nil]
|
350
|
+
#
|
351
|
+
# @version SketchUp 6.0
|
352
|
+
def polygon_points_at(index)
|
353
|
+
end
|
354
|
+
|
355
|
+
# The {#polygons} method is used to retrieve an array of all polygons in the
|
356
|
+
# mesh.
|
357
|
+
#
|
358
|
+
# The returned array contains an array that can have a negative value with the
|
359
|
+
# sign indicating a hidden edge. For example, a return value of +[-1, 2, 3]+
|
360
|
+
# indicates that the edge from +1+ to +2+ is hidden.
|
361
|
+
#
|
362
|
+
# @example
|
363
|
+
# polygons = polygonmesh.polygons
|
364
|
+
#
|
365
|
+
# @return [Array<Array<Integer>>, Array<nil>]
|
366
|
+
#
|
367
|
+
# @version SketchUp 6.0
|
368
|
+
def polygons
|
369
|
+
end
|
370
|
+
|
371
|
+
# The {#set_point} method is used to set the point at a specific index in the
|
372
|
+
# mesh.
|
373
|
+
#
|
374
|
+
# @example
|
375
|
+
# mesh = Geom::PolygonMesh.new
|
376
|
+
# point1 = Geom::Point3d.new(0, 1, 2)
|
377
|
+
# point2 = Geom::Point3d.new(10, 20, 30)
|
378
|
+
# index = mesh.add_point(point1)
|
379
|
+
# mesh.set_point(index, point2)
|
380
|
+
#
|
381
|
+
# @note Index starts at 1.
|
382
|
+
#
|
383
|
+
# @param [Integer] index
|
384
|
+
# The index where the point will be set.
|
385
|
+
#
|
386
|
+
# @param [Geom::Point3d] point
|
387
|
+
# A Point3d object to set at the index.
|
388
|
+
#
|
389
|
+
# @return [Geom::PolygonMesh]
|
390
|
+
#
|
391
|
+
# @version SketchUp 6.0
|
392
|
+
def set_point(index, point)
|
393
|
+
end
|
394
|
+
|
395
|
+
# The {#set_uv} method is used to define UV mapping coordinates to points in
|
396
|
+
# the mesh.
|
397
|
+
#
|
398
|
+
# Beware that the polygons connected to the point will share UV coordiates so
|
399
|
+
# UV mapping coordinates needs to be continuous across the polygon mesh.
|
400
|
+
#
|
401
|
+
# When setting the UV for a point one need to make sure to have the correct
|
402
|
+
# index for the point. It's therefore best to add the points using {#add_point}
|
403
|
+
# and use the index it returns for following calls to set_uv and
|
404
|
+
# {#add_polygon}.
|
405
|
+
#
|
406
|
+
# If you are not able to calculate how many points there will be in your mesh
|
407
|
+
# make sure to not specify an index in {#set_uv} higher than the number of
|
408
|
+
# times you have called {#set_uv}.
|
409
|
+
#
|
410
|
+
# @example
|
411
|
+
# mesh = Geom::PolygonMesh.new(4)
|
412
|
+
# # Create points for a triangle.
|
413
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
414
|
+
# point2 = Geom::Point3d.new(9, 0, 0)
|
415
|
+
# point3 = Geom::Point3d.new(9, 9, 0)
|
416
|
+
# point4 = Geom::Point3d.new(0, 9, 0)
|
417
|
+
# # Create UV mapping to tile 2x cross triangle.
|
418
|
+
# uv1 = Geom::Point3d.new(0, 0, 0)
|
419
|
+
# uv2 = Geom::Point3d.new(2, 0, 0)
|
420
|
+
# uv3 = Geom::Point3d.new(2, 2, 0)
|
421
|
+
# uv4 = Geom::Point3d.new(0, 2, 0)
|
422
|
+
# # Add points and UV data to mesh.
|
423
|
+
# index1 = mesh.add_point(point1)
|
424
|
+
# index2 = mesh.add_point(point2)
|
425
|
+
# index3 = mesh.add_point(point3)
|
426
|
+
# index4 = mesh.add_point(point4)
|
427
|
+
# mesh.set_uv(index1, uv1, true)
|
428
|
+
# mesh.set_uv(index2, uv2, true)
|
429
|
+
# mesh.set_uv(index3, uv3, true)
|
430
|
+
# mesh.set_uv(index4, uv4, true)
|
431
|
+
# # Add polygons.
|
432
|
+
# mesh.add_polygon(index1, index2, index3)
|
433
|
+
# mesh.add_polygon(index1, index3, index4)
|
434
|
+
#
|
435
|
+
# @note If you don't specify how many points you will be adding to the mesh
|
436
|
+
# when you initiate it you may risk the UV data becoming out of sync.
|
437
|
+
#
|
438
|
+
# @note Index starts at 1.
|
439
|
+
#
|
440
|
+
# @param [Integer] index
|
441
|
+
# An Integer representing the UV index.
|
442
|
+
#
|
443
|
+
# @param [Geom::Point3d] point
|
444
|
+
# A Point3d object representing UV coordinates.
|
445
|
+
#
|
446
|
+
# @param [Boolean] front
|
447
|
+
# A boolean representing the front or back.
|
448
|
+
#
|
449
|
+
# @return [nil]
|
450
|
+
#
|
451
|
+
# @version SketchUp 2014
|
452
|
+
def set_uv(index, point, front)
|
453
|
+
end
|
454
|
+
|
455
|
+
# The {#transform!} method is used to apply a transformation to a mesh.
|
456
|
+
#
|
457
|
+
# @example
|
458
|
+
# point1 = Geom::Point3d.new(100, 200, 300)
|
459
|
+
# tr = Geom::Transformation.new(point1)
|
460
|
+
# mesh = Geom::PolygonMesh.new
|
461
|
+
# point2 = Geom::Point3d.new(0, 1, 2)
|
462
|
+
# mesh.add_point(point2)
|
463
|
+
# mesh.transform!(tr)
|
464
|
+
#
|
465
|
+
# @param [Geom::Transformation] transformation
|
466
|
+
#
|
467
|
+
# @return [Geom::PolygonMesh]
|
468
|
+
#
|
469
|
+
# @version SketchUp 6.0
|
470
|
+
def transform!(transformation)
|
471
|
+
end
|
472
|
+
|
473
|
+
# The {#uv_at} method is used to access a uv (texture coordinates) at a
|
474
|
+
# specific index.
|
475
|
+
#
|
476
|
+
# "UVs" is a way of referring to the u,v texture coordinates (as
|
477
|
+
# opposed to the X, Y, and Z axis that you construct your meshes on), which
|
478
|
+
# are points defining 1-by-1 positions within an image. These coordinates
|
479
|
+
# connect to points in your 3D model, to position an image texture onto it's
|
480
|
+
# surface (similar to virtual "thumb tacks")
|
481
|
+
#
|
482
|
+
# These coordinates pin an exact spot on an image that you wish to use to
|
483
|
+
# texture your model to a specific point on an object's surface. Between these
|
484
|
+
# points, your software will stretch the image smoothly. This is what is
|
485
|
+
# referred to as UV mapping.
|
486
|
+
#
|
487
|
+
# @example
|
488
|
+
# point = mesh.uv_at(1, true)
|
489
|
+
#
|
490
|
+
# @note Index starts at 1.
|
491
|
+
#
|
492
|
+
# @param [Integer] index
|
493
|
+
# The index for the texture coordinate.
|
494
|
+
#
|
495
|
+
# @param [Boolean] front
|
496
|
+
# Set to +true+ to get the UV for the front size,
|
497
|
+
# +false+ for the back side.
|
498
|
+
#
|
499
|
+
# @return [Geom::Point3d, nil] a Point3d object where the x equals the u
|
500
|
+
# value and the y equals the v value.
|
501
|
+
# Returns nil on failure.
|
502
|
+
#
|
503
|
+
# @version SketchUp 6.0
|
504
|
+
def uv_at(index, front)
|
505
|
+
end
|
506
|
+
|
507
|
+
# The {#uvs} method is used to retrieve an array of uv coordinates in the
|
508
|
+
# mesh.
|
509
|
+
#
|
510
|
+
# @example
|
511
|
+
# # Get a mesh with front and back UVs.
|
512
|
+
# mesh = face.mesh(1 | 2)
|
513
|
+
# uvs = mesh.uvs(true)
|
514
|
+
#
|
515
|
+
# @param [Boolean] front
|
516
|
+
#
|
517
|
+
# @return [Array<Geom::Point3d>]
|
518
|
+
#
|
519
|
+
# @version SketchUp 6.0
|
520
|
+
def uvs(front)
|
521
|
+
end
|
522
|
+
|
523
|
+
end
|