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

#*, #+, #-, #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(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