.VIEW/*.xpm

10 views
Skip to first unread message

Ralf Hemmecke

unread,
Mar 27, 2021, 12:37:30 PM3/27/21
to fricas-devel
Hi Waldek,

interestingly, when I use

unset DAASE; HTPATH=. FRICAS_INITFILE='' fricas -noihere -paste ug08.ht

then there will be

ugProblemNumericPage26.VIEW ugProblemNumericPage30.VIEW
ugProblemNumericPage27.VIEW ugProblemNumericPage31.VIEW
ugProblemNumericPage28.VIEW ugProblemNumericPage32.VIEW
ugProblemNumericPage29.VIEW

generated with the files

data image.bm image.xpm

in them. When I look at the corresponding ug08.input, then I see
something like this.

draw((x,y)+-> real exp complex(x,y), -2..2, -2*%pi..2*%pi, colorFunction
== (x, y) +-> imag exp complex(x,y), title=="exp(x+%i*y)", style=="smooth")

However, executing that command alone will not produce an output file.

Unfortunately, I seemingly got lost when I folloed what happens during

fricas -paste ...

Obviously, at some place FriCAS must set a default output to *.xpm and
*.bm files. If it were clear at which place this happens (and it
seemingly only happens with the -paste option, we could change it so
that FriCAS will automatically also generate .ps file (even when they
are not needed for HyperDoc.

At the moment I would say that this would be the simplest way to
generate Postscript files without falling back to ImageMagick.

Thank you
Ralf

Waldek Hebisch

unread,
Mar 27, 2021, 3:16:19 PM3/27/21
to fricas...@googlegroups.com
On Sat, Mar 27, 2021 at 05:37:27PM +0100, Ralf Hemmecke wrote:
> Hi Waldek,
>
> interestingly, when I use
>
> unset DAASE; HTPATH=. FRICAS_INITFILE='' fricas -noihere -paste ug08.ht
>
> then there will be
>
> ugProblemNumericPage26.VIEW ugProblemNumericPage30.VIEW
> ugProblemNumericPage27.VIEW ugProblemNumericPage31.VIEW
> ugProblemNumericPage28.VIEW ugProblemNumericPage32.VIEW
> ugProblemNumericPage29.VIEW
>
> generated with the files
>
> data image.bm image.xpm
>
> in them. When I look at the corresponding ug08.input, then I see
> something like this.
>
> draw((x,y)+-> real exp complex(x,y), -2..2, -2*%pi..2*%pi, colorFunction
> == (x, y) +-> imag exp complex(x,y), title=="exp(x+%i*y)", style=="smooth")
>
> However, executing that command alone will not produce an output file.
>
> Unfortunately, I seemingly got lost when I folloed what happens during
>
> fricas -paste ...
>
> Obviously, at some place FriCAS must set a default output to *.xpm and
> *.bm files. If it were clear at which place this happens (and it
> seemingly only happens with the -paste option, we could change it so
> that FriCAS will automatically also generate .ps file (even when they
> are not needed for HyperDoc.

This is hidden in C part: hyperdoc puts 'write' command after
graphic commands. Required formats are specified as part of
that 'write' command.

See diff in the attachement.
--
Waldek Hebisch
sum6b.diff

Ralf Hemmecke

unread,
Mar 27, 2021, 6:22:16 PM3/27/21
to fricas...@googlegroups.com
> This is hidden in C part: hyperdoc puts 'write' command after
> graphic commands. Required formats are specified as part of
> that 'write' command.

Thank you. It works, but I must say, I don't (yet) like the result.

Compare the book from

http://fricas.github.io/book.pdf

with the one without ImageMagick

http://hemmecke.org/fricas/book.pdf

Issues that I realized with the new method
(compare for example pp. 298)

- no caption (compare for example page 298)
- 3d objects look brighter
- 3d meshes are thinner
- 2d graphics is only black/white
- 2d graphics does not fit current size

The last point can probably be adjusted, but why it is only B/W for 2D,
I don't know.

I don't think that currently this will be a good way of generating the
.ps files.

Ralf

Patch attached.
0001-generate-postscript-files-directly-by-hyper.patch

Waldek Hebisch

unread,
Mar 29, 2021, 10:41:49 AM3/29/21
to fricas...@googlegroups.com
On Sat, Mar 27, 2021 at 11:22:14PM +0100, Ralf Hemmecke wrote:
> > This is hidden in C part: hyperdoc puts 'write' command after
> > graphic commands. Required formats are specified as part of
> > that 'write' command.
>
> Thank you. It works, but I must say, I don't (yet) like the result.
>
> Compare the book from
>
> http://fricas.github.io/book.pdf
>
> with the one without ImageMagick
>
> http://hemmecke.org/fricas/book.pdf
>
> Issues that I realized with the new method
> (compare for example pp. 298)
>
> - no caption (compare for example page 298)
> - 3d objects look brighter
> - 3d meshes are thinner

Hmm, on my machine 3D Postscript output that I see looks very
similar to .xpm and certainly no worse.

> - 2d graphics is only black/white

This is known problem, I wrote about this. In 2007 looked at the
issue, but other things kept me busy so I did not come back...

> - 2d graphics does not fit current size

AFAICS this is very general problem: graphics tries to choose
resonable size, but without explicit request size may be wrong.

--
Waldek Hebisch

Ralf Hemmecke

unread,
Mar 29, 2021, 11:43:39 AM3/29/21
to fricas...@googlegroups.com
>> - 3d objects look brighter
>> - 3d meshes are thinner
>
> Hmm, on my machine 3D Postscript output that I see looks very
> similar to .xpm and certainly no worse.

Oh, sorry. That should not have gone under the heading "issues". Rather
it is "differences". In fact, I like the FriCAS generated 3D graphics
more than the .xpm -> .ps conversion done by ImageMagick.

Ralf
Reply all
Reply to author
Forward
0 new messages