Files
bim_engine/demo
yuding 507112fcf9 feat: add camera switch, fix click event/dialog resize/map state sync
- fix(engine): adapt click handler to base engine array format data[0].url/ids
- feat(toolbar): add perspective/orthographic camera switch button with dynamic icon
- fix(dialog): clamp resize to container bounds to prevent overflow
- feat(demo): add auto-combine feature with robust URL parsing and validation
- fix(walk): close minimap on walk exit and sync map state between toolbar and walk panel
- fix(engine): correct MiniMap getstate() casing to match base engine API
- build: rebuild demo libs
2026-03-05 17:43:50 +08:00
..
2026-01-29 17:03:25 +08:00

iFlow Engine Demo

这是一个独立的演示项目,展示如何使用 iFlow Engine。

前置要求

  1. 确保父项目已经构建完成:

    cd ..
    npm run build
    
  2. 安装依赖:

    npm install
    
  3. 复制 SDK 文件到 demo 目录:

    npm run copy-sdk
    

    或者手动复制:

    mkdir -p lib
    cp ../dist/iflow-engine.umd.js lib/
    

运行

开发模式

npm run dev

服务器会在 http://localhost:8080 启动,并自动打开浏览器。

构建

npm run build

构建后的文件会在 dist 目录中。

预览构建结果

npm run preview

项目结构

demo/
├── index.html          # 主页面
├── model/              # 3D 模型文件
│   └── gujianzhu.glb
├── lib/                # SDK 文件目录
│   └── iflow-engine.umd.js
├── package.json        # 项目配置
├── vite.config.js      # Vite 配置
└── README.md           # 说明文档

使用说明

  1. 点击 "初始化引擎" 按钮初始化 3D 引擎
  2. 点击 "加载模型" 按钮加载 3D 模型
  3. 其他功能按钮可以测试 SDK 的各种功能

注意事项

  • 确保父项目的 dist 目录中有构建好的 SDK 文件
  • 模型文件路径是相对于 index.html
  • 使用 HTTP 服务器运行(不能直接打开 HTML 文件)以避免 CORS 问题