简体   繁体   中英

SVF file not loading in Autodesk Forge Viewer 3D

I'm running into a warning message in Autodesk Forge Viewer3D. Recently I updated the version of Autodesk Forge Viewer3D from 2.3 to 4.3. I have updated even the .css files and the .js files. But, the viewer is not loading the 3D model. I would also like to mention all the .js and the 3D model is in my local system. I have not hosted it on Autodesk Forge account.

 The warning that I'm getting is: 

An LMV resource ( http://localhost/MyApplication/Models/Resource/3D_View/PSR1/CameraDefinitions.bin ) was not uncompressed by the browser. This hurts performance.

If you are using offline mode, be aware of gzip compression.

Typically, when a server, gives the browser the pf and bin files, these files are gzip compressed, with it's header containing 'content-type:gzip' to specify the file being served is gzip compressed. The browser sees this and natively decodes the file (in C++ land) before handing it off to the javascript engine.

If the 'content-type:gzip' header is missing, then the browser doesn't decompress the file, and it hands the file directly to the javascript engine "as-is" (compressed).

The 'Forge viewer' checks for this, and will perform the decompression in 'javascript-land' to make up for the mistake. Decompressing in javascript-land 'hurts performance' (especially on mobile devices).

Since it looks like you are using local files, like file://localfolder/viewer3d.js?svf=mybuilding.svf, then try manually decompressing these pf, json and bin files (you need to add a .gz to the end of the file and then unzip each of them). It will result in bigger files, but you won't get the warning.

Alternatively, and the recommended approach, is to create a local static server (localhost) that sets the 'content-type:gzip' header for the compressed files (PF, BIN and json).

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM