问题
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
回答1:
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);
来源:https://stackoverflow.com/questions/54932378/forge-viewer-fails-to-display-edges