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


Groups > comp.lang.postscript > #2791

How can I test for an open subpath ?

Newsgroups comp.lang.postscript
From Peter Billam <peter@www.pjb.com.au>
Subject How can I test for an open subpath ?
Message-ID <slrnnrtfc1.51t.peter@box8.pjb.com.au> (permalink)
Date 2016-08-25 09:42 +0000
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


I find it easy enough to test for existence of a current path, eg:
  { currentpoint } stopped { ...  % no
  } {                pop pop ...  % yes
  } ifelse
(and there may be better ways)

but I'd like to start a procedure with a lineto if there's
a currently open subpath, and with a moveto if there isn't.
Is there a neat way of doing this ?
I can't just use  currentpoint  because it remains defined
after a  closepath;  likewise:
  { gsave lineto grestore } stopped { x0 y0 moveto  % no
  } {                                 x0 y0 lineto  % yes
  } ifelse
messes up for (I think) similar reasons ...  There must be
some neater way than overwriting newpath and closepath ...
Do I have to do forsenics inside pathforall ?

Peter

-- 

Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

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


Thread

How can I test for an open subpath ? Peter Billam <peter@www.pjb.com.au> - 2016-08-25 09:42 +0000
  Re: How can I test for an open subpath ? Carlos <angus@quovadis.com.ar> - 2016-08-25 16:49 +0200
    Re: How can I test for an open subpath ? Peter Billam <peter@www.pjb.com.au> - 2016-08-27 04:28 +0000
    Re: How can I test for an open subpath ? jdaw1 <jdawiseman@gmail.com> - 2016-08-27 10:32 -0700

csiph-web