@Override
    @SuppressWarnings("unchecked")
    public void write(JmeExporter exporter) throws IOException {
        super.write(exporter);
        OutputCapsule capsule = exporter.getCapsule(this);

        capsule.write(type, "type", null);
        capsule.write(basisUFunctionDegree, "basisUFunctionDegree", 0);
        capsule.write(basisVFunctionDegree, "basisVFunctionDegree", 0);
        capsule.write(uSegments, "uSegments", 0);
        capsule.write(vSegments, "vSegments", 0);

        int numKnotArrayLists = knots.length;
        float[][] knotArray2D = new float[numKnotArrayLists][];
        for (int i = 0; i < numKnotArrayLists; ++i) {
            List<Float> list = knots[i];
            int numKnots = list.size();
            float[] array = new float[numKnots];
            for (int j = 0; j < numKnots; ++j) {
                array[j] = list.get(j);
            }
            knotArray2D[i] = array;
        }
        capsule.write(knotArray2D, "knotArray2D", null);

        int numControlPointLists = controlPoints.size();
        ArrayList[] listArray = new ArrayList[numControlPointLists];
        for (int i = 0; i < numControlPointLists; ++i) {
            List<Vector4f> list = controlPoints.get(i);
            int numVectors = list.size();
            listArray[i] = new ArrayList<>(numVectors);
            listArray[i].addAll(list);
        }
        capsule.writeSavableArrayListArray(listArray, "listArray", null);
    }
Serializes to the specified exporter, for example when saving to a J3O
file. The current instance is unaffected.

@param exporter the exporter to use (not null)
@throws IOException from the exporter
jme3-core/src/main/java/com/jme3/scene/shape/Surface.java