pynrose


Namepynrose JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryP3 Penroser Tiling Generator
upload_time2024-02-01 15:54:28
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords de bruijn penrose tiling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pynrose - P3 Penrose Tiling Generator

This is a python library and stand-alone program to generate P3 penrose
tilings.

## Installation

```pip install pynrose```

## Stand-alone program

As a stand-alone program, this is able to generate P3 penrose tilings
to SVG. It supports a two modes of operation.

The SVG mode outputs each rhombus as a separate closed path, with
different styles applied to thick and thin rhombii. This is intended
for visual/display applications.

The SVGLINE mode outputs each rhombus edge as a separate path, and
ensures the edges are deduplicated, to avoid re-cutting/etching the
same line multiple times, for CNC/laser etching types of applications. 

In both modes, the tiling can be split up into multiple smaller tilings
that can be recombined with no overlaps or missing rhombii. This allows
a tiling to be split up into multiple smaller parts, based on the
constraints of the manufacturing process, and then assembled into a single
large tiling.

## CLI Usage

To generate a random penrose tiling as an SVG 

```pynrose > tiling.svg```

To explore more of the options that are available, you can use --help or -?

```pynrose --help```

## API Usage

This also exposes an API that can be used to generate P3 penrose tilings programatically
for any other use you may have.

The API documentation can be found at https://pynrose.readthedocs.io

```python
from pynrose import Tiling, Grid, Vector

# generate a new tiling with random offsets
tiling = Tiling()
grid = Grid(Vector(0, 0), Vector(20, 20))

# iterate over all rhombii whose midpoints are in the grid cell from (0, 0) to (20, 20)
for rhombus in tiling.rhombii(grid.cell(0, 0)):
    print(rhombus.vertices)
```

## Generation Algorithm
The generation algorithm is based on the de Bruijn method, where there are 5 families
of equally spaced parallel lines, and each line intersection represents a
rhombus in the penrose tiling.

You can read more at

* https://www.mathpages.com/home/kmath621/kmath621.htm
* http://www.ams.org/publicoutreach/feature-column/fcarc-ribbons
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pynrose",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "de bruijn,penrose,tiling",
    "author": "",
    "author_email": "Ben Gruver <jesusfreke@jesusfreke.com>",
    "download_url": "https://files.pythonhosted.org/packages/3e/c1/ffa0cd7fb23ce9f617ba7e5c4f2cd901fcb2288922f24a8b718bf9128cf7/pynrose-1.0.0.tar.gz",
    "platform": null,
    "description": "# pynrose - P3 Penrose Tiling Generator\n\nThis is a python library and stand-alone program to generate P3 penrose\ntilings.\n\n## Installation\n\n```pip install pynrose```\n\n## Stand-alone program\n\nAs a stand-alone program, this is able to generate P3 penrose tilings\nto SVG. It supports a two modes of operation.\n\nThe SVG mode outputs each rhombus as a separate closed path, with\ndifferent styles applied to thick and thin rhombii. This is intended\nfor visual/display applications.\n\nThe SVGLINE mode outputs each rhombus edge as a separate path, and\nensures the edges are deduplicated, to avoid re-cutting/etching the\nsame line multiple times, for CNC/laser etching types of applications. \n\nIn both modes, the tiling can be split up into multiple smaller tilings\nthat can be recombined with no overlaps or missing rhombii. This allows\na tiling to be split up into multiple smaller parts, based on the\nconstraints of the manufacturing process, and then assembled into a single\nlarge tiling.\n\n## CLI Usage\n\nTo generate a random penrose tiling as an SVG \n\n```pynrose > tiling.svg```\n\nTo explore more of the options that are available, you can use --help or -?\n\n```pynrose --help```\n\n## API Usage\n\nThis also exposes an API that can be used to generate P3 penrose tilings programatically\nfor any other use you may have.\n\nThe API documentation can be found at https://pynrose.readthedocs.io\n\n```python\nfrom pynrose import Tiling, Grid, Vector\n\n# generate a new tiling with random offsets\ntiling = Tiling()\ngrid = Grid(Vector(0, 0), Vector(20, 20))\n\n# iterate over all rhombii whose midpoints are in the grid cell from (0, 0) to (20, 20)\nfor rhombus in tiling.rhombii(grid.cell(0, 0)):\n    print(rhombus.vertices)\n```\n\n## Generation Algorithm\nThe generation algorithm is based on the de Bruijn method, where there are 5 families\nof equally spaced parallel lines, and each line intersection represents a\nrhombus in the penrose tiling.\n\nYou can read more at\n\n* https://www.mathpages.com/home/kmath621/kmath621.htm\n* http://www.ams.org/publicoutreach/feature-column/fcarc-ribbons",
    "bugtrack_url": null,
    "license": "",
    "summary": "P3 Penroser Tiling Generator",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://pynrose.readthedocs.io/",
        "Homepage": "https://github.com/jesusfreke/pynrose"
    },
    "split_keywords": [
        "de bruijn",
        "penrose",
        "tiling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d80e3b11bb75d07df46c1a9286781c34be144ae965c7f146c7f7a99472301058",
                "md5": "ef15c782ff79d5d6c3cb933811762c6b",
                "sha256": "78f7e0e6ff5285c033d28adfead445aaa31041a47a50dbdc8d20a5c56f231432"
            },
            "downloads": -1,
            "filename": "pynrose-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef15c782ff79d5d6c3cb933811762c6b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 14600,
            "upload_time": "2024-02-01T15:54:26",
            "upload_time_iso_8601": "2024-02-01T15:54:26.757546Z",
            "url": "https://files.pythonhosted.org/packages/d8/0e/3b11bb75d07df46c1a9286781c34be144ae965c7f146c7f7a99472301058/pynrose-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ec1ffa0cd7fb23ce9f617ba7e5c4f2cd901fcb2288922f24a8b718bf9128cf7",
                "md5": "5c11e3b99518fa93fee57223ed749c79",
                "sha256": "2fcd773b70d881f15a9cccedb11f8b3e752995aafe995454de96f10d258012a7"
            },
            "downloads": -1,
            "filename": "pynrose-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5c11e3b99518fa93fee57223ed749c79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 11921,
            "upload_time": "2024-02-01T15:54:28",
            "upload_time_iso_8601": "2024-02-01T15:54:28.245829Z",
            "url": "https://files.pythonhosted.org/packages/3e/c1/ffa0cd7fb23ce9f617ba7e5c4f2cd901fcb2288922f24a8b718bf9128cf7/pynrose-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-01 15:54:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jesusfreke",
    "github_project": "pynrose",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pynrose"
}
        
Elapsed time: 0.22570s