This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |