Autodesk forge 如何在forge viewer中创建剖面框

Autodesk forge 如何在forge viewer中创建剖面框,autodesk-forge,forge,Autodesk Forge,Forge,我想在forge viewer中构建一个剖面框。我有minx,maxX,minY,maxY通过区域标记。我还通过标高选择(标高[I].elevation–globalOffset.Z)实现了minZ和maxZ 我想要一个类似的功能,比如截面分析中的默认添加框按钮,但我想要添加最小-最大坐标 你能帮我一下吗?给你~请参考以下代码片段为查看器计算剖切面参数: const minPt = new THREE.Vector3( -82.73119354248047, -115.4270935058593

我想在forge viewer中构建一个剖面框。我有minx,maxX,minY,maxY通过区域标记。我还通过标高选择(标高[I].elevation–globalOffset.Z)实现了minZ和maxZ

我想要一个类似的功能,比如截面分析中的默认添加框按钮,但我想要添加最小-最大坐标


你能帮我一下吗?

给你~请参考以下代码片段为查看器计算剖切面参数:

const minPt = new THREE.Vector3( -82.73119354248047, -115.42709350585938, -31.42848777770996 ); //!<<< put your point here
const maxPt = new THREE.Vector3( -0.0000020212402347397074, 0, 0 ); //!<<< put your point here

const normals = [
    new THREE.Vector3(1, 0, 0), 
    new THREE.Vector3(0, 1, 0), 
    new THREE.Vector3(0, 0, 1),
    new THREE.Vector3(-1, 0, 0),
    new THREE.Vector3(0, -1, 0),
    new THREE.Vector3(0, 0, -1)
];

const bbox = new THREE.Box3( minPt, maxPt );
const cutPlanes = [];

for( let i = 0; i < normals.length; i++ ) {
    const plane = new THREE.Plane( normals[i], -1 * maxPt.dot( normals[i] ) );

    // offset plane with negative normal to form an octant
    if( i > 2 ) {
        const ptMax = plane.orthoPoint( bbox.max );
        const ptMin = plane.orthoPoint( bbox.min );
        const size = new THREE.Vector3().subVectors( ptMax, ptMin );
        plane.constant -= size.length();
    }

    const n = new THREE.Vector4( plane.normal.x, plane.normal.y, plane.normal.z, plane.constant );
    cutPlanes.push( n );
}

viewer.setCutPlanes( cutPlanes );
const minPt=new THREE.Vector3(-82.73119354248047,-115.42709350585938,-31.428487770996);/!