ian-ross/diagrams-lib — pull request #1 by ian-ross (2011-11-05 19:02:25+00:00)
Title: Ellipses as arcs

There was a problem with my changes for this: the circlePath function returns a path with its origin at (r,0), rather than at (0,0). I had a bit of trouble fixing things, mostly because I don't really yet understand the relationship between paths and trails and the type constraints that go with them. The fix here is a bit ugly, since it involves exporting `arcT` from `Arc.hs`, but it seems to work OK. I'd be very interested to see if there's a cleaner way to do this.

For the constraints, in particular, I don't understand all the `Ord v` constraints for `Path v`, e.g., in the `HasOrigin` instance definition. Trails don't have this constraint, and it's not immediately clear to me why adding a base point to a trail should entail a requirement that the underlying coordinate type be ordered. Perhaps that's the wrong way of thinking about it though.

Anyway, I have to say that I'm really enjoying playing with diagrams, although I'm only dipping a toe so far. I'm actually thinking about having a go at the linear constraints side of things, as it's something I've been interested in since using AutoCAD's nice constraint based drawing tool about 10 years ago. I've got lots of ideas; one or two of them might even work...

Ian.