sketchup-api-stubs 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +151 -148
- data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +509 -523
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -693
- data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +747 -698
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +517 -516
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -692
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Length.rb +278 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +150 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -286
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -619
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -426
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -396
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -502
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1239 -1205
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -272
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -126
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -292
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -407
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -318
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1652 -1651
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -131
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -363
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -477
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +361 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -459
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +255 -260
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -837
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1311 -1317
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1377 -1360
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +494 -496
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +683 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -7
@@ -1,1205 +1,1239 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The {Sketchup::Entities} class is a collection of Entity objects, either in a
|
5
|
-
# {Sketchup::ComponentDefinition} or directly in the {Sketchup::Model}. A
|
6
|
-
# {Sketchup::Entities} object corresponds to a drawing context in the GUI.
|
7
|
-
#
|
8
|
-
# @version SketchUp 6.0
|
9
|
-
class Sketchup::Entities
|
10
|
-
|
11
|
-
# Includes
|
12
|
-
|
13
|
-
include Enumerable
|
14
|
-
|
15
|
-
# Instance Methods
|
16
|
-
|
17
|
-
# The {#[]} method is used to retrieve an entity by its index in an array of
|
18
|
-
# entities. The index is a number between +0+ and entities.length - 1. In
|
19
|
-
# general, it is preferable to use the {#each} method to iterate though all
|
20
|
-
# of the entities in the collection as it will be much more efficient.
|
21
|
-
#
|
22
|
-
# @example
|
23
|
-
# entities = Sketchup.active_model.entities
|
24
|
-
# entity = entities[0]
|
25
|
-
#
|
26
|
-
# @param [Integer] entity_index
|
27
|
-
# The index for a specific entity.
|
28
|
-
#
|
29
|
-
# @return [Sketchup::Entity, nil] an {Sketchup::Entity} object if successful,
|
30
|
-
# +nil+ if not found
|
31
|
-
#
|
32
|
-
# @see #at
|
33
|
-
#
|
34
|
-
# @version SketchUp 6.0
|
35
|
-
def [](entity_index)
|
36
|
-
end
|
37
|
-
|
38
|
-
# The active_section_plane method is used to access the currently active
|
39
|
-
# section plane in the Entities object.
|
40
|
-
#
|
41
|
-
# @example
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
# @
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
# entities
|
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
|
-
# @return [Boolean] true if successful
|
116
|
-
#
|
117
|
-
# @version SketchUp 6.0
|
118
|
-
def add_3d_text(string, alignment, font, is_bold = false, is_italic = false, letter_height)
|
119
|
-
end
|
120
|
-
|
121
|
-
# The add_arc method is used to create an arc curve segment.
|
122
|
-
#
|
123
|
-
# @example
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
# @param [Geom::
|
137
|
-
# @param [
|
138
|
-
# @param [
|
139
|
-
# @param [Numeric]
|
140
|
-
# @
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
# @param [Geom::
|
147
|
-
# @param [
|
148
|
-
# @param [
|
149
|
-
# @param [Numeric]
|
150
|
-
# @param [
|
151
|
-
# @
|
152
|
-
#
|
153
|
-
#
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
# # Create a circle perpendicular to the
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# @param [Geom::
|
171
|
-
# A
|
172
|
-
#
|
173
|
-
# @param [
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# @param [
|
177
|
-
# The
|
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
|
-
#
|
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
|
-
#
|
326
|
-
# @param [Array<Sketchup::InstancePath, Geom::Point3d>]
|
327
|
-
# containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
328
|
-
# @param [
|
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
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
# - entities.add_face(
|
421
|
-
# - entities.add_face(
|
422
|
-
# - entities.add_face(pt1, pt2, pt3
|
423
|
-
# - entities.add_face(
|
424
|
-
#
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
#
|
434
|
-
#
|
435
|
-
#
|
436
|
-
#
|
437
|
-
#
|
438
|
-
#
|
439
|
-
#
|
440
|
-
# face
|
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
|
-
# The
|
467
|
-
#
|
468
|
-
#
|
469
|
-
#
|
470
|
-
#
|
471
|
-
#
|
472
|
-
#
|
473
|
-
# -
|
474
|
-
# -
|
475
|
-
#
|
476
|
-
#
|
477
|
-
#
|
478
|
-
#
|
479
|
-
#
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
# pm
|
484
|
-
# pm.add_point([
|
485
|
-
# pm.add_point([
|
486
|
-
# pm.add_point([
|
487
|
-
# pm.
|
488
|
-
# pm.
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
# smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
|
497
|
-
# group.entities.add_faces_from_mesh(pm, smooth_flags,
|
498
|
-
#
|
499
|
-
# @param [Geom::PolygonMesh] polygon_mesh
|
500
|
-
#
|
501
|
-
# @param [Integer] smooth_flags
|
502
|
-
# flags for softening and smoothing of edges.
|
503
|
-
#
|
504
|
-
# @param [Sketchup::Material, String] f_material
|
505
|
-
# material to paint front faces with.
|
506
|
-
#
|
507
|
-
# @param [Sketchup::Material, String] b_material
|
508
|
-
# material to paint back faces with.
|
509
|
-
#
|
510
|
-
# @return [Integer] Number of faces created
|
511
|
-
#
|
512
|
-
# @see Sketchup::EntitiesBuilder
|
513
|
-
# EntitiesBuilder, alternative interface
|
514
|
-
# for generating bulk geometry with performance in mind.
|
515
|
-
#
|
516
|
-
# @see file:pages/generating_geometry.md
|
517
|
-
# Guide on Generating Geometry
|
518
|
-
#
|
519
|
-
# @version SketchUp 6.0
|
520
|
-
def add_faces_from_mesh(polygon_mesh, smooth_flags = Geom::PolygonMesh::AUTO_SOFTEN|Geom::PolygonMesh::SMOOTH_SOFT_EDGES, f_material = nil, b_material = nil)
|
521
|
-
end
|
522
|
-
|
523
|
-
# The add_group method is used to create an empty group or a group with
|
524
|
-
# entities.
|
525
|
-
#
|
526
|
-
# @example
|
527
|
-
# model = Sketchup.active_model
|
528
|
-
# entities = model.active_entities
|
529
|
-
# group = entities.add_group
|
530
|
-
#
|
531
|
-
# @note Calling add_group with entities in its parameters has been known to
|
532
|
-
# crash SketchUp before version 8.0. It is preferable to create an empty
|
533
|
-
# group and then add things to its Entities collection.
|
534
|
-
#
|
535
|
-
# @overload add_group(entities)
|
536
|
-
#
|
537
|
-
# @param [Array<Sketchup::Entity>] entities
|
538
|
-
# an entities collection to add to the group.
|
539
|
-
#
|
540
|
-
# @overload add_group(*entities)
|
541
|
-
#
|
542
|
-
# @param [Array<Sketchup::Entity>] entities
|
543
|
-
# an entities collection to add to the group.
|
544
|
-
#
|
545
|
-
# @return [Sketchup::Group]
|
546
|
-
#
|
547
|
-
# @version SketchUp 6.0
|
548
|
-
def add_group(*args)
|
549
|
-
end
|
550
|
-
|
551
|
-
# The add_image method is used to add an image to the collection of entities.
|
552
|
-
#
|
553
|
-
# The width and height are measured in model units (i.e. inches). If the
|
554
|
-
# height is not given, then it is computed from the width to preserve the
|
555
|
-
# aspect ratio of the image.
|
556
|
-
#
|
557
|
-
# @example
|
558
|
-
# model = Sketchup.active_model
|
559
|
-
# entities = model.active_entities
|
560
|
-
# point = Geom::Point3d.new
|
561
|
-
# image = entities.add_image
|
562
|
-
#
|
563
|
-
#
|
564
|
-
#
|
565
|
-
#
|
566
|
-
#
|
567
|
-
#
|
568
|
-
#
|
569
|
-
#
|
570
|
-
#
|
571
|
-
# @param [
|
572
|
-
#
|
573
|
-
#
|
574
|
-
#
|
575
|
-
#
|
576
|
-
#
|
577
|
-
#
|
578
|
-
#
|
579
|
-
#
|
580
|
-
#
|
581
|
-
#
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
#
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
#
|
590
|
-
#
|
591
|
-
#
|
592
|
-
#
|
593
|
-
#
|
594
|
-
#
|
595
|
-
#
|
596
|
-
#
|
597
|
-
#
|
598
|
-
#
|
599
|
-
#
|
600
|
-
#
|
601
|
-
#
|
602
|
-
#
|
603
|
-
#
|
604
|
-
#
|
605
|
-
#
|
606
|
-
#
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
#
|
611
|
-
#
|
612
|
-
#
|
613
|
-
#
|
614
|
-
#
|
615
|
-
#
|
616
|
-
#
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
#
|
621
|
-
#
|
622
|
-
#
|
623
|
-
#
|
624
|
-
#
|
625
|
-
#
|
626
|
-
#
|
627
|
-
#
|
628
|
-
# @
|
629
|
-
#
|
630
|
-
#
|
631
|
-
#
|
632
|
-
#
|
633
|
-
#
|
634
|
-
#
|
635
|
-
#
|
636
|
-
#
|
637
|
-
#
|
638
|
-
#
|
639
|
-
#
|
640
|
-
# @
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
#
|
645
|
-
#
|
646
|
-
# @
|
647
|
-
#
|
648
|
-
#
|
649
|
-
#
|
650
|
-
#
|
651
|
-
#
|
652
|
-
#
|
653
|
-
#
|
654
|
-
#
|
655
|
-
#
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
#
|
660
|
-
#
|
661
|
-
#
|
662
|
-
#
|
663
|
-
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
667
|
-
#
|
668
|
-
#
|
669
|
-
# @
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
#
|
674
|
-
#
|
675
|
-
# @
|
676
|
-
#
|
677
|
-
#
|
678
|
-
#
|
679
|
-
#
|
680
|
-
#
|
681
|
-
#
|
682
|
-
#
|
683
|
-
#
|
684
|
-
#
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
#
|
689
|
-
#
|
690
|
-
#
|
691
|
-
#
|
692
|
-
#
|
693
|
-
#
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
#
|
698
|
-
#
|
699
|
-
# @
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
#
|
704
|
-
#
|
705
|
-
#
|
706
|
-
#
|
707
|
-
#
|
708
|
-
#
|
709
|
-
#
|
710
|
-
#
|
711
|
-
#
|
712
|
-
#
|
713
|
-
#
|
714
|
-
#
|
715
|
-
#
|
716
|
-
#
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
#
|
721
|
-
#
|
722
|
-
# @
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
#
|
727
|
-
#
|
728
|
-
# @example
|
729
|
-
#
|
730
|
-
#
|
731
|
-
# entities
|
732
|
-
#
|
733
|
-
#
|
734
|
-
#
|
735
|
-
#
|
736
|
-
#
|
737
|
-
#
|
738
|
-
#
|
739
|
-
#
|
740
|
-
#
|
741
|
-
# Sketchup.active_model.entities
|
742
|
-
#
|
743
|
-
#
|
744
|
-
# instance =
|
745
|
-
#
|
746
|
-
#
|
747
|
-
#
|
748
|
-
#
|
749
|
-
#
|
750
|
-
#
|
751
|
-
#
|
752
|
-
#
|
753
|
-
#
|
754
|
-
#
|
755
|
-
#
|
756
|
-
#
|
757
|
-
# @param [
|
758
|
-
#
|
759
|
-
#
|
760
|
-
#
|
761
|
-
#
|
762
|
-
#
|
763
|
-
#
|
764
|
-
# @
|
765
|
-
# @param [
|
766
|
-
#
|
767
|
-
#
|
768
|
-
#
|
769
|
-
#
|
770
|
-
#
|
771
|
-
#
|
772
|
-
# @
|
773
|
-
# @param [
|
774
|
-
#
|
775
|
-
#
|
776
|
-
#
|
777
|
-
# {Sketchup::
|
778
|
-
#
|
779
|
-
#
|
780
|
-
#
|
781
|
-
#
|
782
|
-
#
|
783
|
-
#
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
#
|
789
|
-
#
|
790
|
-
#
|
791
|
-
#
|
792
|
-
#
|
793
|
-
#
|
794
|
-
#
|
795
|
-
#
|
796
|
-
#
|
797
|
-
#
|
798
|
-
#
|
799
|
-
#
|
800
|
-
#
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
#
|
806
|
-
#
|
807
|
-
#
|
808
|
-
#
|
809
|
-
#
|
810
|
-
#
|
811
|
-
#
|
812
|
-
#
|
813
|
-
# {Sketchup::Model#
|
814
|
-
#
|
815
|
-
#
|
816
|
-
#
|
817
|
-
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
# model
|
821
|
-
#
|
822
|
-
# edge =
|
823
|
-
#
|
824
|
-
# face =
|
825
|
-
#
|
826
|
-
#
|
827
|
-
#
|
828
|
-
#
|
829
|
-
#
|
830
|
-
#
|
831
|
-
#
|
832
|
-
#
|
833
|
-
#
|
834
|
-
#
|
835
|
-
#
|
836
|
-
#
|
837
|
-
#
|
838
|
-
#
|
839
|
-
#
|
840
|
-
#
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
#
|
846
|
-
#
|
847
|
-
#
|
848
|
-
#
|
849
|
-
#
|
850
|
-
#
|
851
|
-
#
|
852
|
-
#
|
853
|
-
#
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
#
|
858
|
-
#
|
859
|
-
#
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
#
|
864
|
-
#
|
865
|
-
#
|
866
|
-
#
|
867
|
-
#
|
868
|
-
#
|
869
|
-
#
|
870
|
-
# @
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
#
|
875
|
-
#
|
876
|
-
#
|
877
|
-
#
|
878
|
-
#
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
#
|
883
|
-
# of
|
884
|
-
#
|
885
|
-
#
|
886
|
-
#
|
887
|
-
#
|
888
|
-
#
|
889
|
-
#
|
890
|
-
#
|
891
|
-
#
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
#
|
896
|
-
#
|
897
|
-
#
|
898
|
-
# @
|
899
|
-
#
|
900
|
-
#
|
901
|
-
#
|
902
|
-
#
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
#
|
911
|
-
#
|
912
|
-
#
|
913
|
-
# entities
|
914
|
-
#
|
915
|
-
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
#
|
919
|
-
#
|
920
|
-
#
|
921
|
-
#
|
922
|
-
#
|
923
|
-
#
|
924
|
-
#
|
925
|
-
#
|
926
|
-
#
|
927
|
-
#
|
928
|
-
#
|
929
|
-
# @
|
930
|
-
#
|
931
|
-
#
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
#
|
936
|
-
#
|
937
|
-
#
|
938
|
-
#
|
939
|
-
#
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
#
|
944
|
-
#
|
945
|
-
#
|
946
|
-
# {
|
947
|
-
#
|
948
|
-
#
|
949
|
-
#
|
950
|
-
#
|
951
|
-
#
|
952
|
-
#
|
953
|
-
#
|
954
|
-
#
|
955
|
-
#
|
956
|
-
#
|
957
|
-
#
|
958
|
-
#
|
959
|
-
#
|
960
|
-
#
|
961
|
-
#
|
962
|
-
#
|
963
|
-
# pm
|
964
|
-
#
|
965
|
-
#
|
966
|
-
#
|
967
|
-
#
|
968
|
-
#
|
969
|
-
#
|
970
|
-
#
|
971
|
-
#
|
972
|
-
#
|
973
|
-
#
|
974
|
-
#
|
975
|
-
#
|
976
|
-
#
|
977
|
-
#
|
978
|
-
#
|
979
|
-
# @param [
|
980
|
-
#
|
981
|
-
#
|
982
|
-
#
|
983
|
-
#
|
984
|
-
#
|
985
|
-
#
|
986
|
-
#
|
987
|
-
#
|
988
|
-
#
|
989
|
-
#
|
990
|
-
#
|
991
|
-
#
|
992
|
-
#
|
993
|
-
#
|
994
|
-
#
|
995
|
-
#
|
996
|
-
#
|
997
|
-
# @
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
#
|
1002
|
-
#
|
1003
|
-
#
|
1004
|
-
# @
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
#
|
1009
|
-
#
|
1010
|
-
#
|
1011
|
-
#
|
1012
|
-
#
|
1013
|
-
#
|
1014
|
-
#
|
1015
|
-
#
|
1016
|
-
#
|
1017
|
-
#
|
1018
|
-
#
|
1019
|
-
#
|
1020
|
-
#
|
1021
|
-
#
|
1022
|
-
#
|
1023
|
-
#
|
1024
|
-
#
|
1025
|
-
#
|
1026
|
-
#
|
1027
|
-
#
|
1028
|
-
#
|
1029
|
-
#
|
1030
|
-
#
|
1031
|
-
#
|
1032
|
-
#
|
1033
|
-
#
|
1034
|
-
# @param [Sketchup::
|
1035
|
-
#
|
1036
|
-
#
|
1037
|
-
#
|
1038
|
-
#
|
1039
|
-
#
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
#
|
1044
|
-
#
|
1045
|
-
#
|
1046
|
-
#
|
1047
|
-
#
|
1048
|
-
#
|
1049
|
-
#
|
1050
|
-
#
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
#
|
1055
|
-
#
|
1056
|
-
#
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
#
|
1061
|
-
#
|
1062
|
-
#
|
1063
|
-
#
|
1064
|
-
#
|
1065
|
-
#
|
1066
|
-
#
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
#
|
1071
|
-
#
|
1072
|
-
#
|
1073
|
-
#
|
1074
|
-
#
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
#
|
1079
|
-
#
|
1080
|
-
#
|
1081
|
-
#
|
1082
|
-
#
|
1083
|
-
#
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
#
|
1088
|
-
#
|
1089
|
-
#
|
1090
|
-
#
|
1091
|
-
#
|
1092
|
-
#
|
1093
|
-
#
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
#
|
1098
|
-
# object
|
1099
|
-
#
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
#
|
1106
|
-
#
|
1107
|
-
#
|
1108
|
-
#
|
1109
|
-
#
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
#
|
1116
|
-
#
|
1117
|
-
#
|
1118
|
-
# entities
|
1119
|
-
#
|
1120
|
-
#
|
1121
|
-
#
|
1122
|
-
#
|
1123
|
-
#
|
1124
|
-
#
|
1125
|
-
#
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
#
|
1130
|
-
#
|
1131
|
-
#
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
#
|
1136
|
-
#
|
1137
|
-
#
|
1138
|
-
#
|
1139
|
-
#
|
1140
|
-
#
|
1141
|
-
#
|
1142
|
-
#
|
1143
|
-
#
|
1144
|
-
#
|
1145
|
-
#
|
1146
|
-
# @
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
#
|
1151
|
-
#
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
#
|
1156
|
-
#
|
1157
|
-
#
|
1158
|
-
#
|
1159
|
-
#
|
1160
|
-
#
|
1161
|
-
#
|
1162
|
-
#
|
1163
|
-
#
|
1164
|
-
#
|
1165
|
-
#
|
1166
|
-
#
|
1167
|
-
#
|
1168
|
-
#
|
1169
|
-
#
|
1170
|
-
#
|
1171
|
-
#
|
1172
|
-
#
|
1173
|
-
#
|
1174
|
-
#
|
1175
|
-
#
|
1176
|
-
#
|
1177
|
-
#
|
1178
|
-
#
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
#
|
1184
|
-
#
|
1185
|
-
#
|
1186
|
-
#
|
1187
|
-
#
|
1188
|
-
#
|
1189
|
-
#
|
1190
|
-
#
|
1191
|
-
#
|
1192
|
-
#
|
1193
|
-
#
|
1194
|
-
#
|
1195
|
-
#
|
1196
|
-
#
|
1197
|
-
#
|
1198
|
-
#
|
1199
|
-
#
|
1200
|
-
#
|
1201
|
-
# @
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1
|
+
# Copyright:: Copyright 2023 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::Entities} class is a collection of Entity objects, either in a
|
5
|
+
# {Sketchup::ComponentDefinition} or directly in the {Sketchup::Model}. A
|
6
|
+
# {Sketchup::Entities} object corresponds to a drawing context in the GUI.
|
7
|
+
#
|
8
|
+
# @version SketchUp 6.0
|
9
|
+
class Sketchup::Entities
|
10
|
+
|
11
|
+
# Includes
|
12
|
+
|
13
|
+
include Enumerable
|
14
|
+
|
15
|
+
# Instance Methods
|
16
|
+
|
17
|
+
# The {#[]} method is used to retrieve an entity by its index in an array of
|
18
|
+
# entities. The index is a number between +0+ and entities.length - 1. In
|
19
|
+
# general, it is preferable to use the {#each} method to iterate though all
|
20
|
+
# of the entities in the collection as it will be much more efficient.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# entities = Sketchup.active_model.entities
|
24
|
+
# entity = entities[0]
|
25
|
+
#
|
26
|
+
# @param [Integer] entity_index
|
27
|
+
# The index for a specific entity.
|
28
|
+
#
|
29
|
+
# @return [Sketchup::Entity, nil] an {Sketchup::Entity} object if successful,
|
30
|
+
# +nil+ if not found
|
31
|
+
#
|
32
|
+
# @see #at
|
33
|
+
#
|
34
|
+
# @version SketchUp 6.0
|
35
|
+
def [](entity_index)
|
36
|
+
end
|
37
|
+
|
38
|
+
# The active_section_plane method is used to access the currently active
|
39
|
+
# section plane in the Entities object.
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# entities = Sketchup.active_model.entities
|
43
|
+
# section_plane = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
44
|
+
# entities.active_section_plane = section_plane
|
45
|
+
# section_plane = entities.active_section_plane
|
46
|
+
#
|
47
|
+
# @return [Sketchup::SectionPlane, nil] the active SectionPlane or nil if none is active.
|
48
|
+
#
|
49
|
+
# @version SketchUp 2014
|
50
|
+
def active_section_plane
|
51
|
+
end
|
52
|
+
|
53
|
+
# The active_section_plane= method is used to set the active section plane in
|
54
|
+
# the Entities object.
|
55
|
+
#
|
56
|
+
# @example
|
57
|
+
# entities = Sketchup.active_model.entities
|
58
|
+
# section_plane = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
59
|
+
# entities.active_section_plane = section_plane
|
60
|
+
#
|
61
|
+
# @param [Sketchup::SectionPlane, nil] sec_plane
|
62
|
+
# the SectionPlane object to be set active. Pass nil to
|
63
|
+
# deactivate any active section plane.
|
64
|
+
#
|
65
|
+
# @return [Sketchup::SectionPlane, nil] the SectionPlane object that was set active.
|
66
|
+
#
|
67
|
+
# @version SketchUp 2014
|
68
|
+
def active_section_plane=(sec_plane)
|
69
|
+
end
|
70
|
+
|
71
|
+
# The {#add_3d_text} method is used to create 3D text. It will be added as edges and
|
72
|
+
# faces drawn at the origin.
|
73
|
+
#
|
74
|
+
# @example
|
75
|
+
# # Draw the word "test" at the origin of the model, aligned left, in
|
76
|
+
# # Arial Bold, not italics, 1" in size, best tolerance quality, filled,
|
77
|
+
# # with an extrusion size of 5".
|
78
|
+
# entities = Sketchup.active_model.entities
|
79
|
+
# success = entities.add_3d_text('test', TextAlignLeft, "Arial",
|
80
|
+
# true, false, 1.inch, 0.0, 0.5.inch, true, 5.0.inch)
|
81
|
+
#
|
82
|
+
# @param [String] string
|
83
|
+
# The text to create.
|
84
|
+
#
|
85
|
+
# @param [Integer] alignment
|
86
|
+
# Number that defines the alignment. There are constants
|
87
|
+
# called TextAlignLeft, TextAlignRight, and
|
88
|
+
# TextAlignCenter that can be passed.
|
89
|
+
#
|
90
|
+
# @param [String] font
|
91
|
+
# font name.
|
92
|
+
#
|
93
|
+
# @param [Boolean] is_bold
|
94
|
+
# true for bold.
|
95
|
+
#
|
96
|
+
# @param [Boolean] is_italic
|
97
|
+
# true for italic.
|
98
|
+
#
|
99
|
+
# @param [Length] letter_height
|
100
|
+
# Height of the text
|
101
|
+
#
|
102
|
+
# @param [Numeric] tolerance
|
103
|
+
# Tolerance of the curve creation. Defaults to
|
104
|
+
# 0.0, which creates the highest possible curve quality.
|
105
|
+
#
|
106
|
+
# @param [Length] z
|
107
|
+
# z position of the text
|
108
|
+
#
|
109
|
+
# @param [Boolean] is_filled
|
110
|
+
# true for filled, which will put a face between the edges of the letters.
|
111
|
+
#
|
112
|
+
# @param [Length] extrusion
|
113
|
+
# Extrusion depth
|
114
|
+
#
|
115
|
+
# @return [Boolean] true if successful
|
116
|
+
#
|
117
|
+
# @version SketchUp 6.0
|
118
|
+
def add_3d_text(string, alignment, font, is_bold = false, is_italic = false, letter_height = 1.0, tolerance = 0.0, z = 0.0, is_filled = true, extrusion = 0.0)
|
119
|
+
end
|
120
|
+
|
121
|
+
# The add_arc method is used to create an arc curve segment.
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# model = Sketchup.active_model
|
125
|
+
# entities = model.active_entities
|
126
|
+
# center_point = Geom::Point3d.new
|
127
|
+
# # Create an arc perpendicular to the normal or Z axis
|
128
|
+
# normal = Geom::Vector3d.new(0, 0, 1)
|
129
|
+
# xaxis = Geom::Vector3d.new(1, 0, 0)
|
130
|
+
# edges = entities.add_arc(center_point, xaxis, normal, 10, 15.degrees, 135.degrees)
|
131
|
+
#
|
132
|
+
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle)
|
133
|
+
#
|
134
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
135
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
136
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
137
|
+
# @param [Numeric] radius The radius of the arc.
|
138
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
139
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
140
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
141
|
+
#
|
142
|
+
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle, num_segments)
|
143
|
+
#
|
144
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
145
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
146
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
147
|
+
# @param [Numeric] radius The radius of the arc.
|
148
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
149
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
150
|
+
# @param [Integer] num_segments How many segments to draw.
|
151
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
152
|
+
#
|
153
|
+
# @version SketchUp 6.0
|
154
|
+
def add_arc(*args)
|
155
|
+
end
|
156
|
+
|
157
|
+
# The add_circle method is used to create a circle.
|
158
|
+
#
|
159
|
+
# @example
|
160
|
+
# model = Sketchup.active_model
|
161
|
+
# entities = model.active_entities
|
162
|
+
# center_point = Geom::Point3d.new
|
163
|
+
# # Create a circle perpendicular to the provided vector.
|
164
|
+
# normal = Z_AXIS
|
165
|
+
# edges = entities.add_circle(center_point, vector, 10)
|
166
|
+
#
|
167
|
+
# @param [Geom::Point3d] center
|
168
|
+
# A Point3d object representing the center.
|
169
|
+
#
|
170
|
+
# @param [Geom::Vector3d] normal
|
171
|
+
# A Vector3d object representing normal for the arc.
|
172
|
+
#
|
173
|
+
# @param [Numeric] radius
|
174
|
+
# The radius of the arc.
|
175
|
+
#
|
176
|
+
# @param [Integer] numsegs
|
177
|
+
# The number of segments.
|
178
|
+
#
|
179
|
+
# @return [Array<Sketchup::Edge>] an Array object containing edges if successful
|
180
|
+
#
|
181
|
+
# @version SketchUp 6.0
|
182
|
+
def add_circle(center, normal, radius, numsegs = 24)
|
183
|
+
end
|
184
|
+
|
185
|
+
# The {#add_cline} method is used to create a construction line. This can be
|
186
|
+
# finite or infinite.
|
187
|
+
#
|
188
|
+
# @example
|
189
|
+
# model = Sketchup.active_model
|
190
|
+
# entities = model.active_entities
|
191
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
192
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
193
|
+
# cline = entities.add_cline(point1, point2)
|
194
|
+
#
|
195
|
+
# @overload add_cline(start_point, end_point, stipple = '-')
|
196
|
+
#
|
197
|
+
# Creates a finite construction line.
|
198
|
+
# @param [Geom::Point3d] start_point
|
199
|
+
# @param [Geom::Point3d] end_point
|
200
|
+
# @param [String] stipple See {ConstructionLine#stipple=} for acceptable
|
201
|
+
# patterns.
|
202
|
+
#
|
203
|
+
# @overload add_cline(point, vector, stipple = '-')
|
204
|
+
#
|
205
|
+
# Creates an infinite construction line.
|
206
|
+
# @param [Geom::Point3d] point
|
207
|
+
# @param [Geom::Point3d] vector
|
208
|
+
# @param [String] stipple See {ConstructionLine#stipple=} for acceptable
|
209
|
+
# patterns.
|
210
|
+
#
|
211
|
+
# @return [Sketchup::ConstructionLine]
|
212
|
+
#
|
213
|
+
# @version SketchUp 6.0
|
214
|
+
def add_cline(*args)
|
215
|
+
end
|
216
|
+
|
217
|
+
# The add_cpoint method is used to create a construction point.
|
218
|
+
#
|
219
|
+
# @example
|
220
|
+
# entities = Sketchup.active_model.active_entities
|
221
|
+
# point1 = Geom::Point3d.new(100, 200, 300)
|
222
|
+
# constpoint = entities.add_cpoint(point1)
|
223
|
+
#
|
224
|
+
# @param [Geom::Point3d] point
|
225
|
+
# A Point3d object.
|
226
|
+
#
|
227
|
+
# @return [Sketchup::ConstructionPoint] a ConstructionPoint object if
|
228
|
+
# successful
|
229
|
+
#
|
230
|
+
# @version SketchUp 6.0
|
231
|
+
def add_cpoint(point)
|
232
|
+
end
|
233
|
+
|
234
|
+
# The add_curve method is used to create a curve from a collection of edges.
|
235
|
+
#
|
236
|
+
# The arguments are either Points or an Array of Points. At least 2 points are
|
237
|
+
# required.
|
238
|
+
#
|
239
|
+
# @example
|
240
|
+
# entities = Sketchup.active_model.entities
|
241
|
+
# curve = entities.add_curve([0, 0, 0], [0, 10, 0], [10, 20, 0])
|
242
|
+
#
|
243
|
+
# @overload add_curve(points)
|
244
|
+
#
|
245
|
+
# @param [Array<Geom::Point3d>] points
|
246
|
+
#
|
247
|
+
# @overload add_curve(*points)
|
248
|
+
#
|
249
|
+
# @param [Array<Geom::Point3d>] points
|
250
|
+
#
|
251
|
+
# @return [Array<Sketchup::Edge>]
|
252
|
+
#
|
253
|
+
# @version SketchUp 6.0
|
254
|
+
def add_curve(*args)
|
255
|
+
end
|
256
|
+
|
257
|
+
# The {#add_dimension_linear} method adds a linear dimension to the entities.
|
258
|
+
#
|
259
|
+
# @example
|
260
|
+
# entities = Sketchup.active_model.entities
|
261
|
+
# # From point to point
|
262
|
+
# dim = entities.add_dimension_linear([0, 0, 0], [50, 0, 0], [0, 20, 0])
|
263
|
+
#
|
264
|
+
# # Between edge vertices
|
265
|
+
# edge1 = entities.add_edges([70, 0, 0], [120, 0, 0])[0]
|
266
|
+
# v0 = edge1.start
|
267
|
+
# v1 = edge1.end
|
268
|
+
# dim = entities.add_dimension_linear(v0, v1, [0, 20, 0])
|
269
|
+
#
|
270
|
+
# # From an edge's midpoint to a construction point
|
271
|
+
# edge2 = entities.add_edges([150, 0, 0], [200, 0, 0])[0]
|
272
|
+
# p0 = edge2.start.position
|
273
|
+
# p1 = edge2.end.position
|
274
|
+
# mp = Geom::Point3d.new((p0.x + p1.x) / 2.0, (p0.y + p1.y) / 2.0, (p0.z + p1.z) / 2.0)
|
275
|
+
# cp = entities.add_cpoint([150, 40, 0])
|
276
|
+
# dim = entities.add_dimension_linear([edge2, mp], cp, [20, 0, 0])
|
277
|
+
#
|
278
|
+
# @example Instance path
|
279
|
+
# entities = Sketchup.active_model.entities
|
280
|
+
# group = entities.add_group
|
281
|
+
# group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
282
|
+
# instance = group.to_component
|
283
|
+
# transformation = instance.transformation
|
284
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
285
|
+
# instance_path = Sketchup::InstancePath.new([instance, edge])
|
286
|
+
# start_point = edge.start.position.transform(transformation)
|
287
|
+
# end_point = edge.end.position.transform(transformation)
|
288
|
+
# vector = Geom::Vector3d.new(0, 30, 0)
|
289
|
+
# Sketchup.active_model.entities.add_dimension_linear(
|
290
|
+
# [instance_path, start_point], [instance_path, end_point], vector)
|
291
|
+
#
|
292
|
+
# @example Instance path as an array
|
293
|
+
# entities = Sketchup.active_model.entities
|
294
|
+
# group = entities.add_group
|
295
|
+
# group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
296
|
+
# instance = group.to_component
|
297
|
+
# transformation = instance.transformation
|
298
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
299
|
+
# path = [instance, edge]
|
300
|
+
# start_point = edge.start.position.transform(transformation)
|
301
|
+
# end_point = edge.end.position.transform(transformation)
|
302
|
+
# vector = Geom::Vector3d.new(0, 30, 0)
|
303
|
+
# Sketchup.active_model.entities.add_dimension_linear(
|
304
|
+
# [path, start_point], [path, end_point], vector)
|
305
|
+
#
|
306
|
+
# @overload add_dimension_linear(start_pt_or_entity, end_pt_or_entity, offset_vector)
|
307
|
+
#
|
308
|
+
# @param [Geom::Point3d, Sketchup::Entity] start_pt_or_entity
|
309
|
+
# the reference point and/or entity at the start of
|
310
|
+
# the dimension. This parameter can take several
|
311
|
+
# forms:
|
312
|
+
# @param [Geom::Point3d, Sketchup::Entity] end_pt_or_entity
|
313
|
+
# the reference point and/or entity at the end
|
314
|
+
# of the dimension. This parameter takes the exact
|
315
|
+
# same forms as 'start_pt_or_entity'.
|
316
|
+
# @param [Geom::Vector3d] offset_vector
|
317
|
+
# the parallel offset vector from the reference line
|
318
|
+
# to the dimension line measured from the 'start'
|
319
|
+
# reference point.
|
320
|
+
#
|
321
|
+
# @overload add_dimension_linear(start_instance_path, end_instance_path, offset_vector)
|
322
|
+
#
|
323
|
+
# @note Added in SketchUp 2019.
|
324
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] start_instance_path An array
|
325
|
+
# containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
326
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] end_instance_path An array
|
327
|
+
# containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
328
|
+
# @param [Geom::Vector3d] offset_vector The parallel offset vector from the
|
329
|
+
# reference line to the dimension line measured from the start reference
|
330
|
+
# point.
|
331
|
+
#
|
332
|
+
# @overload add_dimension_linear(start_array, end_array, offset_vector)
|
333
|
+
#
|
334
|
+
# @note Added in SketchUp 2019.
|
335
|
+
# @param [Array(Array<Sketchup::Entity>, Geom::Point3d)] start_array
|
336
|
+
# The {Array<Sketchup::Entity>} must contain one or more {Sketchup::ComponentInstance}'s
|
337
|
+
# and a leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
338
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
339
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the leaf entity.
|
340
|
+
# @param [Array(Array<Sketchup::Entity>, Geom::Point3d)] end_array
|
341
|
+
# The {Array<Sketchup::Entity>} must contain one or more {Sketchup::ComponentInstance}'s
|
342
|
+
# and a leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
343
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
344
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the leaf entity.
|
345
|
+
# @param [Geom::Vector3d] offset_vector The parallel offset vector from the
|
346
|
+
# reference line to the dimension line measured form the start reference
|
347
|
+
# point.
|
348
|
+
#
|
349
|
+
# @return [Sketchup::DimensionLinear] the created dimension
|
350
|
+
#
|
351
|
+
# @version SketchUp 2014
|
352
|
+
def add_dimension_linear(*args)
|
353
|
+
end
|
354
|
+
|
355
|
+
# The add_dimension_radial method adds a radial dimension (i.e arc/circle
|
356
|
+
# radius/diameter dimension) to the entities.
|
357
|
+
#
|
358
|
+
# @example
|
359
|
+
# entities = Sketchup.active_model.entities
|
360
|
+
# # Create a circle
|
361
|
+
# center_point = Geom::Point3d.new(10, 10, 0)
|
362
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
363
|
+
# edges = entities.add_circle(center_point, vector, 10)
|
364
|
+
# circle = edges[0].curve
|
365
|
+
# dim = entities.add_dimension_radial(circle, [30, 30, 0])
|
366
|
+
#
|
367
|
+
# @param [Sketchup::ArcCurve] arc_curve
|
368
|
+
# an ArcCurve object to which the dimension is to be
|
369
|
+
# attached.
|
370
|
+
#
|
371
|
+
# @param [Geom::Point3d] leader_break_pt
|
372
|
+
# a Point3d for the break point on the leader where the
|
373
|
+
# dimension text is attached.
|
374
|
+
#
|
375
|
+
# @return [Sketchup::DimensionRadial] the created dimension
|
376
|
+
#
|
377
|
+
# @version SketchUp 2014
|
378
|
+
def add_dimension_radial(arc_curve, leader_break_pt)
|
379
|
+
end
|
380
|
+
|
381
|
+
# The {#add_edges} method is used to add a set of connected edges to the
|
382
|
+
# {Sketchup::Entities} collection.
|
383
|
+
#
|
384
|
+
# @example
|
385
|
+
# model = Sketchup.active_model
|
386
|
+
# entities = model.active_entities
|
387
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
388
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
389
|
+
# point3 = Geom::Point3d.new(20, 40, 20)
|
390
|
+
# edges = entities.add_edges(point1, point2, point3)
|
391
|
+
#
|
392
|
+
# @note If the points form a closed loop, the first and last vertex will not
|
393
|
+
# merge. If you intend to create a face from the edges, use {#add_face}
|
394
|
+
# directly.
|
395
|
+
#
|
396
|
+
# @overload add_edges(points)
|
397
|
+
#
|
398
|
+
# @param [Array<Geom::Point3d>] points At least two points required.
|
399
|
+
# @return [Array<Sketchup::Edge>]
|
400
|
+
#
|
401
|
+
# @overload add_edges(*points)
|
402
|
+
#
|
403
|
+
# @param [Array<Geom::Point3d>] points At least two points required.
|
404
|
+
# @return [Array<Sketchup::Edge>]
|
405
|
+
#
|
406
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects if successful
|
407
|
+
#
|
408
|
+
# @see Sketchup::EntitiesBuilder#add_edges
|
409
|
+
# EntitiesBuilder#add_edges, alternative
|
410
|
+
# for generating bulk geometry with performance in mind.
|
411
|
+
#
|
412
|
+
# @version SketchUp 6.0
|
413
|
+
def add_edges(*args)
|
414
|
+
end
|
415
|
+
|
416
|
+
# The add_face method is used to create a face. You can call this method a
|
417
|
+
# number of ways:
|
418
|
+
#
|
419
|
+
# - entities.add_face(edge1, edge2, edge3, ...)
|
420
|
+
# - entities.add_face(edgearray)
|
421
|
+
# - entities.add_face(pt1, pt2, pt3, ...)
|
422
|
+
# - entities.add_face([pt1, pt2, pt3,...])
|
423
|
+
# - entities.add_face(curve)
|
424
|
+
#
|
425
|
+
# For the last form that takes a Curve, the curve must be closed - like a
|
426
|
+
# circle.
|
427
|
+
#
|
428
|
+
# @example
|
429
|
+
# model = Sketchup.active_model
|
430
|
+
# entities = model.active_entities
|
431
|
+
# points = []
|
432
|
+
# points << [0, 0, 0]
|
433
|
+
# points << [100, 0, 0]
|
434
|
+
# points << [100, 100, 0]
|
435
|
+
# points << [0, 100, 0]
|
436
|
+
# # Add the face to the entities in the model
|
437
|
+
# face = entities.add_face(points)
|
438
|
+
#
|
439
|
+
# @note A special case exists for any face created on the ground plane, in
|
440
|
+
# which case the vertex order is ignored and the face is always facing down.
|
441
|
+
#
|
442
|
+
# @overload add_face(entities)
|
443
|
+
#
|
444
|
+
# @param [Array<Sketchup::Edge>, Array<Geom::Point3d>, Sketchup::Curve] entities
|
445
|
+
#
|
446
|
+
# @overload add_face(*entities)
|
447
|
+
#
|
448
|
+
# @param [Array<Sketchup::Edge>, Array<Geom::Point3d>] entities
|
449
|
+
#
|
450
|
+
# @return [Sketchup::Face, nil]
|
451
|
+
#
|
452
|
+
# @see Sketchup::EntitiesBuilder#add_face
|
453
|
+
# EntitiesBuilder#add_face, alternative
|
454
|
+
# for generating bulk geometry with performance in mind.
|
455
|
+
#
|
456
|
+
# @see file:pages/generating_geometry.md
|
457
|
+
# Guide on Generating Geometry
|
458
|
+
#
|
459
|
+
# @version SketchUp 6.0
|
460
|
+
def add_face(*args)
|
461
|
+
end
|
462
|
+
|
463
|
+
# The {#add_faces_from_mesh} method is used to add {Sketchup::Face} entities to the
|
464
|
+
# collection of entities from a {Geom::PolygonMesh}.
|
465
|
+
#
|
466
|
+
# The +smooth_flags+ parameter can contain any of the following values if
|
467
|
+
# passed. The constants were added in SketchUp 2014. For previous versions,
|
468
|
+
# numeric values have to be specified instead of the Ruby constants.
|
469
|
+
#
|
470
|
+
# - 0: {Geom::PolygonMesh::NO_SMOOTH_OR_HIDE}
|
471
|
+
# - 1: {Geom::PolygonMesh::HIDE_BASED_ON_INDEX} (Negative point index will hide the edge.)
|
472
|
+
# - 2: {Geom::PolygonMesh::SOFTEN_BASED_ON_INDEX} (Negative point index will soften the edge.)
|
473
|
+
# - 4: {Geom::PolygonMesh::AUTO_SOFTEN} (Interior edges are softened.)
|
474
|
+
# - 8: {Geom::PolygonMesh::SMOOTH_SOFT_EDGES} (All soft edges will also be smooth.)
|
475
|
+
#
|
476
|
+
# The 3rd and 4th parameters will accept a {Sketchup::Material} object or a
|
477
|
+
# string name of a material currently in the model.
|
478
|
+
#
|
479
|
+
# @example
|
480
|
+
# pm = Geom::PolygonMesh.new
|
481
|
+
# pm.add_point([ 0, 0, 0]) # 1
|
482
|
+
# pm.add_point([10, 0, 0]) # 2
|
483
|
+
# pm.add_point([10, 10, 0]) # 3
|
484
|
+
# pm.add_point([0, 10, 0]) # 4
|
485
|
+
# pm.add_point([20, 0, 5]) # 5
|
486
|
+
# pm.add_point([20, 10, 5]) # 6
|
487
|
+
# pm.add_polygon(1, -2, 3, 4)
|
488
|
+
# pm.add_polygon(2, 5, 6, -3)
|
489
|
+
#
|
490
|
+
# # Create a new group that we will populate with the mesh.
|
491
|
+
# group = Sketchup.active_model.entities.add_group
|
492
|
+
# material1 = Sketchup.active_model.materials.add('My Green Material')
|
493
|
+
# material1.color = 'green'
|
494
|
+
# material2 = Sketchup.active_model.materials.add('My Red Material')
|
495
|
+
# material2.color = 'red'
|
496
|
+
# smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
|
497
|
+
# group.entities.add_faces_from_mesh(pm, smooth_flags, material1, material2)
|
498
|
+
#
|
499
|
+
# @param [Geom::PolygonMesh] polygon_mesh
|
500
|
+
#
|
501
|
+
# @param [Integer] smooth_flags
|
502
|
+
# flags for softening and smoothing of edges.
|
503
|
+
#
|
504
|
+
# @param [Sketchup::Material, String] f_material
|
505
|
+
# material to paint front faces with.
|
506
|
+
#
|
507
|
+
# @param [Sketchup::Material, String] b_material
|
508
|
+
# material to paint back faces with.
|
509
|
+
#
|
510
|
+
# @return [Integer] Number of faces created
|
511
|
+
#
|
512
|
+
# @see Sketchup::EntitiesBuilder
|
513
|
+
# EntitiesBuilder, alternative interface
|
514
|
+
# for generating bulk geometry with performance in mind.
|
515
|
+
#
|
516
|
+
# @see file:pages/generating_geometry.md
|
517
|
+
# Guide on Generating Geometry
|
518
|
+
#
|
519
|
+
# @version SketchUp 6.0
|
520
|
+
def add_faces_from_mesh(polygon_mesh, smooth_flags = Geom::PolygonMesh::AUTO_SOFTEN|Geom::PolygonMesh::SMOOTH_SOFT_EDGES, f_material = nil, b_material = nil)
|
521
|
+
end
|
522
|
+
|
523
|
+
# The add_group method is used to create an empty group or a group with
|
524
|
+
# entities.
|
525
|
+
#
|
526
|
+
# @example
|
527
|
+
# model = Sketchup.active_model
|
528
|
+
# entities = model.active_entities
|
529
|
+
# group = entities.add_group
|
530
|
+
#
|
531
|
+
# @note Calling add_group with entities in its parameters has been known to
|
532
|
+
# crash SketchUp before version 8.0. It is preferable to create an empty
|
533
|
+
# group and then add things to its Entities collection.
|
534
|
+
#
|
535
|
+
# @overload add_group(entities)
|
536
|
+
#
|
537
|
+
# @param [Array<Sketchup::Entity>] entities
|
538
|
+
# an entities collection to add to the group.
|
539
|
+
#
|
540
|
+
# @overload add_group(*entities)
|
541
|
+
#
|
542
|
+
# @param [Array<Sketchup::Entity>] entities
|
543
|
+
# an entities collection to add to the group.
|
544
|
+
#
|
545
|
+
# @return [Sketchup::Group]
|
546
|
+
#
|
547
|
+
# @version SketchUp 6.0
|
548
|
+
def add_group(*args)
|
549
|
+
end
|
550
|
+
|
551
|
+
# The add_image method is used to add an image to the collection of entities.
|
552
|
+
#
|
553
|
+
# The width and height are measured in model units (i.e. inches). If the
|
554
|
+
# height is not given, then it is computed from the width to preserve the
|
555
|
+
# aspect ratio of the image.
|
556
|
+
#
|
557
|
+
# @example
|
558
|
+
# model = Sketchup.active_model
|
559
|
+
# entities = model.active_entities
|
560
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
561
|
+
# image = entities.add_image(Sketchup.find_support_file('ColorWheel.png',
|
562
|
+
# 'Resources/../..'), point, 300)
|
563
|
+
#
|
564
|
+
# @param [String] path
|
565
|
+
# A path for the image file.
|
566
|
+
#
|
567
|
+
# @param [Geom::Point3d] point
|
568
|
+
# A Point3d object representing the insertion point of
|
569
|
+
# the image.
|
570
|
+
#
|
571
|
+
# @param [Numeric] width
|
572
|
+
# Width for the image.
|
573
|
+
#
|
574
|
+
# @param [Numeric] height
|
575
|
+
# height for the image if you want to control
|
576
|
+
# width and height independently. Leave as default +0.0+ when you want it
|
577
|
+
# to be relative to the aspect ratio.
|
578
|
+
#
|
579
|
+
# @return [Sketchup::Image, nil] an Image object if successful.
|
580
|
+
#
|
581
|
+
# @version SketchUp 6.0
|
582
|
+
def add_image(path, point, width, height = 0.0)
|
583
|
+
end
|
584
|
+
|
585
|
+
# The add_instance method adds a component instance to the collection of
|
586
|
+
# entities.
|
587
|
+
#
|
588
|
+
# @example
|
589
|
+
# model = Sketchup.active_model
|
590
|
+
# entities = model.active_entities
|
591
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
592
|
+
# transform = Geom::Transformation.new(point)
|
593
|
+
# path = Sketchup.find_support_file("Bed.skp", "Components/Components Sampler/")
|
594
|
+
# definitions = model.definitions
|
595
|
+
# componentdefinition = definitions.load(path)
|
596
|
+
# instance = entities.add_instance(componentdefinition, transform)
|
597
|
+
#
|
598
|
+
# @param [Sketchup::ComponentDefinition] definition
|
599
|
+
# A ComponentDefinition object.
|
600
|
+
#
|
601
|
+
# @param [Geom::Transformation] transform
|
602
|
+
# A Transformation object.
|
603
|
+
#
|
604
|
+
# @return [Sketchup::ComponentInstance] a ComponentInstance object if successful
|
605
|
+
#
|
606
|
+
# @version SketchUp 6.0
|
607
|
+
def add_instance(definition, transform)
|
608
|
+
end
|
609
|
+
|
610
|
+
# The add_line method is used to add an edge to the collection of entities.
|
611
|
+
# This is not to be confused with the concept of a "line" from a geometric
|
612
|
+
# sense, which is an invisible object represented by an Array of a point
|
613
|
+
# and a vector. (See the Array class for more information on geometric lines in
|
614
|
+
# SketchUp.)
|
615
|
+
#
|
616
|
+
# This method is the same as add_edges method, but returns a single edge.
|
617
|
+
#
|
618
|
+
# @example
|
619
|
+
# model = Sketchup.active_model
|
620
|
+
# entities = model.active_entities
|
621
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
622
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
623
|
+
# line = entities.add_line(point1, point2)
|
624
|
+
#
|
625
|
+
# @param [Geom::Point3d] point1
|
626
|
+
# Point3d object representing the edge's starting point.
|
627
|
+
#
|
628
|
+
# @param [Geom::Point3d] point2
|
629
|
+
# Point3d object representing the edge's ending point.
|
630
|
+
#
|
631
|
+
# @return [Sketchup::Edge] a Edge object if successful
|
632
|
+
#
|
633
|
+
# @see Sketchup::EntitiesBuilder#add_edge
|
634
|
+
# EntitiesBuilder#add_edge, alternative
|
635
|
+
# for generating bulk geometry with performance in mind.
|
636
|
+
#
|
637
|
+
# @see file:pages/generating_geometry.md
|
638
|
+
# Guide on Generating Geometry
|
639
|
+
#
|
640
|
+
# @version SketchUp 6.0
|
641
|
+
def add_line(point1, point2)
|
642
|
+
end
|
643
|
+
|
644
|
+
# The add_ngon method is used to create a multi-sided polygon.
|
645
|
+
#
|
646
|
+
# @example
|
647
|
+
# entities = Sketchup.active_model.entities
|
648
|
+
# center = Geom::Point3d.new
|
649
|
+
# normal = Geom::Vector3d.new(0, 0, 1)
|
650
|
+
# radius = 100
|
651
|
+
# numsides = 6
|
652
|
+
# edges = entities.add_ngon(center, normal, radius, numsides)
|
653
|
+
#
|
654
|
+
# @param [Geom::Point3d] center
|
655
|
+
# A Point3d object representing the center of the polygon.
|
656
|
+
#
|
657
|
+
# @param [Geom::Vector3d] normal
|
658
|
+
# A Vector3d object.
|
659
|
+
#
|
660
|
+
# @param [Numeric] radius
|
661
|
+
# A radius.
|
662
|
+
#
|
663
|
+
# @param [Integer] numsides
|
664
|
+
# The number of sides for the polygon.
|
665
|
+
#
|
666
|
+
# @return [Array<Sketchup::Edge>] an array of Edges that make up the polygon if
|
667
|
+
# successful
|
668
|
+
#
|
669
|
+
# @version SketchUp 6.0
|
670
|
+
def add_ngon(center, normal, radius, numsides = 24)
|
671
|
+
end
|
672
|
+
|
673
|
+
# The add_observer method is used to add an observer to the current object.
|
674
|
+
#
|
675
|
+
# @example
|
676
|
+
# # This is an example of an observer that watches the entities collection.
|
677
|
+
# # It writes to the console everytime new entities are added to the model.
|
678
|
+
# class MyEntitiesObserver < Sketchup::EntitiesObserver
|
679
|
+
# def onElementAdded(entities, entity)
|
680
|
+
# puts "onElementAdded: #{entity} was added to the model."
|
681
|
+
# end
|
682
|
+
# end
|
683
|
+
#
|
684
|
+
# # Attach the observer
|
685
|
+
# entities = Sketchup.active_model.entities
|
686
|
+
# entities.add_observer(MyEntitiesObserver.new)
|
687
|
+
#
|
688
|
+
# @param [Object] observer
|
689
|
+
# An observer.
|
690
|
+
#
|
691
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
692
|
+
#
|
693
|
+
# @version SketchUp 6.0
|
694
|
+
def add_observer(observer)
|
695
|
+
end
|
696
|
+
|
697
|
+
# The add_section_plane method adds a section plane object to the entities.
|
698
|
+
#
|
699
|
+
# @example
|
700
|
+
# # Create a section plane
|
701
|
+
# model = Sketchup.active_model
|
702
|
+
# section_plane = model.entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
703
|
+
# # Activate it
|
704
|
+
# section_plane.activate
|
705
|
+
# # Make sure section planes are visible
|
706
|
+
# model.rendering_options['DisplaySectionPlanes'] = true
|
707
|
+
#
|
708
|
+
# @param plane
|
709
|
+
# the geometric plane where the SectionPlane object is to
|
710
|
+
# be created. Refer to the Geom module for information on
|
711
|
+
# how planes are represented.
|
712
|
+
#
|
713
|
+
# @return [Sketchup::SectionPlane, nil] the created SectionPlane object if
|
714
|
+
# successful, nil on failure.
|
715
|
+
#
|
716
|
+
# @version SketchUp 2014
|
717
|
+
def add_section_plane(plane)
|
718
|
+
end
|
719
|
+
|
720
|
+
# The {#add_text} method adds a note or label text entity to the entities.
|
721
|
+
#
|
722
|
+
# @example
|
723
|
+
# model = Sketchup.active_model
|
724
|
+
# entities = model.entities
|
725
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
726
|
+
# text = entities.add_text("This is a Test", point)
|
727
|
+
#
|
728
|
+
# @example Instance path
|
729
|
+
# entities = Sketchup.active_model.entities
|
730
|
+
# group = entities.add_group
|
731
|
+
# group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
732
|
+
# instance = group.to_component
|
733
|
+
# transformation = instance.transformation
|
734
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
735
|
+
# instance_path = Sketchup::InstancePath.new([instance, edge])
|
736
|
+
# point = edge.start.position.transform(transformation)
|
737
|
+
# vector = Geom::Vector3d.new(45, 45, 45)
|
738
|
+
# Sketchup.active_model.entities.add_text("mytext", [instance_path, point], vector)
|
739
|
+
#
|
740
|
+
# @example Instance path as an array
|
741
|
+
# entities = Sketchup.active_model.entities
|
742
|
+
# group = entities.add_group
|
743
|
+
# group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
744
|
+
# instance = group.to_component
|
745
|
+
# transformation = instance.transformation
|
746
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
747
|
+
# path = [instance, edge]
|
748
|
+
# point = edge.start.position.transform(transformation)
|
749
|
+
# vector = Geom::Vector3d.new(45, 45, 45)
|
750
|
+
# Sketchup.active_model.entities.add_text("mytext", [path, point], vector)
|
751
|
+
#
|
752
|
+
# @overload add_text(text, point, vector)
|
753
|
+
#
|
754
|
+
# @bug SketchUp 2019.0 had a regression bug where an error was thrown if
|
755
|
+
# +point+ was provided as a {Sketchup::Vertex} or {Sketchup::InputPoint}.
|
756
|
+
# This was fixed in SketchUp 2019.1.
|
757
|
+
# @param [String] text The text string to add.
|
758
|
+
# @param [Geom::Point3d, Sketchup::Vertex, Sketchup::InputPoint] point
|
759
|
+
# A Point3d object representing the insertion point.
|
760
|
+
# @param [Geom::Vector3d] vector The Vector representing an arrow leader.
|
761
|
+
#
|
762
|
+
# @overload add_text(text, instance_path_and_pt, vector)
|
763
|
+
#
|
764
|
+
# @version SketchUp 2019
|
765
|
+
# @param [String] text The text to add.
|
766
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] instance_path_and_pt
|
767
|
+
# The array containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
768
|
+
# @param [Geom::Vector3d] vector The vector representing an arrow leader.
|
769
|
+
#
|
770
|
+
# @overload add_text(text, instance_array_and_pt, vector)
|
771
|
+
#
|
772
|
+
# @version SketchUp 2019
|
773
|
+
# @param [String] text The text to add.
|
774
|
+
# @param [Array(Array<Sketchup::Entity>, Geom::Point3d)] instance_array_with_pt
|
775
|
+
# The array containing one or more {Sketchup::ComponentInstance}'s and a
|
776
|
+
# leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
777
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
778
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the
|
779
|
+
# leaf entity.
|
780
|
+
# @param [Geom::Vector3d] vector The vector representing an arrow leader.
|
781
|
+
#
|
782
|
+
# @return [Sketchup::Text] a Text object if successful
|
783
|
+
#
|
784
|
+
# @version SketchUp 6.0
|
785
|
+
def add_text(*args)
|
786
|
+
end
|
787
|
+
|
788
|
+
# The {#at} method is an alias for {#[]}.
|
789
|
+
#
|
790
|
+
# @example
|
791
|
+
# entities = Sketchup.active_model.entities
|
792
|
+
# entity = entities.at(0)
|
793
|
+
#
|
794
|
+
# @param [Integer] entity_index
|
795
|
+
# The index for a specific entity.
|
796
|
+
#
|
797
|
+
# @return [Sketchup::Entity, nil]
|
798
|
+
#
|
799
|
+
# @see #[]
|
800
|
+
#
|
801
|
+
# @version SketchUp 6.0
|
802
|
+
def at(entity_index)
|
803
|
+
end
|
804
|
+
|
805
|
+
# Creates an {Sketchup::EntitiesBuilder} that can be used to generate bulk
|
806
|
+
# geometry with performance in mind. This is particularly useful for importers
|
807
|
+
# where the geometry is already well defined and one wants to recreate it
|
808
|
+
# without further processing.
|
809
|
+
#
|
810
|
+
# The call to {#build} starts an implicit operation, even if no other model
|
811
|
+
# changes are made within the block. This is not the same as
|
812
|
+
# {Sketchup::Model#start_operation}, so it's still recommended to wrap all
|
813
|
+
# model changes, including {#build} with {Sketchup::Model#start_operation} and
|
814
|
+
# {Sketchup::Model#commit_operation}.
|
815
|
+
#
|
816
|
+
# Refer to the documentation of {Sketchup::EntitiesBuilder} for more details.
|
817
|
+
#
|
818
|
+
# @example
|
819
|
+
# model = Sketchup.active_model
|
820
|
+
# model.entities.build { |builder|
|
821
|
+
# edge = builder.add_edge([0, 0, 0], [9, 0, 0])
|
822
|
+
# edge.material = 'red'
|
823
|
+
# face = builder.add_face([0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0])
|
824
|
+
# face.material = 'maroon'
|
825
|
+
# }
|
826
|
+
#
|
827
|
+
# @note While using {Sketchup::Entities#build} it is important to not
|
828
|
+
# add or remove vertices by other means of the builder. Also don't modify the
|
829
|
+
# position of the vertices in the {Sketchup::Entities} container geometry is
|
830
|
+
# added to. Doing so can break the vertex-cache that de-duplicates the vertices.
|
831
|
+
#
|
832
|
+
# @return [nil]
|
833
|
+
#
|
834
|
+
# @see Sketchup::EntitiesBuilder
|
835
|
+
#
|
836
|
+
# @version SketchUp 2022.0
|
837
|
+
#
|
838
|
+
# @yield [builder]
|
839
|
+
#
|
840
|
+
# @yieldparam [Sketchup::EntitiesBuilder] builder
|
841
|
+
def build
|
842
|
+
end
|
843
|
+
|
844
|
+
# The clear! method is used to remove all entities from the collection of
|
845
|
+
# entities.
|
846
|
+
#
|
847
|
+
# @example
|
848
|
+
# entities = Sketchup.active_model.entities
|
849
|
+
# status = entities.clear!
|
850
|
+
#
|
851
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
852
|
+
#
|
853
|
+
# @version SketchUp 6.0
|
854
|
+
def clear!
|
855
|
+
end
|
856
|
+
|
857
|
+
#
|
858
|
+
# @example
|
859
|
+
# entities = Sketchup.active_model.entities
|
860
|
+
# number = entities.count
|
861
|
+
#
|
862
|
+
# @note Since SketchUp 2014 the count method is inherited from Ruby's
|
863
|
+
# +Enumerable+ mix-in module. Prior to that the {#count} method is an alias
|
864
|
+
# for {#length}.
|
865
|
+
#
|
866
|
+
# @return [Integer]
|
867
|
+
#
|
868
|
+
# @see #length
|
869
|
+
#
|
870
|
+
# @version SketchUp 6.0
|
871
|
+
def count
|
872
|
+
end
|
873
|
+
|
874
|
+
# The {#each} method is used to iterate through the entities in the collection
|
875
|
+
# of entities.
|
876
|
+
#
|
877
|
+
# @example
|
878
|
+
# model = Sketchup.active_model
|
879
|
+
# entities = model.entities
|
880
|
+
# entities.each { | entity| puts entity }
|
881
|
+
#
|
882
|
+
# @note Don't remove content from this collection while iterating over it with
|
883
|
+
# {#each}. This would change the size of the collection and cause elements to
|
884
|
+
# be skipped as the indices change. Instead copy the current collection to an
|
885
|
+
# array using +to_a+ and then use +each+ on the array, when removing content.
|
886
|
+
#
|
887
|
+
# @return [nil]
|
888
|
+
#
|
889
|
+
# @version SketchUp 6.0
|
890
|
+
#
|
891
|
+
# @yieldparam [Sketchup::Entity] entity
|
892
|
+
def each
|
893
|
+
end
|
894
|
+
|
895
|
+
# The {#erase_entities} method is used to erase one or more entities from the
|
896
|
+
# model.
|
897
|
+
#
|
898
|
+
# @bug Prior to SketchUp 2023.0 this could crash SketchUp if you erased an
|
899
|
+
# instance used by the active edit path.
|
900
|
+
#
|
901
|
+
# @example
|
902
|
+
# model = Sketchup.active_model
|
903
|
+
# entities = model.active_entities
|
904
|
+
# points = []
|
905
|
+
# points << [0, 0, 0]
|
906
|
+
# points << [100, 0, 0]
|
907
|
+
# points << [100, 100, 0]
|
908
|
+
# points << [0, 100, 0]
|
909
|
+
#
|
910
|
+
# # Add the face to the entities in the model.
|
911
|
+
# face = entities.add_face(pts)
|
912
|
+
# faces = entities.grep(Sketchup::Face)
|
913
|
+
# entities.erase_entities(faces)
|
914
|
+
#
|
915
|
+
# @note It's faster to use this method and erase in bulk than to iterate
|
916
|
+
# individual drawing elements calling {Sketchup::Drawingelement#erase!}.
|
917
|
+
#
|
918
|
+
# @overload erase_entities(entities)
|
919
|
+
#
|
920
|
+
# @param [Array<Sketchup::Entity>] entities
|
921
|
+
#
|
922
|
+
# @overload erase_entities(*entities)
|
923
|
+
#
|
924
|
+
# @param [Array<Sketchup::Entity>] entities
|
925
|
+
#
|
926
|
+
# @raise [ArgumentError] if the given entities contains instances or
|
927
|
+
# definitions are used by {Sketchup::Model#active_path}.
|
928
|
+
#
|
929
|
+
# @return [nil]
|
930
|
+
#
|
931
|
+
# @version SketchUp 6.0
|
932
|
+
def erase_entities(*args)
|
933
|
+
end
|
934
|
+
|
935
|
+
# The {#fill_from_mesh} method is used to add faces and edges to the collection
|
936
|
+
# of entities from a {Geom::PolygonMesh}. It requires that the entities
|
937
|
+
# collection to be filled is empty. It has higher performance than
|
938
|
+
# {#add_faces_from_mesh}, but does less error checking as it builds the
|
939
|
+
# geometry.
|
940
|
+
#
|
941
|
+
# The +smooth_flags+ parameter can contain any of the following values if
|
942
|
+
# passed. The constants were added in SketchUp 2014. For previous versions,
|
943
|
+
# numeric values have to be specified instead of the Ruby constants:
|
944
|
+
#
|
945
|
+
# - 0: {Geom::PolygonMesh::NO_SMOOTH_OR_HIDE}
|
946
|
+
# - 1: {Geom::PolygonMesh::HIDE_BASED_ON_INDEX} (Negative point index will hide the edge.)
|
947
|
+
# - 2: {Geom::PolygonMesh::SOFTEN_BASED_ON_INDEX} (Negative point index will soften the edge.)
|
948
|
+
# - 4: {Geom::PolygonMesh::AUTO_SOFTEN} (Interior edges are softened.)
|
949
|
+
# - 8: {Geom::PolygonMesh::SMOOTH_SOFT_EDGES} (All soft edges will also be smooth.)
|
950
|
+
#
|
951
|
+
# The 4rd and 5th parameters will accept a {Sketchup::Material} object or a
|
952
|
+
# string name of a material currently in the model.
|
953
|
+
#
|
954
|
+
# @example
|
955
|
+
# pm = Geom::PolygonMesh.new
|
956
|
+
# pm.add_point([ 0, 0, 0]) # 1
|
957
|
+
# pm.add_point([ 10, 0, 0]) # 2
|
958
|
+
# pm.add_point([ 10, 10, 0]) # 3
|
959
|
+
# pm.add_point([ 0, 10, 0]) # 4
|
960
|
+
# pm.add_point([ 20, 0, 5]) # 5
|
961
|
+
# pm.add_point([ 20, 10, 5]) # 6
|
962
|
+
# pm.add_polygon(1, -2, 3, 4)
|
963
|
+
# pm.add_polygon(2, 5, 6, -3)
|
964
|
+
#
|
965
|
+
# # Create a new group that we will populate with the mesh.
|
966
|
+
# group = Sketchup.active_model.entities.add_group
|
967
|
+
# material = Sketchup.active_model.materials.add('My Red Material')
|
968
|
+
# material.color = 'red'
|
969
|
+
# smooth_flags = Geom::PolygonMesh::HIDE_BASED_ON_INDEX
|
970
|
+
# group.entities.fill_from_mesh(pm, true, smooth_flags, material)
|
971
|
+
#
|
972
|
+
# @param [Geom::PolygonMesh] polygon_mesh
|
973
|
+
#
|
974
|
+
# @param [Boolean] weld_vertices
|
975
|
+
# This argument has no effect and is kept for
|
976
|
+
# compatibility reasons. Points are always
|
977
|
+
# merged.
|
978
|
+
#
|
979
|
+
# @param [Integer] smooth_flags
|
980
|
+
# flags for softening and smoothing of edges.
|
981
|
+
#
|
982
|
+
# @param [Sketchup::Material, String] f_material
|
983
|
+
# material to paint front faces with.
|
984
|
+
#
|
985
|
+
# @param [Sketchup::Material, String] b_material
|
986
|
+
# material to paint back faces with.
|
987
|
+
#
|
988
|
+
# @return [Boolean]
|
989
|
+
#
|
990
|
+
# @see Sketchup::EntitiesBuilder
|
991
|
+
# EntitiesBuilder, alternative interface
|
992
|
+
# for generating bulk geometry with performance in mind.
|
993
|
+
#
|
994
|
+
# @see file:pages/generating_geometry.md
|
995
|
+
# Guide on Generating Geometry
|
996
|
+
#
|
997
|
+
# @version SketchUp 6.0
|
998
|
+
def fill_from_mesh(polygon_mesh, weld_vertices = true, smooth_flags = Geom::PolygonMesh::AUTO_SOFTEN|Geom::PolygonMesh::SMOOTH_SOFT_EDGES, f_material = nil, b_material = nil)
|
999
|
+
end
|
1000
|
+
|
1001
|
+
# The intersect_with method is used to intersect an entities, component
|
1002
|
+
# instance, or group object with a entities object.
|
1003
|
+
#
|
1004
|
+
# @example
|
1005
|
+
# model = Sketchup.active_model
|
1006
|
+
# entities = model.active_entities
|
1007
|
+
#
|
1008
|
+
# # Create a group to intersect with the model
|
1009
|
+
# group1 = entities.add_group
|
1010
|
+
# face1 = group1.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
1011
|
+
# face1.pushpull(-40)
|
1012
|
+
#
|
1013
|
+
# # Add geometry into the model
|
1014
|
+
# face2 = entities.add_face([50, 50, 0], [200, 50, 0], [200, 200, 0], [50, 200, 0])
|
1015
|
+
# face2.pushpull(-100)
|
1016
|
+
#
|
1017
|
+
# entities1 = group1.entities
|
1018
|
+
# entities2 = entities.to_a
|
1019
|
+
#
|
1020
|
+
# transformation1 = Geom::Transformation.new
|
1021
|
+
# transformation2 = group1.transformation
|
1022
|
+
#
|
1023
|
+
# # Intersect the group and model geometry
|
1024
|
+
# entities.intersect_with(true, transformation1, entities1, transformation2, true, entities2)
|
1025
|
+
#
|
1026
|
+
# @param [Boolean] recurse
|
1027
|
+
# true if you want this entities object to be recursed
|
1028
|
+
# (intersection lines will be put inside of groups and
|
1029
|
+
# components within this entities object).
|
1030
|
+
#
|
1031
|
+
# @param [Geom::Transformation] transform1
|
1032
|
+
# The transformation for this entities object.
|
1033
|
+
#
|
1034
|
+
# @param [Sketchup::Entities] entities1
|
1035
|
+
# The entities object where you want the intersection
|
1036
|
+
# lines to appear.
|
1037
|
+
#
|
1038
|
+
# @param [Geom::Transformation] transform2
|
1039
|
+
# The transformation for entities1.
|
1040
|
+
#
|
1041
|
+
# @param [Boolean] hidden
|
1042
|
+
# true if you want hidden geometry in this entities
|
1043
|
+
# object to be used in the intersection.
|
1044
|
+
#
|
1045
|
+
# @param [Sketchup::Entity, Array<Sketchup::Entity>] entities2
|
1046
|
+
# A single entity, or an array of entities.
|
1047
|
+
#
|
1048
|
+
# @return [nil]
|
1049
|
+
#
|
1050
|
+
# @version SketchUp 6.0
|
1051
|
+
def intersect_with(recurse, transform1, entities1, transform2, hidden, entities2)
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
# The {#length} method is used to retrieve the number of entities in the
|
1055
|
+
# collection of entities.
|
1056
|
+
#
|
1057
|
+
# @example
|
1058
|
+
# model = Sketchup.active_model
|
1059
|
+
# entities = model.entities
|
1060
|
+
# number = entities.length
|
1061
|
+
#
|
1062
|
+
# @return [Integer]
|
1063
|
+
#
|
1064
|
+
# @see #size
|
1065
|
+
#
|
1066
|
+
# @version SketchUp 6.0
|
1067
|
+
def length
|
1068
|
+
end
|
1069
|
+
|
1070
|
+
# The model method is used to retrieve the model that contains the collection
|
1071
|
+
# of entities.
|
1072
|
+
#
|
1073
|
+
# @example
|
1074
|
+
# model = Sketchup.active_model
|
1075
|
+
# entities = model.entities
|
1076
|
+
# group = entities.add_group
|
1077
|
+
# face = group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
1078
|
+
# model = group.entities.model
|
1079
|
+
#
|
1080
|
+
# @return [Sketchup::Model] the model that contains the collection of
|
1081
|
+
# entities if successful.
|
1082
|
+
#
|
1083
|
+
# @version SketchUp 6.0
|
1084
|
+
def model
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
# The parent method is used to retrieve the parent or object that contains the
|
1088
|
+
# collection of entities. A parent can be either a Model or
|
1089
|
+
# ComponentDefinition object.
|
1090
|
+
#
|
1091
|
+
# @example
|
1092
|
+
# model = Sketchup.active_model
|
1093
|
+
# entities = model.entities
|
1094
|
+
# group = entities.add_group
|
1095
|
+
# face = group.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
1096
|
+
# model = group.entities.parent
|
1097
|
+
#
|
1098
|
+
# @return [Sketchup::ComponentDefinition, Sketchup::Model] the object that
|
1099
|
+
# contains the collection of entities if successful
|
1100
|
+
#
|
1101
|
+
# @version SketchUp 6.0
|
1102
|
+
def parent
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
# The remove_observer method is used to remove an observer from the current
|
1106
|
+
# object.
|
1107
|
+
#
|
1108
|
+
# @example
|
1109
|
+
# # This is an example of an observer that watches the entities collection.
|
1110
|
+
# # It writes to the console everytime new entities are added to the model.
|
1111
|
+
# class MyEntitiesObserver < Sketchup::EntitiesObserver
|
1112
|
+
# def onElementAdded(entities, entity)
|
1113
|
+
# puts "onElementAdded: #{entity} was added to the model."
|
1114
|
+
# end
|
1115
|
+
# end
|
1116
|
+
#
|
1117
|
+
# # Attach the observer
|
1118
|
+
# entities = Sketchup.active_model.entities
|
1119
|
+
# my_observer = MyEntitiesObserver.new
|
1120
|
+
# entities.add_observer(my_observer)
|
1121
|
+
# # Add an entity to the model, and the observer will trigger.
|
1122
|
+
# entities.add_line([0,0,0], [100,0,0])
|
1123
|
+
# # Remove the oberserver and the observer will no longer trigger.
|
1124
|
+
# status = entities.remove_observer(my_observer)
|
1125
|
+
#
|
1126
|
+
# @param [Object] observer
|
1127
|
+
# An observer.
|
1128
|
+
#
|
1129
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
1130
|
+
#
|
1131
|
+
# @version SketchUp 6.0
|
1132
|
+
def remove_observer(observer)
|
1133
|
+
end
|
1134
|
+
|
1135
|
+
# The {#size} method is an alias for the {#length} method.
|
1136
|
+
#
|
1137
|
+
# @example
|
1138
|
+
# model = Sketchup.active_model
|
1139
|
+
# entities = model.entities
|
1140
|
+
# entities.size
|
1141
|
+
#
|
1142
|
+
# @return [Integer]
|
1143
|
+
#
|
1144
|
+
# @see #length
|
1145
|
+
#
|
1146
|
+
# @version SketchUp 2014
|
1147
|
+
def size
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
# The transform_by_vectors method is used to apply several vectors to several
|
1151
|
+
# sub-entities all at once.
|
1152
|
+
#
|
1153
|
+
# @example
|
1154
|
+
# model = Sketchup.active_model
|
1155
|
+
# entities = model.active_entities
|
1156
|
+
#
|
1157
|
+
# # Create a group with geometry to transform
|
1158
|
+
# group1 = entities.add_group
|
1159
|
+
# face1 = group1.entities.add_face([0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0])
|
1160
|
+
# face1.pushpull(-40)
|
1161
|
+
#
|
1162
|
+
# # Raise vertices in selection by their distance to the origin.
|
1163
|
+
# with_vertices = group1.entities.select { |entity| entity.respond_to?(:vertices) }
|
1164
|
+
# vertices = with_vertices.flat_map(&:vertices).uniq
|
1165
|
+
# lengths = vertices.map { |vertex| vertex.position.distance(ORIGIN) }
|
1166
|
+
# vectors = lengths.map { |length| Geom::Vector3d.new(0, 0, length) }
|
1167
|
+
#
|
1168
|
+
# entities.transform_by_vectors(vertices, vectors)
|
1169
|
+
#
|
1170
|
+
# @param [Array<Sketchup::Entity>] sub_entities
|
1171
|
+
# An array of entities to transform.
|
1172
|
+
#
|
1173
|
+
# @param [Array<Geom::Vector3d>] vectors
|
1174
|
+
# An array of vectors to apply.
|
1175
|
+
#
|
1176
|
+
# @return [Sketchup::Entities]
|
1177
|
+
#
|
1178
|
+
# @version SketchUp 6.0
|
1179
|
+
def transform_by_vectors(sub_entities, vectors)
|
1180
|
+
end
|
1181
|
+
|
1182
|
+
# The transform_entities method is used to apply a transform to several
|
1183
|
+
# sub-entities all at once.
|
1184
|
+
#
|
1185
|
+
# If you are transforming entities in the active drawing context or any of its
|
1186
|
+
# parent drawing contexts, the transformation will be interpreted as relative
|
1187
|
+
# to the global coordinate system. Otherwise the transformation will be
|
1188
|
+
# interpreted as being on the local coordinate system.
|
1189
|
+
#
|
1190
|
+
# @example
|
1191
|
+
# entities = Sketchup.active_model.entities
|
1192
|
+
# # Add edges to the model at the origin.
|
1193
|
+
# edge1 = entities.add_line([0, 0, 0], [100, 100, 100])
|
1194
|
+
# edge2 = entities.add_line([0, 0, 0], [200, -10, -10])
|
1195
|
+
#
|
1196
|
+
# # After the transformation, the edges will be moved 100 inches
|
1197
|
+
# # away from the origin, on the x axis.
|
1198
|
+
# transformation = Geom::Transformation.new([100, 0, 0])
|
1199
|
+
# entities.transform_entities(transformation, [edge1, edge2])
|
1200
|
+
#
|
1201
|
+
# @param [Geom::Transformation] transform
|
1202
|
+
# The Transformation to apply.
|
1203
|
+
#
|
1204
|
+
# @param [Array<Sketchup::Entity>] entities
|
1205
|
+
# An array or series of entities to transform.
|
1206
|
+
#
|
1207
|
+
# @return [Boolean] +false+ if the entities array was empty.
|
1208
|
+
#
|
1209
|
+
# @version SketchUp 6.0
|
1210
|
+
def transform_entities(transform, entities)
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
# The {#weld} method takes a set of edges and find all possible chains of edges
|
1214
|
+
# and connect them with a {Sketchup::Curve}.
|
1215
|
+
#
|
1216
|
+
# A curve will not cross another curve. They will split where multiple curves
|
1217
|
+
# meet.
|
1218
|
+
#
|
1219
|
+
# @example
|
1220
|
+
# model = Sketchup.active_model
|
1221
|
+
# entities = model.active_entities
|
1222
|
+
# edges = []
|
1223
|
+
# edges << entities.add_line([0, 0, 0], [100, 20, 0])
|
1224
|
+
# edges << entities.add_line([100, 20, 0], [130, 200, 50])
|
1225
|
+
# edges << entities.add_line([130, 200, 50], [130, 300, 50])
|
1226
|
+
# curves = model.active_entities.weld(edges)
|
1227
|
+
#
|
1228
|
+
# @param [Array<Sketchup::Edge>] edges
|
1229
|
+
#
|
1230
|
+
# @raise [ArgumentError] if the given entities are not part of the same
|
1231
|
+
# {Sketchup::Entities} collection.
|
1232
|
+
#
|
1233
|
+
# @return [Array<Sketchup::Curve>]
|
1234
|
+
#
|
1235
|
+
# @version SketchUp 2020.1
|
1236
|
+
def weld(edges)
|
1237
|
+
end
|
1238
|
+
|
1239
|
+
end
|