MM MIHIR MADHAPARIA

AI Steel Structure Studio

This app is mirrored inside the portfolio repository so it can live alongside the website and be deployed from the same GitHub project.

Deploy From The Portfolio Repo

Deploy this app on Streamlit Community Cloud with:

The portfolio site links its Launch App button to:

https://mihir-ai-steel-studios.streamlit.app

After the app is created once in Streamlit Community Cloud, future pushes to this repo will update the deployed app automatically.

A Streamlit MVP for turning a plain-English building prompt into a conceptual steel structure package:

This is a concept generator, not an engineered design tool. A licensed structural engineer must verify loads, member sizing, connections, foundations, code compliance, and permit drawings before construction.

Quick Start

From this folder:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m streamlit run app.py

If PowerShell blocks venv activation, run this once in the current terminal:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1

Then open the local Streamlit URL shown in the terminal, usually:

http://localhost:8501

How To Use The App

  1. Open the Prompt tab.
  2. Use the chat box to describe the building, for example:
Design a 60m x 24m x 9m steel factory with a gable roof, 10 bays, wall girts, purlins, and cross bracing.
  1. Continue in the same chat with follow-ups like make it 5m wider, remove wall girts, or switch to a mono-slope roof.
  2. Fine-tune dimensions, roof style, bay count, and member display sizes in the sidebar.
  3. Review the 3D Preview and Drawings + BOM tabs. In 3D Preview, enable the large visualizer and use its Full screen button for easier orbiting and inspection.
  4. Download STL, OBJ, IFC, SketchUp bundle, DXF, SVG, BOM CSV, connection CSV, or JSON from the Exports tab.

To keep refining the same project, keep chatting in the Prompt tab. Example follow-ups:

Make it 70m long and switch to a mono-slope roof.
Remove wall girts and add cross bracing.
Make it 5m wider and increase the bay count to 12.
Use standing seam roof sheets and insulated wall panels.

The app intentionally keeps one active project in session. Use Reset Project when you want to start over.

Steel And Connection Catalogs

The app loads section and part data from ultimate_steel_parts_database.csv, then overlays steel_sections.csv and purlin_sections.csv. This keeps the broad part database active for hardware/plate/bolt estimating while keeping the smaller section and purlin catalogs available as editable specialist sources. If the CSV files are missing, the app falls back to a small embedded starter catalog.

ultimate_steel_parts_database.csv includes the full active section/parts database. steel_sections.csv is the generated structural-section subset used for visual member profiles and compatibility. purlin_sections.csv contains generated common Z, lapped Z, C, sigma, hat, and eave-strut style purlins/girts and is explicitly loaded after the main catalogs so purlin edits are honored. brace_connection_catalog.csv contains angle-based conceptual brace, bolt, weld, and plate rules. roofing_options.csv contains roof and wall sheet/deck/cladding families used for takeoff rows and cladding fastener notes.

The app uses member angles to select conceptual brace plates/bolts and adds connection hardware rows to the BOM. BOM rows include units, quantity basis, calculated weight, waste/cut factor, estimated weight, and an estimate note. Steel member weights use catalog kg/m values with a cut/splice allowance, cladding uses catalog kg/m2 with lap/cut allowance, hardware uses catalog bolt weights or steel-volume estimates, and concrete uses plan area x slab thickness x normal-weight concrete density.

The catalog can be regenerated with:

python .\tools\build_catalogs.py

The best production source for U.S. shapes is the official AISC Shapes Database v16.0. The current generated values are for visual/detailing prototypes only; verify all dimensions, weights, and design properties before engineering use.

The Drawings + BOM tab also includes conceptual bolt, weld, bracket, and plate schedules. These details are placeholders for conversations and engineer handoff, not fabrication instructions.

AI Integration Options

The app is designed so AI only extracts structured parameters. The CAD generation is deterministic Python, which makes the output more predictable and keeps API costs low.

Option 1: Free Built-In Parser

Use Free local parser in the app. It costs nothing, runs offline, and understands common prompts like:

This is the best place to start.

Option 2: Free Local AI With Ollama

Install Ollama, then pull a local model:

ollama pull llama3.2:1b

In the app, go to AI Setup:

Use the Test Ollama Connection button in the AI Setup tab to verify that Ollama is running and that at least one model is available. On Windows, Ollama usually runs in the background after installation. If it is not reachable, open the Ollama app or run:

ollama serve

Good alternatives to try locally are llama3.1, qwen2.5, mistral, or a newer small instruct model that fits your computer.

Option 3: Paid OpenAI API

Set environment variables before launching Streamlit:

$env:OPENAI_API_KEY="your_api_key_here"
$env:OPENAI_MODEL="gpt-5.4-mini"
python -m streamlit run app.py

In the app, choose OpenAI. This is useful when customer prompts are vague, messy, or include many requirements in one paragraph.

Option 4: Paid Google Gemini API

Set environment variables before launching Streamlit:

$env:GEMINI_API_KEY="your_api_key_here"
$env:GEMINI_MODEL="gemini-2.5-flash"
python -m streamlit run app.py

In the app, choose Google Gemini. This is another practical low-cost extraction option.

Start with one extraction agent only. Do not let the AI directly write CAD geometry until you have a strong validation layer.

  1. Prompt extraction agent: Converts user text into length, width, height, roof type, bay count, and options.
  2. Structural checklist agent: Flags missing location, snow load, wind speed, seismic category, occupancy, crane loads, mezzanine loads, and fire rating.
  3. Costing agent: Converts the BOM into a rough material and erection estimate.
  4. Proposal agent: Turns the generated package into a customer-facing summary for your website.
  5. Engineer handoff agent: Produces a clean design brief for a licensed structural engineer.

Future Website Path

Streamlit is excellent for this prototype. For your website, the clean migration path is:

Adding STEP Or Native CAD Later

This MVP intentionally exports STL, OBJ, DXF, SVG, CSV, and JSON without a heavy CAD kernel. That makes it easy to run on Python 3.13.

For STEP files later, use one of these approaches:

Keep native CAD generation in a backend worker, not directly in the website frontend.

Project Files