Class: Sphere

Inherits:
Shape show all
Defined in:
lib/rcad.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#diaObject

Returns the value of attribute dia.



517
518
519
# File 'lib/rcad.rb', line 517

def dia
  @dia
end

Instance Method Details

#radiusObject



523
524
525
# File 'lib/rcad.rb', line 523

def radius
  dia / 2.0
end