bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with arcs in gpic


From: Michael Cain
Subject: Re: Problem with arcs in gpic
Date: Thu, 27 Aug 2009 10:54:41 -0600

Following up on my own report after poking through things this morning. In the src/preproc/pic directory, in file object.cpp, in the routine declared as "linear_object *object_spec::make_arc", lines 1833 and 1834 have the statement

    while (radius < d)
      radius *= 2.0;

In my example, in some cases the test (radius < d) was satisfied, but the difference in the two values was on the order of 1e-10. Since radius was 0.1, doubling the radius leads to the fairly gross error that I was encountering. For the time being, my workaround is to replace that statement with

    if (radius < d)
      radius = d;

which fixed my problem. The original code appears to have been intended to deal with the situation when radius is orders of magnitude less than d. My replacement code simply assigns radius the smallest value that avoids problems with the floating point code/libraries further on in the routine.

On Aug 26, 2009, at 9:41 AM, Michael Cain wrote:

I'm having the following problem with drawing a series of arcs in gpic. I'm running version 1.20.1, compiled from sources on Mac OS X version 10.5.8. The following code draws a sequence of connected arcs, alternating in size, from top to bottom:

.PS
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
        arc  cw rad 0.075 to Here+(0,-0.15)
        arc ccw rad 0.025 to Here+(0,-0.05)
.PE

Part way through the sequence, the radius for the arcs gets messed up. This happens in the output from gpic alone, shown here. I tried the same experiment on an Ubuntu Linux box, also with gpic version 1.20.1, and got the same result.

.lf 1 foo.mm
.lf 1
.PS 1.600i 0.100i
.\" -0.025 -1.6 0.075 0
.\" 0.000i 1.600i 0.100i 0.000i
.nr 00 \n(.u
.nf
.nr 0x 1
\h'0.100i'
.sp -1
\D't -1.000p'\h'1.000p'
.sp -1
\h'0.025i'\v'0.150i'\D'a 0.000i -0.075i -0.000i -0.075i'
.sp -1
\h'0.025i'\v'0.150i'\D'a 0.000i 0.025i -0.000i 0.025i'
.sp -1
\h'0.025i'\v'0.350i'\D'a 0.000i -0.075i -0.000i -0.075i'
.sp -1
\h'0.025i'\v'0.350i'\D'a 0.000i 0.025i -0.000i 0.025i'
.sp -1
\h'0.025i'\v'0.550i'\D'a 0.000i -0.075i -0.000i -0.075i'
.sp -1
\h'0.025i'\v'0.550i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
\h'0.025i'\v'0.750i'\D'a 0.000i -0.075i -0.000i -0.075i'
.sp -1
\h'0.025i'\v'0.750i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
\h'0.025i'\v'0.950i'\D'a 0.000i -0.075i -0.000i -0.075i'
.sp -1
\h'0.025i'\v'0.950i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
\h'0.025i'\v'1.150i'\D'a -0.130i -0.075i 0.130i -0.075i'
.sp -1
\h'0.025i'\v'1.150i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
\h'0.025i'\v'1.350i'\D'a -0.130i -0.075i 0.130i -0.075i'
.sp -1
\h'0.025i'\v'1.350i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
\h'0.025i'\v'1.550i'\D'a -0.130i -0.075i 0.130i -0.075i'
.sp -1
\h'0.025i'\v'1.550i'\D'a 0.043i 0.025i -0.043i 0.025i'
.sp -1
.sp 1.600i+1
.if \n(00 .fi
.br
.nr 0x 0
.lf 18
.PE
.lf 19



_______________________________________________
bug-groff mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-groff





reply via email to

[Prev in Thread] Current Thread [Next in Thread]