Class: Sphere

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Shape

#*, #+, #-, #bbox, #extrude, #max_x, #max_y, #max_z, #min_x, #min_y, #min_z, #mirror_x, #mirror_y, #mirror_z, #move_x, #move_y, #move_z, #render, #revolve, #rot_x, #rot_y, #rot_z, #scale_x, #scale_y, #scale_z, #x_size, #y_size, #z_size, #~@

Constructor Details

#initialize(dia) ⇒ Sphere

Returns a new instance of Sphere.



307
308
309
# File 'lib/rcad.rb', line 307

def initialize(dia)
  @dia = dia
end

Instance Attribute Details

#diaObject

Returns the value of attribute dia.



305
306
307
# File 'lib/rcad.rb', line 305

def dia
  @dia
end

Instance Method Details

#radiusObject



311
312
313
# File 'lib/rcad.rb', line 311

def radius
  dia / 2.0
end