meslas.geometry package

Submodules

meslas.geometry.grid module

meslas.geometry.tilings module

Copyright (c) 2012-2019 Alex Chan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Generate regular tilings of the plane with Pillow.

Diagrams and background to this code are on my blog: http://alexwlchan.net/2016/10/tiling-the-plane-with-pillow/

meslas.geometry.tilings.draw_tiling(coord_generator, filename)

Given a coordinate generator and a filename, render those coordinates in a new image and save them to the file.

meslas.geometry.tilings.generate_hexagons(*args, **kwargs)

Generate coordinates for a tiling of hexagons.

meslas.geometry.tilings.generate_squares(*args, **kwargs)

Generate coordinates for a tiling of squares.

meslas.geometry.tilings.generate_triangles(*args, **kwargs)

Generate coordinates for a tiling of triangles.

meslas.geometry.tilings.generate_unit_hexagons(image_width, image_height)

Generate coordinates for a regular tiling of unit hexagons.

meslas.geometry.tilings.generate_unit_squares(image_width, image_height)

Generate coordinates for a tiling of unit squares.

meslas.geometry.tilings.generate_unit_triangles(image_width, image_height)

Generate coordinates for a tiling of unit triangles.

Module contents