Class: Sphere
Instance Attribute Summary collapse
-
#dia ⇒ Object
Returns the value of attribute dia.
Instance Method Summary collapse
-
#initialize(dia) ⇒ Sphere
constructor
A new instance of Sphere.
- #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(dia) ⇒ Sphere
Returns a new instance of Sphere.
519 520 521 |
# File 'lib/rcad.rb', line 519 def initialize(dia) @dia = dia end |
Instance Attribute Details
#dia ⇒ Object
Returns the value of attribute dia.
517 518 519 |
# File 'lib/rcad.rb', line 517 def dia @dia end |
Instance Method Details
#radius ⇒ Object
523 524 525 |
# File 'lib/rcad.rb', line 523 def radius dia / 2.0 end |