lilypond-devel
[Top][All Lists]
Advanced

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

Re: Add \path markup command, and use it for \eyeglasses. (issue1730044


From: pnorcks
Subject: Re: Add \path markup command, and use it for \eyeglasses. (issue1730044)
Date: Sat, 26 Jun 2010 00:06:54 +0000

On 2010/06/22 03:50:24, Carl wrote:
On 2010/06/21 22:39:53, Patrick McCarty wrote:
> On 2010/06/20 11:07:37, Carl wrote:
> > Is it possible to have the path command estimate reasonable
> > extents, rather than using (0 . 0) and (0 . 0)?  Since we
> > know the thickness of the line, and we have a list of
> > points, it seems we should be able to keep track of the
> > maximum and minimum X and Y coordinates during the path
> > creation.
>
> This should be possible, but I'm not sure how to implement it,
> especially when relative coordinates are involved.

My first thought would be to start with currentx=currenty=
xmax=xmin=ymax=ymin = 0.

For an absolute move, set currentx = move x, currenty = move y.

For a relative move, set currentx += movex, currenty += movey.

If currentx > xmax, xmax=currentx.  If currenty > ymax,
ymax=currenty.  If currentx < xmin, xmin = currentx.  If
currenty < ymin, ymin = currenty.

For curves, go one point at a time.  The control points bound
the curve, so you can use the control points as if they were
curve points.

When you're done with all the points, add half the thickness to
xmax and ymax, and subtract half the thickness from xmin and
ymin.

I haven't tried it, but it seems to me it should work.

Hi Carl,

Thanks for your help.

I've uploaded a new patch set that (more or less) follows your
algorithm above, and also changes the interface again (according
to Han-Wen's and Jan's comments).

Let me know what you think.

Thanks,
Patrick


http://codereview.appspot.com/1730044/show



reply via email to

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