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: joeneeman
Subject: Re: Gets vertical skylines from grob stencils (issue 5626052)
Date: Tue, 21 Aug 2012 07:22:58 +0000

On 2012/08/17 19:25:29, Keith wrote:
On Fri, 17 Aug 2012 10:16:25 -0700, <mailto: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.

Object AA, a member of the forest, sets two constraints
         floor = padding  -  AA[UP] ~distance~ BB[DOWN]
         ceiling = AA[DOWN] ~distance~ BB[UP]  - padding
and we are checking that a trial location satisfies
         (trial >= floor) OR (trial <= ceiling)

I suppose you show BB having been placed just above the staff, and
that it still
lies below the ceiling set by AA, so this trial position satisfies the
first
test in the OR above, so we win.

All these distances can be computed once, before raising the skylines
at all,
because they tell you right away what trial values of raising BB will
clear AA.
That would be much simpler for people like me to understand than
computing the
four intersects() conditions, after having moved the skylines by zero
or more
bump(s).


I've implemented this method in dev/jneem-skylines and it looks pretty
neat. Next, padding...

http://codereview.appspot.com/5626052/



reply via email to

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