Class: SkippyLib::UVMapping
- Inherits:
-
Object
- Object
- SkippyLib::UVMapping
- Defined in:
- modules/uv/mapping.rb
Overview
Simple structure to make it more readable to build the UV mapping array
for Sketchup::Face#position_material
.
Instance Method Summary collapse
- #add(model_point, uv) ⇒ nil
-
#initialize ⇒ UVMapping
constructor
A new instance of UVMapping.
- #to_a ⇒ Array<Geom::Point3d, UV>
- #to_ary ⇒ Array<Geom::Point3d, UV>
Constructor Details
#initialize ⇒ UVMapping
Returns a new instance of UVMapping.
19 20 21 |
# File 'modules/uv/mapping.rb', line 19 def initialize @mapping = [] end |
Instance Method Details
#add(model_point, uv) ⇒ nil
27 28 29 30 31 |
# File 'modules/uv/mapping.rb', line 27 def add(model_point, uv) @mapping << model_point @mapping << uv nil end |
#to_a ⇒ Array<Geom::Point3d, UV>
35 36 37 |
# File 'modules/uv/mapping.rb', line 35 def to_a @mapping end |
#to_ary ⇒ Array<Geom::Point3d, UV>
41 42 43 44 45 46 |
# File 'modules/uv/mapping.rb', line 41 def to_ary # TODO: Remove this? This object doesn't really behave like an array. # It was added as an attempt to avoid calling .to_a when passing on to # face.position_material. @mapping end |