This repository presents a comprehensive framework for simulating and optimizing manufacturing tolerances in 2D mechanical assemblies. Utilizing vector-based geometry, Monte Carlo simulations, and machine learning techniques, the project aims to identify and optimize Key Characteristics (KCs) that influence system variability.
- The primary objective is to develop a 2D tolerance analysis model that:
- Implements a vector-based approach to analyze tolerance variations.
- Utilizes Python to create a simulation environment.
- Identifies the most relevant KCs affecting product performance.
- Conducts extensive Monte Carlo simulations with a large sample size.
- Analyzes the influence of tolerances on overall system variability.
- Trains an ML model to predict the most influential KCs based on input distributions.
- Optimizes the number of required measurements to reduce computation time while ensuring precision.
-
Geometry Generation: Constructs a 2D representation of the tailgate-window system, incorporating rounded corners and defined gaps.
-
Tolerance Definition: Establishes input distributions and tolerances based on real-world constraints.
-
Sampling: Performs extensive simulations by randomly sampling input tolerances.
-
Analysis: Evaluates the impact of these variations on the overall system, generating histograms and statistical data.
-
KC Identification: Applies machine learning algorithms to determine the most influential KCs affecting system variability.
-
Optimization: Reduces the number of required measurements while maintaining accuracy, thereby optimizing computational resources.
vector_tolerance_analysis/
- config.py 🔧 Configuration for geometry, tolerances, and simulation parameters
- geometry.py 📐 Functions to generate and manipulate 2D geometry
- tolerance_analysis.py 🎲 Monte Carlo simulation and statistical analysis
- kc_identification.py 🧠 Machine learning models for Key Characteristic (KC) identification and optimization
- main.py 🚀 Entry-point script to execute the full analysis pipeline
- tolerance_data.csv 📊 Sample input data for tolerances
- output.png 📸 Visual output of the simulation results
- push.bat 💻 Batch script for version control operations
- README.md 📄 Project documentation
git clone https://github.com/Nihar2082/vector_tolerance_analysis.git
cd vector_tolerance_analysis
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Note: Ensure that requirements.txt is updated with all necessary packages.
- Modify config.py to set geometry parameters, tolerance ranges, and simulation settings.
python main.py
This will execute the full pipeline: geometry generation, Monte Carlo simulation, KC identification, and result visualization.
- Output statistics and plots will be saved in the project directory.
- output.png provides a visual summary of the simulation outcomes.
Include sample plots or statistical summaries here to illustrate the results.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or suggestions, please contact nihar3010patel@gmail.com.