Cesibon
Cesibon

Reputation: 3

Elements meshes loading issue in forge viewer

We are having issues with forge viewer, it sometimes refuse to continue loading elements into the viewer (on a quit large model, 200k+ meshes)

Incomplete loading

We are using the latest SVF2 translation as well as the Autodesk.MemoryLimited extension on viewer v7.51.0

We do not have this issue when loading the model on BIM360 so i'm wondering if some specific configuration is to be made?

Here is the viewer initialization code:

    const viewer = new Autodesk.Viewing.GuiViewer3D(viewerElement, {
                disabledExtensions: {
                    layermanage: true,
                    explode: true,
                    section: true,
                    hyperlink: true
                },
                loaderExtensions: { svf: "Autodesk.MemoryLimited" },
                memory: {
                    limit: 2048,
                    debug: {
                        force: true
                    }
                }
            })


            viewer.loadExtension('Autodesk.Viewing.MemoryLimitedDebug');
            viewer.setProgressiveRendering(true);
            viewer.setSelectionMode(2);

And once model is loaded:

(viewer.impl as any).setFPSTargets(5, 15, 30)

Upvotes: 0

Views: 149

Answers (1)

Petr Broz
Petr Broz

Reputation: 9942

In this case using the MemoryLimited extension might be counter-productive. The purpose of the extension is to make sure that the viewer never allocates "too much memory". However, what that means is that the viewer will keep going through this loop:

  1. load a subset of the design geometry from Forge servers
  2. render it on screen
  3. remove the geometry from memory
  4. if there's more geometry, repeat from step 1

And if there's a lot of geometry in the design (like you said was your case), it may take the viewer a lot of iterations to finally get to the subset that contains the geometry you're missing.

I'd suggest sticking to SVF2 but removing the MemoryLimited extension.

Upvotes: 0

Related Questions