在 Forge Viewer 中使用 restoreState 时如何删除所有剖切面
How to remove all cut planes when using restoreState in Forge Viewer
我正在使用 restoreState 函数设置剖切面,效果很好:
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": [[0,0,0,0]]}'));
但是如何再次删除切面?显示所有对象都不起作用
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": []}'));
或
NOP_VIEWER.setCutPlanes();
一种方法是
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": null}'));
根据文档,您必须将一个空数组传递给 setCutPlanes()
https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#setcutplanes-planes
Passing an empty list or null is equivalent to setting zero cut planes
我正在使用 restoreState 函数设置剖切面,效果很好:
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": [[0,0,0,0]]}'));
但是如何再次删除切面?显示所有对象都不起作用
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": []}'));
或
NOP_VIEWER.setCutPlanes();
一种方法是
NOP_VIEWER.restoreState(JSON.parse('{"cutplanes": null}'));
根据文档,您必须将一个空数组传递给 setCutPlanes()
https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#setcutplanes-planes
Passing an empty list or null is equivalent to setting zero cut planes