refactor: Update color scheme for Floor and Zone components; enhance snapping logic in ReferenceFloor and ReferenceZone
This commit is contained in:
@@ -36,7 +36,7 @@ function Zone2DInstance({ zone }: { zone: Zone }) {
|
||||
userData={zone}
|
||||
>
|
||||
<meshBasicMaterial
|
||||
color={savedTheme === "dark" ? "green" : "green"}
|
||||
color={savedTheme === "dark" ? "#007BFF" : "#007BFF"}
|
||||
side={DoubleSide}
|
||||
transparent
|
||||
opacity={0.4}
|
||||
|
||||
@@ -13,6 +13,10 @@ function ZoneInstances() {
|
||||
const { zones } = zoneStore();
|
||||
const { toggleView } = useToggleView();
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('zones: ', zones);
|
||||
}, [zones])
|
||||
|
||||
const allPoints = useMemo(() => {
|
||||
const points: Point[] = [];
|
||||
const seenUuids = new Set<string>();
|
||||
|
||||
@@ -36,7 +36,7 @@ function ReferenceZone({ tempPoints }: Readonly<ReferenceZoneProps>) {
|
||||
setCurrentPosition([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z]);
|
||||
|
||||
if (!intersectionPoint) return;
|
||||
const snapped = snapZonePoint([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z], [tempPoints[0]]);
|
||||
const snapped = snapZonePoint([intersectionPoint.x, intersectionPoint.y, intersectionPoint.z], tempPoints.length > 2 ? [tempPoints[0]] : []);
|
||||
|
||||
if (snapped.isSnapped && snapped.snappedPoint) {
|
||||
finalPosition.current = snapped.position;
|
||||
@@ -156,7 +156,7 @@ function Zone({ zone }: { zone: 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" ? "#007BFF" : "#007BFF"} depthWrite={false} transparent opacity={0.3} side={THREE.DoubleSide} />
|
||||
</Extrude>
|
||||
</group>
|
||||
);
|
||||
|
||||
@@ -29,6 +29,7 @@ function ZoneGroup() {
|
||||
useEffect(() => {
|
||||
if (projectId && selectedVersion) {
|
||||
getZonesApi(projectId, selectedVersion?.versionId || '').then((zones) => {
|
||||
console.log('zones: ', zones);
|
||||
if (zones && zones.length > 0) {
|
||||
setZones(zones);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user