In response to
http://groups.google.com/group/fricas-devel/browse_thread/thread/4b341750a4e9301d?hl=en
> Also what is the best way to create and write to a text file?
Have you looked at the File constructor?
If you can work on a more standard graphics format, I think that would
be great.
As for
http://www.euclideanspace.com/maths/standards/program/mycode/write/
you should note that many tools in PanAxiom were done before any other
programmers jumped in and created different and nowadays more often used
formats.
Maybe Tim knows a bit more about the history. Your conversion would
certainly be of interest for all the panAxiom systems.
Ralf
One possiblity is to work with Postscrit. General Postscrit is
hard to edit, but FriCAS generates only very restricted subset,
so for Postscrit expert converting to other formats should be
easy.
If you want to add a new output format place to look is
'src/graph/Gdraws/Gfun.c' which defines "primitives" for
Postscrit (and X11) output -- if you want output in different
format you need to find out how to express each of primitives in
the target language and replace 'printf' statemets with
Postscrit code by statements emmiting your desired format.
Concerning data files, they are essentally dump of internal
data structures used by drawing programs. You can correlate
file format with C data structures looking at
'src/graph/view3D/write3d.c'.
--
Waldek Hebisch
heb...@math.uni.wroc.pl
The examples here
http://axiom-wiki.newsynthesis.org/GnuDraw
and associated left sidebar links, might be of some use to you.
Regards,
Bill Page.
> --
> 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 fricas...@googlegroups.com.
> To unsubscribe from this group, send email to fricas-devel...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.
>
>
This is also projected to 2D (in fact equivalent to data in
postscript file).
> I had a look at 'src/graph/view3D/write3d.c' to see the format of the
> 'data' file which I have documented here:
> http://www.euclideanspace.com/maths/standards/program/mycode/write/
> This appears to contain all the information to reconstruct the 3D mesh
> so it would be possible to write a stand alone program to convert into
> other formats. However this would be harder to use, as the user would
> have to find the .view directory and then fire up another program to
> convert it.
>
It is relatively easy to add statements to create different
file format (I mean easier than writing convertion on
text level). Exactly how much effort it takes depends
on target format.
> I will investigate the approach suggested by Bill Page, this looks
> very promising, I can see advantages in avoiding all the mechanisms
> for firing up x-window and so on. This would seem to have the least
> constraints and so allow for adding additional features, for instance,
> it would be good to show more than 3 dimensions by use of colour or
> perhaps animation over time.
I would say that you probably want to connect close to end of
FriCAS graphic pipeline. I am not sure where exactly
GnuDraw plugs in graphic pipeline but the lines:
writeLine!(f1,concat([unparse(convert(p.1)@InputForm)," ",
unparse(convert(p.2)@InputForm)]))
make me suspicious: if InputForm and unparse are really needed, then
probably it is too early.
To put it differently: the first stage is evalation of functions
(in particular choice of evaluation points), I do not think
you want to re-implement this part. Then the data is transmitted
to C code which performs transformations and renders on final
device. Since you want to use external transformation program
skipping C code makes sense, so you probably want to connect
close to the point where data is transmitted to C.
--
Waldek Hebisch
heb...@math.uni.wroc.pl
http://www.euclideanspace.com/maths/standards/program/mycode/graph/write/
While doing this I found the Axiom documentation a bit lacking in some areas
(I needed to understand SubSpace, ThreeSpace and so on) so while I was doing
this I took the opportunity to make some notes on existing axiom geometry
related structures and put my notes here:
http://www.euclideanspace.com/maths/standards/program/mycode/graph/existing/
I also have various issues, questions and so on about the more general issues
of working with geometry in axiom here:
http://www.euclideanspace.com/maths/standards/program/mycode/graph/
The motivation is to:
* Export plots (with scales, axes, and so on) into a dedicated 3D editors
(such as 'blender').
* define and transform shapes using Clifford algebra as well as usual
Matrix methods.
* I also find it very helpful to be able to visualise the algebraic
structures and I want to find better ways to do this.
* define shapes and show union and intersection (join and meet)
* slice through shapes and show sections.
* show scales and grids
* combine many graphs in one view
* add annotations in 3D view.
* Use structures that can be extended to n-dimensions and are not specific
to 2 or 3(+ 1 for colour) dimensions.
As one example of the issues on this page : I would like to be able to export
to a X3D file - which is more complicated and standards based than a Wavefront
file since this can do things like text, lines and colour which would be
useful for drawing scales etc. There seem to be many structures in axiom to
implement Open Inventor (IVNodeCategory, RenderTools, IVSimpleInnerNode,
IVSeparator, IVGroup, IVCoordinate3, IVQuadMesh, IVIndexedLineSet,
IVUtilities). Would it be feasible to adapt this to support X3D?
Martin Baker