Class: BaseBoltPart

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

Direct Known Subclasses

Bolt, HexNut

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(bolt_dia) ⇒ BaseBoltPart

Returns a new instance of BaseBoltPart.



9
10
11
# File 'lib/rcad/nuts.rb', line 9

def initialize(bolt_dia)
  @bolt_dia = bolt_dia
end

Instance Attribute Details

#bolt_diaObject

Returns the value of attribute bolt_dia.



7
8
9
# File 'lib/rcad/nuts.rb', line 7

def bolt_dia
  @bolt_dia
end

Instance Method Details

#nut_dia_across_cornersObject



21
22
23
# File 'lib/rcad/nuts.rb', line 21

def nut_dia_across_corners
  nut_dia_across_flats / Math::cos(30.deg_to_rad)
end

#nut_dia_across_flatsObject



17
18
19
# File 'lib/rcad/nuts.rb', line 17

def nut_dia_across_flats
  1.8 * bolt_dia
end

#nut_heightObject



13
14
15
# File 'lib/rcad/nuts.rb', line 13

def nut_height
  0.8 * bolt_dia
end