项目简介
Pascal Editor 是一个基于 Web 的 3D 建筑编辑器,使用 React Three Fiber 和 WebGPU 构建。用户可以创建、编辑和分享建筑设计方案,支持节点化场景图和实时渲染。
README 预览
# Pascal Editor\n\nA 3D building editor built with React Three Fiber and WebGPU.\n\n[](LICENSE)\n[](https://www.npmjs.com/package/@pascal-app/core)\n[](https://www.npmjs.com/package/@pascal-app/viewer)\n[](https://discord.gg/SaBRA9t2)\n[](https://x.com/pascal_app)\n\nhttps://github.com/user-attachments/assets/8b50e7cf-cebe-4579-9cf3-8786b35f7b6b\n\n\n\n## Repository Architecture\n\nThis is a Turborepo monorepo with three main packages:\n\n```\neditor-v2/\n├── apps/\n│ └── editor/ # Next.js application\n├── packages/\n│ ├── core/ # Schema definitions, state management, systems\n│ └── viewer/ # 3D rendering components\n```\n\n### Separation of Concerns\n\n| Package | Responsibility |\n|---------|---------------|\n| **@pascal-app/core** | Node schemas, scene state (Zustand), systems (geometry generation), spatial queries, event bus |\n| **@pascal-app/viewer** | 3D rendering via React Three Fiber, default camera/controls, post-processing |\n| **apps/editor** | UI components, tools, custom behaviors, editor-specific systems |\n\nThe **viewer** renders the scene with sensible defaults. The **editor** extends it with interactive tools, selection management, and editing capabilities.\n\n### Stores\n\nEach package has its own Zustand store for managing state:\n\n| Store | Package | Responsibility |\n|-------|---------|----------------|\n| `useScene` | `@pascal-app/core` | Scene data: nodes, root IDs, dirty nodes, CRUD operations. Persisted to IndexedDB with undo/redo via Zundo. |\n| `useViewer` | `@pascal-app/viewer` | Viewer state: current selection (building/level/zone IDs), level display mode (stacked/exploded/solo), camera mode. |\n| `useEditor` | `apps/editor` | Editor state: active tool, structure layer visibility, panel states, editor-specific preferences. |\n\n**Access patterns:**\n\n```typescript\n// Subscribe to state changes (React component)\nconst nodes = useScene((state) => state.nodes)\nconst levelId = useViewer((state) => st
常见问题 (1)
故障排除在使用 Bun 在 Apple Silicon 上运行 Next.js 时,如何修复 'CPU doesn't support the bmi2 instructions' 恐慌和 'Cannot find module lightningcss.darwin-x64.node' 错误?
故障排除
在使用 Bun 在 Apple Silicon 上运行 Next.js 时,如何修复 'CPU doesn't support the bmi2 instructions' 恐慌和 'Cannot find module lightningcss.darwin-x64.node' 错误?1. 将 Next.js 升级至版本 16.2.2 或更高,以解决 qfilter BMI2 panic 问题。2. 对于 lightningcss 架构不匹配问题,使用 bun --bun run dev 而非 bun run dev 启动开发服务器,强制 Bun 使用 arm64 的正确原生模块。若问题持续存在,请确保已安装 Bun 1.3.12+ 版本,且 Bun 和 Shell 均以原生 arm64 模式运行(非 Rosetta 下),并在执行 bun install 前删除 .next 和 node_modules 目录进行全新安装。