-void
-Spaceable_grob::add_spring (Grob *me, Grob *other,
- Real distance, Real inverse_strength)
-{
-#ifndef NDEBUG
- SCM mins = me->get_object ("ideal-distances");
- for (SCM s = mins; scm_is_pair (s); s = scm_cdr (s))
- {
- Spring *sp = unsmob_spring (scm_car (s));
- if (sp->other_ == other)
- {
- programming_error ("already have that spring");
- return;
- }
- }
-#endif
-
- Spring spring;
- spring.set_inverse_stretch_strength (inverse_strength);
- spring.set_inverse_compress_strength (inverse_strength);
- spring.set_distance (distance);
- spring.other_ = other;
-
- SCM ideal = me->get_object ("ideal-distances");
- ideal = scm_cons (spring.smobbed_copy (), ideal);
- me->set_object ("ideal-distances", ideal);
-}
-