{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/10888","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/10888/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/10888/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/10888/events","html_url":"https://github.com/mrdoob/three.js/pull/10888","id":210337239,"number":10888,"title":"Issue #10883: STLLoader's binary check trips up","user":{"login":"dnewman-polar3d","id":20478854,"avatar_url":"https://avatars.githubusercontent.com/u/20478854?v=3","gravatar_id":"","url":"https://api.github.com/users/dnewman-polar3d","html_url":"https://github.com/dnewman-polar3d","followers_url":"https://api.github.com/users/dnewman-polar3d/followers","following_url":"https://api.github.com/users/dnewman-polar3d/following{/other_user}","gists_url":"https://api.github.com/users/dnewman-polar3d/gists{/gist_id}","starred_url":"https://api.github.com/users/dnewman-polar3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnewman-polar3d/subscriptions","organizations_url":"https://api.github.com/users/dnewman-polar3d/orgs","repos_url":"https://api.github.com/users/dnewman-polar3d/repos","events_url":"https://api.github.com/users/dnewman-polar3d/events{/privacy}","received_events_url":"https://api.github.com/users/dnewman-polar3d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-02-26T18:27:47Z","updated_at":"2017-02-27T19:35:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/10888","html_url":"https://github.com/mrdoob/three.js/pull/10888","diff_url":"https://github.com/mrdoob/three.js/pull/10888.diff","patch_url":"https://github.com/mrdoob/three.js/pull/10888.patch"},"body":"This commit addresses Issue #10883 in which the isBinary() check of an STL data stream can incorrectly identify a syntactically invalid but still useful ASCII STL as being binary.  Namely, the ASCII STL will be identified as binary if the ASCII STL data presents a non-US-ASCII 'name' field parameter with the 'solid' or 'endsolid' keywords.  E.g.,\r\n\r\n    solid 穿山甲\r\n    facet normal 0.7071067717164974 -0.00016366188967739515 0.707106771716591\r\n      outer loop\r\n        vertex 135.89921424250542 449.7206946618269 58.1296582226351\r\n    ...\r\n        endloop\r\n    endfacet\r\n    endsolid 穿山甲\r\n\r\nNote that as ASCII STLs must be in US-ASCII, they may contain no characters with the high bit set.  As such, the example above is syntactically invalid.  However, more and more such ASCII STLs are appearing.  Moreover, the isBinary() check itself is tripping up as it tries to accommodate a potentially incorrect binary STL for which the computed data length disagrees with the observed data length.  So, it's something of a juggling act as the code attempts to accommodate different, broken inputs.\r\n\r\nThis commit attempts to address this issue while making minimal disruption to the present code.  After the data length is computed but found to not agree, this change next looks for the US-ASCII phrase 'solid' at/near the start of the data.  If it is found, then the STL is declared to NOT be binary.  Then, the existing check of the data for any non US-ASCII characters is performed. That is, a new check has been inserted between the length check and the 8bit character check.  A more robust change might be to look for 'solid' in the first five bytes of the data and, if found, declare it ASCII from the get go."},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/282827299","html_url":"https://github.com/mrdoob/three.js/pull/10888#issuecomment-282827299","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/10888","id":282827299,"user":{"login":"dnewman-polar3d","id":20478854,"avatar_url":"https://avatars.githubusercontent.com/u/20478854?v=3","gravatar_id":"","url":"https://api.github.com/users/dnewman-polar3d","html_url":"https://github.com/dnewman-polar3d","followers_url":"https://api.github.com/users/dnewman-polar3d/followers","following_url":"https://api.github.com/users/dnewman-polar3d/following{/other_user}","gists_url":"https://api.github.com/users/dnewman-polar3d/gists{/gist_id}","starred_url":"https://api.github.com/users/dnewman-polar3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnewman-polar3d/subscriptions","organizations_url":"https://api.github.com/users/dnewman-polar3d/orgs","repos_url":"https://api.github.com/users/dnewman-polar3d/repos","events_url":"https://api.github.com/users/dnewman-polar3d/events{/privacy}","received_events_url":"https://api.github.com/users/dnewman-polar3d/received_events","type":"User","site_admin":false},"created_at":"2017-02-27T19:35:22Z","updated_at":"2017-02-27T19:35:22Z","body":"Pushed"}}
{"actor":{"display_login":"dnewman-polar3d"}}