sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,193 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
# Constants
|
7
|
+
|
8
|
+
ALeaderModel = nil # Stub value.
|
9
|
+
ALeaderNone = nil # Stub value.
|
10
|
+
ALeaderView = nil # Stub value.
|
11
|
+
|
12
|
+
ALT_MODIFIER_KEY = nil # Stub value.
|
13
|
+
ALT_MODIFIER_MASK = nil # Stub value.
|
14
|
+
|
15
|
+
CMD_ARC = nil # Stub value.
|
16
|
+
CMD_CAMERA_UNDO = nil # Stub value.
|
17
|
+
CMD_CIRCLE = nil # Stub value.
|
18
|
+
CMD_COPY = nil # Stub value.
|
19
|
+
CMD_CUT = nil # Stub value.
|
20
|
+
CMD_DELETE = nil # Stub value.
|
21
|
+
CMD_DIMENSION = nil # Stub value.
|
22
|
+
CMD_DISPLAY_FOV = nil # Stub value.
|
23
|
+
CMD_DOLLY = nil # Stub value.
|
24
|
+
CMD_DRAWCUTS = nil # Stub value.
|
25
|
+
CMD_DRAWOUTLINES = nil # Stub value.
|
26
|
+
CMD_ERASE = nil # Stub value.
|
27
|
+
CMD_EXTRUDE = nil # Stub value.
|
28
|
+
CMD_FREEHAND = nil # Stub value.
|
29
|
+
CMD_HIDDENLINE = nil # Stub value.
|
30
|
+
CMD_LINE = nil # Stub value.
|
31
|
+
CMD_MAKE_COMPONENT = nil # Stub value.
|
32
|
+
CMD_MEASURE = nil # Stub value.
|
33
|
+
CMD_MOVE = nil # Stub value.
|
34
|
+
CMD_NEW = nil # Stub value.
|
35
|
+
CMD_OFFSET = nil # Stub value.
|
36
|
+
CMD_OPEN = nil # Stub value.
|
37
|
+
CMD_ORBIT = nil # Stub value.
|
38
|
+
CMD_PAGE_DELETE = nil # Stub value.
|
39
|
+
CMD_PAGE_NEW = nil # Stub value.
|
40
|
+
CMD_PAGE_NEXT = nil # Stub value.
|
41
|
+
CMD_PAGE_PREVIOUS = nil # Stub value.
|
42
|
+
CMD_PAGE_UPDATE = nil # Stub value.
|
43
|
+
CMD_PAINT = nil # Stub value.
|
44
|
+
CMD_PAN = nil # Stub value.
|
45
|
+
CMD_PASTE = nil # Stub value.
|
46
|
+
CMD_POLYGON = nil # Stub value.
|
47
|
+
CMD_POSITION_CAMERA = nil # Stub value.
|
48
|
+
CMD_PRINT = nil # Stub value.
|
49
|
+
CMD_PROTRACTOR = nil # Stub value.
|
50
|
+
CMD_PUSHPULL = nil # Stub value.
|
51
|
+
CMD_RECTANGLE = nil # Stub value.
|
52
|
+
CMD_REDO = nil # Stub value.
|
53
|
+
CMD_ROTATE = nil # Stub value.
|
54
|
+
CMD_RUBY_CONSOLE = nil # Stub value.
|
55
|
+
CMD_SAVE = nil # Stub value.
|
56
|
+
CMD_SCALE = nil # Stub value.
|
57
|
+
CMD_SECTION = nil # Stub value.
|
58
|
+
CMD_SELECT = nil # Stub value.
|
59
|
+
CMD_SELECTION_ZOOM_EXT = nil # Stub value.
|
60
|
+
CMD_SHADED = nil # Stub value.
|
61
|
+
CMD_SHOWGUIDES = nil # Stub value.
|
62
|
+
CMD_SHOWHIDDEN = nil # Stub value.
|
63
|
+
CMD_SKETCHAXES = nil # Stub value.
|
64
|
+
CMD_SKETCHCS = nil # Stub value.
|
65
|
+
CMD_TEXT = nil # Stub value.
|
66
|
+
CMD_TEXTURED = nil # Stub value.
|
67
|
+
CMD_TRANSPARENT = nil # Stub value.
|
68
|
+
CMD_UNDO = nil # Stub value.
|
69
|
+
CMD_VIEW_BACK = nil # Stub value.
|
70
|
+
CMD_VIEW_BOTTOM = nil # Stub value.
|
71
|
+
CMD_VIEW_FRONT = nil # Stub value.
|
72
|
+
CMD_VIEW_ISO = nil # Stub value.
|
73
|
+
CMD_VIEW_LEFT = nil # Stub value.
|
74
|
+
CMD_VIEW_PERSPECTIVE = nil # Stub value.
|
75
|
+
CMD_VIEW_RIGHT = nil # Stub value.
|
76
|
+
CMD_VIEW_TOP = nil # Stub value.
|
77
|
+
CMD_WALK = nil # Stub value.
|
78
|
+
CMD_WIREFRAME = nil # Stub value.
|
79
|
+
CMD_ZOOM = nil # Stub value.
|
80
|
+
CMD_ZOOM_EXTENTS = nil # Stub value.
|
81
|
+
CMD_ZOOM_WINDOW = nil # Stub value.
|
82
|
+
|
83
|
+
COPY_MODIFIER_KEY = nil # Stub value.
|
84
|
+
COPY_MODIFIER_MASK = nil # Stub value.
|
85
|
+
|
86
|
+
CONSTRAIN_MODIFIER_KEY = nil # Stub value.
|
87
|
+
CONSTRAIN_MODIFIER_MASK = nil # Stub value.
|
88
|
+
|
89
|
+
DimensionArrowClosed = nil # Stub value.
|
90
|
+
DimensionArrowDot = nil # Stub value.
|
91
|
+
DimensionArrowNone = nil # Stub value.
|
92
|
+
DimensionArrowOpen = nil # Stub value.
|
93
|
+
DimensionArrowSlash = nil # Stub value.
|
94
|
+
|
95
|
+
FILE_WRITE_FAILED_INVALID_TYPE = nil # Stub value.
|
96
|
+
FILE_WRITE_FAILED_UNKNOWN = nil # Stub value.
|
97
|
+
FILE_WRITE_OK = nil # Stub value.
|
98
|
+
|
99
|
+
GL_LINES = nil # Stub value.
|
100
|
+
GL_LINE_LOOP = nil # Stub value.
|
101
|
+
GL_LINE_STRIP = nil # Stub value.
|
102
|
+
GL_POINTS = nil # Stub value.
|
103
|
+
GL_POLYGON = nil # Stub value.
|
104
|
+
GL_QUADS = nil # Stub value.
|
105
|
+
GL_QUAD_STRIP = nil # Stub value.
|
106
|
+
GL_TRIANGLES = nil # Stub value.
|
107
|
+
GL_TRIANGLE_FAN = nil # Stub value.
|
108
|
+
GL_TRIANGLE_STRIP = nil # Stub value.
|
109
|
+
|
110
|
+
IDENTITY = nil # Stub value.
|
111
|
+
|
112
|
+
IDABORT = nil # Stub value.
|
113
|
+
IDCANCEL = nil # Stub value.
|
114
|
+
IDIGNORE = nil # Stub value.
|
115
|
+
IDNO = nil # Stub value.
|
116
|
+
IDOK = nil # Stub value.
|
117
|
+
IDRETRY = nil # Stub value.
|
118
|
+
IDYES = nil # Stub value.
|
119
|
+
|
120
|
+
LAYER_HIDDEN_BY_DEFAULT = nil # Stub value.
|
121
|
+
LAYER_IS_HIDDEN_ON_NEW_PAGES = nil # Stub value.
|
122
|
+
LAYER_IS_VISIBLE_ON_NEW_PAGES = nil # Stub value.
|
123
|
+
LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES = nil # Stub value.
|
124
|
+
LAYER_VISIBLE_BY_DEFAULT = nil # Stub value.
|
125
|
+
|
126
|
+
MF_CHECKED = nil # Stub value.
|
127
|
+
MF_DISABLED = nil # Stub value.
|
128
|
+
MF_ENABLED = nil # Stub value.
|
129
|
+
MF_GRAYED = nil # Stub value.
|
130
|
+
MF_UNCHECKED = nil # Stub value.
|
131
|
+
|
132
|
+
MB_ABORTRETRYIGNORE = nil # Stub value.
|
133
|
+
MB_MULTILINE = nil # Stub value.
|
134
|
+
MB_OK = nil # Stub value.
|
135
|
+
MB_OKCANCEL = nil # Stub value.
|
136
|
+
MB_RETRYCANCEL = nil # Stub value.
|
137
|
+
MB_YESNO = nil # Stub value.
|
138
|
+
MB_YESNOCANCEL = nil # Stub value.
|
139
|
+
|
140
|
+
ORIGIN = nil # Stub value.
|
141
|
+
|
142
|
+
PAGE_NO_CAMERA = nil # Stub value.
|
143
|
+
PAGE_USE_ALL = nil # Stub value.
|
144
|
+
PAGE_USE_CAMERA = nil # Stub value.
|
145
|
+
PAGE_USE_HIDDEN = nil # Stub value.
|
146
|
+
PAGE_USE_LAYER_VISIBILITY = nil # Stub value.
|
147
|
+
PAGE_USE_RENDERING_OPTIONS = nil # Stub value.
|
148
|
+
PAGE_USE_SECTION_PLANES = nil # Stub value.
|
149
|
+
PAGE_USE_SHADOWINFO = nil # Stub value.
|
150
|
+
PAGE_USE_SKETCHCS = nil # Stub value.
|
151
|
+
|
152
|
+
SB_PROMPT = nil # Stub value.
|
153
|
+
SB_VCB_LABEL = nil # Stub value.
|
154
|
+
SB_VCB_VALUE = nil # Stub value.
|
155
|
+
|
156
|
+
SnapTo_Arbitrary = nil # Stub value.
|
157
|
+
SnapTo_Horizontal = nil # Stub value.
|
158
|
+
SnapTo_Sloped = nil # Stub value.
|
159
|
+
SnapTo_Vertical = nil # Stub value.
|
160
|
+
|
161
|
+
SKETCHUP_CONSOLE = nil # Stub value.
|
162
|
+
|
163
|
+
TB_HIDDEN = nil # Stub value.
|
164
|
+
TB_NEVER_SHOWN = nil # Stub value.
|
165
|
+
TB_VISIBLE = nil # Stub value.
|
166
|
+
|
167
|
+
TextAlignCenter = nil # Stub value.
|
168
|
+
TextAlignLeft = nil # Stub value.
|
169
|
+
TextAlignRight = nil # Stub value.
|
170
|
+
|
171
|
+
VK_DELETE = nil # Stub value.
|
172
|
+
VK_DOWN = nil # Stub value.
|
173
|
+
VK_END = nil # Stub value.
|
174
|
+
VK_HOME = nil # Stub value.
|
175
|
+
VK_INSERT = nil # Stub value.
|
176
|
+
VK_LEFT = nil # Stub value.
|
177
|
+
VK_NEXT = nil # Stub value.
|
178
|
+
VK_PRIOR = nil # Stub value.
|
179
|
+
VK_RIGHT = nil # Stub value.
|
180
|
+
VK_SPACE = nil # Stub value.
|
181
|
+
VK_UP = nil # Stub value.
|
182
|
+
|
183
|
+
VK_ALT = nil # Stub value.
|
184
|
+
VK_COMMAND = nil # Stub value.
|
185
|
+
VK_CONTROL = nil # Stub value.
|
186
|
+
VK_MENU = nil # Stub value.
|
187
|
+
VK_SHIFT = nil # Stub value.
|
188
|
+
|
189
|
+
X_AXIS = nil # Stub value.
|
190
|
+
Y_AXIS = nil # Stub value.
|
191
|
+
Z_AXIS = nil # Stub value.
|
192
|
+
|
193
|
+
|
data/SketchUp/array.rb
ADDED
@@ -0,0 +1,593 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The SketchUp Array class adds additional methods to the standard Ruby Array
|
5
|
+
# class. Specifically, it contains methods allowing an
|
6
|
+
# array to behave just as a {Geom::Vector3d} or {Geom::Point3d} object
|
7
|
+
# (which can be thought of as arrays of 3 coordinate values). Therefore, you
|
8
|
+
# can use the Array class in place of a {Geom::Point3d} or {Geom::Vector3d} as
|
9
|
+
# a way to pass coordinate values.
|
10
|
+
#
|
11
|
+
# @example
|
12
|
+
# # An array of 3 values can represent a 1" long vector pointing straight
|
13
|
+
# # up in the z-direction.
|
14
|
+
# array = [0, 0, 1]
|
15
|
+
#
|
16
|
+
# # An array of 3 values can also represent a point 1" above the origin in
|
17
|
+
# # the z direction. (Note that this is the exact same array.)
|
18
|
+
# array = [0, 0, 1]
|
19
|
+
#
|
20
|
+
# # How it is interpreted is based on context. For example, this code will
|
21
|
+
# # create a construction point at position 0, 0, 1, since in this context
|
22
|
+
# # a Point3d is expected.
|
23
|
+
# entities = Sketchup.active_model.entities
|
24
|
+
# construction_point = entities.add_cpoint(array)
|
25
|
+
#
|
26
|
+
# # Whereas this will move our construction point 1" upward, since in this
|
27
|
+
# # context a Vector3d is expected.
|
28
|
+
# transformation = Geom::Transformation.new(array)
|
29
|
+
# entities.transform_entities(transformation, construction_point)
|
30
|
+
#
|
31
|
+
# @version SketchUp 6.0
|
32
|
+
class Array
|
33
|
+
|
34
|
+
# Instance Methods
|
35
|
+
|
36
|
+
# The {#cross} method is used to compute the cross product between two vectors.
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# vector1 = Geom::Vector3d.new(0, 1, 0)
|
40
|
+
# array = [1, 0, 0]
|
41
|
+
# # This will return a new Vector3d
|
42
|
+
# vector2 = array.cross(vector1)
|
43
|
+
#
|
44
|
+
# @param [Geom::Vector3d] vector
|
45
|
+
#
|
46
|
+
# @return [Geom::Vector3d]
|
47
|
+
#
|
48
|
+
# @version SketchUp 6.0
|
49
|
+
def cross(vector)
|
50
|
+
end
|
51
|
+
|
52
|
+
# The {#distance} method is used to compute the distance between two points.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
# point = Geom::Point3d.new(10, 10, 10)
|
56
|
+
# array = [1, 1, 1]
|
57
|
+
# # This will return a Length
|
58
|
+
# distance = array.distance(point)
|
59
|
+
#
|
60
|
+
# @param [Geom::Point3d] point
|
61
|
+
#
|
62
|
+
# @return [Length]
|
63
|
+
#
|
64
|
+
# @version SketchUp 6.0
|
65
|
+
def distance(point)
|
66
|
+
end
|
67
|
+
|
68
|
+
# The {#distance_to_line} method is used to compute the distance from a
|
69
|
+
# {Geom::Point3d} object to a line.
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
73
|
+
# array = [10, 10, 10]
|
74
|
+
# # This will return a Length
|
75
|
+
# distance = array.distance_to_line(line)
|
76
|
+
#
|
77
|
+
# @overload distance_to_line(point1, point2)
|
78
|
+
#
|
79
|
+
# @param [Geom::Point3d] point1
|
80
|
+
# @param [Geom::Point3d] point1
|
81
|
+
# @return [Length]
|
82
|
+
#
|
83
|
+
# @overload distance_to_line(point, vector)
|
84
|
+
#
|
85
|
+
# @param [Geom::Point3d] point
|
86
|
+
# @param [Geom::Vector3d] vector
|
87
|
+
# @return [Length]
|
88
|
+
#
|
89
|
+
# @see Geom
|
90
|
+
# The Geom module for instructions on how to create a line.
|
91
|
+
#
|
92
|
+
# @version SketchUp 6.0
|
93
|
+
def distance_to_line(*args)
|
94
|
+
end
|
95
|
+
|
96
|
+
# The {#distance_to_plane} method is used to compute the distance from a
|
97
|
+
# {Geom::Point3d} object to a plane.
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
101
|
+
# array = [10, 10, 10]
|
102
|
+
# # This will return a Length
|
103
|
+
# distance = array.distance_to_plane(plane)
|
104
|
+
#
|
105
|
+
# @overload distance_to_plane(array)
|
106
|
+
#
|
107
|
+
# Plane defined by its coefficents.
|
108
|
+
# @param [Array<Float, Float, Float, Float>] point
|
109
|
+
# @return [Length] The distance between the two points.
|
110
|
+
#
|
111
|
+
# @overload distance_to_plane(point, vector)
|
112
|
+
#
|
113
|
+
# Plane defined by
|
114
|
+
# @param [Geom::Point3d] point
|
115
|
+
# @param [Geom::Vector3d] vector
|
116
|
+
# @return [Length] The distance between the two points.
|
117
|
+
#
|
118
|
+
# @overload distance_to_plane(point1, point2, point3)
|
119
|
+
#
|
120
|
+
# Plane defined by three points.
|
121
|
+
# @note The three points should not be co-linear or duplicate.
|
122
|
+
# @param [Geom::Point3d] point1
|
123
|
+
# @param [Geom::Point3d] point2
|
124
|
+
# @param [Geom::Point3d] point3
|
125
|
+
# @return [Length] The distance between the two points.
|
126
|
+
#
|
127
|
+
# @overload distance_to_plane(array)
|
128
|
+
#
|
129
|
+
# Plane defined by three points.
|
130
|
+
# @param [Array<Geom::Point3d, Geom::Point3d, Geom::Point3d>] point
|
131
|
+
# @return [Length] The distance between the two points.
|
132
|
+
#
|
133
|
+
# @overload distance_to_plane(array)
|
134
|
+
#
|
135
|
+
# Plane defined by three points.
|
136
|
+
# @note The three points should not be co-linear or duplicate.
|
137
|
+
# @param [Array<Geom::Point3d, Geom::Vector3d>] point
|
138
|
+
# @return [Length] The distance between the two points.
|
139
|
+
#
|
140
|
+
# @overload distance_to_plane(float1, float2, float3, float4)
|
141
|
+
#
|
142
|
+
# Plane defined by its coefficents.
|
143
|
+
# @param [Float] float1
|
144
|
+
# @param [Float] float2
|
145
|
+
# @param [Float] float3
|
146
|
+
# @param [Float] float4
|
147
|
+
# @return [Length] The distance between the two points.
|
148
|
+
#
|
149
|
+
# @see Geom
|
150
|
+
# The Geom module for instructions on how to create a plane.
|
151
|
+
#
|
152
|
+
# @version SketchUp 6.0
|
153
|
+
def distance_to_plane(*args)
|
154
|
+
end
|
155
|
+
|
156
|
+
# The {#dot} method is used to compute the dot product between two vectors.
|
157
|
+
#
|
158
|
+
# @example
|
159
|
+
# vector = Geom::Vector3d.new(12, 12, 0)
|
160
|
+
# array = [12, 0, 0]
|
161
|
+
# # This will return a Float, in this case 144.0
|
162
|
+
# dot_product = array.dot(vector)
|
163
|
+
#
|
164
|
+
# @param [Geom::Vector3d] vector
|
165
|
+
#
|
166
|
+
# @return [Float]
|
167
|
+
#
|
168
|
+
# @version SketchUp 6.0
|
169
|
+
def dot(vector)
|
170
|
+
end
|
171
|
+
|
172
|
+
# The {#normalize} method is used to normalize a vector (setting its
|
173
|
+
# length to 1). It returns a new array rather than changing the original in
|
174
|
+
# place.
|
175
|
+
#
|
176
|
+
# @example
|
177
|
+
# array = [1, 2, 3]
|
178
|
+
# # This will return a new Vector3d
|
179
|
+
# normal_vector = array.normalize
|
180
|
+
#
|
181
|
+
# @note The arguments and return value will be converted to a floating point
|
182
|
+
# value. (Unlike in the {Geom::Vector3d#normalize!} method.)
|
183
|
+
#
|
184
|
+
# @return [Array(Float, Float, Float)] An array object representing a vector
|
185
|
+
#
|
186
|
+
# @version SketchUp 6.0
|
187
|
+
def normalize
|
188
|
+
end
|
189
|
+
|
190
|
+
# The {#normalize!} method is used to normalize a vector in place (setting its
|
191
|
+
# length to 1).
|
192
|
+
#
|
193
|
+
# @example
|
194
|
+
# array = [1, 2, 3]
|
195
|
+
# # This will modify 'array' in place
|
196
|
+
# array.normalize!
|
197
|
+
#
|
198
|
+
# @return [Array]
|
199
|
+
#
|
200
|
+
# @version SketchUp 6.0
|
201
|
+
def normalize!
|
202
|
+
end
|
203
|
+
|
204
|
+
# The {#offset} method is used to offset a point by a vector. it returns a new
|
205
|
+
# array rather than modifying the original in place.
|
206
|
+
#
|
207
|
+
# @example
|
208
|
+
# array = [10, 10, 10]
|
209
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
210
|
+
# # This will return a new Array
|
211
|
+
# point = array.offset(vector)
|
212
|
+
#
|
213
|
+
# @overload offset!(vector)
|
214
|
+
#
|
215
|
+
# @param [Geom::Vector3d] vector A Vector3d object used to offset the point.
|
216
|
+
# @return [Array(Length, Length, Length)] The newly offset point or vector.
|
217
|
+
#
|
218
|
+
# @overload offset!(vector, length)
|
219
|
+
#
|
220
|
+
# @param [Geom::Vector3d] vector A Vector3d object used to offset the point.
|
221
|
+
# @param [Length] length An overriding distance for how far to offset.
|
222
|
+
# @return [Array(Length, Length, Length)] The newly offset point or vector.
|
223
|
+
#
|
224
|
+
# @version SketchUp 6.0
|
225
|
+
def offset(*args)
|
226
|
+
end
|
227
|
+
|
228
|
+
# The {#offset!} method is used to offset a point by a vector. The array is
|
229
|
+
# modified in place.
|
230
|
+
#
|
231
|
+
# @example
|
232
|
+
# array = [10, 10, 10]
|
233
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
234
|
+
# # This will modify 'array' in place
|
235
|
+
# array.offset!(vector)
|
236
|
+
#
|
237
|
+
# @overload offset!(vector)
|
238
|
+
#
|
239
|
+
# @param [Geom::Vector3d] vector A Vector3d object used to offset the point.
|
240
|
+
# @return [Array(Length, Length, Length)] The newly offset array representing
|
241
|
+
# a point or vector.
|
242
|
+
#
|
243
|
+
# @overload offset!(vector, length)
|
244
|
+
#
|
245
|
+
# @param [Geom::Vector3d] vector A Vector3d object used to offset the point.
|
246
|
+
# @param [Length] length An overriding distance for how far to offset.
|
247
|
+
# @return [Array(Length, Length, Length)] The newly offset array representing
|
248
|
+
# a point or vector.
|
249
|
+
#
|
250
|
+
# @version SketchUp 6.0
|
251
|
+
def offset!(*args)
|
252
|
+
end
|
253
|
+
|
254
|
+
# The {#on_line?} method is used to determine if a {Geom::Point3d} object is on
|
255
|
+
# a line.
|
256
|
+
#
|
257
|
+
# @example
|
258
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
259
|
+
# array = [10, 10, 10]
|
260
|
+
# # This will return a true or false value
|
261
|
+
# on_plane = array.on_line?(line)
|
262
|
+
#
|
263
|
+
# @overload on_line?(point1, point2)
|
264
|
+
#
|
265
|
+
# @param [Geom::Point3d] point1
|
266
|
+
# @param [Geom::Point3d] point1
|
267
|
+
# @return [Boolean] +true+ if the point is on the line, +false+ if the
|
268
|
+
# point is not on the line.
|
269
|
+
#
|
270
|
+
# @overload on_line?(point, vector)
|
271
|
+
#
|
272
|
+
# @param [Geom::Point3d] point
|
273
|
+
# @param [Geom::Vector3d] vector
|
274
|
+
# @return [Boolean] +true+ if the point is on the line, +false+ if the
|
275
|
+
# point is not on the line.
|
276
|
+
#
|
277
|
+
# @return [Boolean]
|
278
|
+
#
|
279
|
+
# @see Geom
|
280
|
+
# The Geom module for instructions on how to create a line.
|
281
|
+
#
|
282
|
+
# @version SketchUp 6.0
|
283
|
+
def on_line?(*args)
|
284
|
+
end
|
285
|
+
|
286
|
+
# The {#on_plane?} method is used to determine if a {Geom::Point3d} object is
|
287
|
+
# on a plane (to within SketchUp's standard floating point tolerance).
|
288
|
+
#
|
289
|
+
# @example
|
290
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
291
|
+
# array = [10, 10, 10]
|
292
|
+
# # This will return a true or false value
|
293
|
+
# on_plane = array.on_plane?(plane)
|
294
|
+
#
|
295
|
+
# @overload on_plane?(point1, point2, point3)
|
296
|
+
#
|
297
|
+
# Plane defined by three points.
|
298
|
+
# @note The three points should not be co-linear or duplicate.
|
299
|
+
# @param [Geom::Point3d] point1
|
300
|
+
# @param [Geom::Point3d] point2
|
301
|
+
# @param [Geom::Point3d] point3
|
302
|
+
#
|
303
|
+
# @overload on_plane?(point, vector)
|
304
|
+
#
|
305
|
+
# Plane defined by
|
306
|
+
# @param [Geom::Point3d] point
|
307
|
+
# @param [Geom::Vector3d] vector
|
308
|
+
#
|
309
|
+
# @overload on_plane?(array)
|
310
|
+
#
|
311
|
+
# Plane defined by three points.
|
312
|
+
# @note The three points should not be co-linear or duplicate.
|
313
|
+
# @param [Array<Geom::Point3d, Geom::Vector3d>] point
|
314
|
+
#
|
315
|
+
# @overload on_plane?(float1, float2, float3, float4)
|
316
|
+
#
|
317
|
+
# Plane defined by its coefficents.
|
318
|
+
# @param [Float] float1
|
319
|
+
# @param [Float] float2
|
320
|
+
# @param [Float] float3
|
321
|
+
# @param [Float] float4
|
322
|
+
#
|
323
|
+
# @overload on_plane?(array)
|
324
|
+
#
|
325
|
+
# Plane defined by its coefficents.
|
326
|
+
# @param [Array<Float, Float, Float, Float>] point
|
327
|
+
#
|
328
|
+
# @overload on_plane?(array)
|
329
|
+
#
|
330
|
+
# Plane defined by three points.
|
331
|
+
# @param [Array<Geom::Point3d, Geom::Point3d, Geom::Point3d>] point
|
332
|
+
#
|
333
|
+
# @return [Boolean]
|
334
|
+
#
|
335
|
+
# @see Geom
|
336
|
+
# The Geom module for instructions on how to create a plane.
|
337
|
+
#
|
338
|
+
# @version SketchUp 6.0
|
339
|
+
def on_plane?(*args)
|
340
|
+
end
|
341
|
+
|
342
|
+
# The {#project_to_line} method is used to retrieve the projection of a
|
343
|
+
# {Geom::Point3d} object onto a line.
|
344
|
+
#
|
345
|
+
# @example
|
346
|
+
# line = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
347
|
+
# array = [10, 10, 10]
|
348
|
+
# # This will return a new Array
|
349
|
+
# point_on_line = array.project_to_line(line)
|
350
|
+
#
|
351
|
+
# @overload project_to_line(point1, point2)
|
352
|
+
#
|
353
|
+
# @param [Geom::Point3d] point1
|
354
|
+
# @param [Geom::Point3d] point1
|
355
|
+
# @return [Array(Length, Length, Length)] A new point on the line that is
|
356
|
+
# closest to this point
|
357
|
+
#
|
358
|
+
# @overload project_to_line(point, vector)
|
359
|
+
#
|
360
|
+
# @param [Geom::Point3d] point
|
361
|
+
# @param [Geom::Vector3d] vector
|
362
|
+
# @return [Array(Length, Length, Length)] A new point on the line that is
|
363
|
+
# closest to this point
|
364
|
+
#
|
365
|
+
# @see Geom
|
366
|
+
# The Geom module for instructions on how to create a line.
|
367
|
+
#
|
368
|
+
# @version SketchUp 6.0
|
369
|
+
def project_to_line(*args)
|
370
|
+
end
|
371
|
+
|
372
|
+
# The {#project_to_plane} method retrieves the projection of a {Geom::Point3d}
|
373
|
+
# onto a plane.
|
374
|
+
#
|
375
|
+
# @example
|
376
|
+
# plane = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
|
377
|
+
# array = [10, 10, 10]
|
378
|
+
# point_on_plane = array.project_to_plane(plane)
|
379
|
+
#
|
380
|
+
# @overload project_to_plane(array)
|
381
|
+
#
|
382
|
+
# Plane defined by its coefficents.
|
383
|
+
# @param [Array(Float, Float, Float, Float)] point
|
384
|
+
# @return [Array(Length, Length, Length)]
|
385
|
+
#
|
386
|
+
# @overload project_to_plane(point, vector)
|
387
|
+
#
|
388
|
+
# Plane defined by
|
389
|
+
# @param [Geom::Point3d] point
|
390
|
+
# @param [Geom::Vector3d] vector
|
391
|
+
# @return [Array(Length, Length, Length)]
|
392
|
+
#
|
393
|
+
# @overload project_to_plane(point1, point2, point3)
|
394
|
+
#
|
395
|
+
# Plane defined by three points.
|
396
|
+
# @note The three points should not be co-linear or duplicate.
|
397
|
+
# @param [Geom::Point3d] point1
|
398
|
+
# @param [Geom::Point3d] point2
|
399
|
+
# @param [Geom::Point3d] point3
|
400
|
+
# @return [Array(Length, Length, Length)]
|
401
|
+
#
|
402
|
+
# @overload project_to_plane(array)
|
403
|
+
#
|
404
|
+
# Plane defined by three points.
|
405
|
+
# @param [Array(Geom::Point3d, Geom::Point3d, Geom::Point3d)] point
|
406
|
+
# @return [Array(Length, Length, Length)]
|
407
|
+
#
|
408
|
+
# @overload project_to_plane(array)
|
409
|
+
#
|
410
|
+
# Plane defined by three points.
|
411
|
+
# @note The three points should not be co-linear or duplicate.
|
412
|
+
# @param [Array(Geom::Point3d, Geom::Vector3d)] point
|
413
|
+
# @return [Array(Length, Length, Length)]
|
414
|
+
#
|
415
|
+
# @overload project_to_plane(float1, float2, float3, float4)
|
416
|
+
#
|
417
|
+
# Plane defined by its coefficents.
|
418
|
+
# @param [Float] float1
|
419
|
+
# @param [Float] float2
|
420
|
+
# @param [Float] float3
|
421
|
+
# @param [Float] float4
|
422
|
+
# @return [Array(Length, Length, Length)]
|
423
|
+
#
|
424
|
+
# @see Geom
|
425
|
+
# The Geom module for instructions on how to create a plane.
|
426
|
+
#
|
427
|
+
# @version SketchUp 6.0
|
428
|
+
def project_to_plane(*args)
|
429
|
+
end
|
430
|
+
|
431
|
+
# The {#transform} method is used to apply a {Geom::Transformation} object to a
|
432
|
+
# {Geom::Point3d} object defined by an {Array} object.
|
433
|
+
#
|
434
|
+
# This method returns a new {Array} object instead of modifying the original.
|
435
|
+
#
|
436
|
+
# @example
|
437
|
+
# point1 = Geom::Point3d.new(10, 20, 30)
|
438
|
+
# transform = Geom::Transformation.new(point1)
|
439
|
+
# array = [1, 2, 3]
|
440
|
+
# # This will return a new Array
|
441
|
+
# point2 = array.transform(transform)
|
442
|
+
#
|
443
|
+
# @param [Geom::Transformation] transform
|
444
|
+
#
|
445
|
+
# @return [Array(Length, Length, Length)] The newly transformed point.
|
446
|
+
#
|
447
|
+
# @version SketchUp 6.0
|
448
|
+
def transform(transform)
|
449
|
+
end
|
450
|
+
|
451
|
+
# The {#transform!} method is used to apply a {Geom::Transformation} object to
|
452
|
+
# a {Geom::Point3d} object defined by an {Array} object.
|
453
|
+
#
|
454
|
+
# @example
|
455
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
456
|
+
# transform = Geom::Transformation.new(point)
|
457
|
+
# array = [1, 2, 3]
|
458
|
+
# # This will modify 'array' in place
|
459
|
+
# array.transform!(transform)
|
460
|
+
#
|
461
|
+
# @note This method modifies the original.
|
462
|
+
#
|
463
|
+
# @param [Geom::Transformation] transform
|
464
|
+
#
|
465
|
+
# @return [Array] The newly transformed point.
|
466
|
+
#
|
467
|
+
# @version SketchUp 6.0
|
468
|
+
def transform!(transform)
|
469
|
+
end
|
470
|
+
|
471
|
+
# The {#vector_to} method is used to create an array as a vector from one point
|
472
|
+
# to a second point.
|
473
|
+
#
|
474
|
+
# @example
|
475
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
476
|
+
# array = [1, 2, 3]
|
477
|
+
# # This will return a new Vector3d
|
478
|
+
# vector = array.vector_to(point)
|
479
|
+
#
|
480
|
+
# @param [Geom::Point3d] point
|
481
|
+
#
|
482
|
+
# @return [Geom::Vector3d]
|
483
|
+
#
|
484
|
+
# @version SketchUp 6.0
|
485
|
+
def vector_to(point)
|
486
|
+
end
|
487
|
+
|
488
|
+
# The {#x} method retrieves the x coordinate.
|
489
|
+
#
|
490
|
+
# @example
|
491
|
+
# array = [1, 2, 3]
|
492
|
+
# # This will return a Fixnum, in this case 1
|
493
|
+
# x = array.x
|
494
|
+
#
|
495
|
+
# array = [1.0, 2.0, 3.0]
|
496
|
+
# # This will return a Float, in this case 1.0
|
497
|
+
# x = array.x
|
498
|
+
#
|
499
|
+
# @return [Object, nil] The x coordinate if successful
|
500
|
+
#
|
501
|
+
# @version SketchUp 6.0
|
502
|
+
def x
|
503
|
+
end
|
504
|
+
|
505
|
+
# The {#x=} method sets the x coordinate.
|
506
|
+
#
|
507
|
+
# @example
|
508
|
+
# array = [1, 2, 3]
|
509
|
+
# # This will initialize the x value as a Float
|
510
|
+
# array.x = 2.5
|
511
|
+
# # This will initialize the x value as a Fixnum
|
512
|
+
# array.x = 5
|
513
|
+
#
|
514
|
+
# @param x
|
515
|
+
# The new x position.
|
516
|
+
#
|
517
|
+
# @return The new x coordinate if successful
|
518
|
+
#
|
519
|
+
# @version SketchUp 6.0
|
520
|
+
def x=(x)
|
521
|
+
end
|
522
|
+
|
523
|
+
# The {#y} method retrieves the y coordinate.
|
524
|
+
#
|
525
|
+
# @example
|
526
|
+
# array = [1, 2, 3]
|
527
|
+
# # This will return a Fixnum, in this case 2
|
528
|
+
# y = array.y
|
529
|
+
#
|
530
|
+
# array = [1.0, 2.0, 3.0]
|
531
|
+
# # This will return a Float, in this case 2.0
|
532
|
+
# y = array.y
|
533
|
+
#
|
534
|
+
# @return [Object, nil] The y coordinate if successful
|
535
|
+
#
|
536
|
+
# @version SketchUp 6.0
|
537
|
+
def y
|
538
|
+
end
|
539
|
+
|
540
|
+
# The {#y=} method sets the y coordinate.
|
541
|
+
#
|
542
|
+
# @example
|
543
|
+
# array = [1, 2, 3]
|
544
|
+
# # This will initialize the y value as a Float
|
545
|
+
# array.y = 2.5
|
546
|
+
# # This will initialize the y value as a Fixnum
|
547
|
+
# array.y = 5
|
548
|
+
#
|
549
|
+
# @param y
|
550
|
+
# The new y position.
|
551
|
+
#
|
552
|
+
# @return The new y coordinate if successful
|
553
|
+
#
|
554
|
+
# @version SketchUp 6.0
|
555
|
+
def y=(y)
|
556
|
+
end
|
557
|
+
|
558
|
+
# The {#z} method retrieves the z coordinate.
|
559
|
+
#
|
560
|
+
# @example
|
561
|
+
# array = [1, 2, 3]
|
562
|
+
# # This will return a Fixnum, in this case 3
|
563
|
+
# z = array.z
|
564
|
+
#
|
565
|
+
# array = [1.0, 2.0, 3.0]
|
566
|
+
# # This will return a Float, in this case 3.0
|
567
|
+
# z = array.z
|
568
|
+
#
|
569
|
+
# @return [Object, nil] The z coordinate if successful
|
570
|
+
#
|
571
|
+
# @version SketchUp 6.0
|
572
|
+
def z
|
573
|
+
end
|
574
|
+
|
575
|
+
# The {#z=} method sets the z coordinate.
|
576
|
+
#
|
577
|
+
# @example
|
578
|
+
# array = [1, 2, 3]
|
579
|
+
# # This will initialize the z value as a Float
|
580
|
+
# array.z = 2.5
|
581
|
+
# # This will initialize the z value as a Fixnum
|
582
|
+
# array.z = 5
|
583
|
+
#
|
584
|
+
# @param z
|
585
|
+
# The new z position.
|
586
|
+
#
|
587
|
+
# @return The new z coordinate if successful
|
588
|
+
#
|
589
|
+
# @version SketchUp 6.0
|
590
|
+
def z=(z)
|
591
|
+
end
|
592
|
+
|
593
|
+
end
|