Banner

Haskell, PDF and Penrose Tilings

Posté par alpheccar le19 Oct 2006 à 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:

imageTiling with recursion level 8

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.

Pas de tags

Pièces liées

Commentaires

Ajouter un commentaire...

Posté par Pseudonym le24 Oct 2006 à07:00 CEST

Cool! Reminds me of something I did a year or so ago.

Posté par alpheccar le20 Oct 2006 à18: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.

Posté par Norman le20 Oct 2006 à10: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 !