import struct import geo import sys import os import os.path if len(sys.argv) < 2: print("Usage:") print(" %s ") print("Dumps all the meshes contained in to /.") print(" and are read from the .geo.") fh = open(sys.argv[1], "rb") g = geo.Geo() g.loadFromFile(fh) geo_name = g.header_modelheader_name.decode("utf-8") if not os.path.exists(geo_name): os.mkdir(geo_name) for i in range(len(g.models)): model = g.models[i] model_name = model.name.decode("utf-8") filename = geo_name + "/" + model_name + ".stl" print(filename) ofh = open(filename, "wb") ofh.write(b"\x00" * 80) ofh.write(struct.pack("