Class: Geom::Transformation2d

Inherits:
Object
  • Object
show all
Defined in:
SketchUp/Geom/Transformation2d.rb

Overview

Version:

  • LayOut 2018

Instance Method Summary collapse

Constructor Details

#initializeGeom::Transformation2d #initialize(array) ⇒ Geom::Transformation2d #initialize(transformation) ⇒ Geom::Transformation2d

The #initialize method creates a new Geom::Transformation2d. You can use this method or one of the more specific methods for creating specific kinds of Geom::Transformation2d.

Examples:

tr = Geom::Transformation2d.new({1.0, 0.0, 0.0, 1.0, 1.0, 1.0})

Overloads:

Version:

  • LayOut 2018



87
88
# File 'SketchUp/Geom/Transformation2d.rb', line 87

def initialize(*args)
end

Instance Method Details

#==(other) ⇒ Boolean

The #== method checks to see if the two Geom::Transformation2ds are equal. This checks whether the values of the transformations are the same.

Examples:

tr = Geom::Transformation2d.new({1.0, 0.0, 0.0, 1.0, 1.0, 1.0})
tr == tr.clone

Parameters:

Returns:

  • (Boolean)

Version:

  • LayOut 2018



22
23
# File 'SketchUp/Geom/Transformation2d.rb', line 22

def ==(other)
end

#cloneGeom::Transformation2d

The #clone method creates a copy of the Geom::Transformation2d.

Examples:

tr1 = Geom::Transformation2d.new
tr2 = tr1.clone

Returns:

Version:

  • LayOut 2018



34
35
# File 'SketchUp/Geom/Transformation2d.rb', line 34

def clone
end

#identity?Boolean

The #identity? method determines if the Geom::Transformation2d is the IDENTITY_2D transform.

Examples:

tr = Geom::Transformation2d.new
# Returns true.
status = tr.identity?
# Returns true.
status = IDENTITY.identity?
array = {1.0, 0.0, 0.0, 1.0, 1.0, 0.0}
tr = Geom::Transformation2d.new(array)
# Returns false.
status = tr.identity?

Returns:

  • (Boolean)

    true if the transform is the identity

  • (Boolean)

Version:

  • LayOut 2018



60
61
# File 'SketchUp/Geom/Transformation2d.rb', line 60

def identity?
end

#set!(transformation) ⇒ Geom::Transformation2d #set!(matrix) ⇒ Geom::Transformation2d

The #set! method sets the Geom::Transformation2d to match another one. The argument is anything that can be converted into a Geom::Transformation2d.

Examples:

tr1 = Geom::Transformation2d.new
array = {2.0, 0.0, 0.0, 2.0, 0.0, 0.0}
tr1.set!(array)

Overloads:

Version:

  • LayOut 2018



109
110
# File 'SketchUp/Geom/Transformation2d.rb', line 109

def set!(arg)
end

#to_aArray<Float>

The #to_a method returns a 6 element array which contains the values that define the Transformation2d.

Examples:

tr = Geom::Transformation2d.new
tr.to_a.each_slice(2) {|a| p a}

Returns:

  • (Array<Float>)

    an array of 6 elements

Version:

  • LayOut 2018



122
123
# File 'SketchUp/Geom/Transformation2d.rb', line 122

def to_a
end