structuraid_core 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39b0943343ece08b91c2884a16e133ad77e663c71c8416db4d65248a20871b67
4
- data.tar.gz: e9ead6c46af568fd4f7d7fda9cfdd73996f93cff85afdf602161b01caef091f7
3
+ metadata.gz: 52e1d580435e0d2bf0733e1fad89ee3b9dca50cc06c2b2ab7690506ca07b645c
4
+ data.tar.gz: aca94e0d33c988f93d3426046ae85b7d5a806334fd5cb96d8d429911cadbb402
5
5
  SHA512:
6
- metadata.gz: b48678b5b1131cf438cfaf5db1d8c2dac8ba1dc89c2d8ee77f580b7c1386f64c7081fbdd1980c7ea6d8373e93fccb7b414bc4555a1ce4c64461e83e1fd40f780
7
- data.tar.gz: d986996199861f01fa6d495bf13b87119d0039d9b23146e545da8e063aab47c8b6ef199a3c232e80a569f0350aec37dcfad856557217830b13a0abdac162ade2
6
+ metadata.gz: fc35e87f4b023db340e437b4f62a22d5e9fcc892eb0587eda56252775a487bd4e87eb5f4089ef935eee85caf9b02eadfd4d192f1da01c50758331557b77c87c4
7
+ data.tar.gz: 94d89ced412800fc53fca63ae363dd0475e68b7371979ec6616e7dbbf8b4c98c97abda27882b5b6cba060904feaf425be7d6e9cba862e98a8df990ced372e7b5
data/.rubocop.yml CHANGED
@@ -7,9 +7,6 @@ AllCops:
7
7
  Style/FrozenStringLiteralComment:
8
8
  Enabled: false
9
9
 
10
- convention:Style/Documentation:
11
- Enabled: false
12
-
13
10
  Style/OptionalBooleanParameter:
14
11
  Enabled: false
15
12
 
@@ -36,3 +33,7 @@ Metrics/ParameterLists:
36
33
 
37
34
  Style/IfUnlessModifier:
38
35
  Enabled: false
36
+
37
+ Layout/LineLength:
38
+ AllowedPatterns: ['\A\s*#'] # Ignore rule for comments
39
+
@@ -1,5 +1,6 @@
1
1
  module StructuraidCore
2
2
  module Elements
3
+ # A footing is a structural element that transfers load from a column to the soil.
3
4
  class Footing < Base
4
5
  attr_accessor :length_1, :length_2, :height, :material, :cover_lateral, :cover_top, :cover_bottom
5
6
  attr_reader :longitudinal_top_reinforcement_length_1,
@@ -10,6 +11,19 @@ module StructuraidCore
10
11
 
11
12
  VALID_SECTIONS = %i[length_1 length_2].freeze
12
13
 
14
+ # @param length_1 [Float] The length of the footing in the direction of the main section
15
+ # @param length_2 [Float] The length of the footing in the direction perpendicular to the main section
16
+ # @param height [Float] The height of the footing
17
+ # @param material [Materials::Concrete] The material of the footing. It must be concrete
18
+ # @param cover_lateral [Float] The lateral cover of the footing
19
+ # @param cover_top [Float] The top cover of the footing
20
+ # @param cover_bottom [Float] The bottom cover of the footing
21
+ # @param longitudinal_top_reinforcement_length_1 [Reinforcement::StraightLongitudinal] The longitudinal reinforcement in the direction of the main section
22
+ # @param longitudinal_bottom_reinforcement_length_1 [Reinforcement::StraightLongitudinal] The longitudinal reinforcement in the direction of the main section
23
+ # @param longitudinal_top_reinforcement_length_2 [Reinforcement::StraightLongitudinal] The longitudinal reinforcement in the direction perpendicular to the main section
24
+ # @param longitudinal_bottom_reinforcement_length_2 [Reinforcement::StraightLongitudinal] The longitudinal reinforcement in the direction perpendicular to the main section
25
+ #
26
+ # @return [Footing] the footing
13
27
  def initialize(
14
28
  length_1:,
15
29
  length_2:,
@@ -37,10 +51,16 @@ module StructuraidCore
37
51
  @main_section = :length_1
38
52
  end
39
53
 
54
+ # Computes the horizontal area of the footing
55
+ # @return [Float] The horizontal area of the footing
40
56
  def horizontal_area
41
- @length_1 * @length_2
57
+ length_1 * length_2
42
58
  end
43
59
 
60
+ # Computes the effective height of the footing for each direction and for either top or bottom reinforcement
61
+ # @param section_direction [Symbol] The direction of the section. See VALID_SECTIONS
62
+ # @param above_middle [Boolean] Whether the reinforcement is above the middle of the footing
63
+ # @return [Float] The effective height of the footing
44
64
  def effective_height(section_direction:, above_middle:)
45
65
  case section_direction
46
66
  when :length_1
@@ -50,22 +70,33 @@ module StructuraidCore
50
70
  end
51
71
  end
52
72
 
73
+ # Sets the coordinates system of the footing
74
+ # @param coordinates_system [Engineering::Locations::CoordinatesSystem] A coordinates system instance
75
+ # @return [Engineering::Locations::CoordinatesSystem] The coordinates system of the footing
53
76
  def add_coordinates_system(coordinates_system)
54
77
  @coordinates_system = coordinates_system
55
78
  end
56
79
 
80
+ # 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.
81
+ # @param column_location [Engineering::Locations::Absolute] The column's absolute location
82
+ # @param column_label [String, Symbol] The column's label
83
+ # @return [Engineering::Locations::Relative] The column's relative location
57
84
  def find_or_add_column_location(column_location, column_label)
58
85
  label = "column_#{column_label}"
59
86
  relative_location_vector = column_location.to_vector - coordinates_system.anchor_location.to_vector
60
87
  coordinates_system.find_or_add_location_from_vector(relative_location_vector, label:)
61
88
  end
62
89
 
90
+ # Computes the vertices location of the footing's perimeter horizontally and adds them to the footing's coordinates system
63
91
  def add_vertices_location
64
92
  vertices_locations_vectors.each do |label, vector|
65
93
  coordinates_system.find_or_add_location_from_vector(vector, label:)
66
94
  end
67
95
  end
68
96
 
97
+ # Evaluates if a relative location is inside the footing's perimeter. It works only for horizontal locations (z = 0)
98
+ # @param location [Engineering::Locations::Relative] The relative location to evaluate
99
+ # @return [Boolean] Whether the location is inside the footing's perimeter
69
100
  def inside_me?(location)
70
101
  inside_axis_2 = location.value_2 >= -0.5 * length_2 && location.value_2 <= 0.5 * length_2
71
102
  inside_axis_1 = location.value_1 >= -0.5 * length_1 && location.value_1 <= 0.5 * length_1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StructuraidCore
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structuraid_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pradaing
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-29 00:00:00.000000000 Z
11
+ date: 2023-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.7.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: puma
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: rspec
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +122,20 @@ dependencies:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
124
  version: 0.22.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: yard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
97
139
  - !ruby/object:Gem::Dependency
98
140
  name: matrix
99
141
  requirement: !ruby/object:Gem::Requirement