lilypond-devel
[Top][All Lists]
Advanced

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

Re: Doc: NR 4.1.2: Reorganize vertical dimensions. (issue2316042)


From: Carl . D . Sorensen
Subject: Re: Doc: NR 4.1.2: Reorganize vertical dimensions. (issue2316042)
Date: Sat, 02 Oct 2010 16:32:06 +0000

On 2010/10/02 16:09:22, Mark Polesky wrote:
 On 2010/10/02 09:17:16, perpeduumimmobile wrote:
> Again, it's a reference.  We can mentioned Hooke's
> law, don't we?

Okay, here we go...

   Hooke's law:  F=-kx

   "x" is the displacement of the end of the spring
   from its equilibrium position (in SI units: "m");

   "F" is the restoring force exerted by the material
   (in SI units: N or kg·m/s^2); and

   "k" is the force constant (or spring constant) (in
   SI units: N/m or kg/s^2).

So, according to Joe, stretchability is equal to 1/k.  So, if we use
"s" for
stretchability, then

    F=-x/s

Now, hopefully you realize that this is completely uninformative
unless we
explain the following, all of which remain unclear to me:

1) what is the "equilibrium position" of the stretchable space?


As I understand it, the space value is the equilibrium (zero penalty)
position of the stretchable space.

2) what is its "displacement" from the equilibrium?


The displacement is the (actual proposed space) - (space)

3) what is the "restoring force" exerted by the stretchable space and
what is
its unit of measurement?

The restoring force is a penalty value that is used to calculate the
location of objects; we try to minimize the total page penalty.

So I think we get penalty = [(proposed actual space) -
(space)]/stretchability


I feel that simply mentioning Hooke's law does little to help the
LilyPond user
understand how to select meaningful values to achieve the desired
vertical
spacing.  Is there anyone here for whom the Hooke's law analogy
clarifies the
spacing behavior?  (Carl?)

Yes, I understand the Hooke's law analogy.  But it would seem to me that
others would understand how springs work, even if they don't know
Hooke's law.

I'd try an explanation something like this:

When laying out a page, LilyPond makes a stack of the layout items
(staves, lyrics lines, chordnames, etc.) on the page, with a variable
spacing item between each pair of layout items.  When calculating the
desired location of each layout item, the code treats the page as if the
layout items were rigid blocks and the spacing items were springs, and
the whole assembly of blocks and springs is made to fit in the space of
the page.  In order to make it fit, the springs will be stretched or
compressed.

The spacing variables affect the size and strength of the springs, as
well as the size of the rigid blocks.  'padding is added to rigid block
above.  'space determines the size of the spring -- it's the space that
would be used if no squeezing or stretching would be required to fit the
systems together.  'stretchability determines the strengths of the
springs.  Higher values of 'stretchability make the spring weaker; lower
values of stretchability make the spring stronger.  'minimum-space is
the shortest-possible length of the spring.  When the space between the
two layout items reaches 'minimum-space, the two layout items can be
placed no closer together.



End of sample

Now, I haven't tested this functionality carefully.  Nor have I
carefully followed it through the code.  But I have browsed the code,
and tested some spacing examples.  I believe that this is how the code
works.  I'd welcome any corrections.

Thanks,

Carl


http://codereview.appspot.com/2316042/

reply via email to

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