← Commit history

Move the interactive 3D viewer embed to the wiki page (README 3D-viewer section) instead of the characterization page - revert IN-S42ATR.html to its original three.js canvas, add the viewer iframe to README, and fix the viewer to load its bundle via fetch plus inline-inject since blob storage serves .js as octet-stream with nosniff (a script-src tag is refused).

AravK ·af3d983246 ·3mo ago ·parent 8457fe5
3 files changed +23−11
IN-S42ATR-viewer.html+9−1
@@ -67,10 +67,18 @@ </div>  <!-- Colby/Kyle's ACTUAL shipped viewer bundle (window.Adom3DViewer). Unmodified. -->-<script src="./adom-3d-viewer.min.js"></script> <script> (async () => {   const statusEl = document.getElementById('status');+  // Wiki blob storage serves .js as application/octet-stream + nosniff, so a <script src>+  // of the bundle is refused by the browser. Fetch it as text and inject it as an inline+  // script (which executes). Behaves the same when served locally.+  if (!window.Adom3DViewer) {+    try {+      const code = await (await fetch('./adom-3d-viewer.min.js')).text();+      const s = document.createElement('script'); s.textContent = code; document.head.appendChild(s);+    } catch (e) { statusEl.textContent = 'viewer bundle fetch failed: ' + e.message; return; }+  }   const V = window.Adom3DViewer;   if (!V) { statusEl.textContent = 'Adom3DViewer bundle failed to load'; return; }   const B = V.BABYLON;                              // his Babylon core instance
IN-S42ATR.html+5−4
@@ -674,10 +674,11 @@ document.getElementById('copyFullUrl').addEventListener('click',function(){var t         <iframe src="IN-S42ATR-fpview.html" style="width:100%;height:340px;border:none;display:block" allow="fullscreen"></iframe>       </div>     </div>-    <!-- 3D Model — interactive: Adom 3D viewer (Colby's) + Static/Pick-and-Place additions. Local build, embedded here as an interim while the homepage viewer is in progress. -->-    <div class="card" style="padding:0;overflow:hidden;margin-bottom:12px">-      <div style="font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:0.5px;color:var(--text-dim);padding:12px 16px 0">3D Model &mdash; Static &amp; Pick-and-Place (interactive)</div>-      <iframe src="IN-S42ATR-viewer.html" style="width:100%;height:560px;border:none;display:block" allow="fullscreen"></iframe>+    <!-- 3D Model -->+    <div class="card" style="text-align:center;margin-bottom:12px">+      <div style="font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:0.5px;color:var(--text-dim);margin-bottom:12px">3D Model (interactive)</div>+      <canvas id="viewer3d" width="600" height="300" style="width:100%;height:300px;border-radius:4px;cursor:grab"></canvas>+      <div style="font-size:10px;color:var(--text-dim);margin-top:6px">Click &amp; drag to rotate &middot; Scroll to zoom</div>     </div>     <!-- Download / Export Bar -->     <div class="card" style="display:flex;align-items:center;gap:10px;flex-wrap:wrap">
README.md+9−6
@@ -14,12 +14,15 @@ Interactive specs, footprint viewer, symbol viewer, and design charts.  ## 3D viewer -The 3D model above is an **animated assembly view**: the LED drops onto its own-footprint (copper pads + solder + FR4 board + cathode silk mark) with a smooth-insert animation. Use the **Layers** control to toggle the board, pads, solder,-silk, the LED itself — and **`LED_lit`** to turn the red emitter **on / off**.-The emitter glows red when lit and sits as a dark unlit red when off. The part-number is embossed on one side and the emission colour (`RED`) on the other.+<iframe src="/blob/component/in-s42atr/IN-S42ATR-viewer.html" width="100%" height="560" frameborder="0" style="border:none;border-radius:8px" allowfullscreen></iframe>++Interactive assembly view on the **Adom 3D viewer** with two modes: **Static** — the+LED drops onto its own footprint (copper pads + solder + FR4 board + cathode silk mark)+with a smooth insert animation; and **Pick &amp; Place** — a translucent pick-and-place+nozzle places the LED from a tape-and-reel ghost. Use the **Layers** control to toggle+the board, pads, solder, silk, the LED itself, **`LED_lit`** (the red emitter on / off),+and the **FOV** cone (the datasheet 130&deg; viewing angle). The part number is embossed+on one side and the emission colour (`RED`) on the other.  > **Provenance — 3D assembly.** `IN-S42ATR.glb` is a composite built from the > page's own `IN-S42ATR.step` (via cadquery for the sunken side embossing) plus a