lib/crystalcell/povray/triangle.rb in crystalcell-0.1.0 vs lib/crystalcell/povray/triangle.rb in crystalcell-0.1.1
- old
+ new
@@ -11,19 +11,16 @@
end
# povray 形式の文字列を返す。
# color は Float による配列。通常、0〜1の範囲。
def to_pov
- v = self.vertices
- result = sprintf("triangle{<%f,%f,%f>,<%f,%f,%f>,<%f,%f,%f>",
+ #v = self.vertices
+ #sprintf( "object { cylinder{ <% 7.4f, % 7.4f, % 7.4f>, <% 7.4f, % 7.4f, % 7.4f>, %7.4f } pigment { color rgb <%4.2f, %4.2f, %4.2f> } }",
+ result = sprintf("triangle{ < % 7.4f, % 7.4f, % 7.4f>,<% 7.4f,% 7.4f,% 7.4f>,<% 7.4f,% 7.4f,% 7.4f>",
*@vertices[0], *@vertices[1], *@vertices[2])
- result += sprintf(" pigment {color rgb<%f,%f,%f>", *@color)
- result += sprintf(" transmit %f", @transmit) if @transmit
+ result += sprintf(" pigment {color rgb<% 7.4f,% 7.4f,% 7.4f>", *@color)
+ result += sprintf(" transmit % 7.4f", @transmit) if @transmit
result += "}}"
- #result = sprintf("triangle{<%f,%f,%f>,<%f,%f,%f>,<%f,%f,%f> " +
- # "pigment {color rgb<%f,%f,%f>}}",
- # *@vertices[0], *@vertices[1], *@vertices[2], *@color)
- #
return result
end
def dump(io)
io.puts self.to_pov