如何對單一構件進行剖切?

示例描述與操作指南

對所選中的構件進行剖切操作,鼠標推動六個面進行剖切。
通過接口enableSectionBoxresetScene、與isolateComponentsByKey實現。

示例效果展示

在這裏插入圖片描述

實現步驟

通過接口enableSectionBoxresetScene、與isolateComponentsByKey實現。

// 點擊運行觸發的函數
const run = () =>{
   // 如果用戶點擊了構件,則把選中的構件id賦值給defaultCk,否則就是默認的構件id值
  defaultCk = viewer3D.getHighlightComponentsKey().length > 0
  ? viewer3D.getHighlightComponentsKey()
   : ["demo_fornature_simple_35mRxI2L175Qq8uVbXI6Nw"]
  viewer3D.enableSectionBox();  //構件剖切   viewer3D.resetScene();
  viewer3D.resetScene({selected:true});
  viewer3D.isolateComponentsByKey(defaultCk);
}

下載完整代碼

相關示例

模型剖切

模型分類剖切

辦公區示例-剖切

廠房類示例-剖切

住房類示例-剖切

相關接口

addView

resetScene

isolateComponentsByKey

enableSectionBox

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章