Avoid telling the nurbs library to do something it can't do (resulting
in a segfault.)
This commit is contained in:
parent
4bb5decbcb
commit
6c26352508
2 changed files with 6 additions and 0 deletions
|
@ -153,6 +153,9 @@ TGAptSurface::TGAptSurface( const string& path,
|
|||
int xdivs = (int)(x_m / 1100.0) + 1;
|
||||
int ydivs = (int)(y_m / 1100.0) + 1;
|
||||
|
||||
if ( xdivs < 3 ) { xdivs = 3; }
|
||||
if ( ydivs < 3 ) { ydivs = 3; }
|
||||
|
||||
cout << " M(" << xdivs << "," << ydivs << ")" << endl;
|
||||
double dlon = x_deg / xdivs;
|
||||
double dlat = y_deg / ydivs;
|
||||
|
@ -190,8 +193,10 @@ TGAptSurface::TGAptSurface( const string& path,
|
|||
|
||||
// Create the nurbs surface
|
||||
|
||||
cout << "ready to create nurbs surface" << endl;
|
||||
apt_surf = new PlNurbsSurfacef;
|
||||
apt_surf->globalInterp( Pts, 3, 3);
|
||||
cout << " successful." << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -991,6 +991,7 @@ void build_airport( string airport_raw, float alt_m,
|
|||
max_deg.setlat( max_deg.lat() + 0.5 * dlat );
|
||||
|
||||
TGAptSurface apt_surf( root, min_deg, max_deg );
|
||||
cout << "Surface created" << endl;
|
||||
|
||||
// calculate node elevations
|
||||
point_list geod_nodes = calc_elevations( apt_surf, nodes.get_node_list(),
|
||||
|
|
Loading…
Reference in a new issue