Monday, November 30, 2009

Wumpus

Copperbox revision 986.

I've started writing the manual for wumpus-core. The intention is to work on it when I get 'writers block' with wumpus-extra.

Sunday, November 29, 2009

Wumpus

Copperbox revision 985.

I've added a new prototype arrowhead for 'hooks'. I'm still no clearer on how I should represent lines at a level above Wumpus.Core's representation, so the arrowheads are very much doodles at the moment.

Saturday, November 28, 2009

wumpus-core-0.13.1

Copperbox revision 984.

Bug fix for SVG curve drawing - I was using the S path command in SVG when I should have been using C (C is the command that matches PostScript's curveto).

Plus some doodling with arrowheads which is how I found the bug.

Wumpus

Copperbox revision 983.

Trivial changes - all the license lines in wumpus-extra have been changed to 'BSD3'.

Friday, November 27, 2009

wumpus-core-0.13.0 and wumpus-extra0.5.0

Copperbox revision 982.

Wumpus core and extra release archives. Core is Hackage bound as the version currently on Hackage is a lot more hokey than I realized.

Wumpus

Copperbox revision 981.

I've re-implemented multilabel in Core.Picture and updated wumpus-extra to work with the latest wumpus-core.

Thursday, November 26, 2009

Wumpus

Copperbox revision 980.

Last bit of haddocking for wumpus-core. Tomorrow I'll make a new release for Hackage.

Wumpus

Copperbox revision 979.

More haddock docs for wumpus core - two modules to go. I've also divided Core.TextEncoding into two modules, one for the 'outside world' interface and the other for internal functionality.

Wumpus

Copperbox revision 978.

And more haddock docs for wumpus-core. Still three and a half modules to go.

Wumpus

Copperbox revision 977.

More Haddock docs for wumpus-core.

Wednesday, November 25, 2009

Wumpus

Copperbox revision 976.

More Haddock docs for wumpus-core, plus unifying the license clause in all the source files.

Wumpus

Copperbox revision 975.

More Haddock docs for wumpus-core. Plus improvements to VectorSpace instances of Wumpus.Core.Colour.

Wumpus

Copperbox revision 974.

First round of haddocking wumpus-core. The version on Hackage has quite a bit of documentation but it isn't comprehensive.

Tuesday, November 24, 2009

wumpus-core-0.12.0 and wumpus-extra-0.4.0

Copperbox revision 973.

I've made new releases of wumpus-core and wumpus-extra. I'm going to upload this revision of wumpus-core to Hackage. I've made a download of the wumpus-extra release available on Copperbox as it is too rough for Hackage.

Wumpus and data-aviary-0.2.0

Copperbox revision 972.

I've got wumpus-core, wumpus-extra and data-aviary all working together (as wumpus-core is now pretty stable wumpus-extra only needed one change).

Data-aviary-0.2.0 is Hackage bound, then I can look at writing a summary for wumpus-core and uploading that too.

Wumpus

Copperbox revision 971.

Wumpus optimized!

Wumpus now generates efficient (straight line) PostScript. The only calls to gsave and grestore are now bookends of the file (which is necessary for EPS files). Changing the CTM or the graphics state no longer needs to be done in gsave ... grestore block - changes to CTM are undone by applying the matrix inverse of the transformation on exit of a 'block' this is much more efficient than putting the graphics state on the stack. Similarly, changes of stroke width, dash pattern, ... are undone after a path is drawn.

Colour and font changes are slightly different - here Wumpus uses the fact that all leaves in the tree have a colour attribute and all label leaves have a Font attribute. Wumpus can avoid an undo because the next leaf will do a set-property anyway.

With a bit of tidying up and checking that the examples in wumpus-extra still work, wumpus-core should be ready for Hackage.

Monday, November 23, 2009

Wumpus

Copperbox revision 970.

Dash patterns sorted for SVG output. Dash patterns in SVG are equivalent to PostScript as far as Wumpus is concerned: a list of on-off lengths and a start offset that discards an initial length.

Wumpus

Copperbox revision 969.

Minor changes, but the point calculating functions for matrices now feel right so are worth committing. The names are currently a bit clunky though.

Wumpus

Copperbox revision 968.

Some more work on colour charts, though I still don't have the abstraction right when I'm calculating points.

Sunday, November 22, 2009

Wumpus

Copperbox revision 967.

I've added a new demo in wumpus-extra to draw colour charts for the X11 and SVG colours.

Wumpus

Copperbox revisions 965 and 966.

More work on scatter plots overlays are working to a degree, but the code still isn't very good. Plus some new work to print colour charts.

Saturday, November 21, 2009

Wumpus

Copperbox revision 964.

Initial work on a module for drawing scatter plots. It's not too sparkling at the moment as I can't have data sets super-imposed on each other.

I've been trying to draw this one, but as each layer changes the frame according to the data I can currently only render one colour per plot.

http://en.wikipedia.org/wiki/File:Anderson's_Iris_data_set.png

wumpus-core-0.11.0 & wumpus-extra-0.3.0

Copperbox revision 963.

New release archives for wumpus-core and wumpus-extra. I've made the archives at the same time this time, so I know they are working together (the last wumpus-core archive had neither a revision version or a release archive of wumpus-extra that worked with it).

Wumpus

Copperbox revision 962.

Latin1 extended characters are now implemented for SVG as well (the last commit implemented them for PostScript).

The admittedly simple test in LabelPic.hs shows the implementation works.

Wumpus

Copperbox revision 961.

I've extended the PostScript monad to be a ReaderT carrying the TextEncoder lookup table. This should mean Latin1 text is now implemented for PostScript. I haven't tested it yet as if still to extended the SVG monad.

Wumpus

Copperbox revision 960.

More work on enabling Latin1 extended characters - hopefully the work is general enough to allow other encodings using the same mechanisms.

I think all the code is now in place, except for extending the PostScript and SVG monads with ReaderT so they can take a consult TextEncoder during operation. A TextEncoder is a pair of functions for translating extended character directives between the named representation (PostScript) and the integer code representation (SVG).

Friday, November 20, 2009

Wumpus

Copperbox revision 959.

I've started work on extending wumpus-core to handle extended characters. I plan to do this very simplistically, not using much more than a lookup table to get either integer character code for SVG or character name for PostScript, plus a minimal tokenizer that interprets text labels looking for special character directives (the intention being to use XML style directives following SVG).

Wumpus

Copperbox revision 958.

I've moved the decent bounding box calculation for text labels from Wumpus.Extra.Text to a new module Wumpus.Core.Font. This obliges a Fractional constraint on the DUnit of all pictures, but is otherwise a good improvement.

Wumpus

Copperbox revision 957.

I've implemented OpenGL style joining points (lines, loops, triangle strips). The implementation is a bit deficient compared to OpenGL - triangle strips and fans have too sharp edges and there is no way to interpolate colour changes or whatever during the drawing.

Thursday, November 19, 2009

Wumpus

Copperbox revision 956.

Changes to get wumpus-core and wumpus-extra in sync. I've advanced wumpus-core since the 0.10.0 archive which isn't ideal as there was no commit of wumpus-extra that worked with it. But there was an interface change that I'd missed for quite a while, so I decided to do it now while it was on my mind.

wumpus-core-0.10.0

Copperbox revision 955.

I've made a new release archive for wumpus-core. Outputting PostScript and SVG has been generalized so that the unit type (of points, line widths etc.) does not have to be a double.

Wumpus

Copperbox revision 954.

Various minor changes to wumpus-extra. I started work on drawing lines from vertex lists as-per OpenGL's GL_POINTS, GL_LINES etc, however its somewhat complicated as simple analogues to the GL operations would create objects of different types (pictures, paths, lists of paths).

Also I want the Path and PathSeg types in wumpus-core to hide their constructors, this has meant changes to quite a few modules in wumpus-extra.

Wumpus

Copperbox revision 953.

I've fixed a bug in SVG output for circles and ellipses where I was emitting attributes x and y for the center point. Seemingly I should have been using cx and cy.

Wumpus

Copperbox revision 952.

I've simplified wumpus-core so it just outputs RGB in the genereated PostScript. Other colour formats (HSB and gray scale) are converted to RGB before printing.

At some point I'll have to make the PostScript output more efficient regards graphics state changes for colours and line styles. Having the graphics state data types as simple as possible will be helpful for this.

Wumpus

Copperbox revision 951.

Somw work on regular polygons. I've made the circular function which generates equal spaced points on a circle more regular.

Wednesday, November 18, 2009

Wumpus

Copperbox revision 950.

I've added module signatures to the Wumpus.Geometry modules in wumpus-extra. I've also factored some operations into type classes.

wumpus-core-0.9.0

Copperbox revision 949.

I've made a new release of wumpus-core, changing the Boundary class to use the DUnit type family and hiding a function (extractFrame). Methinks the version numbers of wumpus-core are cursed to get very large with the current way I'm developing it as the changes are getting minor, but I like having it compiled to run wumpus-extra against.

Wumpus

Copperbox revision 948.

Work on better bounding boxes in wumpus-extra. The new text label functions (textline and colouredTextline) use metrics from Courier to calculate a more accurate bounding box.

Tuesday, November 17, 2009

Wumpus

Copperbox revision 947.

I've started a new module Wumpus.Extra.Text that will include better calculations for a text label's bounding box. Its minimal at the moment as most of my energy has gone into a bit of hand-crafted PostScript - wumpus-extra/doc/courier48.ps. This file does some of the guesswork on bounding Courier - I'm only going to address Courier as it's a fixed width font.

Wumpus

Copperbox revision 946.

I've extended the FontAttr data type in wumpus-core so it can handle SVG style attributes (e.g. italic, bold, oblique). This means that the safe fonts in wumpus-extra are now 'safe' except for the a caveat on Symbol which renders in Chrome but not Firefox.

Wumpus

Copperbox revision 945.

I've added a module for SafeFonts to wumpus-extra. 'SafeFonts' are fonts that should be present in GhostScript / PostScript and SVG and at sizes present in PostScript - PostScript fonts only have certain sizes encoded e.g. 10pt, 12pt, 18pt, other sizes like 41pt can be achieved by doing an uniform scaling on the drawn text.

Due to SVG's font naming convention being completely different to PostScript most of the safe fonts aren't safe yet.

Wumpus

Copperbox revision 944.

Minor but useful work on dots. Its induced a couple of useful extra operations for Wumpus.Core.AffineTrans and clarified somewhat a useful construction mechanism - i.e. if we can do any affine transformations on the components of dots (points, line segments) before we assemble them into Wumpus Pictures, then the calculations are done in advance rather then transmitted to PostScript inside gsave ... grestore blocks.

wumpus-core-0.8.0

Copperbox revision 943.

I've made another release archive of wumpus-core so I can develop wumpus-extras against a frozen version. The examples in wumpus-extra are working again.

Hy-lists and Wumpus

Copperbox revision 942.

I've made added a cut-down OneList to Wumpus and removed the dependency on Hy-lists. The development of hylomorphisms was turning into a mania, so Hy-lists is kicked into touch for the time being.

Monday, November 16, 2009

hy-lists

Copperbox revision 941.

More work on hy-lists, although the hylomorphisms aren't really bootstrapped yet - i.e. I haven't got far enough to replace the (someFunctional . toList) compositions in Wumpus with hylomorphisms that do the two parts at once.

Hy-lists and Wumpus

Copperbox revision 940.

I've added some more functionality to hy-lists, mainly Foldable and Traversable instances for OneList.

The Picture type in wumpus-core has been changed again to make it a rose tree. Lists of child nodes are represented with OneList to prevent empty pictures being constructed. The change from binary tree to rose tree is so I can build multi-pictures - ones that share the same affine frame - more easily.

hy-lists

Copperbox revision 939.

I've started a new library / package for the minor lists snoc-list, one-list, ...

The salient feature of the library is that I'm trying to implement the list manipulations (filter, etc.) as hylomorphisms converting snoc-lists or one-lists to regular lists during the manipulation. There is a conceptual distinction between the construction of the inital snoc- and one-lists (which involves some restriction - non-empty for one-lists, suffixing for snoc-lists) and their subsequent manipulation.

The next step is seeing if non-empty one-lists work for the Multi constructor inside Wumpus's picture type.

Sunday, November 15, 2009

joinlist-0.2.0

Copperbox revision 938.

I've made a new release of joinlist and uploaded it to Hackage - looking at the last release it was, ahem, not very good. This one at least improves things, though there are still quite a few functions that are a easy to add but not yet done (head, tail etc.) and I haven't done any test cases yet.

I've added a snoc list and a non-empty OneList to the joinlist project in Copperbox though I'll keep them away from Hackage for a bit.

Wumpus

Copperbox revision 937.

I've changed grid construction to be monadic in Wumpus-extra, though currently grids are still insubstantial as I haven't really formulated how to work with them.

Saturday, November 14, 2009

Wumpus

Copperbox revision 936.

I've updated the examples in wumpus-extra to work with wumpus-core-0.7.0 and added a couple of picture transformers for clipping.

wumpus-core-0.7.0

Copperbox revision 935.

I've made a release archive of the current wumpus-core with the simplifications to the bounding box and picture types (no empty).

Also it now depends on algebra-0.0.0.1 rather than groupoid and I've reduced many of the associated types to a single type family DUnit, representing 'dimension'.

Wumpus

Copperbox revision 934.

I've simplified bounding box. As the last set of change altered the picture type (no empty Picture!), so bounding box no longer needs represent the empty bounds.

Wumpus

Copperbox revision 933.

I've simplified the Picture type so that it is non-empty. I thought this would make difficulties for the Picture Language (i.e. the module of picture composition operators), but this hasn't been the case.

The 'multiple' operations that layout series of pictures have been changed from [a] -> a to [a] -> a -> a. The simplest to explain is stack which overlays pictures on top of each other. Stack is now considered stackOnto and stacks a list of pictures onto a 'background' picture. By always having a background it doesn't matter if the list of pictures stacked onto it is empty - we will always have a picture (never an empty picture - which we can't construct).

This should simplify the obligations on bounding box as it never need represent the bounds of an empty picture - changing this is the next step.

I've also simplified the AffineTrans module to use a single type family declaration for the unit type of transformable things. Previously each class had its own associated type for the unit.

Friday, November 13, 2009

Wumpus

Copperbox revision 932.

I've added an example that throws an error when rendering due to it manipulating an empty picture. I'd known the empty picture was going to be a problem, but I've needed to construct enough functionality before feeling able to look at it. I think I'm going to need the picture tree type to be a non-empty tree. This might well simplify my bounding box problems but it won't be pain free; the list concatenation operations on the Picture language (stack, hcat, vcat) depend on the notion of an empty Picture. If I get rid of the empty Picture these operations will have to throw an error themselves on the empty list.

Wumpus

Copperbox revision 931.

I've added a module for drawing dots (the original Wumpus had quite a few dots so I've got a bit of code already written).

There's one problem though - the Multi constructor in Wumpus.Core.PictureInternal is meant to be a optimisation for drawing many primitives in one affine frame. Unfortunately + and X dots are both made of two independent line segments - they are multi-pictures already when multi-picture was supposed to represent many simple pictures (e.g. dots). I'm going to have to work out some trick (maybe dots as higher order functions) to accommodate many dots in one multi-picture.

Wumpus

Copperbox revision 930.

Another minor reorganization of wumpus-extra. I've split Geometry.Line into two modules: Geomtry.LineEquation and Geometry.LineSegment.

Wumpus

Copperbox revision 929.

I've reorganized wumpus-extra and little and brought all the examples up to date (they now run again).

wumpus-core-0.6.0

Copperbox revision 928.

I've made a release archive of the current wumpus-core, as the work on Core.PictureLanguage has significantly increased wumpus-core's functionality.

Wumpus-extra hasn't had much attention so I'm not going to make a release archive at the moment. Hopefully I can add quite a bit to wumpus-extra while leaving wumpus-core at 0.6.0.

Thursday, November 12, 2009

Wumpus

Copperbox revision 927.

Quite a bit of work on the picture language, separators and alignment are now implemented. Also I've shrunk the number of functions in Core.BoundingBox's interface.

Wumpus

Copperbox revision 926.

More work on the picture language - some more combinators and I've finally got round to using some of the existing ones (which hadn't entirely been working as expected).

Wumpus

Copperbox revision 925.

I've simplified Core.Picture by having only one type family for the unit type of pictures (which is really the unit type of points - usually Double). Before I had horizontal (HUnit) and and vertical (VUnit) types. But as I've move these associated types out of their respective classes to become type families it seemed overcooked to have two different units.

Wumpus

Copperbox revision 924.

I've implemented hspace and vspace combinators for the picture language. Their implementation justifies adding Blank as a picture constructor.

The following simple definition of hspace is invalid:

-- > hspace n a b = a ->- (moveH n b)

The movement due to moveH n is annulled by the (->-) operator which moves relative to the bounding box. Somehow changing the bounding box of picture b seems more complicated than sandwiching a blank picture between them:

-- > hspace n a b = a ->- blankH n ->- b

Wumpus

Copperbox revision 923.

I've added a Blank constructor to the picture type. This is to implement composing pictures with gaps (vis hsep in PPrint). However I'm not convinced Blank is better than using pmove so this change might be repealed.

More usefully I have improved some of the naming and documentation in Core.PictureInternal.

Wednesday, November 11, 2009

Wumpus

Copperbox revision 922.

I've changed the composite typeclass to have functions over and beneath. These names better describe the (expected) behaviour than the previous composite.

Wumpus

Copperbox revision 921.

I've split Core.Picture into 2 modules - Core.Picture is now for user-level operations and Core.PictureInternal for the data types and type class instances. Outside Wumpus.Core the Picture data types should probably be opaque, but I haven't done this yet.

Also I've added bimap functions to data-aviary - previously called prod in fun-extras.

data-aviary-0.1.0

Copperbox revision 920.

I've tidied up and packaged up a release of data-aviary for Hackage.

data-aviary

Copperbox revision 919.

More work on the inter-defined combinators plus I've added a few 'prime' ones.

Tuesday, November 10, 2009

data-aviary

Copperbox revision 918.

I had assigned the wrong type to the vireo bird (and V* and V**) and hence had typing problems.

Now fixed in both Birds and BirdsInter.

data-aviary

Copperbox revision 917.

I've added a module of inter-defined bird combinators. This has been useful in spotting transcription errors, but it's brought up some problems with the definitions I'm using - particularly apply aka Haskell's ($) which seemingly has a definition as S (SK) but then has a typing problem and the V* and V** combinators.

I was hoping this would be a one-day job at least for the birds, but it isn't going to be.

data-aviary

Copperbox revision 916.

More work on the combinator birds.

I've worked out what I want the package to be - the Data.Aviary module is for combinators that have already escaped into the wild but aren't in 'standard' libraries. For example the (#) combinator in Wash, which is the thrush combinator bird. This is the module to include in programs. The Data.Aviary.Birds module is more a reference collecting as many combinators as I can type - it will need more comprehensive documentation of course. I'm not sure yet whether the pairing functions will have a place in this library or not.

data-aviary

Copperbox revision 915.

I've started a new package data-aviary to replace fun-extras. I aim to be a bit more systematic (and less subjective) in collecting combinators in data-aviary and when Wumpus is ready for Hackage, data-aviary should make a better companion library (the present incarnation of fun-extras could really be called stephens-favourite-functions and otherwise be rolled into Wumpus).

wumpus-core-0.5.0, wumpus-extra-0.2.0

Copperbox revision 914.

As the demos are currently working (if somehow unimpressive) I've made release archives of the current Wumpus parts.

Some changes to wumpus-core are due and I'd like a recent marker where things at least work.

Monday, November 9, 2009

Wumpus

Copperbox revision 913.

I've updated wumpus-extras do the examples run again. At this point I'd like to add an example SVG file but Blogger is thwarting me.

Wumpus

Copperbox revision 912.

I've tidied up the LabelPic example and got coloured text working in SVG output - this means using the span element inside a text element rather than trying to assign the colour to the text element itself.

Sunday, November 8, 2009

Wumpus

Copperbox revision 911.

I've tidied up the interface provided by Core.Picture. The bad label functions - picLabel, picLabel1 - have been moved into the example LabelPic.hs where they are pending removal once I've something better.

I've also added a lot more instances for the builder smart constructor classes - Stroke, Fill, TextLabel and Ellipse - that create primitives and allow some eliding of default attributes.

Revision 910 was a mistake where I didn't run svn status and I hadn't put all the new changes in my local repository.

Wumpus

Copperbox revision 909.

Work tidying up Picture in wumpus-core. There was an oversight where ellipses could be created with open strokes, I've corrected this. More haddock docs though there is still plenty to do, also I need to do more instances for the smart constructors - the classes Fill, Ellipse, Stroke etc.

Wumpus

Copperbox revision 908.

I've finished tidying up Core.OutputSVG. Wumpus-core is getting pretty near 'prime-time'!

Wumpus

Copperbox revision 907.

I've done some tidying up work on the OutputSVG module in wumpus-core, though it's still a bit tardy and more tidying is due. I've implemented all the attributes for stroked paths except dash pattern, as I'm not sure how SVG dash patterns correspond to PostScript ones.

Also I've moved the circular function from wumpus-core to wumpus-extra as I think its doing the wrong thing (currently it is a transformer rather than a generator) and doesn't merit being in wumpus-core.

Clean, Sections, Partial Application

Got this one slightly wrong:

http://www.haskell.org/pipermail/haskell-cafe/2009-November/068820.html

Unhappy...


module nonsense

import StdEnv



nonsense = map (^ 2)

Start = nonsense [1,2,3]

Error [nonsense.icl,7,]: ^ first argument of infix operator missing



Happy...



module nonsense

import StdEnv



nonsense = map (flip (^) 2)

Start = nonsense [1,2,3]

"nonsense"
flip :: !.(.a -> .(.b -> .c)) .b .a -> .c
flip :: !.Int !.Int -> Int
nonsense :: .([.Int] -> .[Int])
Start :: .[Int]



Clean can partially apply functions (of course!) but it doesn't appear to support sectioning infix operators. Arrow maniacs might be concerned...

Saturday, November 7, 2009

Wumpus

Copperbox revision 906.

The Core.SVG and Core.PostScript modules now have Haddock documentation for all (?) the exported functions.

Wumpus

Copperbox revision 905.

Wumpus-core - all modules now have an export list and all have the beginnings of Haddock documentation.

Wumpus

Copperbox revision 904.

A round of tidying on wumpus-core, though this is still plenty to clean up.

wumpus-core-0.4.0, wumpus-extra-0.1.0

Copperbox revision 902.

The examples in wumpus-core and wumpus-extra working are again, so I've made release archives of both these packages. I've let wumpus-core inherit the version number from Wumpus before the package split, otherwise I wouldn't feel like I was making progress.

Copperbox revision 903.

I've deleted the original Wumpus directory tree, now that Wumpus is split into wumpus-core and wumpus-extra.

Wumpus

Copperbox revision 901.

I've split Wumpus into two Cabal packages.

wumpus-core which is just the SVG and PostScript output, the picture language and basic geometry (points, vectors, frames, affine transformations, bounding boxes), i.e. enough to make pictures but no more.

wumpus-extras which is geometry above what is needed for SVG and PostScript (e.g. curves and lines in parametric representation), and composite objects built on top of wumpus-core (e.g. arrows, grids).

Hopefully wumpus-core should be stabilizing quite soon, though wumpus-extras won't. The examples in both packages are unlikely to work at the moment.


Copperbox revision 900.

The module Wumpus.Core.AffineTrans was missing from the repository - I've added it now. The examples in demo/Picture.hs and demo/LabelPic.hs should work, others won't.

Wumpus

Copperbox revision 899.

I've sorted out the coordinate changes for SVG including text which was previously upside down. Now SVG output and PostScript output should pretty much match.

Next up, I'm going to divide Wumpus into to cabal packages - one for Wumpus.Core which hopefully won't change much from now on; and the other for Wumpus.Extras and Wumpus.Geometry. This will probably mean Subversion commit numbers go a bit mad as I shift directory contents about.

Friday, November 6, 2009

Wumpus

Copper box revision 898.

I've implemented labelling for clipping paths in SVG output via a state monad.

Also I've attempted a change of coordinates transformation for SVG, as SVG considers the origin to be at the top left rather than the bottom left (PostScript and Wumpus). Unfortunately it doesn't work.

Wumpus

Copperbox revision 897.

First round of changes for work on monadifying SVG output. To generate clipping paths I need fresh labels, hence a monad.

Wumpus

Copperbox revision 896.

I've added alternative type classes to create filled and stroked paths. These lift a path to the Primitive data type (which is an intermediate of Picture) rather lift all the way up to a Picture (which the PicPath class does).

I don't intend keeping both alternative lifters so I'll have to see which is the most convenient to program with.

Wumpus

Copperbox revision 895.

I've added a Boundary type class to Core.BoundingBox, and made instances for the useful things - pictures, paths...

Wumpus

Copperbox revision 894.

I've changed the DrawProps data type so only strokes are attributed with pen styles (e.g. dash pattern, miter length). This matches PostScript's behaviour - fills just fill, strokes trace the boundary of a path with a pen.

Thursday, November 5, 2009

Wumpus

Copperbox revision 893.

I've tidied up the path construction code in Core.Picture by adding two type classes PicPath and MultiPath that wrap up path attributes. I haven't done this for labels yet, as I'm wondering whether or not the current label type needs improving first.

The PicPath and MultiPath classes were inspired by the Node class in Iavor S. Diatchki's nice XML.Light library.

Wumpus

Copperbox revision 892.

A round of tidying up, I've added export lists to some core modules and put the affine transformations from Core.Geometry into their own module.

Wumpus

Copperbox revision 891.

I've made a minor tweak to the Path data type so that it isn't attributed with a drawing style (Fill, Stroke, ...). This is in line with the previous change that made a distinction between paths for clipping and paths for drawing.

Also, I've a clearer opinion on yesterday's changes to the Picture type. The Picture type changed from having attributes stored on both nodes and leaves to having attributes only on leaves. For generating PostScript it is better to have only nodes attributed then the number of gsave ... grestore blocks in the output can be minimized. However node attribution seems unnatural for construction, and I've decided that I prefer easy construction and 'not so good' PostScript. So yesterdays changes are satisfactory - at some point I could do a tree transformation to optimize the PostScript but I don't see that as a priority.

A few of the demos don't work any more, as I'm due to improve the path and picture constructors.

Wumpus

Copperbox revision 890.

I've changed the Picture type to make clipping more tangible - i.e. it should now be easier to account for clipping paths when considering the picture language operations (horizontal concatenation, etc.). PostScript output should support clipping, SVG output doesn't yet as I'll have to make it monadic to handle tagging with a counter for clip-path references.

I haven't done anything about the problems that yesterday's changes to the Picture type uncovered. I'm still thinking about the consequences.

Wumpus

Copperbox revision 889.

Some tidying up after the changes to the picture types.

Unfortunately I didn't fully work through the changes to the pictures types, and I've realized that in the current form I'll be sending a lot of redundant graphics state changes to PostScript. Essentially I've put all attribute data in the leaves of the tree (the picture type is a tree; paths, labels are the leaves); this is fine for SVG but not good for PostScript. With PostScript I use gsave ... grestore like local in Haskell's reader (environment) monad, but as I've distributed everything to the leaves effectively I'll only ever be running one command inside local.

Wednesday, November 4, 2009

Wumpus

Copperbox revision 888.

I've simplified the attributes on elements of the Picture type (paths, labels...). Currently this means I write quite a lot of redundant graphics state changes in the PostScript output - I plan to solve this by adding an environment to the Wumpus monad and only write the update when there is a difference with the current environment. The attribute changes do make writing SVG easier.

Wumpus

Copperbox revision 887.

I've made some more changes to SVG output code before I start work on changing the Picture types.

Wumpus

Copperbox revision 886.

A checkpoint commit - after this one I'm going to change some of the attributes in the Picture data types (again).

The salient feature of these changes is that SVG drawings are now scaled reasonably (but still in the wrong coordinate system). I shouldn't have been adding a viewPort attribute to the top level svg element.

Wumpus

Copperbox revision 885.

More work on SVG output particularly text labels, currently multiple lines are printed in the wrong vertical order. It looks like another difference between SVG and PostScript - coordinate (0,0) is bottom left in PostScript, from a cursor reading it looks like it is top left in SVG.

These arbitrary differences are really rather disappointing - should I simply transform the coordinate frame [1 0 0 -1] before creating the picture? It's easy for me to do, but potentially confusing for anyone deciphering their output if they're expecting normal SVG.

-- Update - the [1 0 0 -1] transformation won't work of course, as text (well, the Beziers and lines that make text) will be translated along with the location point, thus the characters will be printed upside down.

Wumpus

Copperbox revision 884.

More work on SVG output - pictures with frame transformations now draw, but they are huge. SVG evidently uses a different default unit to PostScript.

Tuesday, November 3, 2009

Wumpus

Copperbox revision 883.

I've started work on adding SVG output support to Wumpus. I was hoping not to bother with SVG, envisaging that there would be some readily available PS to SVG converters. The one I found had substantial dependencies when I installed it into Cygwin and although it worked I wasn't happy with the output, so I'm doing it myself.

Wumpus

Copperbox revision 882.

I've changed the bounding box type so it has a 'zero' element and thus can support monoid rather than groupoid.

I want to change the picture type slightly so it can support pictures that have some size but no content. This is to draw lines that have a parametric representation Ax + By + C = 0. To draw a line the function must supply an area for the line to be drawn in - if the line doesn't actually enter the area the function should still return a picture without content (but still with a bounding box). I don't want to make the picture type more complicated so I've shifted some of the complexity (bounding boxes of empty pictures) to the bounding box type.

Wumpus

Copperbox revision 881.

I've added collective import modules for the Geometry and Core libraries. Also I've started a new set of examples where I'm trying to replicate some of the examples in the Processing book.

Monday, November 2, 2009

Wumpus

Copperbox revision 880.

I've fixed the %%BoundingBox error in eps files. I've also done some tidying of the Core.OutputPostScript module.

Wumpus

Copperbox revision 879.

Wumpus can now output .eps files and multiple page PostScript documents (one picture per page).

Note to self - I've just noticed the EPS bounding box inside the %%BoundingBox comment is wrong.

Wumpus

Copperbox revision 878.

This is the first round of work towards getting the PostScript output to follow the DSC (Document Structure Conventions), it also includes the start of work on outputting EPS files.

Sunday, November 1, 2009

Wumpus

Copperbox revision 877.

More picture combinators - centring one picture on top of another. Plus I've changed the lexical format of the infix combinators (always crucially important in Haskell) - the convention is the operator is enclosed in dashes e.g. centre -@-, place right ->- etc.

Wumpus

Copperbox revision 876.

I've extracted the picture composition code into a new module Core.PictureLanguage and made the operations over type classes rather than a concrete type (previously Picture). Then intention is that some of the operations will be applicable to other types - label text is the immediate candidate.

Wumpus-0.3.0

Copperbox revision 875.

I've added a release tar.gz of the current Wumpus. I'm about to re-work the Picture operators (<||>), (<..>) etc. so the function signatures in Wumpus.Core are going to change significantly.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.