是否可以在SketchUp Ruby API中了解纹理方向?

时间:2014-07-08 07:58:16

标签: ruby sketchup

我已经为草图编写了一些插件。我想知道是否可以在Ruby中以编程方式知道纹理方向(垂直或水平)。

我使用这个face.getUVHelper来提取面部纹理的位置,这给出了U和V点。这些U和V点究竟代表什么?我怎样才能在我的代码中使用它们来获得这个位置?

代码如下:

face = Sketchup.active_model.selection[0];

tw = Sketchup.create_texture_writer

uv_helper = face.get_UVHelper true, true, tw

face.outer_loop.vertices.each do |vert|

  uvq = uv_helper.get_back_UVQ(vert.position)

  puts "u=" + uvq.x.to_s + " v=" + uvq.y.to_s

end;

0 个答案:

没有答案