Class: Cone
Instance Attribute Summary collapse
-
#bottom_dia ⇒ Object
Returns the value of attribute bottom_dia.
-
#height ⇒ Object
Returns the value of attribute height.
-
#top_dia ⇒ Object
Returns the value of attribute top_dia.
Instance Method Summary collapse
- #bottom_radius ⇒ Object
-
#initialize(height, bottom_dia, top_dia = 0) ⇒ Cone
constructor
A new instance of Cone.
- #top_radius ⇒ Object
Methods inherited from Shape
#*, #+, #-, #align, #back, #bbox, #bottom, #center, #cx, #cy, #cz, #extrude, #front, #left, #maxx, #maxy, #maxz, #minx, #miny, #minz, #mirror, #mirror_x, #mirror_y, #mirror_z, #move, #move_x, #move_y, #move_z, #render, #revolve, #right, #rot_x, #rot_y, #rot_z, #rotate, #scale, #scale_x, #scale_y, #scale_z, #top, #transform, #xcenter, #xsize, #ycenter, #ysize, #zcenter, #zsize, #~@
Constructor Details
#initialize(height, bottom_dia, top_dia = 0) ⇒ Cone
Returns a new instance of Cone.
486 487 488 489 490 |
# File 'lib/rcad.rb', line 486 def initialize(height, bottom_dia, top_dia=0) @height = height @bottom_dia = bottom_dia @top_dia = top_dia end |
Instance Attribute Details
#bottom_dia ⇒ Object
Returns the value of attribute bottom_dia.
484 485 486 |
# File 'lib/rcad.rb', line 484 def bottom_dia @bottom_dia end |
#height ⇒ Object
Returns the value of attribute height.
484 485 486 |
# File 'lib/rcad.rb', line 484 def height @height end |
#top_dia ⇒ Object
Returns the value of attribute top_dia.
484 485 486 |
# File 'lib/rcad.rb', line 484 def top_dia @top_dia end |
Instance Method Details
#bottom_radius ⇒ Object
492 493 494 |
# File 'lib/rcad.rb', line 492 def bottom_radius bottom_dia / 2.0 end |
#top_radius ⇒ Object
496 497 498 |
# File 'lib/rcad.rb', line 496 def top_radius top_dia / 2.0 end |