Metadata-Version: 2.4
Name: strokeoutline
Version: 0.1.0
Summary: Deterministic variable-width stroke expansion from 2D centerlines to filled contours.
Author: Holger Nahrstaedt
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/schreibatlas/strokeoutline
Project-URL: Repository, https://github.com/schreibatlas/strokeoutline
Project-URL: Issues, https://github.com/schreibatlas/strokeoutline/issues
Project-URL: Changelog, https://github.com/schreibatlas/strokeoutline/releases
Keywords: geometry,stroke,outline,offset-curve,bezier,vector-graphics,svg
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
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: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: planarcurve<0.2,>=0.1
Provides-Extra: svg
Requires-Dist: fonttools>=4.55; extra == "svg"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: fonttools>=4.55; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Dynamic: license-file

# strokeoutline

`strokeoutline` converts 2D centerlines into deterministic filled contours with constant or variable width. It is reusable geometry extracted from InkGrammar's stroke outlining engine, without glyph, shaping, OCR, or handwriting-model responsibilities.

Use it for vector brushes, pressure-like width profiles, centerline fonts, skeleton thickening, corridors, and other centerline-based applications. The MVP preserves current geometry behavior; see the documentation for its limitations and compatibility contracts.

## Install

```bash
python -m pip install strokeoutline
```

For SVG path parsing, install the optional extra:

```bash
python -m pip install 'strokeoutline[svg]'
```

## Documentation

The complete guides and deliberate API reference are in the [documentation source](docs/index.md):

- [Getting started](docs/getting-started.md)
- [Examples](docs/examples.md)
- [API reference](docs/api/index.md)
- [Limitations](docs/limitations.md)

## Core example

```python
from strokeoutline import Line, Path2D, Subpath, outline

path = Path2D((Subpath((Line((0, 0), (10, 0)),)),))

result = outline(path, width=4.0)
print(result.bounds)
for contour in result.contours:
    print(contour)
```

Width is the full stroke diameter, not radius. Width profiles may be a positive constant, a strictly increasing piecewise-linear knot sequence spanning `0..1`, or a callable.

For compatibility, normalized width progress is based on segment index, not physical arc length:

```text
u = (segment_index + local_segment_parameter) / segment_count
```

Progress restarts at zero for each independent subpath. See [width profiles](docs/width-profiles.md) for details.

## Integration boundary

StrokeOutline owns centerline-to-contour geometry. Integrations such as InkGrammar own shaped-text traversal and domain-specific adaptation, and should call StrokeOutline rather than copy its outlining algorithm. The core package does not require FontTools; only the optional `strokeoutline.svg` adapter does.

## Development

```bash
python -m pip install -e '.[dev]'
ruff format --check .
ruff check .
pytest
python docs/make.py html
python docs/make.py doctest
```

## License

Apache-2.0.
