ai-lover commited on
Commit
1d9e2bf
·
verified ·
1 Parent(s): 1f33ec4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -0
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # App title and description
4
+ st.title("Brick and Mortar Estimator")
5
+ st.markdown("""
6
+ This tool estimates the number of bricks and mortar required for a given wall size.
7
+ Simply enter the wall dimensions and brick size, and the app will do the calculations for you!
8
+ """)
9
+
10
+ # Input fields for wall dimensions
11
+ st.header("Wall Dimensions")
12
+ wall_length = st.number_input("Wall Length (meters):", min_value=0.1, value=5.0, step=0.1)
13
+ wall_height = st.number_input("Wall Height (meters):", min_value=0.1, value=3.0, step=0.1)
14
+ wall_thickness = st.number_input("Wall Thickness (meters):", min_value=0.1, value=0.2, step=0.01)
15
+
16
+ # Input fields for brick dimensions
17
+ st.header("Brick Dimensions")
18
+ brick_length = st.number_input("Brick Length (meters):", min_value=0.1, value=0.2, step=0.01)
19
+ brick_height = st.number_input("Brick Height (meters):", min_value=0.05, value=0.1, step=0.01)
20
+ brick_thickness = st.number_input("Brick Thickness (meters):", min_value=0.05, value=0.1, step=0.01)
21
+
22
+ # Calculate button
23
+ if st.button("Calculate"):
24
+ # Wall volume
25
+ wall_volume = wall_length * wall_height * wall_thickness
26
+
27
+ # Brick volume
28
+ brick_volume = brick_length * brick_height * brick_thickness
29
+
30
+ # Calculate number of bricks and mortar
31
+ if brick_volume > 0:
32
+ num_bricks = wall_volume / brick_volume
33
+ mortar_volume = 0.10 * wall_volume # Assume 10% mortar
34
+
35
+ # Display results
36
+ st.success(f"Estimated Number of Bricks: {num_bricks:.0f}")
37
+ st.info(f"Estimated Mortar Volume: {mortar_volume:.2f} cubic meters")
38
+ else:
39
+ st.error("Brick dimensions must be greater than zero.")