dist/joint.nowrap.js
function(opt) {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) return 0; // if segments is an empty array

            opt = opt || {};
            var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision; // opt.precision only used in getSegmentSubdivisions() call
            var segmentSubdivisions = (opt.segmentSubdivisions === undefined) ? this.getSegmentSubdivisions({ precision: precision }) : opt.segmentSubdivisions;
            // not using localOpt

            var length = 0;
            for (var i = 0; i < numSegments; i++) {

                var segment = segments[i];
                var subdivisions = segmentSubdivisions[i];
                length += segment.length({ subdivisions: subdivisions });
            }

            return length;
        }
function(opt) {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) return 0; // if segments is an empty array

            opt = opt || {};
            var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision; // opt.precision only used in getSegmentSubdivisions() call
            var segmentSubdivisions = (opt.segmentSubdivisions === undefined) ? this.getSegmentSubdivisions({ precision: precision }) : opt.segmentSubdivisions;
            // not using localOpt

            var length = 0;
            for (var i = 0; i < numSegments; i++) {

                var segment = segments[i];
                var subdivisions = segmentSubdivisions[i];
                length += segment.length({ subdivisions: subdivisions });
            }

            return length;
        }
function ( opt ) { var segments = this . segments ; var numSegments = segments . length ; if ( numSegments === 0 ) return 0 ; // if segments is an empty array opt = opt || { } ; var precision = ( opt . precision === undefined ) ? this . PRECISION : opt . precision ; // opt.precision only used in getSegmentSubdivisions() call var segmentSubdivisions = ( opt . segmentSubdivisions === undefined ) ? this . getSegmentSubdivisions ( { precision : precision } ) : opt . segmentSubdivisions ; // not using localOpt var length = 0 ; for ( var i = 0 ; i < numSegments ; i ++ ) { var segment = segments [ i ] ; var subdivisions = segmentSubdivisions [ i ] ; length += segment . length ( { subdivisions : subdivisions } ) ; } return length ; }
Returns length of the path, with precision better than requested `opt.precision`; or using `opt.segmentSubdivisions` provided. If path has no segments, returns 0.
Returns length of the path with precision better than requested opt . precision ; or using opt . segmentSubdivisions provided . If path has no segments returns 0 .