-
- {activeSubTool == "cursor" && (
-
{
- setActiveTool("cursor");
- }}
- >
-
cursor (v)
-
-
- )}
- {activeSubTool == "free-hand" && (
-
{
- setActiveTool("free-hand");
- }}
- >
-
free hand (h)
-
-
- )}
- {activeSubTool == "delete" && (
-
{
- setActiveTool("delete");
- }}
- >
-
delete (x)
-
-
- )}
- {activeModule !== "visualization" && (
-
{
- setOpenDrop(!openDrop);
- }}
- >
-
- {openDrop && (
-
-
{
- setOpenDrop(false);
- setActiveTool("cursor");
- setActiveSubTool("cursor");
- }}
- >
-
- {activeSubTool === "cursor" && }
-
-
-
Cursor
-
-
{
- setOpenDrop(false);
- setActiveTool("free-hand");
- setActiveSubTool("free-hand");
- }}
- >
-
- {activeSubTool === "free-hand" && }
-
-
-
Free Hand
-
-
{
- setOpenDrop(false);
- setActiveTool("delete");
- setActiveSubTool("delete");
- }}
- >
-
- {activeSubTool === "delete" && }
-
-
-
Delete
-
+
+
+ {/* Tool Picker (cursor, delete, etc.) */}
+ {["cursor", "free-hand", "delete"].map(
+ (tool) =>
+ activeSubTool === tool && (
+
setActiveTool(tool)}
+ />
+ )
+ )}
+ {/* Dropdown Menu */}
+ {activeModule !== "visualization" && (
+
-
- {!toggleThreeD && activeModule === "builder" && (
- <>
-
-
-
{
- setActiveTool("draw-wall");
- }}
- >
-
draw wall (q)
-
-
-
{
- setActiveTool("draw-zone");
- }}
- >
-
draw zone (e)
-
-
-
{
- setActiveTool("draw-aisle");
- }}
- >
-
draw asile (r)
-
-
-
{
- setActiveTool("draw-floor");
- }}
- >
-
draw floor (t)
-
-
-
- >
- )}
- {activeModule === "builder" && (
- <>
-
-
-
{
- setActiveTool("measure");
- }}
- >
-
measure scale (m)
-
-
-
- >
- )}
- {activeModule === "simulation" && (
- <>
-
-
-
{
- setActiveTool("pen");
- }}
- >
-
pen
-
-
-
- >
- )}
- {activeModule === "visualization" && (
- <>
-
-
-
{
- handleSaveTemplate({
- addTemplate,
- floatingWidget,
- widgets3D,
- selectedZone,
- templates,
- visualizationSocket,
- });
- }}
- >
-
save template
-
-
-
- >
- )}
-
-
-
{
- setActiveTool("comment");
- }}
- >
-
comment
-
-
- {toggleThreeD && (
-
{
- setIsPlaying(!isPlaying);
- }}
- >
-
play (ctrl + p)
-
+ {getIconComponent(option)}
+
{option}
+
+ ))}
)}
-
- {activeModule === "builder" && (
- <>
-
-
-
toggle view (tab)
-
- 2d
-
-
- 3d
-
-
- >
- )}
-
- ) : (
+
+ )}
+
+
+
+ {activeModule === "builder" && renderBuilderTools()}
+ {activeModule === "simulation" && renderSimulationTools()}
+ {activeModule === "visualization" && renderVisualizationTools()}
+
+
+
+ setActiveTool("comment")}
+ />
+ {toggleThreeD && (
+ setIsPlaying(!isPlaying)}
+ />
+ )}
+
+
+ {activeModule === "builder" && (
<>
- {activeModule !== "simulation" && (
-
setIsPlaying(false)}>
- X
-
- )}
+
+ {renderModeSwitcher()}
>
)}
- >
+
);
};
+// Extracted common store logic
+const useStoreHooks = () => {
+ return {
+ ...useActiveTool(),
+ ...useToolMode(),
+ ...useDeleteTool(),
+ ...useAddAction(),
+ ...useTransformMode(),
+ ...useDeletePointOrLine(),
+ ...useRefTextUpdate(),
+ };
+};
+
export default Tools;
diff --git a/app/src/modules/builder/builder.tsx b/app/src/modules/builder/builder.tsx
index dfae129..4c8b1d7 100644
--- a/app/src/modules/builder/builder.tsx
+++ b/app/src/modules/builder/builder.tsx
@@ -11,9 +11,9 @@ import ReferenceDistanceText from "./geomentries/lines/distanceText/referenceDis
////////// Assests Imports //////////
-import arch from "../../assets/gltf-glb/arch.glb";
-import door from "../../assets/gltf-glb/door.glb";
-import Window from "../../assets/gltf-glb/window.glb";
+// import arch from "../../assets/gltf-glb/arch.glb";
+// import door from "../../assets/gltf-glb/door.glb";
+// import Window from "../../assets/gltf-glb/window.glb";
////////// Zustand State Imports //////////
@@ -129,30 +129,30 @@ export default function Builder() {
////////// Assest Configuration Values //////////
const AssetConfigurations: Types.AssetConfigurations = {
- arch: {
- modelUrl: arch,
- scale: [0.75, 0.75, 0.75],
- csgscale: [2, 4, 0.5],
- csgposition: [0, 2, 0],
- positionY: () => 0,
- type: "Fixed-Move",
- },
- door: {
- modelUrl: door,
- scale: [0.75, 0.75, 0.75],
- csgscale: [2, 4, 0.5],
- csgposition: [0, 2, 0],
- positionY: () => 0,
- type: "Fixed-Move",
- },
- window: {
- modelUrl: Window,
- scale: [0.75, 0.75, 0.75],
- csgscale: [5, 3, 0.5],
- csgposition: [0, 1.5, 0],
- positionY: (intersectionPoint) => intersectionPoint.point.y,
- type: "Free-Move",
- },
+ // arch: {
+ // modelUrl: arch,
+ // scale: [0.75, 0.75, 0.75],
+ // csgscale: [2, 4, 0.5],
+ // csgposition: [0, 2, 0],
+ // positionY: () => 0,
+ // type: "Fixed-Move",
+ // },
+ // door: {
+ // modelUrl: door,
+ // scale: [0.75, 0.75, 0.75],
+ // csgscale: [2, 4, 0.5],
+ // csgposition: [0, 2, 0],
+ // positionY: () => 0,
+ // type: "Fixed-Move",
+ // },
+ // window: {
+ // modelUrl: Window,
+ // scale: [0.75, 0.75, 0.75],
+ // csgscale: [5, 3, 0.5],
+ // csgposition: [0, 1.5, 0],
+ // positionY: (intersectionPoint) => intersectionPoint.point.y,
+ // type: "Free-Move",
+ // },
};
////////// All Toggle's //////////
diff --git a/app/src/modules/scene/setup/setup.tsx b/app/src/modules/scene/setup/setup.tsx
index 34289f9..660264b 100644
--- a/app/src/modules/scene/setup/setup.tsx
+++ b/app/src/modules/scene/setup/setup.tsx
@@ -4,7 +4,7 @@ import PostProcessing from '../postProcessing/postProcessing'
import Controls from '../controls/controls';
import { Environment } from '@react-three/drei'
-import background from "../../../assets/hdr/mudroadpuresky2k.hdr";
+import background from "../../../assets/textures/hdr/mudroadpuresky2k.hdr";
function Setup() {
return (
diff --git a/app/src/modules/simulation/materials/instances/material/materialModel.tsx b/app/src/modules/simulation/materials/instances/material/materialModel.tsx
index 244c7bf..d8f5fe9 100644
--- a/app/src/modules/simulation/materials/instances/material/materialModel.tsx
+++ b/app/src/modules/simulation/materials/instances/material/materialModel.tsx
@@ -2,10 +2,10 @@ import { useGLTF } from '@react-three/drei'
import { useMemo } from 'react';
import * as THREE from 'three';
-import defaultMaterial from '../../../../../assets/gltf-glb/default.glb';
-import material1 from '../../../../../assets/gltf-glb/material1.glb';
-import material2 from '../../../../../assets/gltf-glb/material2.glb';
-import material3 from '../../../../../assets/gltf-glb/material3.glb';
+import defaultMaterial from '../../../../../assets/gltf-glb/materials/default.glb';
+import material1 from '../../../../../assets/gltf-glb/materials/material1.glb';
+import material2 from '../../../../../assets/gltf-glb/materials/material2.glb';
+import material3 from '../../../../../assets/gltf-glb/materials/material3.glb';
const modelPaths: Record
= {
'Default material': defaultMaterial,
diff --git a/app/src/modules/simulation/spatialUI/arm/armBotUI.tsx b/app/src/modules/simulation/spatialUI/arm/armBotUI.tsx
index 55e511a..3bc2a92 100644
--- a/app/src/modules/simulation/spatialUI/arm/armBotUI.tsx
+++ b/app/src/modules/simulation/spatialUI/arm/armBotUI.tsx
@@ -8,8 +8,8 @@ import PickDropPoints from './PickDropPoints';
import useDraggableGLTF from './useDraggableGLTF';
import * as THREE from 'three';
-import armPick from "../../../../assets/gltf-glb/arm_ui_pick.glb";
-import armDrop from "../../../../assets/gltf-glb/arm_ui_drop.glb";
+import armPick from "../../../../assets/gltf-glb/ui/arm_ui_pick.glb";
+import armDrop from "../../../../assets/gltf-glb/ui/arm_ui_drop.glb";
import { upsertProductOrEventApi } from '../../../../services/simulation/UpsertProductOrEventApi';
type Positions = {
diff --git a/app/src/modules/simulation/spatialUI/vehicle/vehicleUI.tsx b/app/src/modules/simulation/spatialUI/vehicle/vehicleUI.tsx
index bb690d4..300c55c 100644
--- a/app/src/modules/simulation/spatialUI/vehicle/vehicleUI.tsx
+++ b/app/src/modules/simulation/spatialUI/vehicle/vehicleUI.tsx
@@ -1,7 +1,5 @@
import { useEffect, useRef, useState } from "react";
import * as Types from "../../../../types/world/worldTypes";
-import startPoint from "../../../../assets/gltf-glb/arrow_green.glb";
-import startEnd from "../../../../assets/gltf-glb/arrow_red.glb";
import { useGLTF } from "@react-three/drei";
import { useFrame, useThree } from "@react-three/fiber";
import {
@@ -15,6 +13,9 @@ import { useProductStore } from "../../../../store/simulation/useProductStore";
import { upsertProductOrEventApi } from "../../../../services/simulation/UpsertProductOrEventApi";
import { DoubleSide, Group, Plane, Vector3 } from "three";
+import startPoint from "../../../../assets/gltf-glb/ui/arrow_green.glb";
+import startEnd from "../../../../assets/gltf-glb/ui/arrow_red.glb";
+
const VehicleUI = () => {
const { scene: startScene } = useGLTF(startPoint) as any;
const { scene: endScene } = useGLTF(startEnd) as any;