lilypond-devel
[Top][All Lists]
Advanced

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

Re: Gets vertical skylines from grob stencils (issue 5626052)


From: Joe Neeman
Subject: Re: Gets vertical skylines from grob stencils (issue 5626052)
Date: Sat, 18 Aug 2012 06:57:50 +1000


On Sat, Aug 18, 2012 at 5:34 AM, Keith OHara <address@hidden> wrote:
On Fri, 17 Aug 2012 10:16:25 -0700, <address@hidden> wrote:


http://codereview.appspot.com/5626052/diff/106004/lily/axis-group-interface.cc#newcode780
lily/axis-group-interface.cc:780: while (dirty);
On 2012/08/17 08:12:56, Keith wrote:
I am beginning to understand the new code. Would you consider again using
distance() instead of the repeated calls to intersects() in the while(dirty)
loop ?  It might look simpler now that you've been away from the code
for awhile.

floors[j] = padding - forest[j][UP]~distance~pair[DOWN]
ceilings[j] = forest[j][DOWN]~distance~pair[UP]

You know the solution will be to move an amount equal to one of the floors[j],
and you want to find the smallest that fits, so make
   trials = sort (floors)
and find the smallest among trials that satisfies
    trials[n] > 0
&&  for all j (trials[n] > floors[j]
                || trials[n] < ceilings[j] )

I am not adverse to using distance if possible - my trouble case is the
following.

AAAAAAAAA

     BBBBBBBBBBBBB

Image that object A above is placed first and LilyPond is now
considering whether it should leave B where it is or place it above A.
The distance function would dictate that it needs to be shifted above A
because its DOWN skyline is below A's UP.

We need not let the distance function between A[UP] and B[DOWN] dictate, because having positive distance between A[DOWN] and B[UP] is another solution.

If you check out the dev/jneem-skylines (which is a simplified but not (yet) feature-compatible version of Mike's branch), you'll see that I'm using this method under the name 'bool Skyline_pair::intersects.'

Cheers,
Joe


reply via email to

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