From 3ec68e74a214df545a285de47e4db453ec93ae87 Mon Sep 17 00:00:00 2001 From: Marcos Reifonas Date: Mon, 21 Sep 2026 17:45:40 +0000 Subject: [PATCH] feat(viewer3d): aplicar cores oficiais nos botoes de processo e sincronizar no 3D --- src/components/viewer3d/ModelViewer3D.tsx | 20 +++++++++- src/components/viewer3d/Viewer3DSidebar.tsx | 42 ++++++++++++++------- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/components/viewer3d/ModelViewer3D.tsx b/src/components/viewer3d/ModelViewer3D.tsx index 0964510..e306e02 100644 --- a/src/components/viewer3d/ModelViewer3D.tsx +++ b/src/components/viewer3d/ModelViewer3D.tsx @@ -364,8 +364,24 @@ export const ModelViewer3D: React.FC = ({ 'montagem de obra': 5, }; + const PROCESS_COLOR_MAP: Record = { + 'corte': '#3b82f6', + 'solda': '#f97316', + 'pintura': '#10b981', + 'pintura/galv': '#10b981', + 'pintura/galvanizacao': '#10b981', + 'pintura / galvanizacao': '#10b981', + 'galvanizacao': '#10b981', + 'expedicao': '#06b6d4', + 'expedição': '#06b6d4', + 'montagem': '#6366f1', + 'montagem obra': '#6366f1', + 'montagem de obra': '#6366f1', + }; + const targetProcKey = String(selectedProcess || 'all').toLowerCase(); const targetOrder = PROCESS_ORDER_MAP[targetProcKey] || 0; + const targetColorHex = PROCESS_COLOR_MAP[targetProcKey] || '#22c55e'; let isPointedInTargetProcess = false; if (selectedProcess !== 'all' && prod && prod.pointedQtd > 0) { @@ -389,9 +405,9 @@ export const ModelViewer3D: React.FC = ({ if (selectedProcess !== 'all') { // --- MODO INOVAÇÃO: Destaque por Processo --- if (isPointedInTargetProcess) { - // Peça apontada no processo: SÓLIDO VERDE BRILHANTE + // Peça apontada no processo: SÓLIDO COM A COR CORRESPONDENTE DO PROCESSO mesh.material = new THREE.MeshStandardMaterial({ - color: new THREE.Color('#22c55e'), // Verde Sólido + color: new THREE.Color(targetColorHex), metalness: 0.35, roughness: 0.45, transparent: opacity < 100, diff --git a/src/components/viewer3d/Viewer3DSidebar.tsx b/src/components/viewer3d/Viewer3DSidebar.tsx index e957999..2a3d68c 100644 --- a/src/components/viewer3d/Viewer3DSidebar.tsx +++ b/src/components/viewer3d/Viewer3DSidebar.tsx @@ -37,12 +37,12 @@ interface Viewer3DSidebarProps { } const FABRICATION_PROCESSES = [ - { id: 'all', label: 'Todos', icon: Layers }, - { id: 'Corte', label: 'Corte', icon: Scissors }, - { id: 'Solda', label: 'Solda', icon: Flame }, - { id: 'Pintura', label: 'Pintura', icon: Paintbrush }, - { id: 'Expedicao', label: 'Expedição', icon: Truck }, - { id: 'Montagem', label: 'Montagem', icon: Wrench }, + { id: 'all', label: 'Todos', icon: Layers, color: '#0284c7' }, + { id: 'Corte', label: 'Corte', icon: Scissors, color: '#3b82f6' }, + { id: 'Solda', label: 'Solda', icon: Flame, color: '#f97316' }, + { id: 'Pintura', label: 'Pintura', icon: Paintbrush, color: '#10b981' }, + { id: 'Expedicao', label: 'Expedição', icon: Truck, color: '#06b6d4' }, + { id: 'Montagem', label: 'Montagem', icon: Wrench, color: '#6366f1' }, ]; export const Viewer3DSidebar: React.FC = ({ @@ -86,7 +86,7 @@ export const Viewer3DSidebar: React.FC = ({ {/* Corpo com Rolagem Suave */}
- {/* Grupo 1: Destaque por Processo Industrial (Inovação Híbrida: Verde Sólido + Aramado Cinza Fantasma) */} + {/* Grupo 1: Destaque por Processo Industrial com Cores Correspondentes */}
-
+
{FABRICATION_PROCESSES.map((proc) => { const Icon = proc.icon; const isSelected = selectedProcess === proc.id; @@ -105,15 +105,29 @@ export const Viewer3DSidebar: React.FC = ({ ); })}