JavaScript converter from VRML 1.0 to VRML97 file format, based on Wings 3D conversion logic.
Glen Whitney
8186038efb
Produces essentially the same token stream as the that found in x3d_import, except includes comment and whitespace tokens, which can be ignored in the parser. Resolves #3. Reviewed-on: #4 Co-authored-by: Glen Whitney <glen@studioinfinity.org> Co-committed-by: Glen Whitney <glen@studioinfinity.org> |
||
---|---|---|
etc | ||
src | ||
tools | ||
.gitignore | ||
LICENSE | ||
package.json5 | ||
pnpm-lock.yaml | ||
README.md | ||
tsconfig.json |
vrml1to97
JavaScript converter from VRML 1.0 to VRML97 file format, based on Wings 3D conversion logic.
Essentially, this is a JavaScript reimplmentation of the algorithm of the "token rearranger" found in the Wings 3D x3d importer (which was written in Erlang).
Usage
From an es6 module
import {convert} from 'vrml1to97'
const vrml1spec = '# VRML 1.0 ....'
const vrml97spec = convert(vrml1spec)
or from a script
(async () => {
const vrml1to97 = await import('./dist/vrml1to97/index.js')
const vrml1spec = '# VRML 1.0 ....'
const vrml97spec = vrml1to97.convert(vrml1spec)
})()
or from the command line via node
npx vrml1to97 < old.wrl > shinynew.wrl