From 1467325475fc348b96a67cf97876049718699b40 Mon Sep 17 00:00:00 2001 From: wass08 Date: Tue, 10 Feb 2026 14:20:40 +0900 Subject: [PATCH] reduce warning csg lib --- packages/core/src/systems/wall/wall-system.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core/src/systems/wall/wall-system.tsx b/packages/core/src/systems/wall/wall-system.tsx index 1b7394be..133f3d1f 100644 --- a/packages/core/src/systems/wall/wall-system.tsx +++ b/packages/core/src/systems/wall/wall-system.tsx @@ -1,5 +1,6 @@ import { useFrame } from '@react-three/fiber' import * as THREE from 'three' +import { computeBoundsTree } from 'three-mesh-bvh' import { Brush, Evaluator, SUBTRACTION } from 'three-bvh-csg' import { sceneRegistry } from '../../hooks/scene-registry/scene-registry' import { spatialGridManager } from '../../hooks/spatial-grid/spatial-grid-manager' @@ -260,6 +261,10 @@ export function generateExtrudedWall( } // Create wall brush from geometry + // Pre-compute BVH with new API to avoid deprecation warning + geometry.computeBoundsTree = computeBoundsTree + geometry.computeBoundsTree({ maxLeafSize: 10 }) + const wallBrush = new Brush(geometry) wallBrush.updateMatrixWorld() @@ -350,6 +355,10 @@ function collectCutoutBrushes( 0, // Center on Z axis (wall thickness direction) ) + // Pre-compute BVH with new API to avoid deprecation warning + boxGeo.computeBoundsTree = computeBoundsTree + boxGeo.computeBoundsTree({ maxLeafSize: 10 }) + const brush = new Brush(boxGeo) brushes.push(brush) }