Class: Geom::Transformation

Inherits:
Object show all
Defined in:
lib/transformation.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTransformation #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.

Overloads:

  • #initializeTransformation

    Creates a new identity transformation.

  • #initialize(point) ⇒ Transformation

    Creates a transformation that translates by the vector from the origin to the given point.

  • #initialize(vector) ⇒ Transformation

    Creates a transformation that translates by the given vector.

  • #initialize(transformation) ⇒ Transformation

    Creates a transformation that is a copy of the given transformation. This is equivalent to #clone.

  • #initialize(array) ⇒ Transformation

    Creates a transformation from a 16 element array that represents a transformation matrix in row major ordering.

  • #initialize(scale) ⇒ Transformation

    Creates a transformation that does uniform scaling.

  • #initialize(origin, zaxis) ⇒ Transformation

    Creates an axis transformation where where xaxis and yaxis are arbitrarily chosen.

  • #initialize(origin, xaxis, yaxis) ⇒ Transformation

    Creates an axis transformation from origin, xaxis and yaxis. The zaxis is set orthogonal to the given axis according to the right-hand rule.

  • #initialize(point, axis, angle) ⇒ Transformation

    Creates a transformation that rotates counter-clockwise about an axis by given angle.

  • #initialize(xaxis, yaxis, zaxis, origin) ⇒ Transformation

    Creates a transformation from 3 axis and an origin.


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

.interpolateGeom::Point3d

Note:

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:

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.

Overloads:


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

#cloneGeom::Transformation

Creates another transformation identical to the transformation being cloned.


70
71
# File 'lib/transformation.rb', line 70

def clone
end

#identity?Boolean

Note:

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

#inverseGeom::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

#originGeom::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_aArray<Float>

Returns an array representation of this transformation.


156
157
# File 'lib/transformation.rb', line 156

def to_a
end

#xaxisGeom::Vector3d

Retrieves the x-axis of this transformation.


167
168
# File 'lib/transformation.rb', line 167

def xaxis
end

#yaxisGeom::Vector3d

Retrieves the y-axis of this transformation.


172
173
# File 'lib/transformation.rb', line 172

def yaxis
end

#zaxisGeom::Vector3d

Retrieves the z-axis of this transformation.


177
178
# File 'lib/transformation.rb', line 177

def zaxis
end