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

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

            if (length === 0) return this.start.clone();

            var fromStart = true;
            if (length < 0) {
                fromStart = false; // negative lengths mean start calculation from end point
                length = -length; // absolute value
            }

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

            var lastVisibleSegment;
            var l = 0; // length so far
            for (var i = (fromStart ? 0 : (numSegments - 1)); (fromStart ? (i < numSegments) : (i >= 0)); (fromStart ? (i++) : (i--))) {

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

                if (segment.isVisible) {
                    if (length <= (l + d)) {
                        return segment.pointAtLength(((fromStart ? 1 : -1) * (length - l)), { precision: precision, subdivisions: subdivisions });
                    }

                    lastVisibleSegment = segment;
                }

                l += d;
            }

            // if length requested is higher than the length of the path, return last visible segment endpoint
            if (lastVisibleSegment) return (fromStart ? lastVisibleSegment.end : lastVisibleSegment.start);

            // if no visible segment, return last segment end point (no matter if fromStart or no)
            var lastSegment = segments[numSegments - 1];
            return lastSegment.end.clone();
        }
function(length, opt) {

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

            if (length === 0) return this.start.clone();

            var fromStart = true;
            if (length < 0) {
                fromStart = false; // negative lengths mean start calculation from end point
                length = -length; // absolute value
            }

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

            var lastVisibleSegment;
            var l = 0; // length so far
            for (var i = (fromStart ? 0 : (numSegments - 1)); (fromStart ? (i < numSegments) : (i >= 0)); (fromStart ? (i++) : (i--))) {

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

                if (segment.isVisible) {
                    if (length <= (l + d)) {
                        return segment.pointAtLength(((fromStart ? 1 : -1) * (length - l)), { precision: precision, subdivisions: subdivisions });
                    }

                    lastVisibleSegment = segment;
                }

                l += d;
            }

            // if length requested is higher than the length of the path, return last visible segment endpoint
            if (lastVisibleSegment) return (fromStart ? lastVisibleSegment.end : lastVisibleSegment.start);

            // if no visible segment, return last segment end point (no matter if fromStart or no)
            var lastSegment = segments[numSegments - 1];
            return lastSegment.end.clone();
        }
function ( length , opt ) { var segments = this . segments ; var numSegments = segments . length ; if ( numSegments === 0 ) return null ; // if segments is an empty array if ( length === 0 ) return this . start . clone ( ) ; var fromStart = true ; if ( length < 0 ) { fromStart = false ; // negative lengths mean start calculation from end point length = - length ; // absolute value } opt = opt || { } ; var precision = ( opt . precision === undefined ) ? this . PRECISION : opt . precision ; var segmentSubdivisions = ( opt . segmentSubdivisions === undefined ) ? this . getSegmentSubdivisions ( { precision : precision } ) : opt . segmentSubdivisions ; // not using localOpt var lastVisibleSegment ; var l = 0 ; // length so far for ( var i = ( fromStart ? 0 : ( numSegments - 1 ) ) ; ( fromStart ? ( i < numSegments ) : ( i >= 0 ) ) ; ( fromStart ? ( i ++ ) : ( i -- ) ) ) { var segment = segments [ i ] ; var subdivisions = segmentSubdivisions [ i ] ; var d = segment . length ( { precision : precision , subdivisions : subdivisions } ) ; if ( segment . isVisible ) { if ( length <= ( l + d ) ) { return segment . pointAtLength ( ( ( fromStart ? 1 : - 1 ) * ( length - l ) ) , { precision : precision , subdivisions : subdivisions } ) ; } lastVisibleSegment = segment ; } l += d ; } // if length requested is higher than the length of the path, return last visible segment endpoint if ( lastVisibleSegment ) return ( fromStart ? lastVisibleSegment . end : lastVisibleSegment . start ) ; // if no visible segment, return last segment end point (no matter if fromStart or no) var lastSegment = segments [ numSegments - 1 ] ; return lastSegment . end . clone ( ) ; }
Returns point at requested `length`, with precision better than requested `opt.precision`; optionally using `opt.segmentSubdivisions` provided. Accepts negative length.
Returns point at requested length with precision better than requested opt . precision ; optionally using opt . segmentSubdivisions provided . Accepts negative length .