private void createBezierMesh(int nbSubSegments) {
        if (nbSubSegments == 0) {
            nbSubSegments = 1;
        }
        int centerPointsAmount = (spline.getControlPoints().size() + 2) / 3;

        //calculating vertices
        float[] array = new float[((centerPointsAmount - 1) * nbSubSegments + 1) * 3];
        int currentControlPoint = 0;
        List<Vector3f> controlPoints = spline.getControlPoints();
        int lineIndex = 0;
        for (int i = 0; i < centerPointsAmount - 1; ++i) {
            Vector3f vector3f = controlPoints.get(currentControlPoint);
            array[lineIndex++] = vector3f.x;
            array[lineIndex++] = vector3f.y;
            array[lineIndex++] = vector3f.z;
            for (int j = 1; j < nbSubSegments; ++j) {
                spline.interpolate((float) j / nbSubSegments, currentControlPoint, temp);
                array[lineIndex++] = temp.getX();
                array[lineIndex++] = temp.getY();
                array[lineIndex++] = temp.getZ();
            }
            currentControlPoint += 3;
        }
        Vector3f vector3f = controlPoints.get(currentControlPoint);
        array[lineIndex++] = vector3f.x;
        array[lineIndex++] = vector3f.y;
        array[lineIndex++] = vector3f.z;

        //calculating indexes
        int i = 0, k;
        short[] indices = new short[(centerPointsAmount - 1) * nbSubSegments << 1];
        for (int j = 0; j < (centerPointsAmount - 1) * nbSubSegments; ++j) {
            k = j;
            indices[i++] = (short) k;
            ++k;
            indices[i++] = (short) k;
        }

        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 Bezier path for this curve.

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