[GRASS-dev] ps.map: diag_up.eps pattern improve

Hi all,

This a improved version of diag_up.eps

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 10 10
newpath
0 0 moveto
10 10 lineto
9 -1 moveto
11 1 lineto
-1 9 moveto
1 11 lineto
stroke

because postscript clip with into the boundingbox limit the outside parts are
not stroke but this eps make a full diagonal up line.

Only a question, the diagonal line width is sqrt(2),
a scale of 1/sqrt(2) = 0.71 make the width of the line similar a any
horizontal line of width of 1.

E. Jorge Tizado

Similar is the full diagonal down line (and other diagonal pattern)

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 10 10
newpath
0 10 moveto
10 0 lineto
-1 1 moveto
1 -1 lineto
9 11 moveto
11 9 lineto
stroke

ejtizado wrote:

This a improved version of diag_up.eps

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 10 10
newpath
0 0 moveto
10 10 lineto
9 -1 moveto
11 1 lineto
-1 9 moveto
1 11 lineto
stroke

thanks! these line breaks have annoyed me for a long time.

because postscript clip with into the boundingbox limit the outside
parts are not stroke but this eps make a full diagonal up line.

I am not at all a PostScript expert - is it valid to place coordinates
beyond the limits of the bounding box? (similar question for GRASS's
symbol format)

Only a question, the diagonal line width is sqrt(2),

is it?

a scale of 1/sqrt(2) = 0.71 make the width of the line
similar a any horizontal line of width of 1.

i.e. 0.71 PostScript points? I'm not sure that I follow.

In the wiki help page I had written "Color and width of patterns are set
by [vareas] fcolor and width instructions until overwritten in the pattern
file." Testing it now that doesn't seem to be the case but from memory it
used to be. ??

Hamish

Hamish wrote:

> because postscript clip with into the boundingbox limit the outside
> parts are not stroke but this eps make a full diagonal up line.

I am not at all a PostScript expert - is it valid to place coordinates
beyond the limits of the bounding box? (similar question for GRASS's
symbol format)

The PostScript language treats any line beginning with a % as a
comment.

DSC comments (beginning with %%) are used by programs which manipulate
PostScript code, e.g. print spoolers, interactive viewers,
Illustrator, etc.

If you were to embed the EPS file in question into another document,
the software might add a clipping path which matches the %%BoundingBox
comment, or it might not.

I don't know how ps.map handles patterns, but in general you shouldn't
rely upon clipping to the bounding box.

> Only a question, the diagonal line width is sqrt(2),

is it?

I don't think so.

> a scale of 1/sqrt(2) = 0.71 make the width of the line
> similar a any horizontal line of width of 1.

i.e. 0.71 PostScript points? I'm not sure that I follow.

In the wiki help page I had written "Color and width of patterns are set
by [vareas] fcolor and width instructions until overwritten in the pattern
file." Testing it now that doesn't seem to be the case but from memory it
used to be. ??

I suggest changing the pattern to use filled areas rather than stroked
lines, e.g.:

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 10 10
0 0 moveto
0 0.5 lineto
9.5 10 lineto
10 10 lineto
10 9.5 lineto
0.5 0 lineto
closepath
fill
9.5 0 moveto
10 0 lineto
10 0.5 lineto
closepath
fill
0 9.5 moveto
0 10 lineto
0.5 10 lineto
closepath
fill

This doesn't make any assumptions about the line width or clipping.

--
Glynn Clements <glynn@gclements.plus.com>