build/pnltri.js
function () {						// <<<<<< public
		var newMono, newMonoTo, toFirstOutSeg, fromRevSeg;
		for ( var i = 0, j = this.segments.length; i < j; i++) {
			newMono = this.segments[i];
			if ( this.PolyLeftArr[newMono.chainId] ) {
				// preserve winding order
				newMonoTo = newMono.vTo;			// target of segment
				newMono.mprev = newMono.sprev;		// doubly linked list for monotone chains (sub-polygons)
				newMono.mnext = newMono.snext;
			} else {
				// reverse winding order
				newMonoTo = newMono.vFrom;
				newMono = newMono.snext;
				newMono.mprev = newMono.snext;
				newMono.mnext = newMono.sprev;
			}
			if ( fromRevSeg = newMono.vFrom.lastInDiag ) {		// assignment !
				fromRevSeg.mnext = newMono;
				newMono.mprev = fromRevSeg;
				newMono.vFrom.lastInDiag = null;		// cleanup
			}
			if ( toFirstOutSeg = newMonoTo.firstOutDiag ) {		// assignment !
				toFirstOutSeg.mprev = newMono;
				newMono.mnext = toFirstOutSeg;
				newMonoTo.firstOutDiag = null;			// cleanup
			}
		}
	}
function () {						// <<<<<< public
		var newMono, newMonoTo, toFirstOutSeg, fromRevSeg;
		for ( var i = 0, j = this.segments.length; i < j; i++) {
			newMono = this.segments[i];
			if ( this.PolyLeftArr[newMono.chainId] ) {
				// preserve winding order
				newMonoTo = newMono.vTo;			// target of segment
				newMono.mprev = newMono.sprev;		// doubly linked list for monotone chains (sub-polygons)
				newMono.mnext = newMono.snext;
			} else {
				// reverse winding order
				newMonoTo = newMono.vFrom;
				newMono = newMono.snext;
				newMono.mprev = newMono.snext;
				newMono.mnext = newMono.sprev;
			}
			if ( fromRevSeg = newMono.vFrom.lastInDiag ) {		// assignment !
				fromRevSeg.mnext = newMono;
				newMono.mprev = fromRevSeg;
				newMono.vFrom.lastInDiag = null;		// cleanup
			}
			if ( toFirstOutSeg = newMonoTo.firstOutDiag ) {		// assignment !
				toFirstOutSeg.mprev = newMono;
				newMono.mnext = toFirstOutSeg;
				newMonoTo.firstOutDiag = null;			// cleanup
			}
		}
	}
function ( ) { // <<<<<< public var newMono , newMonoTo , toFirstOutSeg , fromRevSeg ; for ( var i = 0 , j = this . segments . length ; i < j ; i ++ ) { newMono = this . segments [ i ] ; if ( this . PolyLeftArr [ newMono . chainId ] ) { // preserve winding order newMonoTo = newMono . vTo ; // target of segment newMono . mprev = newMono . sprev ; // doubly linked list for monotone chains (sub-polygons) newMono . mnext = newMono . snext ; } else { // reverse winding order newMonoTo = newMono . vFrom ; newMono = newMono . snext ; newMono . mprev = newMono . snext ; newMono . mnext = newMono . sprev ; } if ( fromRevSeg = newMono . vFrom . lastInDiag ) { // assignment ! fromRevSeg . mnext = newMono ; newMono . mprev = fromRevSeg ; newMono . vFrom . lastInDiag = null ; // cleanup } if ( toFirstOutSeg = newMonoTo . firstOutDiag ) { // assignment ! toFirstOutSeg . mprev = newMono ; newMono . mnext = toFirstOutSeg ; newMonoTo . firstOutDiag = null ; // cleanup } } }
Generate the uni-y-monotone sub-polygons from the trapezoidation of the polygon.
Generate the uni - y - monotone sub - polygons from the trapezoidation of the polygon .