Title: Interpreting LoadObj return value -- strict OBJ specification · Issue #272 · tinyobjloader/tinyobjloader · GitHub
Open Graph Title: Interpreting LoadObj return value -- strict OBJ specification · Issue #272 · tinyobjloader/tinyobjloader
X Title: Interpreting LoadObj return value -- strict OBJ specification · Issue #272 · tinyobjloader/tinyobjloader
Description: 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...
Open Graph Description: 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...
X Description: 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, i...
Opengraph URL: https://github.com/tinyobjloader/tinyobjloader/issues/272
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Interpreting LoadObj return value -- strict OBJ specification","articleBody":"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.\r\n\r\nThe 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.\r\n\r\nIf 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`.\r\n\r\nI'm willing to submit a PR in this regard -- but I want to gauge the interest of the set of users in this regard.","author":{"url":"https://github.com/SeanCurtis-TRI","@type":"Person","name":"SeanCurtis-TRI"},"datePublished":"2020-03-30T14:35:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/272/tinyobjloader/issues/272"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5f6c9f9-60cf-3624-9b28-f2a569f6e8a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EA8:C8498:26595C4:360179B:6970F601 |
| html-safe-nonce | e1a9dab1473bfa250f3acb757c4b2f45b103eeda337fa7324c02f5212e5ba00a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUE4OkM4NDk4OjI2NTk1QzQ6MzYwMTc5Qjo2OTcwRjYwMSIsInZpc2l0b3JfaWQiOiIyMTUzMDA0MzMwNzUzMDM5MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0db27a9df37e84636a082296415eaea4e8d0d9f48add9f9c3255cd2ba751aae |
| hovercard-subject-tag | issue:590342752 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tinyobjloader/tinyobjloader/272/issue_layout |
| twitter:image | https://opengraph.githubassets.com/325b46f3481e49db0036a92b462757b08e0dd94f886a4ce6e2b2493221da323f/tinyobjloader/tinyobjloader/issues/272 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/325b46f3481e49db0036a92b462757b08e0dd94f886a4ce6e2b2493221da323f/tinyobjloader/tinyobjloader/issues/272 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SeanCurtis-TRI |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b239ebed690c3053869ff31a3b7597834c25673659d63e7b6fd6a9b5d7853de |
| turbo-cache-control | no-preview |
| go-import | github.com/tinyobjloader/tinyobjloader git https://github.com/tinyobjloader/tinyobjloader.git |
| octolytics-dimension-user_id | 61176939 |
| octolytics-dimension-user_login | tinyobjloader |
| octolytics-dimension-repository_id | 5421296 |
| octolytics-dimension-repository_nwo | tinyobjloader/tinyobjloader |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5421296 |
| octolytics-dimension-repository_network_root_nwo | tinyobjloader/tinyobjloader |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aeacfd55297f3de5395c83f200ac35d1f474115e |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width