This commit is contained in:
2025-06-23 09:37:53 +05:30
parent 2fbdf8ab61
commit 54b02541c1
278 changed files with 10134 additions and 7904 deletions

View File

@@ -4,13 +4,11 @@ import WallInstance from './instance/wallInstance';
import Line from '../../line/line';
import Point from '../../point/point';
import { useToggleView } from '../../../../store/builder/store';
import { Base, Geometry, Subtraction } from '@react-three/csg';
import { BoxGeometry } from 'three';
import { Geometry } from '@react-three/csg';
function WallInstances() {
const { walls } = useWallStore();
const { toggleView } = useToggleView();
const ref = useRef<any>();
useEffect(() => {
// console.log('walls: ', walls);
@@ -34,26 +32,25 @@ function WallInstances() {
return (
<>
<group name='Walls-Group' ref={ref}>
<Geometry computeVertexNormals>
{walls.map((wall) => (
<WallInstance key={wall.wallUuid} wall={wall} />
))}
{!toggleView && (
{/* <Base geometry={new BoxGeometry()} >
<meshStandardMaterial />
</Base>
<mesh name='Walls-Group'>
{/* <Base name="base" geometry={box} scale={[3, 3, 3]} /> */}
<Geometry>
<Subtraction scale={[5, 11, 5]} >
<Geometry>
<Base geometry={new BoxGeometry()} />
</Geometry>
</Subtraction>
</Geometry> */}
</Geometry>
</group>
<Geometry useGroups>
{walls.map((wall) => (
<WallInstance key={wall.wallUuid} wall={wall} />
))}
</Geometry>
{/* <Subtraction rotation={[0, Math.PI / 2, 0]} position={[-1.425, -0.45, 0]} scale={[1, 3, 1]}>
<Geometry>
<Base geometry={box} />
</Geometry>
</Subtraction> */}
</mesh>
)}
{toggleView && (
<>
@@ -76,4 +73,4 @@ function WallInstances() {
)
}
export default WallInstances
export default WallInstances