pascal-editor

使用 Pascal Editor 的架构(基于 React Three Fiber 与 Zustand 的场景图)构建和扩展 3D 建筑编辑器应用。适用于开发 3D 建筑工具、创建类似 BIM 的编辑器、为 Pascal Editor 添加自定义功能或构建平面图生成器。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "pascal-editor":https://skillpi.com/zh/skills/deepskill-a0278d2a6fedd2b7f80711210f0d588660227e60de94d5791440a07942d9eb1e。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用 Pascal Editor 的架构(基于 React Three Fiber 与 Zustand 的场景图)构建和扩展 3D 建筑编辑器应用。适用于开发 3D 建筑工具、创建类似 BIM 的编辑器、为 Pascal Editor 添加自定义功能或构建平面图生成器。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: pascal-editor
description: >-
  Build and extend 3D building editor apps using Pascal Editor's architecture (React Three Fiber
  + Zustand scene graph). Use when: building 3D architectural tools, creating BIM-like editors,
  extending Pascal Editor with custom features, building floor plan generators.
license: MIT
compatibility: "Node.js 18+, React 18+"
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: design
  tags: [pascal-editor, 3d, react-three-fiber, architecture, bim]

Pascal Editor Integration

Overview

Pascal Editor (pascalorg/editor) is an open-source 3D building editor built with React Three Fiber and WebGPU. It provides a node-based scene graph, Zustand state management, and a systems architecture ideal for AI-driven architectural generation. This skill covers the core API for creating, manipulating, and exporting building geometry.

Instructions

Quick Start

npx create-next-app@latest my-building-app
cd my-building-app
npm install @pascal-app/core @pascal-app/ui @react-three/fiber @react-three/drei three zustand

Node Hierarchy

Pascal uses a tree of typed nodes:

Site -> Building -> Level -> Wall -> Opening (door/window)
                          -> Slab (floor/ceiling)
                          -> Zone (room boundary)
                          -> Item (furniture, fixture)

Every node has: id (UUID), type, parentId, children (child IDs), props (type-specific), and dirty (marks for rebuild).

Zustand Stores

import { useScene, useViewer, useEditor } from '@pascal-app/core'

// useScene -- scene graph (nodes, relations)
const { nodes, createNode, updateNode, deleteNode } = useScene()

// useViewer -- viewport state (camera, selection)
const { selectedIds, camera, setSelection } = useViewer()

// useEditor -- tool mode and UI state
const { activeTool, setTool, history } = useEditor()

Creating Walls with Openings

const scene = useScene.getState()

// Exterior wall: 4.5m long, 200mm thick, 2.7m ceiling
const wall = await scene.createNode({
  type: 'wall',
  props: {
    start: { x: 0, y: 0 }, end: { x: 4.5, y: 0 },
    thickness: 0.20, height: 2.7,
    isExterior: true, material: 'masonry',
  }
}, levelId)

// Add a window: 1.2m wide, sill at 900mm
await scene.createNode({
  type: 'item',
  props: {
    itemType: 'window', wallId: wall.id,
    offsetFromStart: 1.5, width: 1.2, height: 1.2, sillHeight: 0.9,
  }
}, wall.id)

// Add a door: 900mm wide
await scene.createNode({
  type: 'item',
  props: {
    itemType: 'door', wallId: wall.id,
    offsetFromStart: 3.0, width: 0.9, height: 2.1, sillHeight: 0,
  }
}, wall.id)

Creating Levels and Rooms

const level = await scene.createNode({
  type: 'level',
  props: { name: 'Ground Floor', elevation: 0, height: 2.7, index: 0 }
}, buildingId)

// Floor slab
await scene.createNode({
  type: 'slab',
  props: {
    polygon: [{ x: 0, y: 0 }, { x: 10, y: 0 }, { x: 10, y: 8 }, { x: 0, y: 8 }],
    thickness: 0.25, isRoof: false,
  }
}, level.id)

// Room zone for labeling and area calculation
await scene.createNode({
  type: 'zone',
  props: {
    name: 'Living Room', roomType: 'living',
    polygon: [{ x: 0.1, y: 0.1 }, { x: 5.4, y: 0.1 }, { x: 5.4, y: 7.9 }, { x: 0.1, y: 7.9 }],
  }
}, level.id)

Exporting Scene to JSON

function exportScene(): BuildingExport {
  const { nodes } = useScene.getState()
  const allNodes = Object.values(nodes)
  const site = allNodes.find(n => n.type === 'site')
  const building = allNodes.find(n => n.type === 'building')
  const levels = allNodes
    .filter(n => n.type === 'level' && n.parentId === building.id)
    .sort((a, b) => a.props.elevation - b.props.elevation)

  return {
    units: 'meters',
    site: { width: site.props.width, depth: site.props.depth },
    building: {
      levels: levels.map(level => ({
        name: level.props.name,
        elevation: level.props.elevation,
        height: level.props.height,
        walls: getChildrenByType(level.id, 'wall', allNodes),
        rooms: getChildrenByType(level.id, 'zone', allNodes),
      }))
    }
  }
}

Rendering with React Three Fiber

import { Canvas } from '@react-three/fiber'
import { PascalScene, PascalCamera, PascalControls } from '@pascal-app/ui'

export function BuildingViewer() {
  return (
    <Canvas camera={{ position: [0, 20, 20], fov: 45 }}>
      <PascalScene />
      <PascalCamera />
      <PascalControls />
      <ambientLight intensity={0.5} />
      <directionalLight position={[10, 20, 10]} castShadow />
    </Canvas>
  )
}

Grid Snapping

Pascal uses a 100 mm grid (0.1 m) by default:

const snapToGrid = (value: number, gridSize = 0.1) =>
  Math.round(value / gridSize) * gridSize

Examples

Example 1: Build a 10m x 8m Ground Floor

Create a complete ground floor with exterior walls, an interior partition dividing living from bedrooms, and appropriate openings:

  1. Create level node with elevation 0, height 2.7 m
  2. Create floor slab: 10 m x 8 m polygon, 0.25 m thick
  3. Create 4 exterior walls (0.20 m thick, masonry): north (10 m), east (8 m), south (10 m), west (8 m)
  4. Add interior partition at x=5.5 (0.10 m thick, timber) running full depth
  5. Add entry door on north wall: 1.0 m x 2.1 m at offset 3.5 m
  6. Add windows on east wall: two 1.2 m x 1.2 m at sill 0.9 m, offsets 1.2 m and 4.5 m
  7. Create zones: Living Room (5.3 m x 7.8 m = 41.3 m2), Bedroom area (4.3 m x 7.8 m = 33.5 m2)
  8. Export to JSON for validation against architectural-dimensions rules

Example 2: Register a Custom Validation System

Create a system that checks wall thickness whenever a wall node changes:

import { registerSystem, useScene } from '@pascal-app/core'

registerSystem({
  name: 'wall-validator',
  nodeTypes: ['wall'],
  priority: 100,
  process(dirtyNodes) {
    for (const node of dirtyNodes) {
      const { thickness, isExterior, height } = node.props
      if (isExterior && thickness < 0.14)
        console.warn(`Wall ${node.id}: exterior ${thickness}m < 0.14m minimum`)
      if (height < 2.1)
        console.warn(`Wall ${node.id}: height ${height}m < 2.1m minimum`)
    }
  }
})

This runs automatically whenever wall nodes are marked dirty, before geometry systems rebuild meshes.

Guidelines

  • All dimensions are in meters -- Pascal uses metric internally
  • Use useScene for all node CRUD operations, useViewer for selection/camera, useEditor for tools
  • Snap coordinates to 0.1 m grid for clean geometry
  • Wall thickness: 0.20 m for exterior, 0.10 m for interior partitions
  • Door sill height is always 0 (floor level); window sill height defaults to 0.9 m
  • Register custom systems with priority > 50 to run before geometry rebuild (0-50)
  • Combine with architectural-dimensions skill for real-world measurement validation
  • Key packages: @pascal-app/core, @pascal-app/ui, @react-three/fiber, three, zustand
  • GitHub: github.com/pascalorg/editor

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 提供完整的 3D 建筑编辑器开发架构,包含节点系统、状态管理和渲染方案
  • 面向专业 BIM 和建筑工具开发场景,具有明确的技术价值
  • 包含端到端示例和自定义系统注册机制,实用性强
触发精准95/100

亮点

  • 触发词精准覆盖核心功能(pascal-editor, 3d, react-three-fiber, architecture, bim)
  • 适用场景描述清晰,边界明确,不易误触
结构规范95/100

亮点

  • 文档结构完整,包含 Quick Start、API 说明、示例和 Guidelines
  • frontmatter 信息齐全,单文件长度合理
  • 提供两个完整示例,涵盖基础构建和自定义系统开发
执行可靠90/100

亮点

  • 依赖包来源明确,参数设计合理
  • 内置验证系统处理异常情况,支持历史记录和撤销
  • 提供导出和外部验证集成机制
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 27, 29 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。