# FreeCAD Backend - FikoYT

## 🐳 Python API Server

**Flask + Gunicorn:**
- **Workers:** 4 processes
- **Port:** 8090
- **GPU:** CUDA 12.2.0
- **Timeout:** 10 menit

**File structure:**
```
docker/fikoyt-sunucu/python_scripts/
├── freecad_api_server.py      # Flask API (1741 lines)
├── free.py                   # Analysis engine (1290 lines)
├── freesim-yatay-dikey.py    # 3D renderer (963 lines)
├── freesim-spiral.py          # Spiral path
├── headless_render.py        # Batch render
└── freecad_draw_export.py   # Drawing export
```

## 🔧 Core Components

### Flask API Server
- **/analyze** - STEP analysis
- **/render-cached** - Cached render
- **/convert-to-gltf** - glTF export
- **/health** - System status

### FreeCAD Integration
- **STEP parser v3.0** - Entity mapping
- **Document management** - Memory optimized
- **Geometry processing** - Bounding box, volume

## ⚡ Performance

- **Redis cache** - Shared between workers
- **GPU rendering** - CUDA accelerated
- **Object pooling** - Memory reuse
- **Batch processing** - Multiple files

## 🔗 Go Integration

**API pattern:**
```go
// Go backend → Python API
POST /uyar/api/freecad/analyze
→ multipart/form-data
→ Python FreeCAD processing
→ Response with file_id
```

## 🎨 Export Formats

- **glTF 2.0** - Web compatible
- **WRL97** - VRML format
- **GIF** - Animation
- **PNG** - Static image

---
2025-11-06