ObjImporter smoothing issue

Anonymous 9 years ago 0
This discussion was imported from CodePlex

powst wrote at 2014-08-07 16:30:

Hi there!
Thanks objo a lot for your great tools!

Doesn't anybody know what can be a problem for smoothing in Helix 3D Toolkit? I have a little bit strange case.. I got an .obj file with complex 3d-model which I want to be smooth. There are 2 "s on" lines in this file. I don't remember exactly but there was some issue while smoothng - and I set currentSmoothingGroup in ObjReader always to be 1.. And that helped, part of the 3d-object is now smooth. But only part.. For example I have a 3d-model of jaw - some teeth are smooth, some - very rough - there is clear difference. Using other 3d-viewers I can see all of the teeth are smooth.

In this file there are 2 "s on" lines - one before all vertices part, another one before faces. Plus there are a lot of separated "groups" (part of vertices or faces that start with "g"). I don't know maybe that is the problem - but groups with the same names are separated all over the file - ie that can be:
g Name1
g Name2
g Name1

I also tried to change some code in ObjReader - for example in AddGroup method in the beginning I put a line
if (Groups.Any(x => x.Name == name)) { return; }
And it partially helped - all teeth were smooth, but mesh in general was a little bit broken.. Than I changed smoothingGroupMap first parametr to be not int but the name of the group - for every group to have its own smoothing map (cause in original code after adding a group smoothing maps were destroyed) - but it made everything even worse. :(

Has anybody any ideas why there can be part of 3d-model smooth, and part of it - absolutely rough?

objo wrote at 2014-08-08 12:41:

Does it look correct in other software? (try meshlab)
I guess there could be a bug in the obj importer. In that case we should have a small test file and create an issue on this!

powst wrote at 2014-08-08 14:25:

Yes, exactly, I tried Meshlab :) And there when I switch on "Smooth" - it becames smooth, all of the teeth.

I can send you this .obj file..

powst wrote at 2014-08-11 14:33:

This is how it looks:
Using HelixToolkit
Using MeshLab

I feel like there can be an issue with Groups...

powst wrote at 2014-08-11 15:16:

By the way, this is what happened after inserting
 if (Groups.Any(x => x.Name == name)) { return; } 
line in AddGroup method:

Close enough, but appeared some clearly visible trouble with a few tens triangles on a problem part of the model...

powst wrote at 2014-08-14 17:38:

objo wrote at 2014-08-18 13:10:

Thanks for providing the file! I have added the issue at https://helixtoolkit.codeplex.com/workitem/10067