Skip to content

Instantly share code, notes, and snippets.

@kevinjardine
kevinjardine / vertex_figure_search.py
Created May 13, 2011 20:35
Used by the Imperfect Congruence website
#Finds all possible regular polygon vertex types
# reduce the problem to integer math
# with a lowest common denominator
# that is divisible by all numbers up to 12
dem = 8*9*5*7*11
ang = {}
for i in range(3,13):
ang[i] = (dem / i) * (i-2)
@kevinjardine
kevinjardine / tiler.py
Created July 24, 2011 12:52
A universal tiler and polygon decompositor
# To use this, you will want to change the location of the saved data
# at least and possibly the functions called below (at the end of the file).
# You first need to install the Python Shapely library for manipulating polygons:
# http://trac.gispython.org/lab/wiki/Shapely
from math import pi, sin, cos, atan2
import shapely.geometry
import sys, copy