Metadata-Version: 2.4
Name: playdough
Version: 0.3.1
Summary: GDSFactory's next-gen routing engine for photonic IC design
Author-email: amber <amber@gdsfactory.com>
Requires-Python: ~=3.12.0
Requires-Dist: cachetools>=5.0
Requires-Dist: flatbuffers>=25.12.19
Requires-Dist: gdsfactory
Requires-Dist: jax>=0.6.0
Requires-Dist: tqdm>=4.67.3
Description-Content-Type: text/markdown

# playdough

**GDSFactory's next-gen routing engine** — robust, collision-aware Manhattan routing with optional gradient-based finetuning for photonic IC design.

## Features

- **Search-based Manhattan routing** — performant, collision-aware, instant results
- **Gradient-based finetuning** — flexible constraint satisfaction (path length matching, collision avoidance) via automatic differentiation
- **Multi-bundle routing** — grouped port bundles with independent tangent directions
- **Polyline output** — get corner-point coordinates as numpy arrays, with optional smooth euler-bend curves

## Installation

```bash
pip install playdough
```

## Quick Start

```python
import gdsfactory as gf
import playdough as pld

c = gf.Component()
waveguides = gf.components.array(gf.c.straight, columns=1, rows=3, row_pitch=3)
left = c << waveguides
right = c << waveguides
right.move((100, 50))

obs = c << gf.components.rectangle(size=(80, 10))
obs.ymin = 20

router = pld.add_route_bundle(
    c,
    start_ports=list(left.ports.filter(orientation=0)),
    end_ports=list(right.ports.filter(orientation=180)),
    obstacles=[obs],
)

# Optionally finetune for length matching
router.finetune(length_matching=5.0, lr=0.5)
```

## Documentation

See the [documentation site](https://doplaydo.github.io/playdough) for tutorials and API reference.

## License

Requires a valid GDSFactory account. Authenticate with `gfp configure`.
