Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try/catch suggestion #1

Closed
truevis opened this issue Jan 23, 2015 · 11 comments
Closed

try/catch suggestion #1

truevis opened this issue Jan 23, 2015 · 11 comments

Comments

@truevis
Copy link

truevis commented Jan 23, 2015

I suggest adding try/catch around builder.AddFace

    try
    {
        builder.AddFace(new TessellatedFace(corners,
          ElementId.InvalidElementId));       
    }
    catch
    {
     // remember something went wrong here..
    }
@jeremytammik
Copy link
Owner

hi eric,

thank you for the suggestion!

why, though?

the whole operation is wrapped in an exception handler anyway. do you have an example where some individual faces may fail, and you still want to retain the rest?

if so, i'll add this right away.

cheers

jeremy

@truevis
Copy link
Author

truevis commented Jan 23, 2015

Here is an OBJ file with errors in it: https://drive.google.com/file/d/0B_UPhfVzWDkxMWJEVnMtdWN0N28/view?usp=sharing

@jeremytammik
Copy link
Owner

what exact exception is thrown, please? you should never add a catch-all handler if you can avoid it.

@jeremytammik
Copy link
Owner

i do not see the sample OBJ file you refer to. where is it?

@jeremytammik
Copy link
Owner

i updated the code with a catch-all exception handler. i would like to narrow it down to the specific exception thrown, though.

@truevis
Copy link
Author

truevis commented Jan 23, 2015

I think this OBJ tries to make 2-vertex faces https://drive.google.com/file/d/0B_UPhfVzWDkxMWJEVnMtdWN0N28/view?usp=sharing

@jeremytammik
Copy link
Owner

thx, i'll take a look.

@jeremytammik
Copy link
Owner

nope, if you simply look at the OBJ in a text editor, you see that all faces have four vertices. maybe some of the four vertices list the same one or two vertices twice? i'll test... you should be able to debug this also, man :-)

@truevis
Copy link
Author

truevis commented Jan 25, 2015

Even MeshLab complains about that OBJ:

@jeremytammik
Copy link
Owner

hi eric, thank you for the high_ball_glass.obj sample OBJ. i added the exception handler you suggest, and also added a result log in the debug console window reporting the number of faces that succeeded and failed on each shape.

@jeremytammik
Copy link
Owner

closed with release 2015.0.0.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants