Skip to content

快速开始

一分钟内启动这个仿真项目。

快速启动

bash
git clone https://github.com/AICL-Lab/particle-fluid-sim.git
cd particle-fluid-sim
npm install
npm run dev

在支持 WebGPU 的浏览器中打开 http://localhost:5173

环境要求

  • Node.js: 18+
  • 浏览器: Chrome 113+、Edge 113+ 或 Safari 17+

Firefox: WebGPU 仍属实验特性,需要在 about:config 中启用 dom.webgpu.enabled

交互方式

操作效果
移动鼠标排斥附近粒子
触摸移动端同样可交互
调整窗口重新计算画布尺寸与 HiDPI 缩放

开发命令

bash
npm run dev
npm run build
npm run preview
npm run lint
npm run typecheck
npm run test:coverage
npm run verify

项目结构

text
particle-fluid-sim/
├── src/
│   ├── config/       # 仿真常量
│   ├── core/         # 运行时模块与测试
│   └── shaders/      # WGSL 着色器资源
├── docs/             # VitePress 文档与架构说明
├── .github/          # CI、Pages、Issue/PR 模板
└── CHANGELOG.md      # 项目唯一变更日志

后续阅读

Built with VitePress