OpenCTM icon indicating copy to clipboard operation
OpenCTM copied to clipboard

Raw to MG2 does not work for some cases.

Open philxia opened this issue 10 years ago • 1 comments

Not sure if there is a body to look at this... I export a mesh in Raw ctm file, and it looks well in OpenCTM desktop viewer, but it messed up in desktop viewer when I extract the mesh from Raw ctm file and encode to the MG2 ctm file. Here are the raw and raw2mg2 images raw raw2mg2

Here is the code snippet to reproduce this issue. FileStream fileStream = new FileStream(@".\TestData\raw.ctm", FileMode.Open); OpenCTM.CtmFileReader reader = new OpenCTM.CtmFileReader(fileStream);

     Mesh mesh = reader.decode();

     FileStream newfs = new FileStream(@".\TestData\raw2gm2.ctm", FileMode.OpenOrCreate);
     CtmFileWriter fw = new CtmFileWriter(newfs, new MG2Encoder());
     fw.encode(mesh, "reproduce error.");
     newfs.Close();

I uploaded the raw.ctm file here, and please rename it to raw.ctm. raw

philxia avatar May 12 '14 13:05 philxia

Only on my tablet atm, but did you check the mg2 settings? If your model has a very small scale the default settings might not work, mg2 is a loss-full encoding which let you specify an allowed error.

Danny02 avatar May 12 '14 20:05 Danny02