Re: [LIBART] Working on new canvas item...

On 27 Oct 2000, Lauris Kaplinski wrote:

> Hello!
> > [Question about posting application screenshots deleted]
> Well, I bet most people would appreciate, if you could find some web
> space for screenshots and just post url here. Size considerations aside,
> some people are telneting to their mail machines, and getting screenshot
> back to work machine is quite inconvenient.

   An excellent suggestion, and a compromise I should have thought of,
unprompted.  I'll go about setting up a directory for that purpose

> > > > <snip> Getting error messages of the form:
> > > > 
> > > > colinear!
> > > > colinear!
> > > <snip>
> > > 
> > > Try inserting:
> > > 
> > > perturbed_vpath = art_vpath_perturb (vpath);
> > > 
> > > Before stroking your vpath. Libart (at least the one distributed with
> > > gnome-libs) is not always happy with straight
> > > horizontal/vertical lines - perturb make these slanted, adding
> > > microscopic disturbances to points.
> > 
> >    Tried this, and while it did in fact make those error messages go
> > away, it *also* made the vertical bars on my pricebars go away.  Hmm.
> > Does the ordering of the strokes make any difference?  As it is, I do
> > a MOVETO_OPEN to the beginning of the opening tic, then a horizontal
> > LINETO to the center bar, a vertical LINETO down to the bottom, then
> > a vertical LINETO up to the top, another vertical LINETO down to the
> > level of the closing tic, and then a horizontal LINETO over to the
> > end of the closing tic.  Then I put the ART_END point on.  Is there
> > some better ordering that I should use?  I suppose I could retrace
> > the entire set of steps back to the beginning and make it a "closed"
> > path, but it seems like a waste of CPU to do it.  I really want this
> > code to be *fast*.
> I would suggest:
> MOVETO_OPEN (opening tic) LINETO (bar)
> MOVETO_OPEN (bottom of bar) LINETO (top of bar)
> MOVETO_OPEN (bar) LINETO (closing tic)

    Ahh, excellent.  My impression from the documentation and the
source code I studied was that the vector paths had to be "closed"
in the sense that you can't "lift the pen" once you start drawing.
But it *is* possible to mix MOVETOs and LINETOs.  OK, made these
changes *and* put the art_vpath_perturb() call back in.  I still
get a few of these:

x_order_2: colinear!

   But only about 10 of them for ~430 pricebars.  I suspect that
I'm getting them on pricebars where the open/close tics are at
the same value.  And also, there are no *visible* plotting
artifacts like "blocks" or tics that extend halfway across the

   Thanks again for your help!

> Libart handles multipart paths well and you get rid of ugly 180 degree
> turn.
> Lauris

Jim Wiggs
wiggs wiggs net

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