floorplan-3d README

The project's README from github.com/wy51ai/floorplan-3d. As one markdown file: README.md.

户型装修设计

纯前端的户型装修设计工具:在 2D 平面图上摆放家具、拆改墙体、测量尺寸,一键切换到 Three.js 3D 场景,可以鸟瞰,也可以第一人称漫游。整个应用就是一个 index.html,无需构建,打开即用。

功能

2D 平面布置

3D 场景

方案与统计

快速开始

git clone <仓库地址>
cd <仓库目录>

然后直接用浏览器打开 index.html。也可以起一个本地静态服务器:

python3 -m http.server 8000
# 访问 http://localhost:8000

Three.js 通过 jsDelivr CDN 加载,首次打开 3D 场景需要联网。

快捷键

按键 作用
T 切换 2D / 3D
V / M / X 选择 / 测量 / 拆改墙体
R / Shift+R 选中家具顺时针 / 逆时针旋转 90°
Delete / Backspace 删除选中家具
Ctrl/⌘ + D 复制选中家具
Ctrl/⌘ + Z,Ctrl/⌘ + Shift + Z 撤销,重做
F 适应窗口
+ / - 放大 / 缩小
[ / ] 展开 / 收起左侧家具库、右侧面板
Shift + F 全屏
Esc 取消当前操作
漫游:WASD / 方向键,Shift,E 移动,快走,开关门

技术栈

自定义户型

户型数据写在 index.html 里:

改这些数据就能换成自己的户型。

floorplan-3d (wy51ai/floorplan-3d)

i18n
Searching Database…

What is this?A pure front-end floor plan and interior design tool: you lay out furniture, knock down or add walls, and measure dimensions on a 2D plan, then flip to a Three.js 3D scene for a bird's-eye view or a first-person walkthrough.
Is this a web app I install, or just a file I open?It is a single static HTML file with zero build steps - the whole app is 'index.html', so opening it in any browser is enough to use it.
How do I get it running?Open 'index.html' directly in your browser, or serve the folder from any local static server if you'd rather not use the file:// protocol.
Do I need a framework or build tools to work with the code?No - it's plain HTML, CSS and JavaScript with no framework and no build step; the only external piece is Three.js r160, loaded via a CDN.
Can I load my own floor plan, or only the built-in demo?There's no import wizard for arbitrary house shapes - you customize it by editing the ROOMS, WALLS/WINS, MATS and LIB data objects right inside 'index.html' to swap in your own layout and furniture.
Does it work completely offline?Mostly - your plan autosaves locally - but Three.js itself is fetched from the jsDelivr CDN, so you need internet access the first time you open the 3D scene.
Where does my design data go?Nowhere but your own browser - the whole app saves its state in localStorage, with no server involved.
How much furniture does the library include?Over 60 pieces spanning bedroom, living room, dining/kitchen, bathroom, appliance, and study/leisure categories, all draggable from the left-side library panel.
Can I export or share my design?Yes - you can export the plan as a PNG image, or export/import the full plan as JSON to move it between browsers or machines.
Does it support languages other than Chinese?Yes, a Chinese/English toggle sits in the top bar - it defaults to Chinese and remembers whichever language you pick.
What's the first-person walkthrough mode like?You move with WASD plus the mouse on desktop (a virtual joystick on touch devices), can sprint with Shift, and can click doors to open or close them as you explore.
Creator
wy51ai
Size
<0.1 MB
Stars
2.4K
Updated
CommitOct 02
Age
19d
Commits · 90 Days