在Forge Viewer中加载多个模型时出现内存不足错误 [英] Out of memory error in loading multiple models in Forge Viewer
问题描述
我正在开发一个具有14个Navisworks(NWC)模型的项目.我能够将复合模型加载到查看器中(这需要一些时间,但是可以工作).
I am working on a project that has 14 Navisworks (NWC) models. I am able to load the composite model into the viewer (which takes some time but works).
但是,当我将模型一个一个地加载到Viewer中时,在全部14个模型都加载之前,我出现了内存不足的错误.文件总大小约为500MB.
However, when I am loading models one by one into Viewer, I get out of memory error before all 14 are loaded. Total file size is about 500MB.
我观察到浏览器崩溃之前(查看器在后台进行加载),查看器的响应速度非常快.
I observed that viewer is very responsive right until browser crashes (while model loading was taking place in the background).
我怀疑这是多边形总数&的问题.几何学.我捆绑使用NOP_VIEWER.initDebugTools()扩展名,但它似乎并未显示所有模型的总数.似乎只显示第一个模型的细节.
I suspect this to be an issue of total number of polygons & geometry. I tied to use NOP_VIEWER.initDebugTools() extension but it doesn't seem to show total count from all models. It seems to show the details of only first model.
- 有没有一种方法可以阻止Viewer在内存耗尽之前创建更多几何图形?
- 是否可以通过DebugTools扩展找到所有模型的统计信息?
- 还有另一种方法来计算已加载模型的多边形吗?
谢谢班杜
推荐答案
有没有一种方法可以阻止Viewer在内存耗尽之前创建更多几何图形?
Is there a way to stop Viewer creating more geometry before it runs out of memory?
尝试在加载选项中限制内存消耗:
Try and limit the memory consumption in your load options:
var config3d = {
memory: {
limit: 1024 // in MB
}
};
var viewer = new Autodesk.Viewing.Viewer3D(container, config3d);
顺便说一句,默认限制为:
BTW the default limits are:
Desktop 600 MB
Mobile 195 MB
是否可以通过DebugTools扩展找到所有模型的统计信息?
Is there a way to find statistics of all models with DebugTools extension?
不幸的是,内置的 DebugTools
不适用于多个模型.
Unfortunately the built-in DebugTools
does not work with multiple models.
但这不会阻止您按模型查询统计信息:
But that shouldn't stop you from querying stats on a per model basis:
let modelArray = viewer.impl.modelQueue().getModels();
let targetModel = modelArray[index];
targetModel.getGeometryList() // retrieves geometry info about a specific model
您甚至可以烘烤自己的扩展以适合多种型号.
You can even bake an extension of your own to suit multiple models.
还有另一种方法来计算已加载模型的多边形吗?
Is there another way to count polygons of loaded models?
model.getGeometryList().geomPolyCount
这篇关于在Forge Viewer中加载多个模型时出现内存不足错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!