rehanafzal commited on
Commit
8de04aa
·
verified ·
1 Parent(s): b2cde21

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ def calculate_bricks(wall_length, wall_height, wall_thickness, brick_length, brick_height, brick_thickness):
4
+ wall_volume = wall_length * wall_height * wall_thickness
5
+ brick_volume = brick_length * brick_height * brick_thickness
6
+ mortar_ratio = 0.1 # Assuming 10% of volume is mortar
7
+ effective_wall_volume = wall_volume * (1 - mortar_ratio)
8
+ total_bricks = effective_wall_volume / brick_volume
9
+ return int(total_bricks), round(wall_volume * mortar_ratio, 2)
10
+
11
+ st.title("Brick Masonry Estimator")
12
+ st.write("Estimate the number of bricks and mortar required for a given wall size.")
13
+
14
+ st.sidebar.header("Wall Dimensions (in meters)")
15
+ wall_length = st.sidebar.number_input("Wall Length", min_value=0.1, value=10.0, step=0.1)
16
+ wall_height = st.sidebar.number_input("Wall Height", min_value=0.1, value=3.0, step=0.1)
17
+ wall_thickness = st.sidebar.number_input("Wall Thickness", min_value=0.1, value=0.2, step=0.01)
18
+
19
+ st.sidebar.header("Brick Dimensions (in meters)")
20
+ brick_length = st.sidebar.number_input("Brick Length", min_value=0.1, value=0.2, step=0.01)
21
+ brick_height = st.sidebar.number_input("Brick Height", min_value=0.05, value=0.1, step=0.01)
22
+ brick_thickness = st.sidebar.number_input("Brick Thickness", min_value=0.05, value=0.1, step=0.01)
23
+
24
+ if st.button("Estimate"):
25
+ bricks, mortar = calculate_bricks(wall_length, wall_height, wall_thickness, brick_length, brick_height, brick_thickness)
26
+ st.success(f"Estimated Number of Bricks: {bricks}")
27
+ st.info(f"Estimated Mortar Volume: {mortar} cubic meters")