I have merged together the changes that I and Waldek made, I have then
made additional changes and big fixes. The new code is here:

https://github.com/martinbaker/fricas/blob/master/src/algebra/scene.spad.pamphlet

I have added a new SceneNamedPoints domain although this is not
completely functional yet and I am not sure if I have the design of it
correct so far.

The aim of the 'named points' node and associated domain is to provide
better support for drawing graphs (that is 'graphs' as in graph
theory) and related diagrams of trees, latices and category theory
arrow diagrams. In other words, diagrams with named nodes and arrows
or lines between these nodes.

These diagrams can already be drawn, using this graphics framework
without this feature, however this requires that the coordinates are
supplied for each end of each line or arrow. If we want to stop the
arrow short of the nodes, to avoid overwriting the node name, then the
new coordinates would have to be recalculated using boilerplate code.

So the aim is to reduce duplication and separate the mathematical
structure of the diagram from the actual coordinates and issues of
making the diagram more human readable. Eventually we might also have
some intelligent code that places the node positions to minimise
crossing the arrows and so on.

For example, imagine we wanted to add support for graph theory in
FriCAS (seems like it would be an interesting project) then we could
implement a GraphTheory domain and it might contain a 'draw' function
to draw the graph to a SVG file. This code will have a set of node
names, say "a","b"... and the 'draw' function will draw the
appropriate arrows between them, however we don't want the code to be
cluttered up with specific coordinates so we put all that in a 'named
points' node to map the names to coordinates all in one place.

BTW - how do you test and validate this graphics framework code?
I run this script:
https://github.com/martinbaker/fricas/blob/master/src/scripts/testscene.input
This generates a set of files, which I then open using Inkscape or
Blender as appropriate, I then manually compare the graphics to the
images here:
http://www.euclideanspace.com/maths/standards/program/mycode/graph/examples/
I would like to automate this validation more, I was thinking of doing
a file comparison with a reference file but this would be sensitive to
floating point rounding changes, that is it would be sensitive to
changes outside the SPAD environment, can you think of a better way to
do the validation?

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to