Glen Whitney
e0861ea157
I failed to find a satisfactory way to compile and import moo.js with fixed specifiers, so finally I just gave up and patched the distributed moo code to be an es6 module. Very ugly but it works. Resolves #1. Reviewed-on: #2 Co-authored-by: Glen Whitney <glen@studioinfinity.org> Co-committed-by: Glen Whitney <glen@studioinfinity.org>
36 lines
792 B
Markdown
36 lines
792 B
Markdown
# 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](https://github.com/dgud/wings/blob/master/plugins_src/import_export/x3d_import.erl)
|
|
(which was written in Erlang).
|
|
|
|
## Usage
|
|
|
|
From an es6 module
|
|
|
|
```js
|
|
import {convert} from 'vrml1to97'
|
|
const vrml1spec = '# VRML 1.0 ....'
|
|
const vrml97spec = convert(vrml1spec)
|
|
```
|
|
|
|
or from a script
|
|
|
|
```js
|
|
(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
|
|
|
|
```shell
|
|
npx vrml1to97 < old.wrl > shinynew.wrl
|
|
```
|