使用Autodesk Forge Viewer : f2d get frag from dbid中提出的VertexBufferReader,我得到了一些读者,这显然可以用来读取特定dbId中的几何,这是我的目标。
根据另一个问题的答案,我的方法不起作用
const d2f = oViewer2D.gui.model.getFragmentList().fragments.dbId2fragId; //acquire dbid to fragid reference
const geometry = oViewer2D.gui.impl.getFragmentProxy(oViewer2D.gui.model, d2f[941]).frags.getGeometry(d2f[941]); //get geometry for fragment
const reader = new Autodesk.Viewing.Private.VertexBufferReader(geometry); //create reader for geometry
let obj = new CallbackObject(); //sample callbackobject for reader
console.log(reader.enumGeomsForObject(940,obj)); //find geometry for dbid --> not working
class CallbackObject {
constructor() {
}
onLineSegment(x0, y0, x1, y1, viewport_id) {
}
onCircularArc(centerX, centerY, startAngle, endAngle, radius, viewport_id) {
}
onEllipticalArc(centerX, centerY, startAngle, endAngle, major, minor, tilt, viewport_id) {
}
onTriangleVertex(x, y, viewport_id) {
}
}
目标:我有一个自定义绘制的多边形,我想找到一个与它相交的部分,但要做到这一点,我需要部件的坐标。 谢谢!