Class: Cylinder

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(height, dia) ⇒ Cylinder

Returns a new instance of Cylinder.



505
506
507
508
# File 'lib/rcad.rb', line 505

def initialize(height, dia)
  @height = height
  @dia = dia
end

Instance Attribute Details

#diaObject

Returns the value of attribute dia.



503
504
505
# File 'lib/rcad.rb', line 503

def dia
  @dia
end

#heightObject

Returns the value of attribute height.



503
504
505
# File 'lib/rcad.rb', line 503

def height
  @height
end

Instance Method Details

#radiusObject



510
511
512
# File 'lib/rcad.rb', line 510

def radius
  dia / 2.0
end