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:



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.

Parameters:

Returns:



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.

Parameters:

Returns:



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:

  • .self.scaling(scale) ⇒ Geom::Transformation

    Uniform scaling about the origin.

    Parameters:

    • scale (Numeric)

      Uniform scaling factor for all three axes

  • .self.scaling(point, scale) ⇒ Geom::Transformation

    Uniform scaling about a given point.

    Parameters:

  • .self.scaling(xscale, yscale, zscale) ⇒ Geom::Transformation

    Non-uniform scaling about the origin.

    Parameters:

    • xscale (Numeric)

      Scaling factor along the x-axis

    • yscale (Numeric)

      Scaling factor along the y-axis

    • zscale (Numeric)

      Scaling factor along the z-axis

  • .self.scaling(xscale, yscale, zscale) ⇒ Geom::Transformation

    Non-uniform scaling about a given point.

    Parameters:

Returns:



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.

Parameters:

Returns:



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

Overloads:

Returns:



56
57
# File 'lib/transformation.rb', line 56

def *(arg)
end

#cloneGeom::Transformation

Creates another transformation identical to the transformation being cloned.

Returns:



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.

Returns:

  • (Boolean)

    true if this transformation is an identity transformation



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.

Returns:

  • (self)


106
107
# File 'lib/transformation.rb', line 106

def invert!
end

#originGeom::Point3d

Retrieves the origin of a transformation.

Returns:



111
112
# File 'lib/transformation.rb', line 111

def origin
end

#set!(transformation) ⇒ self #set!(array) ⇒ self

Sets this transformation to match another one.

Overloads:

  • #set!(transformation) ⇒ self

    Parameters:

  • #set!(array) ⇒ self

    Parameters:

    • array (Array<Numeric>)

      A 16 element array of a transformation matrix in row major ordering.

Returns:

  • (self)


151
152
# File 'lib/transformation.rb', line 151

def set!(transformation)
end

#to_aArray<Float>

Returns an array representation of this transformation.

Returns:

  • (Array<Float>)

    A 16 element array the matrix elements.



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

def to_a
end

#xaxisGeom::Vector3d

Retrieves the x-axis of this transformation.

Returns:



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

def xaxis
end

#yaxisGeom::Vector3d

Retrieves the y-axis of this transformation.

Returns:



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

def yaxis
end

#zaxisGeom::Vector3d

Retrieves the z-axis of this transformation.

Returns:



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

def zaxis
end