SuperAPI AI 工具集

thatopen-core-architecture

通用与其它

查看项目

更新于 10-16 06:18

技能介绍

用途:面向创建 ThatOpen BIM 应用、理解其组件系统或推理其架构的场景,说明 @thatopen/components 3.3.x(MIT)的核心设计。

主要能力:Components 是顶层单例注册表,管理组件实例与动画循环;组件通过 components.get(ComponentClass) 懒加载获取,禁止直接 new。每个组件有静态 uuid 和 enabled 属性,通过实现 Disposable、Updateable、Configurable、Resizeable、Hideable、Createable、Serializable 等接口获得行为。World 将 Scene、Camera、Renderer 组合为视口,底层 Three.js 对象通过 .three 访问。事件系统为自定义 Event<T>,集合使用响应式 DataMap/DataSet,ModelIdMap 用于跨模型定位元素。

使用方式:先 new OBC.Components(),用 components.get(OBC.Worlds) 创建 world,再分别创建 SimpleScene、SimpleRenderer、OrthoPerspectiveCamera,最后调用 components.init() 启动渲染循环;Configurable 组件需显式 setup(),FragmentsManager 需先 fragments.init(workerURL)。清理时调用 components.dispose()。

适用场景:浏览器端 BIM/IFC 可视化、选择、测量、分类与 OpenBIM 标准处理。

限制:@thatopen/components-front 仅限浏览器,不能在 Node.js 中导入;不要使用已废弃的 web-ifc-three、web-ifc-viewer、openbim-components 或 v2 的 Plans/ClipEdges;不调用 init() 不会渲染,不 dispose() 会导致内存泄漏。具体 API 签名以官方仓库与 npm 包为准。