Class: Torus

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(inner_dia, outer_dia, angle = nil) ⇒ Torus

Returns a new instance of Torus.



542
543
544
545
546
# File 'lib/rcad.rb', line 542

def initialize(inner_dia, outer_dia, angle=nil)
  @inner_dia = inner_dia
  @outer_dia = outer_dia
  @angle = angle
end

Instance Attribute Details

#angleObject

Returns the value of attribute angle.



540
541
542
# File 'lib/rcad.rb', line 540

def angle
  @angle
end

#inner_diaObject

Returns the value of attribute inner_dia.



540
541
542
# File 'lib/rcad.rb', line 540

def inner_dia
  @inner_dia
end

#outer_diaObject

Returns the value of attribute outer_dia.



540
541
542
# File 'lib/rcad.rb', line 540

def outer_dia
  @outer_dia
end

Instance Method Details

#inner_radiusObject



548
549
550
# File 'lib/rcad.rb', line 548

def inner_radius
  inner_dia / 2.0
end

#outer_radiusObject



552
553
554
# File 'lib/rcad.rb', line 552

def outer_radius
  outer_dia / 2.0
end