private void createLinearMesh() {
        float[] array = new float[spline.getControlPoints().size() * 3];
        short[] indices = new short[(spline.getControlPoints().size() - 1) * 2];
        int i = 0;
        int cpt = 0;
        int k;
        int j = 0;
        for (Iterator<Vector3f> it = spline.getControlPoints().iterator(); it.hasNext();) {
            Vector3f vector3f = it.next();
            array[i] = vector3f.getX();
            i++;
            array[i] = vector3f.getY();
            i++;
            array[i] = vector3f.getZ();
            i++;
            if (it.hasNext()) {
                k = j;
                indices[cpt] = (short) k;
                cpt++;
                k++;
                indices[cpt] = (short) k;
                cpt++;
                j++;
            }
        }

        this.setMode(Mesh.Mode.Lines);
        this.setBuffer(VertexBuffer.Type.Position, 3, array);
        this.setBuffer(VertexBuffer.Type.Index, 2, indices);
        this.updateBound();
        this.updateCounts();
    }
This method creates the Nurb path for this curve.

@param nbSubSegments amount of subsegments between position control
points
jme3-core/src/main/java/com/jme3/scene/shape/Curve.java