src/builders/polylines.js
function addMiter (v, coordCurr, normPrev, normNext, miter_len_sq, isBeginning, context) {
    var miterVec = createMiterVec(normPrev, normNext);

    //  Miter limit: if miter join is too sharp, convert to bevel instead
    if (Vector.lengthSq(miterVec) > miter_len_sq) {
        addJoin(JOIN_TYPE.bevel, v, coordCurr, normPrev, normNext, isBeginning, context);
    }
    else {
        addVertex(coordCurr, miterVec, miterVec, 1, v, context, 1);
        addVertex(coordCurr, miterVec, miterVec, 0, v, context, -1);
        if (!isBeginning) {
            indexPairs(1, context);
        }
    }
}
function addMiter (v, coordCurr, normPrev, normNext, miter_len_sq, isBeginning, context) {
    var miterVec = createMiterVec(normPrev, normNext);

    //  Miter limit: if miter join is too sharp, convert to bevel instead
    if (Vector.lengthSq(miterVec) > miter_len_sq) {
        addJoin(JOIN_TYPE.bevel, v, coordCurr, normPrev, normNext, isBeginning, context);
    }
    else {
        addVertex(coordCurr, miterVec, miterVec, 1, v, context, 1);
        addVertex(coordCurr, miterVec, miterVec, 0, v, context, -1);
        if (!isBeginning) {
            indexPairs(1, context);
        }
    }
}
function addMiter ( v , coordCurr , normPrev , normNext , miter_len_sq , isBeginning , context ) { var miterVec = createMiterVec ( normPrev , normNext ) ; //  Miter limit: if miter join is too sharp, convert to bevel instead if ( Vector . lengthSq ( miterVec ) > miter_len_sq ) { addJoin ( JOIN_TYPE . bevel , v , coordCurr , normPrev , normNext , isBeginning , context ) ; } else { addVertex ( coordCurr , miterVec , miterVec , 1 , v , context , 1 ) ; addVertex ( coordCurr , miterVec , miterVec , 0 , v , context , - 1 ) ; if ( ! isBeginning ) { indexPairs ( 1 , context ) ; } } }
Add a miter vector or a join if the miter is too sharp
Add a miter vector or a join if the miter is too sharp