Open John-Nagle opened 6 years ago
Test objects mentioned above. failobjs.zip
Hi John,
Can you try to triangulate the obj file first? My OBJ importer only takes clean triangle mesh.
Best, Songrun Liu, https://songrun.github.io/ PhD student & Research Assistant Volgenau School of Engineering George Mason University
On May 5, 2018, at 12:03 AM, John Nagle notifications@github.com wrote:
Test objects mentioned above. failobjs.zip https://github.com/songrun/SeamAwareDecimater/files/1976316/failobjs.zip — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/songrun/SeamAwareDecimater/issues/6#issuecomment-386777172, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq5AjL6dpdVmZNd_eW-n97VVtPa0o4hks5tvSSHgaJpZM4TzLpL.
Triangulated the cylinder. Result:
decimater testcylindertris.obj percent-vertices 80 testcylindertris50.obj
Warning: readOBJ() ignored non-comment line 4:
o Cylinder
Loaded a mesh with 64 vertices and 124 faces: testcylindertris.obj
80% of 64 input vertices is 51 output vertices.
decimater: /home/john/projects/sl/SeamAwareDecimater/decimater.cpp:87: bool {anonymous}::decimate_down_to(const Eigen::PlainObjectBase<Derived>&, const Eigen::PlainObjectBase<DerivedTC>&, const Eigen::PlainObjectBase<DerivedCN>&, const Eigen::PlainObjectBase<DerivedTC>&, int, Eigen::MatrixXd&, Eigen::MatrixXi&, Eigen::MatrixXd&, Eigen::MatrixXi&, bool) [with DerivedV = Eigen::Matrix<double, -1, -1>; DerivedF = Eigen::Matrix<int, -1, -1>; DerivedT = Eigen::Matrix<double, -1, -1>; Eigen::MatrixXd = Eigen::Matrix<double, -1, -1>; Eigen::MatrixXi = Eigen::Matrix<int, -1, -1>]: Assertion `TC.cols() == 2' failed.
Aborted (core dumped)
failobjs2.zip Test files for above. The triangulated cylinder is the Blender default cylinder triangulated with the default Blender triangulation. The attached image shows a valid triangulation.
Similar failure on a chair model. I can't get this program to work on anything but the provided "animal.obj".
Your cylinder model even doesn’t have a UV mapping.
Best, Songrun Liu, https://songrun.github.io/ PhD student & Research Assistant Volgenau School of Engineering George Mason University
On May 5, 2018, at 2:33 PM, John Nagle notifications@github.com wrote:
failobjs2.zip https://github.com/songrun/SeamAwareDecimater/files/1976949/failobjs2.zip Test files for above. The triangulated cylinder is the Blender default cylinder triangulated with the default Blender triangulation. The attached image shows a valid triangulation.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/songrun/SeamAwareDecimater/issues/6#issuecomment-386825920, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq5Ag3-GW3sA7txBVM99MGgctHhWsPQks5tvfB_gaJpZM4TzLpL.
Thanks.
Next problem:
This is the "minimal textured object file" from http://paulbourke.net/dataformats/obj/minobj.html used as a demo and test case.
The mesh reduction opens up a sizable gap in the mesh between the upper and lower halves of the object. Oops.
I think I may have a solution -- a lot of OBJ files have 3 UVS. which is valid, though they actually seem to only use the first 2 values as the 3rd is always zero. In any case
Goto the ReadOBJ.cpp file, and to insert the line
Count = 2;
just before Line 131,
std::vector<Scalar > tex(count);
You need to do this because the decimation function requires the UVs to have exactly 2 columns and OBJ can legally have 3. By Explicitly setting it to 2 you are tossing the third value which appears to always be zero in files I’ve seen, anyway.
Similarly, OBJ files can legally have NO UVs but the library can't handle that, so make sure they have UVs assigned.
Ah. Two years later, but good info.
Yeah, better late than never, I suppose!
From: John Nagle @.> Sent: Friday, July 02, 2021 2:21 PM To: songrun/SeamAwareDecimater @.> Cc: TheOriginalBytePlayer @.>; Comment @.> Subject: Re: [songrun/SeamAwareDecimater] Fails on every file I try (#6)
Ah. Two years later, but good info.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/songrun/SeamAwareDecimater/issues/6#issuecomment-873262363 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJYX4HWPOC25OKSKI6H5PDTVYUTTANCNFSM4E6MXJFQ . https://github.com/notifications/beacon/AEJYX4B3VNZX2VHLC7XBJU3TVYUTTA5CNFSM4E6MXJF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGQGO2GY.gif
I exported the default cube from Blender to .obj. Result:
OK, so maybe reducing a cube while preserving seams is geometrically impossible.
The default cylinder from Blender:
I get that "Failed to cast F to matrix" error from everything I've tried - simple files from Blender, files from 3D sites.
But the "animal.obj" file provided with the source code poly reduces just fine. So the program passes its own test case.