[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EHZ3FSZPHD61X4K37DD0E6":3,"skill-same:01M7EHZ3FSZPHD61X4K37DD0E6":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7EHZ3FSZPHD61X4K37DD0E6","threejs-impl-ifc-viewer",null,"Use when loading and viewing IFC\u002FBIM models in a Three.js scene. Prevents the common mistake of using deprecated web-ifc-three, ignoring AGPL-3.0 license implications, or loading large IFC files without streaming. Covers web-ifc (MIT), @thatopen\u002Fcomponents (AGPL-3.0), IFC loading, spatial tree, property extraction. Keywords: IFC, BIM, web-ifc, IFC viewer, @thatopen\u002Fcomponents, building model, architecture, IFC loading, spatial tree, BIM viewer, show IFC in browser, load building, web BIM viewer.","mhyahya854\u002FAI-Second-Brain_Universal-Rules","mhyahya854","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F194078115?v=4","01M7EGSP2M9T858SDHJMXQ257Y","01M7EGSP3N6HN6879SVDPMD4DZ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: threejs-impl-ifc-viewer\ndescription: >\n  Use when loading and viewing IFC\u002FBIM models in a Three.js scene.\n  Prevents the common mistake of using deprecated web-ifc-three,\n  ignoring AGPL-3.0 license implications, or loading large IFC files\n  without streaming. Covers web-ifc (MIT), @thatopen\u002Fcomponents\n  (AGPL-3.0), IFC loading, spatial tree, property extraction.\n  Keywords: IFC, BIM, web-ifc, IFC viewer, @thatopen\u002Fcomponents, building model, architecture, IFC loading, spatial tree, BIM viewer, show IFC in browser, load building, web BIM viewer.\nlicense: MIT\ncompatibility: \"Designed for Claude Code. Requires Three.js r160+.\"\nmetadata:\n  author: OpenAEC-Foundation\n  version: \"1.0\"\n---\n\n# threejs-impl-ifc-viewer\n\n## Quick Reference\n\n### Library Comparison\n\n| Library | License | Level | Status | Use Case |\n|---------|---------|-------|--------|----------|\n| `web-ifc` | MIT | Low-level WASM parser | Active (v0.77+) | Custom pipelines, full control |\n| `@thatopen\u002Fcomponents` | MIT (v3.x) | High-level BIM toolkit | Active (v3.3.2+) | Full BIM viewers, rapid prototyping |\n| `@thatopen\u002Fcomponents-front` | MIT | Browser-specific extensions | Active | UI, advanced visualization |\n| `web-ifc-three` | — | Deprecated bridge | **DEAD** | **NEVER use** |\n| `openbim-components` (v1) | — | Deprecated toolkit | **DEAD** | **NEVER use** |\n\n### Package Installation\n\n```bash\n# Low-level approach (MIT, full control)\nnpm install web-ifc three\n\n# High-level approach (MIT, batteries-included)\nnpm install @thatopen\u002Fcomponents @thatopen\u002Fcomponents-front web-ifc three\n```\n\n### Critical Warnings\n\n**LICENSE HISTORY WARNING**: The @thatopen packages (v3.x) are licensed under **MIT**. However, older IFC.js ecosystem packages (openbim-components v1, IFC.js v0.x) used **AGPL-3.0**. ALWAYS verify the license of the exact package version you install. If using any package with AGPL-3.0, your entire application MUST be open-sourced under AGPL-3.0 or a compatible license.\n\n**NEVER** use `web-ifc-three` -- it is deprecated and unmaintained. Use `web-ifc` directly or `@thatopen\u002Fcomponents` instead.\n\n**NEVER** use `openbim-components` (v1) -- it is deprecated. Use `@thatopen\u002Fcomponents` (v3.x) instead.\n\n**NEVER** load entire IFC geometry at once for files >50MB -- ALWAYS stream or load geometry on demand. WASM memory is limited and cannot be reclaimed without page reload.\n\n**NEVER** forget to call `ifcApi.CloseModel(modelID)` after processing -- WASM memory leaks are permanent until page reload.\n\n**ALWAYS** call `components.dispose()` when unmounting a @thatopen viewer -- failure to do so leaks GPU memory, Three.js objects, and event listeners.\n\n**ALWAYS** initialize `IfcAPI` asynchronously -- `await ifcApi.Init()` MUST complete before any model operations.\n\n---\n\n## Approach 1: web-ifc (Low-Level WASM Parser)\n\n### When to Use\n\n- You need full control over geometry extraction and rendering\n- You are building a custom rendering pipeline\n- You want MIT-licensed code only\n- You need to extract IFC properties without rendering geometry\n\n### WASM Setup\n\n```javascript\nimport * as WebIFC from 'web-ifc';\n\nconst ifcApi = new WebIFC.IfcAPI();\nifcApi.SetWasmPath('.\u002F');  \u002F\u002F MUST point to directory containing web-ifc.wasm\nawait ifcApi.Init();       \u002F\u002F ALWAYS await before any operations\n```\n\n**WASM file requirement**: The `web-ifc.wasm` file MUST be served from a location accessible by the browser. Copy it from `node_modules\u002Fweb-ifc\u002F` to your public\u002Fstatic directory. Bundlers like Vite require explicit configuration to serve WASM files.\n\n### IfcAPI Core Methods\n\n| Method | Signature | Description |\n|--------|-----------|-------------|\n| `Init()` | `() => Promise\u003Cvoid>` | Initialize WASM module |\n| `SetWasmPath(path)` | `(string) => void` | Set directory containing .wasm file |\n| `OpenModel(data, settings?)` | `(Uint8Array, object?) => number` | Load IFC data, returns modelID |\n| `CloseModel(modelID)` | `(number) => void` | Release model memory |\n| `GetGeometry(modelID, expressID)` | `(number, number) => object` | Get geometry for element |\n| `GetFlatMesh(modelID, expressID)` | `(number, number) => FlatMesh` | Get flattened mesh data |\n| `GetPlacedGeometry(modelID, pg)` | `(number, PlacedGeometry) => MeshData` | Get positioned geometry with transform |\n| `GetLine(modelID, expressID, flatten?)` | `(number, number, boolean?) => object` | Read single IFC entity by expressID |\n| `GetAllLines(modelID)` | `(number) => number[]` | Get all express IDs in model |\n| `GetLineIDsWithType(modelID, type)` | `(number, number) => number[]` | Get IDs by IFC type constant |\n| `GetAllTypesOfModel(modelID)` | `(number) => TypeInfo[]` | List all entity types in model |\n\n### Geometry Extraction Pattern\n\n```javascript\nconst modelID = ifcApi.OpenModel(ifcData); \u002F\u002F ifcData: Uint8Array\n\nconst wallIDs = ifcApi.GetLineIDsWithType(modelID, WebIFC.IFCWALL);\nfor (const wallID of wallIDs) {\n  const flatMesh = ifcApi.GetFlatMesh(modelID, wallID);\n  for (const pg of flatMesh.geometries) {\n    const meshData = ifcApi.GetPlacedGeometry(modelID, pg);\n    \u002F\u002F meshData.vertexData: Float32Array (interleaved position + normal, 6 floats per vertex)\n    \u002F\u002F meshData.indexData: Uint32Array (triangle indices)\n    \u002F\u002F pg.flatTransformation: Float64Array (4x4 column-major matrix)\n    \u002F\u002F pg.color: { x: r, y: g, z: b, w: alpha } (0-1 range)\n  }\n}\n\nifcApi.CloseModel(modelID); \u002F\u002F ALWAYS release when done\n```\n\n### Converting web-ifc Geometry to Three.js\n\n```javascript\nimport * as THREE from 'three';\n\nfunction ifcMeshToThree(meshData, placedGeometry) {\n  const { vertexData, indexData } = meshData;\n\n  \u002F\u002F vertexData is interleaved: [px, py, pz, nx, ny, nz, px, py, pz, nx, ny, nz, ...]\n  const posFloats = new Float32Array(vertexData.length \u002F 2);\n  const normFloats = new Float32Array(vertexData.length \u002F 2);\n  for (let i = 0; i \u003C vertexData.length; i += 6) {\n    const j = i \u002F 2;\n    posFloats[j]     = vertexData[i];\n    posFloats[j + 1] = vertexData[i + 1];\n    posFloats[j + 2] = vertexData[i + 2];\n    normFloats[j]     = vertexData[i + 3];\n    normFloats[j + 1] = vertexData[i + 4];\n    normFloats[j + 2] = vertexData[i + 5];\n  }\n\n  const geometry = new THREE.BufferGeometry();\n  geometry.setAttribute('position', new THREE.BufferAttribute(posFloats, 3));\n  geometry.setAttribute('normal', new THREE.BufferAttribute(normFloats, 3));\n  geometry.setIndex(new THREE.BufferAttribute(indexData, 1));\n\n  const { x: r, y: g, z: b, w: a } = placedGeometry.color;\n  const material = new THREE.MeshPhongMaterial({\n    color: new THREE.Color(r, g, b),\n    opacity: a,\n    transparent: a \u003C 1,\n    side: THREE.DoubleSide,\n  });\n\n  const mesh = new THREE.Mesh(geometry, material);\n\n  \u002F\u002F Apply the 4x4 transform matrix (column-major)\n  const mat = new THREE.Matrix4();\n  mat.fromArray(placedGeometry.flatTransformation);\n  mesh.applyMatrix4(mat);\n\n  return mesh;\n}\n```\n\n### IFC Property Extraction\n\n```javascript\n\u002F\u002F Read a specific entity\nconst wall = ifcApi.GetLine(modelID, wallExpressID, true); \u002F\u002F flatten=true resolves references\nconsole.log(wall.Name?.value);       \u002F\u002F \"Basic Wall:Generic - 200mm\"\nconsole.log(wall.GlobalId?.value);   \u002F\u002F IFC GUID\n\n\u002F\u002F Get all property sets for an element\nconst relDefines = ifcApi.GetLineIDsWithType(modelID, WebIFC.IFCRELDEFINESBYPROPERTIES);\nfor (const relID of relDefines) {\n  const rel = ifcApi.GetLine(modelID, relID, false);\n  \u002F\u002F Check if this relation references our element\n  \u002F\u002F rel.RelatedObjects contains expressIDs of related elements\n  \u002F\u002F rel.RelatingPropertyDefinition points to the property set\n}\n```\n\n### IFC Type Constants\n\n| Constant | IFC Entity |\n|----------|-----------|\n| `WebIFC.IFCWALL` | Walls |\n| `WebIFC.IFCWALLSTANDARDCASE` | Standard walls |\n| `WebIFC.IFCSLAB` | Slabs \u002F floors |\n| `WebIFC.IFCCOLUMN` | Columns |\n| `WebIFC.IFCBEAM` | Beams |\n| `WebIFC.IFCDOOR` | Doors |\n| `WebIFC.IFCWINDOW` | Windows |\n| `WebIFC.IFCROOF` | Roofs |\n| `WebIFC.IFCSTAIR` | Stairs |\n| `WebIFC.IFCSPACE` | Spaces \u002F rooms |\n| `WebIFC.IFCSITE` | Site |\n| `WebIFC.IFCBUILDING` | Building |\n| `WebIFC.IFCBUILDINGSTOREY` | Storey \u002F floor level |\n| `WebIFC.IFCPROJECT` | Project root |\n| `WebIFC.IFCRELDEFINESBYPROPERTIES` | Property set relations |\n| `WebIFC.IFCPROPERTYSET` | Property sets |\n| `WebIFC.IFCPROPERTYSINGLEVALUE` | Individual property values |\n\n---\n\n## Approach 2: @thatopen\u002Fcomponents (High-Level BIM Toolkit)\n\n### When to Use\n\n- You need a full-featured BIM viewer quickly\n- You want built-in fragment optimization for large models\n- You need element highlighting, section planes, or floor plans\n- MIT license (v3.x) is acceptable for your project\n\n### Architecture Setup\n\n```javascript\nimport * as OBC from '@thatopen\u002Fcomponents';\n\nconst components = new OBC.Components();\nconst worlds = components.get(OBC.Worlds);\nconst world = worlds.create();\n\n\u002F\u002F Scene\nworld.scene = new OBC.SimpleScene(components);\nworld.scene.setup(); \u002F\u002F Adds default lights and grid\n\n\u002F\u002F Camera\nworld.camera = new OBC.SimpleCamera(components);\nworld.camera.controls.setLookAt(10, 10, 10, 0, 0, 0);\n\n\u002F\u002F Renderer (container is an HTMLDivElement)\nworld.renderer = new OBC.SimpleRenderer(components, container);\n\n\u002F\u002F ALWAYS call init after setup\ncomponents.init();\n```\n\n### Loading IFC Files\n\n```javascript\nconst ifcLoader = components.get(OBC.IfcLoader);\nawait ifcLoader.setup(); \u002F\u002F Downloads and initializes WASM\n\n\u002F\u002F Load from file input\nconst file = event.target.files[0];\nconst data = new Uint8Array(await file.arrayBuffer());\nconst model = await ifcLoader.load(data);\n\n\u002F\u002F model is added to the active world automatically\n\u002F\u002F model contains Three.js Group with fragment meshes\n```\n\n### Key Components\n\n| Component | Access Pattern | Purpose |\n|-----------|---------------|---------|\n| `OBC.Components` | `new OBC.Components()` | Central manager for all subsystems |\n| `OBC.Worlds` | `components.get(OBC.Worlds)` | Multi-world environment management |\n| `OBC.SimpleScene` | Constructor | Three.js scene wrapper with defaults |\n| `OBC.SimpleCamera` | Constructor | Camera with built-in orbit controls |\n| `OBC.SimpleRenderer` | Constructor | WebGL renderer bound to DOM element |\n| `OBC.IfcLoader` | `components.get(OBC.IfcLoader)` | IFC file loading and fragment conversion |\n| `OBC.FragmentsManager` | `components.get(OBC.FragmentsManager)` | Efficient batched geometry management |\n| `OBC.Highlighter` | `components.get(OBC.Highlighter)` | Element selection and highlighting |\n| `OBC.Clipper` | `components.get(OBC.Clipper)` | Section plane tools |\n| `OBC.Plans` | `components.get(OBC.Plans)` | Floor plan generation |\n\n### Fragment System\n\nThe fragment system converts IFC geometry into batched draw calls. This is critical for performance with large BIM models (10,000+ elements).\n\n- Each IFC type gets batched into a single fragment mesh\n- Fragments share materials where possible, minimizing state changes\n- Individual elements can still be picked, highlighted, and hidden by expressID\n- ALWAYS use fragments for models with >1,000 elements\n\n### Cleanup\n\n```javascript\n\u002F\u002F ALWAYS dispose when unmounting the viewer\ncomponents.dispose();\n\u002F\u002F This releases: Three.js scene, renderer, geometries, materials, textures,\n\u002F\u002F WASM memory, event listeners, and all component state\n```\n\n---\n\n## IFC Spatial Tree\n\nIFC files follow a hierarchical spatial structure:\n\n```\nIFCPROJECT\n  └── IFCSITE\n        └── IFCBUILDING\n              ├── IFCBUILDINGSTOREY (Level 0)\n              │     ├── IFCWALL\n              │     ├── IFCSLAB\n              │     └── IFCSPACE\n              └── IFCBUILDINGSTOREY (Level 1)\n                    ├── IFCWALL\n                    ├── IFCCOLUMN\n                    └── IFCDOOR\n```\n\nSpatial containment is defined by `IFCRELCONTAINEDINSPATIALSTRUCTURE` and `IFCRELAGGREGATES` relationships. ALWAYS traverse these relationships to build a navigable tree -- do NOT assume flat element lists represent the building structure.\n\n---\n\n## Memory Management for Large IFC Files\n\n| File Size | Strategy |\n|-----------|----------|\n| \u003C10MB | Load entirely, render all geometry at once |\n| 10-50MB | Load entirely, use fragment batching |\n| 50-200MB | Stream geometry by storey or type, dispose unused |\n| >200MB | Server-side preprocessing into fragments, load on demand |\n\n### Rules\n\n- ALWAYS monitor WASM heap usage -- web-ifc allocates in WASM linear memory which has a hard cap\n- ALWAYS dispose geometry that is not currently visible (off-screen storeys, hidden types)\n- NEVER keep duplicate geometry in both WASM and JavaScript heap\n- ALWAYS use `BufferGeometry` (never legacy `Geometry`)\n- ALWAYS call `geometry.dispose()` and `material.dispose()` when removing meshes from scene\n\n---\n\n## Reference Links\n\n- [references\u002Fmethods.md](references\u002Fmethods.md) -- Complete API signatures for web-ifc and @thatopen\u002Fcomponents\n- [references\u002Fexamples.md](references\u002Fexamples.md) -- Working code examples for IFC loading and viewing\n- [references\u002Fanti-patterns.md](references\u002Fanti-patterns.md) -- What NOT to do when working with IFC in Three.js\n\n### Official Sources\n\n- https:\u002F\u002Fgithub.com\u002FIFCjs\u002Fweb-ifc\n- https:\u002F\u002Fgithub.com\u002FThatOpen\u002Fengine_components\n- https:\u002F\u002Fdocs.thatopen.com\u002F\n- https:\u002F\u002Fstandards.buildingsmart.org\u002FIFC\u002FRELEASE\u002FIFC4\u002FADD2_TC1\u002FHTML\u002F\n","# threejs-impl-ifc-viewer\n\n## Quick Reference\n\n### Library Comparison\n\n| Library | License | Level | Status | Use Case |\n|---------|---------|-------|--------|----------|\n| `web-ifc` | MIT | Low-level WASM parser | Active (v0.77+) | Custom pipelines, full control |\n| `@thatopen\u002Fcomponents` | MIT (v3.x) | High-level BIM toolkit | Active (v3.3.2+) | Full BIM viewers, rapid prototyping |\n| `@thatopen\u002Fcomponents-front` | MIT | Browser-specific extensions | Active | UI, advanced visualization |\n| `web-ifc-three` | — | Deprecated bridge | **DEAD** | **NEVER use** |\n| `openbim-components` (v1) | — | Deprecated toolkit | **DEAD** | **NEVER use** |\n\n### Package Installation\n\n```bash\n# Low-level approach (MIT, full control)\nnpm install web-ifc three\n\n# High-level approach (MIT, batteries-included)\nnpm install @thatopen\u002Fcomponents @thatopen\u002Fcomponents-front web-ifc three\n```\n\n### Critical Warnings\n\n**LICENSE HISTORY WARNING**: The @thatopen packages (v3.x) are licensed under **MIT**. However, older IFC.js ecosystem packages (openbim-components v1, IFC.js v0.x) used **AGPL-3.0**. ALWAYS verify the license of the exact package version you install. If using any package with AGPL-3.0, your entire application MUST be open-sourced under AGPL-3.0 or a compatible license.\n\n**NEVER** use `web-ifc-three` -- it is deprecated and unmaintained. Use `web-ifc` directly or `@thatopen\u002Fcomponents` instead.\n\n**NEVER** use `openbim-components` (v1) -- it is deprecated. Use `@thatopen\u002Fcomponents` (v3.x) instead.\n\n**NEVER** load entire IFC geometry at once for files >50MB -- ALWAYS stream or load geometry on demand. WASM memory is limited and cannot be reclaimed without page reload.\n\n**NEVER** forget to call `ifcApi.CloseModel(modelID)` after processing -- WASM memory leaks are permanent until page reload.\n\n**ALWAYS** call `components.dispose()` when unmounting a @thatopen viewer -- failure to do so leaks GPU memory, Three.js objects, and event listeners.\n\n**ALWAYS** initialize `IfcAPI` asynchronously -- `await ifcApi.Init()` MUST complete before any model operations.\n\n---\n\n## Approach 1: web-ifc (Low-Level WASM Parser)\n\n### When to Use\n\n- You need full control over geometry extraction and rendering\n- You are building a custom rendering pipeline\n- You want MIT-licensed code only\n- You need to extract IFC properties without rendering geometry\n\n### WASM Setup\n\n```javascript\nimport * as WebIFC from 'web-ifc';\n\nconst ifcApi = new WebIFC.IfcAPI();\nifcApi.SetWasmPath('.\u002F');  \u002F\u002F MUST point to directory containing web-ifc.wasm\nawait ifcApi.Init();       \u002F\u002F ALWAYS await before any operations\n```\n\n**WASM file requirement**: The `web-ifc.wasm` file MUST be served from a location accessible by the browser. Copy it from `node_modules\u002Fweb-ifc\u002F` to your public\u002Fstatic directory. Bundlers like Vite require explicit configuration to serve WASM files.\n\n### IfcAPI Core Methods\n\n| Method | Signature | Description |\n|--------|-----------|-------------|\n| `Init()` | `() => Promise\u003Cvoid>` | Initialize WASM module |\n| `SetWasmPath(path)` | `(string) => void` | Set directory containing .wasm file |\n| `OpenModel(data, settings?)` | `(Uint8Array, object?) => number` | Load IFC data, returns modelID |\n| `CloseModel(modelID)` | `(number) => void` | Release model memory |\n| `GetGeometry(modelID, expressID)` | `(number, number) => object` | Get geometry for element |\n| `GetFlatMesh(modelID, expressID)` | `(number, number) => FlatMesh` | Get flattened mesh data |\n| `GetPlacedGeometry(modelID, pg)` | `(number, PlacedGeometry) => MeshData` | Get positioned geometry with transform |\n| `GetLine(modelID, expressID, flatten?)` | `(number, number, boolean?) => object` | Read single IFC entity by expressID |\n| `GetAllLines(modelID)` | `(number) => number[]` | Get all express IDs in model |\n| `GetLineIDsWithType(modelID, type)` | `(number, number) => number[]` | Get IDs by IFC type constant |\n| `GetAllTypesOfModel(modelID)` | `(number) => TypeInfo[]` | List all entity types in model |\n\n### Geometry Extraction Pattern\n\n```javascript\nconst modelID = ifcApi.OpenModel(ifcData); \u002F\u002F ifcData: Uint8Array\n\nconst wallIDs = ifcApi.GetLineIDsWithType(modelID, WebIFC.IFCWALL);\nfor (const wallID of wallIDs) {\n  const flatMesh = ifcApi.GetFlatMesh(modelID, wallID);\n  for (const pg of flatMesh.geometries) {\n    const meshData = ifcApi.GetPlacedGeometry(modelID, pg);\n    \u002F\u002F meshData.vertexData: Float32Array (interleaved position + normal, 6 floats per vertex)\n    \u002F\u002F meshData.indexData: Uint32Array (triangle indices)\n    \u002F\u002F pg.flatTransformation: Float64Array (4x4 column-major matrix)\n    \u002F\u002F pg.color: { x: r, y: g, z: b, w: alpha } (0-1 range)\n  }\n}\n\nifcApi.CloseModel(modelID); \u002F\u002F ALWAYS release when done\n```\n\n### Converting web-ifc Geometry to Three.js\n\n```javascript\nimport * as THREE from 'three';\n\nfunction ifcMeshToThree(meshData, placedGeometry) {\n  const { vertexData, indexData } = meshData;\n\n  \u002F\u002F vertexData is interleaved: [px, py, pz, nx, ny, nz, px, py, pz, nx, ny, nz, ...]\n  const posFloats = new Float32Array(vertexData.length \u002F 2);\n  const normFloats = new Float32Array(vertexData.length \u002F 2);\n  for (let i = 0; i \u003C vertexData.length; i += 6) {\n    const j = i \u002F 2;\n    posFloats[j]     = vertexData[i];\n    posFloats[j + 1] = vertexData[i + 1];\n    posFloats[j + 2] = vertexData[i + 2];\n    normFloats[j]     = vertexData[i + 3];\n    normFloats[j + 1] = vertexData[i + 4];\n    normFloats[j + 2] = vertexData[i + 5];\n  }\n\n  const geometry = new THREE.BufferGeometry();\n  geometry.setAttribute('position', new THREE.BufferAttribute(posFloats, 3));\n  geometry.setAttribute('normal', new THREE.BufferAttribute(normFloats, 3));\n  geometry.setIndex(new THREE.BufferAttribute(indexData, 1));\n\n  const { x: r, y: g, z: b, w: a } = placedGeometry.color;\n  const material = new THREE.MeshPhongMaterial({\n    color: new THREE.Color(r, g, b),\n    opacity: a,\n    transparent: a \u003C 1,\n    side: THREE.DoubleSide,\n  });\n\n  const mesh = new THREE.Mesh(geometry, material);\n\n  \u002F\u002F Apply the 4x4 transform matrix (column-major)\n  const mat = new THREE.Matrix4();\n  mat.fromArray(placedGeometry.flatTransformation);\n  mesh.applyMatrix4(mat);\n\n  return mesh;\n}\n```\n\n### IFC Property Extraction\n\n```javascript\n\u002F\u002F Read a specific entity\nconst wall = ifcApi.GetLine(modelID, wallExpressID, true); \u002F\u002F flatten=true resolves references\nconsole.log(wall.Name?.value);       \u002F\u002F \"Basic Wall:Generic - 200mm\"\nconsole.log(wall.GlobalId?.value);   \u002F\u002F IFC GUID\n\n\u002F\u002F Get all property sets for an element\nconst relDefines = ifcApi.GetLineIDsWithType(modelID, WebIFC.IFCRELDEFINESBYPROPERTIES);\nfor (const relID of relDefines) {\n  const rel = ifcApi.GetLine(modelID, relID, false);\n  \u002F\u002F Check if this relation references our element\n  \u002F\u002F rel.RelatedObjects contains expressIDs of related elements\n  \u002F\u002F rel.RelatingPropertyDefinition points to the property set\n}\n```\n\n### IFC Type Constants\n\n| Constant | IFC Entity |\n|----------|-----------|\n| `WebIFC.IFCWALL` | Walls |\n| `WebIFC.IFCWALLSTANDARDCASE` | Standard walls |\n| `WebIFC.IFCSLAB` | Slabs \u002F floors |\n| `WebIFC.IFCCOLUMN` | Columns |\n| `WebIFC.IFCBEAM` | Beams |\n| `WebIFC.IFCDOOR` | Doors |\n| `WebIFC.IFCWINDOW` | Windows |\n| `WebIFC.IFCROOF` | Roofs |\n| `WebIFC.IFCSTAIR` | Stairs |\n| `WebIFC.IFCSPACE` | Spaces \u002F rooms |\n| `WebIFC.IFCSITE` | Site |\n| `WebIFC.IFCBUILDING` | Building |\n| `WebIFC.IFCBUILDINGSTOREY` | Storey \u002F floor level |\n| `WebIFC.IFCPROJECT` | Project root |\n| `WebIFC.IFCRELDEFINESBYPROPERTIES` | Property set relations |\n| `WebIFC.IFCPROPERTYSET` | Property sets |\n| `WebIFC.IFCPROPERTYSINGLEVALUE` | Individual property values |\n\n---\n\n## Approach 2: @thatopen\u002Fcomponents (High-Level BIM Toolkit)\n\n### When to Use\n\n- You need a full-featured BIM viewer quickly\n- You want built-in fragment optimization for large models\n- You need element highlighting, section planes, or floor plans\n- MIT license (v3.x) is acceptable for your project\n\n### Architecture Setup\n\n```javascript\nimport * as OBC from '@thatopen\u002Fcomponents';\n\nconst components = new OBC.Components();\nconst worlds = components.get(OBC.Worlds);\nconst world = worlds.create();\n\n\u002F\u002F Scene\nworld.scene = new OBC.SimpleScene(components);\nworld.scene.setup(); \u002F\u002F Adds default lights and grid\n\n\u002F\u002F Camera\nworld.camera = new OBC.SimpleCamera(components);\nworld.camera.controls.setLookAt(10, 10, 10, 0, 0, 0);\n\n\u002F\u002F Renderer (container is an HTMLDivElement)\nworld.renderer = new OBC.SimpleRenderer(components, container);\n\n\u002F\u002F ALWAYS call init after setup\ncomponents.init();\n```\n\n### Loading IFC Files\n\n```javascript\nconst ifcLoader = components.get(OBC.IfcLoader);\nawait ifcLoader.setup(); \u002F\u002F Downloads and initializes WASM\n\n\u002F\u002F Load from file input\nconst file = event.target.files[0];\nconst data = new Uint8Array(await file.arrayBuffer());\nconst model = await ifcLoader.load(data);\n\n\u002F\u002F model is added to the active world automatically\n\u002F\u002F model contains Three.js Group with fragment meshes\n```\n\n### Key Components\n\n| Component | Access Pattern | Purpose |\n|-----------|---------------|---------|\n| `OBC.Components` | `new OBC.Components()` | Central manager for all subsystems |\n| `OBC.Worlds` | `components.get(OBC.Worlds)` | Multi-world environment management |\n| `OBC.SimpleScene` | Constructor | Three.js scene wrapper with defaults |\n| `OBC.SimpleCamera` | Constructor | Camera with built-in orbit controls |\n| `OBC.SimpleRenderer` | Constructor | WebGL renderer bound to DOM element |\n| `OBC.IfcLoader` | `components.get(OBC.IfcLoader)` | IFC file loading and fragment conversion |\n| `OBC.FragmentsManager` | `components.get(OBC.FragmentsManager)` | Efficient batched geometry management |\n| `OBC.Highlighter` | `components.get(OBC.Highlighter)` | Element selection and highlighting |\n| `OBC.Clipper` | `components.get(OBC.Clipper)` | Section plane tools |\n| `OBC.Plans` | `components.get(OBC.Plans)` | Floor plan generation |\n\n### Fragment System\n\nThe fragment system converts IFC geometry into batched draw calls. This is critical for performance with large BIM models (10,000+ elements).\n\n- Each IFC type gets batched into a single fragment mesh\n- Fragments share materials where possible, minimizing state changes\n- Individual elements can still be picked, highlighted, and hidden by expressID\n- ALWAYS use fragments for models with >1,000 elements\n\n### Cleanup\n\n```javascript\n\u002F\u002F ALWAYS dispose when unmounting the viewer\ncomponents.dispose();\n\u002F\u002F This releases: Three.js scene, renderer, geometries, materials, textures,\n\u002F\u002F WASM memory, event listeners, and all component state\n```\n\n---\n\n## IFC Spatial Tree\n\nIFC files follow a hierarchical spatial structure:\n\n```\nIFCPROJECT\n  └── IFCSITE\n        └── IFCBUILDING\n              ├── IFCBUILDINGSTOREY (Level 0)\n              │     ├── IFCWALL\n              │     ├── IFCSLAB\n              │     └── IFCSPACE\n              └── IFCBUILDINGSTOREY (Level 1)\n                    ├── IFCWALL\n                    ├── IFCCOLUMN\n                    └── IFCDOOR\n```\n\nSpatial containment is defined by `IFCRELCONTAINEDINSPATIALSTRUCTURE` and `IFCRELAGGREGATES` relationships. ALWAYS traverse these relationships to build a navigable tree -- do NOT assume flat element lists represent the building structure.\n\n---\n\n## Memory Management for Large IFC Files\n\n| File Size | Strategy |\n|-----------|----------|\n| \u003C10MB | Load entirely, render all geometry at once |\n| 10-50MB | Load entirely, use fragment batching |\n| 50-200MB | Stream geometry by storey or type, dispose unused |\n| >200MB | Server-side preprocessing into fragments, load on demand |\n\n### Rules\n\n- ALWAYS monitor WASM heap usage -- web-ifc allocates in WASM linear memory which has a hard cap\n- ALWAYS dispose geometry that is not currently visible (off-screen storeys, hidden types)\n- NEVER keep duplicate geometry in both WASM and JavaScript heap\n- ALWAYS use `BufferGeometry` (never legacy `Geometry`)\n- ALWAYS call `geometry.dispose()` and `material.dispose()` when removing meshes from scene\n\n---\n\n## Reference Links\n\n- [references\u002Fmethods.md](references\u002Fmethods.md) -- Complete API signatures for web-ifc and @thatopen\u002Fcomponents\n- [references\u002Fexamples.md](references\u002Fexamples.md) -- Working code examples for IFC loading and viewing\n- [references\u002Fanti-patterns.md](references\u002Fanti-patterns.md) -- What NOT to do when working with IFC in Three.js\n\n### Official Sources\n\n- https:\u002F\u002Fgithub.com\u002FIFCjs\u002Fweb-ifc\n- https:\u002F\u002Fgithub.com\u002FThatOpen\u002Fengine_components\n- https:\u002F\u002Fdocs.thatopen.com\u002F\n- https:\u002F\u002Fstandards.buildingsmart.org\u002FIFC\u002FRELEASE\u002FIFC4\u002FADD2_TC1\u002FHTML\u002F\n",{"name":5,"license":14,"metadata":23,"description":26,"compatibility":27},{"author":24,"version":25},"OpenAEC-Foundation","1.0","Use when loading and viewing IFC\u002FBIM models in a Three.js scene. Prevents the common mistake of using deprecated web-ifc-three, ignoring AGPL-3.0 license implications, or loading large IFC files without streaming. Covers web-ifc (MIT), @thatopen\u002Fcomponents (AGPL-3.0), IFC loading, spatial tree, property extraction. Keywords: IFC, BIM, web-ifc, IFC viewer, @thatopen\u002Fcomponents, building model, architecture, IFC loading, spatial tree, BIM viewer, show IFC in browser, load building, web BIM viewer.\n","Designed for Claude Code. Requires Three.js r160+.","main","4c174e06a831864e98c30f630a7aa6c04738b094","skills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules","https:\u002F\u002Fgithub.com\u002Fmhyahya854","2026-11-06 02:03:37",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mhyahya854\u002FAI-Second-Brain_Universal-Rules --skill threejs-impl-ifc-viewer",{"tool":40,"command":41},"bunx","bunx skills add mhyahya854\u002FAI-Second-Brain_Universal-Rules --skill threejs-impl-ifc-viewer",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mhyahya854\u002FAI-Second-Brain_Universal-Rules --skill threejs-impl-ifc-viewer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002FSKILL.md",true,[48,53,59,63],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":13,"sourceHtmlUrl":52},".gitkeep","OTHER","其他","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002F.gitkeep",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fanti-patterns.md","REFERENCE","参考文档",8023,"https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002Freferences\u002Fanti-patterns.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fexamples.md",9933,"https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002Freferences\u002Fexamples.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fmethods.md",6136,"https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002FImpertio-Studio\u002FThree.js-Claude-Skill-Package\u002Fthreejs-impl-ifc-viewer\u002Freferences\u002Fmethods.md",[68,76,84,92,99,106],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7EX4T721AAH60R0239P8WBZ","frontend-slides","Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT\u002FPPTX to web, or create slides for a talk\u002Fpitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fzarazhangrui\u002Ffrontend-slides\u002Ffrontend-slides\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fzarazhangrui\u002Ffrontend-slides\u002Ffrontend-slides\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7EX495RSHTTCEJVX7C83FA3","design-dna","Extract, define, and apply design DNA across three dimensions: design system (tokens), design style (qualitative feel), and visual effects (Canvas, WebGL, 3D, particles, shaders, scroll effects, etc.). Use this skill when: (1) a user wants to see the full 3-dimension design structure\u002Fschema, (2) a user provides images, screenshots, or URLs of reference designs and wants them analyzed into a structured JSON profile covering all three dimensions, (3) a user has a Design DNA JSON and content and wants a design generated from it, or (4) any combination of these phases. Triggers on \"design DNA\", \"extract design style\", \"analyze design\", \"design tokens from reference\", \"generate design from JSON\", \"design system from screenshot\", \"design profile\", \"style guide JSON\", \"visual effects analysis\", \"design with effects\", \"3d design analysis\".","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fzanwei\u002Fdesign-dna\u002Fdesign-dna\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fzanwei\u002Fdesign-dna\u002Fdesign-dna\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7EX45RF2XZKRC3KDJDTT1PH","wireframe","Generate JSON wireframe with HTML preview","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fyhassy\u002Fwireframe-skill\u002Fwireframe-skill\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fyhassy\u002Fwireframe-skill\u002Fwireframe-skill\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7EWZEM3MHD48AYSYFR2C9JP","social-publishing","Schedule and publish social media posts across 13 platforms (X, LinkedIn, Instagram, Facebook Pages, TikTok, Discord, Telegram, YouTube, Reddit, WordPress, Pinterest) via the SocialClaw API. Use when the user wants to publish, schedule, or manage social media content programmatically. Requires SOCIALCLAW_API_KEY.","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fwshobson\u002Fagents\u002Fsocial-publishing\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7EWKDEK9840C728VXT78EQ9","hermes-tweet","Install and operate Hermes Tweet, a Hermes Agent plugin for X\u002FTwitter research, timeline reading, tweet analysis, and approval-gated private or state-changing operations. Use this skill when installing Hermes Tweet, researching X\u002FTwitter accounts, monitoring launch signals, investigating mentions, auditing giveaways, or preparing gated X operations. Use proactively when a Hermes Agent workflow needs current X\u002FTwitter context. Requires XQUIK_API_KEY for read and action tools.","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fwshobson\u002Fagents\u002Fhermes-tweet\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M7EWASXP3NZWW95CJPT2CRWN","refactoring-ui","Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions \"my UI looks off\" (or amateur\u002Funprofessional), \"fix the design\", \"Tailwind styling\", \"color palette\", \"visual hierarchy\", \"design system\", \"spacing scale\", or \"component styling\". Also trigger when building consistent design tokens, creating dark mode themes, improving data-visualization clarity, or polishing UI details before launch. Covers grayscale-first workflow, constrained design scales, shadows, and component styling. For typeface selection, see web-typography. For usability audits, see ux-heuristics.","https:\u002F\u002Fgithub.com\u002Fmhyahya854\u002FAI-Second-Brain_Universal-Rules\u002Fblob\u002Fmain\u002Fskills\u002F_intake\u002Fgithub\u002Fwondelai\u002Fskills\u002Frefactoring-ui\u002FSKILL.md",[],[]]