diff --git a/app/src/modules/builder/wall/Instances/instance/helpers/useWallClassification.ts b/app/src/modules/builder/wall/Instances/instance/helpers/useWallClassification.ts index 5ae9a21..00b7eaa 100644 --- a/app/src/modules/builder/wall/Instances/instance/helpers/useWallClassification.ts +++ b/app/src/modules/builder/wall/Instances/instance/helpers/useWallClassification.ts @@ -120,6 +120,7 @@ export function useWallClassification(walls: Walls) { } }); + console.log('rooms: ', rooms); return rooms; }; diff --git a/app/src/modules/builder/wall/Instances/instance/wall.tsx b/app/src/modules/builder/wall/Instances/instance/wall.tsx index a888a67..a6c5787 100644 --- a/app/src/modules/builder/wall/Instances/instance/wall.tsx +++ b/app/src/modules/builder/wall/Instances/instance/wall.tsx @@ -54,12 +54,11 @@ function Wall({ wall }: { readonly wall: Wall }) { }, [wallLength, wall.wallHeight]); const materials = useMemo(() => { - return [ - new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide }), // Left - new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide }), // Right - new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide }), // Top - new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide }), // Bottom + new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, visible: visible }), // Left + new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, visible: visible }), // Right + new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, visible: visible }), // Top + new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, visible: visible }), // Bottom new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, @@ -68,7 +67,7 @@ function Wall({ wall }: { readonly wall: Wall }) { new THREE.MeshStandardMaterial({ color: Constants.wallConfig.defaultColor, side: THREE.DoubleSide, - map: wall.outsideMaterial === 'Default Material' ? defaultWallTexture : material1WallTexture, + map: wall.outsideMaterial === 'Default Material`' ? defaultWallTexture : material1WallTexture, }), ]; }, [defaultWallTexture, material1WallTexture, wall]); @@ -94,8 +93,8 @@ function Wall({ wall }: { readonly wall: Wall }) { return ( {materials.map((material, index) => ( - + ))} {wall.decals.map((decal) => { diff --git a/app/src/modules/builder/wall/Instances/wallInstances.tsx b/app/src/modules/builder/wall/Instances/wallInstances.tsx index 82b37ed..21e4819 100644 --- a/app/src/modules/builder/wall/Instances/wallInstances.tsx +++ b/app/src/modules/builder/wall/Instances/wallInstances.tsx @@ -4,14 +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(); - const csg = useRef(); useEffect(() => { // console.log('walls: ', walls); @@ -33,32 +30,27 @@ function WallInstances() { return points; }, [walls]); - - const box = useMemo(() => new BoxGeometry(), []); - return ( <> - - - + {!toggleView && ( - + + {/* */} + {walls.map((wall) => ( ))} - - - - - - - - - + {/* + + + + */} + + )} {toggleView && ( <> diff --git a/app/src/modules/builder/wall/wallCreator/wallCreator.tsx b/app/src/modules/builder/wall/wallCreator/wallCreator.tsx index 53a0f9e..e263571 100644 --- a/app/src/modules/builder/wall/wallCreator/wallCreator.tsx +++ b/app/src/modules/builder/wall/wallCreator/wallCreator.tsx @@ -102,6 +102,28 @@ function WallCreator() { }; if (tempPoints.length === 0) { + const wall2: Wall = { + wallUuid: THREE.MathUtils.generateUUID(), + points: [point1, newPoint], + outsideMaterial: insideMaterial, + insideMaterial: outsideMaterial, + wallThickness: wallThickness, + wallHeight: wallHeight, + decals: [] + } + addWall(wall2); + + const wall3: Wall = { + wallUuid: THREE.MathUtils.generateUUID(), + points: [point2, newPoint], + outsideMaterial: insideMaterial, + insideMaterial: outsideMaterial, + wallThickness: wallThickness, + wallHeight: wallHeight, + decals: [] + } + addWall(wall3); + setTempPoints([newPoint]); setIsCreating(true); } else {