Metadata-Version: 2.4
Name: cutting-engine
Version: 0.3.2
Summary: Pure Python guillotine cutting optimizer for furniture sheet panels
Project-URL: Repository, https://github.com/BerdiyorovAbrorjon/cutting-engine
Author-email: Abrorjon Berdiyorov <abrorjonberdiyor@gmail.com>
License-Expression: MIT
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# cutting-engine

Pure Python guillotine cutting optimizer for furniture sheet panels.

Authoritative docs:

- `docs/CUTTING_ENGINE.md` — main library implementation contract.
- `docs/PACKINGSOLVER_PROVIDER_SPEC.md` — approved `0.3.0` PackingSolver provider
  implementation contract.
- `docs/CUTTING_MODULE_SPEC.md` — application cutting module implementation spec.
- `docs/ALGORITHM_SCORING.md` — authoritative algorithm and scoring implementation spec.
- `docs/ALGORITHM_SCORING_UZ.md` — Uzbek version of the algorithm/scoring spec.
- `docs/PROGRESS.md` — current implementation status and next work.
- `benchmarks/` — Bazis-Raskroy metric baseline comparison framework.

Implementation rule:

```text
CuttingRequest -> optimize() -> native provider (always) + packingsolver provider (when supported)
                              -> shared ResultScore selection -> one CuttingResult
Default sheet size: 2750 x 1830
Default kerf: 4
Default trim: 5
```

The library must not contain FastAPI, database, parser, importer, exporter,
PDF/SVG/CNC, or business-order logic. `optimize()` never opens a network
connection or talks to a database; it may run the pinned
`packingsolver_rectangleguillotine` executable as a local subprocess and use
temporary files that are always cleaned up before returning — see
`docs/PACKINGSOLVER_PROVIDER_SPEC.md` for the full bounded provider contract.

Run Bazis baseline benchmark report:

```bash
/opt/homebrew/bin/python3.11 -m benchmarks.run_benchmarks --export --verbose
```

Regenerate the 2D-Place `.map` benchmark baselines and run that suite. The converter
(`benchmarks/map_baseline.py`, a dev tool — not part of the shipped `src/` package) needs
the Mebel Pro repo checked out next to this one for its `.map` parser; override the
location with `MEBEL_PRO_MAP_PARSER` if it lives elsewhere:

```bash
/opt/homebrew/bin/python3.11 -m benchmarks.map_baseline benchmarks/mapfiles --out-dir benchmarks/baselines_2dplace
/opt/homebrew/bin/python3.11 -m benchmarks.run_benchmarks benchmarks/baselines_2dplace --verbose
```

Run the real PackingSolver contract tests (requires the pinned executable on
`PATH`, or `CUTTING_ENGINE_PACKINGSOLVER_BIN` set to its absolute path):

```bash
/opt/homebrew/bin/python3.11 -m pytest -m packingsolver
```
