{"id":411,"date":"2009-01-23T20:09:59","date_gmt":"2009-01-23T10:09:59","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=411"},"modified":"2009-01-23T20:11:36","modified_gmt":"2009-01-23T10:11:36","slug":"more-vectorstorm-api-comments","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2009\/01\/23\/more-vectorstorm-api-comments\/","title":{"rendered":"More VectorStorm API comments"},"content":{"rendered":"
Newly developed for Lord (this will eventually be migrated back into VectorStorm trunk, in case anyone’s actually using that code for anything), I’ve made a minor adjustment to the file parsing API, such that if you have a file with a block like this:<\/p>\n
Field{\r\na b\r\nc d\r\n}<\/pre>\nThen you’d get a single fsRecord with a label of “Field”, followed by six fsTokens ( {, a, b, c, d, and } ).<\/p>\n
Now, you get a single fsRecord with a label of “Field”, and no fsTokens.\u00a0 Instead, the fsRecord has two “child” records, each of which have two fsTokens ( ‘a’ and ‘b’ for the first child record, and ‘c’ and ‘d’ for the second child record).\u00a0 If you have file reading code which assumed the old file parsing logic, you’ll need to update to the new system once it’s been merged into the trunk codebase.<\/p>\n
There are a few benefits to this change.\u00a0 For one thing, it now means that you can put parsed data inside blocks, for logical or organisational reasons, and not lose the benefits of being able to load things based upon the label.<\/p>\n
The other big benefit is that it’s allowed me to make the .vec file format use a single “VertexArray” block for either 2D or 3D vertices;\u00a0 now that it knows where linebreaks are, it can just do the right thing, based upon whether the data file provides 2 or 3 vertex coordinates.<\/p>\n
…and I promise that my next blog update will be less scarily technical.<\/p>\n","protected":false},"excerpt":{"rendered":"
Newly developed for Lord (this will eventually be migrated back into VectorStorm trunk, in case anyone’s actually using that code for anything), I’ve made a minor adjustment to the file parsing API, such that if you have a file with a block like this: Field{ a b c d } Then you’d get a single…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-6D","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/411"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}