public Mesh parseStream(BufferedReader stream) throws IOException
	{
		String line = null;
		ScanData sd = new ScanData();
		MeshData md = new MeshData();
		Mesh currentMesh = new Mesh();
		int lineindex = 0;
		stream.mark(10000000);
		boolean marked = false;
		// First read all the vertexData
		while((line = stream.readLine()) != null)
		{
			lineindex++;
			String[] tokens = line.trim().split("\\s+");
			if(tokens[0].equalsIgnoreCase("v"))
				sd.vertexList.add(parseVector(tokens));
			else if(tokens[0].equalsIgnoreCase("vn"))
				sd.normalList.add(parseVector(tokens));
			else
			{
				if(!marked)
				{
					marked = true;
					stream.mark(10000000);	
				}
				if(!tokens[0].equals("f"))
					System.out.println("Unknown value " + tokens[0] + " at line " + lineindex);
			}
			
		}
		
		if(isBalanceVertices())
			balanceVertices(sd.vertexList);
		
		// Read the faces
		stream.reset();
		lineindex = 0;
		while((line = stream.readLine()) != null)
		{
			lineindex++;
			String[] tokens = line.trim().split("\\s+");

			if(tokens[0].equalsIgnoreCase("f"))
				parseFace(tokens, md, sd);				
			
		}
				
		md.populateMesh(currentMesh);
		return currentMesh;
	}