fix: improve ceiling handle feedback and WebGPU placeholders

This commit is contained in:
Aymeric Rabot
2026-06-09 14:49:42 -04:00
parent 8ce26154d9
commit 265acdb2be
11 changed files with 661 additions and 55 deletions
+19 -6
View File
@@ -15,8 +15,15 @@ import {
useNodeEvents,
useViewer,
} from '@pascal-app/viewer'
import { useMemo, useRef } from 'react'
import { BufferGeometry, Float32BufferAttribute, type Group, Path, Shape } from 'three'
import { useEffect, useMemo, useRef } from 'react'
import {
BufferGeometry,
Float32BufferAttribute,
type Group,
Path,
Shape,
ShapeGeometry,
} from 'three'
import { MeshLambertNodeMaterial } from 'three/webgpu'
const Y_OFFSET = 0.01
@@ -134,6 +141,13 @@ export const SiteRenderer = ({ node }: { node: SiteNode }) => {
if (!polygonPoints || polygonPoints.length < 2) return null
return createBoundaryLineGeometry(polygonPoints)
}, [polygonPoints])
useEffect(() => () => lineGeometry?.dispose(), [lineGeometry])
const groundGeometry = useMemo(() => {
if (!groundShape) return null
return new ShapeGeometry(groundShape)
}, [groundShape])
useEffect(() => () => groundGeometry?.dispose(), [groundGeometry])
const handlers = useNodeEvents(node, 'site')
@@ -149,15 +163,14 @@ export const SiteRenderer = ({ node }: { node: SiteNode }) => {
))}
{/* Ground fill: site polygon with slab holes, occludes below-grade geometry */}
{groundShape && (
{groundGeometry && (
<mesh
geometry={groundGeometry}
material={groundMaterial}
position={[0, -0.05, 0]}
receiveShadow
rotation={[-Math.PI / 2, 0, 0]}
>
<shapeGeometry args={[groundShape]} />
</mesh>
/>
)}
{/* Simple boundary line */}