build/pnltri.js
function () {					// <<<<<<<<<< public
		var	normedMonoChains = this.polyData.getMonoSubPolys();
		this.polyData.clearTriangles();
		for ( var i=0; i<normedMonoChains.length; i++ ) {
			// loop through uni-y-monotone chains
			// => monoPosmin is next to monoPosmax (left or right)
			var monoPosmax = normedMonoChains[i];
			var prevMono = monoPosmax.mprev;
			var nextMono = monoPosmax.mnext;

			if ( nextMono.mnext == prevMono ) {		// already a triangle
				this.polyData.addTriangle( monoPosmax.vFrom, nextMono.vFrom, prevMono.vFrom );
			} else {								// triangulate the polygon
				this.triangulate_monotone_polygon( monoPosmax );
			}
		}
	}
function () {					// <<<<<<<<<< public
		var	normedMonoChains = this.polyData.getMonoSubPolys();
		this.polyData.clearTriangles();
		for ( var i=0; i<normedMonoChains.length; i++ ) {
			// loop through uni-y-monotone chains
			// => monoPosmin is next to monoPosmax (left or right)
			var monoPosmax = normedMonoChains[i];
			var prevMono = monoPosmax.mprev;
			var nextMono = monoPosmax.mnext;

			if ( nextMono.mnext == prevMono ) {		// already a triangle
				this.polyData.addTriangle( monoPosmax.vFrom, nextMono.vFrom, prevMono.vFrom );
			} else {								// triangulate the polygon
				this.triangulate_monotone_polygon( monoPosmax );
			}
		}
	}
function ( ) { // <<<<<<<<<< public var normedMonoChains = this . polyData . getMonoSubPolys ( ) ; this . polyData . clearTriangles ( ) ; for ( var i = 0 ; i < normedMonoChains . length ; i ++ ) { // loop through uni-y-monotone chains // => monoPosmin is next to monoPosmax (left or right) var monoPosmax = normedMonoChains [ i ] ; var prevMono = monoPosmax . mprev ; var nextMono = monoPosmax . mnext ; if ( nextMono . mnext == prevMono ) { // already a triangle this . polyData . addTriangle ( monoPosmax . vFrom , nextMono . vFrom , prevMono . vFrom ) ; } else { // triangulate the polygon this . triangulate_monotone_polygon ( monoPosmax ) ; } } }
Pass each uni-y-monotone polygon with start at Y-max for greedy triangulation.
Pass each uni - y - monotone polygon with start at Y - max for greedy triangulation .