- modified grid size from 1 cm to 1 mm
- snap runway and pavement polys to grid after adding slivers.
This commit is contained in:
parent
0544854dc9
commit
225e3e1491
4 changed files with 18 additions and 25 deletions
|
@ -770,21 +770,6 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
gettimeofday(&log_time, NULL);
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Finished adding intermediate nodes for " << icao << " at " << ctime(&log_time.tv_sec) );
|
||||
|
||||
// One more pass to try to get rid of other yukky stuff
|
||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||
{
|
||||
TGPolygon poly = rwy_polys[k].get_poly();
|
||||
poly = snap(poly, gSnap);
|
||||
rwy_polys[k].set_poly( poly );
|
||||
}
|
||||
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
{
|
||||
TGPolygon poly = pvmt_polys[k].get_poly();
|
||||
poly = snap(poly, gSnap);
|
||||
pvmt_polys[k].set_poly( poly );
|
||||
}
|
||||
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
{
|
||||
TGPolygon poly = line_polys[k].get_poly();
|
||||
|
@ -819,6 +804,22 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
merge_slivers( rwy_polys, slivers );
|
||||
merge_slivers( pvmt_polys, slivers );
|
||||
|
||||
// Then snap rwy and pavement to grid (was done right after adding intermediate nodes...)
|
||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||
{
|
||||
TGPolygon poly = rwy_polys[k].get_poly();
|
||||
poly = snap(poly, gSnap);
|
||||
poly = remove_dups( poly );
|
||||
rwy_polys[k].set_poly( poly );
|
||||
}
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
{
|
||||
TGPolygon poly = pvmt_polys[k].get_poly();
|
||||
poly = snap(poly, gSnap);
|
||||
poly = remove_dups( poly );
|
||||
pvmt_polys[k].set_poly( poly );
|
||||
}
|
||||
|
||||
gettimeofday(&cleanup_end, NULL);
|
||||
timersub(&cleanup_end, &cleanup_start, &cleanup_time);
|
||||
|
||||
|
|
|
@ -63,14 +63,12 @@ void Helipad::gen_helipad( const TGPolygon& runway,
|
|||
Point3D a2 = runway.get_pt(0, 0);
|
||||
Point3D a3 = runway.get_pt(0, 3);
|
||||
|
||||
#if 0
|
||||
if ( startl_pct > 0.0 ) {
|
||||
startl_pct -= nudge * SG_EPSILON;
|
||||
}
|
||||
if ( endl_pct < 1.0 ) {
|
||||
endl_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( startl_pct < 0.0 ) {
|
||||
startl_pct = 0.0;
|
||||
|
@ -85,7 +83,6 @@ void Helipad::gen_helipad( const TGPolygon& runway,
|
|||
// with our polygon clipping code. This attempts to compensate
|
||||
// for that by nudging the areas a bit bigger so we don't end up
|
||||
// with polygon slivers.
|
||||
#if 0
|
||||
if ( startw_pct > 0.0 || endw_pct < 1.0 ) {
|
||||
if ( startw_pct > 0.0 ) {
|
||||
startw_pct -= nudge * SG_EPSILON;
|
||||
|
@ -94,7 +91,6 @@ void Helipad::gen_helipad( const TGPolygon& runway,
|
|||
endw_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct
|
||||
<< " end len % = " << endl_pct);
|
||||
|
|
|
@ -112,9 +112,9 @@ static void help( int argc, char **argv, const string_list& elev_src ) {
|
|||
}
|
||||
|
||||
// TODO: where do these belong
|
||||
int nudge = 0;
|
||||
int nudge = 10;
|
||||
double slope_max = 0.2;
|
||||
double gSnap = 0.0000001;
|
||||
double gSnap = 0.00000001; // approx 1 mm
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
|
|
@ -109,14 +109,12 @@ void Runway::gen_runway_section( const TGPolygon& runway,
|
|||
Point3D a2 = runway.get_pt(0, 0);
|
||||
Point3D a3 = runway.get_pt(0, 3);
|
||||
|
||||
#if 0
|
||||
if ( startl_pct > 0.0 ) {
|
||||
startl_pct -= nudge * SG_EPSILON;
|
||||
}
|
||||
if ( endl_pct < 1.0 ) {
|
||||
endl_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( startl_pct < 0.0 ) {
|
||||
startl_pct = 0.0;
|
||||
|
@ -131,7 +129,6 @@ void Runway::gen_runway_section( const TGPolygon& runway,
|
|||
// with our polygon clipping code. This attempts to compensate
|
||||
// for that by nudging the areas a bit bigger so we don't end up
|
||||
// with polygon slivers.
|
||||
#if 0
|
||||
if ( startw_pct > 0.0 || endw_pct < 1.0 ) {
|
||||
if ( startw_pct > 0.0 ) {
|
||||
startw_pct -= nudge * SG_EPSILON;
|
||||
|
@ -140,7 +137,6 @@ void Runway::gen_runway_section( const TGPolygon& runway,
|
|||
endw_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct
|
||||
<< " end len % = " << endl_pct);
|
||||
|
|
Loading…
Add table
Reference in a new issue