Forge Viewer 无法显示边缘 [英] Forge Viewer fails to display edges

查看:26
本文介绍了Forge Viewer 无法显示边缘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了

当我使用加载在

我发现了另一个看似相关关于 stackoverflow 的问题,但我尝试了 viewer.js?v=v4.2viewer.js?v=v5.0viewer.js?v=v6.3.1 并且我仍然有不可见的边缘问题.

我还发布了一个 Github 问题

感谢您的帮助.

亚历克斯

解决方案

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

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

var modelOptions = {放置变换:垫子,globalOffset:{x:0,y:0,z:0},sharedPropertyDbPath: doc.getPropertyDbPath(),isAEC: true//!<<<这是缺少的行};viewer.loadModel(svfUrl, modelOptions, onLoadModelSuccess, onLoadModelError);

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

这篇关于Forge Viewer 无法显示边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆