← Commit history

restore proven light rig + absolute framing; keep real-FR4 sublayers with holes + unquantized groups

John Lauer ·20aa232a9d ·3mo ago ·parent 0e0bccb
3 files changed +38−13
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "type": "component",-  "version": "0.1.28",+  "version": "0.1.29",   "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.28",+  "version": "0.1.29",   "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+27−9
@@ -235,12 +235,20 @@ exported bodies + design rules.</p>     quad("mask_bot","layer-mask-bot.png",-0.075*mm,-24*mm+0.075*mm,true);     quad("silk_bot","layer-silk-bot.png",-0.083*mm,-30*mm+0.083*mm,true); -    // 5) lights/env/shadows come from the bundle's SceneBuilder (embedded studio env,-    // hemispheric + spot + PCF shadows) - register our meshes as shadow casters only.-    try{-      const sg=sc.lights.map(l=>l.getShadowGenerator&&l.getShadowGenerator()).find(Boolean);-      if(sg) LAYERS.forEach(L=>L.meshes.forEach(m=>{ try{ sg.addShadowCaster(m,true);}catch(e){} }));-    }catch(e){}+    // 5) the deployed bundle's light rig does not materialize in this sandbox - add a+    // matching rig (hemi + key/fill) and a shadow generator; ground receives below.+    if(sc.lights.length===0){+      new (B().HemisphericLight)("hemi",new (B().Vector3)(0.2,0.2,1),sc).intensity=1.0;+    }+    const key=new (B().DirectionalLight)("key",new (B().Vector3)(-0.4,-0.5,-1),sc);+    key.intensity=1.3; key.position=new (B().Vector3)(0.1,0.1,0.3);+    const fill=new (B().DirectionalLight)("fill",new (B().Vector3)(0.7,0.4,-0.5),sc); fill.intensity=0.5;+    const sg=new (B().ShadowGenerator)(2048,key);+    sg.useBlurExponentialShadowMap=true; sg.blurKernel=16;+    LAYERS.forEach(L=>L.meshes.forEach(m=>{ try{ sg.addShadowCaster(m,true);}catch(e){} }));+    // keep a render loop alive without replacing the bundle's (viewcube scene safety)+    var eng2=viewer.getEngine();+    if(!eng2._activeRenderLoops || eng2._activeRenderLoops.length===0){ eng2.runRenderLoop(function(){ sc.render(); }); }     // 6) ground: 80% transparent + receives shadows     sc.meshes.forEach(m=>{       if(/ground/i.test(m.name||"")){@@ -248,9 +256,19 @@ exported bodies + design rules.</p>       }     }); -    // 7) native frameModel handles framing/spotlight now (true bounds, unquantized);-    // widen slightly for exploded headroom.-    setTimeout(function(){ try{ const cam=sc.activeCamera; cam.radius=cam.radius*1.6; cam.beta=1.15; }catch(e){} },400);+    // 7) absolute framing from world extents (proven; bundle frameModel unreliable here)+    setTimeout(function(){+      try{+        const ext=sc.getWorldExtends();+        const c=new (B().Vector3)((ext.min.x+ext.max.x)/2,(ext.min.y+ext.max.y)/2,(ext.min.z+ext.max.z)/2);+        const dx=ext.max.x-ext.min.x, dy=ext.max.y-ext.min.y, dz=ext.max.z-ext.min.z;+        const diag=Math.sqrt(dx*dx+dy*dy+dz*dz);+        const cam=sc.activeCamera;+        cam.setTarget(c); cam.radius=diag*1.5; cam.beta=1.15; cam.alpha=-1.2;+        cam.minZ=diag*0.005; cam.maxZ=diag*300;+        if(typeof cam.wheelPrecision==="number") cam.wheelPrecision=3/diag;+      }catch(e){}+    },400);     set("animating");   }