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]")