Metadata-Version: 2.4
Name: cadmea
Version: 0.1.0
Summary: Symbolic parametric CAD value kernel with reverse-mode autodiff
Requires-Python: >=3.10
License-Expression: Apache-2.0
Description-Content-Type: text/markdown
Author: Cadmea contributors
Author-email: Cadmea contributors <maintainers@cadmea.com>
Maintainer: Cadmea maintainers
Maintainer-email: Cadmea maintainers <maintainers@cadmea.com>
Keywords: cad, parametric, autodiff, geometry, optimization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Homepage, https://cadmea.com
Project-URL: Documentation, https://cadmea.com
Project-URL: Source, https://cadmea.com
Project-URL: Issues, https://cadmea.com

# cadmea

Cadmea is currently a symbolic parametric CAD kernel prototype. The packaged
Python surface contains fixed-size symbolic values, reverse-mode autodiff, and a
small optimizer layer.

## Current Python API

```python
import math

import cadmea as cd

x = cd.Parameter(0.2, name="x")
opt = cd.optim.Adam([x], lr=0.02)

for _ in range(520):
    residual = cd.sin(x) - 0.5
    loss = residual * residual
    opt.zero_grad()
    loss.backward()
    opt.step()

assert abs(math.sin(x.value[0]) - 0.5) < 1e-8
```

The active value model is:

- `Constant`: fixed scalar/vec1, vec2, vec3, or vec4 value.
- `Parameter`: user-owned differentiable input.
- `Undefined`: solver-owned unknown placeholder with optional hint.
- `Expression`: derived symbolic value.

Constructors infer dimension from arguments:

```python
radius = cd.Parameter(15.0)
center = cd.Parameter(10.0, 20.0)
origin = cd.Constant(0.0, 0.0)
unknown = cd.Undefined(hint=(0.0, 0.0))
packed = cd.vec2(radius, cd.sin(radius))
```

Reverse-mode differentiation currently supports arithmetic, unary negation,
`sin`, and `cos`. Gradients accumulate on `Parameter` leaves:

```python
w = cd.Parameter(190.0)
h = cd.Parameter(240.0)
area = w * h

area.backward()
assert w.grad == (240.0,)
assert h.grad == (190.0,)
```

Optimizers live under `cadmea.optim`:

- `SGD`
- `RMSProp`
- `Adam`
- `AdamW`
- `Adagrad`

Optimizers mutate only `Parameter` values. They do not assign `Undefined`
values and are separate from the future sketch constraint solver.
