Closed abetusk closed 5 years ago
Hi @abetusk !
Thanks for idea! I took your example and added it to a src/examples folder. I only added a comment about the redundant edges, and also fixed some compiler issues. It's also added to the tests to make sure it always works. It required some maintenance overall since it was the first example, so I took it upon myself to organize it.
Here is the PR: https://github.com/JCash/voronoi/pull/13 I've already pushed to the dev branch, but if you see any changes you'd like, let me know :)
Hi @JCash, glad you like the idea!
You might want to consider:
simple.c
file to describe what the program is doingREADME
in examples
sub directory describing the contentsREADME
, pointing to the examples
sub directory for people wanting some sample code (presumably the examples
sub directory can be populated with further examples down the line).Updated the example folder with a README with some brief info
Thanks for the great library!
It would be helpful to provide a simple example program of usage. The
main.c
is a little verbose and has a lot of cruft dealing with coloring and saving to an image file.Here is an example program:
The generated seed sites:
Visualizing the seed sites and edges with gnuplot:
This assumes you're in an
example
subdirectory, say, to compile and run. The number of points is hard coded and it creates the points randomly in a 1x1 box, but the above example gets across clearly how to set up, use and get useful information out of the library. Presumably this 'double covers' the half edges but for illustration purposes I don't think that's a problem.I'd be happy to submit a pull request if that's helpful.