Class: CrystalCell::Povray::Cylinder
- Inherits:
-
Mageo::Cylinder
- Object
- Mageo::Cylinder
- CrystalCell::Povray::Cylinder
- Defined in:
- lib/crystalcell/povray/cylinder.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#positions ⇒ Object
readonly
Returns the value of attribute positions.
Instance Method Summary collapse
- #dump(io) ⇒ Object
-
#initialize(position0, position1, radius, color) ⇒ Cylinder
constructor
A new instance of Cylinder.
-
#to_pov ⇒ Object
povray 形式の文字列を返す。 color は Float による配列。通常、0〜1の範囲。.
Constructor Details
#initialize(position0, position1, radius, color) ⇒ Cylinder
Returns a new instance of Cylinder.
6 7 8 9 |
# File 'lib/crystalcell/povray/cylinder.rb', line 6 def initialize(position0, position1, radius, color) super(position0, position1, radius) @color = color end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
4 5 6 |
# File 'lib/crystalcell/povray/cylinder.rb', line 4 def color @color end |
#positions ⇒ Object (readonly)
Returns the value of attribute positions.
4 5 6 |
# File 'lib/crystalcell/povray/cylinder.rb', line 4 def positions @positions end |
Instance Method Details
#dump(io) ⇒ Object
19 20 21 |
# File 'lib/crystalcell/povray/cylinder.rb', line 19 def dump(io) io.puts self.to_pov end |
#to_pov ⇒ Object
povray 形式の文字列を返す。color は Float による配列。通常、0〜1の範囲。
13 14 15 16 17 |
# File 'lib/crystalcell/povray/cylinder.rb', line 13 def to_pov 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> } }", *positions[0], *positions[1], radius, *color) #*@positions[0], *@positions[1], radius, @color) end |