wall sides feed with floo fill algorithm

This commit is contained in:
wass08
2026-02-03 12:03:03 +09:00
parent 83ebf8366c
commit a15952055a
6 changed files with 659 additions and 3 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
'use client'
import { initSpatialGridSync, sceneRegistry, useScene } from '@pascal-app/core'
import { initSpatialGridSync, initSpaceDetectionSync, sceneRegistry, useScene } from '@pascal-app/core'
import { useGridEvents, useViewer, Viewer } from '@pascal-app/viewer'
import { useFrame } from '@react-three/fiber'
@@ -10,6 +10,7 @@ import { MathUtils, type Mesh } from 'three'
import { color, float, fract, fwidth, mix, positionLocal } from 'three/tsl'
import { MeshBasicNodeMaterial } from 'three/webgpu'
import { useKeyboard } from '@/hooks/use-keyboard'
import useEditor from '@/store/use-editor'
import { ZoneSystem } from '../systems/zone/zone-system'
import { ToolManager } from '../tools/tool-manager'
import { ActionMenu } from '../ui/action-menu'
@@ -23,6 +24,7 @@ import { SelectionManager } from './selection-manager'
useScene.getState().loadScene()
console.log('Loaded scene in editor')
initSpatialGridSync()
initSpaceDetectionSync(useScene, useEditor)
export default function Editor() {
useKeyboard()
+7 -2
View File
@@ -1,6 +1,6 @@
'use client'
import { type BuildingNode, type ItemNode, type LevelNode, useScene } from '@pascal-app/core'
import { type BuildingNode, type ItemNode, type LevelNode, type Space, useScene } from '@pascal-app/core'
import { useViewer } from '@pascal-app/viewer'
import { create } from 'zustand'
import type { AssetInput } from '@pascal-app/core'
@@ -50,7 +50,7 @@ type EditorState = {
setMode: (mode: Mode) => void
tool: Tool | null
setTool: (tool: Tool | null) => void
structureLayer: StructureLayer
structureLayer: StructureLayer
setStructureLayer: (layer: StructureLayer) => void
catalogCategory: CatalogCategory | null
setCatalogCategory: (category: CatalogCategory | null) => void
@@ -60,6 +60,9 @@ type EditorState = {
setMovingNode: (node: ItemNode | null) => void
selectedReferenceId: string | null
setSelectedReferenceId: (id: string | null) => void
// Space detection for cutaway mode
spaces: Record<string, Space>
setSpaces: (spaces: Record<string, Space>) => void
}
const useEditor = create<EditorState>()((set, get) => ({
@@ -174,6 +177,8 @@ const useEditor = create<EditorState>()((set, get) => ({
setMovingNode: (node) => set({ movingNode: node }),
selectedReferenceId: null,
setSelectedReferenceId: (id) => set({ selectedReferenceId: id }),
spaces: {},
setSpaces: (spaces) => set({ spaces }),
}))
export default useEditor