refactor: Update color scheme for Floor and Zone components; enhance snapping logic in ReferenceFloor and ReferenceZone

This commit is contained in:
2025-06-30 12:54:25 +05:30
parent 7124a819b6
commit 943ad3ba49
7 changed files with 13 additions and 8 deletions

View File

@@ -36,7 +36,7 @@ function Floor2DInstance({ floor }: { floor: Floor }) {
userData={floor}
>
<meshBasicMaterial
color={savedTheme === "dark" ? "#d2baff" : "#6f42c1"}
color={savedTheme === "dark" ? "#808080" : "#808080"}
side={DoubleSide}
transparent
opacity={0.4}

View File

@@ -25,7 +25,7 @@ function ReferenceFloor({ tempPoints }: Readonly<ReferenceFloorProps>) {
const [currentPosition, setCurrentPosition] = useState<[number, number, number]>(tempPoints[0]?.position);
const directionalSnap = useDirectionalSnapping(currentPosition, tempPoints[tempPoints.length - 1]?.position || null);
const { snapFloorPoint } = usePointSnapping({ uuid: 'temp-floor', pointType: 'Floor', position: directionalSnap.position || [0, 0, 0], });
const { snapFloorPoint } = usePointSnapping({ uuid: 'temp-Floor', pointType: 'Floor', position: directionalSnap.position || [0, 0, 0], });
useFrame(() => {
if (toolMode === 'Floor' && toggleView && tempPoints.length > 0) {
@@ -36,7 +36,7 @@ function ReferenceFloor({ tempPoints }: Readonly<ReferenceFloorProps>) {
setCurrentPosition([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z]);
if (!intersectionPoint) return;
const snapped = snapFloorPoint([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z], [tempPoints[0]]);
const snapped = snapFloorPoint([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z], tempPoints.length > 2 ? [tempPoints[0]] : []);
if (snapped.isSnapped && snapped.snappedPoint) {
finalPosition.current = snapped.position;
@@ -158,7 +158,7 @@ function Floor({ floor }: { floor: Point[] }) {
position={[0, 0, 0]}
receiveShadow
>
<meshStandardMaterial color={savedTheme === "dark" ? "#d2baff" : "#6f42c1"} depthWrite={false} transparent opacity={0.3} side={THREE.DoubleSide} />
<meshStandardMaterial color={savedTheme === "dark" ? "#808080" : "#808080"} depthWrite={false} transparent opacity={0.3} side={THREE.DoubleSide} />
</Extrude>
</group>
);