簡體   English   中英

IFCjs 在同一場景中添加不同的模型

[英]IFCjs add differents models in the same scene

我不知道這是否會成為在 IFCjs 中向我提出問題的渠道。 我正在嘗試添加兩個屬於同一工作的單獨模型,這兩個模型來自不同的來源,當它們的坐標應該重疊並出現相關時。 我添加模型如下:

await this.ifcLoader.ifcManager.applyWebIfcConfig({
            COORDINATE_TO_ORIGIN: true,
            USE_FAST_BOOLS: true,
 });
this.ifcLoader.load(url, (ifcModel) => {     
            this.scene.add(ifcModel);
   });  

這是結果:

在此處輸入圖像描述

但是當使用https://iloveifc.com/ : (image2) 在此處輸入圖像描述

是相關的。

有誰知道我做錯了什么?

COORDINATE_TO_ORIGIN所做的是將在 IFC 中找到的第一個三角形放入原點。 我們正在使用這種方法,因為這是 100% 的 IFC 文件中唯一可靠的方法。 要協調多個模型,您只能在第一個 model 中使用它,然后檢索應用於該 model 的變換矩陣並將其應用於 rest。

let firstModel = true;

function loadIfc(url) {

  const settings = this.loader.ifcManager.state.webIfcSettings;
  const fastBools = settings?.USE_FAST_BOOLS || true;

  await loader.ifcManager.applyWebIfcConfig({
    COORDINATE_TO_ORIGIN: firstModel,
    USE_FAST_BOOLS: fastBools
  });

  const ifcModel = await loader.loadAsync(url, onProgress);

  if (firstModel) {
    const matrixArr = await 
    loader.ifcManager.ifcAPI.GetCoordinationMatrix(
      ifcModel.modelID
    );
    const matrix = new Matrix4().fromArray(matrixArr);
    loader.ifcManager.setupCoordinationMatrix(matrix);
  }

  firstModel = false;

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM