forge-extract
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

forge-extract

build status npm version node npm downloads platforms license

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));

Package Sidebar

Install

npm i forge-extract

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

500 kB

Total Files

32

Last publish

Collaborators

  • petrbroz