Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

After x y scale Nothing Works

0 views
Skip to first unread message

handheld-penguin

unread,
Nov 17, 2009, 7:52:40 AM11/17/09
to
I have a postscript file with the following lines, andgate is a def
earlier on.

128 14 translate
1.00 1.00 scale
0 0 andgate stroke
-128 -14 translate
-1.00 -1.00 scale

foo
showpage

However, in the area where I have written foo the stuff that I put in
there doesn't appear in my output. If I remove the scale however then
it does. I have tried with 2 2 scale and 0 0 scale to no avail.

Cheers

ken

unread,
Nov 17, 2009, 8:01:11 AM11/17/09
to
In article <025a3e0b-6e88-411b-b81d-
900e0c...@a32g2000yqm.googlegroups.com>, edba...@gmail.com says...

Setting scale negative will cause increasing x or y values to produce
increasing negative numbers. So 0 0 moveto 10 10 lineto stroke will
produce a diagonal line moving down and left instead of up and right.

Possibly this is what you want, without seeing the definition of
'andgate' or the contents of 'foo' its not really possible to tell.

Note that 0 0 scale will scale all output to nothing, so its no surprise
that this produces no marks.

You could just try 1 1 scale.


Ken

RedGrittyBrick

unread,
Nov 18, 2009, 5:23:56 AM11/18/09
to

Doesn't scaling by a factor of exactly one ('1 1 scale' or '1.00 1.00
scale') do exactly nothing?

--
RGB

ken

unread,
Nov 18, 2009, 8:33:30 AM11/18/09
to
In article <4b03cb3f$0$2480$db0f...@news.zen.co.uk>,
RedGrit...@spamweary.invalid says...

> > You could just try 1 1 scale.
> >
>
> Doesn't scaling by a factor of exactly one ('1 1 scale' or '1.00 1.00
> scale') do exactly nothing?

Well yes, that was the point. Since I don't know what else is going on
in the missing sections, that might give some clues as to whether these
were affecting the problem. If eliding the scale caused no problems, and
a 1 1 scale did, then there is something odd happening with the action
of scale.

If it works OK then you could move on to 1.1 1.1 scale and so forth to
see what happened with smaller factors.


Ken

abe...@hotmail.com

unread,
Nov 18, 2009, 3:35:54 PM11/18/09
to
Guessing the OP was trying to draw an and gate that looks exactly like
a 100 point square and
foo is a red and gate 8-) it works fine if you move the and gate back
into view.

While the upper right is what you print you can certainly place marks
in the other areas.

|see|
| |
--------
|
|


Ed

%!
/andgate
{
pop pop
0 0 moveto
0 100 lineto
100 100 lineto
100 0 lineto
0 0 lineto
} def

/foo
{
gsave
1 0 0 setrgbcolor
0 0 andgate
stroke
grestore
} def

128 14 translate
1.00 1.00 scale
0 0 andgate stroke
-128 -14 translate
-1.00 -1.00 scale

-112 -192 translate % move into view

foo
showpage


handheld-penguin

unread,
Nov 26, 2009, 6:47:41 AM11/26/09
to
I solved the issue: it was because I was translating then de-scaling.
Obviously the translation would be scaled and so would not appear in
the visible area.

The solution is to just switch two lines so that the -1 -1 scale
comes before the translation to move back to the origin.

0 new messages