🚀 Auto-deploy: BrainWind atualizado em 28/07/2026 11:08:28
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
const fs = require('fs');
|
||||
let code = fs.readFileSync('app/src/components/Warehouse3D.tsx', 'utf8');
|
||||
|
||||
// Import AirflowSystem
|
||||
if (!code.includes('AirflowSystem')) {
|
||||
code = code.replace("import { useGalpaoStore } from '../store/galpaoStore';", "import { useGalpaoStore } from '../store/galpaoStore';\nimport { AirflowSystem } from './three/AirflowSystem';");
|
||||
}
|
||||
|
||||
// Add viewMode to useGalpaoStore destructuring in WarehouseModel
|
||||
if (!code.includes('viewMode = useGalpaoStore')) {
|
||||
code = code.replace("const { width, length, height, roofPitch, wallCpe, roofCpe, template, extraHeight, skirtHeight } = useGalpaoStore();", "const { width, length, height, roofPitch, wallCpe, roofCpe, template, extraHeight, skirtHeight, viewMode } = useGalpaoStore();");
|
||||
}
|
||||
|
||||
// Add viewMode to PressureArrow
|
||||
if (!code.includes('const { viewMode } = useGalpaoStore();') && code.includes('function PressureArrow')) {
|
||||
code = code.replace("const { q } = useWindStore();", "const { q } = useWindStore();\n const { viewMode } = useGalpaoStore();\n if (viewMode === 'airflow') return null;");
|
||||
}
|
||||
|
||||
// Make meshStandardMaterial transparent
|
||||
code = code.replace(/<meshStandardMaterial(?!\s*color=\{color\}\s*transparent\s*opacity=\{0\.6\})([^>]+)>/g, (match, p1) => {
|
||||
// If it already has transparent, skip
|
||||
if (match.includes("transparent={viewMode")) return match;
|
||||
return `<meshStandardMaterial${p1} transparent={viewMode === 'airflow'} opacity={viewMode === 'airflow' ? 0.35 : 1} />`;
|
||||
});
|
||||
|
||||
// Add AirflowSystem to the scene
|
||||
if (!code.includes('<AirflowSystem')) {
|
||||
code = code.replace("{/* === RÓTULOS 3D === */}", "{viewMode === 'airflow' && <AirflowSystem windAngle={windAngle} width={width} length={length} height={height} permeabilityCase={permeabilityCase} />}\n\n {/* === RÓTULOS 3D === */}");
|
||||
}
|
||||
|
||||
// Rótulos 3D visibility
|
||||
if (code.includes('{showMainWalls && (')) {
|
||||
code = code.replace("{showMainWalls && (", "{showMainWalls && viewMode === 'solid' && (");
|
||||
}
|
||||
|
||||
fs.writeFileSync('app/src/components/Warehouse3D.tsx', code);
|
||||
Reference in New Issue
Block a user