{"id":50417667,"url":"https://github.com/anzai004/mechassist","last_synced_at":"2026-05-31T07:00:35.417Z","repository":{"id":347706589,"uuid":"1194992067","full_name":"Anzai004/MechAssist","owner":"Anzai004","description":"AI-powered desktop engineering decision support for material selection, stress assessment and machinability advisory.","archived":false,"fork":false,"pushed_at":"2026-05-31T05:09:45.000Z","size":26358,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T06:22:02.125Z","etag":null,"topics":["decision-support","engineering-tools","kmeans","machine-learning","mechanical-engineering","python","random-forest","scikit-learn","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anzai004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T04:22:10.000Z","updated_at":"2026-05-31T05:19:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Anzai004/MechAssist","commit_stats":null,"previous_names":["anzai004/mechassist"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Anzai004/MechAssist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anzai004%2FMechAssist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anzai004%2FMechAssist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anzai004%2FMechAssist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anzai004%2FMechAssist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anzai004","download_url":"https://codeload.github.com/Anzai004/MechAssist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anzai004%2FMechAssist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33722156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decision-support","engineering-tools","kmeans","machine-learning","mechanical-engineering","python","random-forest","scikit-learn","tkinter"],"created_at":"2026-05-31T07:00:33.234Z","updated_at":"2026-05-31T07:00:35.394Z","avatar_url":"https://github.com/Anzai004.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MechAssist\n\nA desktop engineering decision support tool for mechanical design. Given a member type and loading condition, it recommends materials, assesses stress state, and generates a machining advisory — all in one workflow with a unified PDF export.\n\nBuilt with Python, scikit-learn, and Tkinter. No internet connection required to run core modules. Groq API integration is running and falls back gracefully in case of errors.\n\n---\n\n## Screenshots\n\n**Module 1 — Material Selection**\nShaft: 200 Nm torque, 40 mm diameter, SF 2.5. K-Means clustering on 1552-material dataset returns ranked candidates with failure concern flags.\n\n![Material Selection — results](screenshots/m1_results.png)\n\n![Material Selection — AI suggestion with apply button](screenshots/m1_ai.png)\n\n---\n\n**Module 2 — Stress Assessment**\nShaft Torsion Tool computes shear stress from torque and diameter, auto-fills the stress fields below, then the RF classifier assesses the combined stress state.\n\n![Shaft Torsion Tool and stress inputs auto-filled](screenshots/m2_shaft_tool.png)\n\n![Stress result — Safe, SF 74.29, SF Check PASS](screenshots/m2_result.png)\n\n![Mohr's Circle — pure torsion, sigma=0, tau=15.92 MPa, t_max=15.92 MPa](screenshots/m2_mohr.png)\n\n---\n\n**Module 3 — Machinability Advisory**\nMachine: HMT NH26 lathe. Tool: Carbide. Parameters auto-filled from M1, capped to machine limits (max 120 m/min, 1800 rpm, 800 Nm).\n\n![Machinability inputs — HMT NH26, Carbide, auto-filled](screenshots/m3_inputs.png)\n\n![Cutting condition advisory — Conservative / Balanced / Aggressive](screenshots/m3_advisory.png)\n\n![Tool life curve — Conservative 7.71 hr, Balanced 3.16 hr, Aggressive 1.52 hr](screenshots/m3_toollife.png)\n\n---\n\n**Summary and PDF Export**\n\n![Summary tab — title block, candidate materials table, stress summary, manufacturability](screenshots/summary_top.png)\n\n![Summary tab — failure mode analysis, stress analysis summary](screenshots/summary_bottom_1.png)\n![Summary tab — manufacturablity, conclusion](screenshots/summary_bottom_2.png)\n\nThe PDF export button on the Summary tab generates a full A4 engineering report with Mohr's Circle and tool life curve embedded. A sample output from the test case above is in [`sample_report/MechAssist_Engineering_Analysis.pdf`](sample_report/MechAssist_Engineering_Analysis.pdf).\n\n---\n\n## Features\n\n**Module 1 — Material Selection**\n- Application-driven inputs: member type (beam / shaft / column / plate), applied load or torque, geometry, and target safety factor\n- Computes required yield strength from first principles — `tau = 16T / (pi * d^3)` for shafts, bending + shear for beams, axial for columns\n- Filters a 1552-row material dataset using K-Means clustering (k=6)\n- Returns ranked candidates with failure concern classification (Fracture / Fatigue / Creep)\n- Manual override available for direct Sy / density / elongation input\n- AI suggestion via Groq API (llama-3.1-8b-instant)\n\n**Module 2 — Stress Assessment**\n- Member type selector switches the geometry tool shown: beam tool for beams and plates, shaft torsion tool for shafts, axial info card for columns\n- Beam Geometry Tool: Rectangle or circular section, point load or UDL, simply supported. Plots SFD, BMD and deflection curve. Auto-fills stress fields.\n- Shaft Torsion Tool: Computes `tau = 16T / (pi * d^3)`, optional combined bending via `sigma = 32M / (pi * d^3)` for transverse load + length input. Auto-fills stress fields.\n- Random Forest classifier (200 estimators, 93% accuracy, 5 risk classes: Safe / Yield Risk / Fatigue Risk / Fracture Risk / Buckling Risk) trained on 36,000 samples\n- Von Mises stress, safety factor check (PASS/FAIL), allowable stress display\n- Interactive Mohr's Circle with principal stresses, max shear, Sy and Su reference lines\n- AI suggestion with one-click Apply buttons that write values back to input fields\n\n**Module 3 — Machinability Advisory**\n- Machine tool selector: Category (Lathe / VMC / HMC / CNC Machining Centre / Drill Press / Grinding Machine) and model (HMT, Kirloskar, ACE, BFW, Haas, Mazak, DMG Mori, Okuma)\n- Machine spec display: Max RPM, torque, power, speed, workpiece diameter\n- Auto-fills speed, RPM, feed, depth, and torque from M1 output, capped to selected machine limits\n- Soft warnings if any parameter exceeds machine capacity\n- Taylor tool life equation with grade multipliers per tool material (HSS / Carbide / Ceramic / CBN)\n- Three cutting modes: Conservative (0.8x), Balanced (1.0x), Aggressive (1.2x, capped at 500 m/min)\n- Random Forest failure classifier trained on the AI4I 2020 dataset\n- Tool life curve plot (Taylor equation, all three modes marked)\n\n**Cross-module workflow**\n- M1 auto-fills Sy, Su, E into M2 on run\n- M1 auto-fills grade, speed, RPM, feed, depth, torque into M3 on run, respecting selected machine limits\n- M2 re-triggers M3 auto-compute after stress assessment\n\n**UI and output**\n- SI / Imperial unit toggle — values convert in-place across all entries\n- Precision selector: 2 to 6 significant figures\n- Tooltips on every input with typical ranges and formula references\n- Activity log panel with colour-coded entries, 200-entry rolling buffer\n- PDF export: A4, header/footer every page, Mohr's Circle and tool life curve embedded, full narrative\n\n---\n\n## Tech Stack\n\n| Layer | Library |\n|---|---|\n| GUI | Tkinter |\n| ML — clustering | scikit-learn KMeans |\n| ML — stress classifier | scikit-learn RandomForestClassifier |\n| ML — failure classifier | scikit-learn RandomForestClassifier |\n| Data | pandas, NumPy |\n| Plots | Matplotlib |\n| Model persistence | joblib |\n| PDF export | ReportLab |\n| AI suggestions | Groq API  |\n\nPython 3.14. Tested on Windows 11.\n\n---\n\n## Installation\n\n```bash\ngit clone https://github.com/Anzai004/MechAssist.git\ncd MechAssist\n\npython -m venv venv\nvenv\\Scripts\\activate          # Windows\n# source venv/bin/activate     # Linux / macOS\n\npip install scikit-learn pandas numpy matplotlib joblib reportlab requests\n```\n\n---\n\n## Running\n\n```bash\nvenv\\Scripts\\activate\npython gui/app.py\n```\n\n---\n\n## File Structure\n\n```\nMechAssist/\n├── data/\n│   ├── module1/Material Selection/Data.csv   # 1552 materials, 15 properties\n│   ├── module2/stress_data.csv               # 36,000 training samples\n│   └── module3/ai4i2020.csv                  # AI4I 2020 machining dataset\n├── data_generators/\n│   ├── generate_stress_data.py\n│   ├── machine_specs.py                      \n│   └── taylor_tool_life.py\n├── gui/\n│   └── app.py                                \n├── models/\n│   ├── kmeans_module1.pkl\n│   ├── scaler_module1.pkl\n│   ├── rf_module2.pkl\n│   ├── encoder_module2.pkl\n│   └── rf_module3_clf.pkl\n├── modules/\n│   ├── module1_material.py\n│   ├── module2_stress.py\n│   └── module3_machining.py\n├── utils/\n│   ├── __init__.py\n│   └── export_pdf.py\n└── sample_report/\n    └── MechAssist_Engineering_Analysis.pdf\n```\n\n---\n\n## Sample Output\n\nTest case: shaft, T = 200 Nm, d = 40 mm, SF = 2.5, Carbide on HMT NH26.\n\n| | Result |\n|---|---|\n| Top material | Steel SAE 9255, Sy = 2048 MPa |\n| Von Mises stress | 27.57 MPa |\n| Safety factor | 74.29 (target 2.0, PASS) |\n| Stress ratio | 0.0135 |\n| Tool life (balanced) | 3.16 hr at 53.9 m/min |\n\n---\n\n## Known Limitations\n\n- Beam tool: simply supported only, point load and UDL only\n- Su auto-estimated as 1.3 x Sy — verify against datasheet for critical designs\n- Fatigue Risk class underrepresented in M2 training data (2096 / 36000 samples)\n- Temperature inputs use manual unit conversion, not the UnitEntry widget\n- Aggressive cutting speed capped at 500 m/min\n- All results are advisory. Verify with a qualified engineer before use in a real design.\n\n---\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzai004%2Fmechassist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanzai004%2Fmechassist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanzai004%2Fmechassist/lists"}