Metadata-Version: 2.4
Name: gearmaster
Version: 0.3.2
Summary: Engineering analysis suite: CAD, meshfree and FEA structural analysis, welded joints, signal processing and a node-based visual workflow editor
Author-email: Simone Lucertini <simone.lucertini@gmail.com>
License: GPL-3.0-only
Project-URL: Homepage, https://github.com/simoneluce/GearMaster
Project-URL: Documentation, https://gearmaster.readthedocs.io
Project-URL: Repository, https://github.com/simoneluce/GearMaster.git
Project-URL: Issues, https://github.com/simoneluce/GearMaster/issues
Project-URL: Changelog, https://github.com/simoneluce/GearMaster/releases
Keywords: engineering,simulation,CAD,FEA,signal-processing,hydraulic,mechanical,structural-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Manufacturing
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: customtkinter>=5.2.0
Requires-Dist: Pillow>=9.5.0
Provides-Extra: visual
Requires-Dist: customtkinter>=5.2.0; extra == "visual"
Requires-Dist: Pillow>=9.5.0; extra == "visual"
Requires-Dist: PyQt5>=5.15; extra == "visual"
Provides-Extra: material-gui
Requires-Dist: PyQt5>=5.15; extra == "material-gui"
Provides-Extra: visualization
Requires-Dist: pyvista>=0.49.0; extra == "visualization"
Requires-Dist: vtk>=9.7.0; extra == "visualization"
Requires-Dist: pooch>=1.9.0; extra == "visualization"
Requires-Dist: markdown>=3.4; extra == "visualization"
Provides-Extra: cad
Requires-Dist: pyvista>=0.49.0; extra == "cad"
Requires-Dist: pyvistaqt>=0.11.0; extra == "cad"
Requires-Dist: vtk>=9.7.0; extra == "cad"
Requires-Dist: PyQt5>=5.15; extra == "cad"
Provides-Extra: meshfree
Requires-Dist: gearmaster[cad]; extra == "meshfree"
Requires-Dist: numba>=0.57.0; extra == "meshfree"
Requires-Dist: shapely>=2.0.0; extra == "meshfree"
Requires-Dist: pyclipper>=1.3.0; extra == "meshfree"
Provides-Extra: ansys
Requires-Dist: ansys-dpf-core>=0.16.1; extra == "ansys"
Requires-Dist: ansys-dpf-post>=0.6.0; extra == "ansys"
Requires-Dist: ansys-tools-visualization-interface>=0.14.0; extra == "ansys"
Requires-Dist: pyvista>=0.49.0; extra == "ansys"
Requires-Dist: vtk>=9.7.0; extra == "ansys"
Requires-Dist: pooch>=1.9.0; extra == "ansys"
Provides-Extra: data
Requires-Dist: h5py>=3.8.0; extra == "data"
Requires-Dist: openpyxl>=3.1.0; extra == "data"
Requires-Dist: plotly>=5.15.0; extra == "data"
Requires-Dist: seaborn>=0.13.0; extra == "data"
Requires-Dist: mplcursors>=0.5; extra == "data"
Requires-Dist: opencv-python>=4.8.0; extra == "data"
Provides-Extra: all
Requires-Dist: gearmaster[ansys,data,meshfree,visual,visualization,windows]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: pylint>=2.17.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.4.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Provides-Extra: windows
Requires-Dist: pywin32>=305; sys_platform == "win32" and extra == "windows"
Requires-Dist: winshell>=0.6; sys_platform == "win32" and extra == "windows"
Dynamic: license-file

# GearMaster - Complete Engineering Analysis Suite

[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-GPL--3.0-green.svg)](LICENSE)
[![Status](https://img.shields.io/badge/status-Alpha-orange.svg)](#)

> A comprehensive Python-based engineering platform for mechanical systems simulation, CAD operations, FEA analysis, hydraulic systems modeling, and signal processing. Built with both programmatic and visual programming interfaces.

## 🎯 Overview

**GearMaster** is an engineering suite designed for:
- 🎨 **CAD Operations** - STEP/IGES import, assembly tree, suppression, material assignment
- 🧮 **Meshfree Analysis** - Point cloud generation and MLPG structural solver on CAD geometry
- 🏗️ **Structural / FEA Analysis** - Ansys DPF integration, welded joints assessment, cross-section properties
- 📊 **Signal Processing** - Time-series generation, conversion and plotting
- 🧱 **Materials** - Material library with GUI editor
- 📈 **Data Management** - GearMaster data structures (DataBase, MultiColumn, MetaData)

### Core Features

- **Dual Interface Model**
  - **Programmatic**: Direct Python API via `GM_modules` for automation and scripting
  - **Visual**: Node-based visual programming via `GM_Visual` for interactive workflows

- **Analysis & Visualization**
  - Meshfree (MLPG) solver with interactive pre/post-processing
  - Welded joint assessment on Ansys results (weld path finder)
  - Ansys DPF/PyDPF integration for result processing
  - 3D visualization with PyVista/VTK

- **Material Library**
  - Material property database with library presets (e.g. `general/steel`)
  - Isotropic elasticity definitions shared by CAD and Meshfree workflows

- **Extensible Architecture**
  - Modular design with specialized engineering modules
  - Plugin-ready node system for visual programming
  - Clean separation of concerns

---

## 🏗️ Architecture Overview

### `GM_modules` - Core Engineering Libraries

**What it is:** The programmatic foundation of GearMaster. A collection of specialized Python modules providing direct APIs for engineering calculations and operations.

**Use Cases:**
- Automated batch analysis scripts
- Integration with other Python tools/frameworks
- Custom simulation workflows
- CI/CD pipelines and testing

**Available Modules:**

| Module | Purpose | Status |
|--------|---------|--------|
| **Cad** | CAD model (STEP/IGES) import, entity tree, editor GUI | Active |
| **Meshfree** | Point clouds, Meshfree model, MLPG solver and editors | Active |
| **Fea** | FEA utilities and welded joints assessment (`Fea/Welded_Joints`) | Active |
| **pyAnsys** | Ansys DPF result loading and post-processing | Active |
| **Materials** | Material library, material definitions and viewer | Active |
| **Signals** | Time-series generation, conversion and plotting | Active |
| **Data** | GearMaster data manager (DataBase, MultiColumn, MetaData) | Active |
| **Structures** | Cross-section and structural utilities | Partial |
| **GUIs** | Reusable GUI components | Partial |
| **utils** | Shared helpers (colour picker, ribbon base) | Active |
| **Mechanical** | Mechanical components (fasteners) | Early stage |
| **Hydraulic** | Hydraulic components | Early stage |

**Example Usage:**

```python
from GM_modules.Cad import GM_CadModel

# Load a CAD file and list its active bodies
model = GM_CadModel(name="welded_joint")
model.load("GM_Visual/examples/meshfree/sample_welded_joint.stp")
for entity in model.iter_active_leaves():
    print(entity.entity_id, entity.name)
```

---

### `GM_Visual` - Node-Based Visual Programming System

**What it is:** An interactive visual programming interface built on `GM_modules`. Use drag-and-drop nodes to create complex engineering workflows without writing code.

**Use Cases:**
- Interactive analysis and exploration
- Non-programmer engineers creating workflows
- Educational demonstrations
- Rapid prototyping of analysis pipelines

**Key Features:**
- **Node Canvas**: Drag-and-drop node-based programming
- **Node Library**: Pre-built nodes for all GM_modules functions
- **Project Management**: Save/load workflows as `.gmv` files
- **Examples**: Ready-to-run workflows under *File → Examples* (basics, signals, meshfree)
- **Live Execution**: Execute workflows with real-time result visualization
- **CustomTkinter UI**: Modern, responsive interface
- **Debug Terminal**: In-app logging and error tracking

**Node Categories:**
- Basics and utilities (constants, lists, value display, file/folder pointers)
- Data nodes
- Signals nodes
- Materials nodes (material library)
- CAD nodes (CAD loader, CAD editor)
- Meshfree nodes (Meshfree Model, Meshfree Solver)
- FEA nodes (welded joints analysis, weld path finder)
- Ansys DPF nodes
- GUI and demo nodes

**Example Workflow** (*File → Examples → Meshfree → basic meshfree analysis*):
```
[CAD Loader] → [CAD Editor] → [Meshfree Model] → [Meshfree Solver]
                                     ↑
                             [Material Library]
```

Use **Run → Canvas Run** to execute the whole graph: each node turns green when
executed successfully and red on error.

**Launch:**
```bash
gm-visual                 # entry point installed with the package
# or, from a source checkout
python GM_Visual/main.py
```

---

## 📦 Installation

### From PyPI

```bash
# Core installation
pip install gearmaster

# With Ansys DPF support
pip install gearmaster[ansys]

# With visual programming interface
pip install gearmaster[visual]

# With CAD import and the Meshfree solver
# (pythonocc-core must be installed from conda-forge:
#  conda install -c conda-forge pythonocc-core)
pip install gearmaster[meshfree]

# Complete installation
pip install gearmaster[all]
```

Available extras: `visual`, `material-gui`, `visualization`, `cad`, `meshfree`,
`ansys`, `data`, `windows`, `all`, `dev`, `docs`. The core installation only
contains the lightweight scientific stack; heavy libraries (Qt, VTK, Ansys DPF,
OpenCV, Numba) are opt-in to keep installs and start-up fast.

### From Source (Development)

```bash
git clone https://github.com/simoneluce/GearMaster.git
cd GearMaster

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode with all features
pip install -e ".[all,dev]"
```

### Requirements

- **Python**: 3.10 or higher
- **Core Dependencies**: NumPy, Pandas, SciPy, Matplotlib
- **Optional**: Ansys DPF and a valid Ansys license (for `pyAnsys` and `Fea/Welded_Joints`),
  pythonocc-core from conda-forge (for CAD import and the Meshfree workflow)

---

## 🚀 Quick Start

### Using GM_modules (Programmatic)

```python
from GM_modules.Cad import GM_CadModel

model = GM_CadModel(name="my_part")
model.load("my_part.step")
print(f"Active bodies: {len(list(model.iter_active_leaves()))}")
```

### Using GM_Visual (Interactive)

```bash
# Start the visual programming interface
gm-visual

# Then in the GUI:
# 1. File → Examples → Meshfree → basic meshfree analysis (or create a new project)
# 2. Drag nodes from the node library to the canvas
# 3. Connect nodes by dragging pins
# 4. Run → Canvas Run to execute the workflow
# 5. Double-click a node to open its editor and inspect results
```

---

## 📚 Project Structure

```
GearMaster/
├── GM_modules/              # Core engineering libraries
│   ├── Cad/                # CAD model and editor
│   ├── Meshfree/           # Point clouds and MLPG meshfree solver
│   ├── Fea/                # FEA utilities, Welded_Joints
│   ├── pyAnsys/            # Ansys DPF integration
│   ├── Materials/          # Material library
│   ├── Signals/            # Signal processing & time-series
│   ├── Data/               # Data management
│   ├── Structures/         # Structural utilities
│   ├── GUIs/               # GUI components
│   ├── utils/              # Shared helpers
│   ├── Mechanical/         # Mechanical components (early stage)
│   └── Hydraulic/          # Hydraulic components (early stage)
│
├── GM_Visual/               # Visual programming system
│   ├── src/                # Source code (canvas, core, nodes, ui)
│   ├── examples/           # Example workflows (.gmv)
│   ├── docs/               # GM_Visual documentation
│   ├── tests/              # Test suite
│   └── main.py             # Application entry point
│
├── docs/                    # Documentation (mkdocs)
├── scripts/                 # Release and test helper scripts
├── tests/                   # Integration tests
├── pyproject.toml           # Python packaging config
└── README.md                # This file
```

---

## 🔄 Differences: GM_modules vs GM_Visual

| Aspect | **GM_modules** | **GM_Visual** |
|--------|---|---|
| **Interface** | Python API (programmatic) | GUI (node-based) |
| **Usage** | Code-driven automation | Drag-and-drop workflows |
| **Target User** | Programmers, Engineers, Researchers | Engineers, Analysts |
| **Extensibility** | Easy - add Python functions | Moderate - create custom nodes |
| **Performance** | Native Python speed | Slight overhead from GUI |
| **Dependency Stack** | Lightweight core | `gearmaster[visual]` extra |
| **Data Flow** | Direct function calls | Visual connections (pins) |
| **Debugging** | Python debuggers, logging | Built-in terminal, node debugging |
| **Learning Curve** | Python knowledge required | Visual intuition required |

### When to Use What

**Choose GM_modules when:**
- ✅ Automating repetitive analysis tasks
- ✅ Integrating with other Python libraries
- ✅ Building production pipelines
- ✅ Requiring maximum performance
- ✅ You're comfortable with Python

**Choose GM_Visual when:**
- ✅ Exploring data interactively
- ✅ Prototyping workflows quickly
- ✅ Team includes non-programmers
- ✅ Teaching engineering concepts
- ✅ Need visual feedback on workflows

---

## 🧪 Testing

Each module has its own `tests/` folder. Because some modules ship helper packages
with the same name, the suites must run in separate processes. Use the runner:

```bash
# Run every suite
python scripts/run_tests.py

# Skip the slow suites (Meshfree, Welded_Joints)
python scripts/run_tests.py --fast

# Run a single suite directly with pytest
pytest GM_modules/Cad/tests
```

Tests that need an Ansys license or optional dependencies are skipped automatically
when these are not available.

---

## 📖 Documentation

Full documentation available via MkDocs:

```bash
# Install docs dependencies
pip install gearmaster[docs]

# Serve documentation locally
mkdocs serve

# Build static docs
mkdocs build
```

Visit [docs/](docs/) for detailed module documentation, tutorials, and API reference.

---

## 🤝 Contributing

We welcome contributions! Before starting work on a new module:

> **⚠️ Please contact the owner before starting a new module or making major changes.**

1. Create a feature branch from `develop`
2. Implement your changes following the repository style
3. Add tests in the appropriate `tests/` folder
4. Update documentation in the corresponding `docs/` folder
5. Submit a pull request against `develop` branch

**Coding Standards:**
- Python 3.10+ compatible
- Use type hints where possible
- Follow PEP 8 style guide
- Document all public APIs
- Include unit tests (pytest)

---

## 📋 Module Development Guide

Each module follows a standard structure:

```
ModuleName/
├── __init__.py              # Module exports
├── core.py                  # Main functionality
├── [other core files].py    
├── tests/                   # pytest test files
│   └── test_*.py
├── docs/                    # Module documentation
│   └── [module].md
└── version.py               # Version info
```

---

## 📝 License

GNU General Public License v3.0 - See [LICENSE](LICENSE) file for details.

---

## 👤 Author

**Simone Lucertini**
- Repository: [github.com/simoneluce/GearMaster](https://github.com/simoneluce/GearMaster)

---

## ⚠️ Status

**Current Version**: see [PyPI](https://pypi.org/project/gearmaster/) and the [CHANGELOG](CHANGELOG.md)  
**Status**: Alpha (under active development)

This project is actively maintained. Features and APIs may change. For production use, pin to a specific version.

---

---

## 📞 Support

- 📧 Create an issue on GitHub for bug reports
- 💬 Discussions for feature requests
- 📖 Check documentation in `docs/` folder

---

**Happy analyzing! 🚀**
