Spaces:
Sleeping
Sleeping
File size: 1,478 Bytes
b3a62c5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import streamlit as st
# Title and Description
st.title("Brick Masonry Estimator")
st.write("""
This app estimates the number of bricks and mortar required to construct a wall based on the wall dimensions and brick size.
""")
# Input Fields
st.header("Input Wall Dimensions and Brick Size")
wall_length = st.number_input("Wall Length (meters)", min_value=0.0, step=0.1, value=5.0)
wall_height = st.number_input("Wall Height (meters)", min_value=0.0, step=0.1, value=3.0)
brick_length = st.number_input("Brick Length (cm)", min_value=0.0, step=0.1, value=20.0)
brick_height = st.number_input("Brick Height (cm)", min_value=0.0, step=0.1, value=10.0)
# Calculation
if st.button("Calculate"):
# Convert dimensions to consistent units (meters to centimeters)
wall_area = wall_length * wall_height * 10000 # m² to cm²
brick_area = brick_length * brick_height # cm²
if brick_area > 0:
total_bricks = wall_area / brick_area
mortar_percentage = 0.10 # Assume 10% of volume is mortar
mortar_volume = (wall_length * wall_height * 0.2) * mortar_percentage # Assuming 20cm wall thickness
# Output
st.subheader("Results")
st.write(f"**Total Bricks Required:** {int(total_bricks)} bricks")
st.write(f"**Mortar Volume Required:** {round(mortar_volume, 2)} cubic meters")
else:
st.error("Brick dimensions must be greater than 0.")
# Footer
st.write("---")
st.write("Created by: [Your Name]")
|