This script generates a random Voronoi (or Delaunay) pattern and automatically trims it to the selected polylines or regions.
It was originally inspired by MacBob's Voronoi Table Lamp:
http://www.cambam.co.uk/forum/index.php?topic=3954.msg26519#msg26519Several user variables are available to change the appearance of the output:
VType = "V" #Options are V="Voronoi Diagram" or D="Delaunay Triangulation"
RandomType = "Grid" #Options are "Random" or "Grid"
DiagramType = "Thick" #Options are "Line" or "Thick"
##For RandomType = "Random"
PointDensity = .1 #number of points per unit area
##For RandomType = "Grid"
GridSpacing = 4 #distance between grid seed points
Wildness = .7 #Measure of variation from grid seed points, 1.0 = Grid Spacing
##For DiagramType = "Thick"
VoronoiOffset = 0.2 #offset amount from voronoi lines, thickness is then 2X VoronoiOffset
SourceOffset = 0.5 #offset from border which contains the voronoi patterns
MacBob's concepts incorporated into this script:
* Rectangular grid of seed points with a certain amount of "wildness".
* Thickness value for the lines to create a stained glass window effect.
Select your bounding pattern before running the script.
Also make sure to combine polylines into Regions if you want to exclude interior islands.
The attached zip includes the script (voronoi_generator 4-5-15.py) and all of the necessary imports. The imported function is Steven Fortune's Sweepline Algorithm converted to Python by Bill Simons. Stay tuned, I am working on converting this to a plugin and will post here when it is complete.
Cheers - BillT