Forge Viewer 无法显示边缘

Forge Viewer fails to display edges

我使用 https://github.com/Autodesk-Forge/viewer-react-express-headless 作为我的 Forge React 应用程序的起点,并将 viewer = new Autodesk.Viewing.Viewer3D(viewerElement, {}); 修改为 viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerElement, {}); 以将其从无头查看器改回经典查看器。

我可以加载我的模型,但它看起来没有边缘,当我转到 Settings -> Performance -> Display edges 时它默认关闭,当我尝试将其设置回来时边缘保持不可见。

来自我的非工作观众:

当我对 Autodesk Viewer 上加载的相同模型尝试相同的操作时,它按预期工作,我可以切换边缘的可见性。

来自Autodesk Viewer

我找到了另一个 ,但我尝试了 viewer.js?v=v4.2viewer.js?v=v5.0viewer.js?v=v6.3.1,但仍然存在不可见边缘问题。

我也发了一个Github Issue

感谢您的帮助。

亚历克西斯

好的,如果您通过以下方式创建查看器实例 Autodesk.Viewing.Private.GuiViewer3D 直接,而不是 Autodesk.Viewing.ViewingApplication,然后有一个神奇的配置参数,您需要在初始化 Forge 查看器时应用该参数,以便出现这些行...

要修复它,一个额外的选项 isAEC: true 必须传入 代码中的 modelOptions,见下文:

var modelOptions = {
    placementTransform: mat,
    globalOffset:{x:0,y:0,z:0},
    sharedPropertyDbPath: doc.getPropertyDbPath(),
    isAEC: true //!<<< Here is the missing line
};

viewer.loadModel(svfUrl, modelOptions, onLoadModelSuccess, onLoadModelError);