Home > other >  Does forge-convert-utils works with .svf2 files?
Does forge-convert-utils works with .svf2 files?

Time:12-09

I need to save svf2 files in cache of browser to enable offline mode on my site. I have already saved all data from modelderivative manifest and derivativeservice manifest. Now I need to get all other files from .svf (.pf, .bin, ...) which are required in forge-viewer with forge-convert-utils

When I want to use forge-convert-utils like this:

const reader = await SvfReader.FromDerivativeService(urn, guid, { token: token }, undefined, Region.EMEA);

It will return an Error 400 and config parameter of returned error has an url regions/eu/designdata/...urn.../manifest/undefined.

I was looking internaly how it works and find out that there is no condition that checks if object of manifest with given guid contains urn.(manifest has no urn for svf2). There is only check for type, role and guid. (on line 208 of reader.ts)

const resources = helper.search({ type: 'resource', role: 'graphics', guid });

How can I find and save those .bin, etc files ?

CodePudding user response:

I'm the author of forge-convert-utils.

SVF2 is something I've been considering to support as well but it looks like this may not be possible after all. First of all, while SVF(1) is a simple file-based format and at this point it's pretty much stable and unlikely to change, SVF2 is much more sophisticated (it's not really a file format, but rather a database querying system on top of a persistent WebSocket connection) and it's still evolving. And more importantly, as @AlexAR pointed out, downloading and caching SVF2 assets is not permitted by the legal terms.

So if you need to cache your APS (formerly Forge) models for offline use, you'll need to use the original SVF format.

  • Related