Class: Cone

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, 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_diaObject

Returns the value of attribute bottom_dia.



484
485
486
# File 'lib/rcad.rb', line 484

def bottom_dia
  @bottom_dia
end

#heightObject

Returns the value of attribute height.



484
485
486
# File 'lib/rcad.rb', line 484

def height
  @height
end

#top_diaObject

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_radiusObject



492
493
494
# File 'lib/rcad.rb', line 492

def bottom_radius
  bottom_dia / 2.0
end

#top_radiusObject



496
497
498
# File 'lib/rcad.rb', line 496

def top_radius
  top_dia / 2.0
end