简体   繁体   English

如何为 Autodesk forge 创建 3d 图钉扩展?

[英]How can i create 3d pushpin extension for autodesk forge?

I want to create 3d pushpin extension for Autodesk forge v7.*.我想为 Autodesk forge v7.* 创建 3d 图钉扩展。 I tried to use this article` 3D Markup with icons and Info-Card .我尝试使用这篇文章的 带有图标和信息卡的 3D 标记 But some functions are not working correctly.但是有些功能不能正常工作。 How can i use it correctly?我该如何正确使用它? I got this errors in console我在控制台中收到此错误

控制台中的错误

Now all functions are working correctly, in data i got undefined for parent.现在所有功能都正常工作,在数据中我没有为父级定义。 Pushpins are not appeared yet.图钉尚未出现。 具有未定义父级的数据

Apparently there were a few issues with your code:显然,您的代码存在一些问题:

  • Since Viewer v7 and onwards overlay scenes are managed so you'd need to add custom geometry with:由于 Viewer v7 及以后的叠加场景是管理的,因此您需要添加自定义几何体:
 this.viewer.overlays.addScene('custom-scene');
 this.viewer.overlays.addMesh(this.line3d, 'custom-scene');
  • Use arrow functions or bind for your callbacks to window and document events such as mousemove or click otherwise they'd lose their contexts and throw errors使用箭头功能或绑定你的回调窗口和文档事件,如mousemoveclick ,否则他们会失去他们的上下文和抛出错误

  • Necessary styling was not set for the markups to persist their relative positions ...没有为标记设置必要的样式以保持其相对位置......

See here with corrections to all of the above:请参阅此处对以上所有内容进行更正: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM