Skip to main content

Create polygon-tesselation mazes from a variety of sources.

Project description

================================================= PolyMaze - Create mazes from a variety of sources =================================================

This utility converts several different kinds of inputs into mazes.

Allowed Inputs:

  • Aspect ratio (height / width) of a rectangular maze
  • Text - convert the content of the string into a maze / mazes
  • Image - convert the dark parts of an image into a maze / mazes

Options:

  • Height / Width - adjust the difficulty (measured in polygon side lengths)
  • Complexity - adjust the difficulty (measured in polygon density)
  • Font - use your own font when making a String maze (especially for unicode strings)
  • Shape - explicitly choose the type of tesselation used in the maze
https://github.com/kobejohn/polymaze/raw/master/docs/Globe_Polycat_small.png https://github.com/kobejohn/polymaze/raw/master/docs/String_small.png

Installation:

polymaze should work with Py2 or Py3.

pip install polymaze

If you get the error decoder zip not available when using it, then probably PILLOW did not install completely. Try to upgrade or reinstall PILLOW and make sure it says png support was installed.

Commandline Usage:

To make a generic rectangular maze, at the command line:

polymaze
https://github.com/kobejohn/polymaze/raw/master/docs/rectangle_small.png

To see all options:

polymaze -h

For example, to make a string into a maze with some extra options (note the n gets converted to a real newline internally):

polymaze --text "Happy\nBirthday!" --complexity 10 --shape Polycat
polymaze -t 迷路 -c 10 -s OctaDiamond --font meiryob.ttc
https://github.com/kobejohn/polymaze/raw/master/docs/birthday_small.png https://github.com/kobejohn/polymaze/raw/master/docs/unicode_small.png

Everything above assumes the command line entry point (named polymaze) works after installation. If not, then you will need to navigate to the root package directory and use:

python cli_runner.py [--options...]

Library Usage:

Please see demo.py for examples of how to use the components. You can also run it simply with:

python demo.py

The primary components are PolyGrid (the geometric core of the whole package), and PolyMaze which converts a PolyGrid into a maze.

Extension:

If anyone is interested, I can document how to specify new tessellations.

Background and Feedback:

I developed this to regain some basic trigonometry skills which I have lost over the years.

If you find this useful or have any feedback, please let me know! Specifically I have only tested this on Windows so please make an issue if it doesn’t work in Linux, etc.

License:

MIT. See LICENSE

Bundled Noto CJK Font:

SIL Open Font License, Version 1.1. See polymaze/font/LICENSE_CJK.txt

Project details


Release history Release notifications

This version
History Node

0.7.0

History Node

0.6.91

History Node

0.6.9

History Node

0.6.8

History Node

0.6.7

History Node

0.6.6

History Node

0.6.5

History Node

0.6.4

History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5b1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
polymaze-0.7.0-py2.py3-none-any.whl (15.8 MB) Copy SHA256 hash SHA256 Wheel 2.7 Dec 27, 2015
polymaze-0.7.0.zip (15.9 MB) Copy SHA256 hash SHA256 Source None Dec 27, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page