Autodesk forge 从Forge viewer中的捕捉点检索坐标
我想捕捉模型中的点并检索它们的坐标。我在Forge博客中找到了下面的代码Autodesk forge 从Forge viewer中的捕捉点检索坐标,autodesk-forge,forge,snapping,Autodesk Forge,Forge,Snapping,我想捕捉模型中的点并检索它们的坐标。我在Forge博客中找到了下面的代码 this.points = []; const result = this.snapper.getSnapResult(); const { SnapType } = Autodesk.Viewing.MeasureCommon; switch (result.geomType) { case SnapType.SNAP_VERTEX:
this.points = [];
const result = this.snapper.getSnapResult();
const { SnapType } = Autodesk.Viewing.MeasureCommon;
switch (result.geomType) {
case SnapType.SNAP_VERTEX:
case SnapType.SNAP_MIDPOINT:
case SnapType.SNAP_INTERSECTION:
this.points.push(result.getGeometry());
现在我可以得到顶点和中点的坐标,但我想实际得到一条Brep线的任何捕捉点的坐标。这怎么可能呢?你可能指的是这个,对吧?博客中使用的
SnapType
枚举列出了工具可以检测到的所有类型的捕捉类型。其他类型你可能需要检测自己,例如,根据相机位置和鼠标光标位置向场景拍摄光线,并找到附近感兴趣的物体。是的,我指的是你提到的博客。如果我使用“SNAP_EDGE”(用于渲染和捕捉),我就能够从JSON obejct中检索顶点坐标,这实际上不是从捕捉点获取的坐标。我是个新手,你提到的方法听起来对我来说不可行。你知道有没有类似的方法吗?不幸的是,没有。如果有其他方法可以解决这种捕捉,我不知道。