Metadata-Version: 2.1
Name: ormin-kamap
Version: 0.1.0
Summary: KA-MAP thin Python SDK — load / validate / evaluate / export via Node Worker
Author: Ormin / KA-MAP
License: MIT
Keywords: kamap,ormin,sdf,mesh,3d,parametric
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"

# ormin-kamap — KA-MAP Python SDK v0.1 (Alpha)

**PyPI / pip name:** `ormin-kamap`  
**Import / CLI:** `import kamap` · `python -m kamap`  
**License:** MIT (Copyright © 2026 KA-MAP / Ormin)

Thin SDK for AI researchers: load a `.kamap` recipe, evaluate a mesh, export STL/OBJ/GLB.

> **Alpha.** Not a drop-in “pip only” mesh engine. Evaluation goes through a **Node Worker** shipped with the KA-MAP monorepo / persona pack — not CUDA, not pure-Python Marching Cubes, not STEP/OCC.

## Requirements (read before install)

| Need | Why |
|------|-----|
| **Python** ≥ 3.8 | SDK runtime |
| **Node.js** ≥ 18 on `PATH` | `evaluate` / exports call the Worker (`check_node()`) |
| **Monorepo** or persona pack, or `KAMAP_ROOT` | This wheel does **not** bundle the Node Worker (R3 thin SDK) |

If Node is missing or `< 18`, `kamap.check_node()` / eval will fail — that is expected.

## Install

```bash
pip install ormin-kamap
# still needs Node ≥ 18 + Worker tree (monorepo / persona pack / KAMAP_ROOT)
```

From a local checkout of the KA-MAP monorepo (development):

```bash
pip install -e ./python[dev]
python -c "import kamap; kamap.check_node(); print(kamap.__version__)"
```

Optional: set `KAMAP_ROOT` to the absolute path of the monorepo root if auto-detect fails.

Do **not** use `pip install kamap` — the distribution name is **`ormin-kamap`**.

## Quick start

```python
import kamap

kamap.check_node()  # raises KamapNodeError if missing / < 18

doc = kamap.load("examples/gear.kamap")
kamap.validate(doc)  # raises KamapValidationError

mesh = kamap.evaluate(doc, resolution=64)
print(mesh.vertices.shape, mesh.stats["triangles"])

kamap.export_stl(doc, "gear.stl", resolution=64)
kamap.export_obj(doc, "gear.obj", resolution=64)
kamap.export_glb(doc, "gear.glb", resolution=64)
```

## API

| Function | Notes |
|----------|--------|
| `check_node()` | `node` on PATH and version ≥ 18 |
| `load(path)` | JSON → dict (v0.1 linear or v0.2 AST) |
| `validate(doc)` | same rules as CLI / browser validator |
| `evaluate(doc, resolution=128)` | mesh via **Node subprocess** |
| `export_obj` / `export_stl` / `export_glb` | writes mesh file |
| `export_step` | **stub** — CAD/STEP is R5, not in this package |

## Not in v0.1

- CUDA / GPU kernels
- Pure-Python Marching Cubes
- STEP / OpenCASCADE
- Bundled Node binary in the wheel

## External testers

Private monorepo users should receive a **persona pack** zip (SDK + Worker tree + smoke script), not a GitHub clone of the full SaaS app. After pack extract: `pip install -e ./python` (or `pip install ormin-kamap`) → `python python/scripts/smoke_persona.py …`.
