Class: SkippyLib::UV
- Inherits:
-
Geom::Point3d
- Object
- Geom::Point3d
- SkippyLib::UV
- Defined in:
- modules/uv.rb
Overview
Alias to make code more readable.
The SketchUp Ruby API deal with Geom::Point3d
objects when it comes to
UV mapping. But this can make it hard to read the intent of the code when
everything is a Geom::Point3d
.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(x, y) ⇒ UV
constructor
A new instance of UV.
-
#inspect ⇒ Object
return [String].
-
#to_s ⇒ Object
return [String].
- #to_uvq ⇒ UVQ
Constructor Details
#initialize(x, y) ⇒ UV
Returns a new instance of UV.
23 24 25 |
# File 'modules/uv.rb', line 23 def initialize(x, y) super(x, y, 1.0) end |
Class Method Details
.from_uvq(uvq) ⇒ Object
16 17 18 |
# File 'modules/uv.rb', line 16 def self.from_uvq(uvq) self.new(uvq.x / uvq.z, uvq.y / uvq.z) end |
Instance Method Details
#inspect ⇒ Object
return [String]
50 51 52 |
# File 'modules/uv.rb', line 50 def inspect "#{self.class.name}(#{x.to_f}, #{y.to_f}, #{z.to_f})" end |
#to_s ⇒ Object
return [String]
44 45 46 |
# File 'modules/uv.rb', line 44 def to_s "#{self.class.name.split('::').last}(#{x.to_f}, #{y.to_f})" end |