|
SketchUp Ruby API Reference |
The UV Helper class contains methods allowing you to determine the location (UV coordinates) of a texture on a face. This class is particularly useful in determining how textures that have been manipulated using the Texture Tweaker should appear when exported to another file type.
Parent: Object
Methods: get_front_UVQ, get_back_UVQ
Example Code: TextureWriter.rb
The get_front_UVQ method is used to get the UV coordinates for a front of a face.
point = uvhelper.get_front_UVQ point
point - a Point3D object containing one of the 3D vertexes of the face.
point - a Point3D containing the UV coordinates where the X value is the U value, the Y value is the V value and the Z value is a Q value (which is not used).
ent.outer_loop.vertices.each do |vert|
uvq = uvHelp.get_front_UVQ(vert.position)
puts "u=" + uvq.x.to_s + " v=" + uvq.y.to_s
The get_back_UVQ method is used to get the UV coordinates for a back of a face.
point = uvhelper.get_back_UVQ point
point - a Point3D object containing one of the 3D vertexes of the face.
point - a Point3D containing the UV coordinates where the X value is the U value, the Y value is the V value and the Z value is a Q value (which is not used).
ent.outer_loop.vertices.each do |vert|
uvq = uvHelp.get_back_UVQ(vert.position)
puts "u=" + uvq.x.to_s + " v=" + uvq.y.to_s
|
SketchUp Ruby API Reference: UVHelper |
© Google Inc. 2007 sketchup.google.com |