← Commit history

per-layer bbox toggle (draws layer extents to verify z); isolate uses custom tooltip

John Lauer ·f35fdfbc0a ·3mo ago ·parent 5ff0447
3 files changed +33−6
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "type": "component",-  "version": "0.1.62",+  "version": "0.1.63",   "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",   "tags": [     "hardware"
page.json+10−3
@@ -4,9 +4,16 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "brief": "Buck-boost 1S-4S battery charger board (TI BQ25792) with 14 Adom machine pins, by Adonis",-  "version": "0.1.62",+  "version": "0.1.63",   "tags": [-    "hardware"+    "adom",+    "adom-modular",+    "component",+    "charger",+    "battery",+    "bq25792",+    "power",+    "usb-c"   ],   "license": "proprietary",   "component": {@@ -49,7 +56,7 @@     "email": "[email protected]"   },   "visibility": "public",-  "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",+  "description": "BQ25792 Charger - a buck-boost 1S-4S battery charger board (Texas Instruments BQ25792) designed by Adonis in Fusion 360, with 14 Adom machine pins for the modular stack. Interactive colored 3D model, schematic and layout views.",   "dependencies": {},   "files": [     "README.md",
readme.html+22−2
@@ -454,7 +454,7 @@ exported bodies + design rules.</p>     LAYERS.forEach(function(L,i){       const row=document.createElement("div"); row.className="lp-row";       const iso=document.createElement("button"); iso.className="lp-iso"; iso.type="button";-      iso.title="Isolate this layer (click again to restore)"; iso.textContent="\u25CE";+      iso.setAttribute("data-tip","Isolate: show ONLY this layer and hide the rest (click again to restore all)"); iso.textContent="\u25CE";       iso.addEventListener("click",function(e){         e.stopPropagation();         isolatedKey = (isolatedKey===L.key) ? null : L.key;@@ -463,16 +463,36 @@ exported bodies + design rules.</p>         applyVisibility();         set(isolatedKey ? ("isolated: "+L.label) : "all layers");       });+      const bx=document.createElement("button"); bx.className="lp-iso lp-bbox"; bx.type="button";+      bx.setAttribute("data-tip","Bounding box: draw this layer's exact extents (X/Y/Z) to verify its position and height"); bx.textContent="\u25A1";+      bx.addEventListener("click",function(e){ e.stopPropagation(); toggleBBox(L,bx); });       const cb=document.createElement("input"); cb.type="checkbox"; cb.checked=true; L.cb=cb;       cb.addEventListener("change",function(){ L.visible=cb.checked; applyVisibility(); });       const nm=document.createElement("span"); nm.className="lp-name"; nm.textContent=L.label;       const z=document.createElement("span"); z.className="lp-z"; L.zEl=z;-      row.appendChild(iso); row.appendChild(cb); row.appendChild(nm); row.appendChild(z);+      row.appendChild(iso); row.appendChild(bx); row.appendChild(cb); row.appendChild(nm); row.appendChild(z);       row.addEventListener("mouseenter",function(){ if(!isolatedKey) hilite(L,true); });       row.addEventListener("mouseleave",function(){ hilite(L,false); });       lpRows.appendChild(row);     });   }+  function toggleBBox(L,btn){+    if(L.boxMesh){ L.boxMesh.dispose(); L.boxMesh=null; btn.classList.remove("on"); set("bbox off: "+L.label); return; }+    const sc=viewer.getScene();+    let mnx=1e9,mny=1e9,mnz=1e9,mxx=-1e9,mxy=-1e9,mxz=-1e9;+    L.meshes.forEach(function(m){ m.computeWorldMatrix(true); const b=m.getBoundingInfo().boundingBox;+      mnx=Math.min(mnx,b.minimumWorld.x);mny=Math.min(mny,b.minimumWorld.y);mnz=Math.min(mnz,b.minimumWorld.z);+      mxx=Math.max(mxx,b.maximumWorld.x);mxy=Math.max(mxy,b.maximumWorld.y);mxz=Math.max(mxz,b.maximumWorld.z); });+    if(mnx>mxx) return;+    const dz=Math.max(mxz-mnz, 5e-5);+    const box=B().MeshBuilder.CreateBox("bbox_"+L.key,{width:mxx-mnx,height:mxy-mny,depth:dz},sc);+    box.position=new (B().Vector3)((mnx+mxx)/2,(mny+mxy)/2,(mnz+mxz)/2);+    const em=new (B().StandardMaterial)("bboxm_"+L.key,sc);+    em.wireframe=true; em.emissiveColor=new (B().Color3)(0.0,0.9,0.85); em.disableLighting=true;+    box.material=em; box.isPickable=false;+    L.boxMesh=box; btn.classList.add("on");+    set("bbox "+L.label+": z "+(mnz*1000).toFixed(2)+".."+(mxz*1000).toFixed(2)+"mm");+  }   function hilite(L,on){     L.meshes.forEach(function(m){       try{ m.renderOverlay=on; if(on){ m.overlayColor=new (B().Color3)(0.0,0.9,0.85); m.overlayAlpha=0.45; } }catch(e){}