On 17 août 2012, at 16:57, Joe Neeman <joenee...@gmail.com> wrote:
>
> On Sat, Aug 18, 2012 at 5:34 AM, Keith OHara <k-ohara5...@oco.net> wrote:
> On Fri, 17 Aug 2012 10:16:25 -0700, <mts...@gmail.com> 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
>
This is great, Joe. If you can get it to a point where it is feature
compatible such that it eliminates the calls to both intersection and distance,
lemme know. I'll have time to work on it together in the AM for the next few
days. I am starting to understand how this solution works but I don't think I
could write it from scratch w/o doing more thinking so if you have something
almost functional I'd rather go from that.
Cheers,
MS
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel