feat: adicionar super manual didatico com fluxos 2d e sheet panel

This commit is contained in:
2026-07-09 23:40:06 +00:00
parent 9fece3f174
commit 40e73e734a
34 changed files with 1443 additions and 390 deletions
+14 -14
View File
@@ -32,27 +32,27 @@ function PressureArrow({
}) {
const { q } = useWindStore();
const force = p * q; // kN/m2
if (Math.abs(force) < 0.05) return null;
const length = Math.max(0.6, Math.min(3.0, Math.abs(force) * 1.5));
const isPressure = p > 0;
const color = isPressure ? '#3b82f6' : '#ef4444';
const normVec = useMemo(() => new THREE.Vector3(...normal).normalize(), [normal]);
const centerVec = useMemo(() => new THREE.Vector3(...center), [center]);
const dir = isPressure ? normVec.clone().negate() : normVec.clone();
const start = isPressure ? centerVec.clone().sub(dir.clone().multiplyScalar(length)) : centerVec;
const end = isPressure ? centerVec : centerVec.clone().add(dir.clone().multiplyScalar(length));
const mid = new THREE.Vector3().addVectors(start, end).multiplyScalar(0.5);
const isPressure = p > 0;
const dir = useMemo(() => isPressure ? normVec.clone().negate() : normVec.clone(), [isPressure, normVec]);
const quat = useMemo(() => {
const q = new THREE.Quaternion();
q.setFromUnitVectors(new THREE.Vector3(0, 1, 0), dir);
return new THREE.Euler().setFromQuaternion(q);
}, [dir]);
if (Math.abs(force) < 0.05) return null;
const length = Math.max(0.6, Math.min(3.0, Math.abs(force) * 1.5));
const color = isPressure ? '#3b82f6' : '#ef4444';
const start = isPressure ? centerVec.clone().sub(dir.clone().multiplyScalar(length)) : centerVec;
const end = isPressure ? centerVec : centerVec.clone().add(dir.clone().multiplyScalar(length));
const mid = new THREE.Vector3().addVectors(start, end).multiplyScalar(0.5);
const headLen = Math.min(0.4, length * 0.4);
return (