- /* s2 either intersects with b or it ends after b */
- Real end = infinity_f;
- Real s2_start_height = s2->front ().height_[LEFT];
- Real s2_end_height = s2->front ().height_[RIGHT];
- Real s1_start_height = b.height (s2->front ().iv_[LEFT]);
- Real s1_end_height = b.height (s2->front ().iv_[RIGHT]);
- if (approx_greater_than (s2_start_height, s1_start_height))
- end = s2->front ().iv_[LEFT];
- else if (approx_greater_than (s2_end_height, s1_end_height))
- end = b.intersection_x (s2->front ());
- end = min (end, b.iv_[RIGHT]);
-
- b.leading_part (end);
- result->push_front (b);
-
- skyline_trailing_part (s1, end);
- skyline_trailing_part (s2, end);
+ /* only include buildings wider than epsilon */
+ if (end > x + EPS)
+ {
+ b.leading_part (end);
+ result->push_front (b);
+ }
+
+ if (end >= s1->front ().end_)
+ s1->pop_front ();
+
+ x = end;