public static void prepareNurbsKnots(List<Float> knots, int basisFunctionDegree) {
        float delta = KNOTS_MINIMUM_DELTA;
        float prevValue = knots.get(0).floatValue();
        for (int i = 1; i < knots.size(); ++i) {
            float value = knots.get(i).floatValue();
            if (value <= prevValue) {
                value += delta;
                knots.set(i, Float.valueOf(value));
                delta += KNOTS_MINIMUM_DELTA;
            } else {
                delta = KNOTS_MINIMUM_DELTA;//reset the delta's value
            }

            prevValue = value;
        }
    }
This method prepares the knots to be used. If the knots represent
non-uniform B-splines (first and last knot values are being repeated) it
leads to NaN results during calculations. This method adds a small number
to each of such knots to avoid NaN's.

@param knots
           the knots to be prepared to use
@param basisFunctionDegree
           the degree of basis function
jme3-core/src/main/java/com/jme3/math/CurveAndSurfaceMath.java