lib/toxi/geom/Polygon2D.js
function( minEdgeLen ){
            minEdgeLen *= minEdgeLen;
            var vs = this.vertices,
                reduced = [],
                prev = vs[0],
                num = vs.length - 1,
                vec;
            reduced.push(prev);
            for( var i = 0; i < num; i++ ){
                vec = vs[i];
                if( prev.distanceToSquared(vec) >= minEdgeLen ){
                    reduced.push(vec);
                    prev = vec;
                }
            }
            if( vs[0].distanceToSquared(vs[num]) >= minEdgeLen ){
                reduced.push(vs[num]);
            }
            this.vertices = reduced;
            return this;
        }
function( minEdgeLen ){
            minEdgeLen *= minEdgeLen;
            var vs = this.vertices,
                reduced = [],
                prev = vs[0],
                num = vs.length - 1,
                vec;
            reduced.push(prev);
            for( var i = 0; i < num; i++ ){
                vec = vs[i];
                if( prev.distanceToSquared(vec) >= minEdgeLen ){
                    reduced.push(vec);
                    prev = vec;
                }
            }
            if( vs[0].distanceToSquared(vs[num]) >= minEdgeLen ){
                reduced.push(vs[num]);
            }
            this.vertices = reduced;
            return this;
        }
function ( minEdgeLen ) { minEdgeLen *= minEdgeLen ; var vs = this . vertices , reduced = [ ] , prev = vs [ 0 ] , num = vs . length - 1 , vec ; reduced . push ( prev ) ; for ( var i = 0 ; i < num ; i ++ ) { vec = vs [ i ] ; if ( prev . distanceToSquared ( vec ) >= minEdgeLen ) { reduced . push ( vec ) ; prev = vec ; } } if ( vs [ 0 ] . distanceToSquared ( vs [ num ] ) >= minEdgeLen ) { reduced . push ( vs [ num ] ) ; } this . vertices = reduced ; return this ; }
Reduces the number of vertices in the polygon based on the given minimum
edge length. Only vertices with at least this distance between them will
be kept.

@param minEdgeLen
@return itself
Reduces the number of vertices in the polygon based on the given minimum edge length . Only vertices with at least this distance between them will be kept .