← Commit history

3d viewer: clean base build (matches adom-lbr export)

Ray ·ffe82c07a7 ·3mo ago ·parent 4f8bff5
1 file changed +44−27
viewers/3d.html+44−27
@@ -7,18 +7,13 @@ body{background:var(--bg);color:var(--ink);font-family:'Satoshi',system-ui,sans- .bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 11px;border-bottom:1px solid var(--edge);flex:none} .bar .h{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--mut);font-weight:700} .bar .sp{flex:1}-.lyrtog{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--mut);background:#1a2130;border:1px solid var(--edge);border-radius:999px;padding:3px 9px;cursor:pointer;user-select:none}-.lyrtog.on{color:var(--ink);border-color:#485162}.lyrtog:not(.on){opacity:.5}-.lyrtog .d{width:8px;height:8px;border-radius:50%}+.act{font-size:11px;color:var(--ink);background:#1a2130;border:1px solid var(--edge);border-radius:999px;padding:3px 11px;cursor:pointer;font-family:'Satoshi'}+.act:hover{border-color:var(--acc)} .stage{flex:1;min-height:0;position:relative;overflow:hidden;background:var(--bg)} .stage canvas{width:100%;height:100%;display:block;outline:none;touch-action:none} .ph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--mut);font-size:12px} </style></head><body>-<div class=bar><span class=h>3D model</span><span class=sp></span>-  <button class="lyrtog on" data-mesh="solder"><span class=d style="background:#c9ccd1"></span>Solder</button>-  <button class="lyrtog on" data-mesh="copper"><span class=d style="background:#d8a24a"></span>Copper</button>-  <button class="lyrtog on" data-mesh="fr4"><span class=d style="background:#2f7d4f"></span>Board</button>-</div>+<div class=bar><span class=h>3D model</span><span class=sp></span><button class=act id=reset>Reset view</button></div> <div class=stage id=stage><div class=ph id=ph>loading 3D…</div></div> <script>var O$e=Object.defineProperty;var R$e=(B9,j1,z9)=>j1 in B9?O$e(B9,j1,{enumerable:!0,configurable:!0,writable:!0,value:z9}):B9[j1]=z9;var mr=(B9,j1,z9)=>R$e(B9,typeof j1!="symbol"?j1+"":j1,z9);(function(){"use strict";function B9(a,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in a)){const r=Object.getOwnPropertyDescriptor(i,s);r&&Object.defineProperty(a,s,r.get?r:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function j1(){}function z9(a){return a()}function Aue(){return Object.create(null)}function QI(a){a.forEach(z9)}function Cue(a){return typeof a=="function"}function xue(a,e){return a!=a?e==e:a!==e||a&&typeof a=="object"||typeof a=="function"}function $Ie(a){return Object.keys(a).length===0}function ePe(a,...e){if(a==null){for(const i of e)i(void 0);return j1}const t=a.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function tPe(a){let e;return ePe(a,t=>e=t)(),e}function Mc(a,e){a.appendChild(e)}function iPe(a,e,t){const i=sPe(a);if(!i.getElementById(e)){const s=$2("style");s.id=e,s.textContent=t,rPe(i,s)}}function sPe(a){if(!a)return document;const e=a.getRootNode?a.getRootNode():a.ownerDocument;return e&&e.host?e:a.ownerDocument}function rPe(a,e){return Mc(a.head||a,e),e.sheet}function JI(a,e,t){a.insertBefore(e,t||null)}function F9(a){a.parentNode&&a.parentNode.removeChild(a)}function $2(a){return document.createElement(a)}function VV(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function JY(a){return document.createTextNode(a)}function k9(){return JY(" ")}function U9(a,e,t,i){return a.addEventListener(e,t,i),()=>a.removeEventListener(e,t,i)}function bue(a){return function(e){return e.stopPropagation(),a.call(this,e)}}function ya(a,e,t){t==null?a.removeAttribute(e):a.getAttribute(e)!==t&&a.setAttribute(e,t)}function nPe(a){return Array.from(a.childNodes)}function $I(a,e,t){a.classList.toggle(e,!!t)}let nw;function aw(a){nw=a}function Sue(){if(!nw)throw new Error("Function called outside component initialization");return nw}function aPe(a){Sue().$$.on_mount.push(a)}function oPe(a){Sue().$$.on_destroy.push(a)}function lPe(a,e){const t=a.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const eP=[],AV=[];let tP=[];const yue=[],cPe=Promise.resolve();let $Y=!1;function uPe(){$Y||($Y=!0,cPe.then(Mue))}function eX(a){tP.push(a)}const tX=new Set;let iP=0;function Mue(){if(iP!==0)return;const a=nw;do{try{for(;iP<eP.length;){const e=eP[iP];iP++,aw(e),hPe(e.$$)}}catch(e){throw eP.length=0,iP=0,e}for(aw(null),eP.length=0,iP=0;AV.length;)AV.pop()();for(let e=0;e<tP.length;e+=1){const t=tP[e];tX.has(t)||(tX.add(t),t())}tP.length=0}while(eP.length);for(;yue.length;)yue.pop()();$Y=!1,tX.clear(),aw(a)}function hPe(a){if(a.fragment!==null){a.update(),QI(a.before_update);const e=a.dirty;a.dirty=[-1],a.fragment&&a.fragment.p(a.ctx,e),a.after_update.forEach(eX)}}function dPe(a){const e=[],t=[];tP.forEach(i=>a.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),tP=e}const fPe=new Set;function pPe(a,e){a&&a.i&&(fPe.delete(a),a.i(e))}function mPe(a,e,t){const{fragment:i,after_update:s}=a.$$;i&&i.m(e,t),eX(()=>{const r=a.$$.on_mount.map(z9).filter(Cue);a.$$.on_destroy?a.$$.on_destroy.push(...r):QI(r),a.$$.on_mount=[]}),s.forEach(eX)}function gPe(a,e){const t=a.$$;t.fragment!==null&&(dPe(t.after_update),QI(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function _Pe(a,e){a.$$.dirty[0]===-1&&(eP.push(a),uPe(),a.$$.dirty.fill(0)),a.$$.dirty[e/31|0]|=1<<e%31}function vPe(a,e,t,i,s,r,n=null,o=[-1]){const l=nw;aw(a);const c=a.$$={fragment:null,ctx:[],props:r,update:j1,not_equal:s,bound:Aue(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Aue(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};n&&n(c.root);let u=!1;if(c.ctx=t?t(a,e.props||{},(f,p,...m)=>{const _=m.length?m[0]:p;return c.ctx&&s(c.ctx[f],c.ctx[f]=_)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](_),u&&_Pe(a,f)),p}):[],c.update(),u=!0,QI(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const f=nPe(e.target);c.fragment&&c.fragment.l(f),f.forEach(F9)}else c.fragment&&c.fragment.c();e.intro&&pPe(a.$$.fragment),mPe(a,e.target,e.anchor),Mue()}aw(l)}class APe{constructor(){mr(this,"$$");mr(this,"$$set")}$destroy(){gPe(this,1),this.$destroy=j1}$on(e,t){if(!Cue(t))return j1;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!$Ie(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const CPe="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(CPe);const xPe=typeof WeakRef<"u";class iX{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class Eue{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(){this._remove&&this._remove()}}class xe{static FromPromise(e,t){const i=new xe;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new iX(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,r=!1){if(!e)return null;const n=new Eue(e,t,s);n.unregisterOnNextCall=r,i?this._observers.unshift(n):this._observers.push(n),this._onObserverAdded&&this._onObserverAdded(n),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(n,this._lastNotifiedValue);const o=xPe?new WeakRef(this):{deref:()=>this};return n._remove=()=>{const l=o.deref();l&&l._remove(n)},n}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,t){for(let i=0;i<this._observers.length;i++){const s=this._observers[i];if(!s._willBeUnregistered&&s.callback===e&&(!t||t===s.scope))return this._deferUnregister(s),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,s,r){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const n=this._eventState;n.mask=t,n.target=i,n.currentTarget=s,n.skipNextObservers=!1,n.lastReturnValue=e,n.userInfo=r;for(const o of this._observers)if(!o._willBeUnregistered&&(o.mask&t&&(o.unregisterOnNextCall&&this._deferUnregister(o),o.scope?n.lastReturnValue=o.callback.apply(o.scope,[e,n]):n.lastReturnValue=o.callback(e,n)),n.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new xe;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}function Il(){return typeof window<"u"}function LT(){return typeof navigator<"u"}function H6(){return typeof document<"u"}function ow(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}const bPe={IsWindowObjectExist:Il,IsNavigatorAvailable:LT,IsDocumentAvailable:H6,GetDOMTextContent:ow};class de{static _CheckLimit(e,t){let i=de._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},de._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){const i=de._LogLimitOutputs[e];if(!i||!de.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&de[s.name](de.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,s.name??""))}static _AddLogEntry(e){de._LogCache=e+de._LogCache,de.OnNewCacheEntry&&de.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!de._CheckLimit(s,i))return;const r=de._FormatMessage(s),n=this._Levels[e],o=Array.isArray(t)?t.slice(1):[];n.logFunc&&n.logFunc("BJS - "+r,...o);const l=`<div style='color:${n.color}'>${r}</div><br>`;de._AddLogEntry(l),de._GenerateLimitMessage(s,e)}static get LogCache(){return de._LogCache}static ClearLogCache(){de._LogCache="",de._LogLimitOutputs={},de.errorsCount=0}static set LogLevels(e){de.Log=de._LogDisabled,de.Warn=de._LogDisabled,de.Error=de._LogDisabled,[de.MessageLogLevel,de.WarningLogLevel,de.ErrorLogLevel].forEach(t=>{if((e&t)===t){const i=this._Levels[t];de[i.name]=de._LogEnabled.bind(de,t)}})}}de.NoneLogLevel=0,de.MessageLogLevel=1,de.WarningLogLevel=2,de.ErrorLogLevel=4,de.AllLogLevel=7,de.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.",de._LogCache="",de._LogLimitOutputs={},de._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}],de.errorsCount=0,de.Log=de._LogEnabled.bind(de,de.MessageLogLevel),de.Warn=de._LogEnabled.bind(de,de.WarningLogLevel),de.Error=de._LogEnabled.bind(de,de.ErrorLogLevel);const Tue=(a,e,t)=>!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&(a.getClassName()==="SubMesh"||a.getClassName()==="PhysicsBody")?a.clone(e):a.clone?a.clone():Array.isArray(a)?a.slice():t&&typeof a=="object"?{...a}:null;function SPe(a){const e=[];do Object.getOwnPropertyNames(a).forEach(function(t){e.indexOf(t)===-1&&e.push(t)});while(a=Object.getPrototypeOf(a));return e}class nu{static DeepCopy(e,t,i,s,r=!1){const n=SPe(e);for(const o of n){if(o[0]==="_"&&(!s||s.indexOf(o)===-1)||o.endsWith("Observable")||i&&i.indexOf(o)!==-1)continue;const l=e[o],c=typeof l;if(c!=="function")try{if(c==="object")if(l instanceof Uint8Array)t[o]=Uint8Array.from(l);else if(l instanceof Array){if(t[o]=[],l.length>0)if(typeof l[0]=="object")for(let u=0;u<l.length;u++){const f=Tue(l[u],t,r);t[o].indexOf(f)===-1&&t[o].push(f)}else t[o]=l.slice(0)}else t[o]=Tue(l,t,r);else t[o]=l}catch(u){de.Warn(u.message)}}}}class lr{static get Now(){return Il()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}const Lue={};function as(a,e=!1){if(!(e&&Lue[a]))return Lue[a]=!0,`${a} needs to be imported before as it contains a side-effect required by your code.`}function yPe(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class ha{constructor(){this._xhr=yPe(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(ha.CustomRequestHeaders).length>0||ha.CustomRequestModifiers.length>0}get requestURL(){return this._requestURL}_injectCustomRequestHeaders(){if(!this._shouldSkipRequestModifications(this._requestURL))for(const e in ha.CustomRequestHeaders){const t=ha.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}}_shouldSkipRequestModifications(e){return ha.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){ha.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)}open(e,t){for(const i of ha.CustomRequestModifiers){if(this._shouldSkipRequestModifications(t))return;t=i(this._xhr,t)||t}t=t.replace("file:http:","http:"),t=t.replace("file:https:","https:"),this._requestURL=t,this._xhr.open(e,t,!0)}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}ha.CustomRequestHeaders={},ha.CustomRequestModifiers=new Array,ha.SkipRequestModificationForBabylonCDN=!0;class ei{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}ei.Instances=[],ei.OnEnginesDisposedObservable=new xe,ei._LastCreatedScene=null,ei.UseFallbackTexture=!0,ei.FallbackTexture="";class j9{}j9.FilesToLoad={};class Iue{static ExponentialBackoff(e=3,t=500){return(i,s,r)=>s.status!==0||r>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,r)*t}}class py extends Error{}py._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const Xx={MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class Y6 extends py{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",py._setPrototypeOf(this,Y6.prototype)}}class sX extends py{constructor(e="Operation aborted"){super(e),this.name="AbortError",py._setPrototypeOf(this,sX.prototype)}}const Pue=(a,e)=>a.endsWith(e),Oue=(a,e)=>a?a.startsWith(e):!1,rX=a=>{if(typeof TextDecoder<"u")return new TextDecoder().decode(a);let e="";for(let t=0;t<a.byteLength;t++)e+=String.fromCharCode(a[t]);return e},lw=a=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,r,n,o,l,c,u=0;const f=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a);for(;u<f.length;)i=f[u++],s=u<f.length?f[u++]:Number.NaN,r=u<f.length?f[u++]:Number.NaN,n=i>>2,o=(i&3)<<4|s>>4,l=(s&15)<<2|r>>6,c=r&63,isNaN(s)?l=c=64:isNaN(r)&&(c=64),t+=e.charAt(n)+e.charAt(o)+e.charAt(l)+e.charAt(c);return t},WV=a=>atob(a),cw=a=>{const e=WV(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s<t;s++)i[s]=e.charCodeAt(s);return i.buffer},Rue=(a,e)=>{let t=String(a);for(;t.length<e;)t="0"+t;return t},MPe={EndsWith:Pue,StartsWith:Oue,Decode:rX,EncodeArrayBufferToBase64:lw,DecodeBase64ToString:WV,DecodeBase64ToBinary:cw,PadNumber:Rue},EPe="attribute",TPe="varying";class uw{constructor(){this.children=[]}isValid(e){return!0}process(e,t){var s,r,n,o,l,c;let i="";if(this.line){let u=this.line;const f=t.processor;if(f){f.lineProcessor&&(u=f.lineProcessor(u,t.isFragment,t.processingContext));const p=((s=t.processor)==null?void 0:s.attributeKeywordName)??EPe,m=t.isFragment&&((r=t.processor)!=null&&r.varyingFragmentKeywordName)?(n=t.processor)==null?void 0:n.varyingFragmentKeywordName:!t.isFragment&&((o=t.processor)!=null&&o.varyingVertexKeywordName)?(l=t.processor)==null?void 0:l.varyingVertexKeywordName:TPe;!t.isFragment&&f.attributeProcessor&&this.line.startsWith(p)?u=f.attributeProcessor(this.line,e,t.processingContext):f.varyingProcessor&&((c=f.varyingCheck)!=null&&c.call(f,this.line,t.isFragment)||!f.varyingCheck&&this.line.startsWith(m))?u=f.varyingProcessor(this.line,t.isFragment,e,t.processingContext):f.uniformProcessor&&f.uniformRegexp&&f.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&f.uniformBufferRegexp&&f.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):f.textureProcessor&&f.textureRegexp&&f.textureRegexp.test(this.line)?u=f.textureProcessor(this.line,t.isFragment,e,t.processingContext):(f.uniformProcessor||f.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?f.uniformProcessor&&(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,f.endOfUniformBufferProcessor&&(u=f.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}i+=u+` `}return this.children.forEach(u=>{i+=u.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),i}}class LPe{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex<this._lines.length-1}set lines(e){this._lines.length=0;for(const t of e){if(!t||t==="\r")continue;if(t[0]==="#"){this._lines.push(t);continue}const i=t.trim();if(!i)continue;if(i.startsWith("//")){this._lines.push(t);continue}const s=i.indexOf(";");if(s===-1)this._lines.push(i);else if(s===i.length-1)i.length>1&&this._lines.push(i);else{const r=t.split(";");for(let n=0;n<r.length;n++){let o=r[n];o&&(o=o.trim(),o&&this._lines.push(o+(n!==r.length-1?";":"")))}}}}}class nX extends uw{process(e,t){for(let i=0;i<this.children.length;i++){const s=this.children[i];if(s.isValid(e))return s.process(e,t)}return""}}class IPe extends uw{isValid(e){return this.testExpression.isTrue(e)}}class Zo{isTrue(e){return!0}static postfixToInfix(e){const t=[];for(const i of e)if(Zo._OperatorPriority[i]===void 0)t.push(i);else{const s=t[t.length-1],r=t[t.length-2];t.length-=2,t.push(`(${r}${i}${s})`)}return t[t.length-1]}static infixToPostfix(e){const t=Zo._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!e.includes("&&")&&!e.includes("||")&&!e.includes(")")&&!e.includes("("))return[e];const i=[];let s=-1;const r=()=>{u=u.trim(),u!==""&&(i.push(u),u="")},n=f=>{s<Zo._Stack.length-1&&(Zo._Stack[++s]=f)},o=()=>Zo._Stack[s],l=()=>s===-1?"!!INVALID EXPRESSION!!":Zo._Stack[s--];let c=0,u="";for(;c<e.length;){const f=e.charAt(c),p=c<e.length-1?e.substring(c,2+c):"";if(f==="(")u="",n(f);else if(f===")"){for(r();s!==-1&&o()!=="(";)i.push(l());l()}else if(Zo._OperatorPriority[p]>1){for(r();s!==-1&&Zo._OperatorPriority[o()]>=Zo._OperatorPriority[p];)i.push(l());n(p),c++}else u+=f;c++}for(r();s!==-1;)o()==="("?l():i.push(l());return Zo._InfixToPostfixCache.size>=Zo.InfixToPostfixCacheLimitSize&&Zo.ClearCache(),Zo._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(Zo._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t<Zo.InfixToPostfixCacheCleanupSize;t++)Zo._InfixToPostfixCache.delete(e[t][0])}}Zo.InfixToPostfixCacheLimitSize=5e4,Zo.InfixToPostfixCacheCleanupSize=25e3,Zo._InfixToPostfixCache=new Map,Zo._OperatorPriority={")":0,"(":1,"||":2,"&&":3},Zo._Stack=["","","","","","","","","","","","","","","","","","","",""];class HV extends Zo{constructor(e,t=!1){super(),this.define=e,this.not=t}isTrue(e){let t=e[this.define]!==void 0;return this.not&&(t=!t),t}}class PPe extends Zo{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class OPe extends Zo{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class RPe extends Zo{constructor(e,t,i){super(),this.define=e,this.operand=t,this.testValue=i}isTrue(e){let t=e[this.define];t===void 0&&(t=this.define);let i=!1;const s=parseInt(t),r=parseInt(this.testValue);switch(this.operand){case">":i=s>r;break;case"<":i=s<r;break;case"<=":i=s<=r;break;case">=":i=s>=r;break;case"==":i=s===r;break;case"!=":i=s!==r;break}return i}}const YV={};function Due(a,e,t=""){return t+(e?e+`@@ -41516,31 +41511,53 @@ Check the top-level render call using <`+bt+">.")}return $e}function Rn(Ee,$e){i   \**********************/f.r(p),f.d(p,{default:()=>_,inspector:()=>m});var m=f("../../../dev/inspector/dist/legacy/legacy.js");const _=m})(),p=p.default,p})())})(Y9e);var L$e=Y9e.exports;const I$e=B9({__proto__:null},[L$e])})(); </script> <script>-var MPN="STM32F103C8T6", GLB="../stm32f103c8t6-board.glb";-var v=null;+var MPN="STM32F103C8T6", GLB="../stm32f103c8t6-board.glb", MARKS=["STM32F103C8T6"];+var v=null, B=(window.Adom3DViewer&&Adom3DViewer.BABYLON)||{}; function rmPh(){var p=document.getElementById('ph');if(p)p.remove();}+// the viewer adds helper meshes (skybox, indicator) immediately; wait for the real model+function isHelper(n){return /arcrotate|background|skybox|indicator|helper|ground|viewcube|viewerroot|laseretch|dbg/i.test(n||'');}+function realMeshes(s){return (s.meshes||[]).filter(function(m){return m.getTotalVertices&&m.getTotalVertices()>0 && !isHelper(m.name);});}+function bounds(s){var mm=realMeshes(s),lo=null,hi=null;mm.forEach(function(m){try{m.computeWorldMatrix(true);var bb=m.getBoundingInfo().boundingBox;lo=lo?B.Vector3.Minimize(lo,bb.minimumWorld):bb.minimumWorld.clone();hi=hi?B.Vector3.Maximize(hi,bb.maximumWorld):bb.maximumWorld.clone();}catch(_){}});return (lo&&hi)?{lo:lo,hi:hi}:null;} try{   v=Adom3DViewer.init(document.getElementById('stage'),{modelUrl:GLB,zUp:true,showGround:false,showViewCube:true,initialViewMode:"perspective"});-  // wait for real geometry, then frame the camera on it   var tries=0, iv=setInterval(function(){     tries++;-    try{-      var s=v.getScene(), real=(s.meshes||[]).filter(function(m){return m.getTotalVertices&&m.getTotalVertices()>0;});-      if(real.length){ try{v.frameModel&&v.frameModel();}catch(_){} try{v.goHome&&v.goHome();}catch(_){} rmPh(); clearInterval(iv); }-    }catch(_){}-    if(tries>60){ clearInterval(iv); var p=document.getElementById('ph'); if(p)p.textContent='3D: model did not load ('+GLB+')'; }+    try{ var s=v.getScene(); if(realMeshes(s).length){ try{v.frameModel&&v.frameModel();}catch(_){} try{v.goHome&&v.goHome();}catch(_){} rmPh(); clearInterval(iv); onReady(s); } }catch(_){}+    if(tries>60){ clearInterval(iv); var p=document.getElementById('ph'); if(p)p.textContent='3D: model did not load'; }   },200);-}catch(err){var p=document.getElementById('ph');if(p)p.textContent='3D unavailable: '+err;}-function meshes(){try{return (v.getScene().meshes)||[];}catch(_){return [];}}-[].slice.call(document.querySelectorAll('.lyrtog')).forEach(function(b){-  b.addEventListener('click',function(){-    var on=b.classList.toggle('on'), key=b.getAttribute('data-mesh');-    meshes().forEach(function(m){ if((m.name||'').toLowerCase().indexOf(key)>=0) m.setEnabled(on); });-  });-});-// cross-highlight bus: 3D joins as a listener (per-lead highlight is a follow-up;-// leads aren't individually named in the merged GLB yet).-window.addEventListener('message',function(e){var d=e.data||{};if(d.type!=='lbr-hover')return;/* future: highlight lead for d.pin */});+}catch(err){ var p=document.getElementById('ph'); if(p)p.textContent='3D unavailable: '+err; }++function onReady(s){+  try{ if(MARKS && MARKS.length) addEtch(s, MARKS); }catch(_){}+  var rb=document.getElementById('reset'); if(rb) rb.addEventListener('click',function(){ try{v.goHome&&v.goHome();}catch(_){} });+}++// laser-etch the MFR part number onto the model's top face. (World up is +Y here;+// chips are laser-marked but the industry never bakes it into the STEP — so we add it.)+function addEtch(s, lines){+  if(!B.DynamicTexture || !B.MeshBuilder) return;+  var bnd=bounds(s); if(!bnd) return;+  var dx=bnd.hi.x-bnd.lo.x, dz=bnd.hi.z-bnd.lo.z, cx=(bnd.lo.x+bnd.hi.x)/2, cz=(bnd.lo.z+bnd.hi.z)/2, topy=bnd.hi.y;+  if(!(dx>0&&dz>0)) return;+  var side=Math.min(dx,dz)*0.55;                    // the chip body is ~55% of the board footprint+  var W=1024, H=1024;+  var tex=new B.DynamicTexture("etchTex",{width:W,height:H},s,true), ctx=tex.getContext();+  ctx.clearRect(0,0,W,H); ctx.fillStyle="rgba(200,203,207,0.95)"; ctx.textAlign="center"; ctx.textBaseline="middle";+  var n=lines.length, fs=Math.min(Math.round(H*0.42/n), Math.round(W*0.13)); ctx.font="700 "+fs+"px monospace";+  for(var i=0;i<n;i++) ctx.fillText(String(lines[i]), W/2, H*(i+1)/(n+1));+  ctx.beginPath(); ctx.arc(W*0.16, H*0.20, fs*0.24, 0, 7); ctx.fill();   // pin-1 dimple mark+  tex.update();+  var mat=new B.StandardMaterial("etchMat",s);+  mat.diffuseTexture=tex; tex.hasAlpha=true; mat.useAlphaFromDiffuseTexture=true;+  mat.emissiveColor=new B.Color3(0.80,0.81,0.82); mat.disableLighting=true; mat.backFaceCulling=false;+  var pl=B.MeshBuilder.CreatePlane("laserEtch",{size:side,sideOrientation:2},s);+  pl.rotation=new B.Vector3(-Math.PI/2,0,0);        // lay flat, facing +Y (up)+  pl.position=new B.Vector3(cx, topy+Math.max(dx,dz)*0.004, cz);+  pl.material=mat; pl.isPickable=false;+}++// cross-highlight bus: 3D joins as a listener (per-lead highlight needs named leads)+window.addEventListener('message',function(e){var d=e.data||{};if(d.type!=='lbr-hover')return;}); function ph(){parent.postMessage({type:'readme-height',height:Math.max(360,document.body.scrollHeight||420)},'*');} window.addEventListener('load',ph);setTimeout(ph,400); </script>