Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2579

Re: Saving currentpoint and CTM

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Carlos <angus@quovadis.com.ar>
Newsgroups comp.lang.postscript
Subject Re: Saving currentpoint and CTM
Date Fri, 20 May 2016 22:58:42 +0200
Organization A noiseless patient Spider
Lines 28
Message-ID <20160520225842.2a5f4a15@samara.DOMA> (permalink)
References <slrnnjueoi.4it.cheney@atc5.vermine.org>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
Injection-Info mx02.eternal-september.org; posting-host="14ae01f255251c16afab023606f4d0b9"; logging-data="28126"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NfIM77ggHEzZyfQeN9lBLY/b/FHDRbuY="
X-Newsreader Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
Cancel-Lock sha1:4VUcHv5LzKBvnUpHqzaR8hLaMnU=
Xref csiph.com comp.lang.postscript:2579

Show key headers only | View raw


[Andre Majorel <cheney@halliburton.com>, 2016-05-20 16:28]
> Is there a way to save (and later restore) currentpoint and the
> CTM, so that after restoring, you can resume adding to the path
> as if no moves or rotations had happened since you saved ?
> 
> Rather not use gsave/grestore because
> 1. it saves and restores more things than I want, such as the path,
> 2. it is saved on the stack and I would prefer a dictionary of
>    arrays or something like that which would give me the freedom
>    of saving multiple times and restoring in any order without
>    burdening my feeble brain.
> 
> Thanks in advance.
> 

Do you mean something like this?

  /savepos { [ currentpoint 6 array currentmatrix ] } def
  /restorepos { aload pop setmatrix moveto } def

E.g.,

 100 100 moveto 100 0 rlineto /x savepos def
 0 20 260 { x restorepos  rotate  50 0 rlineto } for
 showpage

-- 

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Saving currentpoint and CTM Andre Majorel <cheney@halliburton.com> - 2016-05-20 16:28 +0000
  Re: Saving currentpoint and CTM luser- -droog <mijoryx@yahoo.com> - 2016-05-20 11:52 -0700
    Re: Saving currentpoint and CTM luser- -droog <mijoryx@yahoo.com> - 2016-05-20 11:55 -0700
  Re: Saving currentpoint and CTM Carlos <angus@quovadis.com.ar> - 2016-05-20 22:58 +0200
    Re: Saving currentpoint and CTM Andre Majorel <cheney@halliburton.com> - 2016-05-21 17:52 +0000
  Re: Saving currentpoint and CTM jdaw1 <jdawiseman@gmail.com> - 2016-05-21 05:55 -0700

csiph-web