public void setCycle(boolean cycle) {
        if (type != SplineType.Nurb) {
            if (controlPoints.size() >= 2) {
                if (this.cycle && !cycle) {
                    controlPoints.remove(controlPoints.size() - 1);
                }
                if (!this.cycle && cycle) {
                    controlPoints.add(controlPoints.get(0));
                }
                this.cycle = cycle;
                this.computeTotalLength();
            } else {
                this.cycle = cycle;
            }
        }
    }
set to true to make the spline cycle

@param cycle true for cyclic, false for acyclic
jme3-core/src/main/java/com/jme3/math/Spline.java