]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' into jneeman
authorJoe Neeman <joeneeman@gmail.com>
Wed, 4 Jul 2007 09:32:22 +0000 (19:32 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Wed, 4 Jul 2007 09:32:22 +0000 (19:32 +1000)
1  2 
lily/simple-spacer-scheme.cc

index 17b09c10630747eae4a6e97cf201f9e3202ee665,fda38ab503bb41de7039116a15448f34b8a38525..48f127bfca5ae710b5778c73b343e6d08e994839
  
  LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
           4, 1, 0, (SCM springs, SCM rods, SCM length, SCM ragged),
-          "Solve a spring and rod problem for @var{count} objects, that "
-          "are connected by @var{count-1} springs, and an arbitrary number of rods "
-          "Springs have the format (ideal, inverse_hooke) and rods (idx1, idx2, distance) "
-          "@var{length} is a number, @var{ragged} a boolean "
-          "Return: a list containing the force (positive for stretching, "
-          "negative for compressing and #f for non-satisfied constraints) "
-          "followed by the @var{spring-count}+1 positions of the objects. ")
+          "Solve a spring and rod problem for @var{count} objects, that"
+          " are connected by @var{count}-1 @var{springs}, and an arbitrary"
+          " number of @var{rods}.  @var{count} is implicitly given by"
+          " @var{springs} and @var{rods}.  The @var{springs} argument has"
+          " the format @code{(ideal, inverse_hook)} and @var{rods} is of"
+          " the form @code{(idx1, idx2, distance)}.\n"
+          "\n"
+          "@var{length} is a number, @var{ragged} a boolean.\n"
+          "\n"
+          "The function returns a list containing the force (positive for"
+          " stretching, negative for compressing and @code{#f} for"
+          " non-satisfied constraints) followed by @var{spring-count}+1"
+          " positions of the objects.")
  {
    int len = scm_ilength (springs);
    if (len == 0)
        Real ideal = scm_to_double (scm_caar (s));
        Real inv_hooke = scm_to_double (scm_cadar (s));
  
 -      spacer.add_spring (ideal, inv_hooke);
 +      Spring sp (ideal, 0.0);
 +      sp.set_inverse_compress_strength (inv_hooke);
 +      sp.set_inverse_stretch_strength (inv_hooke);
 +
 +      spacer.add_spring (sp);
      }
  
    for (SCM s = rods; scm_is_pair (s); s = scm_cdr (s))