code: function ( inPolyData ) {
  		var thisDepth = [ this.trapArray[0] ];
  		var nextDepth = [];
  
  		var thisTrap, borderSeg, curDepth = 0;
  		do {
  			// rseg should exactely go upward on trapezoids inside the polygon (odd depth)
  			var expectedRsegUpward = ( ( curDepth % 2 ) == 1 );
  			while ( thisTrap = thisDepth.pop() ) {			// assignment !
  				if ( thisTrap.depth != -1 )	continue;
  				thisTrap.depth = curDepth;
  				//
  				if ( thisTrap.uL )	thisDepth.push( thisTrap.uL );
  				if ( thisTrap.uR )	thisDepth.push( thisTrap.uR );
  				if ( thisTrap.dL )	thisDepth.push( thisTrap.dL );
  				if ( thisTrap.dR )	thisDepth.push( thisTrap.dR );
  				//
  				if ( ( borderSeg = thisTrap.lseg ) && ( borderSeg.trLeft.depth == -1 ) )	// assignment !
  					nextDepth.push( borderSeg.trLeft );
  				if ( borderSeg = thisTrap.rseg ) {											// assignment !
  					if ( borderSeg.trRight.depth == -1 )
  						nextDepth.push( borderSeg.trRight );
  					if ( borderSeg.upward != expectedRsegUpward )
  						inPolyData.set_PolyLeft_wrong( borderSeg.chainId );
  				}
  			}
  			thisDepth = nextDepth; nextDepth = [];
  			curDepth++;
  		} while ( thisDepth.length > 0 );
  	}
docs: Assigns a depth to all trapezoids; 0: outside, 1: main polygon, 2: holes, 3:polygons in holes, ... Checks segment orientation and marks those polygon chains for reversal where the polygon inside lies to their right (contour in CW, holes in CCW)