]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur-bezier-bow.cc
release: 1.5.23
[lilypond.git] / lily / slur-bezier-bow.cc
index 4d5c9bdae60a8df82a6f16e9981548a7b39610a2..8c1babb399cf1f9ac0419e6825bc9e78f8cba104 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000  Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2001  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "debug.hh"
@@ -103,17 +103,17 @@ Slur_bezier_bow::enclosed_area_f () const
          x = Interval ((encompass_[i-1][X_AXIS] + encompass_[i][X_AXIS])/2, 
                        encompass_[i][X_AXIS]);
          y = Interval (0,
                      (curve_.get_other_coordinate (X_AXIS,
                                                    (x[MIN] + x[MAX]) / 2)));
+ (curve_.get_other_coordinate (X_AXIS,
+ (x[MIN] + x[MAX]) / 2)));
        }
       else
        {
          x = Interval ((encompass_[i-1][X_AXIS] + encompass_[i][X_AXIS]) / 2, 
                      (encompass_[i][X_AXIS] + encompass_[i+1][X_AXIS]) / 2);
+ (encompass_[i][X_AXIS] + encompass_[i+1][X_AXIS]) / 2);
          y = Interval (encompass_[i][Y_AXIS],
                      (curve_.get_other_coordinate (X_AXIS, x[MIN])
+ (curve_.get_other_coordinate (X_AXIS, x[MIN])
                         + curve_.get_other_coordinate (X_AXIS,
                                                      (x[MIN] + x[MAX]) / 2)
+ (x[MIN] + x[MAX]) / 2)
                         + curve_.get_other_coordinate (X_AXIS, x[MAX])) / 3);
        }
       
@@ -154,18 +154,15 @@ Slur_bezier_bow::minimise_enclosed_area (Real beauty,
   if (fit_factor () > 1.0)
     blow_fit ();
   
-  Real pct_c0 = gh_scm2double (gh_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
-  Real pct_c3 = gh_scm2double (gh_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
-  Real pct_in_max =  gh_scm2double (gh_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
-  Real pct_out_max = gh_scm2double (gh_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
-  Real steps =  gh_scm2double (gh_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
+  Real pct_c0 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
+  Real pct_c3 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
+  Real pct_in_max =  gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
+  Real pct_out_max = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
+  Real steps =  gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
 
   for (int i=0; i < steps; i++)
     {
       Real area = enclosed_area_f ();
-      if (!i)
-       DEBUG_OUT << to_str ("Init area: %f\n", area);
-
       if (area <= beautiful)
        break;
 
@@ -186,14 +183,12 @@ Slur_bezier_bow::minimise_enclosed_area (Real beauty,
       curve_.control_[1][X_AXIS] -= da[0] * u * pct;
       curve_.control_[2][X_AXIS] -= da[1] * u * pct;
     }
-
-  //  Real area = enclosed_area_f ();
 }
 
 
 
 /*
-  max ( encompass.y / curve.y )
+  max (encompass.y / curve.y)
   
  */
 Real