简体   繁体   English

Web-ifc-three:如何仅通过 expressId 获取几何图形,而不选择?

[英]Web-ifc-three: How to get the geometry by expressId only, without picking?

I have a question, please.我有一个问题,请。 How to get the geometry by expressId only, without picking?如何仅通过 expressId 获取几何图形,而不进行选择? Having an expressId(s) I need to know the geometry, ie the corresponding threejs object(s).有一个 expressId(s) 我需要知道几何,即相应的 threejs 对象。 I tried createSubset, but this method returns (as I found) not the mesh of the subset, but the mesh of the whole model.我尝试了 createSubset,但这个方法返回(如我所见)不是子集的网格,而是整个 model 的网格。 let subset =...createSubset({ modelID: ..., ids: [id], material: ... scene: ..., removePrevious: true }); let subset =...createSubset({ modelID: ..., ids: [id], material: ... scene: ..., removePrevious: true }); Thank you in advance!先感谢您!

For performance sake, IFC.js combines all the items of the model in a single mesh.出于性能考虑,IFC.js 将 model 的所有项目组合在一个网格中。 Having each item as a single mesh would result in the browser not being able to handle medium sized models due to the draw calls.将每个项目作为单个网格将导致浏览器由于绘制调用而无法处理中等大小的模型。

Subsets are not exactly the whole model.子集并不完全是整个 model。 Each subset shares the same position , normal , and expressID buffers with the whole model to save memory, but each subset has its own index array.每个子集与整个 model 共享相同的positionnormalexpressID缓冲区以保存 memory,但每个子集都有自己的index数组。 Notice that both the whole model and the subset are indexed BufferGeometries.请注意,整个 model 和子集都是索引的 BufferGeometries。

If you want to reconstruct an individual Three.js Mesh from a subset, you can do it like I explained in this other answer .如果你想从一个子集中重建一个单独的 Three.js 网格,你可以像我在这个其他答案中解释的那样做。 Please note that there is a reason behind this decision, and Mesh reconstruction should only be used for export purposes.请注意,此决定背后是有原因的,网格重建只能用于导出目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM