- Real w = xposn - last_xposn;
- w = w/2 <? nw_f;
-
- Molecule half = Lookup::beam (dydx, w, thick);
- for (int j = lfliebertjes.size(); j--;)
- {
- Molecule b (half);
- b.translate_axis (last_xposn - x0, X_AXIS);
- b.translate_axis (dydx * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
- }
- for (int j = rfliebertjes.size(); j--;)
- {
- Molecule b (half);
- b.translate_axis (xposn - x0 - w , X_AXIS);
- b.translate_axis (dydx * (xposn-x0 -w) + bdy * rfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
- }
+ /* Half beam should be one note-width,
+ but let's make sure two half-beams never touch */
+ Real lw = nw_f;
+ Real rw = nw_f;
+ if (i > 0)
+ rw = nw_f <? ( (xposn - last_xposn) / 2);
+ else
+ /*
+ TODO: 0.5 is a guess.
+ */
+ rw = xposn - me->get_bound (LEFT)->extent (xcommon, X_AXIS)[RIGHT]
+ - 0.5;
+
+ if (st)
+ lw = nw_f <? ( (xposn - last_xposn) / 2);
+ else
+ lw = me->get_bound (RIGHT)->relative_coordinate (xcommon, X_AXIS)
+ - last_xposn;
+
+ Stencil rhalf = Lookup::beam (dydx, rw, thick, blot);
+ Stencil lhalf = Lookup::beam (dydx, lw, thick, blot);
+ for (int j = lfliebertjes.size (); j--;)
+ {
+ Stencil b (lhalf);
+ b.translate_axis (last_xposn - x0, X_AXIS);
+ b.translate_axis (dydx * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
+ the_beam.add_stencil (b);