← Commit history

floaty toolbar: Click-pivot toggle (viewer's Shift+Alt click-to-set-orbit-point, always-on) + Ground show/hide toggle

John Lauer ·d63526a5e7 ·3mo ago ·parent 14ef9dc
3 files changed +40−13
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "type": "component",-  "version": "0.1.47",+  "version": "0.1.48",   "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.47",+  "version": "0.1.48",   "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+29−9
@@ -67,6 +67,9 @@ <div id="viewer-card">   <div id="viewer-wrap"></div>   <div id="floaty"><span class="grip" title="drag">::</span>+    <button class="fbtn" id="btn-pivot" type="button" title="Click any point to orbit around it (Shift+Alt always on)">Click-pivot</button>+    <button class="fbtn active" id="btn-ground" type="button" title="Show/hide the ground plane">Ground</button>+    <span style="width:1px;background:rgba(255,255,255,0.12);margin:0 3px"></span>     <button class="fbtn active" id="btn-anim" type="button" title="Auto-play cascade">Animate</button>     <button class="fbtn" id="btn-assembled" type="button">Assembled</button>     <button class="fbtn" id="btn-exploded" type="button">Exploded</button>@@ -213,7 +216,7 @@ exported bodies + design rules.</p>   const N=LAYERS.length;   LAYERS.forEach(L=>{ L.meshes=[]; L.visible=true; });   const byKey={}; LAYERS.forEach(L=>byKey[L.key]=L);-  let SC=null;+  let SC=null, GROUND=[];   function attach(key,meshes){     meshes=meshes.filter(m=>!/ground|sky|env|viewcube|axis|grid|arcRotate|Background|__root__/i.test(m.name||""));     const L=byKey[key];@@ -322,14 +325,13 @@ exported bodies + design rules.</p>     }      // ground: 80% transparent, receives shadows-    sc.meshes.forEach(m=>{-      if(/ground/i.test(m.name||"")){-        try{-          m.receiveShadows=true;-          if(m.material){ m.material.alpha=0.2; m.material.transparencyMode=2; if("useAlphaFromDiffuseTexture" in m.material) m.material.useAlphaFromDiffuseTexture=false; }-          m.visibility=1;-        }catch(e){}-      }+    GROUND=sc.meshes.filter(m=>/ground/i.test(m.name||""));+    GROUND.forEach(m=>{+      try{+        m.receiveShadows=true;+        if(m.material){ m.material.alpha=0.2; m.material.transparencyMode=2; if("useAlphaFromDiffuseTexture" in m.material) m.material.useAlphaFromDiffuseTexture=false; }+        m.visibility=1;+      }catch(e){}     });      // frame: assembled view + headroom for the +55mm cascade@@ -418,6 +420,24 @@ exported bodies + design rules.</p>   btnAnim.addEventListener("click",function(){ mode="anim"; dir=1; holdT=0; setBtns(btnAnim); set("animating"); });   btnA.addEventListener("click",function(){ mode="t0"; setBtns(btnA); set("assembled"); });   btnE.addEventListener("click",function(){ mode="t1"; setBtns(btnE); set("exploded"); });+  // Click-pivot: the viewer's Shift+Alt-click-to-set-orbit-point, made always-on+  let pivotOn=false;+  const btnPivot=document.getElementById("btn-pivot");+  btnPivot.addEventListener("click",function(){+    pivotOn=!pivotOn;+    try{ const cam=viewer.getCamera(); if(cam&&cam.setClickToSetRotationPoint) cam.setClickToSetRotationPoint(pivotOn,250); }catch(e){}+    btnPivot.classList.toggle("active",pivotOn);+    set(pivotOn?"click-pivot ON (click any point to orbit it)":"click-pivot off");+  });+  // Ground plane show/hide+  let groundOn=true;+  const btnGround=document.getElementById("btn-ground");+  btnGround.addEventListener("click",function(){+    groundOn=!groundOn;+    GROUND.forEach(m=>{ try{ m.setEnabled(groundOn); }catch(e){} });+    btnGround.classList.toggle("active",groundOn);+    set(groundOn?"ground shown":"ground hidden");+  });   btnFS.addEventListener("click",function(){     if(document.fullscreenElement){ document.exitFullscreen(); return; }     (card.requestFullscreen?card.requestFullscreen():Promise.reject()).catch?.(function(){ set("fullscreen blocked in the embed - open the readme URL directly"); });