# wy51ai/floorplan-3d architecture

> Architecture diagram of the GitHub repository wy51ai/floorplan-3d, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wy51ai/floorplan-3d
- Repository: https://github.com/wy51ai/floorplan-3d

## Overview

户型装修设计是一个无需构建步骤的浏览器端设计工具，全部实现位于 `index.html`。用户在 2D 平面图中编辑房间与家具，再切换到 3D 场景查看或漫游；两种视图中的家具操作实时同步。方案还提供面积与材料费用统计、撤销重做、自动保存及导入导出。下图依据 README 描述归纳功能关系；未提供源码摘录，因此没有推断未文档化的内部调用。

Main entry points: [`index.html`](https://github.com/wy51ai/floorplan-3d/blob/master/index.html) (设计方案)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editing["平面编辑"]
  node_app["设计工具<br/>[index.html]"]
  node_plan2d["2D 平面图<br/>[index.html]"]
  node_furniture["家具库与摆放<br/>[index.html]"]
  node_measure["测量与墙体<br/>[index.html]"]
  node_layers["图层开关<br/>[index.html]"]
end

subgraph group_visualization["3D 场景"]
  node_scene3d["3D 场景<br/>[index.html]"]
  node_views["视角与漫游<br/>[index.html]"]
  node_models["家具模型<br/>[index.html]"]
end

subgraph group_planning["方案与统计"]
  node_materials["地面材料<br/>[index.html]"]
  node_statistics["面积与造价<br/>[index.html]"]
  node_history["撤销与重做<br/>[index.html]"]
  node_plan[("设计方案<br/>[index.html]")]
end

subgraph group_storage["保存与导出"]
  node_autosave["自动保存<br/>[index.html]"]
  node_transfer["方案导入导出<br/>[index.html]"]
  node_png["PNG 导出<br/>[index.html]"]
end

node_user(("设计者"))
node_three["Three.js CDN"]
node_localstorage[("浏览器本地存储")]

node_user -->|"使用"| node_app
node_app -->|"提供编辑"| node_plan2d
node_user -->|"拖放家具"| node_furniture
node_user -->|"测量拆改"| node_measure
node_user -->|"切换图层"| node_layers
node_user -->|"切换视图"| node_scene3d
node_user -->|"控制视角"| node_views
node_plan2d -->|"更新方案"| node_plan
node_scene3d -->|"同步家具操作"| node_plan
node_plan -->|"呈现方案"| node_scene3d
node_scene3d -.->|"使用渲染库"| node_three
node_plan -->|"生成家具"| node_models
node_user -->|"设置房间材料"| node_materials
node_plan -->|"统计面积与材料"| node_statistics
node_user -->|"撤销重做"| node_history
node_history -->|"恢复方案"| node_plan
node_plan -->|"自动保存"| node_autosave
node_autosave -->|"写入"| node_localstorage
node_localstorage -->|"读取"| node_autosave
node_user -->|"导入导出"| node_transfer
node_transfer -->|"读写方案"| node_plan
node_user -->|"导出图片"| node_png
node_png -->|"导出平面图"| node_plan2d

click node_app "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_plan2d "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_furniture "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_measure "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_layers "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_scene3d "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_views "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_models "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_materials "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_statistics "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_history "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_plan "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_autosave "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_transfer "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"
click node_png "https://github.com/wy51ai/floorplan-3d/blob/master/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_plan2d,node_furniture,node_measure,node_layers toneBlue
class node_scene3d,node_views,node_models,node_localstorage toneAmber
class node_materials,node_statistics,node_history,node_plan toneMint
class node_autosave,node_transfer,node_png toneRose
class node_user,node_three toneIndigo
```

## Components

### 平面编辑

- [设计工具](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [2D 平面图](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [家具库与摆放](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [测量与墙体](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [图层开关](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`

### 3D 场景

- [3D 场景](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [视角与漫游](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [家具模型](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`

### 方案与统计

- [地面材料](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [面积与造价](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [撤销与重做](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [设计方案](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`

### 保存与导出

- [自动保存](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [方案导入导出](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`
- [PNG 导出](https://github.com/wy51ai/floorplan-3d/blob/master/index.html): `index.html`

### Other components

- **设计者**
- **Three.js CDN**
- **浏览器本地存储**

## Connections

- 设计者 → 设计工具: 使用
- 设计工具 → 2D 平面图: 提供编辑
- 设计者 → 家具库与摆放: 拖放家具
- 设计者 → 测量与墙体: 测量拆改
- 设计者 → 图层开关: 切换图层
- 设计者 → 3D 场景: 切换视图
- 设计者 → 视角与漫游: 控制视角
- 2D 平面图 → 设计方案: 更新方案
- 3D 场景 → 设计方案: 同步家具操作
- 设计方案 → 3D 场景: 呈现方案
- 3D 场景 → Three.js CDN: 使用渲染库
- 设计方案 → 家具模型: 生成家具
- 设计者 → 地面材料: 设置房间材料
- 设计方案 → 面积与造价: 统计面积与材料
- 设计者 → 撤销与重做: 撤销重做
- 撤销与重做 → 设计方案: 恢复方案
- 设计方案 → 自动保存: 自动保存
- 自动保存 → 浏览器本地存储: 写入
- 浏览器本地存储 → 自动保存: 读取
- 设计者 → 方案导入导出: 导入导出
- 方案导入导出 → 设计方案: 读写方案
- 设计者 → PNG 导出: 导出图片
- PNG 导出 → 2D 平面图: 导出平面图
