Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Interpreting LoadObj return value -- strict OBJ specification #272

Copy link
Copy link
@SeanCurtis-TRI

Description

@SeanCurtis-TRI
Issue body actions

I've encountered an issue when using LoadObj to parse a file. Specifically, what happens when the wrong file type is provided to the parser. In this case, LoadObj doesn't return an error, it simply leaves the vector of shape_t empty.

The reason for this, based on a coarse once over on the code, is that the parsing takes an XML-like approach. It looks for specific tokens at the beginning of lines (e.g., f, v, vt, etc.) If it finds such a token and the remainder of the line is not consistent with what it expects to see, it returns false. However, if it finds no such token at the beginning of the line, the line is simply ignored. Thus, if I were to pass an STL file into LoadObj, the parsing would report "success", but give me empty geometry.

If we applied a stricter interpretation of the Obj spec, a line that isn't strictly valid OBJ and isn't commented out should produce an error as being malformed for an OBJ file. This would give us a greater power to distinguish the output of LoadObj.

I'm willing to submit a PR in this regard -- but I want to gauge the interest of the set of users in this regard.

paulmelnikow and ffe-seequent

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.