here is a little something I've been re-doing:
it takes the raw data from the dat file and converts it from there.Code:import struct as S off = open("import.dat", 'r') out = open("export.obj", 'w') t0 = off.read(32)#header a = 0 while (a == 0): h1 = off.read(2).encode('hex') h2 = off.read(2).encode('hex') h3 = off.read(2).encode('hex') #this returns the hault error as a value #and can be deleted after it is fixed if (h1 == ''): h1 = '00' if (h2 == ''): h2 = '00' if (h3 == ''): h3 = '00' c = S.pack("<HHH", int(h1, 16), int(h2, 16), int(h3, 16)) c = S.unpack("<hhh", c) x = float(c[0]) * 0.01 y = float(c[1]) * 0.01 z = float(c[2]) * 0.01 v = "v "+x.__str__()+" "+y.__str__()+" "+z.__str__() if (v == 'v 0.0 0.0 0.0'): a = 1 out.close() else: print v out.write(v+"\n")
instead of taking the hex values from a txt file...
there is a bug however...![]()
when you run the program, it will only convert so much before ending the conversion process...
if anyone knows what I'm missing..., please help.


Reply With Quote


