Class: StructuraidCore::Elements::Footing
- 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
-
#coordinates_system ⇒ Object
readonly
Returns the value of attribute coordinates_system.
-
#cover_bottom ⇒ Object
Returns the value of attribute cover_bottom.
-
#cover_lateral ⇒ Object
Returns the value of attribute cover_lateral.
-
#cover_top ⇒ Object
Returns the value of attribute cover_top.
-
#height ⇒ Object
Returns the value of attribute height.
-
#length_1 ⇒ Object
Returns the value of attribute length_1.
-
#length_2 ⇒ Object
Returns the value of attribute length_2.
-
#longitudinal_bottom_reinforcement_length_1 ⇒ Object
readonly
Returns the value of attribute longitudinal_bottom_reinforcement_length_1.
-
#longitudinal_bottom_reinforcement_length_2 ⇒ Object
readonly
Returns the value of attribute longitudinal_bottom_reinforcement_length_2.
-
#longitudinal_top_reinforcement_length_1 ⇒ Object
readonly
Returns the value of attribute longitudinal_top_reinforcement_length_1.
-
#longitudinal_top_reinforcement_length_2 ⇒ Object
readonly
Returns the value of attribute longitudinal_top_reinforcement_length_2.
-
#material ⇒ Object
Returns the value of attribute material.
Instance Method Summary collapse
-
#add_coordinates_system(coordinates_system) ⇒ Engineering::Locations::CoordinatesSystem
Sets the coordinates system of the footing.
-
#add_vertices_location ⇒ Object
Computes the vertices location of the footing’s perimeter horizontally and adds them to the footing’s coordinates system.
-
#effective_height(section_direction:, above_middle:) ⇒ Float
Computes the effective height of the footing for each direction and for either top or bottom reinforcement.
-
#find_or_add_column_location(column_location, column_label) ⇒ Engineering::Locations::Relative
Adds a column’s location to the footing.
-
#horizontal_area ⇒ Float
Computes the horizontal area of the footing.
-
#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
constructor
The footing.
-
#inside_me?(location) ⇒ Boolean
Evaluates if a relative location is inside the footing’s perimeter.
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.
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_system ⇒ Object (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_bottom ⇒ Object
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_lateral ⇒ Object
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_top ⇒ Object
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 |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/structuraid_core/elements/footing.rb', line 5 def height @height end |
#length_1 ⇒ Object
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_2 ⇒ Object
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_1 ⇒ Object (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_2 ⇒ Object (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_1 ⇒ Object (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_2 ⇒ Object (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 |
#material ⇒ Object
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
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_location ⇒ Object
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
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.
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_area ⇒ Float
Computes 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)
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 |