Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## Re: [Inkscape-user] automatizing a random mosaic or creating a texture

 Re: [Inkscape-user] automatizing a random mosaic or creating a texture From: Bill Baxter - 2007-04-24 23:38:32 ```On 4/25/07, bulia byak wrote: > On 4/24/07, Terry Brown wrote: > > I don't think inkscape has that. Looks like the POV-ray pattern > > 'Crackle': > > > > http://www.povray.org/documentation/view/3.6.1/372/ > > > > --clip-- > > Mathematically, the set crackle(p)=0 is a 3D Voronoi diagram of a > > field of semi random points and crackle(p) < 0 is the distance from > > the set along the shortest path (a Voronoi diagram is the locus of > > points equidistant from their two nearest neighbors from a set of > > disjoint points, like the membranes in suds are to the centers of > > the bubbles). > > By the way, this might make a useful Python effect for Inkscape: Fill > the inside of a path with random points and build a Voronoi diagram > (as a set of polygon paths) of these points, or of the path's nodes, > or both. Any takers? > > See http://en.wikipedia.org/wiki/Voronoi > Doing Voronoi diagrams (and delaunay triangulations) robustly is tricky. Simpler algorithms tend to barf on input that has too many collinear points, or has points placed exactly on a grid. And the textbook implementations usually avoid constraints altogether. But the Triangle lib by Jonathan Shewchuk handles all that and more quite beautifully and can create both Voronoi diagrams and Delaunay triangulations of the interiors of arbitrary polygons. (Arbitrary in the sense of being concave and having holes. Probably not self-intersecting ones, though I haven't tried that). http://www.cs.cmu.edu/~quake/triangle.html The license is a bit odd though. Has some odd advertising requirements and commercial product restrictions: ------------------------------------------------------------------------------ These programs may be freely redistributed under the condition that the copyright notices (including the copy of this notice in the code comments and the copyright notice printed when the `-h' switch is selected) are not removed, and no compensation is received. Private, research, and institutional use is free. You may distribute modified versions of this code UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution of this code as part of a commercial system is permissible ONLY BY DIRECT ARRANGEMENT WITH THE AUTHOR. (If you are not directly supplying this code to a customer, and you are instead telling them how they can obtain it for free, then you are not required to make any arrangement with me.) ------------------------------------------------------------------------------ The author might be willing to make such a DIRECT ARRANGEMENT with inkscape folks. Worth contacting him. I've not found anything better for making "nice" triangulations of shapes. --bb ```