Class: Torus

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

Returns a new instance of Torus.



318
319
320
321
322
# File 'lib/rcad.rb', line 318

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.



316
317
318
# File 'lib/rcad.rb', line 316

def angle
  @angle
end

#inner_diaObject

Returns the value of attribute inner_dia.



316
317
318
# File 'lib/rcad.rb', line 316

def inner_dia
  @inner_dia
end

#outer_diaObject

Returns the value of attribute outer_dia.



316
317
318
# File 'lib/rcad.rb', line 316

def outer_dia
  @outer_dia
end

Instance Method Details

#inner_radiusObject



324
325
326
# File 'lib/rcad.rb', line 324

def inner_radius
  inner_dia / 2.0
end

#outer_radiusObject



328
329
330
# File 'lib/rcad.rb', line 328

def outer_radius
  outer_dia / 2.0
end