From 5844c989bd052a41f833a24802260b830123ab51 Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Fri, 23 Aug 2013 23:13:40 -0700 Subject: [PATCH] Skylines: reject steep-sloped buildings; issue 3383 --- lily/skyline.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lily/skyline.cc b/lily/skyline.cc index 8654f0d973..70bf989861 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -125,6 +125,12 @@ Building::precompute (Real start, Real start_height, Real end_height, Real end) assert (start_height == end_height); y_intercept_ = start_height; } + else if (fabs(slope_) > 1e6) + // too steep to be stored in slope-intercept form, given round-off error + { + slope_ = 0.0; + y_intercept_ = max(start_height, end_height); + } else y_intercept_ = start_height - slope_ * start; } -- 2.39.5