zauguin / luapstricks

8 stars 0 forks source link

unknown name truncate, pst-geo #33

Closed hvoss49 closed 3 years ago

hvoss49 commented 3 years ago

The path setting is only for my system and must be modified if you want to run it.

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass[border=5mm]{standalone}
\pagestyle{empty}
\usepackage{pst-geo} \psset{unit=0.5,path=pst-geo/data}
\begin{document}
\begin{pspicture}(-7,-7)(7,7)\WorldMapThreeD\end{pspicture}\quad
\begin{pspicture}(-7,-7)(7,7)\WorldMapThreeD[RotX=10,RotY=-40]\end{pspicture}
\end{document}
[Loading MPS to PDF converter (version 2006.09.02).]
) [1...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:527: Unknown na
me "truncate"
stack traceback:
    [C]: in function 'error'
    ...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:527: in upvalue 'l
ookup'
    ...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:2790: in upvalue '

expected result:

Bildschirmfoto 2021-08-31 um 11 25 32
zauguin commented 3 years ago

I tried implementing truncate but I couldn't verify it with the test document since I don't have the pst-map3d package.

hvoss49 commented 3 years ago

replace pst-map?? by pst-geo and it should work. Now lua:528: Unknown na me "arccos". is rthe problem

zauguin commented 3 years ago

Now lua:528: Unknown name "arccos". is rthe problem

This is an odd one. arccos is not a standard operator in PostScript so it has to be defined somewhere. There is a definition in tx@geoDict, but arccos is used before tx@geoDict is invoked so it shouldn't be able to find it. So I don't really know why GhostScript doesn't fail here...

hvoss49 commented 3 years ago

I see ... with my Ghostscript (9.55.0):

GS<1>systemdict /arccos known ==
true

However, in pst-geo.tex I load now tx@geoDict for arccos:

/AngleRayonsSoleil latitude_parallel 23.5 sin 360 jours mul 365.25 div sin mul tx@geoDict begin arccos end sub def

But then I get:

[Loading MPS to PDF converter (version 2006.09.02).]
) [1[string "-- luatex-core security and io overloads ....."]:51: bad argument 
#1 to 'io_open' (string expected, got nil)
stack traceback:
    [C]: in upvalue 'io_open'
    [string "-- luatex-core security and io overloads ....."]:51: in function 'io.
open'
    ...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:2533: in function 
<...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:2531>
zauguin commented 3 years ago

I see ... with my Ghostscript (9.55.0):

GS<1>systemdict /arccos known ==
true

Oh, that explains it. I now found it as a documented extension for GhostScript. They are very easy to add so I might just do that.

But then I get:

[Loading MPS to PDF converter (version 2006.09.02).]
) [1[string "-- luatex-core security and io overloads ....."]:51: bad argument 
#1 to 'io_open' (string expected, got nil)
stack traceback:
  [C]: in upvalue 'io_open'
  [string "-- luatex-core security and io overloads ....."]:51: in function 'io.
open'
  ...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:2533: in function 
<...ive/texmf-local/tex/generic/pstricks-lua/luapstricks.lua:2531>

That's a terrible way of telling you: "File not found". The new version should feature a better error message (including the filename/path which wasn't found). It also fixes some other issues about the decompression.

On my system the new version seems to work except that the second globe isn't positioned correctly.

zauguin commented 3 years ago

I found the issue causing the globe to shift: pst-geo defines /MaillageSphere which starts with gsave but never executes grestore. This messes up the nesting of the gsave/grestore groups, causing everything after the figure to be shifted (since the shift from the origin to the figure is never reverted)

hvoss49 commented 3 years ago

Good catch! Fixed in svn.