首页 > 解决方案 > 通过单击对象插入标签

问题描述

我对模型的坐标有疑问。

是否可以使用模型中的标签注册问题,通过单击模型定义确切位置?

在此处输入图像描述

PS.:在这个例子中,只能使用对象的中心坐标

标签: autodesk-forge

解决方案


要获得准确的 x、y、z 值,请使用此“ALT 键枢轴点”技术来获得模型的表面点,而不是其质心:

https://github.com/wallabyway/markupExt/issues/2

第二部分:

获得 x、y、z 值后,您可以在这篇文章中替换“质心”位置计算:

https://forge.autodesk.com/blog/placing-custom-markup-dbid

// get the center of the dbId (based on its fragIds bounding boxes)
const pos = this.viewer.worldToClient(this.getModifiedWorldBoundingBox(id).center());

这有帮助吗?


推荐阅读