String jvxlGetFile(Mesh mesh, String msg, boolean includeHeader, int nSurfaces) {
		String data = "";
		if (includeHeader) {
			data = mesh.jvxlFileHeader
					+ (nSurfaces > 0 ? (-nSurfaces) + mesh.jvxlExtraLine.substring(2) : mesh.jvxlExtraLine);
			if (data.indexOf("JVXL") != 0)
				data = "JVXL " + data;
		}
		data += "# " + msg + "\n";
		if (title != null)
			for (int i = 0; i < title.length; i++)
				data += "# " + title[i] + "\n";
		data += mesh.jvxlDefinitionLine + "\n";
		String compressedData = (mesh.jvxlPlane == null ? mesh.jvxlSurfaceData : "");
		if (logMessages)
			Logger.info(" jvxlGetFile: " + mesh.jvxlSurfaceData + "\n" + mesh.jvxlEdgeData + "\n" + mesh.jvxlColorData
					+ "\n" + mesh.jvxlPlane);

		if (mesh.jvxlPlane == null) {
			// no real point in compressing this unless it's a sign-based coloring
			compressedData += jvxlCompressString(mesh.jvxlEdgeData + mesh.jvxlColorData);
		}
		else {
			compressedData += jvxlCompressString(mesh.jvxlColorData);
		}
		if (!isJvxl && mesh.nBytes > 0)
			mesh.jvxlCompressionRatio = (int) (((float) mesh.nBytes + mesh.jvxlFileHeader.length()) / (data.length() + compressedData
					.length()));
		data += compressedData;
		if (msg != null)
			data += "#-------end of jvxl file data-------\n";
		return data;
	}