[gs-devel] a question about arct(o)

Thorsten S thorsten.schwander at gmail.com
Mon Jan 8 14:16:25 PST 2007


Hi,

I recently noticed that the handling of degenerate cases in arct(o) has changed.

A simple example is "newpath 10 20 moveto 10 20 10 20 0 arct"

which gives different results with latest svn HEAD compared to
previous versions.
This is on various linux boxes, both i386 and x86_64, recent redhat and fedora.

ESP Ghostscript 815.03 (2006-08-25)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>newpath 10 20 moveto 10 20 10 20 0 arct
GS>currentpoint 2 1 roll == ==
9.99902344
19.9980469
GS>

GPL Ghostscript SVN PRE-RELEASE 8.56 (2006-05-20)
Copyright (C) 2006 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>newpath 10 20 moveto 10 20 10 20 0 arct
Error: /undefinedresult in --execute--
Operand stack:
  10   20   10   20   0
Execution stack:
  %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--
--nostringval--   %loop_continue   1689   2   3   %oparray_pop
--nostringval--   --nostringval--   false   1   %stopped_push
.runexec2   --nostringval--   --nostringval--   --nostringval--   2
%stopped_push   --nostringval--
Dictionary stack:
  --dict:1078/1123(ro)(G)--   --dict:0/20(G)--   --dict:69/200(L)--
Current allocation mode is local
Current file position is 40


lets add a little to the second y coordinate

GS<5>newpath 10 20 moveto 10 20 10 20.01 0 arct
GS<5>currentpoint 2 1 roll == ==
10.0
19.9999847
GS<5>


AFPL Ghostscript SVN PRE-RELEASE 8.55 (2006-05-20)
Copyright (C) 2006 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>newpath 10 20 moveto 10 20 10 20 0 arct
GS>currentpoint 2 1 roll == ==
10.0
20.0
GS>


Is this intentional? The PLRM states that when the tangents are
colinear, the joining arc has length zero and arct appends a line
segment to current path. In the example above, that line segment would
also be zero length.

Cheers
T.



More information about the gs-devel mailing list