Metadata-Version: 2.4
Name: pleat
Version: 0.1.0
Summary: Constructing geometric tilings and transforming them into origami crease patterns
Project-URL: Repository, https://github.com/imagirom/pleat
Project-URL: Documentation, https://imagirom.github.io/pleat/
Author: Roman Remme
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
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 :: Artistic Software
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Requires-Dist: fastcluster
Requires-Dist: matplotlib
Requires-Dist: networkx
Requires-Dist: numba
Requires-Dist: numpy
Requires-Dist: pulp
Requires-Dist: pycairo
Requires-Dist: pyyaml
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: svgpathtools
Requires-Dist: svgwrite
Requires-Dist: sympy
Requires-Dist: tqdm
Provides-Extra: all
Requires-Dist: black; extra == 'all'
Requires-Dist: einops; extra == 'all'
Requires-Dist: ipympl; extra == 'all'
Requires-Dist: ipywidgets; extra == 'all'
Requires-Dist: jupyter; extra == 'all'
Requires-Dist: mahotas; extra == 'all'
Requires-Dist: meshio; extra == 'all'
Requires-Dist: mkdocs-gen-files; extra == 'all'
Requires-Dist: mkdocs-jupyter; extra == 'all'
Requires-Dist: mkdocs-literate-nav; extra == 'all'
Requires-Dist: mkdocs-materialx; extra == 'all'
Requires-Dist: mkdocstrings[python]; extra == 'all'
Requires-Dist: mypy; extra == 'all'
Requires-Dist: nbstripout; extra == 'all'
Requires-Dist: plotly; extra == 'all'
Requires-Dist: pre-commit; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-cov; extra == 'all'
Requires-Dist: rdp; extra == 'all'
Requires-Dist: scikit-image; extra == 'all'
Requires-Dist: torch; extra == 'all'
Requires-Dist: widgetsnbextension; extra == 'all'
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: nbstripout; extra == 'dev'
Requires-Dist: plotly; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: rdp; extra == 'dev'
Provides-Extra: docs
Requires-Dist: einops; extra == 'docs'
Requires-Dist: ipympl; extra == 'docs'
Requires-Dist: ipywidgets; extra == 'docs'
Requires-Dist: jupyter; extra == 'docs'
Requires-Dist: mahotas; extra == 'docs'
Requires-Dist: mkdocs-gen-files; extra == 'docs'
Requires-Dist: mkdocs-jupyter; extra == 'docs'
Requires-Dist: mkdocs-literate-nav; extra == 'docs'
Requires-Dist: mkdocs-materialx; extra == 'docs'
Requires-Dist: mkdocstrings[python]; extra == 'docs'
Requires-Dist: plotly; extra == 'docs'
Requires-Dist: rdp; extra == 'docs'
Requires-Dist: scikit-image; extra == 'docs'
Requires-Dist: torch; extra == 'docs'
Requires-Dist: widgetsnbextension; extra == 'docs'
Provides-Extra: image
Requires-Dist: mahotas; extra == 'image'
Requires-Dist: scikit-image; extra == 'image'
Provides-Extra: intersecting-cylinders
Requires-Dist: plotly; extra == 'intersecting-cylinders'
Requires-Dist: rdp; extra == 'intersecting-cylinders'
Provides-Extra: notebook
Requires-Dist: ipympl; extra == 'notebook'
Requires-Dist: ipywidgets; extra == 'notebook'
Requires-Dist: jupyter; extra == 'notebook'
Requires-Dist: widgetsnbextension; extra == 'notebook'
Provides-Extra: threed
Requires-Dist: meshio; extra == 'threed'
Provides-Extra: torch
Requires-Dist: einops; extra == 'torch'
Requires-Dist: torch; extra == 'torch'
Description-Content-Type: text/markdown

# Pleat

[![PyPI](https://img.shields.io/pypi/v/pleat)](https://pypi.org/project/pleat/)
[![CI](https://github.com/imagirom/pleat/actions/workflows/ci.yml/badge.svg)](https://github.com/imagirom/pleat/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-imagirom.github.io%2Fpleat-teal)](https://imagirom.github.io/pleat/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/imagirom/pleat/blob/main/LICENSE)

**Construct geometric tilings, and turn them into origami tessellations.**

<p align="center">
  <img src="https://raw.githubusercontent.com/imagirom/pleat/main/docs/notebooks/images/shrink-rotate/Seven%20Flowers.jpg" alt="Seven Flowers — folded shrink-rotate tessellation" height="240" />
  <img src="https://raw.githubusercontent.com/imagirom/pleat/main/docs/notebooks/images/intersecting-cylinders/Double%20Dodecagon.png" alt="Double Dodecagon — folded intersecting-cylinders tessellation" height="240" />
  <img src="https://raw.githubusercontent.com/imagirom/pleat/main/docs/notebooks/images/shrink-rotate/7.4.3%20Circles.jpg" alt="7.4.3 Circles — folded shrink-rotate tessellation" height="240" />
</p>

Pleat is a Python library for constructing, manipulating, and visualizing geometric tilings across Euclidean, hyperbolic, and spherical geometries.
It can generate crease patterns for origami tessellations and corrugations using several algorithms which can be exported for printing or plotting, and can preview folded states.

## Features

- **Half-edge data structure** — efficient DCEL representation for planar graphs with topology, angles, and positions
- **Tiling construction** — all 11 Archimedean tilings, Platonic solids, hyperbolic tilings, and custom prototiles
- **Conway operators** — dual, ambo, truncate, kis, join, gyro, starify, and more (including alternating flagstones, loft, lace, expand, chamfer)
- **Three geometries** — Euclidean plane, Poincaré disk model (hyperbolic), spherical
- **Origami pipelines** — shrink-rotate, intersecting cylinders, alternating flagstones
- **Folding simulation** — flat folding, finding a face ordering by solving an ILP
- **Multiple renderers** — Cairo for pretty pictures, svgwrite for optimized output for cutting plotters (or laser cutters)

## Installation

```bash
pip install pleat
```

To run the [example notebooks](https://imagirom.github.io/pleat/) locally, clone and install with all extras:

```bash
git clone https://github.com/imagirom/pleat.git && cd pleat
uv venv --python 3.14
uv pip install -e ".[all]"
jupyter lab docs/notebooks
```

Finer-grained extras (e.g. to skip heavy dependencies such as torch) are listed in the
[installation guide](https://imagirom.github.io/pleat/getting-started/installation.html).

## Quick start

The whole pipeline — build a tiling, turn it into a crease pattern, preview the folded state:

```python
import numpy as np
import pleat
from pleat.shrink_rotate import crease_orientation, shrink_rotate_pattern

# build a tiling: two rings of hexagons around a central one
G = pleat.example_graphs.from_tiles(pleat.example_tilesets.platonic(n=6), rings=2)

# decide which faces fold on top, then construct the crease pattern
crease_orientation.assign_this_way_from_center(G)
CP = shrink_rotate_pattern(G, simplify_boundary=True, alpha=np.pi / 5, factor=0.5)

# fold it: preview the folded state with solved layer ordering
pleat.overlap.fold_complete(CP, quiet=True).show()
```

<p align="center"><img src="https://raw.githubusercontent.com/imagirom/pleat/main/docs/notebooks/images/readme_quickstart_1.png" alt="Quick start output: crease pattern and backlit folded state" width="410" /><img src="https://raw.githubusercontent.com/imagirom/pleat/main/docs/notebooks/images/readme_quickstart_2.png" alt="Quick start output: folded top and bottom views" width="410" /></p>

## Documentation

The full documentation lives at **[imagirom.github.io/pleat](https://imagirom.github.io/pleat/)**.
Its heart is a series of executed Jupyter notebooks — starting with the
[pipeline overview](https://imagirom.github.io/pleat/index.html) — covering tiling
construction, and methods to turn them into origami tesselations. The notebook
sources are in [`docs/notebooks/`](https://github.com/imagirom/pleat/tree/main/docs/notebooks).

To build the site locally:

```bash
uv pip install -e ".[docs]"
mkdocs serve                      # dev server at http://127.0.0.1:8000
```

## Development

```bash
uv venv --python 3.14 && uv pip install -e ".[dev]"   # contributor setup (in a clone)
uv run pytest -m "not slow"                    # tests (drop the -m flag for the full suite)
uv run --extra dev black --check pleat tests   # formatting check
pre-commit install                             # install git hooks
```

GitHub Actions CI runs tests, lint, and `mkdocs build --strict` on every push and pull request (`.github/workflows/ci.yml`).

## License

The code is MIT-licensed — see [LICENSE](https://github.com/imagirom/pleat/blob/main/LICENSE).

The photographs of folded origami models (in `docs/notebooks/images/`) are © Roman Remme and licensed under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/).
