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, {});
,以将其从无头更改为经典查看器.
I used https://github.com/Autodesk-Forge/viewer-react-express-headless as a starting point for my Forge React application and I modified viewer = new Autodesk.Viewing.Viewer3D(viewerElement, {});
to viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerElement, {});
to change it back from a headless to a classic viewer.
我可以加载我的模型,但是它看起来没有边缘,当我进入Settings -> Performance -> Display edges
时,默认情况下它处于关闭状态,当我尝试将其设置回去时,边缘保持不可见.
I can load my model but it appears without edges and when I go to Settings -> Performance -> Display edges
it is off by default, and when I try to set it back the edges stay invisible.
从我无法唤醒的查看器中:
From my non wokring viewer:
当我尝试对加载在 Autodesk Viewer 上的相同模型进行的相同操作时,它可以按预期运行,因此我可以切换边缘的可见性.
When I try the same operation with the same model loaded on Autodesk Viewer it works as expected and I can toggle the visibility of the edges.
我发现了另一个似乎相关问题,但是我尝试了viewer.js?v=v4.2
,viewer.js?v=v5.0
和viewer.js?v=v6.3.1
,但仍然存在看不见的边缘问题.
I found another seemingly related question on stackoverflow, but I tried viewer.js?v=v4.2
, viewer.js?v=v5.0
and viewer.js?v=v6.3.1
and I still have the invisible edges issue.
我还发布了 Github问题
谢谢您的帮助.
亚历克西斯
推荐答案
好,如果要通过创建浏览器实例 直接使用Autodesk.Viewing.Private.GuiViewer3D,而不是 Autodesk.Viewing.ViewingApplication,然后在初始化Forge查看器时需要应用一个魔术配置参数,以便这些行出现...
ok, if you are creating the viewer instance via Autodesk.Viewing.Private.GuiViewer3D directly, rather than the Autodesk.Viewing.ViewingApplication, then there is a magic configuration parameter that you will need to apply when initializing the Forge viewer, so that the lines will appear...
要解决此问题,一个额外的选择
isAEC: true
必须传递到
您代码中的modelOptions,请参见下文:
To fix it, an extra option
isAEC: true
must be passed into the
modelOptions in your code, see below:
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);
这篇关于Forge Viewer无法显示边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!