napari-boardgame-maker


Namenapari-boardgame-maker JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryMake boardgame tiles
upload_time2023-08-13 16:57:18
maintainer
docs_urlNone
authorJohannes Soltwedel
requires_python>=3.8
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # napari-boardgame-maker

[![License BSD-3](https://img.shields.io/pypi/l/napari-boardgame-maker.svg?color=green)](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-boardgame-maker.svg?color=green)](https://pypi.org/project/napari-boardgame-maker)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-boardgame-maker.svg?color=green)](https://python.org)
[![tests](https://github.com/jo-mueller/napari-boardgame-maker/workflows/tests/badge.svg)](https://github.com/jo-mueller/napari-boardgame-maker/actions)
[![codecov](https://codecov.io/gh/jo-mueller/napari-boardgame-maker/branch/main/graph/badge.svg)](https://codecov.io/gh/jo-mueller/napari-boardgame-maker)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-boardgame-maker)](https://napari-hub.org/plugins/napari-boardgame-maker)

This plugin turns 2D grayscale images into 3D-printable landscape tiles for a certain all-time tabletop boardgame which revolves around building settlements, obtaining ressources expanding and collecting more points than your opponents.

In short, images (for instance, [digital elevation models](https://en.wikipedia.org/wiki/Digital_elevation_model)) can be turned into surfaces like this:

| Image | Created tile|
| --- | --- |
| <img src="https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample.png"> | <img src="https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample_as_tile.png"> |

## Data

In principle, all 2D grayscale image data can be used to create a tile. However, using digital elevation models is particularly cool. Such data is publicly available at [OpenTopography.org](https://portal.opentopography.org/raster?opentopoID=OTSDEM.032021.4326.2). Acknowledgement:

```text
 NASA JPL. NASADEM Merged DEM Global 1 arc second V001. 2020, distributed by NASA EOSDIS Land Processes DAAC, https://doi.org/10.5067/MEaSUREs/NASADEM/NASADEM_HGT.001.
```
## Usage

To use the boardgame tile maker, open it from the plugins menu (`Plugins > napari-boardgame-maker: Boardgame Tile Maker`) or from the tools menu (`Tools > Boardgame tile maker (npbgm)`). There are a few steps and parameters to set before the tile can be created.

[](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/GUI_screenshot.jpg)

Clicking on `Make hexagon` and `Make number field` will create a hexagonal shape in the viewer (which will be the outline of the tile) and a circular field (which can later be used to put some markers, figures, chips, etc. On the center of the board).

![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample_with_shapes.png)

The next step is to set the parameters for the tile. The following parameters can be set:

### Radii and sizes

The following sketch shows the different radii and sizes that can be set:

![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/stride_and_town.png)

- `hexagon radius`: The radius of the hexagon (in pixels). Upon export, this will be rescaled to a desired physical size in mm.
- `number field radius`: The radius of the number field (in pixels). Can also be set in mm units. The pixels are changed accordingly if the size of the whole hexagon is changed.
- `stride`: The region next to the edge of the tile that should remain flat.
- `town radius`: A circular region around the edges of the hexagonal tiles that should remain flat.

### Topography

The following parameters can be set to create the topography of the tile:

![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/slope_and_heights.png)

- `slope`: Adds a smooth transition of a given width between the edge of the cropped topography and the level of the base platte. Setting this to zero will result in a sharp edge.
- `z-multiplier`: The height of the topography is multiplied by this factor. This can be used to scale the topography to the desired height.
- `Plate thickness`: The thickness of the base plate (in mm).

### Export

- CLicking on `produce tile` will run the workflow to create the tile
- Clicking `Export` will open a dialog to save the tile as an `.stl` file. *Note*: The tile will be exported in the size of the hexagon radius. If the hexagon radius is set to 100 mm, the tile will be exported as a 100 mm hexagon.

----------------------------------

This [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.

<!--
Don't miss the full getting started guide to set up your new package:
https://github.com/napari/cookiecutter-napari-plugin#getting-started

and review the napari docs for plugin developers:
https://napari.org/stable/plugins/index.html
-->

## Installation

You can install `napari-boardgame-maker` via [pip]:

    pip install napari-boardgame-maker


## Contributing

Contributions are very welcome. Tests can be run with [tox], please ensure
the coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the [BSD-3] license,
"napari-boardgame-maker" is free and open source software

## Issues

If you encounter any problems, please [file an issue] along with a detailed description.

[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin

[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "napari-boardgame-maker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Johannes Soltwedel",
    "author_email": "johannes_richard.soltwedel@tu-dresden.de",
    "download_url": "https://files.pythonhosted.org/packages/b6/d1/41a84f42d0fe812ad9d2e36bdf8ec3dc334b7d557244ee09b832bdd8c246/napari-boardgame-maker-0.0.2.tar.gz",
    "platform": null,
    "description": "# napari-boardgame-maker\r\n\r\n[![License BSD-3](https://img.shields.io/pypi/l/napari-boardgame-maker.svg?color=green)](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/LICENSE)\r\n[![PyPI](https://img.shields.io/pypi/v/napari-boardgame-maker.svg?color=green)](https://pypi.org/project/napari-boardgame-maker)\r\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-boardgame-maker.svg?color=green)](https://python.org)\r\n[![tests](https://github.com/jo-mueller/napari-boardgame-maker/workflows/tests/badge.svg)](https://github.com/jo-mueller/napari-boardgame-maker/actions)\r\n[![codecov](https://codecov.io/gh/jo-mueller/napari-boardgame-maker/branch/main/graph/badge.svg)](https://codecov.io/gh/jo-mueller/napari-boardgame-maker)\r\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-boardgame-maker)](https://napari-hub.org/plugins/napari-boardgame-maker)\r\n\r\nThis plugin turns 2D grayscale images into 3D-printable landscape tiles for a certain all-time tabletop boardgame which revolves around building settlements, obtaining ressources expanding and collecting more points than your opponents.\r\n\r\nIn short, images (for instance, [digital elevation models](https://en.wikipedia.org/wiki/Digital_elevation_model)) can be turned into surfaces like this:\r\n\r\n| Image | Created tile|\r\n| --- | --- |\r\n| <img src=\"https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample.png\"> | <img src=\"https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample_as_tile.png\"> |\r\n\r\n## Data\r\n\r\nIn principle, all 2D grayscale image data can be used to create a tile. However, using digital elevation models is particularly cool. Such data is publicly available at [OpenTopography.org](https://portal.opentopography.org/raster?opentopoID=OTSDEM.032021.4326.2). Acknowledgement:\r\n\r\n```text\r\n NASA JPL. NASADEM Merged DEM Global 1 arc second V001. 2020, distributed by NASA EOSDIS Land Processes DAAC, https://doi.org/10.5067/MEaSUREs/NASADEM/NASADEM_HGT.001.\r\n```\r\n## Usage\r\n\r\nTo use the boardgame tile maker, open it from the plugins menu (`Plugins > napari-boardgame-maker: Boardgame Tile Maker`) or from the tools menu (`Tools > Boardgame tile maker (npbgm)`). There are a few steps and parameters to set before the tile can be created.\r\n\r\n[](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/GUI_screenshot.jpg)\r\n\r\nClicking on `Make hexagon` and `Make number field` will create a hexagonal shape in the viewer (which will be the outline of the tile) and a circular field (which can later be used to put some markers, figures, chips, etc. On the center of the board).\r\n\r\n![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/sample_with_shapes.png)\r\n\r\nThe next step is to set the parameters for the tile. The following parameters can be set:\r\n\r\n### Radii and sizes\r\n\r\nThe following sketch shows the different radii and sizes that can be set:\r\n\r\n![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/stride_and_town.png)\r\n\r\n- `hexagon radius`: The radius of the hexagon (in pixels). Upon export, this will be rescaled to a desired physical size in mm.\r\n- `number field radius`: The radius of the number field (in pixels). Can also be set in mm units. The pixels are changed accordingly if the size of the whole hexagon is changed.\r\n- `stride`: The region next to the edge of the tile that should remain flat.\r\n- `town radius`: A circular region around the edges of the hexagonal tiles that should remain flat.\r\n\r\n### Topography\r\n\r\nThe following parameters can be set to create the topography of the tile:\r\n\r\n![](https://github.com/jo-mueller/napari-boardgame-maker/raw/main/docs/imgs/slope_and_heights.png)\r\n\r\n- `slope`: Adds a smooth transition of a given width between the edge of the cropped topography and the level of the base platte. Setting this to zero will result in a sharp edge.\r\n- `z-multiplier`: The height of the topography is multiplied by this factor. This can be used to scale the topography to the desired height.\r\n- `Plate thickness`: The thickness of the base plate (in mm).\r\n\r\n### Export\r\n\r\n- CLicking on `produce tile` will run the workflow to create the tile\r\n- Clicking `Export` will open a dialog to save the tile as an `.stl` file. *Note*: The tile will be exported in the size of the hexagon radius. If the hexagon radius is set to 100 mm, the tile will be exported as a 100 mm hexagon.\r\n\r\n----------------------------------\r\n\r\nThis [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\r\n\r\n<!--\r\nDon't miss the full getting started guide to set up your new package:\r\nhttps://github.com/napari/cookiecutter-napari-plugin#getting-started\r\n\r\nand review the napari docs for plugin developers:\r\nhttps://napari.org/stable/plugins/index.html\r\n-->\r\n\r\n## Installation\r\n\r\nYou can install `napari-boardgame-maker` via [pip]:\r\n\r\n    pip install napari-boardgame-maker\r\n\r\n\r\n## Contributing\r\n\r\nContributions are very welcome. Tests can be run with [tox], please ensure\r\nthe coverage at least stays the same before you submit a pull request.\r\n\r\n## License\r\n\r\nDistributed under the terms of the [BSD-3] license,\r\n\"napari-boardgame-maker\" is free and open source software\r\n\r\n## Issues\r\n\r\nIf you encounter any problems, please [file an issue] along with a detailed description.\r\n\r\n[napari]: https://github.com/napari/napari\r\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\r\n[@napari]: https://github.com/napari\r\n[MIT]: http://opensource.org/licenses/MIT\r\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\r\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\r\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\r\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\r\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\r\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\r\n\r\n[napari]: https://github.com/napari/napari\r\n[tox]: https://tox.readthedocs.io/en/latest/\r\n[pip]: https://pypi.org/project/pip/\r\n[PyPI]: https://pypi.org/\r\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Make boardgame tiles",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cf52d4c8012ff1e1d2c7eedeec3ed6a12b934d1ef6812fa5177fad0ccaefb28f",
                "md5": "d6aa2fb9f5e17e897a94079aaf6380a0",
                "sha256": "fa1e5cc98cdb92b7a2e483e244d6f01a29f3c6ad82389af85c218cb1fe484250"
            },
            "downloads": -1,
            "filename": "napari_boardgame_maker-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6aa2fb9f5e17e897a94079aaf6380a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10359,
            "upload_time": "2023-08-13T16:57:16",
            "upload_time_iso_8601": "2023-08-13T16:57:16.219130Z",
            "url": "https://files.pythonhosted.org/packages/cf/52/d4c8012ff1e1d2c7eedeec3ed6a12b934d1ef6812fa5177fad0ccaefb28f/napari_boardgame_maker-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6d141a84f42d0fe812ad9d2e36bdf8ec3dc334b7d557244ee09b832bdd8c246",
                "md5": "c9ca4894907f11ef4d45c733eb832a8a",
                "sha256": "cb05a9254705ac752a73a5f247dbfc92d7817415ac6b9609ded1e781b5f03bf9"
            },
            "downloads": -1,
            "filename": "napari-boardgame-maker-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c9ca4894907f11ef4d45c733eb832a8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11959,
            "upload_time": "2023-08-13T16:57:18",
            "upload_time_iso_8601": "2023-08-13T16:57:18.347981Z",
            "url": "https://files.pythonhosted.org/packages/b6/d1/41a84f42d0fe812ad9d2e36bdf8ec3dc334b7d557244ee09b832bdd8c246/napari-boardgame-maker-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-13 16:57:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "napari-boardgame-maker"
}
        
Elapsed time: 1.59723s