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


Groups > comp.lang.postscript > #2579

Re: Saving currentpoint and CTM

From Carlos <angus@quovadis.com.ar>
Newsgroups comp.lang.postscript
Subject Re: Saving currentpoint and CTM
Date 2016-05-20 22:58 +0200
Organization A noiseless patient Spider
Message-ID <20160520225842.2a5f4a15@samara.DOMA> (permalink)
References <slrnnjueoi.4it.cheney@atc5.vermine.org>

Show all headers | 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