Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/sketchup-api-stubs/stubs/array.rb
Overview
The SketchUp Array class adds additional methods to the standard Ruby Array class. Specifically, it contains methods allowing an array to behave just as a Geom::Vector3d or Geom::Point3d object (which can be thought of as arrays of 3 coordinate values). Therefore, you can use the Array class in place of a Geom::Point3d or Geom::Vector3d as a way to pass coordinate values.
Instance Method Summary collapse
-
#cross(vector) ⇒ Object
The #cross method is used to compute the cross product between two vectors.
-
#distance(point) ⇒ Object
The #distance method is used to compute the distance between two points.
-
#distance_to_line(*args) ⇒ Object
The #distance_to_line method is used to compute the distance from a Geom::Point3d object to a line.
-
#distance_to_plane(*args) ⇒ Object
The #distance_to_plane method is used to compute the distance from a Geom::Point3d object to a plane.
-
#dot(vector) ⇒ Object
The #dot method is used to compute the dot product between two vectors.
-
#normalize ⇒ Object
The #normalize method is used to normalize a vector (setting its length to 1).
-
#normalize! ⇒ Object
The #normalize! method is used to normalize a vector in place (setting its length to 1).
-
#offset(*args) ⇒ Object
The #offset method is used to offset a point by a vector.
-
#offset!(*args) ⇒ Object
The #offset! method is used to offset a point by a vector.
-
#on_line?(*args) ⇒ Object
The #on_line? method is used to determine if a Geom::Point3d object is on a line.
-
#on_plane?(*args) ⇒ Boolean
The #on_plane? method is used to determine if a Geom::Point3d object is on a plane (to within SketchUp’s standard floating point tolerance).
-
#project_to_line(*args) ⇒ Object
The #project_to_line method is used to retrieve the projection of a Geom::Point3d object onto a line.
-
#project_to_plane(*args) ⇒ Object
The #project_to_plane method retrieves the projection of a Geom::Point3d onto a plane.
-
#transform(transform) ⇒ Object
The #transform method is used to apply a Geom::Transformation or Geom::Transformation2d object to a Geom::Point3d or Geom::Point2d object defined by an Array object.
-
#transform!(transform) ⇒ Object
The #transform! method is used to apply a Geom::Transformation object to a Geom::Point3d object defined by an Array object.
-
#vector_to(point) ⇒ Object
The #vector_to method is used to create an array as a vector from one point to a second point.
-
#x ⇒ Object?
The #x method retrieves the x coordinate.
-
#x=(x) ⇒ Object
The #x= method sets the x coordinate.
-
#y ⇒ Object?
The #y method retrieves the y coordinate.
-
#y=(y) ⇒ Object
The #y= method sets the y coordinate.
-
#z ⇒ Object?
The #z method retrieves the z coordinate.
-
#z=(z) ⇒ Object
The #z= method sets the z coordinate.
Instance Method Details
#cross(vector) ⇒ Geom::Vector3d #cross(vector) ⇒ Geom::Vector2d
The #cross method is used to compute the cross product between two vectors.
66 67 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 66 def cross(vector) end |
#distance(point) ⇒ Length #distance(point) ⇒ Length
The #distance method is used to compute the distance between two points.
98 99 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 98 def distance(point) end |
#distance_to_line(point, vector) ⇒ Length #distance_to_line(point1, point2) ⇒ Length
The #distance_to_line method is used to compute the distance from a Geom::Point3d object to a line.
126 127 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 126 def distance_to_line(*args) end |
#distance_to_plane(point, vector) ⇒ Length #distance_to_plane(point1, point2, point3) ⇒ Length #distance_to_plane(float1, float2, float3, float4) ⇒ Length #distance_to_plane(array) ⇒ Length #distance_to_plane(array) ⇒ Length #distance_to_plane(array) ⇒ Length
The #distance_to_plane method is used to compute the distance from a Geom::Point3d object to a plane.
186 187 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 186 def distance_to_plane(*args) end |
#dot(vector) ⇒ Float #dot(vector) ⇒ Float
The #dot method is used to compute the dot product between two vectors.
216 217 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 216 def dot(vector) end |
#normalize ⇒ Array(Float, Float, Float) #normalize ⇒ Array(Float, Float)
The arguments and return value will be converted to a floating point value. (Unlike in the Geom::Vector3d#normalize! method.)
The #normalize method is used to normalize a vector (setting its length to 1). It returns a new array rather than changing the original in place.
244 245 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 244 def normalize end |
#normalize! ⇒ Array(Float, Float, Float) #normalize! ⇒ Array(Float, Float)
The #normalize! method is used to normalize a vector in place (setting its length to 1).
268 269 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 268 def normalize! end |
#offset(vector) ⇒ Array(Length, Length, Length) #offset(vector) ⇒ Array(Length, Length) #offset(vector, length) ⇒ Array(Length, Length, Length) #offset(vector, length) ⇒ Array(Length, Length)
The #offset method is used to offset a point by a vector. it returns a new array rather than modifying the original in place.
319 320 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 319 def offset(*args) end |
#offset!(vector) ⇒ Array(Length, Length, Length) #offset!(vector) ⇒ Array(Length, Length) #offset!(vector, length) ⇒ Array(Length, Length, Length) #offset!(vector, length) ⇒ Array(Length, Length)
The #offset! method is used to offset a point by a vector. The array is modified in place.
370 371 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 370 def offset!(*args) end |
#on_line?(point, vector) ⇒ Boolean #on_line?(point1, point2) ⇒ Boolean
The #on_line? method is used to determine if a Geom::Point3d object is on a line.
400 401 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 400 def on_line?(*args) end |
#on_plane?(point, vector) ⇒ Boolean #on_plane?(point1, point2, point3) ⇒ Boolean #on_plane?(float1, float2, float3, float4) ⇒ Boolean #on_plane?(array) ⇒ Boolean #on_plane?(array) ⇒ Boolean #on_plane?(array) ⇒ Boolean
The #on_plane? method is used to determine if a Geom::Point3d object is on a plane (to within SketchUp’s standard floating point tolerance).
456 457 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 456 def on_plane?(*args) end |
#project_to_line(point, vector) ⇒ Array(Length, Length, Length) #project_to_line(point1, point2) ⇒ Array(Length, Length, Length)
The #project_to_line method is used to retrieve the projection of a Geom::Point3d object onto a line.
486 487 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 486 def project_to_line(*args) end |
#project_to_plane(point, vector) ⇒ Array(Length, Length, Length) #project_to_plane(point1, point2, point3) ⇒ Array(Length, Length, Length) #project_to_plane(float1, float2, float3, float4) ⇒ Array(Length, Length, Length) #project_to_plane(array) ⇒ Array(Length, Length, Length) #project_to_plane(array) ⇒ Array(Length, Length, Length) #project_to_plane(array) ⇒ Array(Length, Length, Length)
The #project_to_plane method retrieves the projection of a Geom::Point3d onto a plane.
545 546 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 545 def project_to_plane(*args) end |
#transform(transform) ⇒ Array<Length, Length> #transform(transform) ⇒ Array<Length, Length, Length>
The #transform method is used to apply a Geom::Transformation or Geom::Transformation2d object to a Geom::Point3d or Geom::Point2d object defined by an Array object.
This method returns a new Array object instead of modifying the original.
572 573 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 572 def transform(transform) end |
#transform!(transform) ⇒ Array #transform!(transform) ⇒ Array
This method modifies the original.
The #transform! method is used to apply a Geom::Transformation object to a Geom::Point3d object defined by an Array object.
598 599 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 598 def transform!(transform) end |
#vector_to(point) ⇒ Geom::Vector3d #vector_to(point) ⇒ Geom::Vector2d
The #vector_to method is used to create an array as a vector from one point to a second point.
633 634 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 633 def vector_to(point) end |
#x ⇒ Object?
The #x method retrieves the x coordinate.
650 651 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 650 def x end |
#x=(x) ⇒ Object
The #x= method sets the x coordinate.
668 669 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 668 def x=(x) end |
#y ⇒ Object?
The #y method retrieves the y coordinate.
685 686 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 685 def y end |
#y=(y) ⇒ Object
The #y= method sets the y coordinate.
703 704 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 703 def y=(y) end |
#z ⇒ Object?
The #z method retrieves the z coordinate.
720 721 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 720 def z end |
#z=(z) ⇒ Object
The #z= method sets the z coordinate.
738 739 |
# File 'lib/sketchup-api-stubs/stubs/array.rb', line 738 def z=(z) end |