Class: Geom::Transformation
Class Method Summary collapse
-
.axes(origin, xaxis, yaxis, zaxis) ⇒ Geom::Transformation
Creates a transformation from 3 axis and an origin.
-
.interpolate ⇒ Geom::Point3d
Create a new transformation that is the result of interpolating between two other transformations.
-
.rotation(point, vector, angle) ⇒ Geom::Transformation
Creates a new transformation that does a counter-clockwise rotation about an axis by given angle.
-
.scaling ⇒ Geom::Transformation
Creates a new transformation that does a scaling.
-
.translation(vector) ⇒ Geom::Transformation
Creates a new transformation that translates by the given vector.
Instance Method Summary collapse
-
#*(arg) ⇒ Geom::Transformation
Matrix multiplication.
-
#clone ⇒ Geom::Transformation
Creates another transformation identical to the transformation being cloned.
-
#identity? ⇒ Boolean
Determines if this transformation is an identity transformation, that means that applying it to a geometry won't modify it.
-
#initialize(*args) ⇒ Transformation
constructor
Creates a new transformation object.
-
#inverse ⇒ Geom::Transformation
Creates a new transformation that is the inverse of this transformation.
-
#invert! ⇒ self
Modifies this transformation to its inverse.
-
#origin ⇒ Geom::Point3d
Retrieves the origin of a transformation.
-
#set!(transformation) ⇒ self
Sets this transformation to match another one.
-
#to_a ⇒ Array<Float>
Returns an array representation of this transformation.
-
#xaxis ⇒ Geom::Vector3d
Retrieves the x-axis of this transformation.
-
#yaxis ⇒ Geom::Vector3d
Retrieves the y-axis of this transformation.
-
#zaxis ⇒ Geom::Vector3d
Retrieves the z-axis of this transformation.
Constructor Details
#initialize ⇒ Transformation #initialize(point) ⇒ Transformation #initialize(vector) ⇒ Transformation #initialize(transformation) ⇒ Transformation #initialize(array) ⇒ Transformation #initialize(scale) ⇒ Transformation #initialize(origin, zaxis) ⇒ Transformation #initialize(origin, xaxis, yaxis) ⇒ Transformation #initialize(point, axis, angle) ⇒ Transformation #initialize(xaxis, yaxis, zaxis, origin) ⇒ Transformation
Creates a new transformation object.
45 46 |
# File 'lib/transformation.rb', line 45 def initialize(*args) end |
Class Method Details
.axes(origin, xaxis, yaxis, zaxis) ⇒ Geom::Transformation
Creates a transformation from 3 axis and an origin.
65 66 |
# File 'lib/transformation.rb', line 65 def self.axes(origin, xaxis, yaxis, zaxis) end |
.interpolate ⇒ Geom::Point3d
This method fails to interpolate if a uniform scaling is not realized by the three diagonal matrix elements but by the last matrix element. In that case, it would return the first transformation for parameter 0 and
Note transformation matrices are not suited for interpolating rotations: An rotation by 180 would "squeeze" the transformed object through the rotation axis and then expand to the final state instead of rotating either left way or right way.
Create a new transformation that is the result of interpolating between two other transformations. Creates a new point as a linear combination of two points. This method is generally used to get a point at some percentage along a line connecting the two points. The weights should sum up to 1 if you want to get a on that line. The weights should be between 0 and 1 if you want to get a point between the two points. otherwise the second transformation.
96 97 |
# File 'lib/transformation.rb', line 96 def self.interpolate end |
.rotation(point, vector, angle) ⇒ Geom::Transformation
Creates a new transformation that does a counter-clockwise rotation about an axis by given angle.
119 120 |
# File 'lib/transformation.rb', line 119 def self.rotation(point, vector, angle) end |
.self.scaling(scale) ⇒ Geom::Transformation .self.scaling(point, scale) ⇒ Geom::Transformation .self.scaling(xscale, yscale, zscale) ⇒ Geom::Transformation .self.scaling(xscale, yscale, zscale) ⇒ Geom::Transformation
Creates a new transformation that does a scaling.
142 143 |
# File 'lib/transformation.rb', line 142 def self.scaling end |
.translation(vector) ⇒ Geom::Transformation
Creates a new transformation that translates by the given vector.
162 163 |
# File 'lib/transformation.rb', line 162 def self.translation(vector) end |
Instance Method Details
#*(point) ⇒ Geom::Transformation #*(vector) ⇒ Geom::Transformation #*(transformation) ⇒ Geom::Transformation
Matrix multiplication
56 57 |
# File 'lib/transformation.rb', line 56 def *(arg) end |
#clone ⇒ Geom::Transformation
Creates another transformation identical to the transformation being cloned.
70 71 |
# File 'lib/transformation.rb', line 70 def clone end |
#identity? ⇒ Boolean
There is an issue that this method returns only true for transformations initialized as identity, either with Transformation.new or from the constant Geom::Transformation::Identity
Determines if this transformation is an identity transformation, that means that applying it to a geometry won't modify it.
78 79 |
# File 'lib/transformation.rb', line 78 def identity? end |
#inverse ⇒ Geom::Transformation
Creates a new transformation that is the inverse of this transformation.
101 102 |
# File 'lib/transformation.rb', line 101 def inverse end |
#invert! ⇒ self
Modifies this transformation to its inverse.
106 107 |
# File 'lib/transformation.rb', line 106 def invert! end |
#origin ⇒ Geom::Point3d
Retrieves the origin of a transformation.
111 112 |
# File 'lib/transformation.rb', line 111 def origin end |
#set!(transformation) ⇒ self #set!(array) ⇒ self
Sets this transformation to match another one.
151 152 |
# File 'lib/transformation.rb', line 151 def set!(transformation) end |
#to_a ⇒ Array<Float>
Returns an array representation of this transformation.
156 157 |
# File 'lib/transformation.rb', line 156 def to_a end |
#xaxis ⇒ Geom::Vector3d
Retrieves the x-axis of this transformation.
167 168 |
# File 'lib/transformation.rb', line 167 def xaxis end |
#yaxis ⇒ Geom::Vector3d
Retrieves the y-axis of this transformation.
172 173 |
# File 'lib/transformation.rb', line 172 def yaxis end |
#zaxis ⇒ Geom::Vector3d
Retrieves the z-axis of this transformation.
177 178 |
# File 'lib/transformation.rb', line 177 def zaxis end |