tweaked method to generate mesh from graph. added the option to output file in wire format or povray format.