forge-extract
v0.2.1
Published
Tools for converting Autodesk Forge models into glTF.
Downloads
5
Maintainers
Readme
forge-extract
Utilities for converting Autodesk Forge SVF file format into glTF 2.0.
Usage
From Command line
- install the package:
npm install --global forge-extract
- run the command without parameters for usage info:
forge-extract
- run the command with parameters, providing either Forge client credentials or access token:
On Windows
set FORGE_CLIENT_ID=<client id>
set FORGE_CLIENT_SECRET=<client secret>
forge-extract --output-folder=test <urn>
or
set FORGE_ACCESS_TOKEN=<access token>>
forge-extract --output-folder=test <urn>
On macOS/Linux
export FORGE_CLIENT_ID=<client id>
export FORGE_CLIENT_SECRET=<client secret>
forge-extract --output-folder=test <urn>
or
export FORGE_ACCESS_TOKEN=<access token>>
forge-extract --output-folder=test <urn>
From Node.js
const { deserialize } = require('forge-extract/lib/svf');
const { serialize } = require('forge-extract/lib/gltf');
const svf = await deserialize('<model urn>', '<viewable guid>', { client_id: '<client id>', client_secret: '<client secret>' });
await serialize(svf, path.join(__dirname, 'tmp', FORGE_MODEL_URN, FORGE_VIEWABLE_GUID));