Class: StructuraidCore::Elements::Footing

Inherits:
Base
  • Object
show all
Defined in:
lib/structuraid_core/elements/footing.rb

Overview

A footing is a structural element that transfers load from a column to the soil.

Constant Summary collapse

VALID_SECTIONS =
%i[length_1 length_2].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(length_1:, length_2:, height:, material:, cover_lateral:, cover_top:, cover_bottom:, longitudinal_top_reinforcement_length_1: nil, longitudinal_bottom_reinforcement_length_1: nil, longitudinal_top_reinforcement_length_2: nil, longitudinal_bottom_reinforcement_length_2: nil) ⇒ Footing

Returns the footing.

Parameters:

  • length_1 (Float)

    The length of the footing in the direction of the main section

  • length_2 (Float)

    The length of the footing in the direction perpendicular to the main section

  • height (Float)

    The height of the footing

  • material (Materials::Concrete)

    The material of the footing. It must be concrete

  • cover_lateral (Float)

    The lateral cover of the footing

  • cover_top (Float)

    The top cover of the footing

  • cover_bottom (Float)

    The bottom cover of the footing

  • longitudinal_top_reinforcement_length_1 (Reinforcement::StraightLongitudinal) (defaults to: nil)

    The longitudinal reinforcement in the direction of the main section

  • longitudinal_bottom_reinforcement_length_1 (Reinforcement::StraightLongitudinal) (defaults to: nil)

    The longitudinal reinforcement in the direction of the main section

  • longitudinal_top_reinforcement_length_2 (Reinforcement::StraightLongitudinal) (defaults to: nil)

    The longitudinal reinforcement in the direction perpendicular to the main section

  • longitudinal_bottom_reinforcement_length_2 (Reinforcement::StraightLongitudinal) (defaults to: nil)

    The longitudinal reinforcement in the direction perpendicular to the main section



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/structuraid_core/elements/footing.rb', line 27

def initialize(
  length_1:,
  length_2:,
  height:,
  material:,
  cover_lateral:,
  cover_top:,
  cover_bottom:,
  longitudinal_top_reinforcement_length_1: nil,
  longitudinal_bottom_reinforcement_length_1: nil,
  longitudinal_top_reinforcement_length_2: nil,
  longitudinal_bottom_reinforcement_length_2: nil
)
  @length_1 = length_1.to_f
  @length_2 = length_2.to_f
  @height = height.to_f
  @material = material
  @cover_lateral = cover_lateral.to_f
  @cover_top = cover_top.to_f
  @cover_bottom = cover_bottom.to_f
  @longitudinal_top_reinforcement_length_1 = longitudinal_top_reinforcement_length_1
  @longitudinal_bottom_reinforcement_length_1 = longitudinal_bottom_reinforcement_length_1
  @longitudinal_top_reinforcement_length_2 = longitudinal_top_reinforcement_length_2
  @longitudinal_bottom_reinforcement_length_2 = longitudinal_bottom_reinforcement_length_2
  @main_section = :length_1
end

Instance Attribute Details

#coordinates_systemObject (readonly)

Returns the value of attribute coordinates_system.



6
7
8
# File 'lib/structuraid_core/elements/footing.rb', line 6

def coordinates_system
  @coordinates_system
end

#cover_bottomObject

Returns the value of attribute cover_bottom.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def cover_bottom
  @cover_bottom
end

#cover_lateralObject

Returns the value of attribute cover_lateral.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def cover_lateral
  @cover_lateral
end

#cover_topObject

Returns the value of attribute cover_top.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def cover_top
  @cover_top
end

#heightObject

Returns the value of attribute height.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def height
  @height
end

#length_1Object

Returns the value of attribute length_1.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def length_1
  @length_1
end

#length_2Object

Returns the value of attribute length_2.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def length_2
  @length_2
end

#longitudinal_bottom_reinforcement_length_1Object (readonly)

Returns the value of attribute longitudinal_bottom_reinforcement_length_1.



6
7
8
# File 'lib/structuraid_core/elements/footing.rb', line 6

def longitudinal_bottom_reinforcement_length_1
  @longitudinal_bottom_reinforcement_length_1
end

#longitudinal_bottom_reinforcement_length_2Object (readonly)

Returns the value of attribute longitudinal_bottom_reinforcement_length_2.



6
7
8
# File 'lib/structuraid_core/elements/footing.rb', line 6

def longitudinal_bottom_reinforcement_length_2
  @longitudinal_bottom_reinforcement_length_2
end

#longitudinal_top_reinforcement_length_1Object (readonly)

Returns the value of attribute longitudinal_top_reinforcement_length_1.



6
7
8
# File 'lib/structuraid_core/elements/footing.rb', line 6

def longitudinal_top_reinforcement_length_1
  @longitudinal_top_reinforcement_length_1
end

#longitudinal_top_reinforcement_length_2Object (readonly)

Returns the value of attribute longitudinal_top_reinforcement_length_2.



6
7
8
# File 'lib/structuraid_core/elements/footing.rb', line 6

def longitudinal_top_reinforcement_length_2
  @longitudinal_top_reinforcement_length_2
end

#materialObject

Returns the value of attribute material.



5
6
7
# File 'lib/structuraid_core/elements/footing.rb', line 5

def material
  @material
end

Instance Method Details

#add_coordinates_system(coordinates_system) ⇒ Engineering::Locations::CoordinatesSystem

Sets the coordinates system of the footing

Parameters:

Returns:



76
77
78
# File 'lib/structuraid_core/elements/footing.rb', line 76

def add_coordinates_system(coordinates_system)
  @coordinates_system = coordinates_system
end

#add_vertices_locationObject

Computes the vertices location of the footing’s perimeter horizontally and adds them to the footing’s coordinates system



91
92
93
94
95
# File 'lib/structuraid_core/elements/footing.rb', line 91

def add_vertices_location
  vertices_locations_vectors.each do |label, vector|
    coordinates_system.find_or_add_location_from_vector(vector, label:)
  end
end

#effective_height(section_direction:, above_middle:) ⇒ Float

Computes the effective height of the footing for each direction and for either top or bottom reinforcement

Parameters:

  • section_direction (Symbol)

    The direction of the section. See VALID_SECTIONS

  • above_middle (Boolean)

    Whether the reinforcement is above the middle of the footing

Returns:

  • (Float)

    The effective height of the footing



64
65
66
67
68
69
70
71
# File 'lib/structuraid_core/elements/footing.rb', line 64

def effective_height(section_direction:, above_middle:)
  case section_direction
  when :length_1
    length_1_section_effective_area(above_middle:)
  when :length_2
    length_2_section_effective_area(above_middle:)
  end
end

#find_or_add_column_location(column_location, column_label) ⇒ Engineering::Locations::Relative

Adds a column’s location to the footing. If the column’s location is already in the footing’s coordinates system, it returns the existing location.

Parameters:

Returns:



84
85
86
87
88
# File 'lib/structuraid_core/elements/footing.rb', line 84

def find_or_add_column_location(column_location, column_label)
  label = "column_#{column_label}"
  relative_location_vector = column_location.to_vector - coordinates_system.anchor_location.to_vector
  coordinates_system.find_or_add_location_from_vector(relative_location_vector, label:)
end

#horizontal_areaFloat

Computes the horizontal area of the footing

Returns:

  • (Float)

    The horizontal area of the footing



56
57
58
# File 'lib/structuraid_core/elements/footing.rb', line 56

def horizontal_area
  length_1 * length_2
end

#inside_me?(location) ⇒ Boolean

Evaluates if a relative location is inside the footing’s perimeter. It works only for horizontal locations (z = 0)

Parameters:

Returns:

  • (Boolean)

    Whether the location is inside the footing’s perimeter



100
101
102
103
104
105
# File 'lib/structuraid_core/elements/footing.rb', line 100

def inside_me?(location)
  inside_axis_2 = location.value_2 >= -0.5 * length_2 && location.value_2 <= 0.5 * length_2
  inside_axis_1 = location.value_1 >= -0.5 * length_1 && location.value_1 <= 0.5 * length_1

  inside_axis_1 && inside_axis_2
end