main
John Lauer
Show reduced Q1 FR4 and heatsink conductive heat-flow animation with explicit limits
253cc27
<!doctype html><meta charset="utf-8"><title>R11 Q1 thermal path · screening study</title>
<link rel="stylesheet" href="../../../../control-panel/twin/vendor/3d-viewer/style.css">
<style>
*{box-sizing:border-box}body{margin:0;background:#0d1117;color:#eef4f7;font:14px system-ui;height:100vh;display:flex;flex-direction:column}header{padding:16px 22px;background:#161b22;border-bottom:1px solid #30363d}h1{font-size:19px;margin:0 0 14px;font-weight:600}.toolbar{display:flex;gap:10px;flex-wrap:wrap}button{display:inline-flex;align-items:center;gap:10px;min-height:40px;background:#242c36;color:#e6edf3;border:1px solid #485361;border-radius:8px;padding:9px 14px;cursor:pointer;font:600 13px system-ui;box-shadow:0 2px 4px #0004;transition:background 120ms,border-color 120ms,box-shadow 120ms,transform 80ms}button:hover:not(:disabled){background:#344252;border-color:#9aaec2;box-shadow:0 3px 9px #0006}button:active:not(:disabled){transform:translateY(1px);background:#40546a;box-shadow:inset 0 2px 4px #0005}button:focus-visible{outline:3px solid #72e4df;outline-offset:3px}button[aria-pressed=true],button[aria-checked=true]{background:#124441;border-color:#27c8bd;color:#c3fff9}button:disabled{opacity:.55;cursor:wait}.track{width:30px;height:18px;border-radius:12px;background:#657180;position:relative}.track:after{content:'';position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;background:white;transition:transform 140ms}button[aria-checked=true] .track{background:#00a89f}button[aria-checked=true] .track:after{transform:translateX(12px)}p{margin:10px 0 0;color:#aab9c8}#viewer{flex:1;min-height:0}.layers-panel{max-height:65vh;overflow:auto}.legend{display:inline-block;width:160px;height:10px;background:linear-gradient(to right,#00ffff,#80ffbf,#ffff80,#ff8040,#ff0000);margin:0 8px;border-radius:3px}.summary{display:flex;gap:24px;align-items:center;flex-wrap:wrap;margin-top:10px}#status{color:#86e1d6;margin:0}#feedback{min-height:18px;color:#c9d6e3}small{color:#9eacba}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
</style>
<header><h1>Q1 heat path · FR4 + package + heatsink</h1><div class="toolbar">
<button id="cooling" role="switch" aria-checked="false" title="Switch between assumed fan-off and fan-on cooling"><span class="track" aria-hidden="true"></span><span id="cooling-label">Fan off</span></button>
<button id="colors" aria-pressed="false" title="Use unshaded colors for comparison with the temperature scale">Exact colors: off</button>
<button id="flow" aria-pressed="true">Flow motion: on</button></div><div class="summary"><p id="status" role="status" aria-live="polite">Loading thermal model…</p><span>40°C <span class="legend"></span>90°C</span></div>
<p id="fluxScale"></p><p>Surface colours = temperature. Moving markers = internal conductive heat flux, visible through solids. No air-flow or cooling transient simulation.</p><p id="feedback" aria-live="polite">Shaded inspection · use Layers to reveal the base, interface and Q1.</p>
<small>5.5 W · 40°C ambient · Q1-only heat source · reduced FR4 + leads + Q1 + sink · exact copper/vias omitted · assumed airflow · steady-state screening, not a qualified rating. Shading changes apparent brightness; Exact colors removes it.</small></header><div id="viewer"></div>
<script type="module">
await import('../../../../control-panel/twin/vendor/3d-viewer/adom-3d-viewer-babylon9.esm.js');
const viewer=window.Adom3DViewerBabylon9.init(document.querySelector('#viewer'),{zUp:true,showGround:false,showViewCube:true});
let particles=[],flowLines=[],flowPlaying=true;let busy=false,mode='off',exact=false;
const cooling=document.getElementById('cooling'),colors=document.getElementById('colors'),feedback=document.getElementById('feedback');
function renderStyle(){
const scene=viewer.getScene();scene.shadowsEnabled=!exact;
for(const m of scene.meshes){if(!m.getTotalVertices?.()||!m.material)continue;if(!m.metadata?.thermalNormals){const p=m.getVerticesData('position'),idx=m.getIndices(),n=new Float32Array(p.length);for(let t=0;t<(idx?.length||p.length/3);t+=3){const a=(idx?.length?idx[t]:t)*3,b=(idx?.length?idx[t+1]:t+1)*3,c=(idx?.length?idx[t+2]:t+2)*3;const u=[p[b]-p[a],p[b+1]-p[a+1],p[b+2]-p[a+2]],v=[p[c]-p[a],p[c+1]-p[a+1],p[c+2]-p[a+2]],q=[u[1]*v[2]-u[2]*v[1],u[2]*v[0]-u[0]*v[2],u[0]*v[1]-u[1]*v[0]],len=Math.hypot(...q);if(len)for(const j of [a,b,c])for(let k=0;k<3;k++)n[j+k]=q[k]/len;}m.setVerticesData('normal',n);m.metadata={...m.metadata,thermalNormals:true};}m.material.metallic=0;m.material.roughness=.85;m.material.unlit=exact;m.material.environmentIntensity=.25;m.material.directIntensity=1;m.receiveShadows=true;}
const shadow=viewer.getShadowGenerator();if(shadow){shadow.darkness=.22;shadow.forceBackFacesOnly=false;shadow.getShadowMap()?.resetRefreshCounter();}
colors.setAttribute('aria-pressed',String(exact));colors.textContent=`Exact colors: ${exact?'on':'off'}`;
}
async function load(next){if(busy)return;busy=true;cooling.disabled=colors.disabled=true;cooling.setAttribute('aria-busy','true');document.getElementById('cooling-label').textContent='Loading…';feedback.textContent=`Applying fan-${next} cooling assumption…`;
const oldCamera=window.thermalReview?{alpha:viewer.getScene().activeCamera.alpha,beta:viewer.getScene().activeCamera.beta,radius:viewer.getScene().activeCamera.radius}:null;
const hidden=viewer.getLayers().filter(l=>!l.visible).map(l=>l.name);
try{await viewer.loadModel(`./whole-thermal/fan-${next}.glb?v=grouped-2`);mode=next;renderStyle();for(const key of hidden)viewer.setLayerVisible(key,false);
const f=await fetch(`./whole-thermal/flow-${next}.json`).then(r=>r.json());makeFlow(f);const q=f.bodies.find(b=>b.name==='Q1_case_patch'),pcb=f.bodies.find(b=>b.name==='FR4_board');document.getElementById('status').textContent=`Q1 case ${q.maxC.toFixed(1)}°C · FR4 max ${pcb.maxC.toFixed(1)}°C · prescribed sink h=${next==='off'?5:50} W/m²K`;
const c=viewer.getScene().activeCamera;Object.assign(c,oldCamera||{alpha:-.8,beta:.9});
cooling.setAttribute('aria-checked',String(mode==='on'));feedback.textContent=`Fan ${mode} assumption applied. ${exact?'Exact thermal colors.':'Shaded inspection with shadows.'}`;window.thermalReview={viewer,mode,ready:true};
}catch(e){feedback.textContent=`Could not load cooling case: ${e.message}. Click the toggle to retry.`;}
finally{busy=false;cooling.disabled=colors.disabled=false;cooling.removeAttribute('aria-busy');document.getElementById('cooling-label').textContent=`Fan ${mode}`;}}
cooling.onclick=()=>load(mode==='off'?'on':'off');colors.onclick=()=>{exact=!exact;renderStyle();feedback.textContent=exact?'Exact colors enabled; lighting and shadows removed for scale comparison.':'Shaded inspection enabled; shadows show fin depth.';};
const B=window.Adom3DViewerBabylon9.BABYLON;
function makeFlow(data){for(const p of particles)p.mesh.dispose();for(const l of flowLines)l.dispose();particles=[];flowLines=[];const scene=viewer.getScene();const max=Math.max(...data.vectors.map(v=>Math.abs(v.fluxWm2)));document.getElementById('fluxScale').textContent=`Flux markers: 0–${(max/1000).toFixed(1)} kW/m² (log colour scale). Directions solved; motion speed illustrative.`;
for(const [i,f] of data.vectors.entries()){if(Math.abs(f.fluxWm2)<.01)continue;let a=B.Vector3.FromArray(f.a.map(v=>v/1000)),b=B.Vector3.FromArray(f.b.map(v=>v/1000));if(f.fluxWm2<0)[a,b]=[b,a];const dir=b.subtract(a).normalize();b=a.add(dir.scale(.003));const t=Math.log1p(Math.abs(f.fluxWm2))/Math.log1p(max),color=new B.Color3(1,1-.75*t,.1);const line=B.MeshBuilder.CreateLines('heat-flux-direction',{points:[a,b]},scene);line.color=color;line.renderingGroupId=2;line.isPickable=false;flowLines.push(line);const m=B.MeshBuilder.CreateSphere('heat-flux-marker',{diameter:.0006,segments:4},scene);const mat=new B.StandardMaterial('flux',scene);mat.emissiveColor=color;mat.disableLighting=true;m.material=mat;m.renderingGroupId=2;m.isPickable=false;particles.push({mesh:m,a,b,phase:(i*.618)%1});}window.wholeFlow={data,particles,viewer};}
viewer.getScene().onBeforeRenderObservable.add(()=>{if(!flowPlaying)return;const t=performance.now()/2500;for(const p of particles)p.mesh.position.copyFrom(B.Vector3.Lerp(p.a,p.b,(t+p.phase)%1));});
document.getElementById('flow').onclick=()=>{flowPlaying=!flowPlaying;document.getElementById('flow').textContent=flowPlaying?'Flow motion: on':'Flow motion: paused';document.getElementById('flow').setAttribute('aria-pressed',String(flowPlaying));};
await load('off');document.querySelector('.layers-toggle')?.click();
</script>