Haskell, PDF and Penrose Tilings
Posted by alpheccar - Oct 19 2006 at 20:28 CEST
I am currently learning Haskell and the only way to learn a programming language is coding. So, I decided to write a PDF library.
Why PDF ? On a Mac, PDF is a cool format which can be easily used in any application. And the rendering is good. Moreover, I have had problems with other graphic library for Haskell : problems to build them on a Mac or not beautiful rendering.
You can get the package with:
darcs get http://darcs.alpheccar.org/HPDF
It is not Mac specific. You can build it on Windows and any Unix.
It is containing everything : documentation, Cabal configuration files and a test program. The test program is generating Penrose tilings (if my understanding of the article I read was good. It may be wrong but the result looks like Penrose tilings very much). Here is an example:
The library is very experimental since i wrote it mainly to learn. I have not implemented all PDF operators. It is very easy to add new ones and with the current supported subset it is already possible to have lot of fun.
I have attached an example PDF to this post too.
UPDATE : I have updated the library in the darcs repository. I removed a space leak, added support for transparency and clipping and cleaned a bit the API.



Posted by Pseudonym - Oct 24 2006 at07:00 CEST
Cool! Reminds me of something I did a year or so ago.
Posted by alpheccar - Oct 20 2006 at18:49 CEST
Why not install darcs instead ? That's very easy to use and very useful. You can find a binary for your platform on their web site.
Posted by Norman - Oct 20 2006 at10:08 CEST
I don't have darcs installed, could you please add a PDF file you produced and the corresponding Haskell code ? Thanks a lot for your work !