From 33c92f60f60d2a8a84e3d123f50552c98efa4f4c Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Sat, 8 Oct 2011 11:25:25 +0200 Subject: [PATCH] Fix a boundary size bug. All boundaries with < 2 nodes are discarded now --- src/Airports/GenAirports850/closedpoly.cxx | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Airports/GenAirports850/closedpoly.cxx b/src/Airports/GenAirports850/closedpoly.cxx index 73b7c2a4..d3249602 100644 --- a/src/Airports/GenAirports850/closedpoly.cxx +++ b/src/Airports/GenAirports850/closedpoly.cxx @@ -77,14 +77,17 @@ void ClosedPoly::CreateConvexHull( void ) Point3D p; int i; - for (i=0; isize(); i++) - { - p = boundary->at(i)->GetLoc(); - nodes.push_back( p ); - } + if (boundary->size() > 2){ + for (i=0; isize(); i++) + { - convexHull = convex_hull( nodes ); - hull = convexHull.get_contour(0); + p = boundary->at(i)->GetLoc(); + nodes.push_back( p ); + } + convexHull = convex_hull( nodes ); + hull = convexHull.get_contour(0); + } else + SG_LOG(SG_GENERAL, SG_ALERT, "Boundary size too small: " << boundary->size() << ". Ignoring..." ); } int ClosedPoly::CloseCurContour() @@ -589,8 +592,13 @@ int ClosedPoly::BuildBtg( float alt_m, superpoly_list* rwy_polys, texparams_list case 3: material = "grass_rwy"; break; - +// TODO Differentiate more here: case 4: + case 5: + case 12: + case 13: + case 14: + case 15: material = "grass_rwy"; break;