+static Grob*
+maybe_find_prebroken_piece (Grob *g, Direction d)
+{
+ Grob *ret = dynamic_cast<Item*> (g)->find_prebroken_piece (d);
+ if (ret)
+ return ret;
+ return g;
+}
+
+static Grob*
+next_spaceable_column (vector<Grob*> const &list, vsize starting)
+{
+ for (vsize i = starting+1; i < list.size (); i++)
+ if (!is_loose (list[i]))
+ return list[i];
+ return 0;
+}
+
+static Column_description
+get_column_description (vector<Grob*> const &cols, vsize col_index, bool line_starter)
+{
+ Grob *col = cols[col_index];
+ if (line_starter)
+ col = maybe_find_prebroken_piece (col, RIGHT);
+
+ Column_description description;
+ Grob *next_col = next_spaceable_column (cols, col_index);
+ if (next_col)
+ Spaceable_grob::get_spring (col, next_col, &description.ideal_, &description.inverse_hooke_);
+ Grob *end_col = dynamic_cast<Item*> (cols[col_index+1])->find_prebroken_piece (LEFT);
+ if (end_col)
+ Spaceable_grob::get_spring (col, end_col, &description.end_ideal_, &description.end_inverse_hooke_);
+
+ for (SCM s = Spaceable_grob::get_minimum_distances (col);
+ scm_is_pair (s); s = scm_cdr (s))
+ {
+ Grob *other = unsmob_grob (scm_caar (s));
+ vsize j = binary_search (cols, other, Paper_column::less_than, col_index);
+ if (j != VPOS)
+ {
+ if (cols[j] == other)
+ description.rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s))));
+ else /* it must end at the LEFT prebroken_piece */
+ description.end_rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s))));
+ }
+ }