Skip to main content
Glama
catia-v5-modeling-agent

catia-v5-modeling-agent

by tkrtl
README.md
# CATIA V5 Modeling Agent (`catia-v5-modeling-agent`)

<p align="center">
  <img src="assets/logo.svg" alt="CATIA V5 Modeling Agent Logo" width="88" /><br/>
  <strong><a href="#english">English</a> · <a href="#t%C3%BCrk%C3%A7e">Türkçe</a></strong>
</p>

An open-source **Agent Skill**, **MCP Server**, **CLI**, and **Antigravity Plugin** for **CATIA V5** (B19–B32) — covering **FreeStyle / GSD** (`HybridShapeFill` networks) and **Part Design** (`Sketch` + `ShapeFactory` solids).

### Showcase: Aston Martin DB9 Workflow Visuals

| High-Detail FreeStyle Render (CATIA V5) | Parametric 883-Fill Network (CATIA V5) |
| :---: | :---: |
| ![High-Detail CATIA Render](examples/aston-martin-db9/renders/catia_high_detail_iso.jpg) | ![Parametric 883-Fill Network](examples/aston-martin-db9/renders/fill_catia_iso.jpg) |

| 1. Blueprint Wireframe Skeleton (Python) | 2. Master NURBS Shell Skeleton (Python) |
| :---: | :---: |
| ![Python Blueprint Wireframe](examples/aston-martin-db9/renders/python_blueprint_wireframe.png) | ![Python Master Skeleton](examples/aston-martin-db9/renders/python_master_skeleton.png) |

| 3. 4-View Blueprint Fit (IoU ≥ 97.2%) | 4. Python 3D Studio Preview (Zero-Gap Proof) |
| :---: | :---: |
| ![Python Blueprint Fit](examples/aston-martin-db9/renders/python_blueprint_fit_4view.png) | ![Python 3D Studio Preview](examples/aston-martin-db9/renders/python_3d_studio_preview.png) |

> Full render gallery & CAD metrics: [examples/aston-martin-db9/README.md](examples/aston-martin-db9/README.md)

---

## English

### Features
- **Watertight Parametric `HybridShapeFill` Networks:** Compiles NURBS patches into deduplicated `PointCoord` → shared forward/reversed `Spline` → bounded `Fill` features directly inside `PartBody` (`0` `Geometrical Set`, `0` broken external IGES links), locally editable at both shared seams and center passing points (`oFill.Constraint`).
- **Surface + Solid Knowledge (`skills/catia-v5-modeling/`):** Empirical CATIA V5 COM rules (`Constraint` vs ignored `AppendConstraint`, comma-decimal locale parsing, `RefreshDisplay` capture fix) plus **Part Design** (`Pad`, `Pocket`, `Shaft`, `EdgeFillet`, `CloseSurface`, `ThickSurface`).
- **32/64-bit VBScript Linter:** Enforces pure 7-bit ASCII, no BOM, `Option Explicit`, zero `As <Type>`, and validates syntax against both `System32\cscript.exe` and `SysWOW64\cscript.exe`.
- **Isolated `CNEXT.exe` Runner:** Tests `.catvbs` macros on `%TEMP%` copies, tracks only its own child PID tree, auto-dismisses Warm Start dialogs, and collects 5-view JPG captures.

### Quick Start

```bash
git clone https://github.com/tkrtl/catiaV5Mcp.git
cd catiaV5Mcp
python -m venv .venv
.venv\Scripts\pip install -e ".[windows,dev]"   # Windows (with pywin32/psutil)
# or: .venv/bin/pip install -e ".[dev]"        # Linux / macOS (offline compile & lint)
```

Add to your MCP client (Antigravity, Claude Code, Cursor, Gemini CLI):

```json
{
  "mcpServers": {
    "catia-v5-modeling-agent": {
      "command": "python",
      "args": ["-m", "catia_v5_mcp"]
    }
  }
}
```

### MCP Tools & CLI

| MCP Tool | CLI Command | Function |
| :--- | :--- | :--- |
| `catia_inspect_tlb` | `catia-v5-cli inspect-tlb` | Inspect local CATIA `.tlb` COM signatures & enums |
| `catia_lint_macro` | `catia-v5-cli lint` | ASCII, BOM, VBA-safety, and 32/64-bit `cscript` checks |
| `catia_compile_fill_network` | `catia-v5-cli compile-network` | NURBS JSON → shared-Spline `Fill` network + 5-view `.catvbs` |
| `catia_verify_fill_network` | `catia-v5-cli verify-network` | Audit closed loops, shared spline reuse, and bounding box |
| `catia_run_macro_isolated` | `catia-v5-cli run-isolated` | Run macro in isolated child `CNEXT.exe` on temp copy |
| `catia_get_modeling_guide` | — | Load `overview`, `com-quirks`, `vbscript-rules`, `part-design` docs |

---

## Türkçe

### Özellikler
- **Sıfır-Boşluklu Parametrik `HybridShapeFill` Ağları:** NURBS yüzey yamalarını doğrudan **`PartBody`** içine (`0` `Geometrical Set`, `0` dış IGES/CATPart link hatası) tekilleştirilmiş `PointCoord` → ortak paylaşılan `Spline` → tekil `Fill` unsurları olarak derler; hem ortak dikişlerden hem merkez noktasından (`oFill.Constraint`) lokal düzenleme sağlar.
- **Yüzey + Katı Modelleme Rehberi (`skills/catia-v5-modeling/`):** CATIA V5 COM kuralları (`Constraint` vs yoksayılan `AppendConstraint`, `tr-TR` ondalık dönüşümü, `RefreshDisplay` capture düzeltmesi) ile birlikte **Part Design** katı modelleme (`Sketch`, `Pad`, `Pocket`, `Shaft`, `EdgeFillet`, `CloseSurface`).
- **32/64-bit VBScript Linter:** Saf 7-bit ASCII, BOM yokluğu, `Option Explicit`, sıfır `As <Type>` kuralını ve çift mimarili `cscript` sözdizimini doğrular.
- **İzole `CNEXT.exe` Çalıştırıcı:** Makroları `%TEMP%` kopyasında çalıştırır, masaüstündeki açık CATIA oturumuna dokunmadan yalnızca çocuk PID ağacını yönetir ve 5 açıdan JPG görüntü yakalar.

### Hızlı Kurulum

```bash
git clone https://github.com/tkrtl/catiaV5Mcp.git
cd catiaV5Mcp
python -m venv .venv
.venv\Scripts\pip install -e ".[windows,dev]"   # Windows
# veya: .venv/bin/pip install -e ".[dev]"      # Linux / macOS
```

MCP istemcinize (`mcp_config.json`) ekleyin:

```json
{
  "mcpServers": {
    "catia-v5-modeling-agent": {
      "command": "python",
      "args": ["-m", "catia_v5_mcp"]
    }
  }
}
```

### MCP Araçları & CLI

| MCP Aracı | CLI Komutu | İşlevi |
| :--- | :--- | :--- |
| `catia_inspect_tlb` | `catia-v5-cli inspect-tlb` | Yerel CATIA `.tlb` COM arayüz imzalarını ve enum'ları okur |
| `catia_lint_macro` | `catia-v5-cli lint` | `.catvbs` makrolarında ASCII/BOM ve 32/64-bit `cscript` denetimi yapar |
| `catia_compile_fill_network` | `catia-v5-cli compile-network` | NURBS JSON → ortak `Spline` / `Fill` ağı + 5-açı `.catvbs` üretir |
| `catia_verify_fill_network` | `catia-v5-cli verify-network` | Kapalı döngü, dikiş paylaşımı ve eksen sınırlarını (BBox) denetler |
| `catia_run_macro_isolated` | `catia-v5-cli run-isolated` | Geçici kopyada izole çocuk `CNEXT.exe` ile makroyu test eder |
| `catia_get_modeling_guide` | — | `overview`, `com-quirks`, `vbscript-rules`, `part-design` rehberlerini döner |

---

**License / Lisans:** MIT — see [LICENSE](LICENSE)