简体   繁体   中英

Forge Viewer fails to display edges

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.

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: 屏幕截图显示边缘关闭 屏幕截图显示边缘

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.

From the Autodesk Viewer 屏幕截图显示边缘关闭 屏幕截图显示边缘

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.

I also posted a Github Issue

Thank you for your help.

Alexis

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...

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);

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