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

graphics-bug



    Date: Fri, 30 Nov 1990 09:26 EST
    From: gmdzi!nieters%sphinx@ai.sri.com (Hans Nieters)

    The call of draw-polygon does not produce visible output in case of thickness 1
	    for skew lines in genera-8

    (graphics::draw-polygon  '(100 100 100 200 300 200 200 100) :thickness 1 :filled nil)

    Since it works for genera 7, i am surprised. Can it be repaired?

    Hans Nieters  

This bug happens when drawing lines with thicknesses between 1 and
1.414.. (yup - that's (sqrt 2)) at 45 degree angles.  As the angle
decreases towards 0 (or increases towards 90) the range of buggy
thicknesses also decreases.  Horizontal or vertical lines don't exhibit
the bug at all.

(Math weenies can probably discover the nature of the bug for themselves
by pondering the trigonometric nature of its manifestation.)

There are several workarounds.  The easiest is to simply use :thickness
0 when you would have used :thickness 1.  (Thickness 0 is a special case
which avoids the exact rendering code.)  This will have the side effect
of speeding up the drawing slightly, at the expense of inexact rendering.

Another possible workaround will give you exact rendering, at the expense of
slowing down the drawing slightly.  That is to wrap:

  (graphics:with-scan-conversion-mode (stream :round-coordinates nil)

around the code in question.  (It was a change in the default
coordinate-rounding mode that revealed the bug in Genera 8.)

The bug is well known, and these comments have been given to customer
support long ago.  (The fix, on the other hand, is not a quick one and
we regret that it has not yet made it into the system.)

John Aspinall