diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..2aa028da3 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +manifoldcad.org diff --git a/assets/__vite-browser-external-4ed993c7.js b/assets/__vite-browser-external-4ed993c7.js new file mode 100644 index 000000000..f225f88c7 --- /dev/null +++ b/assets/__vite-browser-external-4ed993c7.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=__vite-browser-external-4ed993c7.js.map diff --git a/assets/__vite-browser-external-4ed993c7.js.map b/assets/__vite-browser-external-4ed993c7.js.map new file mode 100644 index 000000000..0077b8286 --- /dev/null +++ b/assets/__vite-browser-external-4ed993c7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"__vite-browser-external-4ed993c7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/assets/__vite-browser-external.js b/assets/__vite-browser-external.js new file mode 100644 index 000000000..5173ed92d --- /dev/null +++ b/assets/__vite-browser-external.js @@ -0,0 +1,2 @@ +const e={};export{e as default}; +//# sourceMappingURL=__vite-browser-external.js.map diff --git a/assets/__vite-browser-external.js.map b/assets/__vite-browser-external.js.map new file mode 100644 index 000000000..28564850a --- /dev/null +++ b/assets/__vite-browser-external.js.map @@ -0,0 +1 @@ +{"version":3,"file":"__vite-browser-external.js","sources":["../../__vite-browser-external"],"sourcesContent":["export default {}"],"names":["__viteBrowserExternal"],"mappings":"AAAA,MAAeA,EAAA,CAAA"} \ No newline at end of file diff --git a/assets/gltf-io.js b/assets/gltf-io.js new file mode 100644 index 000000000..b90f2fef9 --- /dev/null +++ b/assets/gltf-io.js @@ -0,0 +1,21 @@ +class mt{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;return s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t),this}removeEventListener(e,t){if(this._listeners===void 0)return this;const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}return this}dispatchEvent(e){if(this._listeners===void 0)return this;const s=this._listeners[e.type];if(s!==void 0){const i=s.slice(0);for(let n=0,a=i.length;nt.getParent())}listChildEdges(e){return Array.from(this._parentEdges.get(e)||this._emptySet)}listChildren(e){return this.listChildEdges(e).map(t=>t.getChild())}disconnectParents(e,t){let s=this.listParentEdges(e);return t&&(s=s.filter(i=>t(i.getParent()))),s.forEach(i=>i.dispose()),this}createEdge(e,t,s,i){return this._registerEdge(new fe(e,t,s,i))}_registerEdge(e){this._edges.add(e);const t=e.getParent();this._parentEdges.has(t)||this._parentEdges.set(t,new Set),this._parentEdges.get(t).add(e);const s=e.getChild();return this._childEdges.has(s)||this._childEdges.set(s,new Set),this._childEdges.get(s).add(e),e.addEventListener("dispose",()=>this._removeEdge(e)),e}_removeEdge(e){return this._edges.delete(e),this._parentEdges.get(e.getParent()).delete(e),this._childEdges.get(e.getChild()).delete(e),this}}function we(){return we=Object.assign||function(r){for(var e=1;ei.dispose()),this[le].add(s),t[s]=n}else t[s]=i}return t}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"}))}detach(){return this.graph.disconnectParents(this),this}swap(e,t){for(const s in this[L]){const i=this[L][s];if(ot(i)){const n=i;n.getChild()===e&&this.setRef(s,t,n.getAttributes())}else if(Te(i)){const a=i.find(c=>c.getChild()===e);if(a){const c=a.getAttributes();this.removeRef(s,e).addRef(s,t,c)}}else if(be(i)){const n=i;for(const a in n){const c=n[a];c.getChild()===e&&this.setRefMap(s,a,t,c.getAttributes())}}}return this}get(e){return this[L][e]}set(e,t){return this[L][e]=t,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const t=this[L][e];return t?t.getChild():null}setRef(e,t,s){if(this[le].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const i=this[L][e];if(i&&i.dispose(),!t)return this;const n=this.graph.createEdge(e,this,t,s);return n.addEventListener("dispose",()=>{delete this[L][e],this.dispatchEvent({type:"change",attribute:e})}),this[L][e]=n,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this[L][e].map(s=>s.getChild())}addRef(e,t,s){const i=this.graph.createEdge(e,this,t,s),n=this[L][e];return n.push(i),i.addEventListener("dispose",()=>{let a;for(;(a=n.indexOf(i))!==-1;)n.splice(a,1);this.dispatchEvent({type:"change",attribute:e})}),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,t){return this[L][e].filter(n=>n.getChild()===t).forEach(n=>n.dispose()),this}listRefMapKeys(e){return Object.keys(this[L][e])}listRefMapValues(e){return Object.values(this[L][e]).map(t=>t.getChild())}getRefMap(e,t){const s=this[L][e];return s[t]?s[t].getChild():null}setRefMap(e,t,s,i){const n=this[L][e],a=n[t];if(a&&a.dispose(),!s)return this;i=Object.assign(i||{},{key:t});const c=this.graph.createEdge(e,this,s,we({},i,{key:t}));return c.addEventListener("dispose",()=>{delete n[t],this.dispatchEvent({type:"change",attribute:e,key:t})}),n[t]=c,this.dispatchEvent({type:"change",attribute:e,key:t})}dispatchEvent(e){return super.dispatchEvent(we({},e,{target:this})),this.graph.dispatchEvent(we({},e,{target:this,type:`node:${e.type}`})),this}}const $t="v3.8.0",Ge="@glb.bin";var M,ze,$,ct,se;(function(r){r.ACCESSOR="Accessor",r.ANIMATION="Animation",r.ANIMATION_CHANNEL="AnimationChannel",r.ANIMATION_SAMPLER="AnimationSampler",r.BUFFER="Buffer",r.CAMERA="Camera",r.MATERIAL="Material",r.MESH="Mesh",r.PRIMITIVE="Primitive",r.PRIMITIVE_TARGET="PrimitiveTarget",r.NODE="Node",r.ROOT="Root",r.SCENE="Scene",r.SKIN="Skin",r.TEXTURE="Texture",r.TEXTURE_INFO="TextureInfo"})(M||(M={})),function(r){r.INTERLEAVED="interleaved",r.SEPARATE="separate"}(ze||(ze={})),function(r){r.ARRAY_BUFFER="ARRAY_BUFFER",r.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",r.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",r.OTHER="OTHER",r.SPARSE="SPARSE"}($||($={})),function(r){r[r.R=4096]="R",r[r.G=256]="G",r[r.B=16]="B",r[r.A=1]="A"}(ct||(ct={})),function(r){r.GLTF="GLTF",r.GLB="GLB"}(se||(se={}));const $e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var Pe,ut=typeof Float32Array<"u"?Float32Array:Array;function rt(r){return Math.hypot(r[0],r[1],r[2])}function wr(r,e,t){var s=e[0],i=e[1],n=e[2],a=t[3]*s+t[7]*i+t[11]*n+t[15];return r[0]=(t[0]*s+t[4]*i+t[8]*n+t[12])/(a=a||1),r[1]=(t[1]*s+t[5]*i+t[9]*n+t[13])/a,r[2]=(t[2]*s+t[6]*i+t[10]*n+t[14])/a,r}function Js(r){const e={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]},t=r.propertyType===M.NODE?[r]:r.listChildren();for(const s of t)s.traverse(i=>{const n=i.getMesh();if(!n)return;const a=Rr(n,i.getWorldMatrix());lt(a.min,e),lt(a.max,e)});return e}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)}),Pe=new ut(3),ut!=Float32Array&&(Pe[0]=0,Pe[1]=0,Pe[2]=0);function Rr(r,e){const t={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]};for(const s of r.listPrimitives()){const i=s.getAttribute("POSITION");if(!i)continue;let n=[0,0,0],a=[0,0,0];for(let c=0;c"u"){const t=atob(e.split(",")[1]),s=new Uint8Array(t.length);for(let i=0;i=0;return Buffer.from(t,s?"base64":"utf8")}}static encodeText(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}static decodeText(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}static concat(e){let t=0;for(const n of e)t+=n.byteLength;const s=new Uint8Array(t);let i=0;for(const n of e)s.set(n,i),i+=n.byteLength;return s}static pad(e,t=0){const s=this.padNumber(e.byteLength);if(s===e.byteLength)return e;const i=new Uint8Array(s);if(i.set(e),t!==0)for(let n=e.byteLength;n>16&255)/255,s[1]=(e>>8&255)/255,s[2]=(255&e)/255,this.convertSRGBToLinear(t,t)}static factorToHex(e){const t=[...e],[s,i,n]=this.convertLinearToSRGB(e,t);return 255*s<<16^255*i<<8^255*n<<0}static convertSRGBToLinear(e,t){const s=e,i=t;for(let n=0;n<3;n++)i[n]=s[n]<.04045?.0773993808*s[n]:Math.pow(.9478672986*s[n]+.0521327014,2.4);return t}static convertLinearToSRGB(e,t){const s=e,i=t;for(let n=0;n<3;n++)i[n]=s[n]<.0031308?12.92*s[n]:1.055*Math.pow(s[n],.41666)-.055;return t}}class Je{match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){const t=new DataView(e.buffer,e.byteOffset);return F.decodeText(e.slice(12,16))===Je.PNG_FRIED_CHUNK_NAME?[t.getUint32(32,!1),t.getUint32(36,!1)]:[t.getUint32(16,!1),t.getUint32(20,!1)]}getChannels(e){return 4}}Je.PNG_FRIED_CHUNK_NAME="CgBI";class ne{static registerFormat(e,t){this.impls[e]=t}static getMimeType(e){for(const t in this.impls)if(this.impls[t].match(e))return t;return null}static getSize(e,t){return this.impls[t]?this.impls[t].getSize(e):null}static getChannels(e,t){return this.impls[t]?this.impls[t].getChannels(e):null}static getVRAMByteLength(e,t){if(!this.impls[t])return null;if(this.impls[t].getVRAMByteLength)return this.impls[t].getVRAMByteLength(e);let s=0;const i=this.getSize(e,t);if(!i)return null;for(;i[0]>1||i[1]>1;)s+=i[0]*i[1]*4,i[0]=Math.max(Math.floor(i[0]/2),1),i[1]=Math.max(Math.floor(i[1]/2),1);return s+=4,s}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}}function Ir(r,e){if(e>r.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(r.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return r}ne.impls={"image/jpeg":new class{match(r){return r.length>=3&&r[0]===255&&r[1]===216&&r[2]===255}getSize(r){let e,t,s=new DataView(r.buffer,r.byteOffset+4);for(;s.byteLength;){if(e=s.getUint16(0,!1),Ir(s,e),t=s.getUint8(e+1),t===192||t===193||t===194)return[s.getUint16(e+7,!1),s.getUint16(e+5,!1)];s=new DataView(r.buffer,s.byteOffset+e+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(r){return 3}},"image/png":new Je};class ge{static basename(e){const t=e.split(/[\\/]/).pop();return t.substring(0,t.lastIndexOf("."))}static extension(e){if(e.startsWith("data:image/")){const t=e.match(/data:(image\/\w+)/)[1];return ne.mimeTypeToExtension(t)}return e.startsWith("data:model/gltf+json")?"gltf":e.startsWith("data:model/gltf-binary")?"glb":e.startsWith("data:application/")?"bin":e.split(/[\\/]/).pop().split(/[.]/).pop()}}function At(r){return Object.prototype.toString.call(r)==="[object Object]"}function re(r){if(At(r)===!1)return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return At(t)!==!1&&Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")!==!1}var st,ht;(function(r){r[r.SILENT=4]="SILENT",r[r.ERROR=3]="ERROR",r[r.WARN=2]="WARN",r[r.INFO=1]="INFO",r[r.DEBUG=0]="DEBUG"})(ht||(ht={}));let ie=class Ae{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=Ae.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=Ae.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=Ae.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=Ae.Verbosity.ERROR&&console.error(e)}};function xr(r,e,t){var s=e[0],i=e[1],n=e[2],a=e[3],c=e[4],o=e[5],g=e[6],m=e[7],T=e[8],p=e[9],y=e[10],A=e[11],I=e[12],l=e[13],b=e[14],u=e[15],h=t[0],f=t[1],d=t[2],E=t[3];return r[0]=h*s+f*c+d*T+E*I,r[1]=h*i+f*o+d*p+E*l,r[2]=h*n+f*g+d*y+E*b,r[3]=h*a+f*m+d*A+E*u,r[4]=(h=t[4])*s+(f=t[5])*c+(d=t[6])*T+(E=t[7])*I,r[5]=h*i+f*o+d*p+E*l,r[6]=h*n+f*g+d*y+E*b,r[7]=h*a+f*m+d*A+E*u,r[8]=(h=t[8])*s+(f=t[9])*c+(d=t[10])*T+(E=t[11])*I,r[9]=h*i+f*o+d*p+E*l,r[10]=h*n+f*g+d*y+E*b,r[11]=h*a+f*m+d*A+E*u,r[12]=(h=t[12])*s+(f=t[13])*c+(d=t[14])*T+(E=t[15])*I,r[13]=h*i+f*o+d*p+E*l,r[14]=h*n+f*g+d*y+E*b,r[15]=h*a+f*m+d*A+E*u,r}st=ie,ie.Verbosity=ht,ie.DEFAULT_INSTANCE=new st(st.Verbosity.INFO);class B{static identity(e){return e}static eq(e,t,s=1e-5){if(e.length!==t.length)return!1;for(let i=0;is)return!1;return!0}static decodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static denormalize(e,t){return B.decodeNormalizedInt(e,t)}static encodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return Math.round(65535*e);case 5121:return Math.round(255*e);case 5122:return Math.round(32767*e);case 5120:return Math.round(127*e);default:throw new Error("Invalid component type.")}}static normalize(e,t){return B.encodeNormalizedInt(e,t)}static decompose(e,t,s,i){let n=rt([e[0],e[1],e[2]]);const a=rt([e[4],e[5],e[6]]),c=rt([e[8],e[9],e[10]]);var o,g,m,T,p,y,A,I,l,b,u,h,f,d,E,x,N;((g=(o=e)[0])*(A=o[5])-(m=o[1])*(y=o[4]))*((h=o[10])*(N=o[15])-(f=o[11])*(x=o[14]))-(g*(I=o[6])-(T=o[2])*y)*((u=o[9])*N-f*(E=o[13]))+(g*(l=o[7])-(p=o[3])*y)*(u*x-h*E)+(m*I-T*A)*((b=o[8])*N-f*(d=o[12]))-(m*l-p*A)*(b*x-h*d)+(T*l-p*I)*(b*E-u*d)<0&&(n=-n),t[0]=e[12],t[1]=e[13],t[2]=e[14];const v=e.slice(),w=1/n,R=1/a,O=1/c;v[0]*=w,v[1]*=w,v[2]*=w,v[4]*=R,v[5]*=R,v[6]*=R,v[8]*=O,v[9]*=O,v[10]*=O,function(S,_){var V=new ut(3);(function(tt,J){var pr=J[4],dr=J[5],mr=J[6],yr=J[8],Er=J[9],Tr=J[10];tt[0]=Math.hypot(J[0],J[1],J[2]),tt[1]=Math.hypot(pr,dr,mr),tt[2]=Math.hypot(yr,Er,Tr)})(V,_);var P=1/V[0],j=1/V[1],D=1/V[2],k=_[0]*P,Z=_[1]*j,ae=_[2]*D,q=_[4]*P,Q=_[5]*j,ee=_[6]*D,Oe=_[8]*P,Ve=_[9]*j,oe=_[10]*D,vt=k+Q+oe,U=0;vt>0?(U=2*Math.sqrt(vt+1),S[3]=.25*U,S[0]=(ee-Ve)/U,S[1]=(Oe-ae)/U,S[2]=(Z-q)/U):k>Q&&k>oe?(U=2*Math.sqrt(1+k-Q-oe),S[3]=(ee-Ve)/U,S[0]=.25*U,S[1]=(Z+q)/U,S[2]=(Oe+ae)/U):Q>oe?(U=2*Math.sqrt(1+Q-k-oe),S[3]=(Oe-ae)/U,S[0]=(Z+q)/U,S[1]=.25*U,S[2]=(ee+Ve)/U):(U=2*Math.sqrt(1+oe-k-Q),S[3]=(Z-q)/U,S[0]=(Oe+ae)/U,S[1]=(ee+Ve)/U,S[2]=.25*U)}(s,v),i[0]=n,i[1]=a,i[2]=c}static compose(e,t,s,i){const n=i,a=t[0],c=t[1],o=t[2],g=t[3],m=a+a,T=c+c,p=o+o,y=a*m,A=a*T,I=a*p,l=c*T,b=c*p,u=o*p,h=g*m,f=g*T,d=g*p,E=s[0],x=s[1],N=s[2];return n[0]=(1-(l+u))*E,n[1]=(A+d)*E,n[2]=(I-f)*E,n[3]=0,n[4]=(A-d)*x,n[5]=(1-(y+u))*x,n[6]=(b+h)*x,n[7]=0,n[8]=(I+f)*N,n[9]=(b-h)*N,n[10]=(1-(y+l))*N,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}}function Mr(r,e){if(!!r!=!!e)return!1;const t=r.getChild(),s=e.getChild();return t===s||t.equals(s)}function _r(r,e){if(!!r!=!!e||r.length!==e.length)return!1;for(let t=0;tr,Or=new Set;class Et extends yt{constructor(e,t=""){super(e),this[L].name=t,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(e,t){return Array.isArray(t)&&(t=t.slice()),super.set(e,t)}getName(){return this.get("name")}setName(e){return this.set("name",e)}getExtras(){return this.get("extras")}setExtras(e){return this.set("extras",e)}clone(){return new this.constructor(this.graph).copy(this,K)}copy(e,t=K){for(const s in this[L]){const i=this[L][s];if(i instanceof fe)this[le].has(s)||i.dispose();else if(Te(i))for(const n of i)n.dispose();else if(be(i))for(const n in i)i[n].dispose()}for(const s in e[L]){const i=this[L][s],n=e[L][s];if(n instanceof fe)this[le].has(s)?i.getChild().copy(t(n.getChild()),t):this.setRef(s,t(n.getChild()),n.getAttributes());else if(Te(n))for(const a of n)this.addRef(s,t(a.getChild()),a.getAttributes());else if(be(n))for(const a in n){const c=n[a];this.setRefMap(s,a,t(c.getChild()),c.getAttributes())}else this[L][s]=re(n)?JSON.parse(JSON.stringify(n)):Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.slice():n}return this}equals(e,t=Or){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const s in this[L]){if(t.has(s))continue;const i=this[L][s],n=e[L][s];if(ot(i)||ot(n)){if(!Mr(i,n))return!1}else if(Te(i)||Te(n)){if(!_r(i,n))return!1}else if(be(i)||be(n)){if(!Nr(i,n))return!1}else if(re(i)||re(n)){if(!Wt(i,n))return!1}else if(qe(i)||qe(n)){if(!qt(i,n))return!1}else if(i!==n)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}let z=class extends Et{getDefaults(){return Object.assign(super.getDefaults(),{extensions:{}})}getExtension(e){return this.getRefMap("extensions",e)}setExtension(e,t){return t&&t.t(this),this.setRefMap("extensions",e,t)}listExtensions(){return this.listRefMapValues("extensions")}};class C extends z{constructor(...e){super(...e),this.i=B.identity,this.o=B.identity}init(){this.propertyType=M.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:C.Type.SCALAR,componentType:C.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}copy(e,t=K){return super.copy(e,t),this.i=e.i,this.o=e.o,this}static getElementSize(e){switch(e){case C.Type.SCALAR:return 1;case C.Type.VEC2:return 2;case C.Type.VEC3:return 3;case C.Type.VEC4:case C.Type.MAT2:return 4;case C.Type.MAT3:return 9;case C.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case C.ComponentType.BYTE:case C.ComponentType.UNSIGNED_BYTE:return 1;case C.ComponentType.SHORT:case C.ComponentType.UNSIGNED_SHORT:return 2;case C.ComponentType.UNSIGNED_INT:case C.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){const t=this.getElementSize();this.getMin(e);for(let s=0;sB.decodeNormalizedInt(t,this.get("componentType")),this.i=t=>B.encodeNormalizedInt(t,this.get("componentType"))):(this.o=B.identity,this.i=B.identity),this}getScalar(e){const t=this.getElementSize();return this.o(this.get("array")[e*t])}setScalar(e,t){return this.get("array")[e*this.getElementSize()]=this.i(t),this}getElement(e,t){const s=this.getElementSize(),i=this.get("array");for(let n=0;ne.u=null),this}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}getParent(){return this.u?this.u:this.listParents().find(e=>e.propertyType===M.SCENE)||null}getParentNode(){return this.u}getMesh(){return this.getRef("mesh")}setMesh(e){return this.setRef("mesh",e)}getCamera(){return this.getRef("camera")}setCamera(e){return this.setRef("camera",e)}getSkin(){return this.getRef("skin")}setSkin(e){return this.setRef("skin",e)}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}traverse(e){e(this);for(const t of this.listChildren())t.traverse(e);return this}},de=class Qt extends z{init(){this.propertyType=M.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:Qt.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:$.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:$.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}};de.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};let er=class extends Et{init(){this.propertyType=M.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:$.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}};function G(){return G=Object.assign?Object.assign.bind():function(r){for(var e=1;ee.h.delete(this)),this}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}traverse(e){for(const t of this.listChildren())t.traverse(e);return this}};class tr extends z{init(){this.propertyType=M.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:[]})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(e){return this.setRef("skeleton",e)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(e){return this.setRef("inverseBindMatrices",e,{usage:$.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}}let _e=class extends z{init(){this.propertyType=M.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||ne.extensionToMimeType(ge.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const t=ne.extensionToMimeType(ge.extension(e));return t&&this.set("mimeType",t),this}getImage(){return this.get("image")}setImage(e){return this.set("image",F.assertView(e))}getSize(){const e=this.get("image");return e?ne.getSize(e,this.getMimeType()):null}},rr=class extends z{init(){this.propertyType=M.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${$t}`,version:"2.0"},defaultScene:null,accessors:[],animations:[],buffers:[],cameras:[],materials:[],meshes:[],nodes:[],scenes:[],skins:[],textures:[]})}constructor(e){super(e),this.l=new Set,e.addEventListener("node:create",t=>{this.g(t.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(e,t=K){if(t===K)throw new Error("Root cannot be copied.");this.set("asset",G({},e.get("asset"))),this.setName(e.getName()),this.setExtras(G({},e.getExtras())),this.setDefaultScene(e.getDefaultScene()?t(e.getDefaultScene()):null);for(const s of e.listRefMapKeys("extensions")){const i=e.getExtension(s);this.setExtension(s,t(i))}return this}g(e){return e instanceof Ze?this.addRef("scenes",e):e instanceof Zt?this.addRef("nodes",e):e instanceof Se?this.addRef("cameras",e):e instanceof tr?this.addRef("skins",e):e instanceof Kt?this.addRef("meshes",e):e instanceof pe?this.addRef("materials",e):e instanceof _e?this.addRef("textures",e):e instanceof Yt?this.addRef("animations",e):e instanceof C?this.addRef("accessors",e):e instanceof Ht&&this.addRef("buffers",e),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this.l)}listExtensionsRequired(){return this.listExtensionsUsed().filter(e=>e.isRequired())}p(e){return this.l.add(e),this}m(e){return this.l.delete(e),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(e){return this.setRef("defaultScene",e)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}},Qe=class ke{static fromGraph(e){return ke.v.get(e)||null}constructor(){this.T=new br,this.S=new rr(this.T),this.M=ie.DEFAULT_INSTANCE,ke.v.set(this.T,this)}getRoot(){return this.S}getGraph(){return this.T}getLogger(){return this.M}setLogger(e){return this.M=e,this}clone(){return new ke().setLogger(this.M).merge(this)}merge(e){for(const n of e.getRoot().listExtensionsUsed()){const a=this.createExtension(n.constructor);n.isRequired()&&a.setRequired(!0)}const t=new Set,s=new Map;t.add(e.S),s.set(e.S,this.S);for(const n of e.T.listEdges())for(const a of[n.getParent(),n.getChild()]){if(t.has(a))continue;let c;c=a.propertyType===M.TEXTURE_INFO?a:new a.constructor(this.T),s.set(a,c),t.add(a)}const i=n=>{const a=s.get(n);if(!a)throw new Error("Could resolve property.");return a};for(const n of t){const a=s.get(n);if(!a)throw new Error("Could resolve property.");a.propertyType!==M.TEXTURE_INFO&&a.copy(n,i)}return this}async transform(...e){const t=e.map(s=>s.name);for(const s of e)await s(this,{stack:t});return this}createExtension(e){const t=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(s=>s.extensionName===t)||new e(this)}createScene(e=""){return new Ze(this.T,e)}createNode(e=""){return new Zt(this.T,e)}createCamera(e=""){return new Se(this.T,e)}createSkin(e=""){return new tr(this.T,e)}createMesh(e=""){return new Kt(this.T,e)}createPrimitive(){return new de(this.T)}createPrimitiveTarget(e=""){return new er(this.T,e)}createMaterial(e=""){return new pe(this.T,e)}createTexture(e=""){return new _e(this.T,e)}createAnimation(e=""){return new Yt(this.T,e)}createAnimationChannel(e=""){return new Ke(this.T,e)}createAnimationSampler(e=""){return new Ne(this.T,e)}createAccessor(e="",t=null){return t||(t=this.getRoot().listBuffers()[0]),new C(this.T,e).setBuffer(t)}createBuffer(e=""){return new Ht(this.T,e)}};Qe.v=new WeakMap;class sr{constructor(e){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this.I=void 0,this.document=e,e.getRoot().p(this),this.I=s=>{const i=s,n=i.target;n instanceof Ce&&n.extensionName===this.extensionName&&(i.type==="node:create"&&this.N(n),i.type==="node:dispose"&&this.O(n))};const t=e.getGraph();t.addEventListener("node:create",this.I),t.addEventListener("node:dispose",this.I)}dispose(){this.document.getRoot().m(this);const e=this.document.getGraph();e.removeEventListener("node:create",this.I),e.removeEventListener("node:dispose",this.I);for(const t of this.properties)t.dispose()}static register(){}isRequired(){return this.required}setRequired(e){return this.required=e,this}listProperties(){return Array.from(this.properties)}N(e){return this.properties.add(e),this}O(e){return this.properties.delete(e),this}install(e,t){return this}preread(e,t){return this}prewrite(e,t){return this}}sr.EXTENSION_NAME=void 0;let Pr=class{constructor(e){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=e}setTextureInfo(e,t){this.textureInfos.set(e,t),t.texCoord!==void 0&&e.setTexCoord(t.texCoord),t.extras!==void 0&&e.setExtras(t.extras);const s=this.jsonDoc.json.textures[t.index];if(s.sampler===void 0)return;const i=this.jsonDoc.json.samplers[s.sampler];i.magFilter!==void 0&&e.setMagFilter(i.magFilter),i.minFilter!==void 0&&e.setMinFilter(i.minFilter),i.wrapS!==void 0&&e.setWrapS(i.wrapS),i.wrapT!==void 0&&e.setWrapT(i.wrapT)}};const It={logger:ie.DEFAULT_INSTANCE,extensions:[],dependencies:{}};let Fr=class{static read(e,t=It){const s=G({},It,t),{json:i}=e,n=new Qe().setLogger(s.logger);this.validate(e,s);const a=new Pr(e),c=i.asset,o=n.getRoot().getAsset();c.copyright&&(o.copyright=c.copyright),c.extras&&(o.extras=c.extras),i.extras!==void 0&&n.getRoot().setExtras(G({},i.extras));const g=i.extensionsUsed||[],m=i.extensionsRequired||[];for(const u of s.extensions)if(g.includes(u.EXTENSION_NAME)){const h=n.createExtension(u).setRequired(m.includes(u.EXTENSION_NAME));for(const f of h.readDependencies)h.install(f,s.dependencies[f])}const T=i.buffers||[];n.getRoot().listExtensionsUsed().filter(u=>u.prereadTypes.includes(M.BUFFER)).forEach(u=>u.preread(a,M.BUFFER)),a.buffers=T.map(u=>{const h=n.createBuffer(u.name);return u.extras&&h.setExtras(u.extras),u.uri&&u.uri.indexOf("__")!==0&&h.setURI(u.uri),h}),a.bufferViewBuffers=(i.bufferViews||[]).map((u,h)=>{if(!a.bufferViews[h]){const f=e.json.buffers[u.buffer];a.bufferViews[h]=F.toView(f.uri?e.resources[f.uri]:e.resources[Ge],u.byteOffset||0,u.byteLength)}return a.buffers[u.buffer]});const p=i.accessors||[];a.accessors=p.map(u=>{const h=n.createAccessor(u.name,a.bufferViewBuffers[u.bufferView]).setType(u.type);return u.extras&&h.setExtras(u.extras),u.normalized!==void 0&&h.setNormalized(u.normalized),u.bufferView===void 0||h.setArray(Be(u,a)),h});const y=i.images||[],A=i.textures||[];n.getRoot().listExtensionsUsed().filter(u=>u.prereadTypes.includes(M.TEXTURE)).forEach(u=>u.preread(a,M.TEXTURE)),a.textures=y.map(u=>{const h=n.createTexture(u.name);if(u.extras&&h.setExtras(u.extras),u.bufferView!==void 0){const f=i.bufferViews[u.bufferView],d=e.json.buffers[f.buffer],E=f.byteOffset||0,x=(d.uri?e.resources[d.uri]:e.resources[Ge]).slice(E,E+f.byteLength);h.setImage(x)}else u.uri!==void 0&&(h.setImage(e.resources[u.uri]),u.uri.indexOf("__")!==0&&h.setURI(u.uri));if(u.mimeType!==void 0)h.setMimeType(u.mimeType);else if(u.uri){const f=ge.extension(u.uri);h.setMimeType(ne.extensionToMimeType(f))}return h}),a.materials=(i.materials||[]).map(u=>{const h=n.createMaterial(u.name);u.extras&&h.setExtras(u.extras),u.alphaMode!==void 0&&h.setAlphaMode(u.alphaMode),u.alphaCutoff!==void 0&&h.setAlphaCutoff(u.alphaCutoff),u.doubleSided!==void 0&&h.setDoubleSided(u.doubleSided);const f=u.pbrMetallicRoughness||{};if(f.baseColorFactor!==void 0&&h.setBaseColorFactor(f.baseColorFactor),u.emissiveFactor!==void 0&&h.setEmissiveFactor(u.emissiveFactor),f.metallicFactor!==void 0&&h.setMetallicFactor(f.metallicFactor),f.roughnessFactor!==void 0&&h.setRoughnessFactor(f.roughnessFactor),f.baseColorTexture!==void 0){const d=f.baseColorTexture;h.setBaseColorTexture(a.textures[A[d.index].source]),a.setTextureInfo(h.getBaseColorTextureInfo(),d)}if(u.emissiveTexture!==void 0){const d=u.emissiveTexture;h.setEmissiveTexture(a.textures[A[d.index].source]),a.setTextureInfo(h.getEmissiveTextureInfo(),d)}if(u.normalTexture!==void 0){const d=u.normalTexture;h.setNormalTexture(a.textures[A[d.index].source]),a.setTextureInfo(h.getNormalTextureInfo(),d),u.normalTexture.scale!==void 0&&h.setNormalScale(u.normalTexture.scale)}if(u.occlusionTexture!==void 0){const d=u.occlusionTexture;h.setOcclusionTexture(a.textures[A[d.index].source]),a.setTextureInfo(h.getOcclusionTextureInfo(),d),u.occlusionTexture.strength!==void 0&&h.setOcclusionStrength(u.occlusionTexture.strength)}if(f.metallicRoughnessTexture!==void 0){const d=f.metallicRoughnessTexture;h.setMetallicRoughnessTexture(a.textures[A[d.index].source]),a.setTextureInfo(h.getMetallicRoughnessTextureInfo(),d)}return h});const I=i.meshes||[];n.getRoot().listExtensionsUsed().filter(u=>u.prereadTypes.includes(M.PRIMITIVE)).forEach(u=>u.preread(a,M.PRIMITIVE)),a.meshes=I.map(u=>{const h=n.createMesh(u.name);return u.extras&&h.setExtras(u.extras),u.weights!==void 0&&h.setWeights(u.weights),(u.primitives||[]).forEach(f=>{const d=n.createPrimitive();f.extras&&d.setExtras(f.extras),f.material!==void 0&&d.setMaterial(a.materials[f.material]),f.mode!==void 0&&d.setMode(f.mode);for(const[x,N]of Object.entries(f.attributes||{}))d.setAttribute(x,a.accessors[N]);f.indices!==void 0&&d.setIndices(a.accessors[f.indices]);const E=u.extras&&u.extras.targetNames||[];(f.targets||[]).forEach((x,N)=>{const v=E[N]||N.toString(),w=n.createPrimitiveTarget(v);for(const[R,O]of Object.entries(x))w.setAttribute(R,a.accessors[O]);d.addTarget(w)}),h.addPrimitive(d)}),h}),a.cameras=(i.cameras||[]).map(u=>{const h=n.createCamera(u.name).setType(u.type);if(u.extras&&h.setExtras(u.extras),u.type===Se.Type.PERSPECTIVE){const f=u.perspective;h.setYFov(f.yfov),h.setZNear(f.znear),f.zfar!==void 0&&h.setZFar(f.zfar),f.aspectRatio!==void 0&&h.setAspectRatio(f.aspectRatio)}else{const f=u.orthographic;h.setZNear(f.znear).setZFar(f.zfar).setXMag(f.xmag).setYMag(f.ymag)}return h});const l=i.nodes||[];n.getRoot().listExtensionsUsed().filter(u=>u.prereadTypes.includes(M.NODE)).forEach(u=>u.preread(a,M.NODE)),a.nodes=l.map(u=>{const h=n.createNode(u.name);if(u.extras&&h.setExtras(u.extras),u.translation!==void 0&&h.setTranslation(u.translation),u.rotation!==void 0&&h.setRotation(u.rotation),u.scale!==void 0&&h.setScale(u.scale),u.matrix!==void 0){const f=[0,0,0],d=[0,0,0,1],E=[1,1,1];B.decompose(u.matrix,f,d,E),h.setTranslation(f),h.setRotation(d),h.setScale(E)}return u.weights!==void 0&&h.setWeights(u.weights),h}),a.skins=(i.skins||[]).map(u=>{const h=n.createSkin(u.name);u.extras&&h.setExtras(u.extras),u.inverseBindMatrices!==void 0&&h.setInverseBindMatrices(a.accessors[u.inverseBindMatrices]),u.skeleton!==void 0&&h.setSkeleton(a.nodes[u.skeleton]);for(const f of u.joints)h.addJoint(a.nodes[f]);return h}),l.map((u,h)=>{const f=a.nodes[h];(u.children||[]).forEach(d=>f.addChild(a.nodes[d])),u.mesh!==void 0&&f.setMesh(a.meshes[u.mesh]),u.camera!==void 0&&f.setCamera(a.cameras[u.camera]),u.skin!==void 0&&f.setSkin(a.skins[u.skin])}),a.animations=(i.animations||[]).map(u=>{const h=n.createAnimation(u.name);u.extras&&h.setExtras(u.extras);const f=(u.samplers||[]).map(d=>{const E=n.createAnimationSampler().setInput(a.accessors[d.input]).setOutput(a.accessors[d.output]).setInterpolation(d.interpolation||Ne.Interpolation.LINEAR);return d.extras&&E.setExtras(d.extras),h.addSampler(E),E});return(u.channels||[]).forEach(d=>{const E=n.createAnimationChannel().setSampler(f[d.sampler]).setTargetPath(d.target.path);d.target.node!==void 0&&E.setTargetNode(a.nodes[d.target.node]),d.extras&&E.setExtras(d.extras),h.addChannel(E)}),h});const b=i.scenes||[];return n.getRoot().listExtensionsUsed().filter(u=>u.prereadTypes.includes(M.SCENE)).forEach(u=>u.preread(a,M.SCENE)),a.scenes=b.map(u=>{const h=n.createScene(u.name);return u.extras&&h.setExtras(u.extras),(u.nodes||[]).map(f=>a.nodes[f]).forEach(f=>h.addChild(f)),h}),i.scene!==void 0&&n.getRoot().setDefaultScene(a.scenes[i.scene]),n.getRoot().listExtensionsUsed().forEach(u=>u.read(a)),p.forEach((u,h)=>{const f=a.accessors[h],d=!!u.sparse,E=!u.bufferView&&!f.getArray();(d||E)&&f.setSparse(!0).setArray(function(x,N){const v=$e[x.componentType],w=C.getElementSize(x.type);let R;R=x.bufferView!==void 0?Be(x,N):new v(x.count*w);const O=x.sparse;if(!O)return R;const S=O.count,_=G({},x,O.indices,{count:S,type:"SCALAR"}),V=G({},x,O.values,{count:S}),P=Be(_,N),j=Be(V,N);for(let D=0;D<_.count;D++)for(let k=0;kn.EXTENSION_NAME===i))throw new Error(`Missing required extension, "${i}".`)}if(s.extensionsUsed)for(const i of s.extensionsUsed)t.extensions.find(n=>n.EXTENSION_NAME===i)||t.logger.warn(`Missing optional extension, "${i}".`)}};function Be(r,e){const t=e.bufferViews[r.bufferView],s=e.jsonDoc.json.bufferViews[r.bufferView],i=$e[r.componentType],n=C.getElementSize(r.type),a=i.BYTES_PER_ELEMENT;if(s.byteStride!==void 0&&s.byteStride!==n*a)return function(o,g){const m=g.bufferViews[o.bufferView],T=g.jsonDoc.json.bufferViews[o.bufferView],p=$e[o.componentType],y=C.getElementSize(o.type),A=p.BYTES_PER_ELEMENT,I=o.byteOffset||0,l=new p(o.count*y),b=new DataView(m.buffer,m.byteOffset,m.byteLength),u=T.byteStride;for(let h=0;h1,()=>s.basename||"buffer"),this.imageURIGenerator=new xt(a>1,c=>function(o,g){const m=o.getGraph().listParentEdges(g).find(T=>T.getParent()!==o.getRoot());return m?m.getName().replace(/texture$/i,""):""}(e,c)||s.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,t){const s={magFilter:t.getMagFilter()||void 0,minFilter:t.getMinFilter()||void 0,wrapS:t.getWrapS(),wrapT:t.getWrapT()},i=JSON.stringify(s);this.samplerDefIndexMap.has(i)||(this.samplerDefIndexMap.set(i,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(s));const n={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(i)},a=JSON.stringify(n);this.textureDefIndexMap.has(a)||(this.textureDefIndexMap.set(a,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(n));const c={index:this.textureDefIndexMap.get(a)};return t.getTexCoord()!==0&&(c.texCoord=t.getTexCoord()),Object.keys(t.getExtras()).length>0&&(c.extras=t.getExtras()),this.textureInfoDefMap.set(t,c),c}createPropertyDef(e){const t={};return e.getName()&&(t.name=e.getName()),Object.keys(e.getExtras()).length>0&&(t.extras=e.getExtras()),t}createAccessorDef(e){const t=this.createPropertyDef(e);return t.type=e.getType(),t.componentType=e.getComponentType(),t.count=e.getCount(),this.C.getGraph().listParentEdges(e).some(s=>s.getName()==="attributes"&&s.getAttributes().key==="POSITION"||s.getName()==="input")&&(t.max=e.getMax([]).map(Math.fround),t.min=e.getMin([]).map(Math.fround)),e.getNormalized()&&(t.normalized=e.getNormalized()),t}createImageData(e,t,s){if(this.options.format===se.GLB)this.imageBufferViews.push(t),e.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:t.byteLength});else{const i=ne.mimeTypeToExtension(s.getMimeType());e.uri=this.imageURIGenerator.createURI(s,i),this.jsonDoc.resources[e.uri]=t}}getAccessorUsage(e){const t=this.F.get(e);if(t)return t;if(e.getSparse())return $.SPARSE;for(const s of this.C.getGraph().listParentEdges(e)){const{usage:i}=s.getAttributes();if(i)return i;s.getParent().propertyType!==M.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${s.getName()}".`)}return $.OTHER}addAccessorToUsageGroup(e,t){const s=this.F.get(e);if(s&&s!==t)throw new Error(`Accessor with usage "${s}" cannot be reused as "${t}".`);return this.F.set(e,t),this}listAccessorUsageGroups(){const e={};for(const[t,s]of Array.from(this.F.entries()))e[s]=e[s]||[],e[s].push(t);return e}}te.BufferViewTarget=Ie,te.BufferViewUsage=$,te.USAGE_TO_TARGET={[$.ARRAY_BUFFER]:Ie.ARRAY_BUFFER,[$.ELEMENT_ARRAY_BUFFER]:Ie.ELEMENT_ARRAY_BUFFER};let xt=class{constructor(e,t){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=e,this.basename=t}createURI(e,t){if(e.getURI())return e.getURI();if(this.multiple){const s=this.basename(e);return this.counter[s]=this.counter[s]||1,`${s}_${this.counter[s]++}.${t}`}return`${this.basename(e)}.${t}`}};const{BufferViewUsage:Ue}=te,{UNSIGNED_INT:Lr,UNSIGNED_SHORT:jr,UNSIGNED_BYTE:Br}=C.ComponentType;let Ur=class{static write(e,t){const s=e.getRoot(),i={asset:G({generator:`glTF-Transform ${$t}`},s.getAsset()),extras:G({},s.getExtras())},n={json:i,resources:{}},a=new te(e,n,t),c=t.logger||ie.DEFAULT_INSTANCE,o=new Set(t.extensions.map(l=>l.EXTENSION_NAME)),g=e.getRoot().listExtensionsUsed().filter(l=>o.has(l.extensionName)),m=e.getRoot().listExtensionsRequired().filter(l=>o.has(l.extensionName));g.lengthS.getCount()/3){const q=(100*V.length/S.getCount()).toFixed(1);c.warn(`Sparse accessor with many non-zero elements (${q}%) may increase file size.`)}const ae=$e[S.getComponentType()];Z.indices=V,Z.values=new ae(P)}if(!Number.isFinite(E))return{buffers:h,byteLength:f};const x=E<255?Uint8Array:E<65535?Uint16Array:Uint32Array,N=E<255?Br:E<65535?jr:Lr,v={buffer:b,byteOffset:u+f,byteLength:0};for(const S of l){const _=d.get(S);if(_.count===0)continue;_.indicesByteOffset=v.byteLength;const V=F.pad(F.toView(new x(_.indices)));h.push(V),f+=V.byteLength,v.byteLength+=V.byteLength}i.bufferViews.push(v);const w=i.bufferViews.length-1,R={buffer:b,byteOffset:u+f,byteLength:0};for(const S of l){const _=d.get(S);if(_.count===0)continue;_.valuesByteOffset=R.byteLength;const V=F.pad(F.toView(_.values));h.push(V),f+=V.byteLength,R.byteLength+=V.byteLength}i.bufferViews.push(R);const O=i.bufferViews.length-1;for(const S of l){const _=d.get(S);_.count!==0&&(_.accessorDef.sparse={count:_.count,indices:{bufferView:w,byteOffset:_.indicesByteOffset,componentType:N},values:{bufferView:O,byteOffset:_.valuesByteOffset}})}return{buffers:h,byteLength:f}}const A=new Map;for(const l of e.getGraph().listEdges()){if(l.getParent()===s)continue;const b=l.getChild();if(b instanceof C){const u=A.get(b)||[];u.push(l),A.set(b,u)}}if(i.accessors=[],i.bufferViews=[],i.samplers=[],i.textures=[],i.images=s.listTextures().map((l,b)=>{const u=a.createPropertyDef(l);l.getMimeType()&&(u.mimeType=l.getMimeType());const h=l.getImage();return h&&a.createImageData(u,h,l),a.imageIndexMap.set(l,b),u}),g.filter(l=>l.prewriteTypes.includes(M.ACCESSOR)).forEach(l=>l.prewrite(a,M.ACCESSOR)),s.listAccessors().forEach(l=>{const b=a.accessorUsageGroupedByParent,u=a.accessorParents;if(a.accessorIndexMap.has(l))return;const h=A.get(l)||[],f=a.getAccessorUsage(l);if(a.addAccessorToUsageGroup(l,f),b.has(f)){const d=h[0].getParent(),E=u.get(d)||new Set;E.add(l),u.set(d,E)}}),g.filter(l=>l.prewriteTypes.includes(M.BUFFER)).forEach(l=>l.prewrite(a,M.BUFFER)),(s.listAccessors().length>0||s.listTextures().length>0||a.otherBufferViews.size>0)&&s.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");i.buffers=[],s.listBuffers().forEach((l,b)=>{const u=a.createPropertyDef(l),h=a.accessorUsageGroupedByParent,f=a.accessorParents,d=l.listParents().filter(R=>R instanceof C),E=new Set(d),x=[],N=i.buffers.length;let v=0;const w=a.listAccessorUsageGroups();for(const R in w)if(h.has(R))for(const O of Array.from(f.values())){const S=Array.from(O).filter(_=>E.has(_)).filter(_=>a.getAccessorUsage(_)===R);if(S.length)if(R!==Ue.ARRAY_BUFFER||t.vertexLayout===ze.INTERLEAVED){const _=R===Ue.ARRAY_BUFFER?p(S,N,v):T(S,N,v);v+=_.byteLength,x.push(..._.buffers)}else for(const _ of S){const V=p([_],N,v);v+=V.byteLength,x.push(...V.buffers)}}else{const O=w[R].filter(V=>E.has(V));if(!O.length)continue;const S=R===Ue.ELEMENT_ARRAY_BUFFER?te.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,_=R===Ue.SPARSE?y(O,N,v):T(O,N,v,S);v+=_.byteLength,x.push(..._.buffers)}if(a.imageBufferViews.length&&b===0){for(let R=0;R!l.getBuffer())&&c.warn("Skipped writing one or more Accessors: no Buffer assigned."),i.materials=s.listMaterials().map((l,b)=>{const u=a.createPropertyDef(l);if(l.getAlphaMode()!==pe.AlphaMode.OPAQUE&&(u.alphaMode=l.getAlphaMode()),l.getAlphaMode()===pe.AlphaMode.MASK&&(u.alphaCutoff=l.getAlphaCutoff()),l.getDoubleSided()&&(u.doubleSided=!0),u.pbrMetallicRoughness={},B.eq(l.getBaseColorFactor(),[1,1,1,1])||(u.pbrMetallicRoughness.baseColorFactor=l.getBaseColorFactor()),B.eq(l.getEmissiveFactor(),[0,0,0])||(u.emissiveFactor=l.getEmissiveFactor()),l.getRoughnessFactor()!==1&&(u.pbrMetallicRoughness.roughnessFactor=l.getRoughnessFactor()),l.getMetallicFactor()!==1&&(u.pbrMetallicRoughness.metallicFactor=l.getMetallicFactor()),l.getBaseColorTexture()){const h=l.getBaseColorTexture(),f=l.getBaseColorTextureInfo();u.pbrMetallicRoughness.baseColorTexture=a.createTextureInfoDef(h,f)}if(l.getEmissiveTexture()){const h=l.getEmissiveTexture(),f=l.getEmissiveTextureInfo();u.emissiveTexture=a.createTextureInfoDef(h,f)}if(l.getNormalTexture()){const h=l.getNormalTexture(),f=l.getNormalTextureInfo(),d=a.createTextureInfoDef(h,f);l.getNormalScale()!==1&&(d.scale=l.getNormalScale()),u.normalTexture=d}if(l.getOcclusionTexture()){const h=l.getOcclusionTexture(),f=l.getOcclusionTextureInfo(),d=a.createTextureInfoDef(h,f);l.getOcclusionStrength()!==1&&(d.strength=l.getOcclusionStrength()),u.occlusionTexture=d}if(l.getMetallicRoughnessTexture()){const h=l.getMetallicRoughnessTexture(),f=l.getMetallicRoughnessTextureInfo();u.pbrMetallicRoughness.metallicRoughnessTexture=a.createTextureInfoDef(h,f)}return a.materialIndexMap.set(l,b),u}),i.meshes=s.listMeshes().map((l,b)=>{const u=a.createPropertyDef(l);let h=null;return u.primitives=l.listPrimitives().map(f=>{const d={attributes:{}};d.mode=f.getMode();const E=f.getMaterial();E&&(d.material=a.materialIndexMap.get(E)),Object.keys(f.getExtras()).length&&(d.extras=f.getExtras());const x=f.getIndices();x&&(d.indices=a.accessorIndexMap.get(x));for(const N of f.listSemantics())d.attributes[N]=a.accessorIndexMap.get(f.getAttribute(N));for(const N of f.listTargets()){const v={};for(const w of N.listSemantics())v[w]=a.accessorIndexMap.get(N.getAttribute(w));d.targets=d.targets||[],d.targets.push(v)}return f.listTargets().length&&!h&&(h=f.listTargets().map(N=>N.getName())),d}),l.getWeights().length&&(u.weights=l.getWeights()),h&&(u.extras=u.extras||{},u.extras.targetNames=h),a.meshIndexMap.set(l,b),u}),i.cameras=s.listCameras().map((l,b)=>{const u=a.createPropertyDef(l);if(u.type=l.getType(),u.type===Se.Type.PERSPECTIVE){u.perspective={znear:l.getZNear(),zfar:l.getZFar(),yfov:l.getYFov()};const h=l.getAspectRatio();h!==null&&(u.perspective.aspectRatio=h)}else u.orthographic={znear:l.getZNear(),zfar:l.getZFar(),xmag:l.getXMag(),ymag:l.getYMag()};return a.cameraIndexMap.set(l,b),u}),i.nodes=s.listNodes().map((l,b)=>{const u=a.createPropertyDef(l);return B.eq(l.getTranslation(),[0,0,0])||(u.translation=l.getTranslation()),B.eq(l.getRotation(),[0,0,0,1])||(u.rotation=l.getRotation()),B.eq(l.getScale(),[1,1,1])||(u.scale=l.getScale()),l.getWeights().length&&(u.weights=l.getWeights()),a.nodeIndexMap.set(l,b),u}),i.skins=s.listSkins().map((l,b)=>{const u=a.createPropertyDef(l),h=l.getInverseBindMatrices();h&&(u.inverseBindMatrices=a.accessorIndexMap.get(h));const f=l.getSkeleton();return f&&(u.skeleton=a.nodeIndexMap.get(f)),u.joints=l.listJoints().map(d=>a.nodeIndexMap.get(d)),a.skinIndexMap.set(l,b),u}),s.listNodes().forEach((l,b)=>{const u=i.nodes[b],h=l.getMesh();h&&(u.mesh=a.meshIndexMap.get(h));const f=l.getCamera();f&&(u.camera=a.cameraIndexMap.get(f));const d=l.getSkin();d&&(u.skin=a.skinIndexMap.get(d)),l.listChildren().length>0&&(u.children=l.listChildren().map(E=>a.nodeIndexMap.get(E)))}),i.animations=s.listAnimations().map((l,b)=>{const u=a.createPropertyDef(l),h=new Map;return u.samplers=l.listSamplers().map((f,d)=>{const E=a.createPropertyDef(f);return E.input=a.accessorIndexMap.get(f.getInput()),E.output=a.accessorIndexMap.get(f.getOutput()),E.interpolation=f.getInterpolation(),h.set(f,d),E}),u.channels=l.listChannels().map(f=>{const d=a.createPropertyDef(f);return d.sampler=h.get(f.getSampler()),d.target={node:a.nodeIndexMap.get(f.getTargetNode()),path:f.getTargetPath()},d}),a.animationIndexMap.set(l,b),u}),i.scenes=s.listScenes().map((l,b)=>{const u=a.createPropertyDef(l);return u.nodes=l.listChildren().map(h=>a.nodeIndexMap.get(h)),a.sceneIndexMap.set(l,b),u});const I=s.getDefaultScene();return I&&(i.scene=s.listScenes().indexOf(I)),i.extensionsUsed=g.map(l=>l.extensionName),i.extensionsRequired=m.map(l=>l.extensionName),g.forEach(l=>l.write(a)),function(l){const b=[];for(const u in l){const h=l[u];(Array.isArray(h)&&h.length===0||h===null||h===""||h&&typeof h=="object"&&Object.keys(h).length===0)&&b.push(u)}for(const u of b)delete l[u]}(i),n}};var We;(function(r){r[r.JSON=1313821514]="JSON",r[r.BIN=5130562]="BIN"})(We||(We={}));let Dr=class{constructor(){this.M=ie.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=ze.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(e){return this.M=e,this}registerExtensions(e){for(const t of e)this.l.add(t),t.register();return this}registerDependencies(e){return Object.assign(this.U,e),this}setVertexLayout(e){return this.P=e,this}async read(e){return await this.readJSON(await this.readAsJSON(e))}async readAsJSON(e){const t=await this.readURI(e,"view");this.lastReadBytes=t.byteLength;const s=Mt(t)?this.L(t):{json:JSON.parse(F.decodeText(t)),resources:{}};return await this.j(s,this.dirname(e)),this.D(s),s}async readJSON(e){return e=this._(e),this.D(e),Fr.read(e,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(e){const t=this.L(F.assertView(e));this.D(t);const s=t.json;if(s.buffers&&s.buffers.some(i=>function(n,a){return a.uri!==void 0&&!(a.uri in n.resources)}(t,i)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(s.images&&s.images.some(i=>function(n,a){return a.uri!==void 0&&!(a.uri in n.resources)&&a.bufferView===void 0}(t,i)))throw new Error("Cannot resolve external images with binaryToJSON().");return t}async readBinary(e){return this.readJSON(await this.binaryToJSON(F.assertView(e)))}async writeJSON(e,t={}){if(t.format===se.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return Ur.write(e,{format:t.format||se.GLTF,basename:t.basename||"",logger:this.M,vertexLayout:this.P,dependencies:G({},this.U),extensions:Array.from(this.l)})}async writeBinary(e){const{json:t,resources:s}=await this.writeJSON(e,{format:se.GLB}),i=new Uint32Array([1179937895,2,12]),n=JSON.stringify(t),a=F.pad(F.encodeText(n),32),c=F.toView(new Uint32Array([a.byteLength,1313821514])),o=F.concat([c,a]);i[i.length-1]+=o.byteLength;const g=Object.values(s)[0];if(!g||!g.byteLength)return F.concat([F.toView(i),o]);const m=F.pad(g,0),T=F.toView(new Uint32Array([m.byteLength,5130562])),p=F.concat([T,m]);return i[i.length-1]+=p.byteLength,F.concat([F.toView(i),o,p])}async j(e,t){var s=this;const i=[...e.json.images||[],...e.json.buffers||[]].map(async function(n){const a=n.uri;if(!a||a.match(/data:/))return Promise.resolve();e.resources[a]=await s.readURI(s.resolve(t,a),"view"),s.lastReadBytes+=e.resources[a].byteLength});await Promise.all(i)}D(e){function t(s){if(s.uri){if(s.uri in e.resources)F.assertView(e.resources[s.uri]);else if(s.uri.match(/data:/)){const i=`__${Cr()}.${ge.extension(s.uri)}`;e.resources[i]=F.createBufferFromDataURI(s.uri),s.uri=i}}}(e.json.images||[]).forEach(s=>{if(s.bufferView===void 0&&s.uri===void 0)throw new Error("Missing resource URI or buffer view.");t(s)}),(e.json.buffers||[]).forEach(t)}_(e){const{images:t,buffers:s}=e.json;return e={json:G({},e.json),resources:G({},e.resources)},t&&(e.json.images=t.map(i=>G({},i))),s&&(e.json.buffers=s.map(i=>G({},i))),e}L(e){if(!Mt(e))throw new Error("Invalid glTF 2.0 binary.");const t=new Uint32Array(e.buffer,e.byteOffset+12,2);if(t[1]!==We.JSON)throw new Error("Missing required GLB JSON chunk.");const s=t[0],i=F.decodeText(F.toView(e,20,s)),n=JSON.parse(i),a=20+s;if(e.byteLength<=a)return{json:n,resources:{}};const c=new Uint32Array(e.buffer,e.byteOffset+a,2);if(c[1]!==We.BIN)throw new Error("Expected GLB BIN in second chunk.");const o=F.toView(e,a+8,c[0]);return{json:n,resources:{[Ge]:o}}}};function Mt(r){if(r.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(r.buffer,r.byteOffset,3);return e[0]===1179937895&&e[1]===2}let hn=class extends Dr{constructor(e=Re.DEFAULT_INIT){super(),this.J=void 0,this.J=e}async readURI(e,t){const s=await fetch(e,this.J);switch(t){case"view":return new Uint8Array(await s.arrayBuffer());case"text":return s.text()}}resolve(e,t){return Re.resolve(e,t)}dirname(e){return Re.dirname(e)}};function kr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Gr(r){for(var e=new Array(r),t=0;t + * @license MIT + */var $r=function(r){return r!=null&&(nr(r)||qr(r)||!!r._isBuffer)};function nr(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function qr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&nr(r.slice(0,0))}var Wr=zr,Yr=$r,Hr=typeof Float64Array<"u";function Xr(r,e){return r[0]-e[0]}function Jr(){var r=this.stride,e=new Array(r.length),t;for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):e===3&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+t+"_set("+a.join(",")+",v){"),s?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+t+"_get("+a.join(",")+"){"),s?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+t+"_index(",a.join(),"){return "+c+"}"),i.push("proto.hi=function "+t+"_hi("+a.join(",")+"){return new "+t+"(this.data,"+n.map(function(l){return["(typeof i",l,"!=='number'||i",l,"<0)?this.shape[",l,"]:i",l,"|0"].join("")}).join(",")+","+n.map(function(l){return"this.stride["+l+"]"}).join(",")+",this.offset)}");var m=n.map(function(l){return"a"+l+"=this.shape["+l+"]"}),T=n.map(function(l){return"c"+l+"=this.stride["+l+"]"});i.push("proto.lo=function "+t+"_lo("+a.join(",")+"){var b=this.offset,d=0,"+m.join(",")+","+T.join(","));for(var p=0;p=0){d=i"+p+"|0;b+=c"+p+"*d;a"+p+"-=d}");i.push("return new "+t+"(this.data,"+n.map(function(l){return"a"+l}).join(",")+","+n.map(function(l){return"c"+l}).join(",")+",b)}"),i.push("proto.step=function "+t+"_step("+a.join(",")+"){var "+n.map(function(l){return"a"+l+"=this.shape["+l+"]"}).join(",")+","+n.map(function(l){return"b"+l+"=this.stride["+l+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var p=0;p=0){c=(c+this.stride["+p+"]*i"+p+")|0}else{a.push(this.shape["+p+"]);b.push(this.stride["+p+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+t+"(data,shape,stride,offset){return new "+t+"(data,"+n.map(function(l){return"shape["+l+"]"}).join(",")+","+n.map(function(l){return"stride["+l+"]"}).join(",")+",offset)}");var I=new Function("CTOR_LIST","ORDER",i.join(` +`));return I(Ye[r],Jr)}function Zr(r){if(Yr(r))return"buffer";if(Hr)switch(Object.prototype.toString.call(r)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(r)?"array":"generic"}var Ye={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function Qr(r,e,t,s){if(r===void 0){var g=Ye.array[0];return g([])}else typeof r=="number"&&(r=[r]);e===void 0&&(e=[r.length]);var i=e.length;if(t===void 0){t=new Array(i);for(var n=i-1,a=1;n>=0;--n)t[n]=a,a*=e[n]}if(s===void 0){s=0;for(var n=0;n0,a=[],c=[],o=0,g=0,m,T;for(m=0;m0&&a.push("var "+c.join(",")),m=s-1;m>=0;--m)o=r[m],a.push(["for(i",m,"=0;i",m,"0&&a.push(["index[",g,"]-=s",g].join("")),a.push(["++index[",o,"]"].join(""))),a.push("}")}return a.join(` +`)}function cs(r,e,t,s){for(var i=e.length,n=t.arrayArgs.length,a=t.blockSize,c=t.indexArgs.length>0,o=[],g=0;g0;){"].join("")),o.push(["if(j",g,"<",a,"){"].join("")),o.push(["s",e[g],"=j",g].join("")),o.push(["j",g,"=0"].join("")),o.push(["}else{s",e[g],"=",a].join("")),o.push(["j",g,"-=",a,"}"].join("")),c&&o.push(["index[",e[g],"]=j",g].join(""));for(var g=0;g0&&(t=t&&e[s]===e[s-1])}return t?e[0]:e.join("")}function hs(r,e){for(var t=e[1].length-Math.abs(r.arrayBlockIndices[0])|0,s=new Array(r.arrayArgs.length),i=new Array(r.arrayArgs.length),n=0;n0&&I.push("shape=SS.slice(0)"),r.indexArgs.length>0){for(var l=new Array(t),n=0;n0&&A.push("var "+I.join(","));for(var n=0;n3&&A.push(nt(r.pre,r,i));var f=nt(r.body,r,i),d=us(m);d3&&A.push(nt(r.post,r,i)),r.debug&&console.log("-----Generated cwise routine for ",e,`: +`+A.join(` +`)+` +----------`);var E=[r.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",d,ls(i)].join(""),x=new Function(["function ",E,"(",y.join(","),"){",A.join(` +`),"} return ",E].join(""));return x()}var fs=hs,gs=fs;function ps(r){var e=["'use strict'","var CACHED={}"],t=[],s=r.funcName+"_cwise_thunk";e.push(["return function ",s,"(",r.shimArgs.join(","),"){"].join(""));for(var i=[],n=[],a=[["array",r.arrayArgs[0],".shape.slice(",Math.max(0,r.arrayBlockIndices[0]),r.arrayBlockIndices[0]<0?","+r.arrayBlockIndices[0]+")":")"].join("")],c=[],o=[],g=0;g0&&(c.push("array"+r.arrayArgs[0]+".shape.length===array"+m+".shape.length+"+(Math.abs(r.arrayBlockIndices[0])-Math.abs(r.arrayBlockIndices[g]))),o.push("array"+r.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,r.arrayBlockIndices[0])+"]===array"+m+".shape[shapeIndex+"+Math.max(0,r.arrayBlockIndices[g])+"]"))}r.arrayArgs.length>1&&(e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+r.arrayArgs[0]+".shape.length-"+Math.abs(r.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+o.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var g=0;g0)throw new Error("cwise: pre() block may not reference array args");if(s0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(s),e.shimArgs.push("scalar"+s);else if(i==="index"){if(e.indexArgs.push(s),s0)throw new Error("cwise: pre() block may not reference array index");if(s0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(s),st.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>t.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>t.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!r.printCode||!!r.debug,e.funcName=r.funcName||"cwise",e.blockSize=r.blockSize||64,ms(e)}var Ts=Es;(function(r){var e=Ts,t={body:"",args:[],thisVars:[],localVars:[]};function s(p){if(!p)return t;for(var y=0;y>",rrshift:">>>"};(function(){for(var p in a){var y=a[p];r[p]=n({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+y+"c"},funcName:p}),r[p+"eq"]=n({args:["array","array"],body:{args:["a","b"],body:"a"+y+"=b"},rvalue:!0,funcName:p+"eq"}),r[p+"s"]=n({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+y+"s"},funcName:p+"s"}),r[p+"seq"]=n({args:["array","scalar"],body:{args:["a","s"],body:"a"+y+"=s"},rvalue:!0,funcName:p+"seq"})}})();var c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var p in c){var y=c[p];r[p]=n({args:["array","array"],body:{args:["a","b"],body:"a="+y+"b"},funcName:p}),r[p+"eq"]=n({args:["array"],body:{args:["a"],body:"a="+y+"a"},rvalue:!0,count:2,funcName:p+"eq"})}})();var o={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var p in o){var y=o[p];r[p]=n({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+y+"c"},funcName:p}),r[p+"s"]=n({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+y+"s"},funcName:p+"s"}),r[p+"eq"]=n({args:["array","array"],body:{args:["a","b"],body:"a=a"+y+"b"},rvalue:!0,count:2,funcName:p+"eq"}),r[p+"seq"]=n({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+y+"s"},rvalue:!0,count:2,funcName:p+"seq"})}})();var g=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var p=0;pthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=n({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=n({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=n({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(rs);function bs(r,e){if(!(r instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");const t=new Blob([r],{type:e}),s=URL.createObjectURL(t);return new Promise((i,n)=>{const a=new Image;a.crossOrigin="anonymous",a.onload=function(){URL.revokeObjectURL(s);const c=document.createElement("canvas");c.width=a.width,c.height=a.height;const o=c.getContext("2d");o.drawImage(a,0,0);const g=o.getImageData(0,0,a.width,a.height);i(ts(new Uint8Array(g.data),[a.width,a.height,4],[4,4*a.width,1],0))},a.onerror=c=>{URL.revokeObjectURL(s),n(c)},a.src=s})}async function vs(r,e){return bs(r,e)}function me(){return me=Object.assign?Object.assign.bind():function(r){for(var e=1;es?"–":"+")+(Math.abs(t-s)/t*100).toFixed(i)+"%"}(r,e)})`}function ws(r){const e=[];for(const t of r.listAttributes())e.push(t);for(const t of r.listTargets())for(const s of t.listAttributes())e.push(s);return Array.from(new Set(e))}function ce(r,e=r){const t=e<=65534?new Uint16Array(r):new Uint32Array(r);for(let s=0;si instanceof Ze)}function Is(r){const e=Rs(r),t=r.getParentNode();if(!t)return r;r.setMatrix(r.getWorldMatrix()),t.removeChild(r);for(const s of e)s.addChild(r);return r}var ye=typeof Float32Array<"u"?Float32Array:Array;function xs(r,e,t){var s=e[0],i=e[1],n=e[2],a=e[3],c=e[4],o=e[5],g=e[6],m=e[7],T=e[8],p=e[9],y=e[10],A=e[11],I=e[12],l=e[13],b=e[14],u=e[15],h=t[0],f=t[1],d=t[2],E=t[3];return r[0]=h*s+f*c+d*T+E*I,r[1]=h*i+f*o+d*p+E*l,r[2]=h*n+f*g+d*y+E*b,r[3]=h*a+f*m+d*A+E*u,r[4]=(h=t[4])*s+(f=t[5])*c+(d=t[6])*T+(E=t[7])*I,r[5]=h*i+f*o+d*p+E*l,r[6]=h*n+f*g+d*y+E*b,r[7]=h*a+f*m+d*A+E*u,r[8]=(h=t[8])*s+(f=t[9])*c+(d=t[10])*T+(E=t[11])*I,r[9]=h*i+f*o+d*p+E*l,r[10]=h*n+f*g+d*y+E*b,r[11]=h*a+f*m+d*A+E*u,r[12]=(h=t[12])*s+(f=t[13])*c+(d=t[14])*T+(E=t[15])*I,r[13]=h*i+f*o+d*p+E*l,r[14]=h*n+f*g+d*y+E*b,r[15]=h*a+f*m+d*A+E*u,r}function et(){var r=new ye(3);return ye!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function or(r,e){var t=e[0],s=e[1],i=e[2],n=t*t+s*s+i*i;return n>0&&(n=1/Math.sqrt(n)),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r}function Ms(r,e,t){var s=e[0],i=e[1],n=e[2],a=t[3]*s+t[7]*i+t[11]*n+t[15];return r[0]=(t[0]*s+t[4]*i+t[8]*n+t[12])/(a=a||1),r[1]=(t[1]*s+t[5]*i+t[9]*n+t[13])/a,r[2]=(t[2]*s+t[6]*i+t[10]*n+t[14])/a,r}function _s(r,e,t){var s=e[0],i=e[1],n=e[2];return r[0]=s*t[0]+i*t[3]+n*t[6],r[1]=s*t[1]+i*t[4]+n*t[7],r[2]=s*t[2]+i*t[5]+n*t[8],r}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var Ns=function(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r};function Tt(){var r=new ye(4);return ye!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}et();var cr=function(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r},Ss=function(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r},ur=function(r){return Math.hypot(r[0],r[1],r[2],r[3])};Tt();M.ACCESSOR,M.MESH,M.TEXTURE,M.MATERIAL,M.SKIN;const Cs=/color|emissive|diffuse/i;function Os(r){return r.getGraph().listParentEdges(r).some(e=>e.getAttributes().isColor||Cs.test(e.getName()))?"srgb":null}function Vs(r){const e=r.getGraph(),t=new Set,s=new Set;return function i(n){const a=new Set;for(const c of e.listChildEdges(n))c.getChild()instanceof _e&&a.add(c.getName()+"Info");for(const c of e.listChildEdges(n)){const o=c.getChild();t.has(o)||(t.add(o),o instanceof H&&a.has(c.getName())?s.add(o):o instanceof Ce&&i(o))}}(r),Array.from(s)}function Ps(r){const e=Qe.fromGraph(r.getGraph()).getRoot(),t=r.getGraph().listParentEdges(r).filter(s=>s.getParent()!==e).map(s=>s.getName());return Array.from(new Set(t))}const ue="prune",gt=3/255,Nt={propertyTypes:[M.NODE,M.SKIN,M.MESH,M.CAMERA,M.PRIMITIVE,M.PRIMITIVE_TARGET,M.ANIMATION,M.MATERIAL,M.TEXTURE,M.ACCESSOR,M.BUFFER],keepLeaves:!1,keepAttributes:!0,keepSolidTextures:!0};function Fs(r=Nt){const e=me({},Nt,r),t=new Set(e.propertyTypes);return ar(ue,async s=>{const i=s.getLogger(),n=s.getRoot(),a=s.getGraph(),c=new Ls;if(t.has(M.MESH))for(const o of n.listMeshes())o.listPrimitives().length>0||c.dispose(o);if(t.has(M.NODE)){if(!e.keepLeaves)for(const o of n.listScenes())lr(a,o,c);for(const o of n.listNodes())W(o,c)}if(t.has(M.SKIN))for(const o of n.listSkins())W(o,c);if(t.has(M.MESH))for(const o of n.listMeshes())W(o,c);if(t.has(M.CAMERA))for(const o of n.listCameras())W(o,c);if(t.has(M.PRIMITIVE)&&St(a,M.PRIMITIVE,c),t.has(M.PRIMITIVE_TARGET)&&St(a,M.PRIMITIVE_TARGET,c),!e.keepAttributes&&t.has(M.ACCESSOR)){const o=new Map;for(const g of n.listMeshes())for(const m of g.listPrimitives()){const T=m.getMaterial(),p=js(m,hr(s,T));Ct(m,p),m.listTargets().forEach(y=>Ct(y,p)),T&&(o.has(T)?o.get(T).add(m):o.set(T,new Set([m])))}for(const[g,m]of o)Bs(g,Array.from(m))}if(t.has(M.ANIMATION))for(const o of n.listAnimations()){for(const g of o.listChannels())g.getTargetNode()||c.dispose(g);if(o.listChannels().length)o.listSamplers().forEach(g=>W(g,c));else{const g=o.listSamplers();W(o,c),g.forEach(m=>W(m,c))}}if(t.has(M.MATERIAL)&&n.listMaterials().forEach(o=>W(o,c)),t.has(M.TEXTURE)&&(n.listTextures().forEach(o=>W(o,c)),e.keepSolidTextures||await async function(o,g){const m=o.getRoot(),T=o.getGraph(),p=o.getLogger(),y=m.listTextures().map(async A=>{var I;const l=await async function(f){const d=await async function(_){try{return await vs(_.getImage(),_.getMimeType())}catch{return null}}(f);if(!d)return null;const E=[1/0,1/0,1/0,1/0],x=[-1/0,-1/0,-1/0,-1/0],N=[0,0,0,0],[v,w]=d.shape;for(let _=0;_gt)return null}return function(_,V,P){return _[0]=V[0]*P,_[1]=V[1]*P,_[2]=V[2]*P,_[3]=V[3]*P,_}(N,((R=N)[0]=(O=x)[0]+(S=E)[0],R[1]=O[1]+S[1],R[2]=O[2]+S[2],R[3]=O[3]+S[3],R),.00196078431372549);var R,O,S}(A);if(!l)return;Os(A)==="srgb"&&ve.convertSRGBToLinear(l,l);const b=A.getName()||A.getURI(),u=(I=A.getSize())==null?void 0:I.join("x"),h=Ps(A);for(const f of T.listParentEdges(A)){const d=f.getParent();d!==m&&Us(d,l,f.getName(),p)&&f.dispose()}A.listParents().length===1&&(g.dispose(A),p.debug(`${ue}: Removed solid-color texture "${b}" (${u}px ${h.join(", ")})`))});await Promise.all(y)}(s,c)),t.has(M.ACCESSOR)&&n.listAccessors().forEach(o=>W(o,c)),t.has(M.BUFFER)&&n.listBuffers().forEach(o=>W(o,c)),c.empty())i.info(`${ue}: No unused properties found.`);else{const o=c.entries().map(([g,m])=>`${g} (${m})`).join(", ");i.info(`${ue}: Removed types... ${o}`)}i.debug(`${ue}: Complete.`)})}class Ls{constructor(){this.disposed={}}empty(){for(const e in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(e){this.disposed[e.propertyType]=this.disposed[e.propertyType]||0,this.disposed[e.propertyType]++,e.dispose()}}function W(r,e){r.listParents().filter(t=>!(t instanceof rr||t instanceof Ke)).length||e.dispose(r)}function St(r,e,t){for(const s of r.listEdges()){const i=s.getParent();i.propertyType===e&&W(i,t)}}function lr(r,e,t){if(e.listChildren().forEach(i=>lr(r,i,t)),e instanceof Ze)return;const s=r.listParentEdges(e).some(i=>{const n=i.getParent().propertyType;return n!==M.ROOT&&n!==M.SCENE&&n!==M.NODE});r.listChildren(e).length===0&&!s&&t.dispose(e)}function Ct(r,e){for(const t of e)r.setAttribute(t,null)}function js(r,e){const t=[];for(const s of r.listSemantics())s!=="TANGENT"||e.has(s)?(s.startsWith("TEXCOORD_")&&!e.has(s)||s.startsWith("COLOR_")&&s!=="COLOR_0")&&t.push(s):t.push(s);return t}function hr(r,e,t=new Set){if(!e)return t;const s=r.getGraph().listChildEdges(e),i=new Set;for(const n of s)n.getChild()instanceof _e&&i.add(n.getName());for(const n of s){const a=n.getName(),c=n.getChild();c instanceof H&&i.has(a.replace(/Info$/,""))&&t.add(`TEXCOORD_${c.getTexCoord()}`),c instanceof _e&&a.match(/normalTexture/i)&&t.add("TANGENT"),c instanceof Ce&&hr(r,c,t)}return t}function Bs(r,e){const t=Vs(r),s=new Set(t.map(o=>o.getTexCoord())),i=Array.from(s).sort(),n=new Map(i.map((o,g)=>[o,g])),a=new Map(i.map((o,g)=>[`TEXCOORD_${o}`,`TEXCOORD_${g}`]));for(const o of t){const g=o.getTexCoord();o.setTexCoord(n.get(g))}for(const o of e){const g=o.listSemantics().filter(m=>m.startsWith("TEXCOORD_")).sort();c(o,g),o.listTargets().forEach(m=>c(m,g))}function c(o,g){for(const m of g){const T=o.getAttribute(m);if(!T)continue;const p=a.get(m);p!==m&&(o.setAttribute(p,T),o.setAttribute(m,null))}}}function Us(r,e,t,s){if(r instanceof pe)switch(t){case"baseColorTexture":return r.setBaseColorFactor(Ss(e,e,r.getBaseColorFactor())),!0;case"emissiveTexture":return r.setEmissiveFactor(Ns([0,0,0],e.slice(0,3),r.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(e[0]-1)<=gt;case"metallicRoughnessTexture":return r.setRoughnessFactor(e[1]*r.getRoughnessFactor()),r.setMetallicFactor(e[2]*r.getMetallicFactor()),!0;case"normalTexture":return ur(cr(Tt(),e,[.5,.5,1,1]))<=gt}return s.warn(`${ue}: Detected single-color ${t} texture. Pruning ${t} not yet supported.`),!1}const He="weld",he={DEFAULT:1e-4,TEXCOORD:1e-4,COLOR:.01,NORMAL:.05,JOINTS:0,WEIGHTS:.01},pt={tolerance:he.DEFAULT,toleranceNormal:he.NORMAL,overwrite:!0,exhaustive:!1};function Ds(r,e=pt,t=pt){let s,i,n;if(r instanceof de){const a=r.getGraph();s=Qe.fromGraph(a),i=r,n=Pt(e)}else s=r,i=e,n=Pt(t);i.getIndices()&&!n.overwrite||i.getMode()!==de.Mode.POINTS&&(n.tolerance===0?function(a,c){if(c.getIndices())return;const o=c.listAttributes()[0],g=o.getCount(),m=o.getBuffer(),T=a.createAccessor().setBuffer(m).setType(C.Type.SCALAR).setArray(ce(g));c.setIndices(T)}(s,i):function(a,c,o){const g=a.getLogger(),m=c.getAttribute("POSITION"),T=c.getIndices()||a.createAccessor().setArray(ce(m.getCount())),p=new Uint32Array(new Set(T.getArray())).sort(),y={};for(const v of c.listSemantics()){const w=c.getAttribute(v);y[v]=ks(v,w,o)}var A;g.debug(`${He}: Tolerance thresholds: ${A=y,Object.entries(A).map(([v,w])=>`${v}=${w}`).join(", ")}`);const I=[0,0,0],l=[0,0,0],b={},u=y.POSITION;for(let v=0;vVt(c.getAttribute(j),w,_,y[j])),P=c.listTargets().every(j=>j.listSemantics().every(D=>Vt(j.getAttribute(D),w,_,y[D])));if(V&&P){h[w]=_;break e}}f[w]=h[w]===w?E++:f[h[w]]}g.debug(`${He}: ${As(d,E)} vertices.`);const x=T.getCount(),N=ce(x,p.length);for(let v=0;vn-xe[a]),i=Math.max(...s);return t.tolerance*i}function Vt(r,e,t,s,i){r.getElement(e,xe),r.getElement(t,Me);for(let n=0,a=r.getElementSize();ns)return!1;return!0}const it=[0,-1,1];function Gs(r,e){const t=[],s=[0,0,0];for(const i of it)for(const n of it)for(const a of it)s[0]=r[0]+i*e,s[1]=r[1]+n*e,s[2]=r[2]+a*e,t.push(dt(s,e));return t}function dt(r,e){return Math.round(r[0]/e)+":"+Math.round(r[1]/e)+":"+Math.round(r[2]/e)}function Pt(r){const e=me({},pt,r);if(e.tolerance<0||e.tolerance>.1)throw new Error(`${He}: Requires 0 ≤ tolerance ≤ 0.1`);if(e.toleranceNormal<0||e.toleranceNormal>Math.PI/2)throw new Error(`${He}: Requires 0 ≤ toleranceNormal ≤ ${(Math.PI/2).toFixed(2)}`);return e.tolerance>0&&(e.tolerance=Math.max(e.tolerance,Number.EPSILON),e.toleranceNormal=Math.max(e.toleranceNormal,Number.EPSILON)),e}function zs(r,e,t=new Set){var s;const i=r.getAttribute("POSITION"),n=((s=r.getIndices())==null?void 0:s.getArray())||ce(i.getCount());i&&Ft(e,i,n,new Set(t));const a=r.getAttribute("NORMAL");a&&Lt(e,a,n,new Set(t));const c=r.getAttribute("TANGENT");c&&jt(e,c,n,new Set(t));for(const v of r.listTargets()){const w=v.getAttribute("POSITION");w&&Ft(e,w,n,new Set(t));const R=v.getAttribute("NORMAL");R&&Lt(e,R,n,new Set(t));const O=v.getAttribute("TANGENT");O&&jt(e,O,n,new Set(t))}var o,g,m,T,p,y,A,I,l,b,u,h,f,d,E,x,N;((g=(o=e)[0])*(A=o[5])-(m=o[1])*(y=o[4]))*((h=o[10])*(N=o[15])-(f=o[11])*(x=o[14]))-(g*(I=o[6])-(T=o[2])*y)*((u=o[9])*N-f*(E=o[13]))+(g*(l=o[7])-(p=o[3])*y)*(u*x-h*E)+(m*I-T*A)*((b=o[8])*N-f*(d=o[12]))-(m*l-p*A)*(b*x-h*d)+(T*l-p*I)*(b*E-u*d)<0&&function(v){if(v.getMode()!==de.Mode.TRIANGLES)return;v.getIndices()||Ds(v,{tolerance:0});const w=v.getIndices();for(let R=0,O=w.getCount();Ra.propertyType===M.MESH&&a!==r)){const a=n.clone();r.swap(n,a);for(const c of a.listTargets()){const o=c.clone();a.swap(c,o)}}if(!t){const n=new Set([...r.listPrimitives(),...r.listPrimitives().flatMap(c=>c.listTargets())]),a=new Map;for(const c of r.listPrimitives())for(const o of ws(c))o.listParents().some(g=>(g instanceof de||g instanceof er)&&!n.has(g))&&!a.has(o)&&a.set(o,o.clone());for(const c of n)for(const[o,g]of a)c.swap(o,g)}const i=new Map;for(const n of r.listPrimitives()){const a=n.getAttribute("POSITION");let c;s?c=s:i.has(a)?c=i.get(a):i.set(a,c=new Set),zs(n,e,c)}}const Bt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function gn(r){const e=r.getMesh(),t=r.getMatrix();e&&!B.eq(t,Bt)&&$s(e,t);for(const s of r.listChildren()){const i=s.getMatrix();xs(i,i,t),s.setMatrix(i)}return r.setMatrix(Bt)}const at="flatten",Ut={};function pn(r=Ut){return me({},Ut,r),ar(at,async e=>{const t=e.getRoot(),s=e.getLogger(),i=new Set;for(const o of t.listSkins())for(const g of o.listJoints())i.add(g);const n=new Set;for(const o of t.listAnimations())for(const g of o.listChannels()){const m=g.getTargetNode();m&&n.add(m)}const a=new Set,c=new Set;for(const o of t.listScenes())o.traverse(g=>{const m=g.getParentNode();m&&((i.has(m)||a.has(m))&&a.add(g),(n.has(m)||c.has(m))&&c.add(g))});for(const o of t.listScenes())o.traverse(g=>{n.has(g)||a.has(g)||c.has(g)||Is(g)});n.size&&s.debug(`${at}: Flattening node hierarchies with TRS animation not yet supported.`),await e.transform(Fs({propertyTypes:[M.NODE],keepLeaves:!1})),s.debug(`${at}: Complete.`)})}Ke.TargetPath;const qs={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0};me({level:"high"},qs);var Dt;function Ee(r,e,t){for(let s=0,i=t.length;st)return!1;return!0}function Ws(r,e,t){return r*(1-t)+e*t}function Ys(r,e,t,s){for(let i=0;i1e-6?(i=Math.acos(n),a=Math.sin(i),c=Math.sin((1-s)*i)/a,o=Math.sin(s*i)/a):(c=1-s,o=s),r[0]=c*g+o*y,r[1]=c*m+o*A,r[2]=c*T+o*I,r[3]=c*p+o*l,r}function Gt(r,e){const t=function(s,i){return s[0]*i[0]+s[1]*i[1]+s[2]*i[2]+s[3]*i[3]}(r,e);return Math.acos(2*t*t-1)}(function(r){r[r.STEP=0]="STEP",r[r.LERP=1]="LERP",r[r.SLERP=2]="SLERP"})(Dt||(Dt={}));Promise.resolve();var Xe;(function(r){r.LANCZOS3="lanczos3",r.LANCZOS2="lanczos2"})(Xe||(Xe={}));Xe.LANCZOS3;Xe.LANCZOS3;const Y="EXT_mesh_manifold",zt="MERGE";class bt extends Ce{static EXTENSION_NAME=Y;init(){bt.EXTENSION_NAME=Y,this.propertyType="ManifoldPrimitive",this.parentTypes=[M.MESH]}getDefaults(){return Object.assign(super.getDefaults(),{manifoldPrimitive:null,mergeIndices:null,mergeValues:null})}getMergeIndices(){return this.getRef("mergeIndices")}getMergeValues(){return this.getRef("mergeValues")}setMerge(e,t){if(e.getCount()!==t.getCount())throw new Error("merge vectors must be the same length.");return this.setRef("mergeIndices",e),this.setRef("mergeValues",t)}getRunIndex(){return this.get("runIndex")}setRunIndex(e){return this.set("runIndex",e)}setIndices(e){return this.setRef("indices",e)}getIndices(){return this.getRef("indices")}}class fr extends sr{extensionName=Y;prewriteTypes=[M.ACCESSOR];static EXTENSION_NAME=Y;createManifoldPrimitive(){return new bt(this.document.getGraph())}read(e){const{json:t}=e.jsonDoc;return(t.meshes||[]).forEach((i,n)=>{if(!i.extensions||!i.extensions[Y])return;const a=e.meshes[n],c=this.createManifoldPrimitive();a.setExtension(Y,c);const o=i.extensions[Y];if(o.manifoldPrimitive){let g=0;const m=Array();m.push(g);for(const T of a.listPrimitives()){const p=T.getIndices();if(!p){console.log("Skipping non-indexed primitive ",T.getName());continue}g+=p.getCount(),m.push(g)}c.setRunIndex(m),c.setIndices(e.accessors[o.manifoldPrimitive.indices])}o.mergeIndices!=null&&o.mergeValues!=null&&c.setMerge(e.accessors[o.mergeIndices],e.accessors[o.mergeValues])}),this}prewrite(e){return this.document.getRoot().listMeshes().forEach(t=>{const s=t.getExtension(Y);if(!s)return;const i=s.getIndices();e.addAccessorToUsageGroup(i,te.BufferViewUsage.ELEMENT_ARRAY_BUFFER);const n=s.getMergeIndices(),a=s.getMergeValues();!n||!a||(e.addAccessorToUsageGroup(n,zt),e.addAccessorToUsageGroup(a,zt))}),this}write(e){const{json:t}=e.jsonDoc;return this.document.getRoot().listMeshes().forEach(s=>{const i=s.getExtension(Y);if(!i)return;const n=e.meshIndexMap.get(s),a=t.meshes[n],c=i.getRunIndex(),o=c.length-1;if(o!==a.primitives.length)throw new Error("The number of primitives must be exactly one less than the length of runIndex.");const g=e.accessorIndexMap.get(i.getMergeIndices()),m=e.accessorIndexMap.get(i.getMergeValues()),T=t.accessors[g],p=t.accessors[m],y=a.primitives[0],A={indices:e.accessorIndexMap.get(i.getIndices()),mode:y.mode,attributes:{POSITION:y.attributes.POSITION}},I=t.accessors[A.indices];if(I){T&&p&&(I.sparse={count:T.count,indices:{bufferView:T.bufferView,byteOffset:T.byteOffset,componentType:T.componentType},values:{bufferView:p.bufferView,byteOffset:p.byteOffset}});for(let l=0;l{const h=s;return s+=X[u].components,h})),n=r.getExtension("EXT_mesh_manifold");let a=Array(),c=Array();const o=[0],g=Array(),m=Array(),T=Array();if(n!=null){const u=t[0].getAttribute("POSITION").getCount(),h=e.map(x=>X[x].type==null);a=new Array(s*u);for(const x of t){const N=x.getIndices();if(!N){console.log("Skipping non-indexed primitive ",x.getName());continue}const v=x.listSemantics();e.forEach((w,R)=>{if(!h[R]){for(const O of v)if(O===w){h[R]=!0;const S=x.getAttribute(O);gr(a,S,s,i[R])}}}),c=[...c,...N.getArray()],o.push(c.length),T.push({material:x.getMaterial(),attributes:v.filter(w=>e.some(R=>R==w))})}const f=n.getMergeIndices()?.getArray()??[],d=n.getMergeValues()?.getArray()??[],E=new Map;for(const[x,N]of f.entries())E.set(c[N],d[x]);for(const[x,N]of E.entries())g.push(x),m.push(N)}else for(const u of t){const h=u.getIndices();if(!h){console.log("Skipping non-indexed primitive ",u.getName());continue}const f=a.length/s;a=[...a,...Xs(u,s,e)],c=[...c,...h.getArray().map(E=>E+f)],o.push(c.length);const d=u.listSemantics();T.push({material:u.getMaterial(),attributes:d.filter(E=>e.some(x=>x==E))})}const p=new Float32Array(a),y=new Uint32Array(c),A=new Uint32Array(o),I=new Uint32Array(g),l=new Uint32Array(m);return{mesh:{numProp:s,triVerts:y,vertProperties:p,runIndex:A,mergeFromVert:I,mergeToVert:l},runProperties:T}}function yn(r,e,t){r.getRoot().listBuffers().length===0&&r.createBuffer();const s=r.getRoot().listBuffers()[0],i=r.createExtension(fr),n=r.createMesh(),a=Array(),c=Array(),o=new Map,g=e.runIndex.length-1;let m=-1;for(let h=0;h{if(R>=c.length)c.push(w);else{const O=X[w].components,S=X[c[R]].components;if(O!=S)throw new Error("Attribute sizes do not correspond: "+w+" and "+c[R]);X[c[R]].type==null&&(c[R]=w)}})}else o.set(E,["POSITION"]);n.addPrimitive(E)}a.push(e.runIndex[g]);const T=e.numVert,p=e.numProp;let y=0;c.forEach((h,f)=>{const d=X[h];if(d==null)throw new Error(h+" is not a recognized attribute.");if(d.type==null){++y;return}const E=d.components;if(y+E>p)throw new Error("Too many attribute channels.");const x=new Float32Array(E*T);for(let v=0;vf&&X[w[f]].type!=null&&v.setAttribute(h,N)}y+=E});const A=i.createManifoldPrimitive();n.setExtension("EXT_mesh_manifold",A);const I=r.createAccessor("manifold indices").setBuffer(s).setType(C.Type.SCALAR).setArray(e.triVerts);A.setIndices(I),A.setRunIndex(a);const l=[...Array(e.numVert).keys()],b=Array(),u=Array();if(e.mergeFromVert&&e.mergeToVert){for(const[h,f]of e.mergeFromVert.entries())l[f]=e.mergeToVert[h];for(const[h,f]of e.triVerts.entries()){const d=l[f];f!==d&&(b.push(h),u.push(d))}}if(b.length>0){const h=r.createAccessor("merge from").setBuffer(s).setType(C.Type.SCALAR).setArray(new Uint32Array(b)),f=r.createAccessor("merge to").setBuffer(s).setType(C.Type.SCALAR).setArray(new Uint32Array(u));A.setMerge(h,f)}return n}function En(r){if(!r)return;const e=r.listPrimitives();for(const s of e){s.getIndices()?.dispose();for(const i of s.listAttributes())i.dispose()}const t=r.getExtension("EXT_mesh_manifold");t&&(t.getIndices()?.dispose(),t.getMergeIndices()?.dispose(),t.getMergeValues()?.dispose()),r.dispose()}function gr(r,e,t,s){const i=e.getArray(),n=e.getElementSize(),a=e.getCount();for(let c=0;cchild edges on this graph. */\n listEdges() {\n return Array.from(this._edges);\n }\n /** Returns a list of all edges on the graph having the given node as their child. */\n\n\n listParentEdges(node) {\n return Array.from(this._childEdges.get(node) || this._emptySet);\n }\n /** Returns a list of parent nodes for the given child node. */\n\n\n listParents(node) {\n return this.listParentEdges(node).map(edge => edge.getParent());\n }\n /** Returns a list of all edges on the graph having the given node as their parent. */\n\n\n listChildEdges(node) {\n return Array.from(this._parentEdges.get(node) || this._emptySet);\n }\n /** Returns a list of child nodes for the given parent node. */\n\n\n listChildren(node) {\n return this.listChildEdges(node).map(edge => edge.getChild());\n }\n\n disconnectParents(node, filter) {\n let edges = this.listParentEdges(node);\n\n if (filter) {\n edges = edges.filter(edge => filter(edge.getParent()));\n }\n\n edges.forEach(edge => edge.dispose());\n return this;\n }\n /**\n * Creates a {@link GraphEdge} connecting two {@link GraphNode} instances. Edge is returned\n * for the caller to store.\n * @param a Owner\n * @param b Resource\n */\n\n\n createEdge(name, a, b, attributes) {\n return this._registerEdge(new GraphEdge(name, a, b, attributes));\n }\n /**********************************************************************************************\n * Internal.\n */\n\n /** @hidden */\n\n\n _registerEdge(edge) {\n this._edges.add(edge);\n\n const parent = edge.getParent();\n if (!this._parentEdges.has(parent)) this._parentEdges.set(parent, new Set());\n\n this._parentEdges.get(parent).add(edge);\n\n const child = edge.getChild();\n if (!this._childEdges.has(child)) this._childEdges.set(child, new Set());\n\n this._childEdges.get(child).add(edge);\n\n edge.addEventListener('dispose', () => this._removeEdge(edge));\n return edge;\n }\n /**\n * Removes the {@link GraphEdge} from the {@link Graph}. This method should only\n * be invoked by the onDispose() listener created in {@link _registerEdge()}. The\n * public method of removing an edge is {@link GraphEdge.dispose}.\n */\n\n\n _removeEdge(edge) {\n this._edges.delete(edge);\n\n this._parentEdges.get(edge.getParent()).delete(edge);\n\n this._childEdges.get(edge.getChild()).delete(edge);\n\n return this;\n }\n\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction isRef(value) {\n return value instanceof GraphEdge;\n}\nfunction isRefList(value) {\n return Array.isArray(value) && value[0] instanceof GraphEdge;\n}\nfunction isRefMap(value) {\n return !!(isPlainObject(value) && getFirstValue(value) instanceof GraphEdge);\n}\n\nfunction getFirstValue(value) {\n for (const key in value) {\n return value[key];\n }\n}\n\nfunction isPlainObject(value) {\n return Boolean(value) && Object.getPrototypeOf(value) === Object.prototype;\n}\n\nconst $attributes = Symbol('attributes');\nconst $immutableKeys = Symbol('immutableKeys');\n/**\n * Represents a node in a {@link Graph}.\n */\n\nclass GraphNode extends EventDispatcher {\n /**\n * Internal graph used to search and maintain references.\n * @hidden\n */\n\n /**\n * Attributes (literal values and GraphNode references) associated with this instance. For each\n * GraphNode reference, the attributes stores a {@link GraphEdge}. List and Map references are\n * stored as arrays and dictionaries of edges.\n * @internal\n */\n\n /**\n * Attributes included with `getDefaultAttributes` are considered immutable, and cannot be\n * modifed by `.setRef()`, `.copy()`, or other GraphNode methods. Both the edges and the\n * properties will be disposed with the parent GraphNode.\n *\n * Currently, only single-edge references (getRef/setRef) are supported as immutables.\n *\n * @internal\n */\n constructor(graph) {\n super();\n this._disposed = false;\n this.graph = void 0;\n this[$attributes] = void 0;\n this[$immutableKeys] = void 0;\n this.graph = graph;\n this[$immutableKeys] = new Set();\n this[$attributes] = this._createAttributes();\n }\n /**\n * Returns default attributes for the graph node. Subclasses having any attributes (either\n * literal values or references to other graph nodes) must override this method. Literal\n * attributes should be given their default values, if any. References should generally be\n * initialized as empty (Ref → null, RefList → [], RefMap → {}) and then modified by setters.\n *\n * Any single-edge references (setRef) returned by this method will be considered immutable,\n * to be owned by and disposed with the parent node. Multi-edge references (addRef, removeRef,\n * setRefMap) cannot be returned as default attributes.\n */\n\n\n getDefaults() {\n return {};\n }\n /**\n * Constructs and returns an object used to store a graph nodes attributes. Compared to the\n * default Attributes interface, this has two distinctions:\n *\n * 1. Slots for GraphNode objects are replaced with slots for GraphEdge>\n * 2. GraphNode objects provided as defaults are considered immutable\n *\n * @internal\n */\n\n\n _createAttributes() {\n const defaultAttributes = this.getDefaults();\n const attributes = {};\n\n for (const key in defaultAttributes) {\n const value = defaultAttributes[key];\n\n if (value instanceof GraphNode) {\n const ref = this.graph.createEdge(key, this, value);\n ref.addEventListener('dispose', () => value.dispose());\n this[$immutableKeys].add(key);\n attributes[key] = ref;\n } else {\n attributes[key] = value;\n }\n }\n\n return attributes;\n }\n /** @internal Returns true if two nodes are on the same {@link Graph}. */\n\n\n isOnGraph(other) {\n return this.graph === other.graph;\n }\n /** Returns true if the node has been permanently removed from the graph. */\n\n\n isDisposed() {\n return this._disposed;\n }\n /**\n * Removes both inbound references to and outbound references from this object. At the end\n * of the process the object holds no references, and nothing holds references to it. A\n * disposed object is not reusable.\n */\n\n\n dispose() {\n if (this._disposed) return;\n this.graph.listChildEdges(this).forEach(edge => edge.dispose());\n this.graph.disconnectParents(this);\n this._disposed = true;\n this.dispatchEvent({\n type: 'dispose'\n });\n }\n /**\n * Removes all inbound references to this object. At the end of the process the object is\n * considered 'detached': it may hold references to child resources, but nothing holds\n * references to it. A detached object may be re-attached.\n */\n\n\n detach() {\n this.graph.disconnectParents(this);\n return this;\n }\n /**\n * Transfers this object's references from the old node to the new one. The old node is fully\n * detached from this parent at the end of the process.\n *\n * @hidden\n */\n\n\n swap(old, replacement) {\n for (const attribute in this[$attributes]) {\n const value = this[$attributes][attribute];\n\n if (isRef(value)) {\n const ref = value;\n\n if (ref.getChild() === old) {\n this.setRef(attribute, replacement, ref.getAttributes());\n }\n } else if (isRefList(value)) {\n const refs = value;\n const ref = refs.find(ref => ref.getChild() === old);\n\n if (ref) {\n const refAttributes = ref.getAttributes();\n this.removeRef(attribute, old).addRef(attribute, replacement, refAttributes);\n }\n } else if (isRefMap(value)) {\n const refMap = value;\n\n for (const key in refMap) {\n const ref = refMap[key];\n\n if (ref.getChild() === old) {\n this.setRefMap(attribute, key, replacement, ref.getAttributes());\n }\n }\n }\n }\n\n return this;\n }\n /**********************************************************************************************\n * Literal attributes.\n */\n\n /** @hidden */\n\n\n get(attribute) {\n return this[$attributes][attribute];\n }\n /** @hidden */\n\n\n set(attribute, value) {\n this[$attributes][attribute] = value;\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /**********************************************************************************************\n * Ref: 1:1 graph node references.\n */\n\n /** @hidden */\n\n\n getRef(attribute) {\n const ref = this[$attributes][attribute];\n return ref ? ref.getChild() : null;\n }\n /** @hidden */\n\n\n setRef(attribute, value, attributes) {\n if (this[$immutableKeys].has(attribute)) {\n throw new Error(`Cannot overwrite immutable attribute, \"${attribute}\".`);\n }\n\n const prevRef = this[$attributes][attribute];\n if (prevRef) prevRef.dispose(); // TODO(cleanup): Possible duplicate event.\n\n if (!value) return this;\n const ref = this.graph.createEdge(attribute, this, value, attributes);\n ref.addEventListener('dispose', () => {\n delete this[$attributes][attribute];\n this.dispatchEvent({\n type: 'change',\n attribute\n });\n });\n this[$attributes][attribute] = ref;\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /**********************************************************************************************\n * RefList: 1:many graph node references.\n */\n\n /** @hidden */\n\n\n listRefs(attribute) {\n const refs = this[$attributes][attribute];\n return refs.map(ref => ref.getChild());\n }\n /** @hidden */\n\n\n addRef(attribute, value, attributes) {\n const ref = this.graph.createEdge(attribute, this, value, attributes);\n const refs = this[$attributes][attribute];\n refs.push(ref);\n ref.addEventListener('dispose', () => {\n let index;\n\n while ((index = refs.indexOf(ref)) !== -1) {\n refs.splice(index, 1);\n }\n\n this.dispatchEvent({\n type: 'change',\n attribute\n });\n });\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /** @hidden */\n\n\n removeRef(attribute, value) {\n const refs = this[$attributes][attribute];\n const pruned = refs.filter(ref => ref.getChild() === value);\n pruned.forEach(ref => ref.dispose()); // TODO(cleanup): Possible duplicate event.\n\n return this;\n }\n /**********************************************************************************************\n * RefMap: Named 1:many (map) graph node references.\n */\n\n /** @hidden */\n\n\n listRefMapKeys(key) {\n return Object.keys(this[$attributes][key]);\n }\n /** @hidden */\n\n\n listRefMapValues(key) {\n return Object.values(this[$attributes][key]).map(ref => ref.getChild());\n }\n /** @hidden */\n\n\n getRefMap(attribute, key) {\n const refMap = this[$attributes][attribute];\n return refMap[key] ? refMap[key].getChild() : null;\n }\n /** @hidden */\n\n\n setRefMap(attribute, key, value, metadata) {\n const refMap = this[$attributes][attribute];\n const prevRef = refMap[key];\n if (prevRef) prevRef.dispose(); // TODO(cleanup): Possible duplicate event.\n\n if (!value) return this;\n metadata = Object.assign(metadata || {}, {\n key: key\n });\n const ref = this.graph.createEdge(attribute, this, value, _extends({}, metadata, {\n key\n }));\n ref.addEventListener('dispose', () => {\n delete refMap[key];\n this.dispatchEvent({\n type: 'change',\n attribute,\n key\n });\n });\n refMap[key] = ref;\n return this.dispatchEvent({\n type: 'change',\n attribute,\n key\n });\n }\n /**********************************************************************************************\n * Events.\n */\n\n /**\n * Dispatches an event on the GraphNode, and on the associated\n * Graph. Event types on the graph are prefixed, `\"node:[type]\"`.\n */\n\n\n dispatchEvent(event) {\n super.dispatchEvent(_extends({}, event, {\n target: this\n }));\n this.graph.dispatchEvent(_extends({}, event, {\n target: this,\n type: `node:${event.type}`\n }));\n return this;\n }\n\n}\n\nexport { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, isRef, isRefList, isRefMap };\n//# sourceMappingURL=property-graph.modern.js.map\n","import{GraphNode as t,$attributes as e,GraphEdge as r,$immutableKeys as s,isRefList as n,isRefMap as i,isRef as o,Graph as a}from\"property-graph\";export{Graph,GraphEdge}from\"property-graph\";const u=\"v3.8.0\",c=\"@glb.bin\";var h,f,l,d,g;!function(t){t.ACCESSOR=\"Accessor\",t.ANIMATION=\"Animation\",t.ANIMATION_CHANNEL=\"AnimationChannel\",t.ANIMATION_SAMPLER=\"AnimationSampler\",t.BUFFER=\"Buffer\",t.CAMERA=\"Camera\",t.MATERIAL=\"Material\",t.MESH=\"Mesh\",t.PRIMITIVE=\"Primitive\",t.PRIMITIVE_TARGET=\"PrimitiveTarget\",t.NODE=\"Node\",t.ROOT=\"Root\",t.SCENE=\"Scene\",t.SKIN=\"Skin\",t.TEXTURE=\"Texture\",t.TEXTURE_INFO=\"TextureInfo\"}(h||(h={})),function(t){t.INTERLEAVED=\"interleaved\",t.SEPARATE=\"separate\"}(f||(f={})),function(t){t.ARRAY_BUFFER=\"ARRAY_BUFFER\",t.ELEMENT_ARRAY_BUFFER=\"ELEMENT_ARRAY_BUFFER\",t.INVERSE_BIND_MATRICES=\"INVERSE_BIND_MATRICES\",t.OTHER=\"OTHER\",t.SPARSE=\"SPARSE\"}(l||(l={})),function(t){t[t.R=4096]=\"R\",t[t.G=256]=\"G\",t[t.B=16]=\"B\",t[t.A=1]=\"A\"}(d||(d={})),function(t){t.GLTF=\"GLTF\",t.GLB=\"GLB\"}(g||(g={}));const p={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var m,w=\"undefined\"!=typeof Float32Array?Float32Array:Array;function y(t){return Math.hypot(t[0],t[1],t[2])}function v(t,e,r){var s=e[0],n=e[1],i=e[2],o=r[3]*s+r[7]*n+r[11]*i+r[15];return t[0]=(r[0]*s+r[4]*n+r[8]*i+r[12])/(o=o||1),t[1]=(r[1]*s+r[5]*n+r[9]*i+r[13])/o,t[2]=(r[2]*s+r[6]*n+r[10]*i+r[14])/o,t}function T(t){const e={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]},r=t.propertyType===h.NODE?[t]:t.listChildren();for(const t of r)t.traverse(t=>{const r=t.getMesh();if(!r)return;const s=x(r,t.getWorldMatrix());A(s.min,e),A(s.max,e)});return e}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),m=new w(3),w!=Float32Array&&(m[0]=0,m[1]=0,m[2]=0);const b=T;function x(t,e){const r={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]};for(const s of t.listPrimitives()){const t=s.getAttribute(\"POSITION\");if(!t)continue;let n=[0,0,0],i=[0,0,0];for(let s=0;s=0;return Buffer.from(e,r?\"base64\":\"utf8\")}}static encodeText(t){return\"undefined\"!=typeof TextEncoder?(new TextEncoder).encode(t):Buffer.from(t)}static decodeText(t){return\"undefined\"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString(\"utf8\")}static concat(t){let e=0;for(const r of t)e+=r.byteLength;const r=new Uint8Array(e);let s=0;for(const e of t)r.set(e,s),s+=e.byteLength;return r}static pad(t,e=0){const r=this.padNumber(t.byteLength);if(r===t.byteLength)return t;const s=new Uint8Array(r);if(s.set(t),0!==e)for(let n=t.byteLength;n>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,this.convertSRGBToLinear(e,e)}static factorToHex(t){const e=[...t],[r,s,n]=this.convertLinearToSRGB(t,e);return 255*r<<16^255*s<<8^255*n<<0}static convertSRGBToLinear(t,e){const r=t,s=e;for(let t=0;t<3;t++)s[t]=r[t]<.04045?.0773993808*r[t]:Math.pow(.9478672986*r[t]+.0521327014,2.4);return e}static convertLinearToSRGB(t,e){const r=t,s=e;for(let t=0;t<3;t++)s[t]=r[t]<.0031308?12.92*r[t]:1.055*Math.pow(r[t],.41666)-.055;return e}}class M{match(t){return t.length>=8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}getSize(t){const e=new DataView(t.buffer,t.byteOffset);return E.decodeText(t.slice(12,16))===M.PNG_FRIED_CHUNK_NAME?[e.getUint32(32,!1),e.getUint32(36,!1)]:[e.getUint32(16,!1),e.getUint32(20,!1)]}getChannels(t){return 4}}M.PNG_FRIED_CHUNK_NAME=\"CgBI\";class I{static registerFormat(t,e){this.impls[t]=e}static getMimeType(t){for(const e in this.impls)if(this.impls[e].match(t))return e;return null}static getSize(t,e){return this.impls[e]?this.impls[e].getSize(t):null}static getChannels(t,e){return this.impls[e]?this.impls[e].getChannels(t):null}static getVRAMByteLength(t,e){if(!this.impls[e])return null;if(this.impls[e].getVRAMByteLength)return this.impls[e].getVRAMByteLength(t);let r=0;const s=this.getSize(t,e);if(!s)return null;for(;s[0]>1||s[1]>1;)r+=s[0]*s[1]*4,s[0]=Math.max(Math.floor(s[0]/2),1),s[1]=Math.max(Math.floor(s[1]/2),1);return r+=4,r}static mimeTypeToExtension(t){return\"image/jpeg\"===t?\"jpg\":t.split(\"/\").pop()}static extensionToMimeType(t){return\"jpg\"===t?\"image/jpeg\":t?`image/${t}`:\"\"}}function R(t,e){if(e>t.byteLength)throw new TypeError(\"Corrupt JPG, exceeded buffer limits\");if(255!==t.getUint8(e))throw new TypeError(\"Invalid JPG, marker table corrupted\");return t}I.impls={\"image/jpeg\":new class{match(t){return t.length>=3&&255===t[0]&&216===t[1]&&255===t[2]}getSize(t){let e,r,s=new DataView(t.buffer,t.byteOffset+4);for(;s.byteLength;){if(e=s.getUint16(0,!1),R(s,e),r=s.getUint8(e+1),192===r||193===r||194===r)return[s.getUint16(e+7,!1),s.getUint16(e+5,!1)];s=new DataView(t.buffer,s.byteOffset+e+2)}throw new TypeError(\"Invalid JPG, no size found\")}getChannels(t){return 3}},\"image/png\":new M};class N{static basename(t){const e=t.split(/[\\\\/]/).pop();return e.substring(0,e.lastIndexOf(\".\"))}static extension(t){if(t.startsWith(\"data:image/\")){const e=t.match(/data:(image\\/\\w+)/)[1];return I.mimeTypeToExtension(e)}return t.startsWith(\"data:model/gltf+json\")?\"gltf\":t.startsWith(\"data:model/gltf-binary\")?\"glb\":t.startsWith(\"data:application/\")?\"bin\":t.split(/[\\\\/]/).pop().split(/[.]/).pop()}}function O(t){return\"[object Object]\"===Object.prototype.toString.call(t)}function C(t){if(!1===O(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!1!==O(r)&&!1!==Object.prototype.hasOwnProperty.call(r,\"isPrototypeOf\")}var F,U;!function(t){t[t.SILENT=4]=\"SILENT\",t[t.ERROR=3]=\"ERROR\",t[t.WARN=2]=\"WARN\",t[t.INFO=1]=\"INFO\",t[t.DEBUG=0]=\"DEBUG\"}(U||(U={}));class B{constructor(t){this.verbosity=void 0,this.verbosity=t}debug(t){this.verbosity<=B.Verbosity.DEBUG&&console.debug(t)}info(t){this.verbosity<=B.Verbosity.INFO&&console.info(t)}warn(t){this.verbosity<=B.Verbosity.WARN&&console.warn(t)}error(t){this.verbosity<=B.Verbosity.ERROR&&console.error(t)}}function P(t,e,r){var s=e[0],n=e[1],i=e[2],o=e[3],a=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],g=e[11],p=e[12],m=e[13],w=e[14],y=e[15],v=r[0],T=r[1],b=r[2],x=r[3];return t[0]=v*s+T*a+b*f+x*p,t[1]=v*n+T*u+b*l+x*m,t[2]=v*i+T*c+b*d+x*w,t[3]=v*o+T*h+b*g+x*y,t[4]=(v=r[4])*s+(T=r[5])*a+(b=r[6])*f+(x=r[7])*p,t[5]=v*n+T*u+b*l+x*m,t[6]=v*i+T*c+b*d+x*w,t[7]=v*o+T*h+b*g+x*y,t[8]=(v=r[8])*s+(T=r[9])*a+(b=r[10])*f+(x=r[11])*p,t[9]=v*n+T*u+b*l+x*m,t[10]=v*i+T*c+b*d+x*w,t[11]=v*o+T*h+b*g+x*y,t[12]=(v=r[12])*s+(T=r[13])*a+(b=r[14])*f+(x=r[15])*p,t[13]=v*n+T*u+b*l+x*m,t[14]=v*i+T*c+b*d+x*w,t[15]=v*o+T*h+b*g+x*y,t}F=B,B.Verbosity=U,B.DEFAULT_INSTANCE=new F(F.Verbosity.INFO);class L{static identity(t){return t}static eq(t,e,r=1e-5){if(t.length!==e.length)return!1;for(let s=0;sr)return!1;return!0}static decodeNormalizedInt(t,e){switch(e){case 5126:return t;case 5123:return t/65535;case 5121:return t/255;case 5122:return Math.max(t/32767,-1);case 5120:return Math.max(t/127,-1);default:throw new Error(\"Invalid component type.\")}}static denormalize(t,e){return L.decodeNormalizedInt(t,e)}static encodeNormalizedInt(t,e){switch(e){case 5126:return t;case 5123:return Math.round(65535*t);case 5121:return Math.round(255*t);case 5122:return Math.round(32767*t);case 5120:return Math.round(127*t);default:throw new Error(\"Invalid component type.\")}}static normalize(t,e){return L.encodeNormalizedInt(t,e)}static decompose(t,e,r,s){let n=y([t[0],t[1],t[2]]);const i=y([t[4],t[5],t[6]]),o=y([t[8],t[9],t[10]]);var a,u,c,h,f,l,d,g,p,m,v,T,b,x,A,E,S;((u=(a=t)[0])*(d=a[5])-(c=a[1])*(l=a[4]))*((T=a[10])*(S=a[15])-(b=a[11])*(E=a[14]))-(u*(g=a[6])-(h=a[2])*l)*((v=a[9])*S-b*(A=a[13]))+(u*(p=a[7])-(f=a[3])*l)*(v*E-T*A)+(c*g-h*d)*((m=a[8])*S-b*(x=a[12]))-(c*p-f*d)*(m*E-T*x)+(h*p-f*g)*(m*A-v*x)<0&&(n=-n),e[0]=t[12],e[1]=t[13],e[2]=t[14];const M=t.slice(),I=1/n,R=1/i,N=1/o;M[0]*=I,M[1]*=I,M[2]*=I,M[4]*=R,M[5]*=R,M[6]*=R,M[8]*=N,M[9]*=N,M[10]*=N,function(t,e){var r=new w(3);!function(t,e){var r=e[4],s=e[5],n=e[6],i=e[8],o=e[9],a=e[10];t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,s,n),t[2]=Math.hypot(i,o,a)}(r,e);var s=1/r[0],n=1/r[1],i=1/r[2],o=e[0]*s,a=e[1]*n,u=e[2]*i,c=e[4]*s,h=e[5]*n,f=e[6]*i,l=e[8]*s,d=e[9]*n,g=e[10]*i,p=o+h+g,m=0;p>0?(m=2*Math.sqrt(p+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(l-u)/m,t[2]=(a-c)/m):o>h&&o>g?(m=2*Math.sqrt(1+o-h-g),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(a+c)/m,t[2]=(l+u)/m):h>g?(m=2*Math.sqrt(1+h-o-g),t[3]=(l-u)/m,t[0]=(a+c)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+g-o-h),t[3]=(a-c)/m,t[0]=(l+u)/m,t[1]=(f+d)/m,t[2]=.25*m)}(r,M),s[0]=n,s[1]=i,s[2]=o}static compose(t,e,r,s){const n=s,i=e[0],o=e[1],a=e[2],u=e[3],c=i+i,h=o+o,f=a+a,l=i*c,d=i*h,g=i*f,p=o*h,m=o*f,w=a*f,y=u*c,v=u*h,T=u*f,b=r[0],x=r[1],A=r[2];return n[0]=(1-(p+w))*b,n[1]=(d+T)*b,n[2]=(g-v)*b,n[3]=0,n[4]=(d-T)*x,n[5]=(1-(l+w))*x,n[6]=(m+y)*x,n[7]=0,n[8]=(g+v)*A,n[9]=(m-y)*A,n[10]=(1-(l+p))*A,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}}function j(t,e){if(!!t!=!!e)return!1;const r=t.getChild(),s=e.getChild();return r===s||r.equals(s)}function D(t,e){if(!!t!=!!e)return!1;if(t.length!==e.length)return!1;for(let r=0;rt,Y=new Set;class Z extends t{constructor(t,r=\"\"){super(t),this[e].name=r,this.init(),this.dispatchEvent({type:\"create\"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:\"\",extras:{}})}set(t,e){return Array.isArray(e)&&(e=e.slice()),super.set(t,e)}getName(){return this.get(\"name\")}setName(t){return this.set(\"name\",t)}getExtras(){return this.get(\"extras\")}setExtras(t){return this.set(\"extras\",t)}clone(){return new(0,this.constructor)(this.graph).copy(this,H)}copy(t,o=H){for(const t in this[e]){const o=this[e][t];if(o instanceof r)this[s].has(t)||o.dispose();else if(n(o))for(const t of o)t.dispose();else if(i(o))for(const t in o)o[t].dispose()}for(const a in t[e]){const u=this[e][a],c=t[e][a];if(c instanceof r)this[s].has(a)?u.getChild().copy(o(c.getChild()),o):this.setRef(a,o(c.getChild()),c.getAttributes());else if(n(c))for(const t of c)this.addRef(a,o(t.getChild()),t.getAttributes());else if(i(c))for(const t in c){const e=c[t];this.setRefMap(a,t,o(e.getChild()),e.getAttributes())}else this[e][a]=C(c)?JSON.parse(JSON.stringify(c)):Array.isArray(c)||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c.slice():c}return this}equals(t,r=Y){if(this===t)return!0;if(this.propertyType!==t.propertyType)return!1;for(const s in this[e]){if(r.has(s))continue;const a=this[e][s],u=t[e][s];if(o(a)||o(u)){if(!j(a,u))return!1}else if(n(a)||n(u)){if(!D(a,u))return!1}else if(i(a)||i(u)){if(!_(a,u))return!1}else if(C(a)||C(u)){if(!z(a,u))return!1}else if(G(a)||G(u)){if(!k(a,u))return!1}else if(a!==u)return!1}return!0}detach(){return this.graph.disconnectParents(this,t=>\"Root\"!==t.propertyType),this}listParents(){return this.graph.listParents(this)}}class K extends Z{getDefaults(){return Object.assign(super.getDefaults(),{extensions:{}})}getExtension(t){return this.getRefMap(\"extensions\",t)}setExtension(t,e){return e&&e.t(this),this.setRefMap(\"extensions\",t,e)}listExtensions(){return this.listRefMapValues(\"extensions\")}}class Q extends K{constructor(...t){super(...t),this.i=L.identity,this.o=L.identity}init(){this.propertyType=h.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:Q.Type.SCALAR,componentType:Q.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}copy(t,e=H){return super.copy(t,e),this.i=t.i,this.o=t.o,this}static getElementSize(t){switch(t){case Q.Type.SCALAR:return 1;case Q.Type.VEC2:return 2;case Q.Type.VEC3:return 3;case Q.Type.VEC4:case Q.Type.MAT2:return 4;case Q.Type.MAT3:return 9;case Q.Type.MAT4:return 16;default:throw new Error(\"Unexpected type: \"+t)}}static getComponentSize(t){switch(t){case Q.ComponentType.BYTE:case Q.ComponentType.UNSIGNED_BYTE:return 1;case Q.ComponentType.SHORT:case Q.ComponentType.UNSIGNED_SHORT:return 2;case Q.ComponentType.UNSIGNED_INT:case Q.ComponentType.FLOAT:return 4;default:throw new Error(\"Unexpected component type: \"+t)}}getMinNormalized(t){const e=this.getElementSize();this.getMin(t);for(let r=0;rL.decodeNormalizedInt(t,this.get(\"componentType\")),this.i=t=>L.encodeNormalizedInt(t,this.get(\"componentType\"))):(this.o=L.identity,this.i=L.identity),this}getScalar(t){const e=this.getElementSize();return this.o(this.get(\"array\")[t*e])}setScalar(t,e){return this.get(\"array\")[t*this.getElementSize()]=this.i(e),this}getElement(t,e){const r=this.getElementSize(),s=this.get(\"array\");for(let n=0;nt.u=null),this}removeChild(t){return this.removeRef(\"children\",t)}listChildren(){return this.listRefs(\"children\")}getParent(){return this.u?this.u:this.listParents().find(t=>t.propertyType===h.SCENE)||null}getParentNode(){return this.u}getMesh(){return this.getRef(\"mesh\")}setMesh(t){return this.setRef(\"mesh\",t)}getCamera(){return this.getRef(\"camera\")}setCamera(t){return this.setRef(\"camera\",t)}getSkin(){return this.getRef(\"skin\")}setSkin(t){return this.setRef(\"skin\",t)}getWeights(){return this.get(\"weights\")}setWeights(t){return this.set(\"weights\",t)}traverse(t){t(this);for(const e of this.listChildren())e.traverse(t);return this}}class dt extends K{init(){this.propertyType=h.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:dt.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef(\"indices\")}setIndices(t){return this.setRef(\"indices\",t,{usage:l.ELEMENT_ARRAY_BUFFER})}getAttribute(t){return this.getRefMap(\"attributes\",t)}setAttribute(t,e){return this.setRefMap(\"attributes\",t,e,{usage:l.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}getMaterial(){return this.getRef(\"material\")}setMaterial(t){return this.setRef(\"material\",t)}getMode(){return this.get(\"mode\")}setMode(t){return this.set(\"mode\",t)}listTargets(){return this.listRefs(\"targets\")}addTarget(t){return this.addRef(\"targets\",t)}removeTarget(t){return this.removeRef(\"targets\",t)}}dt.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gt extends Z{init(){this.propertyType=h.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(t){return this.getRefMap(\"attributes\",t)}setAttribute(t,e){return this.setRefMap(\"attributes\",t,e,{usage:l.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}}function pt(){return pt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.h.delete(this)),this}removeChild(t){return this.removeRef(\"children\",t)}listChildren(){return this.listRefs(\"children\")}traverse(t){for(const e of this.listChildren())e.traverse(t);return this}}class wt extends K{init(){this.propertyType=h.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:[]})}getSkeleton(){return this.getRef(\"skeleton\")}setSkeleton(t){return this.setRef(\"skeleton\",t)}getInverseBindMatrices(){return this.getRef(\"inverseBindMatrices\")}setInverseBindMatrices(t){return this.setRef(\"inverseBindMatrices\",t,{usage:l.INVERSE_BIND_MATRICES})}addJoint(t){return this.addRef(\"joints\",t)}removeJoint(t){return this.removeRef(\"joints\",t)}listJoints(){return this.listRefs(\"joints\")}}class yt extends K{init(){this.propertyType=h.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:\"\",uri:\"\"})}getMimeType(){return this.get(\"mimeType\")||I.extensionToMimeType(N.extension(this.get(\"uri\")))}setMimeType(t){return this.set(\"mimeType\",t)}getURI(){return this.get(\"uri\")}setURI(t){this.set(\"uri\",t);const e=I.extensionToMimeType(N.extension(t));return e&&this.set(\"mimeType\",e),this}getImage(){return this.get(\"image\")}setImage(t){return this.set(\"image\",E.assertView(t))}getSize(){const t=this.get(\"image\");return t?I.getSize(t,this.getMimeType()):null}}class vt extends K{init(){this.propertyType=h.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${u}`,version:\"2.0\"},defaultScene:null,accessors:[],animations:[],buffers:[],cameras:[],materials:[],meshes:[],nodes:[],scenes:[],skins:[],textures:[]})}constructor(t){super(t),this.l=new Set,t.addEventListener(\"node:create\",t=>{this.g(t.target)})}clone(){throw new Error(\"Root cannot be cloned.\")}copy(t,e=H){if(e===H)throw new Error(\"Root cannot be copied.\");this.set(\"asset\",pt({},t.get(\"asset\"))),this.setName(t.getName()),this.setExtras(pt({},t.getExtras())),this.setDefaultScene(t.getDefaultScene()?e(t.getDefaultScene()):null);for(const r of t.listRefMapKeys(\"extensions\")){const s=t.getExtension(r);this.setExtension(r,e(s))}return this}g(t){return t instanceof mt?this.addRef(\"scenes\",t):t instanceof lt?this.addRef(\"nodes\",t):t instanceof st?this.addRef(\"cameras\",t):t instanceof wt?this.addRef(\"skins\",t):t instanceof ft?this.addRef(\"meshes\",t):t instanceof ht?this.addRef(\"materials\",t):t instanceof yt?this.addRef(\"textures\",t):t instanceof X?this.addRef(\"animations\",t):t instanceof Q?this.addRef(\"accessors\",t):t instanceof rt&&this.addRef(\"buffers\",t),this}getAsset(){return this.get(\"asset\")}listExtensionsUsed(){return Array.from(this.l)}listExtensionsRequired(){return this.listExtensionsUsed().filter(t=>t.isRequired())}p(t){return this.l.add(t),this}m(t){return this.l.delete(t),this}listScenes(){return this.listRefs(\"scenes\")}setDefaultScene(t){return this.setRef(\"defaultScene\",t)}getDefaultScene(){return this.getRef(\"defaultScene\")}listNodes(){return this.listRefs(\"nodes\")}listCameras(){return this.listRefs(\"cameras\")}listSkins(){return this.listRefs(\"skins\")}listMeshes(){return this.listRefs(\"meshes\")}listMaterials(){return this.listRefs(\"materials\")}listTextures(){return this.listRefs(\"textures\")}listAnimations(){return this.listRefs(\"animations\")}listAccessors(){return this.listRefs(\"accessors\")}listBuffers(){return this.listRefs(\"buffers\")}}class Tt{static fromGraph(t){return Tt.v.get(t)||null}constructor(){this.T=new a,this.S=new vt(this.T),this.M=B.DEFAULT_INSTANCE,Tt.v.set(this.T,this)}getRoot(){return this.S}getGraph(){return this.T}getLogger(){return this.M}setLogger(t){return this.M=t,this}clone(){return(new Tt).setLogger(this.M).merge(this)}merge(t){for(const e of t.getRoot().listExtensionsUsed()){const t=this.createExtension(e.constructor);e.isRequired()&&t.setRequired(!0)}const e=new Set,r=new Map;e.add(t.S),r.set(t.S,this.S);for(const s of t.T.listEdges())for(const t of[s.getParent(),s.getChild()]){if(e.has(t))continue;let s;s=t.propertyType===h.TEXTURE_INFO?t:new(0,t.constructor)(this.T),r.set(t,s),e.add(t)}const s=t=>{const e=r.get(t);if(!e)throw new Error(\"Could resolve property.\");return e};for(const t of e){const e=r.get(t);if(!e)throw new Error(\"Could resolve property.\");e.propertyType!==h.TEXTURE_INFO&&e.copy(t,s)}return this}async transform(...t){const e=t.map(t=>t.name);for(const r of t)await r(this,{stack:e});return this}createExtension(t){const e=t.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(t=>t.extensionName===e)||new t(this)}createScene(t=\"\"){return new mt(this.T,t)}createNode(t=\"\"){return new lt(this.T,t)}createCamera(t=\"\"){return new st(this.T,t)}createSkin(t=\"\"){return new wt(this.T,t)}createMesh(t=\"\"){return new ft(this.T,t)}createPrimitive(){return new dt(this.T)}createPrimitiveTarget(t=\"\"){return new gt(this.T,t)}createMaterial(t=\"\"){return new ht(this.T,t)}createTexture(t=\"\"){return new yt(this.T,t)}createAnimation(t=\"\"){return new X(this.T,t)}createAnimationChannel(t=\"\"){return new tt(this.T,t)}createAnimationSampler(t=\"\"){return new et(this.T,t)}createAccessor(t=\"\",e=null){return e||(e=this.getRoot().listBuffers()[0]),new Q(this.T,t).setBuffer(e)}createBuffer(t=\"\"){return new rt(this.T,t)}}Tt.v=new WeakMap;class bt{constructor(t){this.extensionName=\"\",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this.I=void 0,this.document=t,t.getRoot().p(this),this.I=t=>{const e=t,r=e.target;r instanceof nt&&r.extensionName===this.extensionName&&(\"node:create\"===e.type&&this.N(r),\"node:dispose\"===e.type&&this.O(r))};const e=t.getGraph();e.addEventListener(\"node:create\",this.I),e.addEventListener(\"node:dispose\",this.I)}dispose(){this.document.getRoot().m(this);const t=this.document.getGraph();t.removeEventListener(\"node:create\",this.I),t.removeEventListener(\"node:dispose\",this.I);for(const t of this.properties)t.dispose()}static register(){}isRequired(){return this.required}setRequired(t){return this.required=t,this}listProperties(){return Array.from(this.properties)}N(t){return this.properties.add(t),this}O(t){return this.properties.delete(t),this}install(t,e){return this}preread(t,e){return this}prewrite(t,e){return this}}bt.EXTENSION_NAME=void 0;class xt{constructor(t){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=t}setTextureInfo(t,e){this.textureInfos.set(t,e),void 0!==e.texCoord&&t.setTexCoord(e.texCoord),void 0!==e.extras&&t.setExtras(e.extras);const r=this.jsonDoc.json.textures[e.index];if(void 0===r.sampler)return;const s=this.jsonDoc.json.samplers[r.sampler];void 0!==s.magFilter&&t.setMagFilter(s.magFilter),void 0!==s.minFilter&&t.setMinFilter(s.minFilter),void 0!==s.wrapS&&t.setWrapS(s.wrapS),void 0!==s.wrapT&&t.setWrapT(s.wrapT)}}const At={logger:B.DEFAULT_INSTANCE,extensions:[],dependencies:{}};class Et{static read(t,e=At){const r=pt({},At,e),{json:s}=t,n=(new Tt).setLogger(r.logger);this.validate(t,r);const i=new xt(t),o=s.asset,a=n.getRoot().getAsset();o.copyright&&(a.copyright=o.copyright),o.extras&&(a.extras=o.extras),void 0!==s.extras&&n.getRoot().setExtras(pt({},s.extras));const u=s.extensionsUsed||[],f=s.extensionsRequired||[];for(const t of r.extensions)if(u.includes(t.EXTENSION_NAME)){const e=n.createExtension(t).setRequired(f.includes(t.EXTENSION_NAME));for(const t of e.readDependencies)e.install(t,r.dependencies[t])}const l=s.buffers||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.BUFFER)).forEach(t=>t.preread(i,h.BUFFER)),i.buffers=l.map(t=>{const e=n.createBuffer(t.name);return t.extras&&e.setExtras(t.extras),t.uri&&0!==t.uri.indexOf(\"__\")&&e.setURI(t.uri),e}),i.bufferViewBuffers=(s.bufferViews||[]).map((e,r)=>{if(!i.bufferViews[r]){const s=t.json.buffers[e.buffer];i.bufferViews[r]=E.toView(s.uri?t.resources[s.uri]:t.resources[c],e.byteOffset||0,e.byteLength)}return i.buffers[e.buffer]});const d=s.accessors||[];i.accessors=d.map(t=>{const e=n.createAccessor(t.name,i.bufferViewBuffers[t.bufferView]).setType(t.type);return t.extras&&e.setExtras(t.extras),void 0!==t.normalized&&e.setNormalized(t.normalized),void 0===t.bufferView||e.setArray(St(t,i)),e});const g=s.images||[],m=s.textures||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.TEXTURE)).forEach(t=>t.preread(i,h.TEXTURE)),i.textures=g.map(e=>{const r=n.createTexture(e.name);if(e.extras&&r.setExtras(e.extras),void 0!==e.bufferView){const n=s.bufferViews[e.bufferView],i=t.json.buffers[n.buffer],o=n.byteOffset||0,a=(i.uri?t.resources[i.uri]:t.resources[c]).slice(o,o+n.byteLength);r.setImage(a)}else void 0!==e.uri&&(r.setImage(t.resources[e.uri]),0!==e.uri.indexOf(\"__\")&&r.setURI(e.uri));if(void 0!==e.mimeType)r.setMimeType(e.mimeType);else if(e.uri){const t=N.extension(e.uri);r.setMimeType(I.extensionToMimeType(t))}return r}),i.materials=(s.materials||[]).map(t=>{const e=n.createMaterial(t.name);t.extras&&e.setExtras(t.extras),void 0!==t.alphaMode&&e.setAlphaMode(t.alphaMode),void 0!==t.alphaCutoff&&e.setAlphaCutoff(t.alphaCutoff),void 0!==t.doubleSided&&e.setDoubleSided(t.doubleSided);const r=t.pbrMetallicRoughness||{};if(void 0!==r.baseColorFactor&&e.setBaseColorFactor(r.baseColorFactor),void 0!==t.emissiveFactor&&e.setEmissiveFactor(t.emissiveFactor),void 0!==r.metallicFactor&&e.setMetallicFactor(r.metallicFactor),void 0!==r.roughnessFactor&&e.setRoughnessFactor(r.roughnessFactor),void 0!==r.baseColorTexture){const t=r.baseColorTexture;e.setBaseColorTexture(i.textures[m[t.index].source]),i.setTextureInfo(e.getBaseColorTextureInfo(),t)}if(void 0!==t.emissiveTexture){const r=t.emissiveTexture;e.setEmissiveTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getEmissiveTextureInfo(),r)}if(void 0!==t.normalTexture){const r=t.normalTexture;e.setNormalTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getNormalTextureInfo(),r),void 0!==t.normalTexture.scale&&e.setNormalScale(t.normalTexture.scale)}if(void 0!==t.occlusionTexture){const r=t.occlusionTexture;e.setOcclusionTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getOcclusionTextureInfo(),r),void 0!==t.occlusionTexture.strength&&e.setOcclusionStrength(t.occlusionTexture.strength)}if(void 0!==r.metallicRoughnessTexture){const t=r.metallicRoughnessTexture;e.setMetallicRoughnessTexture(i.textures[m[t.index].source]),i.setTextureInfo(e.getMetallicRoughnessTextureInfo(),t)}return e});const w=s.meshes||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.PRIMITIVE)).forEach(t=>t.preread(i,h.PRIMITIVE)),i.meshes=w.map(t=>{const e=n.createMesh(t.name);return t.extras&&e.setExtras(t.extras),void 0!==t.weights&&e.setWeights(t.weights),(t.primitives||[]).forEach(r=>{const s=n.createPrimitive();r.extras&&s.setExtras(r.extras),void 0!==r.material&&s.setMaterial(i.materials[r.material]),void 0!==r.mode&&s.setMode(r.mode);for(const[t,e]of Object.entries(r.attributes||{}))s.setAttribute(t,i.accessors[e]);void 0!==r.indices&&s.setIndices(i.accessors[r.indices]);const o=t.extras&&t.extras.targetNames||[];(r.targets||[]).forEach((t,e)=>{const r=o[e]||e.toString(),a=n.createPrimitiveTarget(r);for(const[e,r]of Object.entries(t))a.setAttribute(e,i.accessors[r]);s.addTarget(a)}),e.addPrimitive(s)}),e}),i.cameras=(s.cameras||[]).map(t=>{const e=n.createCamera(t.name).setType(t.type);if(t.extras&&e.setExtras(t.extras),t.type===st.Type.PERSPECTIVE){const r=t.perspective;e.setYFov(r.yfov),e.setZNear(r.znear),void 0!==r.zfar&&e.setZFar(r.zfar),void 0!==r.aspectRatio&&e.setAspectRatio(r.aspectRatio)}else{const r=t.orthographic;e.setZNear(r.znear).setZFar(r.zfar).setXMag(r.xmag).setYMag(r.ymag)}return e});const y=s.nodes||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.NODE)).forEach(t=>t.preread(i,h.NODE)),i.nodes=y.map(t=>{const e=n.createNode(t.name);if(t.extras&&e.setExtras(t.extras),void 0!==t.translation&&e.setTranslation(t.translation),void 0!==t.rotation&&e.setRotation(t.rotation),void 0!==t.scale&&e.setScale(t.scale),void 0!==t.matrix){const r=[0,0,0],s=[0,0,0,1],n=[1,1,1];L.decompose(t.matrix,r,s,n),e.setTranslation(r),e.setRotation(s),e.setScale(n)}return void 0!==t.weights&&e.setWeights(t.weights),e}),i.skins=(s.skins||[]).map(t=>{const e=n.createSkin(t.name);t.extras&&e.setExtras(t.extras),void 0!==t.inverseBindMatrices&&e.setInverseBindMatrices(i.accessors[t.inverseBindMatrices]),void 0!==t.skeleton&&e.setSkeleton(i.nodes[t.skeleton]);for(const r of t.joints)e.addJoint(i.nodes[r]);return e}),y.map((t,e)=>{const r=i.nodes[e];(t.children||[]).forEach(t=>r.addChild(i.nodes[t])),void 0!==t.mesh&&r.setMesh(i.meshes[t.mesh]),void 0!==t.camera&&r.setCamera(i.cameras[t.camera]),void 0!==t.skin&&r.setSkin(i.skins[t.skin])}),i.animations=(s.animations||[]).map(t=>{const e=n.createAnimation(t.name);t.extras&&e.setExtras(t.extras);const r=(t.samplers||[]).map(t=>{const r=n.createAnimationSampler().setInput(i.accessors[t.input]).setOutput(i.accessors[t.output]).setInterpolation(t.interpolation||et.Interpolation.LINEAR);return t.extras&&r.setExtras(t.extras),e.addSampler(r),r});return(t.channels||[]).forEach(t=>{const s=n.createAnimationChannel().setSampler(r[t.sampler]).setTargetPath(t.target.path);void 0!==t.target.node&&s.setTargetNode(i.nodes[t.target.node]),t.extras&&s.setExtras(t.extras),e.addChannel(s)}),e});const v=s.scenes||[];return n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.SCENE)).forEach(t=>t.preread(i,h.SCENE)),i.scenes=v.map(t=>{const e=n.createScene(t.name);return t.extras&&e.setExtras(t.extras),(t.nodes||[]).map(t=>i.nodes[t]).forEach(t=>e.addChild(t)),e}),void 0!==s.scene&&n.getRoot().setDefaultScene(i.scenes[s.scene]),n.getRoot().listExtensionsUsed().forEach(t=>t.read(i)),d.forEach((t,e)=>{const r=i.accessors[e],s=!!t.sparse,n=!t.bufferView&&!r.getArray();(s||n)&&r.setSparse(!0).setArray(function(t,e){const r=p[t.componentType],s=Q.getElementSize(t.type);let n;n=void 0!==t.bufferView?St(t,e):new r(t.count*s);const i=t.sparse;if(!i)return n;const o=i.count,a=pt({},t,i.indices,{count:o,type:\"SCALAR\"}),u=pt({},t,i.values,{count:o}),c=St(a,e),h=St(u,e);for(let t=0;te.EXTENSION_NAME===t))throw new Error(`Missing required extension, \"${t}\".`);if(r.extensionsUsed)for(const t of r.extensionsUsed)e.extensions.find(e=>e.EXTENSION_NAME===t)||e.logger.warn(`Missing optional extension, \"${t}\".`)}}function St(t,e){const r=e.bufferViews[t.bufferView],s=e.jsonDoc.json.bufferViews[t.bufferView],n=p[t.componentType],i=Q.getElementSize(t.type),o=n.BYTES_PER_ELEMENT;if(void 0!==s.byteStride&&s.byteStride!==i*o)return function(t,e){const r=e.bufferViews[t.bufferView],s=e.jsonDoc.json.bufferViews[t.bufferView],n=p[t.componentType],i=Q.getElementSize(t.type),o=n.BYTES_PER_ELEMENT,a=t.byteOffset||0,u=new n(t.count*i),c=new DataView(r.buffer,r.byteOffset,r.byteLength),h=s.byteStride;for(let e=0;e1,()=>r.basename||\"buffer\"),this.imageURIGenerator=new Rt(i>1,e=>function(t,e){const r=t.getGraph().listParentEdges(e).find(e=>e.getParent()!==t.getRoot());return r?r.getName().replace(/texture$/i,\"\"):\"\"}(t,e)||r.basename||\"texture\"),this.logger=t.getLogger()}createTextureInfoDef(t,e){const r={magFilter:e.getMagFilter()||void 0,minFilter:e.getMinFilter()||void 0,wrapS:e.getWrapS(),wrapT:e.getWrapT()},s=JSON.stringify(r);this.samplerDefIndexMap.has(s)||(this.samplerDefIndexMap.set(s,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(r));const n={source:this.imageIndexMap.get(t),sampler:this.samplerDefIndexMap.get(s)},i=JSON.stringify(n);this.textureDefIndexMap.has(i)||(this.textureDefIndexMap.set(i,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(n));const o={index:this.textureDefIndexMap.get(i)};return 0!==e.getTexCoord()&&(o.texCoord=e.getTexCoord()),Object.keys(e.getExtras()).length>0&&(o.extras=e.getExtras()),this.textureInfoDefMap.set(e,o),o}createPropertyDef(t){const e={};return t.getName()&&(e.name=t.getName()),Object.keys(t.getExtras()).length>0&&(e.extras=t.getExtras()),e}createAccessorDef(t){const e=this.createPropertyDef(t);return e.type=t.getType(),e.componentType=t.getComponentType(),e.count=t.getCount(),this.C.getGraph().listParentEdges(t).some(t=>\"attributes\"===t.getName()&&\"POSITION\"===t.getAttributes().key||\"input\"===t.getName())&&(e.max=t.getMax([]).map(Math.fround),e.min=t.getMin([]).map(Math.fround)),t.getNormalized()&&(e.normalized=t.getNormalized()),e}createImageData(t,e,r){if(this.options.format===g.GLB)this.imageBufferViews.push(e),t.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:e.byteLength});else{const s=I.mimeTypeToExtension(r.getMimeType());t.uri=this.imageURIGenerator.createURI(r,s),this.jsonDoc.resources[t.uri]=e}}getAccessorUsage(t){const e=this.F.get(t);if(e)return e;if(t.getSparse())return l.SPARSE;for(const e of this.C.getGraph().listParentEdges(t)){const{usage:t}=e.getAttributes();if(t)return t;e.getParent().propertyType!==h.ROOT&&this.logger.warn(`Missing attribute \".usage\" on edge, \"${e.getName()}\".`)}return l.OTHER}addAccessorToUsageGroup(t,e){const r=this.F.get(t);if(r&&r!==e)throw new Error(`Accessor with usage \"${r}\" cannot be reused as \"${e}\".`);return this.F.set(t,e),this}listAccessorUsageGroups(){const t={};for(const[e,r]of Array.from(this.F.entries()))t[r]=t[r]||[],t[r].push(e);return t}}It.BufferViewTarget=Mt,It.BufferViewUsage=l,It.USAGE_TO_TARGET={[l.ARRAY_BUFFER]:Mt.ARRAY_BUFFER,[l.ELEMENT_ARRAY_BUFFER]:Mt.ELEMENT_ARRAY_BUFFER};class Rt{constructor(t,e){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=t,this.basename=e}createURI(t,e){if(t.getURI())return t.getURI();if(this.multiple){const r=this.basename(t);return this.counter[r]=this.counter[r]||1,`${r}_${this.counter[r]++}.${e}`}return`${this.basename(t)}.${e}`}}const{BufferViewUsage:Nt}=It,{UNSIGNED_INT:Ot,UNSIGNED_SHORT:Ct,UNSIGNED_BYTE:Ft}=Q.ComponentType;class Ut{static write(t,e){const r=t.getRoot(),s={asset:pt({generator:`glTF-Transform ${u}`},r.getAsset()),extras:pt({},r.getExtras())},n={json:s,resources:{}},i=new It(t,n,e),o=e.logger||B.DEFAULT_INSTANCE,a=new Set(e.extensions.map(t=>t.EXTENSION_NAME)),l=t.getRoot().listExtensionsUsed().filter(t=>a.has(t.extensionName)),d=t.getRoot().listExtensionsRequired().filter(t=>a.has(t.extensionName));l.lengthe.getCount()/3){const t=(100*r.length/e.getCount()).toFixed(1);o.warn(`Sparse accessor with many non-zero elements (${t}%) may increase file size.`)}const d=p[e.getComponentType()];l.indices=r,l.values=new d(n)}if(!Number.isFinite(c))return{buffers:n,byteLength:a};const h=c<255?Uint8Array:c<65535?Uint16Array:Uint32Array,f=c<255?Ft:c<65535?Ct:Ot,l={buffer:e,byteOffset:r+a,byteLength:0};for(const e of t){const t=u.get(e);if(0===t.count)continue;t.indicesByteOffset=l.byteLength;const r=E.pad(E.toView(new h(t.indices)));n.push(r),a+=r.byteLength,l.byteLength+=r.byteLength}s.bufferViews.push(l);const d=s.bufferViews.length-1,g={buffer:e,byteOffset:r+a,byteLength:0};for(const e of t){const t=u.get(e);if(0===t.count)continue;t.valuesByteOffset=g.byteLength;const r=E.pad(E.toView(t.values));n.push(r),a+=r.byteLength,g.byteLength+=r.byteLength}s.bufferViews.push(g);const m=s.bufferViews.length-1;for(const e of t){const t=u.get(e);0!==t.count&&(t.accessorDef.sparse={count:t.count,indices:{bufferView:d,byteOffset:t.indicesByteOffset,componentType:f},values:{bufferView:m,byteOffset:t.valuesByteOffset}})}return{buffers:n,byteLength:a}}const v=new Map;for(const e of t.getGraph().listEdges()){if(e.getParent()===r)continue;const t=e.getChild();if(t instanceof Q){const r=v.get(t)||[];r.push(e),v.set(t,r)}}if(s.accessors=[],s.bufferViews=[],s.samplers=[],s.textures=[],s.images=r.listTextures().map((t,e)=>{const r=i.createPropertyDef(t);t.getMimeType()&&(r.mimeType=t.getMimeType());const s=t.getImage();return s&&i.createImageData(r,s,t),i.imageIndexMap.set(t,e),r}),l.filter(t=>t.prewriteTypes.includes(h.ACCESSOR)).forEach(t=>t.prewrite(i,h.ACCESSOR)),r.listAccessors().forEach(t=>{const e=i.accessorUsageGroupedByParent,r=i.accessorParents;if(i.accessorIndexMap.has(t))return;const s=v.get(t)||[],n=i.getAccessorUsage(t);if(i.addAccessorToUsageGroup(t,n),e.has(n)){const e=s[0].getParent(),n=r.get(e)||new Set;n.add(t),r.set(e,n)}}),l.filter(t=>t.prewriteTypes.includes(h.BUFFER)).forEach(t=>t.prewrite(i,h.BUFFER)),(r.listAccessors().length>0||r.listTextures().length>0||i.otherBufferViews.size>0)&&0===r.listBuffers().length)throw new Error(\"Buffer required for Document resources, but none was found.\");s.buffers=[],r.listBuffers().forEach((t,r)=>{const o=i.createPropertyDef(t),a=i.accessorUsageGroupedByParent,u=i.accessorParents,h=t.listParents().filter(t=>t instanceof Q),l=new Set(h),d=[],p=s.buffers.length;let v=0;const T=i.listAccessorUsageGroups();for(const t in T)if(a.has(t))for(const r of Array.from(u.values())){const s=Array.from(r).filter(t=>l.has(t)).filter(e=>i.getAccessorUsage(e)===t);if(s.length)if(t!==Nt.ARRAY_BUFFER||e.vertexLayout===f.INTERLEAVED){const e=t===Nt.ARRAY_BUFFER?w(s,p,v):m(s,p,v);v+=e.byteLength,d.push(...e.buffers)}else for(const t of s){const e=w([t],p,v);v+=e.byteLength,d.push(...e.buffers)}}else{const e=T[t].filter(t=>l.has(t));if(!e.length)continue;const r=t===Nt.ELEMENT_ARRAY_BUFFER?It.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,s=t===Nt.SPARSE?y(e,p,v):m(e,p,v,r);v+=s.byteLength,d.push(...s.buffers)}if(i.imageBufferViews.length&&0===r)for(let t=0;t!t.getBuffer())&&o.warn(\"Skipped writing one or more Accessors: no Buffer assigned.\"),s.materials=r.listMaterials().map((t,e)=>{const r=i.createPropertyDef(t);if(t.getAlphaMode()!==ht.AlphaMode.OPAQUE&&(r.alphaMode=t.getAlphaMode()),t.getAlphaMode()===ht.AlphaMode.MASK&&(r.alphaCutoff=t.getAlphaCutoff()),t.getDoubleSided()&&(r.doubleSided=!0),r.pbrMetallicRoughness={},L.eq(t.getBaseColorFactor(),[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=t.getBaseColorFactor()),L.eq(t.getEmissiveFactor(),[0,0,0])||(r.emissiveFactor=t.getEmissiveFactor()),1!==t.getRoughnessFactor()&&(r.pbrMetallicRoughness.roughnessFactor=t.getRoughnessFactor()),1!==t.getMetallicFactor()&&(r.pbrMetallicRoughness.metallicFactor=t.getMetallicFactor()),t.getBaseColorTexture()){const e=t.getBaseColorTexture(),s=t.getBaseColorTextureInfo();r.pbrMetallicRoughness.baseColorTexture=i.createTextureInfoDef(e,s)}if(t.getEmissiveTexture()){const e=t.getEmissiveTexture(),s=t.getEmissiveTextureInfo();r.emissiveTexture=i.createTextureInfoDef(e,s)}if(t.getNormalTexture()){const e=t.getNormalTexture(),s=t.getNormalTextureInfo(),n=i.createTextureInfoDef(e,s);1!==t.getNormalScale()&&(n.scale=t.getNormalScale()),r.normalTexture=n}if(t.getOcclusionTexture()){const e=t.getOcclusionTexture(),s=t.getOcclusionTextureInfo(),n=i.createTextureInfoDef(e,s);1!==t.getOcclusionStrength()&&(n.strength=t.getOcclusionStrength()),r.occlusionTexture=n}if(t.getMetallicRoughnessTexture()){const e=t.getMetallicRoughnessTexture(),s=t.getMetallicRoughnessTextureInfo();r.pbrMetallicRoughness.metallicRoughnessTexture=i.createTextureInfoDef(e,s)}return i.materialIndexMap.set(t,e),r}),s.meshes=r.listMeshes().map((t,e)=>{const r=i.createPropertyDef(t);let s=null;return r.primitives=t.listPrimitives().map(t=>{const e={attributes:{}};e.mode=t.getMode();const r=t.getMaterial();r&&(e.material=i.materialIndexMap.get(r)),Object.keys(t.getExtras()).length&&(e.extras=t.getExtras());const n=t.getIndices();n&&(e.indices=i.accessorIndexMap.get(n));for(const r of t.listSemantics())e.attributes[r]=i.accessorIndexMap.get(t.getAttribute(r));for(const r of t.listTargets()){const t={};for(const e of r.listSemantics())t[e]=i.accessorIndexMap.get(r.getAttribute(e));e.targets=e.targets||[],e.targets.push(t)}return t.listTargets().length&&!s&&(s=t.listTargets().map(t=>t.getName())),e}),t.getWeights().length&&(r.weights=t.getWeights()),s&&(r.extras=r.extras||{},r.extras.targetNames=s),i.meshIndexMap.set(t,e),r}),s.cameras=r.listCameras().map((t,e)=>{const r=i.createPropertyDef(t);if(r.type=t.getType(),r.type===st.Type.PERSPECTIVE){r.perspective={znear:t.getZNear(),zfar:t.getZFar(),yfov:t.getYFov()};const e=t.getAspectRatio();null!==e&&(r.perspective.aspectRatio=e)}else r.orthographic={znear:t.getZNear(),zfar:t.getZFar(),xmag:t.getXMag(),ymag:t.getYMag()};return i.cameraIndexMap.set(t,e),r}),s.nodes=r.listNodes().map((t,e)=>{const r=i.createPropertyDef(t);return L.eq(t.getTranslation(),[0,0,0])||(r.translation=t.getTranslation()),L.eq(t.getRotation(),[0,0,0,1])||(r.rotation=t.getRotation()),L.eq(t.getScale(),[1,1,1])||(r.scale=t.getScale()),t.getWeights().length&&(r.weights=t.getWeights()),i.nodeIndexMap.set(t,e),r}),s.skins=r.listSkins().map((t,e)=>{const r=i.createPropertyDef(t),s=t.getInverseBindMatrices();s&&(r.inverseBindMatrices=i.accessorIndexMap.get(s));const n=t.getSkeleton();return n&&(r.skeleton=i.nodeIndexMap.get(n)),r.joints=t.listJoints().map(t=>i.nodeIndexMap.get(t)),i.skinIndexMap.set(t,e),r}),r.listNodes().forEach((t,e)=>{const r=s.nodes[e],n=t.getMesh();n&&(r.mesh=i.meshIndexMap.get(n));const o=t.getCamera();o&&(r.camera=i.cameraIndexMap.get(o));const a=t.getSkin();a&&(r.skin=i.skinIndexMap.get(a)),t.listChildren().length>0&&(r.children=t.listChildren().map(t=>i.nodeIndexMap.get(t)))}),s.animations=r.listAnimations().map((t,e)=>{const r=i.createPropertyDef(t),s=new Map;return r.samplers=t.listSamplers().map((t,e)=>{const r=i.createPropertyDef(t);return r.input=i.accessorIndexMap.get(t.getInput()),r.output=i.accessorIndexMap.get(t.getOutput()),r.interpolation=t.getInterpolation(),s.set(t,e),r}),r.channels=t.listChannels().map(t=>{const e=i.createPropertyDef(t);return e.sampler=s.get(t.getSampler()),e.target={node:i.nodeIndexMap.get(t.getTargetNode()),path:t.getTargetPath()},e}),i.animationIndexMap.set(t,e),r}),s.scenes=r.listScenes().map((t,e)=>{const r=i.createPropertyDef(t);return r.nodes=t.listChildren().map(t=>i.nodeIndexMap.get(t)),i.sceneIndexMap.set(t,e),r});const T=r.getDefaultScene();return T&&(s.scene=r.listScenes().indexOf(T)),s.extensionsUsed=l.map(t=>t.extensionName),s.extensionsRequired=d.map(t=>t.extensionName),l.forEach(t=>t.write(i)),function(t){const e=[];for(const r in t){const s=t[r];(Array.isArray(s)&&0===s.length||null===s||\"\"===s||s&&\"object\"==typeof s&&0===Object.keys(s).length)&&e.push(r)}for(const r of e)delete t[r]}(s),n}}var Bt;!function(t){t[t.JSON=1313821514]=\"JSON\",t[t.BIN=5130562]=\"BIN\"}(Bt||(Bt={}));class Pt{constructor(){this.M=B.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=f.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(t){return this.M=t,this}registerExtensions(t){for(const e of t)this.l.add(e),e.register();return this}registerDependencies(t){return Object.assign(this.U,t),this}setVertexLayout(t){return this.P=t,this}async read(t){return await this.readJSON(await this.readAsJSON(t))}async readAsJSON(t){const e=await this.readURI(t,\"view\");this.lastReadBytes=e.byteLength;const r=Lt(e)?this.L(e):{json:JSON.parse(E.decodeText(e)),resources:{}};return await this.j(r,this.dirname(t)),this.D(r),r}async readJSON(t){return t=this._(t),this.D(t),Et.read(t,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(t){const e=this.L(E.assertView(t));this.D(e);const r=e.json;if(r.buffers&&r.buffers.some(t=>function(t,e){return void 0!==e.uri&&!(e.uri in t.resources)}(e,t)))throw new Error(\"Cannot resolve external buffers with binaryToJSON().\");if(r.images&&r.images.some(t=>function(t,e){return void 0!==e.uri&&!(e.uri in t.resources)&&void 0===e.bufferView}(e,t)))throw new Error(\"Cannot resolve external images with binaryToJSON().\");return e}async readBinary(t){return this.readJSON(await this.binaryToJSON(E.assertView(t)))}async writeJSON(t,e={}){if(e.format===g.GLB&&t.getRoot().listBuffers().length>1)throw new Error(\"GLB must have 0–1 buffers.\");return Ut.write(t,{format:e.format||g.GLTF,basename:e.basename||\"\",logger:this.M,vertexLayout:this.P,dependencies:pt({},this.U),extensions:Array.from(this.l)})}async writeBinary(t){const{json:e,resources:r}=await this.writeJSON(t,{format:g.GLB}),s=new Uint32Array([1179937895,2,12]),n=JSON.stringify(e),i=E.pad(E.encodeText(n),32),o=E.toView(new Uint32Array([i.byteLength,1313821514])),a=E.concat([o,i]);s[s.length-1]+=a.byteLength;const u=Object.values(r)[0];if(!u||!u.byteLength)return E.concat([E.toView(s),a]);const c=E.pad(u,0),h=E.toView(new Uint32Array([c.byteLength,5130562])),f=E.concat([h,c]);return s[s.length-1]+=f.byteLength,E.concat([E.toView(s),a,f])}async j(t,e){var r=this;const s=[...t.json.images||[],...t.json.buffers||[]].map(async function(s){const n=s.uri;if(!n||n.match(/data:/))return Promise.resolve();t.resources[n]=await r.readURI(r.resolve(e,n),\"view\"),r.lastReadBytes+=t.resources[n].byteLength});await Promise.all(s)}D(t){function e(e){if(e.uri)if(e.uri in t.resources)E.assertView(t.resources[e.uri]);else if(e.uri.match(/data:/)){const r=`__${V()}.${N.extension(e.uri)}`;t.resources[r]=E.createBufferFromDataURI(e.uri),e.uri=r}}(t.json.images||[]).forEach(t=>{if(void 0===t.bufferView&&void 0===t.uri)throw new Error(\"Missing resource URI or buffer view.\");e(t)}),(t.json.buffers||[]).forEach(e)}_(t){const{images:e,buffers:r}=t.json;return t={json:pt({},t.json),resources:pt({},t.resources)},e&&(t.json.images=e.map(t=>pt({},t))),r&&(t.json.buffers=r.map(t=>pt({},t))),t}L(t){if(!Lt(t))throw new Error(\"Invalid glTF 2.0 binary.\");const e=new Uint32Array(t.buffer,t.byteOffset+12,2);if(e[1]!==Bt.JSON)throw new Error(\"Missing required GLB JSON chunk.\");const r=e[0],s=E.decodeText(E.toView(t,20,r)),n=JSON.parse(s),i=20+r;if(t.byteLength<=i)return{json:n,resources:{}};const o=new Uint32Array(t.buffer,t.byteOffset+i,2);if(o[1]!==Bt.BIN)throw new Error(\"Expected GLB BIN in second chunk.\");const a=E.toView(t,i+8,o[0]);return{json:n,resources:{[c]:a}}}}function Lt(t){if(t.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(t.buffer,t.byteOffset,3);return 1179937895===e[0]&&2===e[1]}class jt extends Pt{constructor(t=null,e=q.DEFAULT_INIT){super(),this.k=void 0,this.J=void 0,this.$=void 0,this.V=!1,this.k=t,this.J=e,this.$=this.init()}async init(){return this.$?this.$:Promise.all([import(\"fs\"),import(\"path\")]).then(([t,e])=>{this.W=t.promises,this.q=e})}setAllowHTTP(t){if(t&&!this.k)throw new Error(\"NodeIO requires a Fetch API implementation for HTTP requests.\");return this.V=t,this}async readURI(t,e){if(await this.init(),q.isAbsoluteURL(t)){if(!this.V||!this.k)throw new Error(\"Network request blocked. Allow HTTP requests explicitly, if needed.\");const r=await this.k(t,this.J);switch(e){case\"view\":return new Uint8Array(await r.arrayBuffer());case\"text\":return r.text()}}else switch(e){case\"view\":return this.W.readFile(t);case\"text\":return this.W.readFile(t,\"utf8\")}}resolve(t,e){return q.isAbsoluteURL(t)||q.isAbsoluteURL(e)?q.resolve(t,e):this.q.resolve(t,decodeURIComponent(e))}dirname(t){return q.isAbsoluteURL(t)?q.dirname(t):this.q.dirname(t)}async write(t,e){await this.init();const r=!!t.match(/\\.glb$/);await(r?this.H(t,e):this.Y(t,e))}async Y(t,e){var r=this;this.lastWriteBytes=0;const{json:s,resources:n}=await this.writeJSON(e,{format:g.GLTF,basename:N.basename(t)}),{W:i,q:o}=this,a=o.dirname(t),u=JSON.stringify(s,null,2);this.lastWriteBytes+=u.length,await i.writeFile(t,u);const c=Object.keys(n).map(async function(t){if(q.isAbsoluteURL(t)){if(\"bin\"===q.extension(t))throw new Error(`Cannot write buffer to path \"${t}\".`);return}const e=Buffer.from(n[t]),s=o.join(a,decodeURIComponent(t));await i.mkdir(o.dirname(s),{recursive:!0}),await i.writeFile(s,e),r.lastWriteBytes+=e.byteLength});await Promise.all(c)}async H(t,e){const r=Buffer.from(await this.writeBinary(e));await this.W.writeFile(t,r),this.lastWriteBytes=r.byteLength}}class Dt extends Pt{constructor(t){super(),this.q=void 0,this.q=t}async readURI(t,e){switch(e){case\"view\":return Deno.readFile(t);case\"text\":return Deno.readTextFile(t)}}resolve(t,e){return this.q.resolve(t,decodeURIComponent(e))}dirname(t){return this.q.dirname(t)}}class _t extends Pt{constructor(t=q.DEFAULT_INIT){super(),this.J=void 0,this.J=t}async readURI(t,e){const r=await fetch(t,this.J);switch(e){case\"view\":return new Uint8Array(await r.arrayBuffer());case\"text\":return r.text()}}resolve(t,e){return q.resolve(t,e)}dirname(t){return q.dirname(t)}}export{Q as Accessor,X as Animation,tt as AnimationChannel,et as AnimationSampler,rt as Buffer,E as BufferUtils,H as COPY_IDENTITY,st as Camera,S as ColorUtils,p as ComponentTypeToTypedArray,Dt as DenoIO,Tt as Document,K as ExtensibleProperty,bt as Extension,nt as ExtensionProperty,N as FileUtils,g as Format,c as GLB_BUFFER,q as HTTPUtils,I as ImageUtils,B as Logger,ht as Material,L as MathUtils,ft as Mesh,lt as Node,jt as NodeIO,Pt as PlatformIO,dt as Primitive,gt as PrimitiveTarget,Z as Property,h as PropertyType,xt as ReaderContext,vt as Root,mt as Scene,wt as Skin,yt as Texture,d as TextureChannel,it as TextureInfo,u as VERSION,U as Verbosity,f as VertexLayout,_t as WebIO,It as WriterContext,b as bounds,T as getBounds,V as uuid};\n//# sourceMappingURL=core.modern.js.map\n","\"use strict\"\n\nfunction iota(n) {\n var result = new Array(n)\n for(var i=0; i\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","var iota = require(\"iota-array\")\nvar isBuffer = require(\"is-buffer\")\n\nvar hasTypedArrays = ((typeof Float64Array) !== \"undefined\")\n\nfunction compare1st(a, b) {\n return a[0] - b[0]\n}\n\nfunction order() {\n var stride = this.stride\n var terms = new Array(stride.length)\n var i\n for(i=0; iMath.abs(this.stride[1]))?[1,0]:[0,1]}})\")\n } else if(dimension === 3) {\n code.push(\n\"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\\\nif(s0>s1){\\\nif(s1>s2){\\\nreturn [2,1,0];\\\n}else if(s0>s2){\\\nreturn [1,2,0];\\\n}else{\\\nreturn [1,0,2];\\\n}\\\n}else if(s0>s2){\\\nreturn [2,0,1];\\\n}else if(s2>s1){\\\nreturn [0,1,2];\\\n}else{\\\nreturn [0,2,1];\\\n}}})\")\n }\n } else {\n code.push(\"ORDER})\")\n }\n }\n\n //view.set(i0, ..., v):\n code.push(\n\"proto.set=function \"+className+\"_set(\"+args.join(\",\")+\",v){\")\n if(useGetters) {\n code.push(\"return this.data.set(\"+index_str+\",v)}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]=v}\")\n }\n\n //view.get(i0, ...):\n code.push(\"proto.get=function \"+className+\"_get(\"+args.join(\",\")+\"){\")\n if(useGetters) {\n code.push(\"return this.data.get(\"+index_str+\")}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]}\")\n }\n\n //view.index:\n code.push(\n \"proto.index=function \"+className+\"_index(\", args.join(), \"){return \"+index_str+\"}\")\n\n //view.hi():\n code.push(\"proto.hi=function \"+className+\"_hi(\"+args.join(\",\")+\"){return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return [\"(typeof i\",i,\"!=='number'||i\",i,\"<0)?this.shape[\", i, \"]:i\", i,\"|0\"].join(\"\")\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"this.stride[\"+i + \"]\"\n }).join(\",\")+\",this.offset)}\")\n\n //view.lo():\n var a_vars = indices.map(function(i) { return \"a\"+i+\"=this.shape[\"+i+\"]\" })\n var c_vars = indices.map(function(i) { return \"c\"+i+\"=this.stride[\"+i+\"]\" })\n code.push(\"proto.lo=function \"+className+\"_lo(\"+args.join(\",\")+\"){var b=this.offset,d=0,\"+a_vars.join(\",\")+\",\"+c_vars.join(\",\"))\n for(var i=0; i=0){\\\nd=i\"+i+\"|0;\\\nb+=c\"+i+\"*d;\\\na\"+i+\"-=d}\")\n }\n code.push(\"return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return \"a\"+i\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"c\"+i\n }).join(\",\")+\",b)}\")\n\n //view.step():\n code.push(\"proto.step=function \"+className+\"_step(\"+args.join(\",\")+\"){var \"+\n indices.map(function(i) {\n return \"a\"+i+\"=this.shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"b\"+i+\"=this.stride[\"+i+\"]\"\n }).join(\",\")+\",c=this.offset,d=0,ceil=Math.ceil\")\n for(var i=0; i=0){c=(c+this.stride[\"+i+\"]*i\"+i+\")|0}else{a.push(this.shape[\"+i+\"]);b.push(this.stride[\"+i+\"])}\")\n }\n code.push(\"var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}\")\n\n //Add return statement\n code.push(\"return function construct_\"+className+\"(data,shape,stride,offset){return new \"+className+\"(data,\"+\n indices.map(function(i) {\n return \"shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"stride[\"+i+\"]\"\n }).join(\",\")+\",offset)}\")\n\n //Compile procedure\n var procedure = new Function(\"CTOR_LIST\", \"ORDER\", code.join(\"\\n\"))\n return procedure(CACHED_CONSTRUCTORS[dtype], order)\n}\n\nfunction arrayDType(data) {\n if(isBuffer(data)) {\n return \"buffer\"\n }\n if(hasTypedArrays) {\n switch(Object.prototype.toString.call(data)) {\n case \"[object Float64Array]\":\n return \"float64\"\n case \"[object Float32Array]\":\n return \"float32\"\n case \"[object Int8Array]\":\n return \"int8\"\n case \"[object Int16Array]\":\n return \"int16\"\n case \"[object Int32Array]\":\n return \"int32\"\n case \"[object Uint8Array]\":\n return \"uint8\"\n case \"[object Uint16Array]\":\n return \"uint16\"\n case \"[object Uint32Array]\":\n return \"uint32\"\n case \"[object Uint8ClampedArray]\":\n return \"uint8_clamped\"\n case \"[object BigInt64Array]\":\n return \"bigint64\"\n case \"[object BigUint64Array]\":\n return \"biguint64\"\n }\n }\n if(Array.isArray(data)) {\n return \"array\"\n }\n return \"generic\"\n}\n\nvar CACHED_CONSTRUCTORS = {\n \"float32\":[],\n \"float64\":[],\n \"int8\":[],\n \"int16\":[],\n \"int32\":[],\n \"uint8\":[],\n \"uint16\":[],\n \"uint32\":[],\n \"array\":[],\n \"uint8_clamped\":[],\n \"bigint64\": [],\n \"biguint64\": [],\n \"buffer\":[],\n \"generic\":[]\n}\n\n;(function() {\n for(var id in CACHED_CONSTRUCTORS) {\n CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))\n }\n});\n\nfunction wrappedNDArrayCtor(data, shape, stride, offset) {\n if(data === undefined) {\n var ctor = CACHED_CONSTRUCTORS.array[0]\n return ctor([])\n } else if(typeof data === \"number\") {\n data = [data]\n }\n if(shape === undefined) {\n shape = [ data.length ]\n }\n var d = shape.length\n if(stride === undefined) {\n stride = new Array(d)\n for(var i=d-1, sz=1; i>=0; --i) {\n stride[i] = sz\n sz *= shape[i]\n }\n }\n if(offset === undefined) {\n offset = 0\n for(var i=0; i0\n , code = []\n , vars = []\n , idx=0, pidx=0, i, j\n for(i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n } \n //Scan loop\n for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards\n idx = order[i]\n code.push([\"for(i\",i,\"=0;i\",i,\" 0) {\n code.push([\"index[\",pidx,\"]-=s\",pidx].join(\"\"))\n }\n code.push([\"++index[\",idx,\"]\"].join(\"\"))\n }\n code.push(\"}\")\n }\n return code.join(\"\\n\")\n}\n\n// Generate \"outer\" loops that loop over blocks of data, applying \"inner\" loops to the blocks by manipulating the local variables in such a way that the inner loop only \"sees\" the current block.\n// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.\n// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and \"shape\" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.\nfunction outerFill(matched, order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , blockSize = proc.blockSize\n , has_index = proc.indexArgs.length > 0\n , code = []\n for(var i=0; i0;){\"].join(\"\")) // Iterate back to front\n code.push([\"if(j\",i,\"<\",blockSize,\"){\"].join(\"\")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).\n code.push([\"s\",order[i],\"=j\",i].join(\"\"))\n code.push([\"j\",i,\"=0\"].join(\"\"))\n code.push([\"}else{s\",order[i],\"=\",blockSize].join(\"\"))\n code.push([\"j\",i,\"-=\",blockSize,\"}\"].join(\"\"))\n if(has_index) {\n code.push([\"index[\",order[i],\"]=j\",i].join(\"\"))\n }\n }\n for(var i=0; i 0) {\n allEqual = allEqual && summary[i] === summary[i-1]\n }\n }\n if(allEqual) {\n return summary[0]\n }\n return summary.join(\"\")\n}\n\n//Generates a cwise operator\nfunction generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n for(var i=0; i 0) {\n vars.push(\"shape=SS.slice(0)\") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)\n }\n if(proc.indexArgs.length > 0) {\n // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.\n var zeros = new Array(dimension)\n for(var i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n }\n for(var i=0; i 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(loopOrders)\n if(matched < dimension) {\n code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.\n } else {\n code.push(innerFill(loopOrders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"-----Generated cwise routine for \", typesig, \":\\n\" + code.join(\"\\n\") + \"\\n----------\")\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}\nmodule.exports = generateCWiseOp\n","\"use strict\"\n\n// The function below is called when constructing a cwise function object, and does the following:\n// A function object is constructed which accepts as argument a compilation function and returns another function.\n// It is this other function that is eventually returned by createThunk, and this function is the one that actually\n// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.\n// The compilation passed to the first function object is used for compiling new functions.\n// Once this function object is created, it is called with compile as argument, where the first argument of compile\n// is bound to \"proc\" (essentially containing a preprocessed version of the user arguments to cwise).\n// So createThunk roughly works like this:\n// function createThunk(proc) {\n// var thunk = function(compileBound) {\n// var CACHED = {}\n// return function(arrays and scalars) {\n// if (dtype and order of arrays in CACHED) {\n// var func = CACHED[dtype and order of arrays]\n// } else {\n// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)\n// }\n// return func(arrays and scalars)\n// }\n// }\n// return thunk(compile.bind1(proc))\n// }\n\nvar compile = require(\"./compile.js\")\n\nfunction createThunk(proc) {\n var code = [\"'use strict'\", \"var CACHED={}\"]\n var vars = []\n var thunkName = proc.funcName + \"_cwise_thunk\"\n \n //Build thunk\n code.push([\"return function \", thunkName, \"(\", proc.shimArgs.join(\",\"), \"){\"].join(\"\"))\n var typesig = []\n var string_typesig = []\n var proc_args = [[\"array\",proc.arrayArgs[0],\".shape.slice(\", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).\n Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(\",\"+proc.arrayBlockIndices[0]+\")\"):\")\"].join(\"\")]\n var shapeLengthConditions = [], shapeConditions = []\n // Process array arguments\n for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)\n shapeLengthConditions.push(\"array\" + proc.arrayArgs[0] + \".shape.length===array\" + j + \".shape.length+\" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))\n shapeConditions.push(\"array\" + proc.arrayArgs[0] + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[0]) + \"]===array\" + j + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[i]) + \"]\")\n }\n }\n // Check for shape equality\n if (proc.arrayArgs.length > 1) {\n code.push(\"if (!(\" + shapeLengthConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\")\n code.push(\"for(var shapeIndex=array\" + proc.arrayArgs[0] + \".shape.length-\" + Math.abs(proc.arrayBlockIndices[0]) + \"; shapeIndex-->0;) {\")\n code.push(\"if (!(\" + shapeConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same shape!')\")\n code.push(\"}\")\n }\n // Process scalar arguments\n for(var i=0; i0) {\n throw new Error(\"cwise: pre() block may not reference array args\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count>0) {\n throw new Error(\"cwise: post() block may not reference array args\")\n }\n } else if(arg_type === \"scalar\") {\n proc.scalarArgs.push(i)\n proc.shimArgs.push(\"scalar\" + i)\n } else if(arg_type === \"index\") {\n proc.indexArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {\n throw new Error(\"cwise: pre() block may not reference array index\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array index\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count > 0) {\n throw new Error(\"cwise: post() block may not reference array index\")\n }\n } else if(arg_type === \"shape\") {\n proc.shapeArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {\n throw new Error(\"cwise: pre() block may not write to array shape\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array shape\")\n }\n if(i < proc.post.args.length && proc.post.args[i].lvalue) {\n throw new Error(\"cwise: post() block may not write to array shape\")\n }\n } else if(typeof arg_type === \"object\" && arg_type.offset) {\n proc.argTypes[i] = \"offset\"\n proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })\n proc.offsetArgIndex.push(i)\n } else {\n throw new Error(\"cwise: Unknown argument type \" + proc_args[i])\n }\n }\n \n //Make sure at least one array argument was specified\n if(proc.arrayArgs.length <= 0) {\n throw new Error(\"cwise: No array arguments specified\")\n }\n \n //Make sure arguments are correct\n if(proc.pre.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in pre() block\")\n }\n if(proc.body.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in body() block\")\n }\n if(proc.post.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in post() block\")\n }\n\n //Check debug flag\n proc.debug = !!user_args.printCode || !!user_args.debug\n \n //Retrieve name\n proc.funcName = user_args.funcName || \"cwise\"\n \n //Read in block size\n proc.blockSize = user_args.blockSize || 64\n\n return createThunk(proc)\n}\n\nmodule.exports = compileCwise\n","\"use strict\"\n\nvar compile = require(\"cwise-compiler\")\n\nvar EmptyProc = {\n body: \"\",\n args: [],\n thisVars: [],\n localVars: []\n}\n\nfunction fixup(x) {\n if(!x) {\n return EmptyProc\n }\n for(var i=0; i>\",\n rrshift: \">>>\"\n}\n;(function(){\n for(var id in assign_ops) {\n var op = assign_ops[id]\n exports[id] = makeOp({\n args: [\"array\",\"array\",\"array\"],\n body: {args:[\"a\",\"b\",\"c\"],\n body: \"a=b\"+op+\"c\"},\n funcName: id\n })\n exports[id+\"eq\"] = makeOp({\n args: [\"array\",\"array\"],\n body: {args:[\"a\",\"b\"],\n body:\"a\"+op+\"=b\"},\n rvalue: true,\n funcName: id+\"eq\"\n })\n exports[id+\"s\"] = makeOp({\n args: [\"array\", \"array\", \"scalar\"],\n body: {args:[\"a\",\"b\",\"s\"],\n body:\"a=b\"+op+\"s\"},\n funcName: id+\"s\"\n })\n exports[id+\"seq\"] = makeOp({\n args: [\"array\",\"scalar\"],\n body: {args:[\"a\",\"s\"],\n body:\"a\"+op+\"=s\"},\n rvalue: true,\n funcName: id+\"seq\"\n })\n }\n})();\n\nvar unary_ops = {\n not: \"!\",\n bnot: \"~\",\n neg: \"-\",\n recip: \"1.0/\"\n}\n;(function(){\n for(var id in unary_ops) {\n var op = unary_ops[id]\n exports[id] = makeOp({\n args: [\"array\", \"array\"],\n body: {args:[\"a\",\"b\"],\n body:\"a=\"+op+\"b\"},\n funcName: id\n })\n exports[id+\"eq\"] = makeOp({\n args: [\"array\"],\n body: {args:[\"a\"],\n body:\"a=\"+op+\"a\"},\n rvalue: true,\n count: 2,\n funcName: id+\"eq\"\n })\n }\n})();\n\nvar binary_ops = {\n and: \"&&\",\n or: \"||\",\n eq: \"===\",\n neq: \"!==\",\n lt: \"<\",\n gt: \">\",\n leq: \"<=\",\n geq: \">=\"\n}\n;(function() {\n for(var id in binary_ops) {\n var op = binary_ops[id]\n exports[id] = makeOp({\n args: [\"array\",\"array\",\"array\"],\n body: {args:[\"a\", \"b\", \"c\"],\n body:\"a=b\"+op+\"c\"},\n funcName: id\n })\n exports[id+\"s\"] = makeOp({\n args: [\"array\",\"array\",\"scalar\"],\n body: {args:[\"a\", \"b\", \"s\"],\n body:\"a=b\"+op+\"s\"},\n funcName: id+\"s\"\n })\n exports[id+\"eq\"] = makeOp({\n args: [\"array\", \"array\"],\n body: {args:[\"a\", \"b\"],\n body:\"a=a\"+op+\"b\"},\n rvalue:true,\n count:2,\n funcName: id+\"eq\"\n })\n exports[id+\"seq\"] = makeOp({\n args: [\"array\", \"scalar\"],\n body: {args:[\"a\",\"s\"],\n body:\"a=a\"+op+\"s\"},\n rvalue:true,\n count:2,\n funcName: id+\"seq\"\n })\n }\n})();\n\nvar math_unary = [\n \"abs\",\n \"acos\",\n \"asin\",\n \"atan\",\n \"ceil\",\n \"cos\",\n \"exp\",\n \"floor\",\n \"log\",\n \"round\",\n \"sin\",\n \"sqrt\",\n \"tan\"\n]\n;(function() {\n for(var i=0; ithis_s){this_s=-a}else if(a>this_s){this_s=a}\", localVars: [], thisVars: [\"this_s\"]},\n post: {args:[], localVars:[], thisVars:[\"this_s\"], body:\"return this_s\"},\n funcName: \"norminf\"\n})\n\nexports.norm1 = compile({\n args:[\"array\"],\n pre: {args:[], localVars:[], thisVars:[\"this_s\"], body:\"this_s=0\"},\n body: {args:[{name:\"a\", lvalue:false, rvalue:true, count:3}], body: \"this_s+=a<0?-a:a\", localVars: [], thisVars: [\"this_s\"]},\n post: {args:[], localVars:[], thisVars:[\"this_s\"], body:\"return this_s\"},\n funcName: \"norm1\"\n})\n\nexports.sup = compile({\n args: [ \"array\" ],\n pre:\n { body: \"this_h=-Infinity\",\n args: [],\n thisVars: [ \"this_h\" ],\n localVars: [] },\n body:\n { body: \"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_\",\n args: [{\"name\":\"_inline_1_arg0_\",\"lvalue\":false,\"rvalue\":true,\"count\":2} ],\n thisVars: [ \"this_h\" ],\n localVars: [] },\n post:\n { body: \"return this_h\",\n args: [],\n thisVars: [ \"this_h\" ],\n localVars: [] }\n })\n\nexports.inf = compile({\n args: [ \"array\" ],\n pre:\n { body: \"this_h=Infinity\",\n args: [],\n thisVars: [ \"this_h\" ],\n localVars: [] },\n body:\n { body: \"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}\",\n args:[\n {name:\"_inline_1_arg0_\",lvalue:false,rvalue:true,count:2},\n {name:\"_inline_1_arg1_\",lvalue:false,rvalue:true,count:2}],\n thisVars:[\"this_i\",\"this_v\"],\n localVars:[\"_inline_1_k\"]},\n post:{\n body:\"{return this_i}\",\n args:[],\n thisVars:[\"this_i\"],\n localVars:[]}\n}) \n\nexports.random = makeOp({\n args: [\"array\"],\n pre: {args:[], body:\"this_f=Math.random\", thisVars:[\"this_f\"]},\n body: {args: [\"a\"], body:\"a=this_f()\", thisVars:[\"this_f\"]},\n funcName: \"random\"\n})\n\nexports.assign = makeOp({\n args:[\"array\", \"array\"],\n body: {args:[\"a\", \"b\"], body:\"a=b\"},\n funcName: \"assign\" })\n\nexports.assigns = makeOp({\n args:[\"array\", \"scalar\"],\n body: {args:[\"a\", \"b\"], body:\"a=b\"},\n funcName: \"assigns\" })\n\n\nexports.equals = compile({\n args:[\"array\", \"array\"],\n pre: EmptyProc,\n body: {args:[{name:\"x\", lvalue:false, rvalue:true, count:1},\n {name:\"y\", lvalue:false, rvalue:true, count:1}], \n body: \"if(x!==y){return false}\", \n localVars: [], \n thisVars: []},\n post: {args:[], localVars:[], thisVars:[], body:\"return true\"},\n funcName: \"equals\"\n})\n\n\n","import ndarray from 'ndarray';\nimport ops from 'ndarray-ops';\n\nfunction getPixelsInternal(buffer, mimeType) {\n // Warn for Data URIs, URLs, and file paths. Support removed in v3.\n if (!(buffer instanceof Uint8Array)) {\n throw new Error('[ndarray-pixels] Input must be Uint8Array or Buffer.');\n }\n\n const blob = new Blob([buffer], {\n type: mimeType\n });\n const path = URL.createObjectURL(blob); // Decode image with Canvas API.\n\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n\n img.onload = function () {\n URL.revokeObjectURL(path);\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n const pixels = context.getImageData(0, 0, img.width, img.height);\n resolve(ndarray(new Uint8Array(pixels.data), [img.width, img.height, 4], [4, 4 * img.width, 1], 0));\n };\n\n img.onerror = err => {\n URL.revokeObjectURL(path);\n reject(err);\n };\n\n img.src = path;\n });\n}\n\nfunction putPixelData(array, data, frame = -1) {\n if (array.shape.length === 4) {\n return putPixelData(array.pick(frame), data, 0);\n } else if (array.shape.length === 3) {\n if (array.shape[2] === 3) {\n ops.assign(ndarray(data, [array.shape[0], array.shape[1], 3], [4, 4 * array.shape[0], 1]), array);\n ops.assigns(ndarray(data, [array.shape[0] * array.shape[1]], [4], 3), 255);\n } else if (array.shape[2] === 4) {\n ops.assign(ndarray(data, [array.shape[0], array.shape[1], 4], [4, array.shape[0] * 4, 1]), array);\n } else if (array.shape[2] === 1) {\n ops.assign(ndarray(data, [array.shape[0], array.shape[1], 3], [4, 4 * array.shape[0], 1]), ndarray(array.data, [array.shape[0], array.shape[1], 3], [array.stride[0], array.stride[1], 0], array.offset));\n ops.assigns(ndarray(data, [array.shape[0] * array.shape[1]], [4], 3), 255);\n } else {\n throw new Error('[ndarray-pixels] Incompatible array shape.');\n }\n } else if (array.shape.length === 2) {\n ops.assign(ndarray(data, [array.shape[0], array.shape[1], 3], [4, 4 * array.shape[0], 1]), ndarray(array.data, [array.shape[0], array.shape[1], 3], [array.stride[0], array.stride[1], 0], array.offset));\n ops.assigns(ndarray(data, [array.shape[0] * array.shape[1]], [4], 3), 255);\n } else {\n throw new Error('[ndarray-pixels] Incompatible array shape.');\n }\n\n return data;\n}\n\nasync function savePixelsInternal(pixels, mimeType, options = {}) {\n // Create HTMLCanvasElement and write pixel data.\n const canvas = document.createElement('canvas');\n canvas.width = pixels.shape[0];\n canvas.height = pixels.shape[1];\n const context = canvas.getContext('2d');\n const imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n putPixelData(pixels, imageData.data);\n context.putImageData(imageData, 0, 0);\n const quality = options.quality ? options.quality / 100 : undefined; // Encode to target format.\n\n switch (mimeType) {\n case 'image/jpeg':\n return streamCanvas(canvas, 'image/jpeg', quality);\n\n default:\n return streamCanvas(canvas, mimeType);\n }\n}\n/** Creates readable stream from given HTMLCanvasElement and options. */\n\nfunction streamCanvas(canvas, mimeType, quality) {\n return new Promise((resolve, reject) => {\n canvas.toBlob(async blob => {\n if (blob) {\n resolve(new Uint8Array(await blob.arrayBuffer()));\n } else {\n reject(new Error('[ndarray-pixels] Failed to canvas.toBlob().'));\n }\n }, mimeType, quality);\n });\n}\n\n/**\n * Decodes image data to an `ndarray`.\n *\n * MIME type is optional when given a path or URL, and required when given a Uint8Array.\n *\n * Accepts `image/png` or `image/jpeg` in Node.js, and additional formats on browsers with\n * the necessary support in Canvas 2D.\n *\n * @param data\n * @param mimeType `image/jpeg`, `image/png`, etc.\n * @returns\n */\n\nasync function getPixels(data, mimeType) {\n return getPixelsInternal(data, mimeType);\n}\n/**\n * Encodes an `ndarray` as image data in the given format.\n *\n * If the source `ndarray` was constructed manually with default stride, use\n * `ndarray.transpose(1, 0)` to reshape it and ensure an identical result from getPixels(). For an\n * ndarray created by getPixels(), this isn't necessary.\n *\n * Accepts `image/png` or `image/jpeg` in Node.js, and additional formats on browsers with\n * the necessary support in Canvas 2D.\n *\n * @param pixels ndarray of shape W x H x 4.\n * @param mimeType `image/jpeg`, `image/png`, etc.\n * @returns\n */\n\n\nasync function savePixels(pixels, mimeType) {\n return savePixelsInternal(pixels, mimeType);\n}\n\nexport { getPixels, savePixels };\n//# sourceMappingURL=ndarray-pixels-browser.modern.js.map\n","import{Primitive as t,PropertyType as e,Document as n,getBounds as o,Scene as r,BufferUtils as s,Root as i,TextureInfo as a,Texture as c,ExtensionProperty as l,AnimationChannel as g,ColorUtils as u,Material as f,Accessor as p,PrimitiveTarget as m,MathUtils as d,ImageUtils as h,ComponentTypeToTypedArray as A,TextureChannel as T,Node as y,AnimationSampler as E,uuid as S}from\"@gltf-transform/core\";import{getPixels as M,savePixels as I}from\"ndarray-pixels\";import{KHRMeshQuantization as w,KHRDracoMeshCompression as N,EXTMeshGPUInstancing as b,EXTMeshoptCompression as R,KHRMaterialsIOR as C,KHRMaterialsSpecular as O,KHRMaterialsPBRSpecularGlossiness as $,EXTTextureWebP as v,EXTTextureAVIF as P,KHRMaterialsUnlit as x}from\"@gltf-transform/extensions\";import{read as L,KHR_DF_MODEL_ETC1S as z,KHR_DF_MODEL_UASTC as F}from\"ktx-parse\";import _ from\"ndarray\";import{lanczos3 as G,lanczos2 as k}from\"ndarray-lanczos\";function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;ee?\"–\":\"+\")+(Math.abs(t-e)/t*100).toFixed(n)+\"%\"}(t,e)})`}function K(t){const e=[];for(const n of t.listAttributes())e.push(n);for(const n of t.listTargets())for(const t of n.listAttributes())e.push(t);return Array.from(new Set(e))}function J(t,e,n){t.swap(e,n);for(const o of t.listTargets())o.swap(e,n)}function Z(t,e){if(null==t&&null==e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(let n=0;n{const n=t.getAttribute(e);return`${e}:${n.getElementSize()}:${n.getComponentType()}`}).join(\"+\")}|${t.listTargets().map(e=>e.listSemantics().sort().map(e=>{const n=t.getAttribute(e);return`${e}:${n.getElementSize()}:${n.getComponentType()}`}).join(\"+\")).join(\"~\")}`}function et(t,e){const[n,o]=e,[r,s]=t;if(r<=n&&s<=o)return t;let i=r,a=s;return i>n&&(a=Math.floor(a*(n/i)),i=n),a>o&&(i=Math.floor(i*(o/a)),a=o),[i,a]}const nt=\"center\",ot={pivot:\"center\"};function rt(t=ot){const e=q({},ot,t);return B(nt,t=>{const n=t.getLogger(),r=t.getRoot(),s=r.listAnimations().length>0||r.listSkins().length>0;t.getRoot().listScenes().forEach((i,a)=>{let c;if(n.debug(`${nt}: Scene ${a+1} / ${r.listScenes().length}.`),\"string\"==typeof e.pivot){const t=o(i);c=[(t.max[0]-t.min[0])/2+t.min[0],(t.max[1]-t.min[1])/2+t.min[1],(t.max[2]-t.min[2])/2+t.min[2]],\"above\"===e.pivot&&(c[1]=t.max[1]),\"below\"===e.pivot&&(c[1]=t.min[1])}else c=e.pivot;n.debug(`${nt}: Pivot \"${c.join(\", \")}\".`);const l=[-1*c[0],-1*c[1],-1*c[2]];if(s){n.debug(`${nt}: Model contains animation or skin. Adding a wrapper node.`);const e=t.createNode(\"Pivot\").setTranslation(l);i.listChildren().forEach(t=>e.addChild(t)),i.addChild(e)}else n.debug(`${nt}: Skipping wrapper, offsetting all root nodes.`),i.listChildren().forEach(t=>{const e=t.getTranslation();t.setTranslation([e[0]+l[0],e[1]+l[1],e[2]+l[2]])})}),n.debug(`${nt}: Complete.`)})}function st(t){const e=new Set;let n,o=t;for(;n=o.getParentNode();){if(e.has(n))throw new Error(\"Circular dependency in scene graph.\");e.add(n),o=n}return o.listParents().filter(t=>t instanceof r)}function it(t){const e=st(t),n=t.getParentNode();if(!n)return t;t.setMatrix(t.getWorldMatrix()),n.removeChild(t);for(const n of e)n.addChild(t);return t}var at=\"undefined\"!=typeof Float32Array?Float32Array:Array;function ct(t,e){var n=e[0],o=e[1],r=e[2],s=e[3],i=e[4],a=e[5],c=e[6],l=e[7],g=e[8],u=e[9],f=e[10],p=e[11],m=e[12],d=e[13],h=e[14],A=e[15],T=n*a-o*i,y=n*c-r*i,E=n*l-s*i,S=o*c-r*a,M=o*l-s*a,I=r*l-s*c,w=g*d-u*m,N=g*h-f*m,b=g*A-p*m,R=u*h-f*d,C=u*A-p*d,O=f*A-p*h,$=T*O-y*C+E*R+S*b-M*N+I*w;return $?(t[0]=(a*O-c*C+l*R)*($=1/$),t[1]=(r*C-o*O-s*R)*$,t[2]=(d*I-h*M+A*S)*$,t[3]=(f*M-u*I-p*S)*$,t[4]=(c*b-i*O-l*N)*$,t[5]=(n*O-r*b+s*N)*$,t[6]=(h*E-m*I-A*y)*$,t[7]=(g*I-f*E+p*y)*$,t[8]=(i*C-a*b+l*w)*$,t[9]=(o*b-n*C-s*w)*$,t[10]=(m*M-d*E+A*T)*$,t[11]=(u*E-g*M-p*T)*$,t[12]=(a*N-i*R-c*w)*$,t[13]=(n*R-o*N+r*w)*$,t[14]=(d*y-m*S-h*T)*$,t[15]=(g*S-u*y+f*T)*$,t):null}function lt(t,e,n){var o=e[0],r=e[1],s=e[2],i=e[3],a=e[4],c=e[5],l=e[6],g=e[7],u=e[8],f=e[9],p=e[10],m=e[11],d=e[12],h=e[13],A=e[14],T=e[15],y=n[0],E=n[1],S=n[2],M=n[3];return t[0]=y*o+E*a+S*u+M*d,t[1]=y*r+E*c+S*f+M*h,t[2]=y*s+E*l+S*p+M*A,t[3]=y*i+E*g+S*m+M*T,t[4]=(y=n[4])*o+(E=n[5])*a+(S=n[6])*u+(M=n[7])*d,t[5]=y*r+E*c+S*f+M*h,t[6]=y*s+E*l+S*p+M*A,t[7]=y*i+E*g+S*m+M*T,t[8]=(y=n[8])*o+(E=n[9])*a+(S=n[10])*u+(M=n[11])*d,t[9]=y*r+E*c+S*f+M*h,t[10]=y*s+E*l+S*p+M*A,t[11]=y*i+E*g+S*m+M*T,t[12]=(y=n[12])*o+(E=n[13])*a+(S=n[14])*u+(M=n[15])*d,t[13]=y*r+E*c+S*f+M*h,t[14]=y*s+E*l+S*p+M*A,t[15]=y*i+E*g+S*m+M*T,t}function gt(){var t=new at(3);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ut(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function ft(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function pt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function mt(t,e){var n=e[0],o=e[1],r=e[2],s=n*n+o*o+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function dt(t,e,n){var o=e[0],r=e[1],s=e[2],i=n[3]*o+n[7]*r+n[11]*s+n[15];return t[0]=(n[0]*o+n[4]*r+n[8]*s+n[12])/(i=i||1),t[1]=(n[1]*o+n[5]*r+n[9]*s+n[13])/i,t[2]=(n[2]*o+n[6]*r+n[10]*s+n[14])/i,t}function ht(t,e,n){var o=e[0],r=e[1],s=e[2];return t[0]=o*n[0]+r*n[3]+s*n[6],t[1]=o*n[1]+r*n[4]+s*n[7],t[2]=o*n[2]+r*n[5]+s*n[8],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var At=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t};function Tt(){var t=new at(4);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}gt();var yt=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},Et=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},St=function(t){return Math.hypot(t[0],t[1],t[2],t[3])};Tt();const Mt=\"dedup\",It={propertyTypes:[e.ACCESSOR,e.MESH,e.TEXTURE,e.MATERIAL,e.SKIN]};function wt(t=It){const n=q({},It,t),o=new Set(n.propertyTypes);for(const t of n.propertyTypes)if(!It.propertyTypes.includes(t))throw new Error(`${Mt}: Unsupported deduplication on type \"${t}\".`);return B(Mt,t=>{const n=t.getLogger();o.has(e.ACCESSOR)&&function(t){const e=t.getLogger(),n=new Map,o=new Map,r=new Map,i=new Map,a=t.getRoot().listMeshes();a.forEach(t=>{t.listPrimitives().forEach(t=>{t.listAttributes().forEach(t=>c(t,o)),c(t.getIndices(),n)})});for(const e of t.getRoot().listAnimations())for(const t of e.listSamplers())c(t.getInput(),r),c(t.getOutput(),i);function c(t,e){if(!t)return;const n=[t.getCount(),t.getType(),t.getComponentType(),t.getNormalized(),t.getSparse()].join(\":\");let o=e.get(n);o||e.set(n,o=new Set),o.add(t)}function l(t,e){for(let n=0;n{t.listPrimitives().forEach(t=>{t.listAttributes().forEach(e=>{u.has(e)&&t.swap(e,u.get(e))});const e=t.getIndices();e&&u.has(e)&&t.swap(e,u.get(e))})});for(const e of t.getRoot().listAnimations())for(const t of e.listSamplers()){const e=t.getInput(),n=t.getOutput();e&&u.has(e)&&t.swap(e,u.get(e)),n&&u.has(n)&&t.swap(n,u.get(n))}Array.from(u.keys()).forEach(t=>t.dispose())}(t),o.has(e.TEXTURE)&&function(t){const e=t.getLogger(),n=t.getRoot(),o=n.listTextures(),r=new Map;for(let t=0;t{t.listParents().forEach(n=>{n instanceof i||n.swap(t,e)}),t.dispose()})}(t),o.has(e.MATERIAL)&&function(t){const e=t.getLogger(),n=t.getRoot().listMaterials(),o=new Map,r=new Set([\"name\"]),s=new Map;for(let t=0;t{t.listParents().forEach(n=>{n instanceof i||n.swap(t,e)}),t.dispose()})}(t),o.has(e.MESH)&&function(t){const n=t.getLogger(),o=t.getRoot(),r=new Map;o.listAccessors().forEach((t,e)=>r.set(t,e)),o.listMaterials().forEach((t,e)=>r.set(t,e));const s=o.listMeshes().length,i=new Map;for(const t of o.listMeshes()){const n=[];for(const e of t.listPrimitives())n.push(Nt(e,r));const o=n.join(\";\");if(i.has(o)){const n=i.get(o);t.listParents().forEach(o=>{o.propertyType!==e.ROOT&&o.swap(t,n)}),t.dispose()}else i.set(o,t)}n.debug(`${Mt}: Merged ${s-i.size} of ${s} meshes.`)}(t),o.has(e.SKIN)&&function(t){const e=t.getLogger(),n=t.getRoot().listSkins(),o=new Map,r=new Set([\"name\",\"joints\"]);for(let t=0;t{t.listParents().forEach(n=>{n instanceof i||n.swap(t,e)}),t.dispose()})}(t),n.debug(`${Mt}: Complete.`)})}function Nt(e,n){const o=[];for(const t of e.listSemantics()){const r=e.getAttribute(t);o.push(t+\":\"+n.get(r))}if(e instanceof t){const t=e.getIndices();t&&o.push(\"indices:\"+n.get(t));const r=e.getMaterial();r&&o.push(\"material:\"+n.get(r)),o.push(\"mode:\"+e.getMode());for(const t of e.listTargets())o.push(\"target:\"+Nt(t,n))}return o.join(\",\")}function bt(t,e){if(e.has(t))return e.get(t);const n=t.getGraph(),o=new Set,r=n.listParentEdges(t);for(;r.length>0;){const s=r.pop();if(!0===s.getAttributes().modifyChild)return e.set(t,!0),!0;const i=s.getChild();if(!o.has(i))for(const t of n.listChildEdges(i))r.push(t)}return e.set(t,!1),!1}const Rt=/color|emissive|diffuse/i;function Ct(t){return t.getGraph().listParentEdges(t).some(t=>t.getAttributes().isColor||Rt.test(t.getName()))?\"srgb\":null}function Ot(t){const e=t.getGraph(),n=new Set;for(const o of e.listParentEdges(t)){const t=o.getParent(),r=o.getName()+\"Info\";for(const o of e.listChildEdges(t)){const t=o.getChild();t instanceof a&&o.getName()===r&&n.add(t)}}return Array.from(n)}function $t(t){const e=t.getGraph(),n=new Set,o=new Set;return function t(r){const s=new Set;for(const t of e.listChildEdges(r))t.getChild()instanceof c&&s.add(t.getName()+\"Info\");for(const i of e.listChildEdges(r)){const e=i.getChild();n.has(e)||(n.add(e),e instanceof a&&s.has(i.getName())?o.add(e):e instanceof l&&t(e))}}(t),Array.from(o)}function vt(t){const e=n.fromGraph(t.getGraph()).getRoot(),o=t.getGraph().listParentEdges(t).filter(t=>t.getParent()!==e).map(t=>t.getName());return Array.from(new Set(o))}const Pt=\"prune\",xt=3/255,Lt={propertyTypes:[e.NODE,e.SKIN,e.MESH,e.CAMERA,e.PRIMITIVE,e.PRIMITIVE_TARGET,e.ANIMATION,e.MATERIAL,e.TEXTURE,e.ACCESSOR,e.BUFFER],keepLeaves:!1,keepAttributes:!0,keepSolidTextures:!0};function zt(t=Lt){const n=q({},Lt,t),o=new Set(n.propertyTypes);return B(Pt,async t=>{const r=t.getLogger(),s=t.getRoot(),i=t.getGraph(),a=new Ft;if(o.has(e.MESH))for(const t of s.listMeshes())t.listPrimitives().length>0||a.dispose(t);if(o.has(e.NODE)){if(!n.keepLeaves)for(const t of s.listScenes())kt(i,t,a);for(const t of s.listNodes())_t(t,a)}if(o.has(e.SKIN))for(const t of s.listSkins())_t(t,a);if(o.has(e.MESH))for(const t of s.listMeshes())_t(t,a);if(o.has(e.CAMERA))for(const t of s.listCameras())_t(t,a);if(o.has(e.PRIMITIVE)&&Gt(i,e.PRIMITIVE,a),o.has(e.PRIMITIVE_TARGET)&&Gt(i,e.PRIMITIVE_TARGET,a),!n.keepAttributes&&o.has(e.ACCESSOR)){const e=new Map;for(const n of s.listMeshes())for(const o of n.listPrimitives()){const n=o.getMaterial(),r=Bt(o,Ut(t,n));qt(o,r),o.listTargets().forEach(t=>qt(t,r)),n&&(e.has(n)?e.get(n).add(o):e.set(n,new Set([o])))}for(const[t,n]of e)Wt(t,Array.from(n))}if(o.has(e.ANIMATION))for(const t of s.listAnimations()){for(const e of t.listChannels())e.getTargetNode()||a.dispose(e);if(t.listChannels().length)t.listSamplers().forEach(t=>_t(t,a));else{const e=t.listSamplers();_t(t,a),e.forEach(t=>_t(t,a))}}if(o.has(e.MATERIAL)&&s.listMaterials().forEach(t=>_t(t,a)),o.has(e.TEXTURE)&&(s.listTextures().forEach(t=>_t(t,a)),n.keepSolidTextures||await async function(t,e){const n=t.getRoot(),o=t.getGraph(),r=t.getLogger(),s=n.listTextures().map(async t=>{var s;const i=await async function(t){const e=await async function(t){try{return await M(t.getImage(),t.getMimeType())}catch(t){return null}}(t);if(!e)return null;const n=[Infinity,Infinity,Infinity,Infinity],o=[-Infinity,-Infinity,-Infinity,-Infinity],r=[0,0,0,0],[s,i]=e.shape;for(let t=0;txt)return null}return function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}(r,((a=r)[0]=(c=o)[0]+(l=n)[0],a[1]=c[1]+l[1],a[2]=c[2]+l[2],a[3]=c[3]+l[3],a),.5/255);var a,c,l}(t);if(!i)return;\"srgb\"===Ct(t)&&u.convertSRGBToLinear(i,i);const a=t.getName()||t.getURI(),c=null==(s=t.getSize())?void 0:s.join(\"x\"),l=vt(t);for(const e of o.listParentEdges(t)){const t=e.getParent();t!==n&&Dt(t,i,e.getName(),r)&&e.dispose()}1===t.listParents().length&&(e.dispose(t),r.debug(`${Pt}: Removed solid-color texture \"${a}\" (${c}px ${l.join(\", \")})`))});await Promise.all(s)}(t,a)),o.has(e.ACCESSOR)&&s.listAccessors().forEach(t=>_t(t,a)),o.has(e.BUFFER)&&s.listBuffers().forEach(t=>_t(t,a)),a.empty())r.info(`${Pt}: No unused properties found.`);else{const t=a.entries().map(([t,e])=>`${t} (${e})`).join(\", \");r.info(`${Pt}: Removed types... ${t}`)}r.debug(`${Pt}: Complete.`)})}class Ft{constructor(){this.disposed={}}empty(){for(const t in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(t){this.disposed[t.propertyType]=this.disposed[t.propertyType]||0,this.disposed[t.propertyType]++,t.dispose()}}function _t(t,e){t.listParents().filter(t=>!(t instanceof i||t instanceof g)).length||e.dispose(t)}function Gt(t,e,n){for(const o of t.listEdges()){const t=o.getParent();t.propertyType===e&&_t(t,n)}}function kt(t,n,o){if(n.listChildren().forEach(e=>kt(t,e,o)),n instanceof r)return;const s=t.listParentEdges(n).some(t=>{const n=t.getParent().propertyType;return n!==e.ROOT&&n!==e.SCENE&&n!==e.NODE});0===t.listChildren(n).length&&!s&&o.dispose(n)}function qt(t,e){for(const n of e)t.setAttribute(n,null)}function Bt(t,e){const n=[];for(const o of t.listSemantics())\"TANGENT\"!==o||e.has(o)?(o.startsWith(\"TEXCOORD_\")&&!e.has(o)||o.startsWith(\"COLOR_\")&&\"COLOR_0\"!==o)&&n.push(o):n.push(o);return n}function Ut(t,e,n=new Set){if(!e)return n;const o=t.getGraph().listChildEdges(e),r=new Set;for(const t of o)t.getChild()instanceof c&&r.add(t.getName());for(const e of o){const o=e.getName(),s=e.getChild();s instanceof a&&r.has(o.replace(/Info$/,\"\"))&&n.add(`TEXCOORD_${s.getTexCoord()}`),s instanceof c&&o.match(/normalTexture/i)&&n.add(\"TANGENT\"),s instanceof l&&Ut(t,s,n)}return n}function Wt(t,e){const n=$t(t),o=new Set(n.map(t=>t.getTexCoord())),r=Array.from(o).sort(),s=new Map(r.map((t,e)=>[t,e])),i=new Map(r.map((t,e)=>[`TEXCOORD_${t}`,`TEXCOORD_${e}`]));for(const t of n){const e=t.getTexCoord();t.setTexCoord(s.get(e))}for(const t of e){const e=t.listSemantics().filter(t=>t.startsWith(\"TEXCOORD_\")).sort();a(t,e),t.listTargets().forEach(t=>a(t,e))}function a(t,e){for(const n of e){const e=t.getAttribute(n);if(!e)continue;const o=i.get(n);o!==n&&(t.setAttribute(o,e),t.setAttribute(n,null))}}}function Dt(t,e,n,o){if(t instanceof f)switch(n){case\"baseColorTexture\":return t.setBaseColorFactor(Et(e,e,t.getBaseColorFactor())),!0;case\"emissiveTexture\":return t.setEmissiveFactor(At([0,0,0],e.slice(0,3),t.getEmissiveFactor())),!0;case\"occlusionTexture\":return Math.abs(e[0]-1)<=xt;case\"metallicRoughnessTexture\":return t.setRoughnessFactor(e[1]*t.getRoughnessFactor()),t.setMetallicFactor(e[2]*t.getMetallicFactor()),!0;case\"normalTexture\":return St(yt(Tt(),e,[.5,.5,1,1]))<=xt}return o.warn(`${Pt}: Detected single-color ${n} texture. Pruning ${n} not yet supported.`),!1}const Ht=\"weld\",jt={DEFAULT:1e-4,TEXCOORD:1e-4,COLOR:.01,NORMAL:.05,JOINTS:0,WEIGHTS:.01},Xt={tolerance:jt.DEFAULT,toleranceNormal:jt.NORMAL,overwrite:!0,exhaustive:!1};function Vt(t=Xt){const n=re(t);return B(Ht,async t=>{const o=t.getLogger();for(const e of t.getRoot().listMeshes()){for(const o of e.listPrimitives())Kt(t,o,n),se(o)&&o.dispose();0===e.listPrimitives().length&&e.dispose()}n.tolerance>0&&await t.transform(zt({propertyTypes:[e.ACCESSOR,e.NODE]})),await t.transform(wt({propertyTypes:[e.ACCESSOR]})),o.debug(`${Ht}: Complete.`)})}function Kt(e,o=Xt,r=Xt){let s,i,a;if(e instanceof t){const t=e.getGraph();s=n.fromGraph(t),i=e,a=re(o)}else s=e,i=o,a=re(r);i.getIndices()&&!a.overwrite||i.getMode()!==t.Mode.POINTS&&(0===a.tolerance?function(t,e){if(e.getIndices())return;const n=e.listAttributes()[0],o=n.getCount(),r=n.getBuffer(),s=t.createAccessor().setBuffer(r).setType(p.Type.SCALAR).setArray(Y(o));e.setIndices(s)}(s,i):function(t,e,n){const o=t.getLogger(),r=e.getAttribute(\"POSITION\"),s=e.getIndices()||t.createAccessor().setArray(Y(r.getCount())),i=new Uint32Array(new Set(s.getArray())).sort(),a={};for(const t of e.listSemantics()){const o=e.getAttribute(t);a[t]=Yt(t,o,n)}var c;o.debug(`${Ht}: Tolerance thresholds: ${c=a,Object.entries(c).map(([t,e])=>`${t}=${e}`).join(\", \")}`);const l=[0,0,0],g=[0,0,0],u={},f=a.POSITION;for(let t=0;tte(e.getAttribute(n),o,t,a[n])),i=e.listTargets().every(e=>e.listSemantics().every(n=>te(e.getAttribute(n),o,t,a[n])));if(s&&i){p[o]=t;break t}}m[o]=p[o]===o?h++:m[p[o]]}o.debug(`${Ht}: ${V(d,h)} vertices.`);const A=s.getCount(),T=Y(A,i.length);for(let t=0;tt-Zt[e]),r=Math.max(...o);return n.tolerance*r}function te(t,e,n,o,r){t.getElement(e,Zt),t.getElement(n,Qt);for(let e=0,n=t.getElementSize();eo)return!1;return!0}const ee=[0,-1,1];function ne(t,e){const n=[],o=[0,0,0];for(const r of ee)for(const s of ee)for(const i of ee)o[0]=t[0]+r*e,o[1]=t[1]+s*e,o[2]=t[2]+i*e,n.push(oe(o,e));return n}function oe(t,e){return Math.round(t[0]/e)+\":\"+Math.round(t[1]/e)+\":\"+Math.round(t[2]/e)}function re(t){const e=q({},Xt,t);if(e.tolerance<0||e.tolerance>.1)throw new Error(`${Ht}: Requires 0 ≤ tolerance ≤ 0.1`);if(e.toleranceNormal<0||e.toleranceNormal>Math.PI/2)throw new Error(`${Ht}: Requires 0 ≤ toleranceNormal ≤ ${(Math.PI/2).toFixed(2)}`);return e.tolerance>0&&(e.tolerance=Math.max(e.tolerance,Number.EPSILON),e.toleranceNormal=Math.max(e.toleranceNormal,Number.EPSILON)),e}function se(t){const e=t.getIndices();return!!e&&0===e.getCount()}function ie(e,n,o=new Set){var r;const s=e.getAttribute(\"POSITION\"),i=(null==(r=e.getIndices())?void 0:r.getArray())||Y(s.getCount());s&&ae(n,s,i,new Set(o));const a=e.getAttribute(\"NORMAL\");a&&ce(n,a,i,new Set(o));const c=e.getAttribute(\"TANGENT\");c&&le(n,c,i,new Set(o));for(const t of e.listTargets()){const e=t.getAttribute(\"POSITION\");e&&ae(n,e,i,new Set(o));const r=t.getAttribute(\"NORMAL\");r&&ce(n,r,i,new Set(o));const s=t.getAttribute(\"TANGENT\");s&&le(n,s,i,new Set(o))}var l,g,u,f,p,m,d,h,A,T,y,E,S,M,I,w,N;((g=(l=n)[0])*(d=l[5])-(u=l[1])*(m=l[4]))*((E=l[10])*(N=l[15])-(S=l[11])*(w=l[14]))-(g*(h=l[6])-(f=l[2])*m)*((y=l[9])*N-S*(I=l[13]))+(g*(A=l[7])-(p=l[3])*m)*(y*w-E*I)+(u*h-f*d)*((T=l[8])*N-S*(M=l[12]))-(u*A-p*d)*(T*w-E*M)+(f*A-p*h)*(T*I-y*M)<0&&function(e){if(e.getMode()!==t.Mode.TRIANGLES)return;e.getIndices()||Kt(e,{tolerance:0});const n=e.getIndices();for(let t=0,e=n.getCount();tt.propertyType===e.MESH&&t!==n)){const e=t.clone();n.swap(t,e);for(const t of e.listTargets()){const n=t.clone();e.swap(t,n)}}if(!r){const e=new Set([...n.listPrimitives(),...n.listPrimitives().flatMap(t=>t.listTargets())]),o=new Map;for(const r of n.listPrimitives())for(const n of K(r))n.listParents().some(n=>(n instanceof t||n instanceof m)&&!e.has(n))&&!o.has(n)&&o.set(n,n.clone());for(const t of e)for(const[e,n]of o)t.swap(e,n)}const i=new Map;for(const t of n.listPrimitives()){const e=t.getAttribute(\"POSITION\");let n;s?n=s:i.has(e)?n=i.get(e):i.set(e,n=new Set),ie(t,o,n)}}const ue=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function fe(t){const e=t.getMesh(),n=t.getMatrix();e&&!d.eq(n,ue)&&ge(e,n);for(const e of t.listChildren()){const t=e.getMatrix();lt(t,t,n),e.setMatrix(t)}return t.setMatrix(ue)}const pe=\"dequantize\",me={pattern:/^((?!JOINTS_).)*$/};function de(t=me){const e=q({},me,t);return B(pe,t=>{const n=t.getLogger();for(const n of t.getRoot().listMeshes())for(const t of n.listPrimitives())he(t,e);t.createExtension(w).dispose(),n.debug(`${pe}: Complete.`)})}function he(t,e){for(const n of t.listSemantics())Ae(n,t.getAttribute(n),e);for(const n of t.listTargets())for(const t of n.listSemantics())Ae(t,n.getAttribute(t),e)}function Ae(t,e,n){if(!e.getArray())return;if(!n.pattern.test(t))return;if(e.getComponentSize()>=4)return;const o=e.getArray(),r=new Float32Array(o.length);for(let t=0,n=e.getCount(),s=[];t{await t.transform(Vt({tolerance:0})),t.createExtension(N).setRequired(!0).setEncoderOptions({method:\"edgebreaker\"===e.method?N.EncoderMethod.EDGEBREAKER:N.EncoderMethod.SEQUENTIAL,encodeSpeed:e.encodeSpeed,decodeSpeed:e.decodeSpeed,quantizationBits:{POSITION:e.quantizePosition,NORMAL:e.quantizeNormal,COLOR:e.quantizeColor,TEX_COORD:e.quantizeTexcoord,GENERIC:e.quantizeGeneric},quantizationVolume:e.quantizationVolume})})}const Ee=\"flatten\",Se={};function Me(t=Se){return q({},Se,t),B(Ee,async t=>{const n=t.getRoot(),o=t.getLogger(),r=new Set;for(const t of n.listSkins())for(const e of t.listJoints())r.add(e);const s=new Set;for(const t of n.listAnimations())for(const e of t.listChannels()){const t=e.getTargetNode();t&&s.add(t)}const i=new Set,a=new Set;for(const t of n.listScenes())t.traverse(t=>{const e=t.getParentNode();e&&((r.has(e)||i.has(e))&&i.add(t),(s.has(e)||a.has(e))&&a.add(t))});for(const t of n.listScenes())t.traverse(t=>{s.has(t)||i.has(t)||a.has(t)||it(t)});s.size&&o.debug(`${Ee}: Flattening node hierarchies with TRS animation not yet supported.`),await t.transform(zt({propertyTypes:[e.NODE],keepLeaves:!1})),o.debug(`${Ee}: Complete.`)})}function Ie(t){return st(t)[0]||null}function we(t){return{scenes:Ne(t),meshes:be(t),materials:Re(t),textures:Ce(t),animations:Oe(t)}}function Ne(t){return{properties:t.getRoot().listScenes().map(t=>{const e=t.listChildren()[0],n=o(t);return{name:t.getName(),rootName:e?e.getName():\"\",bboxMin:Pe(n.min),bboxMax:Pe(n.max)}})}}function be(t){return{properties:t.getRoot().listMeshes().map(t=>{const n=t.listParents().filter(t=>t.propertyType!==e.ROOT).length;let o=0,r=0;const s=new Set,i=new Set,a=new Set;t.listPrimitives().forEach(t=>{for(const e of t.listSemantics()){const n=t.getAttribute(e);s.add(e+\":\"+xe(n)),a.add(n)}for(const e of t.listTargets())e.listAttributes().forEach(t=>a.add(t));const e=t.getIndices();e&&(i.add(xe(e)),a.add(e)),r+=t.listAttributes()[0].getCount(),o+=D(t)});let c=0;Array.from(a).forEach(t=>c+=t.getArray().byteLength);const l=t.listPrimitives().map(t=>$e[t.getMode()]);return{name:t.getName(),mode:Array.from(new Set(l)),primitives:t.listPrimitives().length,glPrimitives:o,vertices:r,indices:Array.from(i).sort(),attributes:Array.from(s).sort(),instances:n,size:c}})}}function Re(t){return{properties:t.getRoot().listMaterials().map(n=>{const o=n.listParents().filter(t=>t.propertyType!==e.ROOT).length,r=new Set(n.listExtensions()),s=t.getGraph().listEdges().filter(t=>{const e=t.getChild(),o=t.getParent();return e instanceof c&&o===n||!!(e instanceof c&&o instanceof l&&r.has(o))}).map(t=>t.getName());return{name:n.getName(),instances:o,textures:s,alphaMode:n.getAlphaMode(),doubleSided:n.getDoubleSided()}})}}function Ce(t){return{properties:t.getRoot().listTextures().map(n=>{const o=n.listParents().filter(t=>t.propertyType!==e.ROOT).length,r=t.getGraph().listParentEdges(n).filter(t=>t.getParent().propertyType!==e.ROOT).map(t=>t.getName()),s=h.getSize(n.getImage(),n.getMimeType());let i=\"\";if(\"image/ktx2\"===n.getMimeType()){const t=L(n.getImage()).dataFormatDescriptor[0];t.colorModel===z?i=\"ETC1S\":t.colorModel===F&&(i=\"UASTC\")}return{name:n.getName(),uri:n.getURI(),slots:Array.from(new Set(r)),instances:o,mimeType:n.getMimeType(),compression:i,resolution:s?s.join(\"x\"):\"\",size:n.getImage().byteLength,gpuSize:h.getVRAMByteLength(n.getImage(),n.getMimeType())}})}}function Oe(t){return{properties:t.getRoot().listAnimations().map(t=>{let e=Infinity,n=-Infinity;t.listSamplers().forEach(t=>{const o=t.getInput();o&&(e=Math.min(e,o.getMin([])[0]),n=Math.max(n,o.getMax([])[0]))});let o=0,r=0;const s=new Set;return t.listSamplers().forEach(t=>{const e=t.getInput(),n=t.getOutput();e&&(r+=e.getCount(),s.add(e),n&&s.add(n))}),Array.from(s).forEach(t=>{o+=t.getArray().byteLength}),{name:t.getName(),channels:t.listChannels().length,samplers:t.listSamplers().length,duration:Math.round(1e3*(n-e))/1e3,keyframes:r,size:o}})}}const $e=[\"POINTS\",\"LINES\",\"LINE_LOOP\",\"LINE_STRIP\",\"TRIANGLES\",\"TRIANGLE_STRIP\",\"TRIANGLE_FAN\"],ve={Float32Array:\"f32\",Uint32Array:\"u32\",Uint16Array:\"u16\",Uint8Array:\"u8\",Int32Array:\"i32\",Int16Array:\"i16\",Int8Array:\"i8\"};function Pe(t){for(let e=0;e{const n=t.getLogger(),o=t.getRoot();if(o.listAnimations().length)return n.warn(`${Le}: Instancing is not currently supported for animated models.`),void n.debug(`${Le}: Complete.`);const r=t.createExtension(b);let s=0,i=0;for(const a of o.listScenes()){const o=new Map;a.traverse(t=>{const e=t.getMesh();e&&o.set(e,(o.get(e)||new Set).add(t))});const c=[];for(const l of Array.from(o.keys())){const g=Array.from(o.get(l));if(g.lengtht.getSkin()))continue;if(l.listPrimitives().some(Ge)&&g.some(ke))continue;const u=qe(t,r,l,g.length),f=u.getAttribute(\"TRANSLATION\"),p=u.getAttribute(\"ROTATION\"),m=u.getAttribute(\"SCALE\"),h=t.createNode().setMesh(l).setExtension(\"EXT_mesh_gpu_instancing\",u);a.addChild(h);let A=!1,T=!1,y=!1;for(let t=0;t0?`${Le}: Created ${s} batches, with ${i} total instances.`:`${Le}: No meshes with ≥${e.min} parent nodes were found.`),0===r.listProperties().length&&r.dispose(),n.debug(`${Le}: Complete.`)})}function _e(t,e){let n,o=0;for(;n=t.pop();){if(n.listChildren().length||n.getCamera()||n.getMesh()||n.getSkin()||n.listExtensions().length)continue;const e=n.getParentNode();e&&t.push(e),n.dispose(),o++}e.debug(`${Le}: Removed ${o} unused nodes.`)}function Ge(t){const e=t.getMaterial();return!(!e||!e.getExtension(\"KHR_materials_volume\"))}function ke(t){const e=t.getWorldScale();return!d.eq(e,[1,1,1])}function qe(t,e,n,o){const r=n.listPrimitives()[0].getAttribute(\"POSITION\").getBuffer(),s=t.createAccessor().setType(\"VEC3\").setArray(new Float32Array(3*o)).setBuffer(r),i=t.createAccessor().setType(\"VEC4\").setArray(new Float32Array(4*o)).setBuffer(r),a=t.createAccessor().setType(\"VEC3\").setArray(new Float32Array(3*o)).setBuffer(r);return e.createInstancedMesh().setAttribute(\"TRANSLATION\",s).setAttribute(\"ROTATION\",i).setAttribute(\"SCALE\",a)}const Be={skipValidation:!1};function Ue(t,e={}){e=q({},Be,e);const o=t[0],r=n.fromGraph(o.getGraph());if(!e.skipValidation&&new Set(t.map(tt)).size>1)throw new Error(\"Requires ≥2 Primitives, sharing the same Material and Mode, with compatible vertex attributes and indices.\");const s=[],i=[];let a=0,c=0;for(const e of t){const t=We(e),n=[];for(let e=0;e{const n=t.getRoot(),o=t.getLogger();for(const o of n.listScenes())Ye(t,o,e),o.traverse(n=>Ye(t,n,e));await t.transform(zt({propertyTypes:[je,Xe,Ve,Ke],keepLeaves:!1,keepAttributes:!0})),o.debug(`${De}: Complete.`)})}function Ye(t,n,o){const r=t.getLogger(),s={},i=n.listChildren();for(let t=0;tt instanceof g))continue;const n=e.getMesh();if(n&&!e.getExtension(\"EXT_mesh_gpu_instancing\")&&!e.getSkin())for(const r of n.listPrimitives()){if(r.listTargets().length>0)continue;const i=r.getMaterial();if(i&&i.getExtension(\"KHR_materials_volume\"))continue;nn(r);let a=tt(r);const c=n.getName()||e.getName();(o.keepMeshes||o.keepNamed&&c)&&(a+=`|${t}`),a in s||(s[a]={prims:[],primMeshes:[],primNodes:[],dstNode:e,dstMesh:void 0});const l=s[a];l.prims.push(r),l.primNodes.push(e)}}const a=Object.values(s).filter(({prims:t})=>t.length>1),c=new Set(a.flatMap(t=>t.primNodes));for(const t of c){const e=t.getMesh(),n=e.listParents().some(e=>e.propertyType!==He&&t!==e);n&&t.setMesh(e.clone())}for(const t of a){const{dstNode:e,primNodes:n}=t;t.dstMesh=e.getMesh(),t.primMeshes=n.map(t=>t.getMesh())}for(const t of a){const{prims:n,primNodes:o,primMeshes:s,dstNode:i,dstMesh:a}=t,c=i.getMatrix();for(let t=0;tt.propertyType!==e.ROOT)||en(a))&&(a=n[t]=tn(n[t])),r!==i&&(lt(Je,ct(Je,c),r.getMatrix()),ie(a,Je))}const l=Ue(n),g=l.listAttributes()[0].getCount();a.addPrimitive(l),r.debug(`${De}: Joined Primitives (${n.length}) containing ${X(g)} vertices under Node \"${i.getName()}\".`)}}function tn(t){const e=t.clone();for(const t of e.listSemantics())e.setAttribute(t,e.getAttribute(t).clone());const n=e.getIndices();return n&&e.setIndices(n.clone()),e}function en(t){for(const e of t.listAttributes())for(const n of e.listParents())if(n!==t&&n.propertyType!==He)return!0;return!1}function nn(t){for(const e of[\"POSITION\",\"NORMAL\",\"TANGENT\"]){const n=t.getAttribute(e);n&&n.getComponentSize()<4&&Ae(e,n,{pattern:/.*/})}}function on(t){const e=rn(t),n=[];return e&T.R&&n.push(T.R),e&T.G&&n.push(T.G),e&T.B&&n.push(T.B),e&T.A&&n.push(T.A),n}function rn(t){const o=n.fromGraph(t.getGraph());let r=0;for(const n of o.getGraph().listParentEdges(t)){const t=n.getParent();let{channels:s}=n.getAttributes();s&&\"baseColorTexture\"===n.getName()&&t instanceof f&&t.getAlphaMode()===f.AlphaMode.OPAQUE&&(s&=~T.A),s?r|=s:t.propertyType!==e.ROOT&&o.getLogger().warn(`Missing attribute \".channels\" on edge, \"${n.getName()}\".`)}return r}const sn=\"reorder\",an={target:\"size\"};function cn(n){const o=q({},an,n),r=o.encoder;if(!r)throw new Error(`${sn}: encoder dependency required — install \"meshoptimizer\".`);return B(sn,async n=>{const s=n.getLogger();await r.ready;const i=function(t){const e=new H,n=new Map,o=new H;for(const r of t.getRoot().listMeshes())for(const t of r.listPrimitives()){const r=t.getIndices();if(r){n.set(r,t.getMode());for(const n of K(t))e.add(r,n),o.add(n,t)}}return{indicesToAttributes:e,indicesToMode:n,attributesToPrimitives:o}}(n);for(const e of i.indicesToAttributes.keys()){const n=e.clone();let s=n.getArray().slice();s instanceof Uint32Array||(s=new Uint32Array(s));const[a,c]=r.reorderMesh(s,i.indicesToMode.get(e)===t.Mode.TRIANGLES,\"size\"===o.target);n.setArray(c<=65534?new Uint16Array(s):s);for(const t of i.indicesToAttributes.get(e)){const o=t.clone();Q(o,a,c);for(const r of i.attributesToPrimitives.get(t))if(r.getIndices()===e&&r.swap(e,n),r.getIndices()===n){r.swap(t,o);for(const e of r.listTargets())e.swap(t,o)}}}await n.transform(zt({propertyTypes:[e.ACCESSOR]})),i.indicesToAttributes.size?s.debug(`${sn}: Complete.`):s.warn(`${sn}: No qualifying primitives found; may need to weld first.`)})}function ln(t,e=Infinity){if(Number.isFinite(e)&&e%4||e<=0)throw new Error(\"Limit must be positive multiple of four.\");const n=t.getAttribute(\"POSITION\").getCount(),o=t.listSemantics().filter(t=>t.startsWith(\"WEIGHTS_\")).length,r=new Uint16Array(4*o),s=new Float32Array(4*o),i=new Float32Array(4*o),a=new Uint32Array(4*o),c=new Uint32Array(4*o);for(let e=0;es[t]>s[e]?-1:1);for(let t=0;te;n--){const e=t.getAttribute(\"WEIGHTS_\"+(n-1)),o=t.getAttribute(\"JOINTS_\"+(n-1));t.setAttribute(\"WEIGHTS_\"+(n-1),null),t.setAttribute(\"JOINTS_\"+(n-1),null),1===e.listParents().length&&e.dispose(),1===o.listParents().length&&o.dispose()}!function(t){if(!function(t){const e=t.listSemantics().filter(t=>t.startsWith(\"WEIGHTS_\")).map(e=>t.getAttribute(e)),n=e.map(t=>t.getNormalized()),o=e.map(t=>t.getComponentType());return 1===new Set(n).size&&1===new Set(o).size}(t))return;const e=t.getAttribute(\"POSITION\").getCount(),n=t.listSemantics().filter(t=>t.startsWith(\"WEIGHTS_\")).length,o=t.getAttribute(\"WEIGHTS_0\"),r=o.getArray(),s=o.getComponentType(),i=o.getNormalized(),a=i?s:void 0,c=i?d.decodeNormalizedInt(1,s):Number.EPSILON,l=new Uint32Array(4*n).fill(0),g=r.slice(0,4*n).fill(0);for(let n=0;nc)for(let t=0;t=0;t--)if(g[t]>0){g[t]+=d.encodeNormalizedInt(1-e,s);break}for(let t=g.length-1;t>=0;t--)0===g[t]&&(l[t]=0);un(t,n,\"JOINTS\",l),un(t,n,\"WEIGHTS\",g,a)}}}(t)}function gn(t,e,n,o,r){let s;const i=[0,0,0,0];for(let a=0;s=t.getAttribute(`${n}_${a}`);a++){s.getElement(e,i);for(let t=0;t<4;t++)o[4*a+t]=r?d.encodeNormalizedInt(i[t],r):i[t]}return o}function un(t,e,n,o,r){let s;const i=[0,0,0,0];for(let a=0;s=t.getAttribute(`${n}_${a}`);a++){for(let t=0;t<4;t++)i[t]=r?d.decodeNormalizedInt(o[4*a+t],r):o[4*a+t];s.setElement(e,i)}}function fn(t,e){let n=0;for(let o=0;o{const o=t.getLogger(),r=t.getRoot();let s;t.createExtension(w).setRequired(!0),\"scene\"===n.quantizationVolume&&(s=In(function(t){const e=t[0];for(const n of t)ut(e.min,e.min,n.min),ft(e.max,e.max,n.max);return e}(r.listMeshes().map($n))));for(const e of t.getRoot().listMeshes()){\"mesh\"===n.quantizationVolume&&(s=In($n(e))),s&&n.pattern.test(\"POSITION\")&&(wn(t,e,s),Rn(e,1/s.scale));for(const o of e.listPrimitives()){Mn(t,o,s,n);for(const e of o.listTargets())Mn(t,e,s,n)}}await t.transform(zt({propertyTypes:[e.ACCESSOR,e.SKIN,e.MATERIAL]}),wt({propertyTypes:[e.ACCESSOR,e.MATERIAL,e.SKIN]})),o.debug(`${pn}: Complete.`)})}function Mn(e,n,o,r){const s=n instanceof m,i=e.getLogger();for(const e of n.listSemantics()){if(!s&&!r.pattern.test(e))continue;if(s&&!r.patternTargets.test(e))continue;const l=n.getAttribute(e),{bits:g,ctor:u}=On(e,l,i,r);if(!u)continue;if(g<8||g>16)throw new Error(`${pn}: Requires bits = 8–16.`);if(l.getComponentSize()<=g/8)continue;const f=l.clone();if(\"POSITION\"===e){const e=o.scale,r=[];n instanceof t?ct(r,Pn(o)):((a=r)[0]=(c=[1/e,1/e,1/e])[0],a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c[1],a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c[2],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1);for(let t=0,e=[0,0,0],n=f.getCount();tt instanceof g),i=s.some(t=>yn.includes(t.getTargetPath())),a=r.listChildren().length>0,c=r.getSkin();if(c){r.setSkin(Nn(c,n));continue}const l=r.getExtension(\"EXT_mesh_gpu_instancing\");if(l){r.setExtension(\"EXT_mesh_gpu_instancing\",bn(l,n));continue}let u;a||i?(u=t.createNode(\"\").setMesh(e),r.addChild(u).setMesh(null),s.filter(t=>t.getTargetPath()===Tn).forEach(t=>t.setTargetNode(u))):u=r;const f=u.getMatrix();lt(f,f,o),u.setMatrix(f)}}function Nn(t,e){t=t.clone();const n=Pn(e),o=t.getInverseBindMatrices().clone(),r=[];for(let t=0,e=o.getCount();t0?-1:0,1];for(let e=0,n=0,r=[];e>l,o[n++]=e*Math.sign(r[t])}}t.setArray(o).setNormalized(!0).setSparse(!1)}function On(t,e,n,o){const r=e.getMinNormalized([]),s=e.getMaxNormalized([]);let i,a;if(\"POSITION\"===t)i=o.quantizePosition,a=i<=8?Int8Array:Int16Array;else if(\"NORMAL\"===t||\"TANGENT\"===t)i=o.quantizeNormal,a=i<=8?Int8Array:Int16Array;else if(t.startsWith(\"COLOR_\"))i=o.quantizeColor,a=i<=8?Uint8Array:Uint16Array;else if(t.startsWith(\"TEXCOORD_\")){if(r.some(t=>t<0)||s.some(t=>t>1))return n.warn(`${pn}: Skipping ${t}; out of [0,1] range.`),{bits:-1};i=o.quantizeTexcoord,a=i<=8?Uint8Array:Uint16Array}else{if(t.startsWith(\"JOINTS_\"))return i=Math.max(...e.getMax([]))<=255?8:16,a=i<=8?Uint8Array:Uint16Array,e.getComponentSize()>i/8&&e.setArray(new a(e.getArray())),{bits:-1};if(t.startsWith(\"WEIGHTS_\")){if(r.some(t=>t<0)||s.some(t=>t>1))return n.warn(`${pn}: Skipping ${t}; out of [0,1] range.`),{bits:-1};i=o.quantizeWeight,a=i<=8?Uint8Array:Uint16Array}else{if(!t.startsWith(\"_\"))throw new Error(`${pn}: Unexpected semantic, \"${t}\".`);if(r.some(t=>t<-1)||s.some(t=>t>1))return n.warn(`${pn}: Skipping ${t}; out of [-1,1] range.`),{bits:-1};i=o.quantizeGeneric,a=a=r.some(t=>t<0)?i<=8?Int8Array:Int16Array:i<=8?Uint8Array:Uint16Array}}return{bits:i,ctor:a}}function $n(t){const e=[],n=[];for(const o of t.listPrimitives()){const t=o.getAttribute(\"POSITION\");t&&e.push(t);for(const t of o.listTargets()){const e=t.getAttribute(\"POSITION\");e&&n.push(e)}}if(0===e.length)throw new Error(`${pn}: Missing \"POSITION\" attribute.`);const o=vn(e,3);if(n.length>0){const{min:t,max:e}=vn(n,3);ut(o.min,o.min,ut(t,pt(t,t,2),[0,0,0])),ft(o.max,o.max,ft(e,pt(e,e,2),[0,0,0]))}return o}function vn(t,e){const n=new Array(e).fill(Infinity),o=new Array(e).fill(-Infinity),r=[],s=[];for(const i of t){i.getMinNormalized(r),i.getMaxNormalized(s);for(let t=0;t{let o,r,s=e.quantizeNormal;\"medium\"===e.level?(o=/.*/,r=/.*/):(o=/^(POSITION|TEXCOORD|JOINTS|WEIGHTS)(_\\d+)?$/,r=/^(POSITION|TEXCOORD|JOINTS|WEIGHTS|NORMAL|TANGENT)(_\\d+)?$/,s=Math.min(s,8)),await t.transform(cn({encoder:n,target:\"size\"}),Sn(q({},e,{pattern:o,patternTargets:r,quantizeNormal:s}))),t.createExtension(R).setRequired(!0).setEncoderOptions({method:\"medium\"===e.level?R.EncoderMethod.QUANTIZE:R.EncoderMethod.FILTER})})}const _n=\"metalRough\",Gn={};function kn(t=Gn){return q({},Gn,t),B(_n,async t=>{const e=t.getLogger();if(!t.getRoot().listExtensionsUsed().map(t=>t.extensionName).includes(\"KHR_materials_pbrSpecularGlossiness\"))return void e.warn(`${_n}: KHR_materials_pbrSpecularGlossiness not found on document.`);const n=t.createExtension(C),o=t.createExtension(O),r=t.createExtension($),s=new Set;for(const e of t.getRoot().listMaterials()){const r=e.getExtension(\"KHR_materials_pbrSpecularGlossiness\");if(!r)continue;const i=o.createSpecular().setSpecularFactor(1).setSpecularColorFactor(r.getSpecularFactor());s.add(r.getSpecularGlossinessTexture()),s.add(e.getBaseColorTexture()),s.add(e.getMetallicRoughnessTexture()),e.setBaseColorFactor(r.getDiffuseFactor()).setMetallicFactor(0).setRoughnessFactor(1).setExtension(\"KHR_materials_ior\",n.createIOR().setIOR(1e3)).setExtension(\"KHR_materials_specular\",i);const a=r.getDiffuseTexture();a&&(e.setBaseColorTexture(a),e.getBaseColorTextureInfo().copy(r.getDiffuseTextureInfo()));const c=r.getSpecularGlossinessTexture();if(c){const n=r.getSpecularGlossinessTextureInfo(),o=t.createTexture();await W(c,o,(t,e,n)=>{t.set(e,n,3,255)}),i.setSpecularTexture(o),i.setSpecularColorTexture(o),i.getSpecularTextureInfo().copy(n),i.getSpecularColorTextureInfo().copy(n);const s=r.getGlossinessFactor(),a=t.createTexture();await W(c,a,(t,e,n)=>{const o=255-Math.round(t.get(e,n,3)*s);t.set(e,n,0,0),t.set(e,n,1,o),t.set(e,n,2,0),t.set(e,n,3,255)}),e.setMetallicRoughnessTexture(a),e.getMetallicRoughnessTextureInfo().copy(n)}else i.setSpecularColorFactor(r.getSpecularFactor()),e.setRoughnessFactor(1-r.getGlossinessFactor());e.setExtension(\"KHR_materials_pbrSpecularGlossiness\",null)}r.dispose();for(const t of s)t&&1===t.listParents().length&&t.dispose();e.debug(`${_n}: Complete.`)})}const qn=\"unweld\",Bn={};function Un(t=Bn){return q({},Bn,t),B(qn,t=>{const e=t.getLogger(),n=new Map;for(const o of t.getRoot().listMeshes())for(const t of o.listPrimitives()){const o=t.getIndices();if(!o)continue;const r=t.getAttribute(\"POSITION\").getCount();for(const r of t.listAttributes())t.swap(r,Wn(r,o,e,n)),1===r.listParents().length&&r.dispose();for(const r of t.listTargets())for(const t of r.listAttributes())r.swap(t,Wn(t,o,e,n)),1===t.listParents().length&&t.dispose();const s=t.getAttribute(\"POSITION\").getCount();e.debug(`${qn}: ${V(r,s)} vertices.`),t.setIndices(null),1===o.listParents().length&&o.dispose()}e.debug(`${qn}: Complete.`)})}function Wn(t,e,n,o){if(o.has(t)&&o.get(t).has(e))return n.debug(`${qn}: Cache hit for reused attribute, \"${t.getName()}\".`),o.get(t).get(e);const r=t.clone(),s=t.getArray().constructor;r.setArray(new s(e.getCount()*t.getElementSize()));const i=[];for(let n=0;n{const n=t.getLogger();let o=0;await t.transform(Un());for(const r of t.getRoot().listMeshes())for(const s of r.listPrimitives()){const r=s.getAttribute(\"POSITION\");let i=s.getAttribute(\"NORMAL\");if(e.overwrite&&i)i.dispose();else if(i){n.debug(`${Dn}: Skipping primitive: NORMAL found.`);continue}i=t.createAccessor().setArray(new Float32Array(3*r.getCount())).setType(\"VEC3\");const a=[0,0,0],c=[0,0,0],l=[0,0,0];for(let t=0;t{const n=t.getLogger(),s=t.getRoot();await t.transform(zt({keepAttributes:!1,keepLeaves:!0,propertyTypes:[e.ACCESSOR]}));const i=new Set,c=new Set;for(const t of s.listMeshes())for(const e of t.listPrimitives()){const t=e.getMaterial();t&&!e.getAttribute(\"TEXCOORD_0\")&&(i.add(e),c.add(t))}const l=new Set,g=new Map,f={baseColor:new Set,emissive:new Set,metallicRoughness:new Set};for(const t of c){const e=Qn(t.getBaseColorFactor().slice()),n=Qn([...t.getEmissiveFactor(),1]),o=Zn(t.getRoughnessFactor()),r=Zn(t.getMetallicFactor()),s=`baseColor:${e},emissive:${n},metallicRoughness:${r}${o}`;f.baseColor.add(e),f.emissive.add(n),f.metallicRoughness.add(r+\"+\"+o),l.add(s),g.set(t,s)}const p=l.size;if(pt.forEach(t=>T.add(t));let E=null,S=null,M=null;if(f.baseColor.size>=r){const e=\"PaletteBaseColor\";E=t.createTexture(e).setURI(`${e}.png`),A.baseColor=_(new Uint8Array(m*d*4),[m,d,4]),y(\"baseColorFactor\",\"baseColorTexture\",\"baseColorTextureInfo\")}if(f.emissive.size>=r){const e=\"PaletteEmissive\";S=t.createTexture(e).setURI(`${e}.png`),A.emissive=_(new Uint8Array(m*d*4),[m,d,4]),y(\"emissiveFactor\",\"emissiveTexture\",\"emissiveTextureInfo\")}if(f.metallicRoughness.size>=r){const e=\"PaletteMetallicRoughness\";M=t.createTexture(e).setURI(`${e}.png`),A.metallicRoughness=_(new Uint8Array(m*d*4),[m,d,4]),y(\"metallicFactor\",\"roughnessFactor\",\"metallicRoughnessTexture\",\"metallicRoughnessTextureInfo\")}if(!(E||S||M))return void n.debug(`${Vn}: No material property has ≥${r} unique values. Exiting.`);const w=new Set,N=new Map,b=[];let R=0;for(const t of c){const e=g.get(t);if(w.has(e))continue;const n=R++;if(A.baseColor){const e=A.baseColor,r=[...t.getBaseColorFactor()];u.convertLinearToSRGB(r,r),to(e,n,r,o)}if(A.emissive){const e=A.emissive,r=[...t.getEmissiveFactor(),1];u.convertLinearToSRGB(r,r),to(e,n,r,o)}if(A.metallicRoughness){const e=A.metallicRoughness,r=t.getMetallicFactor();to(e,n,[0,t.getRoughnessFactor(),r,1],o)}w.add(e),N.set(e,n)}const C=\"image/png\";if(E){const t=await I(A.baseColor,C);E.setImage(t).setMimeType(C)}if(S){const t=await I(A.emissive,C);S.setImage(t).setMimeType(C)}if(M){const t=await I(A.metallicRoughness,C);M.setImage(t).setMimeType(C)}let O=1;for(const e of i){const n=e.getMaterial(),o=g.get(n),r=(N.get(o)+.5)/p*(m-h)/m,s=e.getAttribute(\"POSITION\"),i=s.getBuffer(),c=new Float32Array(2*s.getCount()).fill(r),l=t.createAccessor().setType(\"VEC2\").setArray(c).setBuffer(i);let u;for(const t of b)t.equals(n,T)&&(u=t);if(!u){const t=(O++).toString().padStart(3,\"0\");u=n.clone().setName(`PaletteMaterial${t}`),E&&u.setBaseColorFactor([1,1,1,1]).setBaseColorTexture(E).getBaseColorTextureInfo().setMinFilter(a.MinFilter.NEAREST).setMagFilter(a.MagFilter.NEAREST),S&&u.setEmissiveFactor([1,1,1]).setEmissiveTexture(S).getEmissiveTextureInfo().setMinFilter(a.MinFilter.NEAREST).setMagFilter(a.MagFilter.NEAREST),M&&u.setMetallicFactor(1).setRoughnessFactor(1).setMetallicRoughnessTexture(M).getMetallicRoughnessTextureInfo().setMinFilter(a.MinFilter.NEAREST).setMagFilter(a.MagFilter.NEAREST),b.push(u)}e.setMaterial(u).setAttribute(\"TEXCOORD_0\",l)}await t.transform(zt({propertyTypes:[e.MATERIAL]})),n.debug(`${Vn}: Complete.`)})}function Zn(t){const e=Math.round(255*t).toString(16);return 1===e.length?\"0\"+e:e}function Qn(t){return u.convertLinearToSRGB(t,t),t.map(Zn).join(\"\")}function Yn(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function to(t,e,n,o){for(let r=0;r{const o=t.getLogger();!1!==n.meshes&&function(t,e,n){const o=new Set(t.getRoot().listBuffers().map(t=>t.getURI()));t.getRoot().listMeshes().forEach((r,s)=>{if(Array.isArray(n.meshes)&&!n.meshes.includes(r.getName()))return void e.debug(`${eo}: Skipping mesh #${s} with name \"${r.getName()}\".`);e.debug(`${eo}: Creating buffer for mesh \"${r.getName()}\".`);const i=t.createBuffer(r.getName()).setURI(ro(r.getName()||\"mesh\",o));r.listPrimitives().forEach(t=>{const e=t.getIndices();e&&e.setBuffer(i),t.listAttributes().forEach(t=>t.setBuffer(i)),t.listTargets().forEach(t=>{t.listAttributes().forEach(t=>t.setBuffer(i))})})})}(t,o,n),!1!==n.animations&&function(t,e,n){const o=new Set(t.getRoot().listBuffers().map(t=>t.getURI()));t.getRoot().listAnimations().forEach((r,s)=>{if(Array.isArray(n.animations)&&!n.animations.includes(r.getName()))return void e.debug(`${eo}: Skipping animation #${s} with name \"${r.getName()}\".`);e.debug(`${eo}: Creating buffer for animation \"${r.getName()}\".`);const i=t.createBuffer(r.getName()).setURI(ro(r.getName()||\"animation\",o));r.listSamplers().forEach(t=>{const e=t.getInput(),n=t.getOutput();e&&e.setBuffer(i),n&&n.setBuffer(i)})})}(t,o,n),n.meshes||n.animations||o.warn(`${eo}: Select animations or meshes to create a partition.`),await t.transform(zt({propertyTypes:[e.BUFFER]})),o.debug(`${eo}: Complete.`)})}function ro(t,e){let n=`${t}.bin`,o=1;for(;e.has(n);)n=`${t}_${o++}.bin`;return n}var so;function io(t,e,n){for(let o=0,r=n.length;on)return!1;return!0}function lo(t,e,n){return t*(1-n)+e*n}function go(t,e,n,o){for(let r=0;r1e-6?(r=Math.acos(s),i=Math.sin(r),a=Math.sin((1-o)*r)/i,c=Math.sin(o*r)/i):(a=1-o,c=o),t[0]=a*l+c*p,t[1]=a*g+c*m,t[2]=a*u+c*d,t[3]=a*f+c*h,t}function fo(t,e){const n=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}(t,e);return Math.acos(2*n*n-1)}!function(t){t[t.STEP=0]=\"STEP\",t[t.LERP=1]=\"LERP\",t[t.SLERP=2]=\"SLERP\"}(so||(so={}));const po=\"resample\",mo=new Float32Array(0),ho={ready:Promise.resolve(),resample:function(t,e,n,o=1e-4){const r=e.length/t.length,s=new Array(r).fill(0),i=new Array(r).fill(0),a=new Array(r).fill(0),c=new Array(r).fill(0),l=t.length-1;let g=1;for(let r=1;r=Math.PI}else\"lerp\"===n?m=!co(i,go(s,c,a,p),o):\"step\"===n&&(m=!co(i,c)||!co(i,a));m&&(r!==g&&(t[g]=t[r],ao(e,g,io(e,r,s))),g++)}return l>0&&(t[g]=t[l],ao(e,g,io(e,l,s)),g++),g},tolerance:1e-4};function Ao(t=ho){const n=q({},ho,t);return B(po,async(t,o)=>{const r=new Set,s=t.getRoot().listAccessors().length,a=t.getLogger(),c=n.ready,l=n.resample;await c;for(const e of t.getRoot().listAnimations()){const t=new Map;for(const n of e.listChannels())t.set(n.getSampler(),n.getTargetPath());for(const o of e.listSamplers()){const e=o.getInterpolation();if(\"STEP\"===e||\"LINEAR\"===e){const s=o.getInput(),i=o.getOutput();r.add(s),r.add(i);const a=To(s.getArray(),s.getComponentType(),s.getNormalized()),c=To(i.getArray(),i.getComponentType(),i.getNormalized()),g=c.length/a.length,u=a.length;let f;if(f=\"STEP\"===e?l(a,c,\"step\",n.tolerance):\"rotation\"===t.get(o)?l(a,c,\"slerp\",n.tolerance):l(a,c,\"lerp\",n.tolerance),f!(t instanceof i))||t.dispose();t.getRoot().listAccessors().length>s&&!U(o,po,\"dedup\")&&await t.transform(wt({propertyTypes:[e.ACCESSOR]})),a.debug(`${po}: Complete.`)})}function To(t,e,n){if(t instanceof Float32Array)return t.slice();const o=new Float32Array(t);if(!n)return o;for(let t=0;t{const n=t.getLogger(),o=t.getRoot(),r=e.fps,s=o.listNodes().filter(t=>t.getName().match(e.pattern));e.sort&&s.sort((t,e)=>t.getName()>e.getName()?1:-1);const i=t.createAnimation(e.name),a=o.listBuffers()[0];s.forEach((e,n)=>{let o,c;0===n?(o=[n/r,(n+1)/r],c=[1,1,1,0,0,0]):n===s.length-1?(o=[(n-1)/r,n/r],c=[0,0,0,1,1,1]):(o=[(n-1)/r,n/r,(n+1)/r],c=[0,0,0,1,1,1,0,0,0]);const l=t.createAccessor().setArray(new Float32Array(o)).setBuffer(a),u=t.createAccessor().setArray(new Float32Array(c)).setBuffer(a).setType(p.Type.VEC3),f=t.createAnimationSampler().setInterpolation(E.Interpolation.STEP).setInput(l).setOutput(u),m=t.createAnimationChannel().setTargetNode(e).setTargetPath(g.TargetPath.SCALE).setSampler(f);i.addSampler(f).addChannel(m)}),n.debug(`${Eo}: Complete.`)})}const Io=\"simplify\",wo={ratio:0,error:1e-4,lockBorder:!1};function No(n){const o=q({},wo,n),r=o.simplifier;if(!r)throw new Error(`${Io}: simplifier dependency required — install \"meshoptimizer\".`);return B(Io,async(n,s)=>{const i=n.getLogger();await r.ready,await n.transform(Vt({overwrite:!1}));for(const e of n.getRoot().listMeshes()){for(const r of e.listPrimitives())r.getMode()===t.Mode.TRIANGLES?(bo(n,r,o),0===r.getIndices().getCount()&&r.dispose()):i.warn(`${Io}: Skipping primitive of mesh \"${e.getName()}\": Requires TRIANGLES draw mode.`);0===e.listPrimitives().length&&e.dispose()}await n.transform(zt({keepLeaves:!1,propertyTypes:[e.ACCESSOR,e.NODE]})),U(s,Io,\"dedup\")||await n.transform(wt({propertyTypes:[e.ACCESSOR]})),i.debug(`${Io}: Complete.`)})}function bo(t,e,n){const o=q({},wo,n),r=o.simplifier,s=t.getLogger(),i=e.getAttribute(\"POSITION\"),a=e.getIndices(),c=i.getCount();let l=i.getArray(),g=a.getArray();if(i.getComponentType()!==p.ComponentType.FLOAT)if(i.getNormalized()){const t=l,e=new Float32Array(t.length);for(let n=0,o=i.getCount(),r=[];n1)throw new Error(`${Ro}: Ratio must be between 0 and 1.`);return B(Ro,t=>{const n=t.getRoot(),o=t.getLogger();let r=0;for(const t of n.listAccessors()){const n=t.getCount(),o=Array(t.getElementSize()).fill(0),s=Array(t.getElementSize()).fill(0);let i=0;for(let r=0;r=e));r++);const a=i/n{const n=t.getLogger();for(const o of t.getRoot().listTextures()){const t=o.getName(),r=o.getURI();if(e.pattern&&!e.pattern.test(t)&&!e.pattern.test(r)){n.debug(`${$o}: Skipping, excluded by \"pattern\" parameter.`);continue}if(\"image/png\"!==o.getMimeType()&&\"image/jpeg\"!==o.getMimeType()){n.warn(`${$o}: Skipping, unsupported texture type \"${o.getMimeType()}\".`);continue}const s=vt(o);if(e.slots&&!s.some(t=>{var n;return null==(n=e.slots)?void 0:n.test(t)})){n.debug(`${$o}: Skipping, [${s.join(\", \")}] excluded by \"slots\" parameter.`);continue}const i=o.getSize(),a=et(i,e.size);if(d.eq(i,a)){n.debug(`${$o}: Skipping, not within size range.`);continue}const c=o.getImage(),l=await M(c,o.getMimeType()),g=_(new Uint8Array(a[0]*a[1]*4),[...a,4]);n.debug(`${$o}: Resizing \"${r||t}\", ${l.shape} → ${g.shape}...`),n.debug(`${$o}: Slots → [${s.join(\", \")}]`);try{e.filter===vo.LANCZOS3?G(l,g):k(l,g)}catch(e){if(e instanceof Error){n.warn(`${$o}: Failed to resize \"${r||t}\": \"${e.message}\".`);continue}throw e}o.setImage(await I(g,o.getMimeType()))}n.debug(`${$o}: Complete.`)})}const Lo=\"textureCompress\",zo=[\"jpeg\",\"png\",\"webp\",\"avif\"],Fo=[\"image/jpeg\",\"image/png\",\"image/webp\",\"image/avif\"],_o={resizeFilter:vo.LANCZOS3,pattern:void 0,formats:void 0,slots:void 0,quality:void 0,effort:void 0,lossless:!1,nearLossless:!1};function Go(t){const e=q({},_o,t),n=e.targetFormat,o=e.pattern,r=e.formats,s=e.slots;return B(Lo,async t=>{const i=t.getLogger(),a=t.getRoot().listTextures();await Promise.all(a.map(async(a,c)=>{const l=vt(a),g=rn(a),u=a.getURI()||a.getName()||`${c+1}/${t.getRoot().listTextures().length}`,f=`${Lo}(${u})`;if(!Fo.includes(a.getMimeType()))return void i.debug(`${f}: Skipping, unsupported texture type \"${a.getMimeType()}\".`);if(o&&!o.test(a.getName())&&!o.test(a.getURI()))return void i.debug(`${f}: Skipping, excluded by \"pattern\" parameter.`);if(r&&!r.test(a.getMimeType()))return void i.debug(`${f}: Skipping, \"${a.getMimeType()}\" excluded by \"formats\" parameter.`);if(s&&l.length&&!l.some(t=>s.test(t)))return void i.debug(`${f}: Skipping, [${l.join(\", \")}] excluded by \"slots\" parameter.`);if(\"jpeg\"===e.targetFormat&&g&T.A)return void i.warn(`${f}: Skipping, [${l.join(\", \")}] requires alpha channel.`);const p=qo(a);i.debug(`${f}: Format = ${p} → ${n||p}`),i.debug(`${f}: Slots = [${l.join(\", \")}]`);const m=a.getImage(),d=m.byteLength;await ko(a,e);const h=a.getImage(),A=h.byteLength,y=m===h?\" (SKIPPED\":\"\";i.debug(`${f}: Size = ${j(d)} → ${j(A)}${y}`)}));const c=t.createExtension(v);a.some(t=>\"image/webp\"===t.getMimeType())?c.setRequired(!0):c.dispose();const l=t.createExtension(P);a.some(t=>\"image/avif\"===t.getMimeType())?l.setRequired(!0):l.dispose(),i.debug(`${Lo}: Complete.`)})}async function ko(t,e){const n=q({},_o,e),o=n.encoder,r=qo(t),i=n.targetFormat||r,a=t.getMimeType(),c=`image/${i}`,l=t.getImage(),g=o?await async function(t,e,n,o){const r=o.encoder;let i={};const a=Bo(n);switch(a){case\"jpeg\":i={quality:o.quality};break;case\"png\":i={quality:o.quality,effort:Uo(o.effort,100,10)};break;case\"webp\":i={quality:o.quality,effort:Uo(o.effort,100,6),lossless:o.lossless,nearLossless:o.nearLossless};break;case\"avif\":i={quality:o.quality,effort:Uo(o.effort,100,9),lossless:o.lossless}}const c=r(t).toFormat(a,i);return o.resize&&c.resize(o.resize[0],o.resize[1],{fit:\"inside\",kernel:o.resizeFilter,withoutEnlargement:!0}),s.toView(await c.toBuffer())}(l,0,c,n):await async function(t,e,n,o){const r=await M(t,e);if(o.resize){const[t,e]=r.shape,s=et([t,e],o.resize),i=_(new Uint8Array(s[0]*s[1]*4),[...s,4]);return o.resizeFilter===vo.LANCZOS3?G(r,i):k(r,i),I(i,n)}return I(r,n)}(l,a,c,n);if(!(a===c&&g.byteLength>=l.byteLength)||n.resize)if(a===c)t.setImage(g);else{const e=h.mimeTypeToExtension(a),n=h.mimeTypeToExtension(c),o=t.getURI().replace(new RegExp(`\\\\.${e}$`),`.${n}`);t.setImage(g).setMimeType(c).setURI(o)}}function qo(t){return Bo(t.getMimeType())}function Bo(t){const e=t.split(\"/\").pop();if(!e||!zo.includes(e))throw new Error(`Unknown MIME type \"${t}\".`);return e}function Uo(t,e,n){if(null!=t)return Math.round(t/e*n)}const Wo=\"tangents\",Do={overwrite:!1};function Ho(t=Do){if(!t.generateTangents)throw new Error(`${Wo}: generateTangents callback required — install \"mikktspace\".`);const e=q({},Do,t);return B(Wo,t=>{const n=t.getLogger(),o=new Map,r=new Map;let s=0;for(const i of t.getRoot().listMeshes()){const a=i.getName(),c=i.listPrimitives();for(let i=0;i{const e=t.createExtension(x).createUnlit();t.getRoot().listMaterials().forEach(t=>{t.setExtension(\"KHR_materials_unlit\",e)})}}const Ko=\"unpartition\",Jo={};function Zo(t=Jo){return q({},Jo,t),B(Ko,async t=>{const e=t.getLogger(),n=t.getRoot().listBuffers()[0];t.getRoot().listAccessors().forEach(t=>t.setBuffer(n)),t.getRoot().listBuffers().forEach((t,e)=>e>0?t.dispose():null),e.debug(`${Ko}: Complete.`)})}const Qo=\"vertexColorSpace\",Yo=tr;function tr(t){return B(Qo,e=>{const n=e.getLogger(),o=(t.inputColorSpace||t.inputEncoding||\"\").toLowerCase();if(\"srgb-linear\"===o)return void n.info(`${Qo}: Vertex colors already linear. Skipping conversion.`);if(\"srgb\"!==o)return void n.error(`${Qo}: Unknown input color space \"${o}\" – should be \"srgb\" or \"srgb-linear\". Skipping conversion.`);const r=new Set;function s(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function i(t){const e=[0,0,0];let n;for(let o=0;n=t.getAttribute(`COLOR_${o}`);o++)if(!r.has(n)){for(let t=0;tt.listPrimitives().forEach(i)),n.debug(`${Qo}: Complete.`)})}export{Te as DRACO_DEFAULTS,Se as FLATTEN_DEFAULTS,Ze as JOIN_DEFAULTS,Ln as MESHOPT_DEFAULTS,Kn as PALETTE_DEFAULTS,En as QUANTIZE_DEFAULTS,wo as SIMPLIFY_DEFAULTS,_o as TEXTURE_COMPRESS_DEFAULTS,zo as TEXTURE_COMPRESS_SUPPORTED_FORMATS,Po as TEXTURE_RESIZE_DEFAULTS,vo as TextureResizeFilter,Xt as WELD_DEFAULTS,rt as center,it as clearNodeParent,fe as clearNodeTransform,Yo as colorspace,ko as compressTexture,B as createTransform,wt as dedup,de as dequantize,he as dequantizePrimitive,ye as draco,Me as flatten,D as getGLPrimitiveCount,Ie as getNodeScene,rn as getTextureChannelMask,Ct as getTextureColorSpace,we as inspect,Fe as instance,U as isTransformPending,Qe as join,Ue as joinPrimitives,st as listNodeScenes,on as listTextureChannels,Ot as listTextureInfo,$t as listTextureInfoByMaterial,vt as listTextureSlots,Fn as meshopt,kn as metalRough,jn as normals,Jn as palette,oo as partition,zt as prune,Sn as quantize,cn as reorder,Ao as resample,Mo as sequence,No as simplify,bo as simplifyPrimitive,ln as sortPrimitiveWeights,Oo as sparse,Ho as tangents,Go as textureCompress,xo as textureResize,ge as transformMesh,ie as transformPrimitive,Vo as unlit,Zo as unpartition,Un as unweld,tr as vertexColorSpace,Vt as weld,Kt as weldPrimitive};\n//# sourceMappingURL=functions.modern.js.map\n","// Copyright 2023 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Accessor, Extension, ExtensionProperty, GLTF, IProperty, PropertyType, ReaderContext, WriterContext} from '@gltf-transform/core';\n\nconst NAME = 'EXT_mesh_manifold';\nconst MERGE = 'MERGE';\n\ninterface IManifoldPrimitive extends IProperty {\n mergeIndices: Accessor;\n mergeValues: Accessor;\n indices: Accessor;\n runIndex: number[]|Uint32Array;\n}\n\ninterface ManifoldDef {\n manifoldPrimitive: GLTF.IMeshPrimitive;\n mergeIndices: number;\n mergeValues: number;\n}\n\nexport class ManifoldPrimitive extends ExtensionProperty {\n static EXTENSION_NAME = NAME;\n public declare extensionName: typeof NAME;\n public declare propertyType: 'ManifoldPrimitive';\n public declare parentTypes: [PropertyType.MESH];\n\n init() {\n ManifoldPrimitive.EXTENSION_NAME = NAME;\n this.propertyType = 'ManifoldPrimitive';\n this.parentTypes = [PropertyType.MESH];\n }\n\n getDefaults() {\n return Object.assign(\n super.getDefaults(),\n {manifoldPrimitive: null, mergeIndices: null, mergeValues: null});\n }\n\n getMergeIndices() {\n return this.getRef('mergeIndices');\n }\n\n getMergeValues() {\n return this.getRef('mergeValues');\n }\n\n setMerge(indicesAccessor: Accessor, valuesAccessor: Accessor) {\n if (indicesAccessor.getCount() !== valuesAccessor.getCount())\n throw new Error('merge vectors must be the same length.');\n this.setRef('mergeIndices', indicesAccessor);\n return this.setRef('mergeValues', valuesAccessor);\n }\n\n getRunIndex() {\n return this.get('runIndex');\n }\n\n setRunIndex(runIndex: number[]|Uint32Array) {\n return this.set('runIndex', runIndex);\n }\n\n setIndices(indices: Accessor) {\n return this.setRef('indices', indices);\n }\n\n getIndices() {\n return this.getRef('indices')!;\n }\n}\n\nexport class EXTManifold extends Extension {\n extensionName = NAME;\n prewriteTypes = [PropertyType.ACCESSOR];\n static EXTENSION_NAME = NAME;\n\n createManifoldPrimitive() {\n return new ManifoldPrimitive(this.document.getGraph());\n }\n\n read(context: ReaderContext) {\n const {json} = context.jsonDoc;\n const meshDefs = json.meshes || [];\n\n meshDefs.forEach((meshDef, meshIndex) => {\n if (!meshDef.extensions || !meshDef.extensions[NAME]) return;\n\n const mesh = context.meshes[meshIndex];\n const manifoldPrimitive = this.createManifoldPrimitive();\n mesh.setExtension(NAME, manifoldPrimitive);\n\n const manifoldDef = meshDef.extensions[NAME] as ManifoldDef;\n\n if (manifoldDef.manifoldPrimitive) {\n let count = 0;\n const runIndex = Array();\n runIndex.push(count);\n for (const primitive of mesh.listPrimitives()) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n count += indices.getCount();\n runIndex.push(count);\n }\n manifoldPrimitive.setRunIndex(runIndex);\n manifoldPrimitive.setIndices(\n context.accessors[manifoldDef.manifoldPrimitive.indices!]);\n }\n\n if (manifoldDef.mergeIndices != null && manifoldDef.mergeValues != null) {\n manifoldPrimitive.setMerge(\n context.accessors[manifoldDef.mergeIndices],\n context.accessors[manifoldDef.mergeValues]);\n }\n });\n\n return this;\n }\n\n prewrite(context: WriterContext) {\n this.document.getRoot().listMeshes().forEach((mesh) => {\n const manifoldPrimitive = mesh.getExtension(NAME) as ManifoldPrimitive;\n if (!manifoldPrimitive) return;\n\n const indices = manifoldPrimitive.getIndices();\n context.addAccessorToUsageGroup(\n indices, WriterContext.BufferViewUsage.ELEMENT_ARRAY_BUFFER);\n\n const mergeFrom = manifoldPrimitive.getMergeIndices();\n const mergeTo = manifoldPrimitive.getMergeValues();\n if (!mergeFrom || !mergeTo) return;\n\n context.addAccessorToUsageGroup(mergeFrom, MERGE);\n context.addAccessorToUsageGroup(mergeTo, MERGE);\n });\n return this;\n }\n\n write(context: WriterContext) {\n const {json} = context.jsonDoc;\n\n this.document.getRoot().listMeshes().forEach((mesh) => {\n const manifoldPrimitive = mesh.getExtension(NAME) as ManifoldPrimitive;\n if (!manifoldPrimitive) return;\n\n const meshIndex = context.meshIndexMap.get(mesh)!;\n const meshDef = json.meshes![meshIndex];\n\n const runIndex = manifoldPrimitive.getRunIndex();\n const numPrimitive = runIndex.length - 1;\n\n if (numPrimitive !== meshDef.primitives.length) {\n throw new Error(\n 'The number of primitives must be exactly one less than the length of runIndex.');\n }\n\n const mergeIndicesIndex =\n context.accessorIndexMap.get(manifoldPrimitive.getMergeIndices()!)!;\n const mergeValuesIndex =\n context.accessorIndexMap.get(manifoldPrimitive.getMergeValues()!)!;\n const mergeIndices = json.accessors![mergeIndicesIndex];\n const mergeValues = json.accessors![mergeValuesIndex];\n\n const existingPrimitive = meshDef.primitives[0];\n const primitive = {\n indices: context.accessorIndexMap.get(manifoldPrimitive.getIndices())!,\n mode: existingPrimitive.mode,\n attributes: {'POSITION': existingPrimitive.attributes['POSITION']}\n };\n\n const indices = json.accessors![primitive.indices];\n if (!indices) {\n return;\n }\n\n if (mergeIndices && mergeValues) {\n indices.sparse = {\n count: mergeIndices.count,\n indices: {\n bufferView: mergeIndices.bufferView!,\n byteOffset: mergeIndices.byteOffset,\n componentType: mergeIndices.componentType\n },\n values: {\n bufferView: mergeValues.bufferView!,\n byteOffset: mergeValues.byteOffset,\n }\n };\n }\n\n for (let i = 0; i < numPrimitive; ++i) {\n const accessor = json.accessors![meshDef.primitives[i].indices!];\n accessor.bufferView = indices.bufferView;\n accessor.byteOffset = indices.byteOffset! + 4 * runIndex[i];\n accessor.count = runIndex[i + 1] - runIndex[i];\n }\n\n meshDef.extensions = meshDef.extensions || {};\n meshDef.extensions[NAME] = {\n manifoldPrimitive: primitive,\n mergeIndices: mergeIndicesIndex,\n mergeValues: mergeValuesIndex\n };\n\n // Test the manifold primitive by replacing the material primitives\n // meshDef.primitives = [primitive];\n });\n\n return this;\n }\n}","// Copyright 2023 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Accessor, Document, Material, Mesh, Primitive, Texture, WebIO} from '@gltf-transform/core';\n\nimport {EXTManifold, ManifoldPrimitive} from './manifold-gltf';\nimport {Mesh as ManifoldMesh, MeshOptions} from './public/manifold-encapsulated-types';\n\nexport const attributeDefs = {\n 'POSITION': {type: Accessor.Type.VEC3, components: 3},\n 'NORMAL': {type: Accessor.Type.VEC3, components: 3},\n 'TANGENT': {type: Accessor.Type.VEC4, components: 4},\n 'TEXCOORD_0': {type: Accessor.Type.VEC2, components: 2},\n 'TEXCOORD_1': {type: Accessor.Type.VEC2, components: 2},\n 'COLOR_0': {type: Accessor.Type.VEC3, components: 3},\n 'JOINTS_0': {type: Accessor.Type.VEC4, components: 4},\n 'WEIGHTS_0': {type: Accessor.Type.VEC4, components: 4},\n 'SKIP_1': {type: null, components: 1},\n 'SKIP_2': {type: null, components: 2},\n 'SKIP_3': {type: null, components: 3},\n 'SKIP_4': {type: null, components: 4},\n};\n\nexport type Attribute = keyof(typeof attributeDefs);\n\nexport interface Properties {\n material: Material;\n attributes: Attribute[];\n}\n\n/**\n * Call this first to register the manifold extension so that readMesh and\n * writeMesh will work.\n */\nexport function setupIO(io: WebIO) {\n return io.registerExtensions([EXTManifold]);\n}\n\n/**\n * Read an input mesh into Manifold-compatible data structures, whether it\n * contains the EXT_mesh_manifold extension or not.\n *\n * @param mesh The Mesh to read.\n * @param attributes An array of attributes representing the order of desired\n * properties returned in the vertProperties array of the output mesh. If\n * omitted, this will be populated with the union of all attributes defined\n * in the primitives of the input mesh. If present, the first entry must be\n * 'POSITION', and any attributes in the primitives that are not included in\n * this list will be ignored, while those in the list but not defined in a\n * primitive will be populated with zeros.\n * @returns The returned mesh is suitable for initializing a Manifold or Mesh of\n * the Manifold library if desired. See Manifold documentation if you prefer\n * to use these GL arrays in a different library. The runProperties array\n * gives the Material and attributes list associated with each triangle run,\n * which in turn corresponds to a primitive of the input mesh. These\n * attributes are the intersection of the attributes present on the\n * primitive and those requested in the attributes input.\n */\nexport function readMesh(mesh: Mesh, attributes: Attribute[] = []):\n {mesh: MeshOptions, runProperties: Properties[]}|null {\n const primitives = mesh.listPrimitives();\n if (primitives.length === 0) {\n return null;\n }\n\n if (attributes.length === 0) {\n const attributeSet = new Set();\n for (const primitive of primitives) {\n const semantics = primitive.listSemantics() as Attribute[];\n for (const semantic of semantics) {\n attributeSet.add(semantic);\n }\n }\n let semantic: Attribute;\n for (semantic in attributeDefs) {\n if (attributeSet.has(semantic)) {\n attributes.push(semantic);\n attributeSet.delete(semantic);\n }\n }\n for (const semantic of attributeSet.keys()) {\n attributes.push(semantic);\n }\n }\n\n if (attributes.length < 1 || attributes[0] !== 'POSITION')\n throw new Error('First attribute must be \"POSITION\".');\n\n let numProp = 0;\n const attributeOffsets = attributes.map((numProp = 0, def => {\n const last = numProp;\n numProp += attributeDefs[def].components;\n return last;\n }));\n\n const manifoldPrimitive =\n mesh.getExtension('EXT_mesh_manifold') as ManifoldPrimitive;\n\n let vertPropArray = Array();\n let triVertArray = Array();\n const runIndexArray = [0];\n const mergeFromVertArray = Array();\n const mergeToVertArray = Array();\n const runProperties = Array();\n if (manifoldPrimitive != null) {\n const numVert = primitives[0].getAttribute('POSITION')!.getCount();\n const foundAttribute = attributes.map((a) => attributeDefs[a].type == null);\n vertPropArray = new Array(numProp * numVert);\n\n for (const primitive of primitives) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n\n const attributesIn = primitive.listSemantics() as Attribute[];\n\n attributes.forEach((attributeOut, idx) => {\n if (foundAttribute[idx]) {\n return;\n }\n for (const attributeIn of attributesIn) {\n if (attributeIn === attributeOut) {\n foundAttribute[idx] = true;\n const accessor = primitive.getAttribute(attributeIn)!;\n writeProperties(\n vertPropArray, accessor, numProp, attributeOffsets[idx]);\n }\n }\n });\n\n triVertArray = [...triVertArray, ...indices.getArray()!];\n runIndexArray.push(triVertArray.length);\n runProperties.push({\n material: primitive.getMaterial()!,\n attributes: attributesIn.filter(b => attributes.some(a => a == b))\n });\n }\n const mergeTriVert = manifoldPrimitive.getMergeIndices()?.getArray() ?? [];\n const mergeTo = manifoldPrimitive.getMergeValues()?.getArray() ?? [];\n const vert2merge = new Map();\n for (const [i, idx] of mergeTriVert.entries()) {\n vert2merge.set(triVertArray[idx], mergeTo[i]);\n }\n for (const [from, to] of vert2merge.entries()) {\n mergeFromVertArray.push(from);\n mergeToVertArray.push(to);\n }\n } else {\n for (const primitive of primitives) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n const numVert = vertPropArray.length / numProp;\n vertPropArray =\n [...vertPropArray, ...readPrimitive(primitive, numProp, attributes)];\n triVertArray =\n [...triVertArray, ...indices.getArray()!.map((i) => i + numVert)];\n runIndexArray.push(triVertArray.length);\n\n const attributesIn = primitive.listSemantics() as Attribute[];\n runProperties.push({\n material: primitive.getMaterial()!,\n attributes: attributesIn.filter(b => attributes.some(a => a == b))\n });\n }\n }\n const vertProperties = new Float32Array(vertPropArray);\n const triVerts = new Uint32Array(triVertArray);\n const runIndex = new Uint32Array(runIndexArray);\n const mergeFromVert = new Uint32Array(mergeFromVertArray);\n const mergeToVert = new Uint32Array(mergeToVertArray);\n\n const meshOut =\n {numProp, triVerts, vertProperties, runIndex, mergeFromVert, mergeToVert};\n\n return {mesh: meshOut, runProperties};\n}\n\n/**\n * Write a Manifold Mesh into a glTF Mesh object, using the EXT_mesh_manifold\n * extension to allow for lossless roundtrip of the manifold mesh through the\n * glTF file.\n *\n * @param doc The glTF Document to which this Mesh will be added.\n * @param manifoldMesh The Manifold Mesh to convert to glTF.\n * @param id2properties A map from originalID to Properties that include the\n * glTF Material and the set of attributes to output. All triangle runs with\n * the same originalID will be combined into a single output primitive. Any\n * originalIDs not found in the map will have the glTF default material and\n * no attributes beyond 'POSITION'. Each attributes array must correspond to\n * the manifoldMesh vertProperties, thus the first attribute must always be\n * 'POSITION'. Any properties that should not be output for a given\n * primitive must use the 'SKIP_*' attributes.\n * @returns The glTF Mesh to add to the Document.\n */\nexport function writeMesh(\n doc: Document, manifoldMesh: ManifoldMesh,\n id2properties: Map): Mesh {\n if (doc.getRoot().listBuffers().length === 0) {\n doc.createBuffer();\n }\n const buffer = doc.getRoot().listBuffers()[0];\n const manifoldExtension = doc.createExtension(EXTManifold);\n\n const mesh = doc.createMesh();\n const runIndex = Array();\n const attributeUnion = Array();\n const primitive2attributes = new Map();\n const numRun = manifoldMesh.runIndex.length - 1;\n let lastID = -1;\n for (let run = 0; run < numRun; ++run) {\n const id = manifoldMesh.runOriginalID[run];\n if (id == lastID) {\n continue;\n }\n lastID = id;\n runIndex.push(manifoldMesh.runIndex[run]);\n\n const indices = doc.createAccessor('primitive indices of ID ' + id)\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(1));\n const primitive = doc.createPrimitive().setIndices(indices);\n\n const properties = id2properties.get(id);\n if (properties) {\n const {material, attributes} = properties;\n if (attributes.length < 1 || attributes[0] !== 'POSITION')\n throw new Error('First attribute must be \"POSITION\".');\n\n primitive.setMaterial(material);\n primitive2attributes.set(primitive, attributes);\n\n properties.attributes.forEach((attribute, i) => {\n if (i >= attributeUnion.length) {\n attributeUnion.push(attribute);\n } else {\n const size = attributeDefs[attribute].components;\n const unionSize = attributeDefs[attributeUnion[i]].components;\n if (size != unionSize) {\n throw new Error(\n 'Attribute sizes do not correspond: ' + attribute + ' and ' +\n attributeUnion[i]);\n }\n if (attributeDefs[attributeUnion[i]].type == null) {\n attributeUnion[i] = attribute;\n }\n }\n });\n } else {\n primitive2attributes.set(primitive, ['POSITION']);\n }\n\n mesh.addPrimitive(primitive);\n }\n runIndex.push(manifoldMesh.runIndex[numRun]);\n\n const numVert = manifoldMesh.numVert;\n const numProp = manifoldMesh.numProp;\n let offset = 0;\n attributeUnion.forEach((attribute, aIdx) => {\n const def = attributeDefs[attribute];\n if (def == null)\n throw new Error(attribute + ' is not a recognized attribute.');\n\n if (def.type == null) {\n ++offset;\n return;\n }\n\n const n = def.components;\n if (offset + n > numProp) throw new Error('Too many attribute channels.');\n\n const array = new Float32Array(n * numVert);\n for (let v = 0; v < numVert; ++v) {\n for (let i = 0; i < n; ++i) {\n let x = manifoldMesh.vertProperties[numProp * v + offset + i];\n if (attribute == 'COLOR_0') {\n x = Math.max(0, Math.min(1, x));\n }\n array[n * v + i] = x;\n }\n }\n\n const accessor = doc.createAccessor(attribute)\n .setBuffer(buffer)\n .setType(def.type)\n .setArray(array);\n\n for (const primitive of mesh.listPrimitives()) {\n const attributes = primitive2attributes.get(primitive)!;\n if (attributes.length > aIdx &&\n attributeDefs[attributes[aIdx]].type != null) {\n primitive.setAttribute(attribute, accessor);\n }\n }\n offset += n;\n });\n\n const manifoldPrimitive = manifoldExtension.createManifoldPrimitive();\n mesh.setExtension('EXT_mesh_manifold', manifoldPrimitive);\n\n const indices = doc.createAccessor('manifold indices')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(manifoldMesh.triVerts);\n manifoldPrimitive.setIndices(indices);\n manifoldPrimitive.setRunIndex(runIndex);\n\n const vert2merge = [...Array(manifoldMesh.numVert).keys()];\n const ind = Array();\n const val = Array();\n if (manifoldMesh.mergeFromVert && manifoldMesh.mergeToVert) {\n for (const [i, from] of manifoldMesh.mergeFromVert.entries()) {\n vert2merge[from] = manifoldMesh.mergeToVert[i];\n }\n\n for (const [i, vert] of manifoldMesh.triVerts.entries()) {\n const newVert = vert2merge[vert];\n if (vert !== newVert) {\n ind.push(i);\n val.push(newVert);\n }\n }\n }\n if (ind.length > 0) {\n const indicesAccessor = doc.createAccessor('merge from')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(ind));\n const valuesAccessor = doc.createAccessor('merge to')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(val));\n manifoldPrimitive.setMerge(indicesAccessor, valuesAccessor);\n }\n\n return mesh;\n}\n\n/**\n * Helper function to dispose of a Mesh, useful when replacing an existing Mesh\n * with one from writeMesh.\n */\nexport function disposeMesh(mesh: Mesh) {\n if (!mesh) return;\n const primitives = mesh.listPrimitives();\n for (const primitive of primitives) {\n primitive.getIndices()?.dispose();\n for (const accessor of primitive.listAttributes()) {\n accessor.dispose();\n }\n }\n\n const manifoldPrimitive =\n mesh.getExtension('EXT_mesh_manifold') as ManifoldPrimitive;\n if (manifoldPrimitive) {\n manifoldPrimitive.getIndices()?.dispose();\n manifoldPrimitive.getMergeIndices()?.dispose();\n manifoldPrimitive.getMergeValues()?.dispose();\n }\n\n mesh.dispose();\n}\n\n/**\n * Helper function to download an image and apply it to the given texture.\n *\n * @param texture The texture to update\n * @param uri The location of the image to download\n */\nexport async function loadTexture(texture: Texture, uri: string) {\n const response = await fetch(uri);\n const blob = await response.blob();\n texture.setMimeType(blob.type);\n texture.setImage(new Uint8Array(await blob.arrayBuffer()));\n}\n\nfunction writeProperties(\n vertProperties: number[], accessor: Accessor, numProp: number,\n offset: number) {\n const array = accessor.getArray()!;\n const size = accessor.getElementSize();\n const numVert = accessor.getCount();\n for (let i = 0; i < numVert; ++i) {\n for (let j = 0; j < size; ++j) {\n vertProperties[numProp * i + offset + j] = array[i * size + j];\n }\n }\n}\n\nfunction readPrimitive(\n primitive: Primitive, numProp: number, attributes: Attribute[]) {\n const vertProperties: number[] = [];\n let offset = 0;\n for (const attribute of attributes) {\n const size = attributeDefs[attribute].components;\n if (attributeDefs[attribute].type == null) {\n offset += size;\n continue;\n }\n const accessor = primitive.getAttribute(attribute);\n if (accessor) {\n writeProperties(vertProperties, accessor, numProp, offset);\n }\n offset += size;\n }\n return vertProperties;\n}"],"names":["EventDispatcher","type","listener","listeners","listenerArray","index","event","array","i","l","key","GraphEdge","_name","_parent","_child","_attributes","child","Graph","args","node","edge","filter","edges","name","a","b","attributes","parent","_extends","target","source","isRef","value","isRefList","isRefMap","isPlainObject","getFirstValue","$attributes","$immutableKeys","GraphNode","graph","defaultAttributes","ref","other","old","replacement","attribute","refAttributes","refMap","prevRef","refs","metadata","u","c","h","f","d","g","t","p","m","w","y","v","r","n","o","T","s","x","A","E","e","S","M","I","R","N","O","C","F","U","B","P","L","j","D","_","k","z","G","J","$","V","W","q$1","q","H","Y","Z","Q","K","X$1","tt","et","rt","st$1","st","nt","it","ot","at","ut","ct","ht$1","ht","ft","dt$1","dt","gt$1","pt","wt","yt$1","vt$1","mt","lt","yt","X","Tt","vt","gt","bt","At","xt","St","Mt","It","Rt","Rt$1","Nt","Ot","Ct","Ft","Ut$1","Bt","Pt$1","Lt","Et","Ut","Pt","iota","result","iota_1","isBuffer_1","obj","isBuffer","isSlowBuffer","require$$0","require$$1","hasTypedArrays","compare1st","order","stride","terms","compileConstructor","dtype","dimension","className","useGetters","code","procedure","CACHED_CONSTRUCTORS","indices","index_str","shapeArg","strideArg","a_vars","c_vars","tShape","tStride","idx","arrayDType","data","wrappedNDArrayCtor","shape","offset","ctor","sz","ctor_list","ndarray","unique_pred","list","compare","ptr","len","unique_eq","unique","sorted","uniq","innerFill","proc","body","nargs","has_index","vars","pidx","outerFill","matched","blockSize","indexStr","countMatches","orders","processBlock","block","dtypes","pre","post","carg","re","ptrStr","arrNum","offArgIndex","offArg","localStr","arrStr","reStrArr","ptrStrArr","typeSummary","summary","allEqual","digits","generateCWiseOp","typesig","blockBegin","blockEnd","loopBegin","loopEnd","loopOrders","newOrder","arglist","zeros","off_arg","init_string","thisVars","loopName","compile","createThunk","thunkName","string_typesig","proc_args","shapeLengthConditions","shapeConditions","thunk","Procedure","compileCwise","user_args","arg_type","compiler","EmptyProc","fixup","pcompile","makeOp","wrapper","assign_ops","id","op","exports","unary_ops","binary_ops","math_unary","math_comm","math_noncomm","getPixelsInternal","buffer","mimeType","blob","path","resolve","reject","img","canvas","context","pixels","err","getPixels","$t","zt","kt","_t","Gt","qt","Wt","Dt","Ht","jt","Xt","Kt","Yt","oe","ne","te","Jt","Zt","Qt","ee","ie","ae","ce","le","ge","ue","fe","Ee","Se","Me","En","so","io","ao","co","lo","go","uo","fo","vo","NAME","MERGE","ManifoldPrimitive","ExtensionProperty","PropertyType","indicesAccessor","valuesAccessor","runIndex","EXTManifold","Extension","json","meshDef","meshIndex","mesh","manifoldPrimitive","manifoldDef","count","primitive","WriterContext","mergeFrom","mergeTo","numPrimitive","mergeIndicesIndex","mergeValuesIndex","mergeIndices","mergeValues","existingPrimitive","accessor","attributeDefs","Accessor","setupIO","readMesh","primitives","attributeSet","semantics","semantic","numProp","attributeOffsets","def","last","vertPropArray","triVertArray","runIndexArray","mergeFromVertArray","mergeToVertArray","runProperties","numVert","foundAttribute","attributesIn","attributeOut","attributeIn","writeProperties","mergeTriVert","vert2merge","from","to","readPrimitive","vertProperties","triVerts","mergeFromVert","mergeToVert","writeMesh","doc","manifoldMesh","id2properties","manifoldExtension","attributeUnion","primitive2attributes","numRun","lastID","run","properties","material","size","unionSize","aIdx","ind","val","vert","newVert","disposeMesh"],"mappings":"AAAA,MAAMA,EAAgB,CACpB,aAAc,CACZ,KAAK,WAAa,EACnB,CAED,iBAAiBC,EAAMC,EAAU,CAC/B,MAAMC,EAAY,KAAK,WAEvB,OAAIA,EAAUF,CAAI,IAAM,SACtBE,EAAUF,CAAI,EAAI,IAGhBE,EAAUF,CAAI,EAAE,QAAQC,CAAQ,IAAM,IACxCC,EAAUF,CAAI,EAAE,KAAKC,CAAQ,EAGxB,IACR,CAED,oBAAoBD,EAAMC,EAAU,CAClC,GAAI,KAAK,aAAe,OAAW,OAAO,KAE1C,MAAME,EADY,KAAK,WACSH,CAAI,EAEpC,GAAIG,IAAkB,OAAW,CAC/B,MAAMC,EAAQD,EAAc,QAAQF,CAAQ,EAExCG,IAAU,IACZD,EAAc,OAAOC,EAAO,CAAC,CAEhC,CAED,OAAO,IACR,CAED,cAAcC,EAAO,CACnB,GAAI,KAAK,aAAe,OAAW,OAAO,KAE1C,MAAMF,EADY,KAAK,WACSE,EAAM,IAAI,EAE1C,GAAIF,IAAkB,OAAW,CAE/B,MAAMG,EAAQH,EAAc,MAAM,CAAC,EAEnC,QAASI,EAAI,EAAGC,EAAIF,EAAM,OAAQC,EAAIC,EAAGD,IACvCD,EAAMC,CAAC,EAAE,KAAK,KAAMF,CAAK,CAE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AAGA,EAAI2W,EAAS,EAAE3W,EAC7B,QAAS6E,EAAI,EAAGA,EAAIyT,EAAM,EAAEzT,EACXyS,EAAArB,EAAUjW,EAAIiL,EAASpG,CAAC,EAAI9E,EAAMC,EAAIsY,EAAOzT,CAAC,CAGnE,CAEA,SAASwS,GACLvC,EAAsBmB,EAAiB/U,EAAyB,CAClE,MAAMoW,EAA2B,CAAA,EACjC,IAAIrM,EAAS,EACb,UAAW3I,KAAapB,EAAY,CAC5B,MAAAoX,EAAO7C,EAAcnT,CAAS,EAAE,WACtC,GAAImT,EAAcnT,CAAS,EAAE,MAAQ,KAAM,CAC/B2I,GAAAqN,EACV,QACF,CACM,MAAA9C,EAAWV,EAAU,aAAaxS,CAAS,EAC7CkT,GACcwB,GAAAM,EAAgB9B,EAAUS,EAAShL,CAAM,EAEjDA,GAAAqN,CACZ,CACO,OAAAhB,CACT","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11]} \ No newline at end of file diff --git a/assets/index.css b/assets/index.css new file mode 100644 index 000000000..315e368c5 --- /dev/null +++ b/assets/index.css @@ -0,0 +1 @@ +html{height:100%}body{margin:0;height:100%;font-family:Rubik,sans-serif;font-size:24px;line-height:24px;font-weight:800;-webkit-font-smoothing:antialiased}button{display:block;padding:0 1em;cursor:pointer;height:36px;border:none;border-radius:18px;font-family:Rubik,sans-serif;font-size:16px;line-height:24px;font-weight:800;text-align:left;-webkit-font-smoothing:antialiased}a:link,a:visited{color:#000;text-decoration:underline}a:hover,a:active{color:#000;text-decoration:none}button:disabled{color:#000;background-color:#eee!important;cursor:auto}button:hover{filter:brightness(.9)}.name{border:none;height:36px;background-color:transparent;font-family:Rubik,sans-serif;font-size:16px;line-height:24px;font-weight:800;text-align:left;-webkit-font-smoothing:antialiased}.name:focus{outline:none}p{margin:18px;text-align:left}model-viewer{position:relative;flex:3;width:100%;background-color:#ddd}#console{flex:1;min-height:0;max-height:25vh;overflow-y:scroll;background-color:#eee;white-space:pre-wrap;font-size:14px;font-weight:100;line-height:20px;padding:8px}.page{height:100vh;display:flex;flex-direction:column}.container{display:flex}.col{position:relative;width:50vw}.center{position:absolute;left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.header .margin{font-size:16px;margin:18px 8px}.dropdown{display:none;position:absolute;z-index:1;width:100%;max-height:80vh;overflow-y:auto}.show{display:block}.hide{display:none}.uparrow{display:inline-block;position:relative;border:solid black;border-width:0 3px 3px 0;padding:3px;transform:rotate(-135deg)}.down{transform:rotate(45deg)}.item{width:100%;position:relative}.top-edit{display:inline-block;vertical-align:middle;height:36px;top:18px;border:none;border-radius:18px}.top-icon{display:inline-block;vertical-align:middle;width:36px;background-size:24px;background-repeat:no-repeat;background-position:center;background-color:transparent}.squish{margin-right:-12px}.icon{display:inline-block;background-color:transparent;position:absolute;width:36px;top:0;right:0;background-size:20px;background-repeat:no-repeat;background-position:center}.undo{background-image:url(/icons/undo.png)}.redo{background-image:url(/icons/redo.png)}.star{background-image:url(/icons/star.png)}.share{background-image:url(/icons/share.png)}.cancel{background-image:url(/icons/close.png);background-size:20px;background-repeat:no-repeat;background-position:center}.edit{background-image:url(/icons/pencil.png);right:30px}.trash{background-image:url(/icons/trash.png)}.play{background-image:url(/icons/play.png)}.pause{background-image:url(/icons/pause.png)}.icon:hover,.top-icon:hover{background-color:#0003}.blue{background-color:#94ddff}.green{background-color:#83ff83}.red{background-color:#ffb1b1}#file-margin{position:relative;width:250px}#save{width:125px}#animation{display:none;align-items:center;position:absolute;width:100%;bottom:0;margin:2px}#play{position:relative;background-color:#ccc;margin:8px}.slider{position:relative;-webkit-appearance:none;appearance:none;width:100%;height:10px;border-radius:5px;margin-right:16px;background:#ffffff55;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;border-radius:50%;background:#ccc;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#ccc;cursor:pointer}@media only screen and (max-width: 820px){.container{flex-direction:column;width:100%}.col{width:100%;height:50%}#file-margin{width:calc(100% - 32px)}p{margin:.2em 1em;text-align:center}.header .margin{margin:.2em 16px}#button-container{flex-direction:row;margin-left:8px;margin-right:8px;width:calc(100% - 16px)}#button-container .margin{width:calc(50% - 16px);margin:8px}} diff --git a/assets/makeManifold.js b/assets/makeManifold.js new file mode 100644 index 000000000..241aefbc1 --- /dev/null +++ b/assets/makeManifold.js @@ -0,0 +1,2 @@ +import"./modulepreload-polyfill.js";import{Q as te,h as j,n as ae,b as Z,E as Te,c as er,I as Mt,a as Zt,d as kt,T as ti,S as Ee,L as ut,i as he,v as ni,e as ri,t as ii,f as De,s as si,_ as oi,r as ai,g as ci,w as ui,z as li}from"./gltf-io.js";import{M as fi}from"./manifold.js";const di=0,hi=0,pi=0,xi=2,gi=0,_i=163,mi=166,Ti=0,yi=2,wi=1,bi=64,Ei=0;class Ii{constructor(){this.vkFormat=Ei,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=di,this.levels=[],this.dataFormatDescriptor=[{vendorId:pi,descriptorType:hi,descriptorBlockSize:0,versionNumber:xi,colorModel:gi,colorPrimaries:wi,transferFunction:yi,flags:Ti,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class tt{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*t;return this._offset+=8,n}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r{if(!t.extensions||!t.extensions[Me])return;const r=t.extensions[Me],s=this.createInstancedMesh();for(const o in r.attributes)s.setAttribute(o,e.accessors[r.attributes[o]]);e.nodes[n].setExtension(Me,s)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(Ut);for(const t of this.properties)for(const n of t.listAttributes())e.addAccessorToUsageGroup(n,Ut);return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listNodes().forEach(n=>{const r=n.getExtension(Me);if(r){const s=e.nodeIndexMap.get(n),o=t.json.nodes[s],a={attributes:{}};r.listSemantics().forEach(f=>{const d=r.getAttribute(f);a.attributes[f]=e.accessorIndexMap.get(d)}),o.extensions=o.extensions||{},o.extensions[Me]=a}}),this}};function Re(){return Re=Object.assign?Object.assign.bind():function(i){for(var e=1;e8?8:4,o.componentType=s>8?En:vi,o.normalized=!0,a=i.getElementSize()===3?function(f){const d=new Float32Array(4*f.length/3);for(let p=0,m=f.length/3;pAt(f,i.getComponentType())),o.max=o.max.map(f=>At(f,i.getComponentType()))),o.normalized&&(o.min=o.min.map(f=>In(f,o.componentType)),o.max=o.max.map(f=>In(f,o.componentType)))}else o.byteStride%4&&(o.array=function(a,f){const d=Te.padNumber(a.BYTES_PER_ELEMENT*f)/a.BYTES_PER_ELEMENT,p=new a.constructor(a.length/f*d);for(let m=0;m*ft instanceof kt&&t.getMode()===kt.Mode.TRIANGLES)?qe.TRIANGLES:qe.INDICES:qe.ATTRIBUTES}function Si(i,e){const t=e.getGraph().listParentEdges(i).filter(n=>!(n.getParent()instanceof ni));for(const n of t){const r=n.getName(),s=n.getAttributes().key||"",o=n.getParent().propertyType===j.PRIMITIVE_TARGET;if(r==="indices")return{filter:Q.NONE};if(r==="attributes"){if(s==="POSITION")return{filter:Q.NONE};if(s==="TEXCOORD_0")return{filter:Q.NONE};if(s.startsWith("JOINTS_"))return{filter:Q.NONE};if(s.startsWith("WEIGHTS_"))return{filter:Q.NONE};if(s==="NORMAL"||s==="TANGENT")return o?{filter:Q.NONE}:{filter:Q.OCTAHEDRAL,bits:8}}if(r==="output"){const a=ir(i);return a==="rotation"?{filter:Q.QUATERNION,bits:16}:a==="translation"||a==="scale"?{filter:Q.EXPONENTIAL,bits:12}:{filter:Q.NONE}}if(r==="input")return{filter:Q.NONE};if(r==="inverseBindMatrices")return{filter:Q.NONE}}return{filter:Q.NONE}}function ir(i){for(const e of i.listParents())if(e instanceof ri){for(const t of e.listParents())if(t instanceof ii)return t.getTargetPath()}return null}const fe=Ct,vn={method:at.QUANTIZE};let Ot=class extends Z{constructor(...e){super(...e),this.extensionName=fe,this.prereadTypes=[j.BUFFER,j.PRIMITIVE],this.prewriteTypes=[j.BUFFER,j.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=vn,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(e,t){return e==="meshopt.decoder"&&(this._decoder=t),e==="meshopt.encoder"&&(this._encoder=t),this}setEncoderOptions(e){return this._encoderOptions=Re({},vn,e),this}preread(e,t){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${fe}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${fe}]: Missing WASM support.`)}return t===j.BUFFER?this._prereadBuffers(e):t===j.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach((n,r)=>{if(!n.extensions||!n.extensions[fe])return;const s=n.extensions[fe],o=s.byteOffset||0,a=s.byteLength||0,f=s.count,d=s.byteStride,p=new Uint8Array(f*d),m=t.json.buffers[s.buffer],w=Te.toView(m.uri?t.resources[m.uri]:t.resources[er],o,a);this._decoder.decodeGltfBuffer(p,f,d,w,s.mode,s.filter),e.bufferViews[r]=p})}_prereadPrimitives(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach(n=>{var r;n.extensions&&n.extensions[fe]&&(r=t.json.buffers[n.buffer]).extensions&&r.extensions[Ct]&&r.extensions[Ct].fallback&&this._decoderFallbackBufferMap.set(e.buffers[n.buffer],e.buffers[n.extensions[fe].buffer])})}read(e){if(!this.isRequired())return this;for(const[t,n]of this._decoderFallbackBufferMap){for(const r of t.listParents())r instanceof te&&r.swap(t,n);t.dispose()}return this}prewrite(e,t){return t===j.ACCESSOR?this._prewriteAccessors(e):t===j.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const t=e.jsonDoc.json,n=this._encoder,r=this._encoderOptions,s=this.document.createBuffer(),o=this.document.getRoot().listBuffers().indexOf(s);this._encoderFallbackBuffer=s,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const a of this.document.getRoot().listAccessors()){if(ir(a)==="weights"||a.getSparse())continue;const f=e.getAccessorUsage(a),d=Ni(a,f),p=r.method===at.FILTER?Si(a,this.document):{filter:Q.NONE},m=Ai(a,n,d,p),{array:w,byteStride:b}=m,l=a.getBuffer();if(!l)throw new Error(`${fe}: Missing buffer for accessor.`);const _=this.document.getRoot().listBuffers().indexOf(l),c=[f,d,p.filter,b,_].join(":");let u=this._encoderBufferViews[c],x=this._encoderBufferViewData[c],g=this._encoderBufferViewAccessors[c];u&&x||(g=this._encoderBufferViewAccessors[c]=[],x=this._encoderBufferViewData[c]=[],u=this._encoderBufferViews[c]={buffer:o,target:Mt.USAGE_TO_TARGET[f],byteOffset:0,byteLength:0,byteStride:f===Mt.BufferViewUsage.ARRAY_BUFFER?b:void 0,extensions:{[fe]:{buffer:_,byteOffset:0,byteLength:0,mode:d,filter:p.filter!==Q.NONE?p.filter:void 0,byteStride:b,count:0}}});const h=e.createAccessorDef(a);h.componentType=m.componentType,h.normalized=m.normalized,h.byteOffset=u.byteLength,h.min&&m.min&&(h.min=m.min),h.max&&m.max&&(h.max=m.max),e.accessorIndexMap.set(a,t.accessors.length),t.accessors.push(h),g.push(h),x.push(new Uint8Array(w.buffer,w.byteOffset,w.byteLength)),u.byteLength+=w.byteLength,u.extensions.EXT_meshopt_compression.count+=a.getCount()}}_prewriteBuffers(e){const t=this._encoder;for(const n in this._encoderBufferViews){const r=this._encoderBufferViews[n],s=this._encoderBufferViewData[n],o=this.document.getRoot().listBuffers()[r.extensions[fe].buffer],a=e.otherBufferViews.get(o)||[],{count:f,byteStride:d,mode:p}=r.extensions[fe],m=Te.concat(s),w=t.encodeGltfBuffer(m,f,d,p),b=Te.pad(w);r.extensions[fe].byteLength=w.byteLength,s.length=0,s.push(b),a.push(b),e.otherBufferViews.set(o,a)}}write(e){let t=0;for(const o in this._encoderBufferViews){const a=this._encoderBufferViews[o],f=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[o][0]),d=this._encoderBufferViewAccessors[o];for(const w of d)w.bufferView=f;const p=e.jsonDoc.json.bufferViews[f],m=p.byteOffset||0;Object.assign(p,a),p.byteOffset=t,p.extensions[fe].byteOffset=m,t+=Te.padNumber(a.byteLength)}const n=this._encoderFallbackBuffer,r=e.bufferIndexMap.get(n),s=e.jsonDoc.json.buffers[r];return s.byteLength=t,s.extensions={[fe]:{fallback:!0}},n.dispose(),this}};Ot.EXTENSION_NAME=fe,Ot.EncoderMethod=at;const rt="EXT_texture_avif";let Di=class{match(e){return e.length>=12&&Te.decodeText(e.slice(4,12))==="ftypavif"}getSize(e){if(!this.match(e))return null;const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=Rn(t,0);if(!n)return null;let r=n.end;for(;n=Rn(t,r);)if(n.type==="meta")r=n.start+4;else if(n.type==="iprp"||n.type==="ipco")r=n.start;else{if(n.type==="ispe")return[t.getUint32(n.start+4),t.getUint32(n.start+8)];if(n.type==="mdat")break;r=n.end}return null}getChannels(e){return 4}},sr=class extends Z{constructor(...e){super(...e),this.extensionName=rt,this.prereadTypes=[j.TEXTURE]}static register(){Zt.registerFormat("image/avif",new Di)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(t=>{t.extensions&&t.extensions[rt]&&(t.source=t.extensions[rt].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/avif"){const r=e.imageIndexMap.get(n);(t.json.textures||[]).forEach(s=>{s.source===r&&(s.extensions=s.extensions||{},s.extensions[rt]={source:s.source},delete s.source)})}}),this}};function Rn(i,e){if(i.byteLength<4+e)return null;const t=i.getUint32(e);return i.byteLength=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80}getSize(e){const t=Te.decodeText(e.slice(0,4)),n=Te.decodeText(e.slice(8,12));if(t!=="RIFF"||n!=="WEBP")return null;const r=new DataView(e.buffer,e.byteOffset);let s=12;for(;s>6)]}s+=8+a+a%2}return null}getChannels(e){return 4}},or=class extends Z{constructor(...e){super(...e),this.extensionName=it,this.prereadTypes=[j.TEXTURE]}static register(){Zt.registerFormat("image/webp",new Mi)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(t=>{t.extensions&&t.extensions[it]&&(t.source=t.extensions[it].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/webp"){const r=e.imageIndexMap.get(n);(t.json.textures||[]).forEach(s=>{s.source===r&&(s.extensions=s.extensions||{},s.extensions[it]={source:s.source},delete s.source)})}}),this}};or.EXTENSION_NAME=it;const An=tr;let re,ar,cr,xe;function ki(i,e){const t=new re.DecoderBuffer;try{if(t.Init(e,e.length),i.GetEncodedGeometryType(t)!==re.TRIANGULAR_MESH)throw new Error(`[${An}] Unknown geometry type.`);const n=new re.Mesh;if(!i.DecodeBufferToMesh(t,n).ok()||n.ptr===0)throw new Error(`[${An}] Decoding failure.`);return n}finally{re.destroy(t)}}function Ci(i,e){const t=3*e.num_faces();let n,r;if(e.num_points()<=65534){const s=t*Uint16Array.BYTES_PER_ELEMENT;n=re._malloc(s),i.GetTrianglesUInt16Array(e,s,n),r=new Uint16Array(re.HEAPU16.buffer,n,t).slice()}else{const s=t*Uint32Array.BYTES_PER_ELEMENT;n=re._malloc(s),i.GetTrianglesUInt32Array(e,s,n),r=new Uint32Array(re.HEAPU32.buffer,n,t).slice()}return re._free(n),r}function Ui(i,e,t,n){const r=cr[n.componentType],s=ar[n.componentType],o=t.num_components(),a=e.num_points()*o,f=a*s.BYTES_PER_ELEMENT,d=re._malloc(f);i.GetAttributeDataArrayForAllPoints(e,t,r,f,d);const p=new s(re.HEAPF32.buffer,d,a).slice();return re._free(d),p}var ct,ge;(function(i){i[i.EDGEBREAKER=1]="EDGEBREAKER",i[i.SEQUENTIAL=0]="SEQUENTIAL"})(ct||(ct={})),function(i){i.POSITION="POSITION",i.NORMAL="NORMAL",i.COLOR="COLOR",i.TEX_COORD="TEX_COORD",i.GENERIC="GENERIC"}(ge||(ge={}));const ur={[ge.POSITION]:14,[ge.NORMAL]:10,[ge.COLOR]:8,[ge.TEX_COORD]:12,[ge.GENERIC]:12},Nn={decodeSpeed:5,encodeSpeed:5,method:ct.EDGEBREAKER,quantizationBits:ur,quantizationVolume:"mesh"};function Oi(i,e=Nn){const t=Re({},Nn,e);t.quantizationBits=Re({},ur,e.quantizationBits);const n=new xe.MeshBuilder,r=new xe.Mesh,s=new xe.ExpertEncoder(r),o={},a=new xe.DracoInt8Array,f=i.listTargets().length>0;let d=!1;for(const _ of i.listSemantics()){const c=i.getAttribute(_);if(c.getSparse()){d=!0;continue}const u=Fi(_),x=Bi(n,c.getComponentType(),r,xe[u],c.getCount(),c.getElementSize(),c.getArray());if(x===-1)throw new Error(`Error compressing "${_}" attribute.`);if(o[_]=x,t.quantizationVolume==="mesh"||_!=="POSITION")s.SetAttributeQuantization(x,t.quantizationBits[u]);else{if(typeof t.quantizationVolume!="object")throw new Error("Invalid quantization volume state.");{const{quantizationVolume:g}=t,h=Math.max(g.max[0]-g.min[0],g.max[1]-g.min[1],g.max[2]-g.min[2]);s.SetAttributeExplicitQuantization(x,t.quantizationBits[u],c.getElementSize(),g.min,h)}}}const p=i.getIndices();if(!p)throw new Ft("Primitive must have indices.");n.AddFacesToMesh(r,p.getCount()/3,p.getArray()),s.SetSpeedOptions(t.encodeSpeed,t.decodeSpeed),s.SetTrackEncodedProperties(!0),s.SetEncodingMethod(t.method===ct.SEQUENTIAL||f||d?xe.MESH_SEQUENTIAL_ENCODING:xe.MESH_EDGEBREAKER_ENCODING);const m=s.EncodeToDracoBuffer(!(f||d),a);if(m<=0)throw new Ft("Error applying Draco compression.");const w=new Uint8Array(m);for(let _=0;_x.propertyType));if(u.size!==2||!u.has(j.PRIMITIVE)||!u.has(j.ROOT))throw new Error(`[${Y}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const c of Array.from(d)){const u=_.get(c),x=c.getIndices();if(b.get(x)!==u||c.listAttributes().some(g=>b.get(g)!==u))throw new Error(`[${Y}] Draco primitives must share all, or no, accessors.`)}for(const c of Array.from(p)){const u=c.getIndices();if(b.has(u)||c.listAttributes().some(x=>b.has(x)))throw new Error(`[${Y}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return _}(this.document),s=new Map;let o="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?n.warn(`[${Y}]: quantizationVolume=scene requires exactly 1 scene.`):o=ti(this.document.getRoot().listScenes().pop()));for(const a of Array.from(r.keys())){const f=r.get(a);if(!f)throw new Error("Unexpected primitive.");if(s.has(f)){s.set(f,s.get(f));continue}const d=a.getIndices(),p=e.jsonDoc.json.accessors;let m;try{m=Oi(a,Re({},this._encoderOptions,{quantizationVolume:o}))}catch(l){if(l instanceof Ft){n.warn(`[${Y}]: ${l.message} Skipping primitive compression.`);continue}throw l}s.set(f,m);const w=e.createAccessorDef(d);w.count=m.numIndices,e.accessorIndexMap.set(d,p.length),p.push(w);for(const l of a.listSemantics()){const _=a.getAttribute(l);if(m.attributeIDs[l]===void 0)continue;const c=e.createAccessorDef(_);c.count=m.numVertices,e.accessorIndexMap.set(_,p.length),p.push(c)}const b=a.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(b)||e.otherBufferViews.set(b,[]),e.otherBufferViews.get(b).push(m.data)}return n.debug(`[${Y}] Compressed ${r.size} primitives.`),e.extensionData[Y]={primitiveHashMap:r,primitiveEncodingMap:s},this}write(e){const t=e.extensionData[Y];for(const n of this.document.getRoot().listMeshes()){const r=e.jsonDoc.json.meshes[e.meshIndexMap.get(n)];for(let s=0;sr!==Y),n.extensionsRequired=(n.extensionsRequired||[]).filter(r=>r!==Y)}return this}}function Sn(i,e){const t=[],n=i.getIndices();t.push(e.get(n));for(const r of i.listAttributes())t.push(e.get(r));return t.sort().join("|")}Bt.EXTENSION_NAME=Y,Bt.EncoderMethod=ct;let Tt=class lr extends ae{init(){this.extensionName=Qt,this.propertyType="Light",this.parentTypes=[j.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:lr.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getColorHex(){return Ee.factorToHex(this.getColor())}setColorHex(e){const t=this.getColor().slice();return Ee.hexToFactor(e,t),this.setColor(t)}getIntensity(){return this.get("intensity")}setIntensity(e){return this.set("intensity",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getRange(){return this.get("range")}setRange(e){return this.set("range",e)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(e){return this.set("innerConeAngle",e)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(e){return this.set("outerConeAngle",e)}};Tt.EXTENSION_NAME=Qt,Tt.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};const we=Qt;let fr=class extends Z{constructor(...e){super(...e),this.extensionName=we}createLight(e=""){return new Tt(this.document.getGraph(),e)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[we])return this;const n=(t.json.extensions[we].lights||[]).map(r=>{var s,o;const a=this.createLight().setName(r.name||"").setType(r.type);return r.color!==void 0&&a.setColor(r.color),r.intensity!==void 0&&a.setIntensity(r.intensity),r.range!==void 0&&a.setRange(r.range),((s=r.spot)==null?void 0:s.innerConeAngle)!==void 0&&a.setInnerConeAngle(r.spot.innerConeAngle),((o=r.spot)==null?void 0:o.outerConeAngle)!==void 0&&a.setOuterConeAngle(r.spot.outerConeAngle),a});return t.json.nodes.forEach((r,s)=>{r.extensions&&r.extensions[we]&&e.nodes[s].setExtension(we,n[r.extensions[we].light])}),this}write(e){const t=e.jsonDoc;if(this.properties.size===0)return this;const n=[],r=new Map;for(const s of this.properties){const o=s,a={type:o.getType()};ut.eq(o.getColor(),[1,1,1])||(a.color=o.getColor()),o.getIntensity()!==1&&(a.intensity=o.getIntensity()),o.getRange()!=null&&(a.range=o.getRange()),o.getName()&&(a.name=o.getName()),o.getType()===Tt.Type.SPOT&&(a.spot={innerConeAngle:o.getInnerConeAngle(),outerConeAngle:o.getOuterConeAngle()}),n.push(a),r.set(o,n.length-1)}return this.document.getRoot().listNodes().forEach(s=>{const o=s.getExtension(we);if(o){const a=e.nodeIndexMap.get(s),f=t.json.nodes[a];f.extensions=f.extensions||{},f.extensions[we]={light:r.get(o)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[we]={lights:n},this}};fr.EXTENSION_NAME=we;const{R:Li,G:ji,B:zi}=De;class dr extends ae{init(){this.extensionName=Jt,this.propertyType="Anisotropy",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new he(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(e){return this.set("anisotropyStrength",e)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(e){return this.set("anisotropyRotation",e)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(e){return this.setRef("anisotropyTexture",e,{channels:Li|ji|zi})}}dr.EXTENSION_NAME=Jt;const ke=Jt;class hr extends Z{constructor(...e){super(...e),this.extensionName=ke}createAnisotropy(){return new dr(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[ke]){const o=this.createAnisotropy();e.materials[s].setExtension(ke,o);const a=r.extensions[ke];if(a.anisotropyStrength!==void 0&&o.setAnisotropyStrength(a.anisotropyStrength),a.anisotropyRotation!==void 0&&o.setAnisotropyRotation(a.anisotropyRotation),a.anisotropyTexture!==void 0){const f=a.anisotropyTexture;o.setAnisotropyTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getAnisotropyTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(ke);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[ke]={};if(r.getAnisotropyStrength()>0&&(a.anisotropyStrength=r.getAnisotropyStrength()),r.getAnisotropyRotation()!==0&&(a.anisotropyRotation=r.getAnisotropyRotation()),r.getAnisotropyTexture()){const f=r.getAnisotropyTexture(),d=r.getAnisotropyTextureInfo();a.anisotropyTexture=e.createTextureInfoDef(f,d)}}}),this}}hr.EXTENSION_NAME=ke;const{R:Dn,G:Mn,B:Pi}=De;class pr extends ae{init(){this.extensionName=en,this.propertyType="Clearcoat",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new he(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new he(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new he(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(e){return this.set("clearcoatFactor",e)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(e){return this.setRef("clearcoatTexture",e,{channels:Dn})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(e){return this.set("clearcoatRoughnessFactor",e)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(e){return this.setRef("clearcoatRoughnessTexture",e,{channels:Mn})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(e){return this.set("clearcoatNormalScale",e)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(e){return this.setRef("clearcoatNormalTexture",e,{channels:Dn|Mn|Pi})}}pr.EXTENSION_NAME=en;const Ce=en;class xr extends Z{constructor(...e){super(...e),this.extensionName=Ce}createClearcoat(){return new pr(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[Ce]){const o=this.createClearcoat();e.materials[s].setExtension(Ce,o);const a=r.extensions[Ce];if(a.clearcoatFactor!==void 0&&o.setClearcoatFactor(a.clearcoatFactor),a.clearcoatRoughnessFactor!==void 0&&o.setClearcoatRoughnessFactor(a.clearcoatRoughnessFactor),a.clearcoatTexture!==void 0){const f=a.clearcoatTexture;o.setClearcoatTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getClearcoatTextureInfo(),f)}if(a.clearcoatRoughnessTexture!==void 0){const f=a.clearcoatRoughnessTexture;o.setClearcoatRoughnessTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),f)}if(a.clearcoatNormalTexture!==void 0){const f=a.clearcoatNormalTexture;o.setClearcoatNormalTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getClearcoatNormalTextureInfo(),f),f.scale!==void 0&&o.setClearcoatNormalScale(f.scale)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Ce);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[Ce]={clearcoatFactor:r.getClearcoatFactor(),clearcoatRoughnessFactor:r.getClearcoatRoughnessFactor()};if(r.getClearcoatTexture()){const f=r.getClearcoatTexture(),d=r.getClearcoatTextureInfo();a.clearcoatTexture=e.createTextureInfoDef(f,d)}if(r.getClearcoatRoughnessTexture()){const f=r.getClearcoatRoughnessTexture(),d=r.getClearcoatRoughnessTextureInfo();a.clearcoatRoughnessTexture=e.createTextureInfoDef(f,d)}if(r.getClearcoatNormalTexture()){const f=r.getClearcoatNormalTexture(),d=r.getClearcoatNormalTextureInfo();a.clearcoatNormalTexture=e.createTextureInfoDef(f,d),r.getClearcoatNormalScale()!==1&&(a.clearcoatNormalTexture.scale=r.getClearcoatNormalScale())}}}),this}}xr.EXTENSION_NAME=Ce;class gr extends ae{init(){this.extensionName=tn,this.propertyType="EmissiveStrength",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(e){return this.set("emissiveStrength",e)}}gr.EXTENSION_NAME=tn;const Ue=tn;class _r extends Z{constructor(...e){super(...e),this.extensionName=Ue}createEmissiveStrength(){return new gr(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Ue]){const r=this.createEmissiveStrength();e.materials[n].setExtension(Ue,r);const s=t.extensions[Ue];s.emissiveStrength!==void 0&&r.setEmissiveStrength(s.emissiveStrength)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Ue);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{},o.extensions[Ue]={emissiveStrength:r.getEmissiveStrength()}}}),this}}_r.EXTENSION_NAME=Ue;class mr extends ae{init(){this.extensionName=nn,this.propertyType="IOR",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(e){return this.set("ior",e)}}mr.EXTENSION_NAME=nn;const Oe=nn;class Tr extends Z{constructor(...e){super(...e),this.extensionName=Oe}createIOR(){return new mr(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Oe]){const r=this.createIOR();e.materials[n].setExtension(Oe,r);const s=t.extensions[Oe];s.ior!==void 0&&r.setIOR(s.ior)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Oe);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{},o.extensions[Oe]={ior:r.getIOR()}}}),this}}Tr.EXTENSION_NAME=Oe;const{R:Gi,G:$i}=De;class yr extends ae{init(){this.extensionName=rn,this.propertyType="Iridescence",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new he(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new he(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(e){return this.set("iridescenceFactor",e)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(e){return this.setRef("iridescenceTexture",e,{channels:Gi})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(e){return this.set("iridescenceIOR",e)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(e){return this.set("iridescenceThicknessMinimum",e)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(e){return this.set("iridescenceThicknessMaximum",e)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(e){return this.setRef("iridescenceThicknessTexture",e,{channels:$i})}}yr.EXTENSION_NAME=rn;const Fe=rn;class wr extends Z{constructor(...e){super(...e),this.extensionName=Fe}createIridescence(){return new yr(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[Fe]){const o=this.createIridescence();e.materials[s].setExtension(Fe,o);const a=r.extensions[Fe];if(a.iridescenceFactor!==void 0&&o.setIridescenceFactor(a.iridescenceFactor),a.iridescenceIor!==void 0&&o.setIridescenceIOR(a.iridescenceIor),a.iridescenceThicknessMinimum!==void 0&&o.setIridescenceThicknessMinimum(a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&o.setIridescenceThicknessMaximum(a.iridescenceThicknessMaximum),a.iridescenceTexture!==void 0){const f=a.iridescenceTexture;o.setIridescenceTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getIridescenceTextureInfo(),f)}if(a.iridescenceThicknessTexture!==void 0){const f=a.iridescenceThicknessTexture;o.setIridescenceThicknessTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getIridescenceThicknessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Fe);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[Fe]={};if(r.getIridescenceFactor()>0&&(a.iridescenceFactor=r.getIridescenceFactor()),r.getIridescenceIOR()!==1.3&&(a.iridescenceIor=r.getIridescenceIOR()),r.getIridescenceThicknessMinimum()!==100&&(a.iridescenceThicknessMinimum=r.getIridescenceThicknessMinimum()),r.getIridescenceThicknessMaximum()!==400&&(a.iridescenceThicknessMaximum=r.getIridescenceThicknessMaximum()),r.getIridescenceTexture()){const f=r.getIridescenceTexture(),d=r.getIridescenceTextureInfo();a.iridescenceTexture=e.createTextureInfoDef(f,d)}if(r.getIridescenceThicknessTexture()){const f=r.getIridescenceThicknessTexture(),d=r.getIridescenceThicknessTextureInfo();a.iridescenceThicknessTexture=e.createTextureInfoDef(f,d)}}}),this}}wr.EXTENSION_NAME=Fe;const{R:kn,G:Cn,B:Un,A:On}=De;class br extends ae{init(){this.extensionName=sn,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new he(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new he(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(e){return this.set("diffuseFactor",e)}getDiffuseHex(){return Ee.factorToHex(this.getDiffuseFactor())}setDiffuseHex(e){const t=this.getDiffuseFactor().slice();return this.setDiffuseFactor(Ee.hexToFactor(e,t))}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(e){return this.setRef("diffuseTexture",e,{channels:kn|Cn|Un|On,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(e){return this.set("glossinessFactor",e)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(e){return this.setRef("specularGlossinessTexture",e,{channels:kn|Cn|Un|On})}}br.EXTENSION_NAME=sn;const Be=sn;class Er extends Z{constructor(...e){super(...e),this.extensionName=Be}createPBRSpecularGlossiness(){return new br(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[Be]){const o=this.createPBRSpecularGlossiness();e.materials[s].setExtension(Be,o);const a=r.extensions[Be];if(a.diffuseFactor!==void 0&&o.setDiffuseFactor(a.diffuseFactor),a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.glossinessFactor!==void 0&&o.setGlossinessFactor(a.glossinessFactor),a.diffuseTexture!==void 0){const f=a.diffuseTexture;o.setDiffuseTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getDiffuseTextureInfo(),f)}if(a.specularGlossinessTexture!==void 0){const f=a.specularGlossinessTexture;o.setSpecularGlossinessTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getSpecularGlossinessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Be);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[Be]={diffuseFactor:r.getDiffuseFactor(),specularFactor:r.getSpecularFactor(),glossinessFactor:r.getGlossinessFactor()};if(r.getDiffuseTexture()){const f=r.getDiffuseTexture(),d=r.getDiffuseTextureInfo();a.diffuseTexture=e.createTextureInfoDef(f,d)}if(r.getSpecularGlossinessTexture()){const f=r.getSpecularGlossinessTexture(),d=r.getSpecularGlossinessTextureInfo();a.specularGlossinessTexture=e.createTextureInfoDef(f,d)}}}),this}}Er.EXTENSION_NAME=Be;const{R:Vi,G:Hi,B:Xi,A:Wi}=De;class Ir extends ae{init(){this.extensionName=on,this.propertyType="Sheen",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new he(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new he(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}getSheenColorHex(){return Ee.factorToHex(this.getSheenColorFactor())}setSheenColorFactor(e){return this.set("sheenColorFactor",e)}setSheenColorHex(e){const t=this.getSheenColorFactor().slice();return this.set("sheenColorFactor",Ee.hexToFactor(e,t))}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(e){return this.setRef("sheenColorTexture",e,{channels:Vi|Hi|Xi,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(e){return this.set("sheenRoughnessFactor",e)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(e){return this.setRef("sheenRoughnessTexture",e,{channels:Wi})}}Ir.EXTENSION_NAME=on;const Le=on;class vr extends Z{constructor(...e){super(...e),this.extensionName=Le}createSheen(){return new Ir(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[Le]){const o=this.createSheen();e.materials[s].setExtension(Le,o);const a=r.extensions[Le];if(a.sheenColorFactor!==void 0&&o.setSheenColorFactor(a.sheenColorFactor),a.sheenRoughnessFactor!==void 0&&o.setSheenRoughnessFactor(a.sheenRoughnessFactor),a.sheenColorTexture!==void 0){const f=a.sheenColorTexture;o.setSheenColorTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getSheenColorTextureInfo(),f)}if(a.sheenRoughnessTexture!==void 0){const f=a.sheenRoughnessTexture;o.setSheenRoughnessTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getSheenRoughnessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Le);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[Le]={sheenColorFactor:r.getSheenColorFactor(),sheenRoughnessFactor:r.getSheenRoughnessFactor()};if(r.getSheenColorTexture()){const f=r.getSheenColorTexture(),d=r.getSheenColorTextureInfo();a.sheenColorTexture=e.createTextureInfoDef(f,d)}if(r.getSheenRoughnessTexture()){const f=r.getSheenRoughnessTexture(),d=r.getSheenRoughnessTextureInfo();a.sheenRoughnessTexture=e.createTextureInfoDef(f,d)}}}),this}}vr.EXTENSION_NAME=Le;const{R:Ki,G:qi,B:Zi,A:Yi}=De;class Rr extends ae{init(){this.extensionName=an,this.propertyType="Specular",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new he(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new he(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(e){return this.set("specularColorFactor",e)}getSpecularColorHex(){return Ee.factorToHex(this.getSpecularColorFactor())}setSpecularColorHex(e){const t=this.getSpecularColorFactor().slice();return this.set("specularColorFactor",Ee.hexToFactor(e,t))}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(e){return this.setRef("specularTexture",e,{channels:Yi})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(e){return this.setRef("specularColorTexture",e,{channels:Ki|qi|Zi,isColor:!0})}}Rr.EXTENSION_NAME=an;const je=an;class Ar extends Z{constructor(...e){super(...e),this.extensionName=je}createSpecular(){return new Rr(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[je]){const o=this.createSpecular();e.materials[s].setExtension(je,o);const a=r.extensions[je];if(a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.specularColorFactor!==void 0&&o.setSpecularColorFactor(a.specularColorFactor),a.specularTexture!==void 0){const f=a.specularTexture;o.setSpecularTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getSpecularTextureInfo(),f)}if(a.specularColorTexture!==void 0){const f=a.specularColorTexture;o.setSpecularColorTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getSpecularColorTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(je);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[je]={};if(r.getSpecularFactor()!==1&&(a.specularFactor=r.getSpecularFactor()),ut.eq(r.getSpecularColorFactor(),[1,1,1])||(a.specularColorFactor=r.getSpecularColorFactor()),r.getSpecularTexture()){const f=r.getSpecularTexture(),d=r.getSpecularTextureInfo();a.specularTexture=e.createTextureInfoDef(f,d)}if(r.getSpecularColorTexture()){const f=r.getSpecularColorTexture(),d=r.getSpecularColorTextureInfo();a.specularColorTexture=e.createTextureInfoDef(f,d)}}}),this}}Ar.EXTENSION_NAME=je;const{R:Qi}=De;class Nr extends ae{init(){this.extensionName=cn,this.propertyType="Transmission",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new he(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(e){return this.set("transmissionFactor",e)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(e){return this.setRef("transmissionTexture",e,{channels:Qi})}}Nr.EXTENSION_NAME=cn;const ze=cn;class Sr extends Z{constructor(...e){super(...e),this.extensionName=ze}createTransmission(){return new Nr(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[ze]){const o=this.createTransmission();e.materials[s].setExtension(ze,o);const a=r.extensions[ze];if(a.transmissionFactor!==void 0&&o.setTransmissionFactor(a.transmissionFactor),a.transmissionTexture!==void 0){const f=a.transmissionTexture;o.setTransmissionTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getTransmissionTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(ze);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[ze]={transmissionFactor:r.getTransmissionFactor()};if(r.getTransmissionTexture()){const f=r.getTransmissionTexture(),d=r.getTransmissionTextureInfo();a.transmissionTexture=e.createTextureInfoDef(f,d)}}}),this}}Sr.EXTENSION_NAME=ze;class Dr extends ae{init(){this.extensionName=un,this.propertyType="Unlit",this.parentTypes=[j.MATERIAL]}}Dr.EXTENSION_NAME=un;const We=un;class Mr extends Z{constructor(...e){super(...e),this.extensionName=We}createUnlit(){return new Dr(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,n)=>{t.extensions&&t.extensions[We]&&e.materials[n].setExtension(We,this.createUnlit())}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{if(n.getExtension(We)){const r=e.materialIndexMap.get(n),s=t.json.materials[r];s.extensions=s.extensions||{},s.extensions[We]={}}}),this}}Mr.EXTENSION_NAME=We;class kr extends ae{init(){this.extensionName=$e,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:[]})}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}addVariant(e){return this.addRef("variants",e)}removeVariant(e){return this.removeRef("variants",e)}listVariants(){return this.listRefs("variants")}}kr.EXTENSION_NAME=$e;class Cr extends ae{init(){this.extensionName=$e,this.propertyType="MappingList",this.parentTypes=[j.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:[]})}addMapping(e){return this.addRef("mappings",e)}removeMapping(e){return this.removeRef("mappings",e)}listMappings(){return this.listRefs("mappings")}}Cr.EXTENSION_NAME=$e;class Lt extends ae{init(){this.extensionName=$e,this.propertyType="Variant",this.parentTypes=["MappingList"]}}Lt.EXTENSION_NAME=$e;const be=$e;class Ur extends Z{constructor(...e){super(...e),this.extensionName=be}createMappingList(){return new Cr(this.document.getGraph())}createVariant(e=""){return new Lt(this.document.getGraph(),e)}createMapping(){return new kr(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof Lt)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[be])return this;const n=(t.json.extensions[be].variants||[]).map(r=>this.createVariant().setName(r.name||""));return(t.json.meshes||[]).forEach((r,s)=>{const o=e.meshes[s];(r.primitives||[]).forEach((a,f)=>{if(!a.extensions||!a.extensions[be])return;const d=this.createMappingList(),p=a.extensions[be];for(const m of p.mappings){const w=this.createMapping();m.material!==void 0&&w.setMaterial(e.materials[m.material]);for(const b of m.variants||[])w.addVariant(n[b]);d.addMapping(w)}o.listPrimitives()[f].setExtension(be,d)})}),this}write(e){const t=e.jsonDoc,n=this.listVariants();if(!n.length)return this;const r=[],s=new Map;for(const o of n)s.set(o,r.length),r.push(e.createPropertyDef(o));for(const o of this.document.getRoot().listMeshes()){const a=e.meshIndexMap.get(o);o.listPrimitives().forEach((f,d)=>{const p=f.getExtension(be);if(!p)return;const m=e.jsonDoc.json.meshes[a].primitives[d],w=p.listMappings().map(b=>{const l=e.createPropertyDef(b),_=b.getMaterial();return _&&(l.material=e.materialIndexMap.get(_)),l.variants=b.listVariants().map(c=>s.get(c)),l});m.extensions=m.extensions||{},m.extensions[be]={mappings:w}})}return t.json.extensions=t.json.extensions||{},t.json.extensions[be]={variants:r},this}}Ur.EXTENSION_NAME=be;const{G:Ji}=De;class Or extends ae{init(){this.extensionName=ln,this.propertyType="Volume",this.parentTypes=[j.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new he(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(e){return this.set("thicknessFactor",e)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(e){return this.setRef("thicknessTexture",e,{channels:Ji})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(e){return this.set("attenuationDistance",e)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(e){return this.set("attenuationColor",e)}getAttenuationColorHex(){return Ee.factorToHex(this.getAttenuationColor())}setAttenuationColorHex(e){const t=this.getAttenuationColor().slice();return this.set("attenuationColor",Ee.hexToFactor(e,t))}}Or.EXTENSION_NAME=ln;const Pe=ln;class Fr extends Z{constructor(...e){super(...e),this.extensionName=Pe}createVolume(){return new Or(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,s)=>{if(r.extensions&&r.extensions[Pe]){const o=this.createVolume();e.materials[s].setExtension(Pe,o);const a=r.extensions[Pe];if(a.thicknessFactor!==void 0&&o.setThicknessFactor(a.thicknessFactor),a.attenuationDistance!==void 0&&o.setAttenuationDistance(a.attenuationDistance),a.attenuationColor!==void 0&&o.setAttenuationColor(a.attenuationColor),a.thicknessTexture!==void 0){const f=a.thicknessTexture;o.setThicknessTexture(e.textures[n[f.index].source]),e.setTextureInfo(o.getThicknessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Pe);if(r){const s=e.materialIndexMap.get(n),o=t.json.materials[s];o.extensions=o.extensions||{};const a=o.extensions[Pe]={};if(r.getThicknessFactor()>0&&(a.thicknessFactor=r.getThicknessFactor()),Number.isFinite(r.getAttenuationDistance())&&(a.attenuationDistance=r.getAttenuationDistance()),ut.eq(r.getAttenuationColor(),[1,1,1])||(a.attenuationColor=r.getAttenuationColor()),r.getThicknessTexture()){const f=r.getThicknessTexture(),d=r.getThicknessTextureInfo();a.thicknessTexture=e.createTextureInfoDef(f,d)}}}),this}}Fr.EXTENSION_NAME=Pe;const Br="KHR_mesh_quantization";class Lr extends Z{constructor(...e){super(...e),this.extensionName=Br}read(e){return this}write(e){return this}}Lr.EXTENSION_NAME=Br;const st="KHR_texture_basisu";class es{match(e){return e[0]===171&&e[1]===75&&e[2]===84&&e[3]===88&&e[4]===32&&e[5]===50&&e[6]===48&&e[7]===187&&e[8]===13&&e[9]===10&&e[10]===26&&e[11]===10}getSize(e){const t=Rt(e);return[t.pixelWidth,t.pixelHeight]}getChannels(e){const t=Rt(e).dataFormatDescriptor[0];if(t.colorModel===_i)return t.samples.length===2&&(15&t.samples[1].channelType)==15?4:3;if(t.colorModel===mi)return(15&t.samples[0].channelType)==3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${t.colorModel}".`)}getVRAMByteLength(e){const t=Rt(e),n=this.getChannels(e)>3;let r=0;for(let s=0;s{t.extensions&&t.extensions[st]&&(t.source=t.extensions[st].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/ktx2"){const r=e.imageIndexMap.get(n);t.json.textures.forEach(s=>{s.source===r&&(s.extensions=s.extensions||{},s.extensions[st]={source:s.source},delete s.source)})}}),this}}jr.EXTENSION_NAME=st;class zr extends ae{init(){this.extensionName=fn,this.propertyType="Transform",this.parentTypes=[j.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getRotation(){return this.get("rotation")}setRotation(e){return this.set("rotation",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}}zr.EXTENSION_NAME=fn;const Ge=fn;class Pr extends Z{constructor(...e){super(...e),this.extensionName=Ge}createTransform(){return new zr(this.document.getGraph())}read(e){for(const[t,n]of Array.from(e.textureInfos.entries())){if(!n.extensions||!n.extensions[Ge])continue;const r=this.createTransform(),s=n.extensions[Ge];s.offset!==void 0&&r.setOffset(s.offset),s.rotation!==void 0&&r.setRotation(s.rotation),s.scale!==void 0&&r.setScale(s.scale),s.texCoord!==void 0&&r.setTexCoord(s.texCoord),t.setExtension(Ge,r)}return this}write(e){const t=Array.from(e.textureInfoDefMap.entries());for(const[n,r]of t){const s=n.getExtension(Ge);if(!s)continue;r.extensions=r.extensions||{};const o={},a=ut.eq;a(s.getOffset(),[0,0])||(o.offset=s.getOffset()),s.getRotation()!==0&&(o.rotation=s.getRotation()),a(s.getScale(),[1,1])||(o.scale=s.getScale()),s.getTexCoord()!=null&&(o.texCoord=s.getTexCoord()),r.extensions[Ge]=o}return this}}Pr.EXTENSION_NAME=Ge;const ts=[j.ROOT,j.SCENE,j.NODE,j.MESH,j.MATERIAL,j.TEXTURE,j.ANIMATION];class Gr extends ae{init(){this.extensionName=mt,this.propertyType="Packet",this.parentTypes=ts}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(e){return this.set("context",Re({},e))}listProperties(){return Object.keys(this.get("properties"))}getProperty(e){const t=this.get("properties");return e in t?t[e]:null}setProperty(e,t){this._assertContext(e);const n=Re({},this.get("properties"));return t?n[e]=t:delete n[e],this.set("properties",n)}toJSONLD(){return Re({"@context":Nt(this.get("context"))},Nt(this.get("properties")))}fromJSONLD(e){const t=(e=Nt(e))["@context"];return t&&this.set("context",t),delete e["@context"],this.set("properties",e)}_assertContext(e){if(!(e.split(":")[0]in this.get("context")))throw new Error(`${mt}: Missing context for term, "${e}".`)}}function Nt(i){return JSON.parse(JSON.stringify(i))}Gr.EXTENSION_NAME=mt;const Ie=mt;class $r extends Z{constructor(...e){super(...e),this.extensionName=Ie}createPacket(){return new Gr(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(e){var t;const n=(t=e.jsonDoc.json.extensions)==null?void 0:t[Ie];if(!n||!n.packets)return this;const r=e.jsonDoc.json,s=this.document.getRoot(),o=n.packets.map(d=>this.createPacket().fromJSONLD(d)),a=[[r.asset],r.scenes,r.nodes,r.meshes,r.materials,r.images,r.animations],f=[[s],s.listScenes(),s.listNodes(),s.listMeshes(),s.listMaterials(),s.listTextures(),s.listAnimations()];for(let d=0;d0&&(t.extensions=t.extensions||{},t.extensions[Ie]={packets:n}),this}}$r.EXTENSION_NAME=Ie;const Vr=[Bt,fr,hr,xr,_r,Tr,wr,Er,Ar,vr,Sr,Mr,Ur,Fr,Lr,jr,Pr,$r];[...Vr];var Fn=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function q(){var i=this;function e(t,n){var r=0;do r|=1&t,t>>>=1,r<<=1;while(--n>0);return r>>>1}i.build_tree=function(t){var n,r,s,o=i.dyn_tree,a=i.stat_desc.static_tree,f=i.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,n=0;n=1;n--)t.pqdownheap(o,n);s=f;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*s]=o[2*n]+o[2*r],t.depth[s]=Math.max(t.depth[n],t.depth[r])+1,o[2*n+1]=o[2*r+1]=s,t.heap[1]=s++,t.pqdownheap(o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(p){var m,w,b,l,_,c,u=i.dyn_tree,x=i.stat_desc.static_tree,g=i.stat_desc.extra_bits,h=i.stat_desc.extra_base,E=i.stat_desc.max_length,y=0;for(l=0;l<=15;l++)p.bl_count[l]=0;for(u[2*p.heap[p.heap_max]+1]=0,m=p.heap_max+1;m<573;m++)(l=u[2*u[2*(w=p.heap[m])+1]+1]+1)>E&&(l=E,y++),u[2*w+1]=l,w>i.max_code||(p.bl_count[l]++,_=0,w>=h&&(_=g[w-h]),p.opt_len+=(c=u[2*w])*(l+_),x&&(p.static_len+=c*(x[2*w+1]+_)));if(y!==0){do{for(l=E-1;p.bl_count[l]===0;)l--;p.bl_count[l]--,p.bl_count[l+1]+=2,p.bl_count[E]--,y-=2}while(y>0);for(l=E;l!==0;l--)for(w=p.bl_count[l];w!==0;)(b=p.heap[--m])>i.max_code||(u[2*b+1]!=l&&(p.opt_len+=(l-u[2*b+1])*u[2*b],u[2*b+1]=l),w--)}}(t),function(p,m,w){var b,l,_,c=[],u=0;for(b=1;b<=15;b++)c[b]=u=u+w[b-1]<<1;for(l=0;l<=m;l++)(_=p[2*l+1])!==0&&(p[2*l]=e(c[_]++,_))}(o,i.max_code,t.bl_count)}}function ce(i,e,t,n,r){var s=this;s.static_tree=i,s.extra_bits=e,s.extra_base=t,s.elems=n,s.max_length=r}function ye(i,e,t,n,r){var s=this;s.good_length=i,s.max_lazy=e,s.nice_length=t,s.max_chain=n,s.func=r}q._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],q.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],q.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],q.d_code=function(i){return i<256?Fn[i]:Fn[256+(i>>>7)]},q.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],q.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ce.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],ce.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],ce.static_l_desc=new ce(ce.static_ltree,q.extra_lbits,257,286,15),ce.static_d_desc=new ce(ce.static_dtree,q.extra_dbits,0,30,15),ce.static_bl_desc=new ce(null,q.extra_blbits,0,19,7);var me=[new ye(0,0,0,0,0),new ye(4,4,8,4,1),new ye(4,5,16,8,1),new ye(4,6,32,32,1),new ye(4,4,16,16,2),new ye(8,16,32,32,2),new ye(8,16,128,128,2),new ye(8,32,128,256,2),new ye(32,128,258,1024,2),new ye(32,258,258,4096,2)],lt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function Bn(i,e,t,n){var r=i[2*e],s=i[2*t];return r>>8&255)}function ue(D,N){var k,M=N;se>16-M?(Je(H|=(k=D)<>>16-se,se+=M-16):(H|=D<=8&&(Ve(255&H),H>>>=8,se-=8)}function et(D,N){var k,M,S;if(P.pending_buf[F+2*ne]=D>>>8&255,P.pending_buf[F+2*ne+1]=255&D,P.pending_buf[W+ne]=255&N,ne++,D===0?B[2*N]++:(ie++,D--,B[2*(q._length_code[N]+256+1)]++,z[2*q.d_code(D)]++),(8191&ne)==0&&R>2){for(k=8*ne,M=h-c,S=0;S<30;S++)k+=z[2*S]*(5+q.extra_dbits[S]);if(k>>>=3,ie8?Je(H):se>0&&Ve(255&H),H=0,se=0}function yn(D,N,k){ue(0+(k?1:0),3),function(M,S,L){Tn(),$=8,Je(S),Je(~S),P.pending_buf.set(a.subarray(M,M+S),P.pending),P.pending+=S}(D,N)}function Ae(D){(function(N,k,M){var S,L,G=0;R>0?(Ye.build_tree(P),Qe.build_tree(P),G=function(){var V;for(xn(B,Ye.max_code),xn(z,Qe.max_code),It.build_tree(P),V=18;V>=3&&U[2*q.bl_order[V]+1]===0;V--);return P.opt_len+=3*(V+1)+5+5+4,V}(),(L=P.static_len+3+7>>>3)<=(S=P.opt_len+3+7>>>3)&&(S=L)):S=L=k+5,k+4<=S&&N!=-1?yn(N,k,M):L==S?(ue(2+(M?1:0),3),mn(ce.static_ltree,ce.static_dtree)):(ue(4+(M?1:0),3),function(V,X,J){var ee;for(ue(V-257,5),ue(X-1,5),ue(J-4,4),ee=0;ee=0?c:-1,h-c,D),c=h,i.flush_pending()}function vt(){var D,N,k,M;do{if((M=f-y-h)==0&&h===0&&y===0)M=r;else if(M==-1)M--;else if(h>=r+r-262){a.set(a.subarray(r,r+r),0),E-=r,h-=r,c-=r,k=D=w;do N=65535&p[--k],p[k]=N>=r?N-r:0;while(--D!=0);k=D=r;do N=65535&d[--k],d[k]=N>=r?N-r:0;while(--D!=0);M+=r}if(i.avail_in===0)return;D=i.read_buf(a,h+y,M),(y+=D)>=3&&(m=((m=255&a[h])<<_^255&a[h+1])&l)}while(y<262&&i.avail_in!==0)}function wn(D){var N,k,M=A,S=h,L=T,G=h>r-262?h-(r-262):0,V=C,X=o,J=h+258,ee=a[S+L-1],Ne=a[S+L];T>=I&&(M>>=2),V>y&&(V=y);do if(a[(N=D)+L]==Ne&&a[N+L-1]==ee&&a[N]==a[S]&&a[++N]==a[S+1]){S+=2,N++;do;while(a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&a[++S]==a[++N]&&SL){if(E=D,L=k,k>=V)break;ee=a[S+L-1],Ne=a[S+L]}}while((D=65535&d[D&X])>G&&--M!=0);return L<=y?L:y}P.depth=[],P.bl_count=[],P.heap=[],B=[],z=[],U=[],P.pqdownheap=function(D,N){for(var k=P.heap,M=k[N],S=N<<1;S<=P.heap_len&&(S9||M!=8||k<9||k>15||N<0||N>9||L<0||L>2?-2:(D.dstate=P,o=(r=1<<(s=k))-1,l=(w=1<<(b=S+7))-1,_=Math.floor((b+3-1)/3),a=new Uint8Array(2*r),d=[],p=[],de=1<9||k<0||k>2?-2:(me[R].func!=me[N].func&&D.total_in!==0&&(M=D.deflate(1)),R!=N&&(O=me[R=N].max_lazy,I=me[R].good_length,C=me[R].nice_length,A=me[R].max_chain),v=k,M)},P.deflateSetDictionary=function(D,N,k){var M,S=k,L=0;if(!N||e!=42)return-2;if(S<3)return 0;for(S>r-262&&(L=k-(S=r-262)),a.set(N.subarray(L,L+S),0),h=S,c=S,m=((m=255&a[0])<<_^255&a[1])&l,M=0;M<=S-3;M++)d[M&o]=p[m=(m<<_^255&a[M+2])&l],p[m]=M;return 0},P.deflate=function(D,N){var k,M,S,L,G,V;if(N>4||N<0)return-2;if(!D.next_out||!D.next_in&&D.avail_in!==0||e==666&&N!=4)return D.msg=lt[4],-2;if(D.avail_out===0)return D.msg=lt[7],-5;if(i=D,L=n,n=N,e==42&&(M=8+(s-8<<4)<<8,(S=(R-1&255)>>1)>3&&(S=3),M|=S<<6,h!==0&&(M|=32),e=113,Ve((V=M+=31-M%31)>>8&255),Ve(255&V)),P.pending!==0){if(i.flush_pending(),i.avail_out===0)return n=-1,0}else if(i.avail_in===0&&N<=L&&N!=4)return i.msg=lt[7],-5;if(e==666&&i.avail_in!==0)return D.msg=lt[7],-5;if(i.avail_in!==0||y!==0||N!=0&&e!=666){switch(G=-1,me[R].func){case 0:G=function(X){var J,ee=65535;for(ee>t-5&&(ee=t-5);;){if(y<=1){if(vt(),y===0&&X==0)return 0;if(y===0)break}if(h+=y,y=0,J=c+ee,(h===0||h>=J)&&(y=h-J,h=J,Ae(!1),i.avail_out===0)||h-c>=r-262&&(Ae(!1),i.avail_out===0))return 0}return Ae(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(N);break;case 1:G=function(X){for(var J,ee=0;;){if(y<262){if(vt(),y<262&&X==0)return 0;if(y===0)break}if(y>=3&&(ee=65535&p[m=(m<<_^255&a[h+2])&l],d[h&o]=p[m],p[m]=h),ee!==0&&(h-ee&65535)<=r-262&&v!=2&&(u=wn(ee)),u>=3)if(J=et(h-E,u-3),y-=u,u<=O&&y>=3){u--;do h++,ee=65535&p[m=(m<<_^255&a[h+2])&l],d[h&o]=p[m],p[m]=h;while(--u!=0);h++}else h+=u,u=0,m=((m=255&a[h])<<_^255&a[h+1])&l;else J=et(0,255&a[h]),y--,h++;if(J&&(Ae(!1),i.avail_out===0))return 0}return Ae(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(N);break;case 2:G=function(X){for(var J,ee,Ne=0;;){if(y<262){if(vt(),y<262&&X==0)return 0;if(y===0)break}if(y>=3&&(Ne=65535&p[m=(m<<_^255&a[h+2])&l],d[h&o]=p[m],p[m]=h),T=u,x=E,u=2,Ne!==0&&T4096)&&(u=2)),T>=3&&u<=T){ee=h+y-3,J=et(h-1-x,T-3),y-=T-1,T-=2;do++h<=ee&&(Ne=65535&p[m=(m<<_^255&a[h+2])&l],d[h&o]=p[m],p[m]=h);while(--T!=0);if(g=0,u=2,h++,J&&(Ae(!1),i.avail_out===0))return 0}else if(g!==0){if((J=et(0,255&a[h-1]))&&Ae(!1),h++,y--,i.avail_out===0)return 0}else g=1,h++,y--}return g!==0&&(J=et(0,255&a[h-1]),g=0),Ae(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(N)}if(G!=2&&G!=3||(e=666),G==0||G==2)return i.avail_out===0&&(n=-1),0;if(G==1){if(N==1)ue(2,3),_e(256,ce.static_ltree),_n(),1+$+10-se<9&&(ue(2,3),_e(256,ce.static_ltree),_n()),$=7;else if(yn(0,0,!1),N==3)for(k=0;k0&&e.next_in_index!=d&&(o(e.next_in_index),d=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return a=new Uint8Array(m),f.forEach(function(w){a.set(w,p),p+=w.length}),a}},this.flush=function(){var s,o,a=[],f=0,d=0;do{if(e.next_out_index=0,e.avail_out=t,(s=e.deflate(4))!=1&&s!=0)throw new Error("deflating: "+e.msg);t-e.avail_out>0&&a.push(new Uint8Array(n.subarray(0,e.next_out_index))),d+=e.next_out_index}while(e.avail_in>0||e.avail_out===0);return e.deflateEnd(),o=new Uint8Array(d),a.forEach(function(p){o.set(p,f),f+=p.length}),o}}Hr.prototype={deflateInit:function(i,e){var t=this;return t.dstate=new ns,e||(e=15),t.dstate.deflateInit(t,i,e)},deflate:function(i){var e=this;return e.dstate?e.dstate.deflate(e,i):-2},deflateEnd:function(){var i=this;if(!i.dstate)return-2;var e=i.dstate.deflateEnd();return i.dstate=null,e},deflateParams:function(i,e){var t=this;return t.dstate?t.dstate.deflateParams(t,i,e):-2},deflateSetDictionary:function(i,e){var t=this;return t.dstate?t.dstate.deflateSetDictionary(t,i,e):-2},read_buf:function(i,e,t){var n=this,r=n.avail_in;return r>t&&(r=t),r===0?0:(n.avail_in-=r,i.set(n.next_in.subarray(n.next_in_index,n.next_in_index+r),e),n.next_in_index+=r,n.total_in+=r,r)},flush_pending:function(){var i=this,e=i.dstate.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.next_out.set(i.dstate.pending_buf.subarray(i.dstate.pending_out,i.dstate.pending_out+e),i.next_out_index),i.next_out_index+=e,i.dstate.pending_out+=e,i.total_out+=e,i.avail_out-=e,i.dstate.pending-=e,i.dstate.pending===0&&(i.dstate.pending_out=0))}},self._zipjs_Deflater=Xr;var pe=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],rs=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],is=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],ss=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],os=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],as=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],cs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function jt(){var i,e,t,n,r,s;function o(f,d,p,m,w,b,l,_,c,u,x){var g,h,E,y,T,A,O,R,v,I,C,B,z,U,W;I=0,T=p;do t[f[d+I]]++,I++,T--;while(T!==0);if(t[0]==p)return l[0]=-1,_[0]=0,0;for(R=_[0],A=1;A<=15&&t[A]===0;A++);for(O=A,RT&&(R=T),_[0]=R,U=1<B+R;){if(y++,W=(W=E-(B+=R))>R?R:W,(h=1<<(A=O-B))>g+1&&(h-=g+1,z=O,A1440)return-3;r[y]=C=u[0],u[0]+=W,y!==0?(s[y]=T,n[0]=A,n[1]=R,n[2]=C-r[y-1]-(A=T>>>B-R),c.set(n,3*(r[y-1]+A))):l[0]=C}for(n[1]=O-B,I>=p?n[0]=192:x[I]>>B;A>>=1)T^=A;for(T^=A,v=(1<257?(u==-3?c.msg="oversubscribed distance tree":u==-5?(c.msg="incomplete distance tree",u=-3):u!=-4&&(c.msg="empty distance tree with lengths",u=-3),u):0)}}function us(){var i,e,t,n,r=this,s=0,o=0,a=0,f=0,d=0,p=0,m=0,w=0,b=0,l=0;function _(c,u,x,g,h,E,y,T){var A,O,R,v,I,C,B,z,U,W,de,ne,F,ie,$,H;B=T.next_in_index,z=T.avail_in,I=y.bitb,C=y.bitk,W=(U=y.write)>=O[H+1],C-=O[H+1],(16&v)!=0){for(F=O[H+2]+(I&pe[v&=15]),I>>=v,C-=v;C<15;)z--,I|=(255&T.read_byte(B++))<>=O[H+1],C-=O[H+1],(16&v)!=0){for(v&=15;C>=v,C-=v,W-=F,U>=ie)U-($=U-ie)>0&&2>U-$?(y.window[U++]=y.window[$++],y.window[U++]=y.window[$++],F-=2):(y.window.set(y.window.subarray($,$+2),U),U+=2,$+=2,F-=2);else{$=U-ie;do $+=y.end;while($<0);if(F>(v=y.end-$)){if(F-=v,U-$>0&&v>U-$)do y.window[U++]=y.window[$++];while(--v!=0);else y.window.set(y.window.subarray($,$+v),U),U+=v,$+=v,v=0;$=0}}if(U-$>0&&F>U-$)do y.window[U++]=y.window[$++];while(--F!=0);else y.window.set(y.window.subarray($,$+F),U),U+=F,$+=F,F=0;break}if(64&v)return T.msg="invalid distance code",z+=F=C>>3<(F=T.avail_in-z)?C>>3:F,B-=F,C-=F<<3,y.bitb=I,y.bitk=C,T.avail_in=z,T.total_in+=B-T.next_in_index,T.next_in_index=B,y.write=U,-3;A+=O[H+2],v=O[H=3*(R+(A+=I&pe[v]))]}break}if(64&v)return 32&v?(z+=F=C>>3<(F=T.avail_in-z)?C>>3:F,B-=F,C-=F<<3,y.bitb=I,y.bitk=C,T.avail_in=z,T.total_in+=B-T.next_in_index,T.next_in_index=B,y.write=U,1):(T.msg="invalid literal/length code",z+=F=C>>3<(F=T.avail_in-z)?C>>3:F,B-=F,C-=F<<3,y.bitb=I,y.bitk=C,T.avail_in=z,T.total_in+=B-T.next_in_index,T.next_in_index=B,y.write=U,-3);if(A+=O[H+2],(v=O[H=3*(R+(A+=I&pe[v]))])===0){I>>=O[H+1],C-=O[H+1],y.window[U++]=O[H+2],W--;break}}else I>>=O[H+1],C-=O[H+1],y.window[U++]=O[H+2],W--}while(W>=258&&z>=10);return z+=F=C>>3<(F=T.avail_in-z)?C>>3:F,B-=F,C-=F<<3,y.bitb=I,y.bitk=C,T.avail_in=z,T.total_in+=B-T.next_in_index,T.next_in_index=B,y.write=U,0}r.init=function(c,u,x,g,h,E){i=0,m=c,w=u,t=x,b=g,n=h,l=E,e=null},r.proc=function(c,u,x){var g,h,E,y,T,A,O,R=0,v=0,I=0;for(I=u.next_in_index,y=u.avail_in,R=c.bitb,v=c.bitk,A=(T=c.write)=258&&y>=10&&(c.bitb=R,c.bitk=v,u.avail_in=y,u.total_in+=I-u.next_in_index,u.next_in_index=I,c.write=T,x=_(m,w,t,b,n,l,c,u),I=u.next_in_index,y=u.avail_in,R=c.bitb,v=c.bitk,A=(T=c.write)>>=e[1+(h=3*(o+(R&pe[g])))],v-=e[h+1],(E=e[h])===0){f=e[h+2],i=6;break}if(16&E){d=15&E,s=e[h+2],i=2;break}if(!(64&E)){a=E,o=h/3+e[h+2];break}if(32&E){i=7;break}return i=9,u.msg="invalid literal/length code",x=-3,c.bitb=R,c.bitk=v,u.avail_in=y,u.total_in+=I-u.next_in_index,u.next_in_index=I,c.write=T,c.inflate_flush(u,x);case 2:for(g=d;v>=g,v-=g,a=w,e=n,o=l,i=3;case 3:for(g=a;v>=e[1+(h=3*(o+(R&pe[g])))],v-=e[h+1],(16&(E=e[h]))!=0){d=15&E,p=e[h+2],i=4;break}if(!(64&E)){a=E,o=h/3+e[h+2];break}return i=9,u.msg="invalid distance code",x=-3,c.bitb=R,c.bitk=v,u.avail_in=y,u.total_in+=I-u.next_in_index,u.next_in_index=I,c.write=T,c.inflate_flush(u,x);case 4:for(g=d;v>=g,v-=g,i=5;case 5:for(O=T-p;O<0;)O+=c.end;for(;s!==0;){if(A===0&&(T==c.end&&c.read!==0&&(A=(T=0)7&&(v-=8,y++,I--),c.write=T,x=c.inflate_flush(u,x),A=(T=c.write)l.avail_out&&(c=l.avail_out),c!==0&&_==-5&&(_=0),l.avail_out-=c,l.total_out+=c,l.next_out.set(n.window.subarray(x,x+c),u),u+=c,(x+=c)==n.end&&(x=0,n.write==n.end&&(n.write=0),(c=n.write-x)>l.avail_out&&(c=l.avail_out),c!==0&&_==-5&&(_=0),l.avail_out-=c,l.total_out+=c,l.next_out.set(n.window.subarray(x,x+c),u),u+=c,x+=c),l.next_out_index=u,n.read=x,_},n.proc=function(l,_){var c,u,x,g,h,E,y,T;for(g=l.next_in_index,h=l.avail_in,u=n.bitb,x=n.bitk,y=(E=n.write)>>1){case 0:u>>>=3,u>>>=c=7&(x-=3),x-=c,r=1;break;case 1:var A=[],O=[],R=[[]],v=[[]];jt.inflate_trees_fixed(A,O,R,v),p.init(A[0],O[0],R[0],0,v[0],0),u>>>=3,x-=3,r=6;break;case 2:u>>>=3,x-=3,r=3;break;case 3:return u>>>=3,x-=3,r=9,l.msg="invalid block type",_=-3,n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_)}break;case 1:for(;x<32;){if(h===0)return n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);_=0,h--,u|=(255&l.read_byte(g++))<>>16&65535)!=(65535&u))return r=9,l.msg="invalid stored block lengths",_=-3,n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);s=65535&u,u=x=0,r=s!==0?2:m!==0?7:0;break;case 2:if(h===0||y===0&&(E==n.end&&n.read!==0&&(y=(E=0)h&&(c=h),c>y&&(c=y),n.window.set(l.read_buf(g,c),E),g+=c,h-=c,E+=c,y-=c,(s-=c)!=0)break;r=m!==0?7:0;break;case 3:for(;x<14;){if(h===0)return n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);_=0,h--,u|=(255&l.read_byte(g++))<29||(c>>5&31)>29)return r=9,l.msg="too many length or distance symbols",_=-3,n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);if(c=258+(31&c)+(c>>5&31),!t||t.length>>=14,x-=14,a=0,r=4;case 4:for(;a<4+(o>>>10);){for(;x<3;){if(h===0)return n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);_=0,h--,u|=(255&l.read_byte(g++))<>>=3,x-=3}for(;a<19;)t[Ln[a++]]=0;if(f[0]=7,(c=b.inflate_trees_bits(t,f,d,w,l))!=0)return(_=c)==-3&&(t=null,r=9),n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);a=0,r=5;case 5:for(;!(a>=258+(31&(c=o))+(c>>5&31));){var I,C;for(c=f[0];x>>=c,x-=c,t[a++]=C;else{for(T=C==18?7:C-14,I=C==18?11:3;x>>=c)&pe[T],u>>>=T,x-=T,(T=a)+I>258+(31&(c=o))+(c>>5&31)||C==16&&T<1)return t=null,r=9,l.msg="invalid bit length repeat",_=-3,n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);C=C==16?t[T-1]:0;do t[T++]=C;while(--I!=0);a=T}}d[0]=-1;var B=[],z=[],U=[],W=[];if(B[0]=9,z[0]=6,(c=b.inflate_trees_dynamic(257+(31&(c=o)),1+(c>>5&31),t,B,z,U,W,w,l))!=0)return c==-3&&(t=null,r=9),_=c,n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,n.inflate_flush(l,_);p.init(B[0],z[0],w,U[0],w,W[0]),r=6;case 6:if(n.bitb=u,n.bitk=x,l.avail_in=h,l.total_in+=g-l.next_in_index,l.next_in_index=g,n.write=E,(_=p.proc(n,l,_))!=1)return n.inflate_flush(l,_);if(_=0,p.free(l),g=l.next_in_index,h=l.avail_in,u=n.bitb,x=n.bitk,y=(E=n.write)15?(i.inflateEnd(t),-2):(i.wbits=n,t.istate.blocks=new ls(t,1<>4)>t.istate.wbits){t.istate.mode=13,t.msg="invalid window size",t.istate.marker=5;break}t.istate.mode=1;case 1:if(t.avail_in===0)return r;if(r=n,t.avail_in--,t.total_in++,s=255&t.read_byte(t.next_in_index++),((t.istate.method<<8)+s)%31!=0){t.istate.mode=13,t.msg="incorrect header check",t.istate.marker=5;break}if(!(32&s)){t.istate.mode=7;break}t.istate.mode=2;case 2:if(t.avail_in===0)return r;r=n,t.avail_in--,t.total_in++,t.istate.need=(255&t.read_byte(t.next_in_index++))<<24&4278190080,t.istate.mode=3;case 3:if(t.avail_in===0)return r;r=n,t.avail_in--,t.total_in++,t.istate.need+=(255&t.read_byte(t.next_in_index++))<<16&16711680,t.istate.mode=4;case 4:if(t.avail_in===0)return r;r=n,t.avail_in--,t.total_in++,t.istate.need+=(255&t.read_byte(t.next_in_index++))<<8&65280,t.istate.mode=5;case 5:return t.avail_in===0?r:(r=n,t.avail_in--,t.total_in++,t.istate.need+=255&t.read_byte(t.next_in_index++),t.istate.mode=6,2);case 6:return t.istate.mode=13,t.msg="need dictionary",t.istate.marker=0,-2;case 7:if((r=t.istate.blocks.proc(t,r))==-3){t.istate.mode=13,t.istate.marker=0;break}if(r==0&&(r=n),r!=1)return r;r=n,t.istate.blocks.reset(t,t.istate.was),t.istate.mode=12;case 12:return 1;case 13:return-3;default:return-2}},i.inflateSetDictionary=function(t,n,r){var s=0,o=r;return t&&t.istate&&t.istate.mode==6?(o>=1<0&&i.next_in_index!=f&&(r(i.next_in_index),f=i.next_in_index)}while(i.avail_in>0||i.avail_out===0);return o=new Uint8Array(p),a.forEach(function(m){o.set(m,d),d+=m.length}),o}},this.flush=function(){i.inflateEnd()}}Wr.prototype={inflateInit:function(i){var e=this;return e.istate=new ds,i||(i=15),e.istate.inflateInit(e,i)},inflate:function(i){var e=this;return e.istate?e.istate.inflate(e,i):-2},inflateEnd:function(){var i=this;if(!i.istate)return-2;var e=i.istate.inflateEnd(i);return i.istate=null,e},inflateSync:function(){var i=this;return i.istate?i.istate.inflateSync(i):-2},inflateSetDictionary:function(i,e){var t=this;return t.istate?t.istate.inflateSetDictionary(t,i,e):-2},read_byte:function(i){return this.next_in.subarray(i,i+1)[0]},read_buf:function(i,e){return this.next_in.subarray(i,i+e)}},self._zipjs_Inflater=Kr;var dn,nt="File format is not recognized.",jn="Error while reading zip file.";try{dn=new Blob([new DataView(new ArrayBuffer(0))]).size===0}catch{}function dt(){this.crc=-1}function zt(){}function Se(i,e){var t,n;return t=new ArrayBuffer(i),n=new Uint8Array(t),e&&n.set(e,0),{buffer:t,array:n,view:new DataView(t)}}function ht(){}function Pt(i){var e,t=this;t.size=0,t.init=function(n,r){var s=new Blob([i],{type:"text/plain"});(e=new yt(s)).init(function(){t.size=e.size,n()},r)},t.readUint8Array=function(n,r,s,o){e.readUint8Array(n,r,s,o)}}function Gt(i){var e,t=this;t.size=0,t.init=function(n){for(var r=i.length;i.charAt(r-1)=="=";)r--;e=i.indexOf(",")+1,t.size=Math.floor(.75*(r-e)),n()},t.readUint8Array=function(n,r,s){var o,a=Se(r),f=4*Math.floor(n/3),d=4*Math.ceil((n+r)/3),p=self.atob(i.substring(f+e,d+e)),m=n-3*Math.floor(f/4);for(o=m;oa.size)throw new RangeError("offset:"+f+", length:"+d+", size:"+a.size);return a.slice?a.slice(f,f+d):a.webkitSlice?a.webkitSlice(f,f+d):a.mozSlice?a.mozSlice(f,f+d):a.msSlice?a.msSlice(f,f+d):void 0}(i,t,n))}catch(a){s(a)}}}function ot(){}function $t(i){var e,t=this;t.init=function(n){e=new Blob([],{type:"text/plain"}),n()},t.writeUint8Array=function(n,r){e=new Blob([e,dn?n:n.buffer],{type:"text/plain"}),r()},t.getData=function(n,r){var s=new FileReader;s.onload=function(o){n(o.target.result)},s.onerror=r,s.readAsText(e,i)}}function Vt(i){var e=this,t="",n="";e.init=function(r){t+="data:"+(i||"")+";base64,",r()},e.writeUint8Array=function(r,s){var o,a=n.length,f=n;for(n="",o=0;o<3*Math.floor((a+r.length)/3)-a;o++)f+=String.fromCharCode(r[o]);for(;o2?t+=self.btoa(f):n=f,s()},e.getData=function(r){r(t+self.btoa(n))}}function Ht(i){var e,t=this;t.init=function(n){e=new Blob([],{type:i}),n()},t.writeUint8Array=function(n,r){e=new Blob([e,dn?n:n.buffer],{type:i}),r()},t.getData=function(n){n(e)}}function Xt(i,e,t,n,r,s,o,a,f,d){var p,m,w,b=0,l=e.sn;function _(){i.removeEventListener("message",c,!1),a(m,w)}function c(x){var g=x.data,h=g.data,E=g.error;if(E)return E.toString=function(){return"Error: "+this.message},void f(E);if(g.sn===l)switch(typeof g.codecTime=="number"&&(i.codecTime+=g.codecTime),typeof g.crcTime=="number"&&(i.crcTime+=g.crcTime),g.type){case"append":h?(m+=h.length,n.writeUint8Array(h,function(){u()},d)):u();break;case"flush":w=g.crc,h?(m+=h.length,n.writeUint8Array(h,function(){_()},d)):_();break;case"progress":o&&o(p+g.loaded,s);break;case"importScripts":case"newTask":case"echo":break;default:console.warn("zip.js:launchWorkerProcess: unknown message: ",g)}}function u(){(p=524288*b)<=s?t.readUint8Array(r+p,Math.min(524288,s-p),function(x){o&&o(p,s);var g=p===0?e:{sn:l};g.type="append",g.data=x;try{i.postMessage(g,[x.buffer])}catch{i.postMessage(g)}b++},f):i.postMessage({sn:l,type:"flush"})}m=0,i.addEventListener("message",c,!1),u()}function Wt(i,e,t,n,r,s,o,a,f,d){var p,m=0,w=0,b=s==="input",l=s==="output",_=new dt;(function c(){var u;if((p=524288*m)127?r[t-128]:String.fromCharCode(t);return n}function Gn(i){return decodeURIComponent(escape(i))}function $n(i){var e,t="";for(e=0;e>16,a=65535&s;try{return new Date(1980+((65024&o)>>9),((480&o)>>5)-1,31&o,(63488&a)>>11,(2016&a)>>5,2*(31&a),0)}catch{}}(i.lastModDateRaw),(1&i.bitFlag)!=1?((n||(8&i.bitFlag)!=8)&&(i.crc32=e.view.getUint32(t+10,!0),i.compressedSize=e.view.getUint32(t+14,!0),i.uncompressedSize=e.view.getUint32(t+18,!0)),i.compressedSize!==4294967295&&i.uncompressedSize!==4294967295?(i.filenameLength=e.view.getUint16(t+22,!0),i.extraFieldLength=e.view.getUint16(t+24,!0)):r("File is using Zip64 (4gb+ file size).")):r("File contains encrypted entry.")}function Hn(i){return unescape(encodeURIComponent(i))}function Xn(i){var e,t=[];for(e=0;e>>8^t[255&(e^i[n])];this.crc=e},dt.prototype.get=function(){return~this.crc},dt.prototype.table=function(){var i,e,t,n=[];for(i=0;i<256;i++){for(t=i,e=0;e<8;e++)1&t?t=t>>>1^3988292384:t>>>=1;n[i]=t}return n}(),zt.prototype.append=function(i,e){return i},zt.prototype.flush=function(){},(Pt.prototype=new ht).constructor=Pt,(Gt.prototype=new ht).constructor=Gt,(yt.prototype=new ht).constructor=yt,ot.prototype.getData=function(i){i(this.data)},($t.prototype=new ot).constructor=$t,(Vt.prototype=new ot).constructor=Vt,(Ht.prototype=new ot).constructor=Ht;var hs={deflater:["z-worker.js","deflate.js"],inflater:["z-worker.js","inflate.js"]};function Wn(i,e,t){if(K.workerScripts===null||K.workerScriptsPath===null){var n,r,s;if(K.workerScripts){if(n=K.workerScripts[i],!Array.isArray(n))return void t(new Error("zip.workerScripts."+i+" is not an array!"));r=n,s=document.createElement("a"),n=r.map(function(f){return s.href=f,s.href})}else(n=hs[i].slice(0))[0]=(K.workerScriptsPath||"")+n[0];var o=new Worker(n[0]);o.codecTime=o.crcTime=0,o.postMessage({type:"importScripts",scripts:n.slice(1)}),o.addEventListener("message",function f(d){var p=d.data;if(p.error)return o.terminate(),void t(p.error);p.type==="importScripts"&&(o.removeEventListener("message",f),o.removeEventListener("error",a),e(o))}),o.addEventListener("error",a)}else t(new Error("Either zip.workerScripts or zip.workerScriptsPath may be set, not both."));function a(f){o.terminate(),t(f)}}function Kn(i){console.error(i)}const K={Reader:ht,Writer:ot,BlobReader:yt,Data64URIReader:Gt,TextReader:Pt,BlobWriter:Ht,Data64URIWriter:Vt,TextWriter:$t,createReader:function(i,e,t){i.init(function(){(function(n,r,s){var o=0;function a(){}a.prototype.getData=function(d,p,m,w){var b=this;function l(u,x){w&&!function(g){var h=Se(4);return h.view.setUint32(0,g),b.crc32==h.view.getUint32(0)}(x)?s("CRC failed."):d.getData(function(g){p(g)})}function _(u){s(u||"Error while reading file data.")}function c(u){s(u||"Error while writing file data.")}n.readUint8Array(b.offset,30,function(u){var x,g=Se(u.length,u);g.view.getUint32(0)==1347093252?(Vn(b,g,4,!1,s),x=b.offset+30+b.filenameLength+b.extraFieldLength,d.init(function(){b.compressionMethod===0?zn(b._worker,o++,n,d,x,b.compressedSize,w,l,m,_,c):function(h,E,y,T,A,O,R,v,I,C,B){var z=R?"output":"none";K.useWebWorkers?Xt(h,{sn:E,codecClass:"_zipjs_Inflater",crcType:z},y,T,A,O,I,v,C,B):Wt(new Kr,y,T,A,O,z,I,v,C,B)}(b._worker,o++,n,d,x,b.compressedSize,w,l,m,_,c)},c)):s(nt)},_)};var f={getEntries:function(d){var p=this._worker;(function(m){function w(b,l){n.readUint8Array(n.size-b,b,function(_){for(var c=_.length-22;c>=0;c--)if(_[c]===80&&_[c+1]===75&&_[c+2]===5&&_[c+3]===6)return void m(new DataView(_.buffer,c,22));l()},function(){s(jn)})}n.size<22?s(nt):w(22,function(){w(Math.min(65558,n.size),function(){s(nt)})})})(function(m){var w,b;w=m.getUint32(16,!0),b=m.getUint16(8,!0),w<0||w>=n.size?s(nt):n.readUint8Array(w,n.size-w,function(l){var _,c,u,x,g=0,h=[],E=Se(l.length,l);for(_=0;_0){var s=r.map(function(o){return o.webkitGetAsEntry()}).filter(function(o){return o!==null});s.length>0&&(s[0].name.match(/\.zip$/)?this._loadZip(r[0].getAsFile()):this._loadNextEntry(new Map,s))}else n.length===1&&n[0].name.match(/\.zip$/)&&this._loadZip(n[0]),this._emit("drop",{files:new Map(n.map(function(o){return[o.name,o]}))});else this._fail("Required drag-and-drop APIs are not supported in this browser.")},e._onDragover=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e._onSelect=function(t){this._emit("dropstart");var n=[].slice.call(this.inputEl.files);if(n.length===1&&this._isZip(n[0]))this._loadZip(n[0]);else{var r=new Map;n.forEach(function(s){return r.set(s.webkitRelativePath||s.name,s)}),this._emit("drop",{files:r})}},e._loadNextEntry=function(t,n){var r=this,s=n.pop();if(s)if(s.isFile)s.file(function(a){t.set(s.fullPath,a),r._loadNextEntry(t,n)},function(){return console.error("Could not load file: %s",s.fullPath)});else if(s.isDirectory){var o=s.createReader();o.readEntries(function a(f){f.length?(n=n.concat(f),o.readEntries(a)):r._loadNextEntry(t,n)})}else console.warn("Unknown asset type: "+s.fullPath),this._loadNextEntry(t,n);else this._emit("drop",{files:t})},e._loadZip=function(t){var n=this,r=[],s=new Map,o=new gs.FS,a=function f(d){d.directory?d.children.forEach(f):d.name[0]!=="."&&r.push(new Promise(function(p){d.getData(new K.BlobWriter,function(m){m.name=d.name,s.set(d.getFullname(),m),p()})}))};o.importBlob(t,function(){a(o.root),Promise.all(r).then(function(){n._emit("drop",{files:s,archive:t})})})},e._isZip=function(t){return t.type==="application/zip"||t.name.match(/\.zip$/)},e._fail=function(t){this._emit("droperror",{message:t})},i}();const hn=si(new oi);hn.registerExtensions(Vr);const Zr=await fi();Zr.setup();const{Manifold:Jn,Mesh:ms}=Zr,Yr=document.querySelector("model-viewer"),Ts=document.querySelector("#input"),Qr=document.querySelector("#download"),ve=document.querySelector("#viewFinal"),ys=new _s(Yr,Ts);let gt="",bt="",_t=!0,Et=!1;ys.on("drop",async({files:i})=>{for(const[e,t]of i)if(t.name.toLowerCase().match(/\.(gltf|glb)$/)){URL.revokeObjectURL(gt),gt=URL.createObjectURL(t),await ws(await bs(gt)),Jr();break}});function Jr(){_t?(ve.checked=!0,ve.disabled=!0):Et?(ve.checked=!1,ve.disabled=!1):(ve.checked=!1,ve.disabled=!0),ei()}ve.onclick=ei;function ei(){Yr.src=ve.checked?bt:gt,Qr.disabled=!ve.checked}Qr.onclick=()=>{const i=document.createElement("a");i.download="manifold.glb",i.href=bt,i.click()};async function ws(i){if(URL.revokeObjectURL(bt),!Et)return;const e=await hn.writeBinary(i),t=new Blob([e],{type:"application/octet-stream"});bt=URL.createObjectURL(t)}async function bs(i){_t=!1,Et=!1,Jr(),_t=!0;const e=await hn.read(i),t=e.getRoot().listNodes();for(const n of t){const r=n.getMesh();if(!r)continue;const s=ai(r);if(!s)continue;const o=new Map,a=s.runProperties.length,f=Jn.reserveIDs(a);s.mesh.runOriginalID=new Uint32Array(a);for(let p=0;p 0 ? kvdByteOffset + kvdBuffer.byteLength : 0;\n if (sgdByteOffset % 8) sgdByteOffset += 8 - sgdByteOffset % 8; // align(8)\n ///////////////////////////////////////////////////\n // Level Index.\n ///////////////////////////////////////////////////\n\n const levelData = [];\n const levelIndex = new DataView(new ArrayBuffer(container.levels.length * 3 * 8));\n let levelDataByteOffset = (sgdByteOffset || kvdByteOffset + kvdBuffer.byteLength) + sgdBuffer.byteLength;\n\n for (let i = 0; i < container.levels.length; i++) {\n const level = container.levels[i];\n levelData.push(level.levelData);\n levelIndex.setBigUint64(i * 24 + 0, BigInt(levelDataByteOffset), true);\n levelIndex.setBigUint64(i * 24 + 8, BigInt(level.levelData.byteLength), true);\n levelIndex.setBigUint64(i * 24 + 16, BigInt(level.uncompressedByteLength), true);\n levelDataByteOffset += level.levelData.byteLength;\n } ///////////////////////////////////////////////////\n // Header.\n ///////////////////////////////////////////////////\n\n\n const headerBuffer = new ArrayBuffer(HEADER_BYTE_LENGTH);\n const headerView = new DataView(headerBuffer);\n headerView.setUint32(0, container.vkFormat, true);\n headerView.setUint32(4, container.typeSize, true);\n headerView.setUint32(8, container.pixelWidth, true);\n headerView.setUint32(12, container.pixelHeight, true);\n headerView.setUint32(16, container.pixelDepth, true);\n headerView.setUint32(20, container.layerCount, true);\n headerView.setUint32(24, container.faceCount, true);\n headerView.setUint32(28, container.levels.length, true);\n headerView.setUint32(32, container.supercompressionScheme, true);\n headerView.setUint32(36, dfdByteOffset, true);\n headerView.setUint32(40, dfdBuffer.byteLength, true);\n headerView.setUint32(44, kvdByteOffset, true);\n headerView.setUint32(48, kvdBuffer.byteLength, true);\n headerView.setBigUint64(52, BigInt(sgdBuffer.byteLength > 0 ? sgdByteOffset : 0), true);\n headerView.setBigUint64(60, BigInt(sgdBuffer.byteLength), true); ///////////////////////////////////////////////////\n // Compose.\n ///////////////////////////////////////////////////\n\n return new Uint8Array(concat([new Uint8Array(KTX2_ID).buffer, headerBuffer, levelIndex.buffer, dfdBuffer, kvdBuffer, sgdByteOffset > 0 ? new ArrayBuffer(sgdByteOffset - (kvdByteOffset + kvdBuffer.byteLength)) // align(8)\n : new ArrayBuffer(0), sgdBuffer, ...levelData]));\n}\n\nexport { KHR_DF_CHANNEL_RGBSDA_ALPHA, KHR_DF_CHANNEL_RGBSDA_BLUE, KHR_DF_CHANNEL_RGBSDA_DEPTH, KHR_DF_CHANNEL_RGBSDA_GREEN, KHR_DF_CHANNEL_RGBSDA_RED, KHR_DF_CHANNEL_RGBSDA_STENCIL, KHR_DF_FLAG_ALPHA_PREMULTIPLIED, KHR_DF_FLAG_ALPHA_STRAIGHT, KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT, KHR_DF_MODEL_ASTC, KHR_DF_MODEL_ETC1, KHR_DF_MODEL_ETC1S, KHR_DF_MODEL_ETC2, KHR_DF_MODEL_RGBSDA, KHR_DF_MODEL_UASTC, KHR_DF_MODEL_UNSPECIFIED, KHR_DF_PRIMARIES_ACES, KHR_DF_PRIMARIES_ACESCC, KHR_DF_PRIMARIES_ADOBERGB, KHR_DF_PRIMARIES_BT2020, KHR_DF_PRIMARIES_BT601_EBU, KHR_DF_PRIMARIES_BT601_SMPTE, KHR_DF_PRIMARIES_BT709, KHR_DF_PRIMARIES_CIEXYZ, KHR_DF_PRIMARIES_DISPLAYP3, KHR_DF_PRIMARIES_NTSC1953, KHR_DF_PRIMARIES_PAL525, KHR_DF_PRIMARIES_UNSPECIFIED, KHR_DF_SAMPLE_DATATYPE_EXPONENT, KHR_DF_SAMPLE_DATATYPE_FLOAT, KHR_DF_SAMPLE_DATATYPE_LINEAR, KHR_DF_SAMPLE_DATATYPE_SIGNED, KHR_DF_TRANSFER_ACESCC, KHR_DF_TRANSFER_ACESCCT, KHR_DF_TRANSFER_ADOBERGB, KHR_DF_TRANSFER_BT1886, KHR_DF_TRANSFER_DCIP3, KHR_DF_TRANSFER_HLG_EOTF, KHR_DF_TRANSFER_HLG_OETF, KHR_DF_TRANSFER_ITU, KHR_DF_TRANSFER_LINEAR, KHR_DF_TRANSFER_NTSC, KHR_DF_TRANSFER_PAL625_EOTF, KHR_DF_TRANSFER_PAL_OETF, KHR_DF_TRANSFER_PQ_EOTF, KHR_DF_TRANSFER_PQ_OETF, KHR_DF_TRANSFER_SLOG, KHR_DF_TRANSFER_SLOG2, KHR_DF_TRANSFER_SRGB, KHR_DF_TRANSFER_ST240, KHR_DF_TRANSFER_UNSPECIFIED, KHR_DF_VENDORID_KHRONOS, KHR_DF_VERSION, KHR_SUPERCOMPRESSION_BASISLZ, KHR_SUPERCOMPRESSION_NONE, KHR_SUPERCOMPRESSION_ZLIB, KHR_SUPERCOMPRESSION_ZSTD, KTX2Container, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A2B10G10R10_SINT_PACK32, VK_FORMAT_A2B10G10R10_SNORM_PACK32, VK_FORMAT_A2B10G10R10_UINT_PACK32, VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_SINT_PACK32, VK_FORMAT_A2R10G10B10_SNORM_PACK32, VK_FORMAT_A2R10G10B10_UINT_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT, VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT, VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x6_SRGB_BLO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K, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B5G5R5A1_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B8G8R8A8_SINT, VK_FORMAT_B8G8R8A8_SNORM, VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UINT, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8_SINT, VK_FORMAT_B8G8R8_SNORM, VK_FORMAT_B8G8R8_SRGB, VK_FORMAT_B8G8R8_UINT, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_D16_UNORM, VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_EAC_R11G11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, VK_FORMAT_R10X6G10X6_UNORM_2PACK16, VK_FORMAT_R10X6_UNORM_PACK16, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, VK_FORMAT_R12X4G12X4_UNORM_2PACK16, VK_FORMAT_R12X4_UNORM_PACK16, VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16_SFLOAT, VK_FORMAT_R16G16B16_SINT, VK_FORMAT_R16G16B16_SNORM, VK_FORMAT_R16G16B16_UINT, VK_FORMAT_R16G16B16_UNORM, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SINT, VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_UINT, VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16_SINT, VK_FORMAT_R16_SNORM, VK_FORMAT_R16_UINT, VK_FORMAT_R16_UNORM, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32_SINT, VK_FORMAT_R32G32B32_UINT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SINT, VK_FORMAT_R32_UINT, VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_R4G4_UNORM_PACK8, VK_FORMAT_R5G5B5A1_UNORM_PACK16, VK_FORMAT_R5G6B5_UNORM_PACK16, VK_FORMAT_R64G64B64A64_SFLOAT, VK_FORMAT_R64G64B64A64_SINT, VK_FORMAT_R64G64B64A64_UINT, VK_FORMAT_R64G64B64_SFLOAT, VK_FORMAT_R64G64B64_SINT, VK_FORMAT_R64G64B64_UINT, VK_FORMAT_R64G64_SFLOAT, VK_FORMAT_R64G64_SINT, VK_FORMAT_R64G64_UINT, VK_FORMAT_R64_SFLOAT, VK_FORMAT_R64_SINT, VK_FORMAT_R64_UINT, VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8_SINT, VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_R8G8B8_SRGB, VK_FORMAT_R8G8B8_UINT, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8_SINT, VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_SRGB, VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8_SINT, VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SRGB, VK_FORMAT_R8_UINT, VK_FORMAT_R8_UNORM, VK_FORMAT_S8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, read, write };\n//# sourceMappingURL=ktx-parse.modern.js.map\n","import{ExtensionProperty as e,PropertyType as t,Extension as s,BufferUtils as n,WriterContext as r,Primitive as o,Root as i,AnimationSampler as a,AnimationChannel as c,Accessor as u,MathUtils as l,GLB_BUFFER as h,ImageUtils as f,getBounds as g,ColorUtils as p,TextureInfo as x,TextureChannel as d}from\"@gltf-transform/core\";import{read as T,KHR_DF_MODEL_ETC1S as m,KHR_DF_MODEL_UASTC as E}from\"ktx-parse\";const I=\"EXT_mesh_gpu_instancing\",N=\"EXT_meshopt_compression\",R=\"KHR_draco_mesh_compression\",y=\"KHR_lights_punctual\",A=\"KHR_materials_anisotropy\",S=\"KHR_materials_clearcoat\",C=\"KHR_materials_emissive_strength\",M=\"KHR_materials_ior\",O=\"KHR_materials_iridescence\",_=\"KHR_materials_pbrSpecularGlossiness\",w=\"KHR_materials_sheen\",D=\"KHR_materials_specular\",b=\"KHR_materials_transmission\",F=\"KHR_materials_unlit\",j=\"KHR_materials_volume\",v=\"KHR_materials_variants\",k=\"KHR_texture_transform\",B=\"KHR_xmp_json_ld\",G=\"INSTANCE_ATTRIBUTE\";class L extends e{init(){this.extensionName=I,this.propertyType=\"InstancedMesh\",this.parentTypes=[t.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(e){return this.getRefMap(\"attributes\",e)}setAttribute(e,t){return this.setRefMap(\"attributes\",e,t,{usage:G})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}}L.EXTENSION_NAME=I;const U=I;class V extends s{constructor(...e){super(...e),this.extensionName=U,this.provideTypes=[t.NODE],this.prewriteTypes=[t.ACCESSOR]}createInstancedMesh(){return new L(this.document.getGraph())}read(e){return(e.jsonDoc.json.nodes||[]).forEach((t,s)=>{if(!t.extensions||!t.extensions[U])return;const n=t.extensions[U],r=this.createInstancedMesh();for(const t in n.attributes)r.setAttribute(t,e.accessors[n.attributes[t]]);e.nodes[s].setExtension(U,r)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(G);for(const t of this.properties)for(const s of t.listAttributes())e.addAccessorToUsageGroup(s,G);return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listNodes().forEach(s=>{const n=s.getExtension(U);if(n){const r=e.nodeIndexMap.get(s),o=t.json.nodes[r],i={attributes:{}};n.listSemantics().forEach(t=>{const s=n.getAttribute(t);i.attributes[t]=e.accessorIndexMap.get(s)}),o.extensions=o.extensions||{},o.extensions[U]=i}}),this}}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t8?8:4,a.componentType=i>8?q:$,a.normalized=!0,s=3===e.getElementSize()?function(e){const t=new Float32Array(4*e.length/3);for(let s=0,n=e.length/3;sQ(t,e.getComponentType())),a.max=a.max.map(t=>Q(t,e.getComponentType()))),a.normalized&&(a.min=a.min.map(e=>Y(e,a.componentType)),a.max=a.max.map(e=>Y(e,a.componentType)))}else a.byteStride%4&&(a.array=function(e,t){const s=n.padNumber(e.BYTES_PER_ELEMENT*t)/e.BYTES_PER_ELEMENT,r=new e.constructor(e.length/t*s);for(let n=0;n*te instanceof o&&e.getMode()===o.Mode.TRIANGLES)?H.TRIANGLES:H.INDICES:H.ATTRIBUTES}function Z(e,s){const n=s.getGraph().listParentEdges(e).filter(e=>!(e.getParent()instanceof i));for(const s of n){const n=s.getName(),r=s.getAttributes().key||\"\",o=s.getParent().propertyType===t.PRIMITIVE_TARGET;if(\"indices\"===n)return{filter:z.NONE};if(\"attributes\"===n){if(\"POSITION\"===r)return{filter:z.NONE};if(\"TEXCOORD_0\"===r)return{filter:z.NONE};if(r.startsWith(\"JOINTS_\"))return{filter:z.NONE};if(r.startsWith(\"WEIGHTS_\"))return{filter:z.NONE};if(\"NORMAL\"===r||\"TANGENT\"===r)return o?{filter:z.NONE}:{filter:z.OCTAHEDRAL,bits:8}}if(\"output\"===n){const t=ee(e);return\"rotation\"===t?{filter:z.QUATERNION,bits:16}:\"translation\"===t||\"scale\"===t?{filter:z.EXPONENTIAL,bits:12}:{filter:z.NONE}}if(\"input\"===n)return{filter:z.NONE};if(\"inverseBindMatrices\"===n)return{filter:z.NONE}}return{filter:z.NONE}}function ee(e){for(const t of e.listParents())if(t instanceof a)for(const e of t.listParents())if(e instanceof c)return e.getTargetPath();return null}const te=N,se={method:X.QUANTIZE};class ne extends s{constructor(...e){super(...e),this.extensionName=te,this.prereadTypes=[t.BUFFER,t.PRIMITIVE],this.prewriteTypes=[t.BUFFER,t.ACCESSOR],this.readDependencies=[\"meshopt.decoder\"],this.writeDependencies=[\"meshopt.encoder\"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=se,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(e,t){return\"meshopt.decoder\"===e&&(this._decoder=t),\"meshopt.encoder\"===e&&(this._encoder=t),this}setEncoderOptions(e){return this._encoderOptions=P({},se,e),this}preread(e,s){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${te}] Please install extension dependency, \"meshopt.decoder\".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${te}]: Missing WASM support.`)}return s===t.BUFFER?this._prereadBuffers(e):s===t.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach((s,r)=>{if(!s.extensions||!s.extensions[te])return;const o=s.extensions[te],i=o.byteOffset||0,a=o.byteLength||0,c=o.count,u=o.byteStride,l=new Uint8Array(c*u),f=t.json.buffers[o.buffer],g=n.toView(f.uri?t.resources[f.uri]:t.resources[h],i,a);this._decoder.decodeGltfBuffer(l,c,u,g,o.mode,o.filter),e.bufferViews[r]=l})}_prereadPrimitives(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach(s=>{var n;s.extensions&&s.extensions[te]&&(n=t.json.buffers[s.buffer]).extensions&&n.extensions[N]&&n.extensions[N].fallback&&this._decoderFallbackBufferMap.set(e.buffers[s.buffer],e.buffers[s.extensions[te].buffer])})}read(e){if(!this.isRequired())return this;for(const[e,t]of this._decoderFallbackBufferMap){for(const s of e.listParents())s instanceof u&&s.swap(e,t);e.dispose()}return this}prewrite(e,s){return s===t.ACCESSOR?this._prewriteAccessors(e):s===t.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const t=e.jsonDoc.json,s=this._encoder,n=this._encoderOptions,o=this.document.createBuffer(),i=this.document.getRoot().listBuffers().indexOf(o);this._encoderFallbackBuffer=o,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const o of this.document.getRoot().listAccessors()){if(\"weights\"===ee(o))continue;if(o.getSparse())continue;const a=e.getAccessorUsage(o),c=J(o,a),u=n.method===X.FILTER?Z(o,this.document):{filter:z.NONE},l=W(o,s,c,u),{array:h,byteStride:f}=l,g=o.getBuffer();if(!g)throw new Error(`${te}: Missing buffer for accessor.`);const p=this.document.getRoot().listBuffers().indexOf(g),x=[a,c,u.filter,f,p].join(\":\");let d=this._encoderBufferViews[x],T=this._encoderBufferViewData[x],m=this._encoderBufferViewAccessors[x];d&&T||(m=this._encoderBufferViewAccessors[x]=[],T=this._encoderBufferViewData[x]=[],d=this._encoderBufferViews[x]={buffer:i,target:r.USAGE_TO_TARGET[a],byteOffset:0,byteLength:0,byteStride:a===r.BufferViewUsage.ARRAY_BUFFER?f:void 0,extensions:{[te]:{buffer:p,byteOffset:0,byteLength:0,mode:c,filter:u.filter!==z.NONE?u.filter:void 0,byteStride:f,count:0}}});const E=e.createAccessorDef(o);E.componentType=l.componentType,E.normalized=l.normalized,E.byteOffset=d.byteLength,E.min&&l.min&&(E.min=l.min),E.max&&l.max&&(E.max=l.max),e.accessorIndexMap.set(o,t.accessors.length),t.accessors.push(E),m.push(E),T.push(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),d.byteLength+=h.byteLength,d.extensions.EXT_meshopt_compression.count+=o.getCount()}}_prewriteBuffers(e){const t=this._encoder;for(const s in this._encoderBufferViews){const r=this._encoderBufferViews[s],o=this._encoderBufferViewData[s],i=this.document.getRoot().listBuffers()[r.extensions[te].buffer],a=e.otherBufferViews.get(i)||[],{count:c,byteStride:u,mode:l}=r.extensions[te],h=n.concat(o),f=t.encodeGltfBuffer(h,c,u,l),g=n.pad(f);r.extensions[te].byteLength=f.byteLength,o.length=0,o.push(g),a.push(g),e.otherBufferViews.set(i,a)}}write(e){let t=0;for(const s in this._encoderBufferViews){const r=this._encoderBufferViews[s],o=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[s][0]),i=this._encoderBufferViewAccessors[s];for(const e of i)e.bufferView=o;const a=e.jsonDoc.json.bufferViews[o],c=a.byteOffset||0;Object.assign(a,r),a.byteOffset=t,a.extensions[te].byteOffset=c,t+=n.padNumber(r.byteLength)}const s=this._encoderFallbackBuffer,r=e.bufferIndexMap.get(s),o=e.jsonDoc.json.buffers[r];return o.byteLength=t,o.extensions={[te]:{fallback:!0}},s.dispose(),this}}ne.EXTENSION_NAME=te,ne.EncoderMethod=X;const re=\"EXT_texture_avif\";class oe{match(e){return e.length>=12&&\"ftypavif\"===n.decodeText(e.slice(4,12))}getSize(e){if(!this.match(e))return null;const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let s=ae(t,0);if(!s)return null;let n=s.end;for(;s=ae(t,n);)if(\"meta\"===s.type)n=s.start+4;else if(\"iprp\"===s.type||\"ipco\"===s.type)n=s.start;else{if(\"ispe\"===s.type)return[t.getUint32(s.start+4),t.getUint32(s.start+8)];if(\"mdat\"===s.type)break;n=s.end}return null}getChannels(e){return 4}}class ie extends s{constructor(...e){super(...e),this.extensionName=re,this.prereadTypes=[t.TEXTURE]}static register(){f.registerFormat(\"image/avif\",new oe)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions[re]&&(e.source=e.extensions[re].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/avif\"===s.getMimeType()){const n=e.imageIndexMap.get(s);(t.json.textures||[]).forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[re]={source:e.source},delete e.source)})}}),this}}function ae(e,t){if(e.byteLength<4+t)return null;const s=e.getUint32(t);return e.byteLength=12&&87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]}getSize(e){const t=n.decodeText(e.slice(0,4)),s=n.decodeText(e.slice(8,12));if(\"RIFF\"!==t||\"WEBP\"!==s)return null;const r=new DataView(e.buffer,e.byteOffset);let o=12;for(;o>6)]}o+=8+t+t%2}return null}getChannels(e){return 4}}class le extends s{constructor(...e){super(...e),this.extensionName=ce,this.prereadTypes=[t.TEXTURE]}static register(){f.registerFormat(\"image/webp\",new ue)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions[ce]&&(e.source=e.extensions[ce].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/webp\"===s.getMimeType()){const n=e.imageIndexMap.get(s);(t.json.textures||[]).forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[ce]={source:e.source},delete e.source)})}}),this}}le.EXTENSION_NAME=ce;const he=R;let fe,ge,pe,xe;function de(e,t){const s=new fe.DecoderBuffer;try{if(s.Init(t,t.length),e.GetEncodedGeometryType(s)!==fe.TRIANGULAR_MESH)throw new Error(`[${he}] Unknown geometry type.`);const n=new fe.Mesh;if(!e.DecodeBufferToMesh(s,n).ok()||0===n.ptr)throw new Error(`[${he}] Decoding failure.`);return n}finally{fe.destroy(s)}}function Te(e,t){const s=3*t.num_faces();let n,r;if(t.num_points()<=65534){const o=s*Uint16Array.BYTES_PER_ELEMENT;n=fe._malloc(o),e.GetTrianglesUInt16Array(t,o,n),r=new Uint16Array(fe.HEAPU16.buffer,n,s).slice()}else{const o=s*Uint32Array.BYTES_PER_ELEMENT;n=fe._malloc(o),e.GetTrianglesUInt32Array(t,o,n),r=new Uint32Array(fe.HEAPU32.buffer,n,s).slice()}return fe._free(n),r}function me(e,t,s,n){const r=pe[n.componentType],o=ge[n.componentType],i=s.num_components(),a=t.num_points()*i,c=a*o.BYTES_PER_ELEMENT,u=fe._malloc(c);e.GetAttributeDataArrayForAllPoints(t,s,r,c,u);const l=new o(fe.HEAPF32.buffer,u,a).slice();return fe._free(u),l}var Ee,Ie;!function(e){e[e.EDGEBREAKER=1]=\"EDGEBREAKER\",e[e.SEQUENTIAL=0]=\"SEQUENTIAL\"}(Ee||(Ee={})),function(e){e.POSITION=\"POSITION\",e.NORMAL=\"NORMAL\",e.COLOR=\"COLOR\",e.TEX_COORD=\"TEX_COORD\",e.GENERIC=\"GENERIC\"}(Ie||(Ie={}));const Ne={[Ie.POSITION]:14,[Ie.NORMAL]:10,[Ie.COLOR]:8,[Ie.TEX_COORD]:12,[Ie.GENERIC]:12},Re={decodeSpeed:5,encodeSpeed:5,method:Ee.EDGEBREAKER,quantizationBits:Ne,quantizationVolume:\"mesh\"};function ye(e,t=Re){const s=P({},Re,t);s.quantizationBits=P({},Ne,t.quantizationBits);const n=new xe.MeshBuilder,r=new xe.Mesh,o=new xe.ExpertEncoder(r),i={},a=new xe.DracoInt8Array,c=e.listTargets().length>0;let u=!1;for(const t of e.listSemantics()){const a=e.getAttribute(t);if(a.getSparse()){u=!0;continue}const c=Ae(t),l=Se(n,a.getComponentType(),r,xe[c],a.getCount(),a.getElementSize(),a.getArray());if(-1===l)throw new Error(`Error compressing \"${t}\" attribute.`);if(i[t]=l,\"mesh\"===s.quantizationVolume||\"POSITION\"!==t)o.SetAttributeQuantization(l,s.quantizationBits[c]);else{if(\"object\"!=typeof s.quantizationVolume)throw new Error(\"Invalid quantization volume state.\");{const{quantizationVolume:e}=s,t=Math.max(e.max[0]-e.min[0],e.max[1]-e.min[1],e.max[2]-e.min[2]);o.SetAttributeExplicitQuantization(l,s.quantizationBits[c],a.getElementSize(),e.min,t)}}}const l=e.getIndices();if(!l)throw new Ce(\"Primitive must have indices.\");n.AddFacesToMesh(r,l.getCount()/3,l.getArray()),o.SetSpeedOptions(s.encodeSpeed,s.decodeSpeed),o.SetTrackEncodedProperties(!0),o.SetEncodingMethod(s.method===Ee.SEQUENTIAL||c||u?xe.MESH_SEQUENTIAL_ENCODING:xe.MESH_EDGEBREAKER_ENCODING);const h=o.EncodeToDracoBuffer(!(c||u),a);if(h<=0)throw new Ce(\"Error applying Draco compression.\");const f=new Uint8Array(h);for(let e=0;ee.propertyType));if(2!==s.size||!s.has(t.PRIMITIVE)||!s.has(t.ROOT))throw new Error(`[${Me}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const e of Array.from(n)){const t=l.get(e),s=e.getIndices();if(c.get(s)!==t||e.listAttributes().some(e=>c.get(e)!==t))throw new Error(`[${Me}] Draco primitives must share all, or no, accessors.`)}for(const e of Array.from(r)){const t=e.getIndices();if(c.has(t)||e.listAttributes().some(e=>c.has(e)))throw new Error(`[${Me}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return l}(this.document),i=new Map;let a=\"mesh\";\"scene\"===this._encoderOptions.quantizationVolume&&(1!==this.document.getRoot().listScenes().length?n.warn(`[${Me}]: quantizationVolume=scene requires exactly 1 scene.`):a=g(this.document.getRoot().listScenes().pop()));for(const t of Array.from(r.keys())){const s=r.get(t);if(!s)throw new Error(\"Unexpected primitive.\");if(i.has(s)){i.set(s,i.get(s));continue}const o=t.getIndices(),c=e.jsonDoc.json.accessors;let u;try{u=ye(t,P({},this._encoderOptions,{quantizationVolume:a}))}catch(e){if(e instanceof Ce){n.warn(`[${Me}]: ${e.message} Skipping primitive compression.`);continue}throw e}i.set(s,u);const l=e.createAccessorDef(o);l.count=u.numIndices,e.accessorIndexMap.set(o,c.length),c.push(l);for(const s of t.listSemantics()){const n=t.getAttribute(s);if(void 0===u.attributeIDs[s])continue;const r=e.createAccessorDef(n);r.count=u.numVertices,e.accessorIndexMap.set(n,c.length),c.push(r)}const h=t.getAttribute(\"POSITION\").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(h)||e.otherBufferViews.set(h,[]),e.otherBufferViews.get(h).push(u.data)}return n.debug(`[${Me}] Compressed ${r.size} primitives.`),e.extensionData[Me]={primitiveHashMap:r,primitiveEncodingMap:i},this}write(e){const t=e.extensionData[Me];for(const s of this.document.getRoot().listMeshes()){const n=e.jsonDoc.json.meshes[e.meshIndexMap.get(s)];for(let r=0;re!==Me),t.extensionsRequired=(t.extensionsRequired||[]).filter(e=>e!==Me)}return this}}function _e(e,t){const s=[],n=e.getIndices();s.push(t.get(n));for(const n of e.listAttributes())s.push(t.get(n));return s.sort().join(\"|\")}Oe.EXTENSION_NAME=Me,Oe.EncoderMethod=Ee;class we extends e{init(){this.extensionName=y,this.propertyType=\"Light\",this.parentTypes=[t.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:we.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get(\"color\")}setColor(e){return this.set(\"color\",e)}getColorHex(){return p.factorToHex(this.getColor())}setColorHex(e){const t=this.getColor().slice();return p.hexToFactor(e,t),this.setColor(t)}getIntensity(){return this.get(\"intensity\")}setIntensity(e){return this.set(\"intensity\",e)}getType(){return this.get(\"type\")}setType(e){return this.set(\"type\",e)}getRange(){return this.get(\"range\")}setRange(e){return this.set(\"range\",e)}getInnerConeAngle(){return this.get(\"innerConeAngle\")}setInnerConeAngle(e){return this.set(\"innerConeAngle\",e)}getOuterConeAngle(){return this.get(\"outerConeAngle\")}setOuterConeAngle(e){return this.set(\"outerConeAngle\",e)}}we.EXTENSION_NAME=y,we.Type={POINT:\"point\",SPOT:\"spot\",DIRECTIONAL:\"directional\"};const De=y;class be extends s{constructor(...e){super(...e),this.extensionName=De}createLight(e=\"\"){return new we(this.document.getGraph(),e)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[De])return this;const s=(t.json.extensions[De].lights||[]).map(e=>{var t,s;const n=this.createLight().setName(e.name||\"\").setType(e.type);return void 0!==e.color&&n.setColor(e.color),void 0!==e.intensity&&n.setIntensity(e.intensity),void 0!==e.range&&n.setRange(e.range),void 0!==(null==(t=e.spot)?void 0:t.innerConeAngle)&&n.setInnerConeAngle(e.spot.innerConeAngle),void 0!==(null==(s=e.spot)?void 0:s.outerConeAngle)&&n.setOuterConeAngle(e.spot.outerConeAngle),n});return t.json.nodes.forEach((t,n)=>{t.extensions&&t.extensions[De]&&e.nodes[n].setExtension(De,s[t.extensions[De].light])}),this}write(e){const t=e.jsonDoc;if(0===this.properties.size)return this;const s=[],n=new Map;for(const e of this.properties){const t=e,r={type:t.getType()};l.eq(t.getColor(),[1,1,1])||(r.color=t.getColor()),1!==t.getIntensity()&&(r.intensity=t.getIntensity()),null!=t.getRange()&&(r.range=t.getRange()),t.getName()&&(r.name=t.getName()),t.getType()===we.Type.SPOT&&(r.spot={innerConeAngle:t.getInnerConeAngle(),outerConeAngle:t.getOuterConeAngle()}),s.push(r),n.set(t,s.length-1)}return this.document.getRoot().listNodes().forEach(s=>{const r=s.getExtension(De);if(r){const o=e.nodeIndexMap.get(s),i=t.json.nodes[o];i.extensions=i.extensions||{},i.extensions[De]={light:n.get(r)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[De]={lights:s},this}}be.EXTENSION_NAME=De;const{R:Fe,G:je,B:ve}=d;class ke extends e{init(){this.extensionName=A,this.propertyType=\"Anisotropy\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new x(this.graph,\"anisotropyTextureInfo\")})}getAnisotropyStrength(){return this.get(\"anisotropyStrength\")}setAnisotropyStrength(e){return this.set(\"anisotropyStrength\",e)}getAnisotropyRotation(){return this.get(\"anisotropyRotation\")}setAnisotropyRotation(e){return this.set(\"anisotropyRotation\",e)}getAnisotropyTexture(){return this.getRef(\"anisotropyTexture\")}getAnisotropyTextureInfo(){return this.getRef(\"anisotropyTexture\")?this.getRef(\"anisotropyTextureInfo\"):null}setAnisotropyTexture(e){return this.setRef(\"anisotropyTexture\",e,{channels:Fe|je|ve})}}ke.EXTENSION_NAME=A;const Be=A;class Ge extends s{constructor(...e){super(...e),this.extensionName=Be}createAnisotropy(){return new ke(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Be]){const r=this.createAnisotropy();e.materials[n].setExtension(Be,r);const o=t.extensions[Be];if(void 0!==o.anisotropyStrength&&r.setAnisotropyStrength(o.anisotropyStrength),void 0!==o.anisotropyRotation&&r.setAnisotropyRotation(o.anisotropyRotation),void 0!==o.anisotropyTexture){const t=o.anisotropyTexture;r.setAnisotropyTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getAnisotropyTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Be);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Be]={};if(n.getAnisotropyStrength()>0&&(i.anisotropyStrength=n.getAnisotropyStrength()),0!==n.getAnisotropyRotation()&&(i.anisotropyRotation=n.getAnisotropyRotation()),n.getAnisotropyTexture()){const t=n.getAnisotropyTexture(),s=n.getAnisotropyTextureInfo();i.anisotropyTexture=e.createTextureInfoDef(t,s)}}}),this}}Ge.EXTENSION_NAME=Be;const{R:Le,G:Ue,B:Ve}=d;class Pe extends e{init(){this.extensionName=S,this.propertyType=\"Clearcoat\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new x(this.graph,\"clearcoatTextureInfo\"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new x(this.graph,\"clearcoatRoughnessTextureInfo\"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new x(this.graph,\"clearcoatNormalTextureInfo\")})}getClearcoatFactor(){return this.get(\"clearcoatFactor\")}setClearcoatFactor(e){return this.set(\"clearcoatFactor\",e)}getClearcoatTexture(){return this.getRef(\"clearcoatTexture\")}getClearcoatTextureInfo(){return this.getRef(\"clearcoatTexture\")?this.getRef(\"clearcoatTextureInfo\"):null}setClearcoatTexture(e){return this.setRef(\"clearcoatTexture\",e,{channels:Le})}getClearcoatRoughnessFactor(){return this.get(\"clearcoatRoughnessFactor\")}setClearcoatRoughnessFactor(e){return this.set(\"clearcoatRoughnessFactor\",e)}getClearcoatRoughnessTexture(){return this.getRef(\"clearcoatRoughnessTexture\")}getClearcoatRoughnessTextureInfo(){return this.getRef(\"clearcoatRoughnessTexture\")?this.getRef(\"clearcoatRoughnessTextureInfo\"):null}setClearcoatRoughnessTexture(e){return this.setRef(\"clearcoatRoughnessTexture\",e,{channels:Ue})}getClearcoatNormalScale(){return this.get(\"clearcoatNormalScale\")}setClearcoatNormalScale(e){return this.set(\"clearcoatNormalScale\",e)}getClearcoatNormalTexture(){return this.getRef(\"clearcoatNormalTexture\")}getClearcoatNormalTextureInfo(){return this.getRef(\"clearcoatNormalTexture\")?this.getRef(\"clearcoatNormalTextureInfo\"):null}setClearcoatNormalTexture(e){return this.setRef(\"clearcoatNormalTexture\",e,{channels:Le|Ue|Ve})}}Pe.EXTENSION_NAME=S;const Xe=S;class He extends s{constructor(...e){super(...e),this.extensionName=Xe}createClearcoat(){return new Pe(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Xe]){const r=this.createClearcoat();e.materials[n].setExtension(Xe,r);const o=t.extensions[Xe];if(void 0!==o.clearcoatFactor&&r.setClearcoatFactor(o.clearcoatFactor),void 0!==o.clearcoatRoughnessFactor&&r.setClearcoatRoughnessFactor(o.clearcoatRoughnessFactor),void 0!==o.clearcoatTexture){const t=o.clearcoatTexture;r.setClearcoatTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatTextureInfo(),t)}if(void 0!==o.clearcoatRoughnessTexture){const t=o.clearcoatRoughnessTexture;r.setClearcoatRoughnessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatRoughnessTextureInfo(),t)}if(void 0!==o.clearcoatNormalTexture){const t=o.clearcoatNormalTexture;r.setClearcoatNormalTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatNormalTextureInfo(),t),void 0!==t.scale&&r.setClearcoatNormalScale(t.scale)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Xe);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Xe]={clearcoatFactor:n.getClearcoatFactor(),clearcoatRoughnessFactor:n.getClearcoatRoughnessFactor()};if(n.getClearcoatTexture()){const t=n.getClearcoatTexture(),s=n.getClearcoatTextureInfo();i.clearcoatTexture=e.createTextureInfoDef(t,s)}if(n.getClearcoatRoughnessTexture()){const t=n.getClearcoatRoughnessTexture(),s=n.getClearcoatRoughnessTextureInfo();i.clearcoatRoughnessTexture=e.createTextureInfoDef(t,s)}if(n.getClearcoatNormalTexture()){const t=n.getClearcoatNormalTexture(),s=n.getClearcoatNormalTextureInfo();i.clearcoatNormalTexture=e.createTextureInfoDef(t,s),1!==n.getClearcoatNormalScale()&&(i.clearcoatNormalTexture.scale=n.getClearcoatNormalScale())}}}),this}}He.EXTENSION_NAME=Xe;class ze extends e{init(){this.extensionName=C,this.propertyType=\"EmissiveStrength\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get(\"emissiveStrength\")}setEmissiveStrength(e){return this.set(\"emissiveStrength\",e)}}ze.EXTENSION_NAME=C;const $e=C;class qe extends s{constructor(...e){super(...e),this.extensionName=$e}createEmissiveStrength(){return new ze(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[$e]){const n=this.createEmissiveStrength();e.materials[s].setExtension($e,n);const r=t.extensions[$e];void 0!==r.emissiveStrength&&n.setEmissiveStrength(r.emissiveStrength)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension($e);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[$e]={emissiveStrength:n.getEmissiveStrength()}}}),this}}qe.EXTENSION_NAME=$e;class Ke extends e{init(){this.extensionName=M,this.propertyType=\"IOR\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get(\"ior\")}setIOR(e){return this.set(\"ior\",e)}}Ke.EXTENSION_NAME=M;const Ye=M;class Qe extends s{constructor(...e){super(...e),this.extensionName=Ye}createIOR(){return new Ke(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[Ye]){const n=this.createIOR();e.materials[s].setExtension(Ye,n);const r=t.extensions[Ye];void 0!==r.ior&&n.setIOR(r.ior)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Ye);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[Ye]={ior:n.getIOR()}}}),this}}Qe.EXTENSION_NAME=Ye;const{R:We,G:Je}=d;class Ze extends e{init(){this.extensionName=O,this.propertyType=\"Iridescence\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new x(this.graph,\"iridescenceTextureInfo\"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new x(this.graph,\"iridescenceThicknessTextureInfo\")})}getIridescenceFactor(){return this.get(\"iridescenceFactor\")}setIridescenceFactor(e){return this.set(\"iridescenceFactor\",e)}getIridescenceTexture(){return this.getRef(\"iridescenceTexture\")}getIridescenceTextureInfo(){return this.getRef(\"iridescenceTexture\")?this.getRef(\"iridescenceTextureInfo\"):null}setIridescenceTexture(e){return this.setRef(\"iridescenceTexture\",e,{channels:We})}getIridescenceIOR(){return this.get(\"iridescenceIOR\")}setIridescenceIOR(e){return this.set(\"iridescenceIOR\",e)}getIridescenceThicknessMinimum(){return this.get(\"iridescenceThicknessMinimum\")}setIridescenceThicknessMinimum(e){return this.set(\"iridescenceThicknessMinimum\",e)}getIridescenceThicknessMaximum(){return this.get(\"iridescenceThicknessMaximum\")}setIridescenceThicknessMaximum(e){return this.set(\"iridescenceThicknessMaximum\",e)}getIridescenceThicknessTexture(){return this.getRef(\"iridescenceThicknessTexture\")}getIridescenceThicknessTextureInfo(){return this.getRef(\"iridescenceThicknessTexture\")?this.getRef(\"iridescenceThicknessTextureInfo\"):null}setIridescenceThicknessTexture(e){return this.setRef(\"iridescenceThicknessTexture\",e,{channels:Je})}}Ze.EXTENSION_NAME=O;const et=O;class tt extends s{constructor(...e){super(...e),this.extensionName=et}createIridescence(){return new Ze(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[et]){const r=this.createIridescence();e.materials[n].setExtension(et,r);const o=t.extensions[et];if(void 0!==o.iridescenceFactor&&r.setIridescenceFactor(o.iridescenceFactor),void 0!==o.iridescenceIor&&r.setIridescenceIOR(o.iridescenceIor),void 0!==o.iridescenceThicknessMinimum&&r.setIridescenceThicknessMinimum(o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&r.setIridescenceThicknessMaximum(o.iridescenceThicknessMaximum),void 0!==o.iridescenceTexture){const t=o.iridescenceTexture;r.setIridescenceTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getIridescenceTextureInfo(),t)}if(void 0!==o.iridescenceThicknessTexture){const t=o.iridescenceThicknessTexture;r.setIridescenceThicknessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getIridescenceThicknessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(et);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[et]={};if(n.getIridescenceFactor()>0&&(i.iridescenceFactor=n.getIridescenceFactor()),1.3!==n.getIridescenceIOR()&&(i.iridescenceIor=n.getIridescenceIOR()),100!==n.getIridescenceThicknessMinimum()&&(i.iridescenceThicknessMinimum=n.getIridescenceThicknessMinimum()),400!==n.getIridescenceThicknessMaximum()&&(i.iridescenceThicknessMaximum=n.getIridescenceThicknessMaximum()),n.getIridescenceTexture()){const t=n.getIridescenceTexture(),s=n.getIridescenceTextureInfo();i.iridescenceTexture=e.createTextureInfoDef(t,s)}if(n.getIridescenceThicknessTexture()){const t=n.getIridescenceThicknessTexture(),s=n.getIridescenceThicknessTextureInfo();i.iridescenceThicknessTexture=e.createTextureInfoDef(t,s)}}}),this}}tt.EXTENSION_NAME=et;const{R:st,G:nt,B:rt,A:ot}=d;class it extends e{init(){this.extensionName=_,this.propertyType=\"PBRSpecularGlossiness\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new x(this.graph,\"diffuseTextureInfo\"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new x(this.graph,\"specularGlossinessTextureInfo\")})}getDiffuseFactor(){return this.get(\"diffuseFactor\")}setDiffuseFactor(e){return this.set(\"diffuseFactor\",e)}getDiffuseHex(){return p.factorToHex(this.getDiffuseFactor())}setDiffuseHex(e){const t=this.getDiffuseFactor().slice();return this.setDiffuseFactor(p.hexToFactor(e,t))}getDiffuseTexture(){return this.getRef(\"diffuseTexture\")}getDiffuseTextureInfo(){return this.getRef(\"diffuseTexture\")?this.getRef(\"diffuseTextureInfo\"):null}setDiffuseTexture(e){return this.setRef(\"diffuseTexture\",e,{channels:st|nt|rt|ot,isColor:!0})}getSpecularFactor(){return this.get(\"specularFactor\")}setSpecularFactor(e){return this.set(\"specularFactor\",e)}getGlossinessFactor(){return this.get(\"glossinessFactor\")}setGlossinessFactor(e){return this.set(\"glossinessFactor\",e)}getSpecularGlossinessTexture(){return this.getRef(\"specularGlossinessTexture\")}getSpecularGlossinessTextureInfo(){return this.getRef(\"specularGlossinessTexture\")?this.getRef(\"specularGlossinessTextureInfo\"):null}setSpecularGlossinessTexture(e){return this.setRef(\"specularGlossinessTexture\",e,{channels:st|nt|rt|ot})}}it.EXTENSION_NAME=_;const at=_;class ct extends s{constructor(...e){super(...e),this.extensionName=at}createPBRSpecularGlossiness(){return new it(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[at]){const r=this.createPBRSpecularGlossiness();e.materials[n].setExtension(at,r);const o=t.extensions[at];if(void 0!==o.diffuseFactor&&r.setDiffuseFactor(o.diffuseFactor),void 0!==o.specularFactor&&r.setSpecularFactor(o.specularFactor),void 0!==o.glossinessFactor&&r.setGlossinessFactor(o.glossinessFactor),void 0!==o.diffuseTexture){const t=o.diffuseTexture;r.setDiffuseTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getDiffuseTextureInfo(),t)}if(void 0!==o.specularGlossinessTexture){const t=o.specularGlossinessTexture;r.setSpecularGlossinessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularGlossinessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(at);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[at]={diffuseFactor:n.getDiffuseFactor(),specularFactor:n.getSpecularFactor(),glossinessFactor:n.getGlossinessFactor()};if(n.getDiffuseTexture()){const t=n.getDiffuseTexture(),s=n.getDiffuseTextureInfo();i.diffuseTexture=e.createTextureInfoDef(t,s)}if(n.getSpecularGlossinessTexture()){const t=n.getSpecularGlossinessTexture(),s=n.getSpecularGlossinessTextureInfo();i.specularGlossinessTexture=e.createTextureInfoDef(t,s)}}}),this}}ct.EXTENSION_NAME=at;const{R:ut,G:lt,B:ht,A:ft}=d;class gt extends e{init(){this.extensionName=w,this.propertyType=\"Sheen\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new x(this.graph,\"sheenColorTextureInfo\"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new x(this.graph,\"sheenRoughnessTextureInfo\")})}getSheenColorFactor(){return this.get(\"sheenColorFactor\")}getSheenColorHex(){return p.factorToHex(this.getSheenColorFactor())}setSheenColorFactor(e){return this.set(\"sheenColorFactor\",e)}setSheenColorHex(e){const t=this.getSheenColorFactor().slice();return this.set(\"sheenColorFactor\",p.hexToFactor(e,t))}getSheenColorTexture(){return this.getRef(\"sheenColorTexture\")}getSheenColorTextureInfo(){return this.getRef(\"sheenColorTexture\")?this.getRef(\"sheenColorTextureInfo\"):null}setSheenColorTexture(e){return this.setRef(\"sheenColorTexture\",e,{channels:ut|lt|ht,isColor:!0})}getSheenRoughnessFactor(){return this.get(\"sheenRoughnessFactor\")}setSheenRoughnessFactor(e){return this.set(\"sheenRoughnessFactor\",e)}getSheenRoughnessTexture(){return this.getRef(\"sheenRoughnessTexture\")}getSheenRoughnessTextureInfo(){return this.getRef(\"sheenRoughnessTexture\")?this.getRef(\"sheenRoughnessTextureInfo\"):null}setSheenRoughnessTexture(e){return this.setRef(\"sheenRoughnessTexture\",e,{channels:ft})}}gt.EXTENSION_NAME=w;const pt=w;class xt extends s{constructor(...e){super(...e),this.extensionName=pt}createSheen(){return new gt(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[pt]){const r=this.createSheen();e.materials[n].setExtension(pt,r);const o=t.extensions[pt];if(void 0!==o.sheenColorFactor&&r.setSheenColorFactor(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&r.setSheenRoughnessFactor(o.sheenRoughnessFactor),void 0!==o.sheenColorTexture){const t=o.sheenColorTexture;r.setSheenColorTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSheenColorTextureInfo(),t)}if(void 0!==o.sheenRoughnessTexture){const t=o.sheenRoughnessTexture;r.setSheenRoughnessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSheenRoughnessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(pt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[pt]={sheenColorFactor:n.getSheenColorFactor(),sheenRoughnessFactor:n.getSheenRoughnessFactor()};if(n.getSheenColorTexture()){const t=n.getSheenColorTexture(),s=n.getSheenColorTextureInfo();i.sheenColorTexture=e.createTextureInfoDef(t,s)}if(n.getSheenRoughnessTexture()){const t=n.getSheenRoughnessTexture(),s=n.getSheenRoughnessTextureInfo();i.sheenRoughnessTexture=e.createTextureInfoDef(t,s)}}}),this}}xt.EXTENSION_NAME=pt;const{R:dt,G:Tt,B:mt,A:Et}=d;class It extends e{init(){this.extensionName=D,this.propertyType=\"Specular\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new x(this.graph,\"specularTextureInfo\"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new x(this.graph,\"specularColorTextureInfo\")})}getSpecularFactor(){return this.get(\"specularFactor\")}setSpecularFactor(e){return this.set(\"specularFactor\",e)}getSpecularColorFactor(){return this.get(\"specularColorFactor\")}setSpecularColorFactor(e){return this.set(\"specularColorFactor\",e)}getSpecularColorHex(){return p.factorToHex(this.getSpecularColorFactor())}setSpecularColorHex(e){const t=this.getSpecularColorFactor().slice();return this.set(\"specularColorFactor\",p.hexToFactor(e,t))}getSpecularTexture(){return this.getRef(\"specularTexture\")}getSpecularTextureInfo(){return this.getRef(\"specularTexture\")?this.getRef(\"specularTextureInfo\"):null}setSpecularTexture(e){return this.setRef(\"specularTexture\",e,{channels:Et})}getSpecularColorTexture(){return this.getRef(\"specularColorTexture\")}getSpecularColorTextureInfo(){return this.getRef(\"specularColorTexture\")?this.getRef(\"specularColorTextureInfo\"):null}setSpecularColorTexture(e){return this.setRef(\"specularColorTexture\",e,{channels:dt|Tt|mt,isColor:!0})}}It.EXTENSION_NAME=D;const Nt=D;class Rt extends s{constructor(...e){super(...e),this.extensionName=Nt}createSpecular(){return new It(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Nt]){const r=this.createSpecular();e.materials[n].setExtension(Nt,r);const o=t.extensions[Nt];if(void 0!==o.specularFactor&&r.setSpecularFactor(o.specularFactor),void 0!==o.specularColorFactor&&r.setSpecularColorFactor(o.specularColorFactor),void 0!==o.specularTexture){const t=o.specularTexture;r.setSpecularTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularTextureInfo(),t)}if(void 0!==o.specularColorTexture){const t=o.specularColorTexture;r.setSpecularColorTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularColorTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Nt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Nt]={};if(1!==n.getSpecularFactor()&&(i.specularFactor=n.getSpecularFactor()),l.eq(n.getSpecularColorFactor(),[1,1,1])||(i.specularColorFactor=n.getSpecularColorFactor()),n.getSpecularTexture()){const t=n.getSpecularTexture(),s=n.getSpecularTextureInfo();i.specularTexture=e.createTextureInfoDef(t,s)}if(n.getSpecularColorTexture()){const t=n.getSpecularColorTexture(),s=n.getSpecularColorTextureInfo();i.specularColorTexture=e.createTextureInfoDef(t,s)}}}),this}}Rt.EXTENSION_NAME=Nt;const{R:yt}=d;class At extends e{init(){this.extensionName=b,this.propertyType=\"Transmission\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new x(this.graph,\"transmissionTextureInfo\")})}getTransmissionFactor(){return this.get(\"transmissionFactor\")}setTransmissionFactor(e){return this.set(\"transmissionFactor\",e)}getTransmissionTexture(){return this.getRef(\"transmissionTexture\")}getTransmissionTextureInfo(){return this.getRef(\"transmissionTexture\")?this.getRef(\"transmissionTextureInfo\"):null}setTransmissionTexture(e){return this.setRef(\"transmissionTexture\",e,{channels:yt})}}At.EXTENSION_NAME=b;const St=b;class Ct extends s{constructor(...e){super(...e),this.extensionName=St}createTransmission(){return new At(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[St]){const r=this.createTransmission();e.materials[n].setExtension(St,r);const o=t.extensions[St];if(void 0!==o.transmissionFactor&&r.setTransmissionFactor(o.transmissionFactor),void 0!==o.transmissionTexture){const t=o.transmissionTexture;r.setTransmissionTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getTransmissionTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(St);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[St]={transmissionFactor:n.getTransmissionFactor()};if(n.getTransmissionTexture()){const t=n.getTransmissionTexture(),s=n.getTransmissionTextureInfo();i.transmissionTexture=e.createTextureInfoDef(t,s)}}}),this}}Ct.EXTENSION_NAME=St;class Mt extends e{init(){this.extensionName=F,this.propertyType=\"Unlit\",this.parentTypes=[t.MATERIAL]}}Mt.EXTENSION_NAME=F;const Ot=F;class _t extends s{constructor(...e){super(...e),this.extensionName=Ot}createUnlit(){return new Mt(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{t.extensions&&t.extensions[Ot]&&e.materials[s].setExtension(Ot,this.createUnlit())}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{if(s.getExtension(Ot)){const n=e.materialIndexMap.get(s),r=t.json.materials[n];r.extensions=r.extensions||{},r.extensions[Ot]={}}}),this}}_t.EXTENSION_NAME=Ot;class wt extends e{init(){this.extensionName=v,this.propertyType=\"Mapping\",this.parentTypes=[\"MappingList\"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:[]})}getMaterial(){return this.getRef(\"material\")}setMaterial(e){return this.setRef(\"material\",e)}addVariant(e){return this.addRef(\"variants\",e)}removeVariant(e){return this.removeRef(\"variants\",e)}listVariants(){return this.listRefs(\"variants\")}}wt.EXTENSION_NAME=v;class Dt extends e{init(){this.extensionName=v,this.propertyType=\"MappingList\",this.parentTypes=[t.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:[]})}addMapping(e){return this.addRef(\"mappings\",e)}removeMapping(e){return this.removeRef(\"mappings\",e)}listMappings(){return this.listRefs(\"mappings\")}}Dt.EXTENSION_NAME=v;class bt extends e{init(){this.extensionName=v,this.propertyType=\"Variant\",this.parentTypes=[\"MappingList\"]}}bt.EXTENSION_NAME=v;const Ft=v;class jt extends s{constructor(...e){super(...e),this.extensionName=Ft}createMappingList(){return new Dt(this.document.getGraph())}createVariant(e=\"\"){return new bt(this.document.getGraph(),e)}createMapping(){return new wt(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof bt)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[Ft])return this;const s=(t.json.extensions[Ft].variants||[]).map(e=>this.createVariant().setName(e.name||\"\"));return(t.json.meshes||[]).forEach((t,n)=>{const r=e.meshes[n];(t.primitives||[]).forEach((t,n)=>{if(!t.extensions||!t.extensions[Ft])return;const o=this.createMappingList(),i=t.extensions[Ft];for(const t of i.mappings){const n=this.createMapping();void 0!==t.material&&n.setMaterial(e.materials[t.material]);for(const e of t.variants||[])n.addVariant(s[e]);o.addMapping(n)}r.listPrimitives()[n].setExtension(Ft,o)})}),this}write(e){const t=e.jsonDoc,s=this.listVariants();if(!s.length)return this;const n=[],r=new Map;for(const t of s)r.set(t,n.length),n.push(e.createPropertyDef(t));for(const t of this.document.getRoot().listMeshes()){const s=e.meshIndexMap.get(t);t.listPrimitives().forEach((t,n)=>{const o=t.getExtension(Ft);if(!o)return;const i=e.jsonDoc.json.meshes[s].primitives[n],a=o.listMappings().map(t=>{const s=e.createPropertyDef(t),n=t.getMaterial();return n&&(s.material=e.materialIndexMap.get(n)),s.variants=t.listVariants().map(e=>r.get(e)),s});i.extensions=i.extensions||{},i.extensions[Ft]={mappings:a}})}return t.json.extensions=t.json.extensions||{},t.json.extensions[Ft]={variants:n},this}}jt.EXTENSION_NAME=Ft;const{G:vt}=d;class kt extends e{init(){this.extensionName=j,this.propertyType=\"Volume\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new x(this.graph,\"thicknessTexture\"),attenuationDistance:Infinity,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get(\"thicknessFactor\")}setThicknessFactor(e){return this.set(\"thicknessFactor\",e)}getThicknessTexture(){return this.getRef(\"thicknessTexture\")}getThicknessTextureInfo(){return this.getRef(\"thicknessTexture\")?this.getRef(\"thicknessTextureInfo\"):null}setThicknessTexture(e){return this.setRef(\"thicknessTexture\",e,{channels:vt})}getAttenuationDistance(){return this.get(\"attenuationDistance\")}setAttenuationDistance(e){return this.set(\"attenuationDistance\",e)}getAttenuationColor(){return this.get(\"attenuationColor\")}setAttenuationColor(e){return this.set(\"attenuationColor\",e)}getAttenuationColorHex(){return p.factorToHex(this.getAttenuationColor())}setAttenuationColorHex(e){const t=this.getAttenuationColor().slice();return this.set(\"attenuationColor\",p.hexToFactor(e,t))}}kt.EXTENSION_NAME=j;const Bt=j;class Gt extends s{constructor(...e){super(...e),this.extensionName=Bt}createVolume(){return new kt(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Bt]){const r=this.createVolume();e.materials[n].setExtension(Bt,r);const o=t.extensions[Bt];if(void 0!==o.thicknessFactor&&r.setThicknessFactor(o.thicknessFactor),void 0!==o.attenuationDistance&&r.setAttenuationDistance(o.attenuationDistance),void 0!==o.attenuationColor&&r.setAttenuationColor(o.attenuationColor),void 0!==o.thicknessTexture){const t=o.thicknessTexture;r.setThicknessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getThicknessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Bt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Bt]={};if(n.getThicknessFactor()>0&&(i.thicknessFactor=n.getThicknessFactor()),Number.isFinite(n.getAttenuationDistance())&&(i.attenuationDistance=n.getAttenuationDistance()),l.eq(n.getAttenuationColor(),[1,1,1])||(i.attenuationColor=n.getAttenuationColor()),n.getThicknessTexture()){const t=n.getThicknessTexture(),s=n.getThicknessTextureInfo();i.thicknessTexture=e.createTextureInfoDef(t,s)}}}),this}}Gt.EXTENSION_NAME=Bt;const Lt=\"KHR_mesh_quantization\";class Ut extends s{constructor(...e){super(...e),this.extensionName=Lt}read(e){return this}write(e){return this}}Ut.EXTENSION_NAME=Lt;const Vt=\"KHR_texture_basisu\";class Pt{match(e){return 171===e[0]&&75===e[1]&&84===e[2]&&88===e[3]&&32===e[4]&&50===e[5]&&48===e[6]&&187===e[7]&&13===e[8]&&10===e[9]&&26===e[10]&&10===e[11]}getSize(e){const t=T(e);return[t.pixelWidth,t.pixelHeight]}getChannels(e){const t=T(e).dataFormatDescriptor[0];if(t.colorModel===m)return 2===t.samples.length&&15==(15&t.samples[1].channelType)?4:3;if(t.colorModel===E)return 3==(15&t.samples[0].channelType)?4:3;throw new Error(`Unexpected KTX2 colorModel, \"${t.colorModel}\".`)}getVRAMByteLength(e){const t=T(e),s=this.getChannels(e)>3;let n=0;for(let e=0;e{e.extensions&&e.extensions[Vt]&&(e.source=e.extensions[Vt].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/ktx2\"===s.getMimeType()){const n=e.imageIndexMap.get(s);t.json.textures.forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[Vt]={source:e.source},delete e.source)})}}),this}}Xt.EXTENSION_NAME=Vt;class Ht extends e{init(){this.extensionName=k,this.propertyType=\"Transform\",this.parentTypes=[t.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get(\"offset\")}setOffset(e){return this.set(\"offset\",e)}getRotation(){return this.get(\"rotation\")}setRotation(e){return this.set(\"rotation\",e)}getScale(){return this.get(\"scale\")}setScale(e){return this.set(\"scale\",e)}getTexCoord(){return this.get(\"texCoord\")}setTexCoord(e){return this.set(\"texCoord\",e)}}Ht.EXTENSION_NAME=k;const zt=k;class $t extends s{constructor(...e){super(...e),this.extensionName=zt}createTransform(){return new Ht(this.document.getGraph())}read(e){for(const[t,s]of Array.from(e.textureInfos.entries())){if(!s.extensions||!s.extensions[zt])continue;const e=this.createTransform(),n=s.extensions[zt];void 0!==n.offset&&e.setOffset(n.offset),void 0!==n.rotation&&e.setRotation(n.rotation),void 0!==n.scale&&e.setScale(n.scale),void 0!==n.texCoord&&e.setTexCoord(n.texCoord),t.setExtension(zt,e)}return this}write(e){const t=Array.from(e.textureInfoDefMap.entries());for(const[e,s]of t){const t=e.getExtension(zt);if(!t)continue;s.extensions=s.extensions||{};const n={},r=l.eq;r(t.getOffset(),[0,0])||(n.offset=t.getOffset()),0!==t.getRotation()&&(n.rotation=t.getRotation()),r(t.getScale(),[1,1])||(n.scale=t.getScale()),null!=t.getTexCoord()&&(n.texCoord=t.getTexCoord()),s.extensions[zt]=n}return this}}$t.EXTENSION_NAME=zt;const qt=[t.ROOT,t.SCENE,t.NODE,t.MESH,t.MATERIAL,t.TEXTURE,t.ANIMATION];class Kt extends e{init(){this.extensionName=B,this.propertyType=\"Packet\",this.parentTypes=qt}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get(\"context\")}setContext(e){return this.set(\"context\",P({},e))}listProperties(){return Object.keys(this.get(\"properties\"))}getProperty(e){const t=this.get(\"properties\");return e in t?t[e]:null}setProperty(e,t){this._assertContext(e);const s=P({},this.get(\"properties\"));return t?s[e]=t:delete s[e],this.set(\"properties\",s)}toJSONLD(){return P({\"@context\":Yt(this.get(\"context\"))},Yt(this.get(\"properties\")))}fromJSONLD(e){const t=(e=Yt(e))[\"@context\"];return t&&this.set(\"context\",t),delete e[\"@context\"],this.set(\"properties\",e)}_assertContext(e){if(!(e.split(\":\")[0]in this.get(\"context\")))throw new Error(`${B}: Missing context for term, \"${e}\".`)}}function Yt(e){return JSON.parse(JSON.stringify(e))}Kt.EXTENSION_NAME=B;const Qt=B;class Wt extends s{constructor(...e){super(...e),this.extensionName=Qt}createPacket(){return new Kt(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(e){var t;const s=null==(t=e.jsonDoc.json.extensions)?void 0:t[Qt];if(!s||!s.packets)return this;const n=e.jsonDoc.json,r=this.document.getRoot(),o=s.packets.map(e=>this.createPacket().fromJSONLD(e)),i=[[n.asset],n.scenes,n.nodes,n.meshes,n.materials,n.images,n.animations],a=[[r],r.listScenes(),r.listNodes(),r.listMeshes(),r.listMaterials(),r.listTextures(),r.listAnimations()];for(let e=0;e0&&(s.extensions=s.extensions||{},s.extensions[Qt]={packets:n}),this}}Wt.EXTENSION_NAME=Qt;const Jt=[Oe,be,Ge,He,qe,Qe,tt,ct,Rt,xt,Ct,_t,jt,Gt,Ut,Xt,$t,Wt],Zt=[V,ne,ie,le,...Jt];export{Zt as ALL_EXTENSIONS,ke as Anisotropy,Pe as Clearcoat,V as EXTMeshGPUInstancing,ne as EXTMeshoptCompression,ie as EXTTextureAVIF,le as EXTTextureWebP,ze as EmissiveStrength,G as INSTANCE_ATTRIBUTE,Ke as IOR,L as InstancedMesh,Ze as Iridescence,Oe as KHRDracoMeshCompression,be as KHRLightsPunctual,Ge as KHRMaterialsAnisotropy,He as KHRMaterialsClearcoat,qe as KHRMaterialsEmissiveStrength,Qe as KHRMaterialsIOR,tt as KHRMaterialsIridescence,ct as KHRMaterialsPBRSpecularGlossiness,xt as KHRMaterialsSheen,Rt as KHRMaterialsSpecular,Ct as KHRMaterialsTransmission,_t as KHRMaterialsUnlit,jt as KHRMaterialsVariants,Gt as KHRMaterialsVolume,Ut as KHRMeshQuantization,Jt as KHRONOS_EXTENSIONS,Xt as KHRTextureBasisu,$t as KHRTextureTransform,Wt as KHRXMP,we as Light,wt as Mapping,Dt as MappingList,it as PBRSpecularGlossiness,Kt as Packet,gt as Sheen,It as Specular,Ht as Transform,At as Transmission,Mt as Unlit,bt as Variant,kt as Volume};\n//# sourceMappingURL=extensions.modern.js.map\n","var e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function t(){var e=this;function t(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.build_tree=function(n){var i,r,a,o=e.dyn_tree,s=e.stat_desc.static_tree,l=e.stat_desc.elems,f=-1;for(n.heap_len=0,n.heap_max=573,i=0;i=1;i--)n.pqdownheap(o,i);a=l;do{i=n.heap[1],n.heap[1]=n.heap[n.heap_len--],n.pqdownheap(o,1),r=n.heap[1],n.heap[--n.heap_max]=i,n.heap[--n.heap_max]=r,o[2*a]=o[2*i]+o[2*r],n.depth[a]=Math.max(n.depth[i],n.depth[r])+1,o[2*i+1]=o[2*r+1]=a,n.heap[1]=a++,n.pqdownheap(o,1)}while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],function(t){var n,i,r,a,o,s,l=e.dyn_tree,f=e.stat_desc.static_tree,u=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,c=e.stat_desc.max_length,_=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(a=l[2*l[2*(i=t.heap[n])+1]+1]+1)>c&&(a=c,_++),l[2*i+1]=a,i>e.max_code||(t.bl_count[a]++,o=0,i>=d&&(o=u[i-d]),t.opt_len+=(s=l[2*i])*(a+o),f&&(t.static_len+=s*(f[2*i+1]+o)));if(0!==_){do{for(a=c-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[c]--,_-=2}while(_>0);for(a=c;0!==a;a--)for(i=t.bl_count[a];0!==i;)(r=t.heap[--n])>e.max_code||(l[2*r+1]!=a&&(t.opt_len+=(a-l[2*r+1])*l[2*r],l[2*r+1]=a),i--)}}(n),function(e,n,i){var r,a,o,s=[],l=0;for(r=1;r<=15;r++)s[r]=l=l+i[r-1]<<1;for(a=0;a<=n;a++)0!==(o=e[2*a+1])&&(e[2*a]=t(s[o]++,o))}(o,e.max_code,n.bl_count)}}function n(e,t,n,i,r){var a=this;a.static_tree=e,a.extra_bits=t,a.extra_base=n,a.elems=i,a.max_length=r}function i(e,t,n,i,r){var a=this;a.good_length=e,a.max_lazy=t,a.nice_length=n,a.max_chain=i,a.func=r}t._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],t.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],t.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],t.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},t.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],t.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],t.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],t.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],n.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],n.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],n.static_l_desc=new n(n.static_ltree,t.extra_lbits,257,286,15),n.static_d_desc=new n(n.static_dtree,t.extra_dbits,0,30,15),n.static_bl_desc=new n(null,t.extra_blbits,0,19,7);var r=[new i(0,0,0,0,0),new i(4,4,8,4,1),new i(4,5,16,8,1),new i(4,6,32,32,1),new i(4,4,16,16,2),new i(8,16,32,32,2),new i(8,16,128,128,2),new i(8,32,128,256,2),new i(32,128,258,1024,2),new i(32,258,258,4096,2)],a=[\"need dictionary\",\"stream end\",\"\",\"\",\"stream error\",\"data error\",\"\",\"buffer error\",\"\",\"\"];function o(e,t,n,i){var r=e[2*t],a=e[2*n];return r>>8&255)}function ee(e,t){var n,i=t;q>16-i?(X(V|=(n=e)<>>16-q,q+=i-16):(V|=e<=8&&(Q(255&V),V>>>=8,q-=8)}function re(e,n){var i,r,a;if($.pending_buf[N+2*Z]=e>>>8&255,$.pending_buf[N+2*Z+1]=255&e,$.pending_buf[L+Z]=255&n,Z++,0===e?B[2*n]++:(j++,e--,B[2*(t._length_code[n]+256+1)]++,I[2*t.d_code(e)]++),0==(8191&Z)&&F>2){for(i=8*Z,r=z-g,a=0;a<30;a++)i+=I[2*a]*(5+t.extra_dbits[a]);if(i>>>=3,j8?X(V):q>0&&Q(255&V),V=0,q=0}function se(e,t,n){ee(0+(n?1:0),3),function(e,t,n){oe(),O=8,X(t),X(~t),$.pending_buf.set(c.subarray(e,e+t),$.pending),$.pending+=t}(e,t)}function le(i){(function(e,i,r){var a,o,s=0;F>0?(G.build_tree($),H.build_tree($),s=function(){var e;for(K(B,G.max_code),K(I,H.max_code),Y.build_tree($),e=18;e>=3&&0===C[2*t.bl_order[e]+1];e--);return $.opt_len+=3*(e+1)+5+5+4,e}(),(o=$.static_len+3+7>>>3)<=(a=$.opt_len+3+7>>>3)&&(a=o)):a=o=i+5,i+4<=a&&-1!=e?se(e,i,r):o==a?(ee(2+(r?1:0),3),ae(n.static_ltree,n.static_dtree)):(ee(4+(r?1:0),3),function(e,n,i){var r;for(ee(e-257,5),ee(n-1,5),ee(i-4,4),r=0;r=0?g:-1,z-g,i),g=z,e.flush_pending()}function fe(){var t,n,i,r;do{if(0==(r=_-D-z)&&0===z&&0===D)r=f;else if(-1==r)r--;else if(z>=f+f-262){c.set(c.subarray(f,f+f),0),E-=f,z-=f,g-=f,i=t=v;do{n=65535&p[--i],p[i]=n>=f?n-f:0}while(0!=--t);i=t=f;do{n=65535&h[--i],h[i]=n>=f?n-f:0}while(0!=--t);r+=f}if(0===e.avail_in)return;t=e.read_buf(c,z+D,r),(D+=t)>=3&&(w=((w=255&c[z])<f-262?z-(f-262):0,s=M,l=d,u=z+258,_=c[r+a-1],p=c[r+a];A>=W&&(i>>=2),s>D&&(s=D);do{if(c[(t=e)+a]==p&&c[t+a-1]==_&&c[t]==c[r]&&c[++t]==c[r+1]){r+=2,t++;do{}while(c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&c[++r]==c[++t]&&ra){if(E=e,a=n,n>=s)break;_=c[r+a-1],p=c[r+a]}}}while((e=65535&h[e&l])>o&&0!=--i);return a<=D?a:D}$.depth=[],$.bl_count=[],$.heap=[],B=[],I=[],C=[],$.pqdownheap=function(e,t){for(var n=$.heap,i=n[t],r=t<<1;r<=$.heap_len&&(r<$.heap_len&&o(e,n[r+1],n[r],$.depth)&&r++,!o(e,i,n[r],$.depth));)n[t]=n[r],t=r,r<<=1;n[t]=i},$.deflateInit=function(e,t,a,o,k,E){return o||(o=8),k||(k=8),E||(E=0),e.msg=null,-1==t&&(t=6),k<1||k>9||8!=o||a<9||a>15||t<0||t>9||E<0||E>2?-2:(e.dstate=$,d=(f=1<<(u=a))-1,x=(v=1<<(b=k+7))-1,m=Math.floor((b+3-1)/3),c=new Uint8Array(2*f),h=[],p=[],P=1<9||n<0||n>2?-2:(r[F].func!=r[t].func&&0!==e.total_in&&(i=e.deflate(1)),F!=t&&(R=r[F=t].max_lazy,W=r[F].good_length,M=r[F].nice_length,S=r[F].max_chain),T=n,i)},$.deflateSetDictionary=function(e,t,n){var r,a=n,o=0;if(!t||42!=i)return-2;if(a<3)return 0;for(a>f-262&&(o=n-(a=f-262)),c.set(t.subarray(o,o+a),0),z=a,g=a,w=((w=255&c[0])<4||o<0)return-2;if(!t.next_out||!t.next_in&&0!==t.avail_in||666==i&&4!=o)return t.msg=a[4],-2;if(0===t.avail_out)return t.msg=a[7],-5;if(e=t,W=l,l=o,42==i&&(b=8+(u-8<<4)<<8,(S=(F-1&255)>>1)>3&&(S=3),b|=S<<6,0!==z&&(b|=32),i=113,Q((B=b+=31-b%31)>>8&255),Q(255&B)),0!==$.pending){if(e.flush_pending(),0===e.avail_out)return l=-1,0}else if(0===e.avail_in&&o<=W&&4!=o)return e.msg=a[7],-5;if(666==i&&0!==e.avail_in)return t.msg=a[7],-5;if(0!==e.avail_in||0!==D||0!=o&&666!=i){switch(M=-1,r[F].func){case 0:M=function(t){var n,i=65535;for(i>s-5&&(i=s-5);;){if(D<=1){if(fe(),0===D&&0==t)return 0;if(0===D)break}if(z+=D,D=0,n=g+i,(0===z||z>=n)&&(D=z-n,z=n,le(!1),0===e.avail_out))return 0;if(z-g>=f-262&&(le(!1),0===e.avail_out))return 0}return le(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(o);break;case 1:M=function(t){for(var n,i=0;;){if(D<262){if(fe(),D<262&&0==t)return 0;if(0===D)break}if(D>=3&&(i=65535&p[w=(w<=3)if(n=re(z-E,y-3),D-=y,y<=R&&D>=3){y--;do{z++,i=65535&p[w=(w<=3&&(r=65535&p[w=(w<4096)&&(y=2)),A>=3&&y<=A){i=z+D-3,n=re(z-1-k,A-3),D-=A-1,A-=2;do{++z<=i&&(r=65535&p[w=(w<0&&t.next_in_index!=s&&(r(t.next_in_index),s=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return a=new Uint8Array(f),o.forEach(function(e){a.set(e,l),l+=e.length}),a}},this.flush=function(){var e,r,a=[],o=0,s=0;do{if(t.next_out_index=0,t.avail_out=n,1!=(e=t.deflate(4))&&0!=e)throw new Error(\"deflating: \"+t.msg);n-t.avail_out>0&&a.push(new Uint8Array(i.subarray(0,t.next_out_index))),s+=t.next_out_index}while(t.avail_in>0||0===t.avail_out);return t.deflateEnd(),r=new Uint8Array(s),a.forEach(function(e){r.set(e,o),o+=e.length}),r}}l.prototype={deflateInit:function(e,t){var n=this;return n.dstate=new s,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){var t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){var e=this;if(!e.dstate)return-2;var t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){var n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){var n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){var i=this,r=i.avail_in;return r>n&&(r=n),0===r?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){var e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}},self._zipjs_Deflater=f;var u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],d=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],c=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],_=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],p=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],w=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function v(){var e,t,n,i,r,a;function o(e,t,o,s,l,f,u,d,c,_,h){var p,w,v,b,x,m,g,y,k,U,z,E,D,A,S;U=0,x=o;do{n[e[t+U]]++,U++,x--}while(0!==x);if(n[0]==o)return u[0]=-1,d[0]=0,0;for(y=d[0],m=1;m<=15&&0===n[m];m++);for(g=m,yx&&(y=x),d[0]=y,A=1<E+y;){if(b++,S=(S=v-(E+=y))>y?y:S,(w=1<<(m=g-E))>p+1&&(w-=p+1,D=g,m1440)return-3;r[b]=z=_[0],_[0]+=S,0!==b?(a[b]=x,i[0]=m,i[1]=y,i[2]=z-r[b-1]-(m=x>>>E-y),c.set(i,3*(r[b-1]+m))):u[0]=z}for(i[1]=g-E,U>=o?i[0]=192:h[U]>>E;m>>=1)x^=m;for(x^=m,k=(1<257?(-3==v?c.msg=\"oversubscribed distance tree\":-5==v?(c.msg=\"incomplete distance tree\",v=-3):-4!=v&&(c.msg=\"empty distance tree with lengths\",v=-3),v):0)}}function b(){var e,t,n,i,r=this,a=0,o=0,s=0,l=0,f=0,d=0,c=0,_=0,h=0,p=0;function w(e,t,n,i,r,a,o,s){var l,f,d,c,_,h,p,w,v,b,x,m,g,y,k,U;p=s.next_in_index,w=s.avail_in,_=o.bitb,h=o.bitk,b=(v=o.write)>=f[U+1],h-=f[U+1],0!=(16&c)){for(g=f[U+2]+(_&u[c&=15]),_>>=c,h-=c;h<15;)w--,_|=(255&s.read_byte(p++))<>=f[U+1],h-=f[U+1],0!=(16&c)){for(c&=15;h>=c,h-=c,b-=g,v>=y)v-(k=v-y)>0&&2>v-k?(o.window[v++]=o.window[k++],o.window[v++]=o.window[k++],g-=2):(o.window.set(o.window.subarray(k,k+2),v),v+=2,k+=2,g-=2);else{k=v-y;do{k+=o.end}while(k<0);if(g>(c=o.end-k)){if(g-=c,v-k>0&&c>v-k)do{o.window[v++]=o.window[k++]}while(0!=--c);else o.window.set(o.window.subarray(k,k+c),v),v+=c,k+=c,c=0;k=0}}if(v-k>0&&g>v-k)do{o.window[v++]=o.window[k++]}while(0!=--g);else o.window.set(o.window.subarray(k,k+g),v),v+=g,k+=g,g=0;break}if(0!=(64&c))return s.msg=\"invalid distance code\",w+=g=h>>3<(g=s.avail_in-w)?h>>3:g,p-=g,h-=g<<3,o.bitb=_,o.bitk=h,s.avail_in=w,s.total_in+=p-s.next_in_index,s.next_in_index=p,o.write=v,-3;l+=f[U+2],c=f[U=3*(d+(l+=_&u[c]))]}break}if(0!=(64&c))return 0!=(32&c)?(w+=g=h>>3<(g=s.avail_in-w)?h>>3:g,p-=g,h-=g<<3,o.bitb=_,o.bitk=h,s.avail_in=w,s.total_in+=p-s.next_in_index,s.next_in_index=p,o.write=v,1):(s.msg=\"invalid literal/length code\",w+=g=h>>3<(g=s.avail_in-w)?h>>3:g,p-=g,h-=g<<3,o.bitb=_,o.bitk=h,s.avail_in=w,s.total_in+=p-s.next_in_index,s.next_in_index=p,o.write=v,-3);if(l+=f[U+2],0===(c=f[U=3*(d+(l+=_&u[c]))])){_>>=f[U+1],h-=f[U+1],o.window[v++]=f[U+2],b--;break}}else _>>=f[U+1],h-=f[U+1],o.window[v++]=f[U+2],b--}while(b>=258&&w>=10);return w+=g=h>>3<(g=s.avail_in-w)?h>>3:g,p-=g,h-=g<<3,o.bitb=_,o.bitk=h,s.avail_in=w,s.total_in+=p-s.next_in_index,s.next_in_index=p,o.write=v,0}r.init=function(r,a,o,s,l,f){e=0,c=r,_=a,n=o,h=s,i=l,p=f,t=null},r.proc=function(r,v,b){var x,m,g,y,k,U,z,E=0,D=0,A=0;for(A=v.next_in_index,y=v.avail_in,E=r.bitb,D=r.bitk,U=(k=r.write)=258&&y>=10&&(r.bitb=E,r.bitk=D,v.avail_in=y,v.total_in+=A-v.next_in_index,v.next_in_index=A,r.write=k,b=w(c,_,n,h,i,p,r,v),A=v.next_in_index,y=v.avail_in,E=r.bitb,D=r.bitk,U=(k=r.write)>>=t[1+(m=3*(o+(E&u[x])))],D-=t[m+1],0===(g=t[m])){l=t[m+2],e=6;break}if(0!=(16&g)){f=15&g,a=t[m+2],e=2;break}if(0==(64&g)){s=g,o=m/3+t[m+2];break}if(0!=(32&g)){e=7;break}return e=9,v.msg=\"invalid literal/length code\",b=-3,r.bitb=E,r.bitk=D,v.avail_in=y,v.total_in+=A-v.next_in_index,v.next_in_index=A,r.write=k,r.inflate_flush(v,b);case 2:for(x=f;D>=x,D-=x,s=_,t=i,o=p,e=3;case 3:for(x=s;D>=t[1+(m=3*(o+(E&u[x])))],D-=t[m+1],0!=(16&(g=t[m]))){f=15&g,d=t[m+2],e=4;break}if(0==(64&g)){s=g,o=m/3+t[m+2];break}return e=9,v.msg=\"invalid distance code\",b=-3,r.bitb=E,r.bitk=D,v.avail_in=y,v.total_in+=A-v.next_in_index,v.next_in_index=A,r.write=k,r.inflate_flush(v,b);case 4:for(x=f;D>=x,D-=x,e=5;case 5:for(z=k-d;z<0;)z+=r.end;for(;0!==a;){if(0===U&&(k==r.end&&0!==r.read&&(U=(k=0)7&&(D-=8,y++,A--),r.write=k,b=r.inflate_flush(v,b),U=(k=r.write)e.avail_out&&(n=e.avail_out),0!==n&&-5==t&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(i.window.subarray(a,a+n),r),r+=n,(a+=n)==i.end&&(a=0,i.write==i.end&&(i.write=0),(n=i.write-a)>e.avail_out&&(n=e.avail_out),0!==n&&-5==t&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(i.window.subarray(a,a+n),r),r+=n,a+=n),e.next_out_index=r,i.read=a,t},i.proc=function(e,t){var p,w,b,m,g,y,k,U;for(m=e.next_in_index,g=e.avail_in,w=i.bitb,b=i.bitk,k=(y=i.write)>>1){case 0:w>>>=3,w>>>=p=7&(b-=3),b-=p,r=1;break;case 1:var z=[],E=[],D=[[]],A=[[]];v.inflate_trees_fixed(z,E,D,A),d.init(z[0],E[0],D[0],0,A[0],0),w>>>=3,b-=3,r=6;break;case 2:w>>>=3,b-=3,r=3;break;case 3:return w>>>=3,b-=3,r=9,e.msg=\"invalid block type\",t=-3,i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t)}break;case 1:for(;b<32;){if(0===g)return i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);t=0,g--,w|=(255&e.read_byte(m++))<>>16&65535)!=(65535&w))return r=9,e.msg=\"invalid stored block lengths\",t=-3,i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);a=65535&w,w=b=0,r=0!==a?2:0!==c?7:0;break;case 2:if(0===g)return i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);if(0===k&&(y==i.end&&0!==i.read&&(k=(y=0)g&&(p=g),p>k&&(p=k),i.window.set(e.read_buf(m,p),y),m+=p,g-=p,y+=p,k-=p,0!=(a-=p))break;r=0!==c?7:0;break;case 3:for(;b<14;){if(0===g)return i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);t=0,g--,w|=(255&e.read_byte(m++))<29||(p>>5&31)>29)return r=9,e.msg=\"too many length or distance symbols\",t=-3,i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);if(p=258+(31&p)+(p>>5&31),!n||n.length>>=14,b-=14,s=0,r=4;case 4:for(;s<4+(o>>>10);){for(;b<3;){if(0===g)return i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);t=0,g--,w|=(255&e.read_byte(m++))<>>=3,b-=3}for(;s<19;)n[x[s++]]=0;if(l[0]=7,0!=(p=h.inflate_trees_bits(n,l,f,_,e)))return-3==(t=p)&&(n=null,r=9),i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);s=0,r=5;case 5:for(;!(s>=258+(31&(p=o))+(p>>5&31));){var S,R;for(p=l[0];b>>=p,b-=p,n[s++]=R;else{for(U=18==R?7:R-14,S=18==R?11:3;b>>=p)&u[U],w>>>=U,b-=U,(U=s)+S>258+(31&(p=o))+(p>>5&31)||16==R&&U<1)return n=null,r=9,e.msg=\"invalid bit length repeat\",t=-3,i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);R=16==R?n[U-1]:0;do{n[U++]=R}while(0!=--S);s=U}}f[0]=-1;var F=[],T=[],W=[],M=[];if(F[0]=9,T[0]=6,0!=(p=h.inflate_trees_dynamic(257+(31&(p=o)),1+(p>>5&31),n,F,T,W,M,_,e)))return-3==p&&(n=null,r=9),t=p,i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,i.inflate_flush(e,t);d.init(F[0],T[0],_,W[0],_,M[0]),r=6;case 6:if(i.bitb=w,i.bitk=b,e.avail_in=g,e.total_in+=m-e.next_in_index,e.next_in_index=m,i.write=y,1!=(t=d.proc(i,e,t)))return i.inflate_flush(e,t);if(t=0,d.free(e),m=e.next_in_index,g=e.avail_in,w=i.bitb,b=i.bitk,k=(y=i.write)15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new m(n,1<>4)>e.istate.wbits){e.istate.mode=13,e.msg=\"invalid window size\",e.istate.marker=5;break}e.istate.mode=1;case 1:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((e.istate.method<<8)+i)%31!=0){e.istate.mode=13,e.msg=\"incorrect header check\",e.istate.marker=5;break}if(0==(32&i)){e.istate.mode=7;break}e.istate.mode=2;case 2:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,e.istate.mode=3;case 3:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,e.istate.mode=4;case 4:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,e.istate.mode=5;case 5:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.read_byte(e.next_in_index++),e.istate.mode=6,2);case 6:return e.istate.mode=13,e.msg=\"need dictionary\",e.istate.marker=0,-2;case 7:if(-3==(n=e.istate.blocks.proc(e,n))){e.istate.mode=13,e.istate.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,e.istate.blocks.reset(e,e.istate.was),e.istate.mode=12;case 12:return 1;case 13:return-3;default:return-2}},e.inflateSetDictionary=function(e,t,n){var i=0,r=n;return e&&e.istate&&6==e.istate.mode?(r>=1<0&&e.next_in_index!=l&&(r(e.next_in_index),l=e.next_in_index)}while(e.avail_in>0||0===e.avail_out);return o=new Uint8Array(u),s.forEach(function(e){o.set(e,f),f+=e.length}),o}},this.flush=function(){e.inflateEnd()}}k.prototype={inflateInit:function(e){var t=this;return t.istate=new y,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){var t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){var e=this;if(!e.istate)return-2;var t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){var e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){var n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in.subarray(e,e+1)[0]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}},self._zipjs_Inflater=U;var z,E=\"File format is not recognized.\",D=\"Error while reading zip file.\";try{z=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}function A(){this.crc=-1}function S(){}function R(e,t){var n,i;return n=new ArrayBuffer(e),i=new Uint8Array(n),t&&i.set(t,0),{buffer:n,array:i,view:new DataView(n)}}function F(){}function T(e){var t,n=this;n.size=0,n.init=function(i,r){var a=new Blob([e],{type:\"text/plain\"});(t=new M(a)).init(function(){n.size=t.size,i()},r)},n.readUint8Array=function(e,n,i,r){t.readUint8Array(e,n,i,r)}}function W(e){var t,n=this;n.size=0,n.init=function(i){for(var r=e.length;\"=\"==e.charAt(r-1);)r--;t=e.indexOf(\",\")+1,n.size=Math.floor(.75*(r-t)),i()},n.readUint8Array=function(n,i,r){var a,o=R(i),s=4*Math.floor(n/3),l=4*Math.ceil((n+i)/3),f=self.atob(e.substring(s+t,l+t)),u=n-3*Math.floor(s/4);for(a=u;ae.size)throw new RangeError(\"offset:\"+t+\", length:\"+n+\", size:\"+e.size);return e.slice?e.slice(t,t+n):e.webkitSlice?e.webkitSlice(t,t+n):e.mozSlice?e.mozSlice(t,t+n):e.msSlice?e.msSlice(t,t+n):void 0}(e,t,n))}catch(e){r(e)}}}function B(){}function I(e){var t,n=this;n.init=function(e){t=new Blob([],{type:\"text/plain\"}),e()},n.writeUint8Array=function(e,n){t=new Blob([t,z?e:e.buffer],{type:\"text/plain\"}),n()},n.getData=function(n,i){var r=new FileReader;r.onload=function(e){n(e.target.result)},r.onerror=i,r.readAsText(t,e)}}function C(e){var t=this,n=\"\",i=\"\";t.init=function(t){n+=\"data:\"+(e||\"\")+\";base64,\",t()},t.writeUint8Array=function(e,t){var r,a=i.length,o=i;for(i=\"\",r=0;r<3*Math.floor((a+e.length)/3)-a;r++)o+=String.fromCharCode(e[r]);for(;r2?n+=self.btoa(o):i=o,t()},t.getData=function(e){e(n+self.btoa(i))}}function L(e){var t,n=this;n.init=function(n){t=new Blob([],{type:e}),n()},n.writeUint8Array=function(n,i){t=new Blob([t,z?n:n.buffer],{type:e}),i()},n.getData=function(e){e(t)}}function P(e,t,n,i,r,a,o,s,l,f){var u,d,c,_=0,h=t.sn;function p(){e.removeEventListener(\"message\",w,!1),s(d,c)}function w(t){var n=t.data,r=n.data,s=n.error;if(s)return s.toString=function(){return\"Error: \"+this.message},void l(s);if(n.sn===h)switch(\"number\"==typeof n.codecTime&&(e.codecTime+=n.codecTime),\"number\"==typeof n.crcTime&&(e.crcTime+=n.crcTime),n.type){case\"append\":r?(d+=r.length,i.writeUint8Array(r,function(){v()},f)):v();break;case\"flush\":c=n.crc,r?(d+=r.length,i.writeUint8Array(r,function(){p()},f)):p();break;case\"progress\":o&&o(u+n.loaded,a);break;case\"importScripts\":case\"newTask\":case\"echo\":break;default:console.warn(\"zip.js:launchWorkerProcess: unknown message: \",n)}}function v(){(u=524288*_)<=a?n.readUint8Array(r+u,Math.min(524288,a-u),function(n){o&&o(u,a);var i=0===u?t:{sn:h};i.type=\"append\",i.data=n;try{e.postMessage(i,[n.buffer])}catch(t){e.postMessage(i)}_++},l):e.postMessage({sn:h,type:\"flush\"})}d=0,e.addEventListener(\"message\",w,!1),v()}function Z(e,t,n,i,r,a,o,s,l,f){var u,d=0,c=0,_=\"input\"===a,h=\"output\"===a,p=new A;!function a(){var w;if((u=524288*d)127?r[n-128]:String.fromCharCode(n);return i}function O(e){return decodeURIComponent(escape(e))}function V(e){var t,n=\"\";for(t=0;t>16,n=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(n+10,!0),e.compressedSize=t.view.getUint32(n+14,!0),e.uncompressedSize=t.view.getUint32(n+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(n+22,!0),e.extraFieldLength=t.view.getUint16(n+24,!0)):r(\"File is using Zip64 (4gb+ file size).\")):r(\"File contains encrypted entry.\")}function $(e){return unescape(encodeURIComponent(e))}function G(e){var t,n=[];for(t=0;t>>8^n[255&(t^e[i])];this.crc=t},A.prototype.get=function(){return~this.crc},A.prototype.table=function(){var e,t,n,i=[];for(e=0;e<256;e++){for(n=e,t=0;t<8;t++)1&n?n=n>>>1^3988292384:n>>>=1;i[e]=n}return i}(),S.prototype.append=function(e,t){return e},S.prototype.flush=function(){},(T.prototype=new F).constructor=T,(W.prototype=new F).constructor=W,(M.prototype=new F).constructor=M,B.prototype.getData=function(e){e(this.data)},(I.prototype=new B).constructor=I,(C.prototype=new B).constructor=C,(L.prototype=new B).constructor=L;var H={deflater:[\"z-worker.js\",\"deflate.js\"],inflater:[\"z-worker.js\",\"inflate.js\"]};function Y(e,t,n){if(null===K.workerScripts||null===K.workerScriptsPath){var i,r,a;if(K.workerScripts){if(i=K.workerScripts[e],!Array.isArray(i))return void n(new Error(\"zip.workerScripts.\"+e+\" is not an array!\"));r=i,a=document.createElement(\"a\"),i=r.map(function(e){return a.href=e,a.href})}else(i=H[e].slice(0))[0]=(K.workerScriptsPath||\"\")+i[0];var o=new Worker(i[0]);o.codecTime=o.crcTime=0,o.postMessage({type:\"importScripts\",scripts:i.slice(1)}),o.addEventListener(\"message\",function e(i){var r=i.data;if(r.error)return o.terminate(),void n(r.error);\"importScripts\"===r.type&&(o.removeEventListener(\"message\",e),o.removeEventListener(\"error\",s),t(o))}),o.addEventListener(\"error\",s)}else n(new Error(\"Either zip.workerScripts or zip.workerScriptsPath may be set, not both.\"));function s(e){o.terminate(),n(e)}}function J(e){console.error(e)}const K={Reader:F,Writer:B,BlobReader:M,Data64URIReader:W,TextReader:T,BlobWriter:L,Data64URIWriter:C,TextWriter:I,createReader:function(e,t,n){e.init(function(){!function(e,t,n){var i=0;function r(){}r.prototype.getData=function(t,r,a,o){var s=this;function l(e,i){o&&!function(e){var t=R(4);return t.view.setUint32(0,e),s.crc32==t.view.getUint32(0)}(i)?n(\"CRC failed.\"):t.getData(function(e){r(e)})}function f(e){n(e||\"Error while reading file data.\")}function u(e){n(e||\"Error while writing file data.\")}e.readUint8Array(s.offset,30,function(r){var d,c=R(r.length,r);1347093252==c.view.getUint32(0)?(q(s,c,4,!1,n),d=s.offset+30+s.filenameLength+s.extraFieldLength,t.init(function(){0===s.compressionMethod?N(s._worker,i++,e,t,d,s.compressedSize,o,l,a,f,u):function(e,t,n,i,r,a,o,s,l,f,u){var d=o?\"output\":\"none\";K.useWebWorkers?P(e,{sn:t,codecClass:\"_zipjs_Inflater\",crcType:d},n,i,r,a,l,s,f,u):Z(new U,n,i,r,a,d,l,s,f,u)}(s._worker,i++,e,t,d,s.compressedSize,o,l,a,f,u)},u)):n(E)},f)};var a={getEntries:function(t){var i=this._worker;!function(t){function i(i,r){e.readUint8Array(e.size-i,i,function(e){for(var n=e.length-22;n>=0;n--)if(80===e[n]&&75===e[n+1]&&5===e[n+2]&&6===e[n+3])return void t(new DataView(e.buffer,n,22));r()},function(){n(D)})}e.size<22?n(E):i(22,function(){i(Math.min(65558,e.size),function(){n(E)})})}(function(a){var o,s;o=a.getUint32(16,!0),s=a.getUint16(8,!0),o<0||o>=e.size?n(E):e.readUint8Array(o,e.size-o,function(e){var a,o,l,f,u=0,d=[],c=R(e.length,e);for(a=0;a0){var i=n.map(function(e){return e.webkitGetAsEntry()}).filter(function(e){return null!==e});i.length>0&&(i[0].name.match(/\\.zip$/)?this._loadZip(n[0].getAsFile()):this._loadNextEntry(new Map,i))}else 1===t.length&&t[0].name.match(/\\.zip$/)&&this._loadZip(t[0]),this._emit(\"drop\",{files:new Map(t.map(function(e){return[e.name,e]}))});else this._fail(\"Required drag-and-drop APIs are not supported in this browser.\")},t._onDragover=function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect=\"copy\"},t._onSelect=function(e){this._emit(\"dropstart\");var t=[].slice.call(this.inputEl.files);if(1===t.length&&this._isZip(t[0]))this._loadZip(t[0]);else{var n=new Map;t.forEach(function(e){return n.set(e.webkitRelativePath||e.name,e)}),this._emit(\"drop\",{files:n})}},t._loadNextEntry=function(e,t){var n=this,i=t.pop();if(i)if(i.isFile)i.file(function(r){e.set(i.fullPath,r),n._loadNextEntry(e,t)},function(){return console.error(\"Could not load file: %s\",i.fullPath)});else if(i.isDirectory){var r=i.createReader();r.readEntries(function i(a){a.length?(t=t.concat(a),r.readEntries(i)):n._loadNextEntry(e,t)})}else console.warn(\"Unknown asset type: \"+i.fullPath),this._loadNextEntry(e,t);else this._emit(\"drop\",{files:e})},t._loadZip=function(e){var t=this,n=[],i=new Map,r=new be.FS,a=function e(t){t.directory?t.children.forEach(e):\".\"!==t.name[0]&&n.push(new Promise(function(e){t.getData(new K.BlobWriter,function(n){n.name=t.name,i.set(t.getFullname(),n),e()})}))};r.importBlob(e,function(){a(r.root),Promise.all(n).then(function(){t._emit(\"drop\",{files:i,archive:e})})})},t._isZip=function(e){return\"application/zip\"===e.type||e.name.match(/\\.zip$/)},t._fail=function(e){this._emit(\"droperror\",{message:e})},e}();export{xe as SimpleDropzone};\n//# sourceMappingURL=simple-dropzone.module.js.map\n","// Copyright 2024 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Document, WebIO} from '@gltf-transform/core';\nimport {KHRONOS_EXTENSIONS} from '@gltf-transform/extensions';\nimport {prune} from '@gltf-transform/functions';\nimport {SimpleDropzone} from 'simple-dropzone';\n\nimport Module from './built/manifold.js';\nimport {disposeMesh, Properties, readMesh, setupIO, writeMesh} from './gltf-io';\n\n// Set up gltf-transform\nconst io = setupIO(new WebIO());\nio.registerExtensions(KHRONOS_EXTENSIONS);\n\n// Set up Manifold WASM library\nconst wasm = await Module();\nwasm.setup();\nconst {Manifold, Mesh} = wasm;\n\n// UX elements\nconst mv = document.querySelector('model-viewer');\nconst inputEl = document.querySelector('#input') as HTMLInputElement;\nconst downloadButton = document.querySelector('#download') as HTMLButtonElement;\nconst checkbox = document.querySelector('#viewFinal') as HTMLInputElement;\nconst dropCtrl = new SimpleDropzone(mv, inputEl) as any;\n\n// glTF objects in memory\nlet inputGLBurl = '';\nlet outputGLBurl = '';\n// Status of manifoldness of all meshes\nlet allManifold = true;\nlet anyManifold = false;\n\n// The processing is run when a glTF is drag-and-dropped onto this element.\ndropCtrl.on('drop', async ({files}: {files: Map}) => {\n for (const [_path, file] of files) {\n const filename = file.name.toLowerCase();\n if (filename.match(/\\.(gltf|glb)$/)) {\n URL.revokeObjectURL(inputGLBurl);\n inputGLBurl = URL.createObjectURL(file);\n await writeGLB(await readGLB(inputGLBurl));\n updateUI();\n break;\n }\n }\n});\n\n// UI functions\n\nfunction updateUI() {\n if (allManifold) {\n checkbox.checked = true;\n checkbox.disabled = true;\n } else if (anyManifold) {\n checkbox.checked = false;\n checkbox.disabled = false;\n } else {\n checkbox.checked = false;\n checkbox.disabled = true;\n }\n onClick();\n}\n\ncheckbox.onclick = onClick;\n\nfunction onClick() {\n (mv as any).src = checkbox.checked ? outputGLBurl : inputGLBurl;\n downloadButton.disabled = !checkbox.checked;\n};\n\ndownloadButton.onclick = () => {\n const link = document.createElement('a');\n link.download = 'manifold.glb';\n link.href = outputGLBurl;\n link.click();\n};\n\n// Write output glTF using gltf-transform, which contains only the meshes that\n// are manifold, and using the EXT_mesh_manifold extension.\nasync function writeGLB(doc: Document): Promise {\n URL.revokeObjectURL(outputGLBurl);\n if (!anyManifold) {\n return;\n }\n const glb = await io.writeBinary(doc);\n\n const blob = new Blob([glb], {type: 'application/octet-stream'});\n outputGLBurl = URL.createObjectURL(blob);\n}\n\n// Read the glTF ObjectURL and return a gltf-transform document with all the\n// non-manifold meshes stripped out.\nasync function readGLB(url: string): Promise {\n allManifold = false;\n anyManifold = false;\n updateUI();\n allManifold = true;\n const docIn = await io.read(url);\n const nodes = docIn.getRoot().listNodes();\n for (const node of nodes) {\n const mesh = node.getMesh();\n if (!mesh) continue;\n\n const tmp = readMesh(mesh);\n if (!tmp) continue;\n\n const id2properties = new Map();\n const numID = tmp.runProperties.length;\n const firstID = Manifold.reserveIDs(numID);\n tmp.mesh.runOriginalID = new Uint32Array(numID);\n for (let i = 0; i < numID; ++i) {\n tmp.mesh.runOriginalID[i] = firstID + i;\n id2properties.set(firstID + i, tmp.runProperties[i]);\n }\n const manifoldMesh = new Mesh(tmp.mesh);\n disposeMesh(mesh);\n // Make the mesh manifold if it's close.\n manifoldMesh.merge();\n\n try {\n // Test manifoldness - will throw if not.\n const manifold = new Manifold(manifoldMesh);\n // Replace the mesh with a manifold version\n node.setMesh(writeMesh(docIn, manifold.getMesh(), id2properties));\n manifold.delete();\n anyManifold = true;\n } catch (e) {\n console.log(mesh.getName(), e);\n allManifold = false;\n }\n }\n\n // Prune the leftovers after non-manifold mesh removal.\n await docIn.transform(prune());\n\n return docIn;\n}"],"names":["KHR_SUPERCOMPRESSION_NONE","KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT","KHR_DF_VENDORID_KHRONOS","KHR_DF_VERSION","KHR_DF_MODEL_UNSPECIFIED","KHR_DF_MODEL_ETC1S","KHR_DF_MODEL_UASTC","KHR_DF_FLAG_ALPHA_STRAIGHT","KHR_DF_TRANSFER_SRGB","KHR_DF_PRIMARIES_BT709","KHR_DF_SAMPLE_DATATYPE_SIGNED","VK_FORMAT_UNDEFINED","KTX2Container","BufferReader","data","byteOffset","byteLength","littleEndian","value","left","right","len","bytes","maxByteLength","term","KTX2_ID","decodeText","buffer","read","id","container","headerByteLength","headerReader","levelCount","dfdByteOffset","dfdByteLength","kvdByteOffset","kvdByteLength","sgdByteOffset","sgdByteLength","levelByteLength","levelReader","i","dfdReader","dfd","sampleStart","sampleWords","numSamples","sample","kvdReader","keyValueByteLength","keyData","key","text","kvPadding","sgdReader","endpointCount","selectorCount","endpointsByteLength","selectorsByteLength","tablesByteLength","extendedByteLength","imageDescs","endpointsByteOffset","selectorsByteOffset","tablesByteOffset","extendedByteOffset","endpointsData","selectorsData","tablesData","extendedData","I","N","R","y","A","S","C","M","O","_","w","D","b","F","j","v","k","B","G","L$1","e","t","L","U","V$1","s","n","r","P","X","H","z","V","$","q","K","u","Y","Q","l","W","o","a","J","Z","ee","c","te","se","ne$1","f","g","h","p","x","d","T","m","E","ne","re","oe$1","ae","ie$1","oe","ie","ce","ue$1","le$1","ue","le","he","fe","ge","pe","xe","de","Te","me","Ee","Ie","Ne","Re","ye","Ae","Se","Ce","Me","Oe","_e","we$1","we","De","be$1","be","Fe","je","ve","ke","Be","Ge","Le","Ue","Ve","Pe","Xe","He","ze","$e","qe","Ke","Ye","Qe","We","Je","Ze","et","tt","st","nt","rt","ot","it","at","ct","ut","lt","ht","ft","gt","pt","xt","dt","Tt","mt","Et","It","Nt","Rt","yt","At","St","Ct","Mt","Ot","_t","wt","Dt","bt","Ft","jt","vt","kt","Bt","Gt","Lt","Ut","Vt","Pt","Xt","Ht","zt","$t","qt","Kt","Yt","Qt","Wt","Jt","io","setupIO","WebIO","KHRONOS_EXTENSIONS","wasm","Module","Manifold","Mesh","mv","inputEl","downloadButton","checkbox","dropCtrl","SimpleDropzone","inputGLBurl","outputGLBurl","allManifold","anyManifold","files","_path","file","writeGLB","readGLB","updateUI","onClick","link","doc","glb","blob","url","docIn","nodes","node","mesh","tmp","readMesh","id2properties","numID","firstID","manifoldMesh","disposeMesh","manifold","writeMesh","prune"],"mappings":"uRAGA,MAAMA,GAA4B,EAO5BC,GAAwC,EACxCC,GAA0B,EAC1BC,GAAiB,EACjBC,GAA2B,EAM3BC,GAAqB,IACrBC,GAAqB,IACrBC,GAA6B,EAI7BC,GAAuB,EAkBvBC,GAAyB,EAkBzBC,GAAgC,GAMhCC,GAAsB,EAmM5B,MAAMC,EAAc,CAClB,aAAc,CACZ,KAAK,SAAWD,GAChB,KAAK,SAAW,EAChB,KAAK,WAAa,EAClB,KAAK,YAAc,EACnB,KAAK,WAAa,EAClB,KAAK,WAAa,EAClB,KAAK,UAAY,EACjB,KAAK,uBAAyBX,GAC9B,KAAK,OAAS,GACd,KAAK,qBAAuB,CAAC,CAC3B,SAAUE,GACV,eAAgBD,GAChB,oBAAqB,EACrB,cAAeE,GACf,WAAYC,GACZ,eAAgBK,GAChB,iBAAkBD,GAClB,MAAOD,GACP,oBAAqB,CAAC,EAAG,EAAG,EAAG,CAAC,EAChC,WAAY,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EACnC,QAAS,CAAE,CACjB,CAAK,EACD,KAAK,SAAW,GAChB,KAAK,WAAa,IACnB,CAEH,CAEA,MAAMM,EAAa,CACjB,YAAYC,EAAMC,EAAYC,EAAYC,EAAc,CACtD,KAAK,UAAY,OACjB,KAAK,cAAgB,OACrB,KAAK,QAAU,OACf,KAAK,UAAY,IAAI,SAASH,EAAK,OAAQA,EAAK,WAAaC,EAAYC,CAAU,EACnF,KAAK,cAAgBC,EACrB,KAAK,QAAU,CACh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S,OAAO,EACFxB,GAAA,SACPtK,EAAG,CACV,QAAQ,IAAIsL,EAAK,QAAQ,EAAGtL,CAAC,EACfqK,GAAA,EAChB,CACF,CAGM,aAAAc,EAAM,UAAUa,GAAA,CAAO,EAEtBb,CACT","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/assets/manifold-0f9aa664.wasm b/assets/manifold-0f9aa664.wasm new file mode 100644 index 000000000..38c5112d6 Binary files /dev/null and b/assets/manifold-0f9aa664.wasm differ diff --git a/assets/manifold.js b/assets/manifold.js new file mode 100644 index 000000000..2eef8da35 --- /dev/null +++ b/assets/manifold.js @@ -0,0 +1,21 @@ +const xi="modulepreload",Di=function(de){return"/"+de},Yr={},ji=function(ke,oe,a){if(!oe||oe.length===0)return ke();const pe=document.getElementsByTagName("link");return Promise.all(oe.map(M=>{if(M=Di(M),M in Yr)return;Yr[M]=!0;const U=M.endsWith(".css"),Ne=U?'[rel="stylesheet"]':"";if(!!a)for(let G=pe.length-1;G>=0;G--){const Q=pe[G];if(Q.href===M&&(!U||Q.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${M}"]${Ne}`))return;const B=document.createElement("link");if(B.rel=U?"stylesheet":xi,U||(B.as="script",B.crossOrigin=""),B.href=M,document.head.appendChild(B),U)return new Promise((G,Q)=>{B.addEventListener("load",G),B.addEventListener("error",()=>Q(new Error(`Unable to preload CSS for ${M}`)))})})).then(()=>ke()).catch(M=>{const U=new Event("vite:preloadError",{cancelable:!0});if(U.payload=M,window.dispatchEvent(U),!U.defaultPrevented)throw M})};var Bi=(()=>{var de=import.meta.url;return async function(ke={}){var oe,a=ke,pe,M,U=new Promise((e,r)=>{pe=e,M=r}),Ne=typeof window=="object",Ae=typeof importScripts=="function",B=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(B){const{createRequire:e}=await ji(()=>import("./__vite-browser-external.js"),[]);var G=e(import.meta.url)}var Q=!1;a.setup=function(){if(Q)return;Q=!0;function e(o,f,v=p=>p){if(f)for(let p of f)o.push_back(v(p));return o}function r(o,f=v=>v){const v=[],p=o.size();for(let _=0;_v){const v=[],p=o.size();for(let _=0;_e(new a.Vector_vec2,f,v=>v instanceof Array?{x:v[0],y:v[1]}:v))}function i(o){for(let f=0;fo.min[f]),max:["x","y"].map(f=>o.max[f])}},a.CrossSection.prototype.offset=function(o,f="Square",v=2,p=0){return this._Offset(o,l(f),v,p)},a.CrossSection.prototype.extrude=function(o,f=0,v=0,p=[1,1],_=!1){p=s([p]);const k=a._Extrude(this._ToPolygons(),o,f,v,p);return _?k.translate([0,0,-o/2]):k},a.CrossSection.prototype.revolve=function(o=0,f=360){return a._Revolve(this._ToPolygons(),o,f)},a.CrossSection.prototype.add=function(o){return this._add(h(o))},a.CrossSection.prototype.subtract=function(o){return this._subtract(h(o))},a.CrossSection.prototype.intersect=function(o){return this._intersect(h(o))},a.CrossSection.prototype.toPolygons=function(){const o=this._ToPolygons(),f=t(o);return o.delete(),f},a.Manifold.prototype.smoothOut=function(o=60,f=0){return this._SmoothOut(o,f)},a.Manifold.prototype.warp=function(o){const f=Ce(function(_){const k=L(_,"double"),A=L(_+8,"double"),D=L(_+16,"double"),F=[k,A,D];o(F),se(_,F[0],"double"),se(_+8,F[1],"double"),se(_+16,F[2],"double")},"vi"),v=this._Warp(f);Se(f);const p=v.status();if(p.value!==0)throw new a.ManifoldError(p.value);return v},a.Manifold.prototype.calculateNormals=function(o,f=60){return this._CalculateNormals(o,f)},a.Manifold.prototype.setProperties=function(o,f){const v=this.numProp(),p=Ce(function(k,A,D){const F=[];for(let E=0;Eo.min[f]),max:["x","y","z"].map(f=>o.max[f])}};class y{constructor({numProp:f=3,triVerts:v=new Uint32Array,vertProperties:p=new Float32Array,mergeFromVert:_,mergeToVert:k,runIndex:A,runOriginalID:D,faceID:F,halfedgeTangent:le,runTransform:ve}={}){this.numProp=f,this.triVerts=v,this.vertProperties=p,this.mergeFromVert=_,this.mergeToVert=k,this.runIndex=A,this.runOriginalID=D,this.faceID=F,this.halfedgeTangent=le,this.runTransform=ve}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:f,mesh:v}=a._Merge(this);return Object.assign(this,{...v}),f}verts(f){return this.triVerts.subarray(3*f,3*(f+1))}position(f){return this.vertProperties.subarray(this.numProp*f,this.numProp*f+3)}extras(f){return this.vertProperties.subarray(this.numProp*f+3,this.numProp*(f+1))}tangent(f){return this.halfedgeTangent.subarray(4*f,4*(f+1))}transform(f){const v=new Array(16);for(const p of[0,1,2,3])for(const _ of[0,1,2])v[4*p+_]=this.runTransform[12*f+3*p+_];return v[15]=1,v}}a.Mesh=y,a.Manifold.prototype.getMesh=function(o=[0,0,0]){return o instanceof Array&&(o={0:o[0],1:o[1],2:o[2]}),new y(this._GetMeshJS(o))},a.ManifoldError=function(f,...v){let p="Unknown error";switch(f){case a.status.NonFiniteVertex.value:p="Non-finite vertex";break;case a.status.NotManifold.value:p="Not manifold";break;case a.status.VertexOutOfBounds.value:p="Vertex index out of bounds";break;case a.status.PropertiesWrongLength.value:p="Properties have wrong length";break;case a.status.MissingPositionProperties.value:p="Less than three properties";break;case a.status.MergeVectorsDifferentLengths.value:p="Merge vectors have different lengths";break;case a.status.MergeIndexOutOfBounds.value:p="Merge index out of bounds";break;case a.status.TransformWrongLength.value:p="Transform vector has wrong length";break;case a.status.RunIndexWrongLength.value:p="Run index vector has wrong length";break;case a.status.FaceIDWrongLength.value:p="Face ID vector has wrong length";case a.status.InvalidConstruction.value:p="Manifold constructed with invalid parameters"}const _=Error.apply(this,[p,...v]);_.name=this.name="ManifoldError",this.message=_.message,this.stack=_.stack,this.code=f},a.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:a.ManifoldError,writable:!0,configurable:!0}}),a.CrossSection=function(o,f="Positive"){const v=n(o),p=new d(v,u(f));return i(v),p},a.CrossSection.ofPolygons=function(o,f="Positive"){return new a.CrossSection(o,f)},a.CrossSection.square=function(...o){let f;o.length==0?f={x:1,y:1}:typeof o[0]=="number"?f={x:o[0],y:o[0]}:f=s(o);const v=o[1]||!1;return a._Square(f,v)},a.CrossSection.circle=function(o,f=0){return a._Circle(o,f)};function g(o){return function(...f){f.length==1&&(f=f[0]);const v=new a.Vector_crossSection;for(const _ of f)v.push_back(h(_));const p=a["_crossSection"+o](v);return v.delete(),p}}a.CrossSection.compose=g("Compose"),a.CrossSection.union=g("UnionN"),a.CrossSection.difference=g("DifferenceN"),a.CrossSection.intersection=g("IntersectionN");function C(o,f){e(o,f,v=>v instanceof Array?{x:v[0],y:v[1]}:v)}a.CrossSection.hull=function(...o){o.length==1&&(o=o[0]);let f=new a.Vector_vec2;for(const p of o)if(p instanceof d)a._crossSectionCollectVertices(f,p);else if(p instanceof Array&&p.length==2&&typeof p[0]=="number")f.push_back({x:p[0],y:p[1]});else if(p.x)f.push_back(p);else{const k=p[0].length==2&&typeof p[0][0]=="number"||p[0].x?[p]:p;for(const A of k)C(f,A)}const v=a._crossSectionHullPoints(f);return f.delete(),v},a.CrossSection.prototype=Object.create(d.prototype),Object.defineProperty(a.CrossSection,Symbol.hasInstance,{get:()=>o=>o instanceof d});const T=a.Manifold;a.Manifold=function(o){const f=new T(o),v=f.status();if(v.value!==0)throw new a.ManifoldError(v.value);return f},a.Manifold.ofMesh=function(o){return new a.Manifold(o)},a.Manifold.tetrahedron=function(){return a._Tetrahedron()},a.Manifold.cube=function(...o){let f;o.length==0?f={x:1,y:1,z:1}:typeof o[0]=="number"?f={x:o[0],y:o[0],z:o[0]}:f=c(o);const v=o[1]||!1;return a._Cube(f,v)},a.Manifold.cylinder=function(o,f,v=-1,p=0,_=!1){return a._Cylinder(o,f,v,p,_)},a.Manifold.sphere=function(o,f=0){return a._Sphere(o,f)},a.Manifold.smooth=function(o,f=[]){const v=new a.Vector_smoothness;e(v,f);const p=a._Smooth(o,v);return v.delete(),p},a.Manifold.extrude=function(o,f,v=0,p=0,_=[1,1],k=!1){return(o instanceof d?o:a.CrossSection(o,"Positive")).extrude(f,v,p,_,k)},a.Manifold.revolve=function(o,f=0,v=360){return(o instanceof d?o:a.CrossSection(o,"Positive")).revolve(f,v)},a.Manifold.reserveIDs=function(o){return a._ReserveIDs(o)},a.Manifold.compose=function(o){const f=new a.Vector_manifold;e(f,o);const v=a._manifoldCompose(f);return f.delete(),v};function I(o){return function(...f){f.length==1&&(f=f[0]);const v=new a.Vector_manifold;for(const _ of f)v.push_back(_);const p=a["_manifold"+o+"N"](v);return v.delete(),p}}a.Manifold.union=I("Union"),a.Manifold.difference=I("Difference"),a.Manifold.intersection=I("Intersection"),a.Manifold.levelSet=function(o,f,v,p=0,_=-1){const k={min:{x:f.min[0],y:f.min[1],z:f.min[2]},max:{x:f.max[0],y:f.max[1],z:f.max[2]}},A=Ce(function(F){const le=L(F,"double"),ve=L(F+8,"double"),E=L(F+16,"double");return o([le,ve,E])},"di"),D=a._LevelSet(A,k,v,p,_);return Se(A),D};function x(o,f){e(o,f,v=>v instanceof Array?{x:v[0],y:v[1],z:v[2]}:v)}a.Manifold.hull=function(...o){o.length==1&&(o=o[0]);let f=new a.Vector_vec3;for(const p of o)p instanceof T?a._manifoldCollectVertices(f,p):p instanceof Array&&p.length==3&&typeof p[0]=="number"?f.push_back({x:p[0],y:p[1],z:p[2]}):p.x?f.push_back(p):x(f,p);const v=a._manifoldHullPoints(f);return f.delete(),v},a.Manifold.prototype=Object.create(T.prototype),Object.defineProperty(a.Manifold,Symbol.hasInstance,{get:()=>o=>o instanceof T}),a.triangulate=function(o,f=-1){const v=n(o),p=r(a._Triangulate(v,f),_=>[_[0],_[1],_[2]]);return i(v),p}};var lr=Object.assign({},a),H="";function et(e){return a.locateFile?a.locateFile(e,H):H+e}var qe,Ge,Ee;if(B){var vr=G("fs"),dr=G("path");H=G("url").fileURLToPath(new URL("./",self.location)),qe=(e,r)=>(e=We(e)?new URL(e):dr.normalize(e),vr.readFileSync(e,r?void 0:"utf8")),Ee=e=>{var r=qe(e,!0);return r.buffer||(r=new Uint8Array(r)),r},Ge=(e,r,t,n=!0)=>{e=We(e)?new URL(e):dr.normalize(e),vr.readFile(e,n?void 0:"utf8",(i,s)=>{i?t(i):r(n?s.buffer:s)})},!a.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(Ne||Ae)&&(Ae?H=self.location.href:typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),de&&(H=de),H.startsWith("blob:")?H="":H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1),qe=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},Ae&&(Ee=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Ge=(e,r,t)=>{if(We(e)){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(n.status==200||n.status==0&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null);return}fetch(e,{credentials:"same-origin"}).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(i.status+" : "+i.url))).then(r,t)});a.print||console.log.bind(console);var he=a.printErr||console.error.bind(console);Object.assign(a,lr),lr=null,a.arguments&&a.arguments,a.thisProgram&&a.thisProgram,a.quit&&a.quit;var ye;a.wasmBinary&&(ye=a.wasmBinary);var Re,pr=!1,j,O,K,_e,Z,S,Fe,Me;function hr(){var e=Re.buffer;a.HEAP8=j=new Int8Array(e),a.HEAP16=K=new Int16Array(e),a.HEAPU8=O=new Uint8Array(e),a.HEAPU16=_e=new Uint16Array(e),a.HEAP32=Z=new Int32Array(e),a.HEAPU32=S=new Uint32Array(e),a.HEAPF32=Fe=new Float32Array(e),a.HEAPF64=Me=new Float64Array(e)}var yr=[],_r=[],mr=[];function rt(){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)it(a.preRun.shift());Je(yr)}function tt(){Je(_r)}function nt(){if(a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;)at(a.postRun.shift());Je(mr)}function it(e){yr.unshift(e)}function ot(e){_r.unshift(e)}function at(e){mr.unshift(e)}var Y=0,me=null;function st(e){Y++,a.monitorRunDependencies?.(Y)}function ut(e){if(Y--,a.monitorRunDependencies?.(Y),Y==0&&me){var r=me;me=null,r()}}function ae(e){a.onAbort?.(e),e="Aborted("+e+")",he(e),pr=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw M(r),r}var ct="data:application/octet-stream;base64,",gr=e=>e.startsWith(ct),We=e=>e.startsWith("file://");function ft(){if(a.locateFile){var e="manifold.wasm";return gr(e)?e:et(e)}return new URL("/assets/manifold.wasm",self.location).href}var Ve;function wr(e){if(e==Ve&&ye)return new Uint8Array(ye);if(Ee)return Ee(e);throw"both async and sync fetching of the wasm failed"}function lt(e){return ye?Promise.resolve().then(()=>wr(e)):new Promise((r,t)=>{Ge(e,n=>r(new Uint8Array(n)),n=>{try{r(wr(e))}catch(i){t(i)}})})}function br(e,r,t){return lt(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{he(`failed to asynchronously prepare wasm: ${n}`),ae(n)})}function vt(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!gr(r)&&!We(r)&&!B&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(i=>{var s=WebAssembly.instantiateStreaming(i,t);return s.then(n,function(c){return he(`wasm streaming compile failed: ${c}`),he("falling back to ArrayBuffer instantiation"),br(r,t,n)})}):br(r,t,n)}function dt(){return{a:ei}}function pt(){var e=dt();function r(n,i){return V=n.exports,Re=V.xa,hr(),ne=V.Aa,ot(V.ya),ut(),V}st();function t(n){r(n.instance)}if(a.instantiateWasm)try{return a.instantiateWasm(e,r)}catch(n){he(`Module.instantiateWasm callback failed with error: ${n}`),M(n)}return Ve||(Ve=ft()),vt(ye,Ve,e,t).catch(M),{}}var Je=e=>{for(;e.length>0;)e.shift()(a)};function L(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return j[e];case"i8":return j[e];case"i16":return K[e>>1];case"i32":return Z[e>>2];case"i64":ae("to do getValue(i64) use WASM_BIGINT");case"float":return Fe[e>>2];case"double":return Me[e>>3];case"*":return S[e>>2];default:ae(`invalid type for getValue: ${r}`)}}a.noExitRuntime;function se(e,r,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":j[e]=r;break;case"i8":j[e]=r;break;case"i16":K[e>>1]=r;break;case"i32":Z[e>>2]=r;break;case"i64":ae("to do setValue(i64) use WASM_BIGINT");case"float":Fe[e>>2]=r;break;case"double":Me[e>>3]=r;break;case"*":S[e>>2]=r;break;default:ae(`invalid type for setValue: ${t}`)}}var b=e=>Nr(e),$=()=>qr(),$r=[],ht=e=>{var r=new Xe(e);return r.get_caught()||r.set_caught(!0),r.set_rethrown(!1),$r.push(r),Jr(r.excPtr),r.get_exception_ptr()},ee=0,yt=()=>{w(0,0);var e=$r.pop();Gr(e.excPtr),ee=0};class Xe{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){S[this.ptr+4>>2]=r}get_type(){return S[this.ptr+4>>2]}set_destructor(r){S[this.ptr+8>>2]=r}get_destructor(){return S[this.ptr+8>>2]}set_caught(r){r=r?1:0,j[this.ptr+12]=r}get_caught(){return j[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,j[this.ptr+13]=r}get_rethrown(){return j[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){S[this.ptr+16>>2]=r}get_adjusted_ptr(){return S[this.ptr+16>>2]}get_exception_ptr(){var r=Kr(this.get_type());if(r)return S[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var _t=e=>{throw ee||(ee=e),ee},Ie=e=>zr(e),Pr=e=>{var r=ee;if(!r)return Ie(0),0;var t=new Xe(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return Ie(0),r;for(var i of e){if(i===0||i===n)break;var s=t.ptr+16;if(Xr(i,n,s))return Ie(i),r}return Ie(n),r},mt=()=>Pr([]),gt=e=>Pr([e]),wt=(e,r,t)=>{var n=new Xe(e);throw n.init(r,t),ee=e,ee},bt=()=>{ae("")},Oe={},Ke=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function ge(e){return this.fromWireType(S[e>>2])}var ue={},re={},xe={},Tr,De=e=>{throw new Tr(e)},te=(e,r,t)=>{e.forEach(function(u){xe[u]=r});function n(u){var l=t(u);l.length!==e.length&&De("Mismatched type converter count");for(var d=0;d{re.hasOwnProperty(u)?i[l]=re[u]:(s.push(u),ue.hasOwnProperty(u)||(ue[u]=[]),ue[u].push(()=>{i[l]=re[u],++c,c===s.length&&n(i)}))}),s.length===0&&n(i)},$t=e=>{var r=Oe[e];delete Oe[e];var t=r.rawConstructor,n=r.rawDestructor,i=r.fields,s=i.map(c=>c.getterReturnType).concat(i.map(c=>c.setterArgumentType));te([e],s,c=>{var u={};return i.forEach((l,d)=>{var h=l.fieldName,y=c[d],g=l.getter,C=l.getterContext,T=c[d+i.length],I=l.setter,x=l.setterContext;u[h]={read:o=>y.fromWireType(g(C,o)),write:(o,f)=>{var v=[];I(x,o,T.toWireType(v,f)),Ke(v)}}}),[{name:r.name,fromWireType:l=>{var d={};for(var h in u)d[h]=u[h].read(l);return n(l),d},toWireType:(l,d)=>{for(var h in u)if(!(h in d))throw new TypeError(`Missing field: "${h}"`);var y=t();for(h in u)u[h].write(y,d[h]);return l!==null&&l.push(n,y),y},argPackAdvance:q,readValueFromPointer:ge,destructorFunction:n}]})},Pt=(e,r,t,n,i)=>{},Tt=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Cr=e},Cr,W=e=>{for(var r="",t=e;O[t];)r+=Cr[O[t++]];return r},ce,P=e=>{throw new ce(e)};function Ct(e,r,t={}){var n=r.name;if(e||P(`type "${n}" must have a positive integer typeid pointer`),re.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;P(`Cannot register type '${n}' twice`)}if(re[e]=r,delete xe[e],ue.hasOwnProperty(e)){var i=ue[e];delete ue[e],i.forEach(s=>s())}}function N(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ct(e,r,t)}var q=8,St=(e,r,t,n)=>{r=W(r),N(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,s){return s?t:n},argPackAdvance:q,readValueFromPointer:function(i){return this.fromWireType(O[i])},destructorFunction:null})},kt=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ze=e=>{function r(t){return t.$$.ptrType.registeredClass.name}P(r(e)+" instance already deleted")},Qe=!1,Sr=e=>{},At=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},kr=e=>{e.count.value-=1;var r=e.count.value===0;r&&At(e)},Ar=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=Ar(e,r,t.baseClass);return n===null?null:t.downcast(n)},Er={},Et=()=>Object.keys($e).length,Rt=()=>{var e=[];for(var r in $e)$e.hasOwnProperty(r)&&e.push($e[r]);return e},we=[],Ye=()=>{for(;we.length;){var e=we.pop();e.$$.deleteScheduled=!1,e.delete()}},be,Ft=e=>{be=e,we.length&&be&&be(Ye)},Mt=()=>{a.getInheritedInstanceCount=Et,a.getLiveInheritedInstances=Rt,a.flushPendingDeletes=Ye,a.setDelayFunction=Ft},$e={},Wt=(e,r)=>{for(r===void 0&&P("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Vt=(e,r)=>(r=Wt(e,r),$e[r]),je=(e,r)=>{(!r.ptrType||!r.ptr)&&De("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&De("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Pe(Object.create(e,{$$:{value:r,writable:!0}}))};function It(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Vt(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s=this.registeredClass.getActualType(r),c=Er[s];if(!c)return i.call(this);var u;this.isConst?u=c.constPointerType:u=c.pointerType;var l=Ar(r,this.registeredClass,u.registeredClass);return l===null?i.call(this):this.isSmartPointer?je(u.registeredClass.instancePrototype,{ptrType:u,ptr:l,smartPtrType:this,smartPtr:e}):je(u.registeredClass.instancePrototype,{ptrType:u,ptr:l})}var Pe=e=>typeof FinalizationRegistry>"u"?(Pe=r=>r,e):(Qe=new FinalizationRegistry(r=>{kr(r.$$)}),Pe=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t};Qe.register(r,i,r)}return r},Sr=r=>Qe.unregister(r),Pe(e)),Ot=()=>{Object.assign(Ue.prototype,{isAliasOf(e){if(!(this instanceof Ue)||!(e instanceof Ue))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return r===n&&t===i},clone(){if(this.$$.ptr||Ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Pe(Object.create(Object.getPrototypeOf(this),{$$:{value:kt(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&P("Object already scheduled for deletion"),Sr(this),kr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&P("Object already scheduled for deletion"),we.push(this),we.length===1&&be&&be(Ye),this.$$.deleteScheduled=!0,this}})};function Ue(){}var fe=(e,r)=>Object.defineProperty(r,"name",{value:e}),Rr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...i){return e[r].overloadTable.hasOwnProperty(i.length)||P(`Function '${t}' called with an invalid number of arguments (${i.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[i.length].apply(this,i)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},er=(e,r,t)=>{a.hasOwnProperty(e)?((t===void 0||a[e].overloadTable!==void 0&&a[e].overloadTable[t]!==void 0)&&P(`Cannot register public name '${e}' twice`),Rr(a,e,e),a.hasOwnProperty(t)&&P(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),a[e].overloadTable[t]=r):(a[e]=r,t!==void 0&&(a[e].numArguments=t))},xt=48,Dt=57,jt=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=xt&&r<=Dt?`_${e}`:e};function Ut(e,r,t,n,i,s,c,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=s,this.upcast=c,this.downcast=u,this.pureVirtualFunctions=[]}var rr=(e,r,t)=>{for(;r!==t;)r.upcast||P(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Bt(e,r){if(r===null)return this.isReference&&P(`null is not a valid ${this.name}`),0;r.$$||P(`Cannot pass "${ar(r)}" as a ${this.name}`),r.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=rr(r.$$.ptr,t,this.registeredClass);return n}function Ht(e,r){var t;if(r===null)return this.isReference&&P(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&P(`Cannot pass "${ar(r)}" as a ${this.name}`),r.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&P(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=rr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&P("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:P(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var i=r.clone();t=this.rawShare(t,R.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:P("Unsupporting sharing policy")}return t}function Lt(e,r){if(r===null)return this.isReference&&P(`null is not a valid ${this.name}`),0;r.$$||P(`Cannot pass "${ar(r)}" as a ${this.name}`),r.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&P(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=rr(r.$$.ptr,t,this.registeredClass);return n}var zt=()=>{Object.assign(Be.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:q,readValueFromPointer:ge,fromWireType:It})};function Be(e,r,t,n,i,s,c,u,l,d,h){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=c,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=d,this.rawDestructor=h,!i&&r.baseClass===void 0?n?(this.toWireType=Bt,this.destructorFunction=null):(this.toWireType=Lt,this.destructorFunction=null):this.toWireType=Ht}var Fr=(e,r,t)=>{a.hasOwnProperty(e)||De("Replacing nonexistent public symbol"),a[e].overloadTable!==void 0&&t!==void 0?a[e].overloadTable[t]=r:(a[e]=r,a[e].argCount=t)},Nt=(e,r,t)=>{e=e.replace(/p/g,"i");var n=a["dynCall_"+e];return n(r,...t)},Te=[],ne,m=e=>{var r=Te[e];return r||(e>=Te.length&&(Te.length=e+1),Te[e]=r=ne.get(e)),r},qt=(e,r,t=[])=>{if(e.includes("j"))return Nt(e,r,t);var n=m(r)(...t);return n},Gt=(e,r)=>(...t)=>qt(e,r,t),z=(e,r)=>{e=W(e);function t(){return e.includes("j")?Gt(e,r):m(r)}var n=t();return typeof n!="function"&&P(`unknown function pointer with signature ${e}: ${r}`),n},Jt=(e,r)=>{var t=fe(r,function(n){this.name=r,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+` +`+i.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},Mr,Wr=e=>{var r=Lr(e),t=W(r);return X(r),t},He=(e,r)=>{var t=[],n={};function i(s){if(!n[s]&&!re[s]){if(xe[s]){xe[s].forEach(i);return}t.push(s),n[s]=!0}}throw r.forEach(i),new Mr(`${e}: `+t.map(Wr).join([", "]))},Xt=(e,r,t,n,i,s,c,u,l,d,h,y,g)=>{h=W(h),s=z(i,s),u&&=z(c,u),d&&=z(l,d),g=z(y,g);var C=jt(h);er(C,function(){He(`Cannot construct ${h} due to unbound types`,[n])}),te([e,r,t],n?[n]:[],T=>{T=T[0];var I,x;n?(I=T.registeredClass,x=I.instancePrototype):x=Ue.prototype;var o=fe(h,function(...A){if(Object.getPrototypeOf(this)!==f)throw new ce("Use 'new' to construct "+h);if(v.constructor_body===void 0)throw new ce(h+" has no accessible constructor");var D=v.constructor_body[A.length];if(D===void 0)throw new ce(`Tried to invoke ctor of ${h} with invalid number of parameters (${A.length}) - expected (${Object.keys(v.constructor_body).toString()}) parameters instead!`);return D.apply(this,A)}),f=Object.create(x,{constructor:{value:o}});o.prototype=f;var v=new Ut(h,o,f,g,I,s,u,d);v.baseClass&&(v.baseClass.__derivedClasses??=[],v.baseClass.__derivedClasses.push(v));var p=new Be(h,v,!0,!1,!1),_=new Be(h+"*",v,!1,!1,!1),k=new Be(h+" const*",v,!1,!0,!1);return Er[e]={pointerType:_,constPointerType:k},Fr(C,o),[p,_,k]})},tr=(e,r)=>{for(var t=[],n=0;n>2]);return t};function Vr(e){for(var r=1;r0?", ":"")+u),d+=(t||n?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+`); +`,i)d+=`runDestructors(destructors); +`;else for(var l=r?1:2;l{var c=tr(r,t);i=z(n,i),te([],[e],u=>{u=u[0];var l=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[r-1]!==void 0)throw new ce(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[r-1]=()=>{He(`Cannot construct ${u.name} due to unbound types`,c)},te([],c,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[r-1]=nr(l,d,null,i,s),[])),[]})},Or=e=>{e=e.trim();const r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Qt=(e,r,t,n,i,s,c,u,l)=>{var d=tr(t,n);r=W(r),r=Or(r),s=z(i,s),te([],[e],h=>{h=h[0];var y=`${h.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),u&&h.registeredClass.pureVirtualFunctions.push(r);function g(){He(`Cannot call ${y} due to unbound types`,d)}var C=h.registeredClass.instancePrototype,T=C[r];return T===void 0||T.overloadTable===void 0&&T.className!==h.name&&T.argCount===t-2?(g.argCount=t-2,g.className=h.name,C[r]=g):(Rr(C,r,y),C[r].overloadTable[t-2]=g),te([],d,I=>{var x=nr(y,I,h,s,c,l);return C[r].overloadTable===void 0?(x.argCount=t-2,C[r]=x):C[r].overloadTable[t-2]=x,[]}),[]})},ir=[],J=[],or=e=>{e>9&&--J[e+1]===0&&(J[e]=void 0,ir.push(e))},Yt=()=>J.length/2-5-ir.length,en=()=>{J.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=Yt},R={toValue:e=>(e||P("Cannot use deleted val. handle = "+e),J[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=ir.pop()||J.length;return J[r]=e,J[r+1]=1,r}}}},rn={name:"emscripten::val",fromWireType:e=>{var r=R.toValue(e);return or(e),r},toWireType:(e,r)=>R.toHandle(r),argPackAdvance:q,readValueFromPointer:ge,destructorFunction:null},xr=e=>N(e,rn),tn=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType(j[n])}:function(n){return this.fromWireType(O[n])};case 2:return t?function(n){return this.fromWireType(K[n>>1])}:function(n){return this.fromWireType(_e[n>>1])};case 4:return t?function(n){return this.fromWireType(Z[n>>2])}:function(n){return this.fromWireType(S[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},nn=(e,r,t,n)=>{r=W(r);function i(){}i.values={},N(e,{name:r,constructor:i,fromWireType:function(s){return this.constructor.values[s]},toWireType:(s,c)=>c.value,argPackAdvance:q,readValueFromPointer:tn(r,t,n),destructorFunction:null}),er(r,i)},Le=(e,r)=>{var t=re[e];return t===void 0&&P(`${r} has unknown type ${Wr(e)}`),t},on=(e,r,t)=>{var n=Le(e,"enum");r=W(r);var i=n.constructor,s=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:fe(`${n.name}_${r}`,function(){})}});i.values[t]=s,i[r]=s},ar=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},an=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Fe[t>>2])};case 8:return function(t){return this.fromWireType(Me[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},sn=(e,r,t)=>{r=W(r),N(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:q,readValueFromPointer:an(r,t),destructorFunction:null})},un=(e,r,t,n,i,s,c)=>{var u=tr(r,t);e=W(e),e=Or(e),i=z(n,i),er(e,function(){He(`Cannot call ${e} due to unbound types`,u)},r-1),te([],u,l=>{var d=[l[0],null].concat(l.slice(1));return Fr(e,nr(e,d,null,i,s,c),r-1),[]})},cn=(e,r,t)=>{switch(r){case 1:return t?n=>j[n]:n=>O[n];case 2:return t?n=>K[n>>1]:n=>_e[n>>1];case 4:return t?n=>Z[n>>2]:n=>S[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},fn=(e,r,t,n,i)=>{r=W(r);var s=h=>h;if(n===0){var c=32-8*t;s=h=>h<>>c}var u=r.includes("unsigned"),l=(h,y)=>{},d;u?d=function(h,y){return l(y,this.name),y>>>0}:d=function(h,y){return l(y,this.name),y},N(e,{name:r,fromWireType:s,toWireType:d,argPackAdvance:q,readValueFromPointer:cn(r,t,n!==0),destructorFunction:null})},ln=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[r];function s(c){var u=S[c>>2],l=S[c+4>>2];return new i(j.buffer,l,u)}t=W(t),N(e,{name:t,fromWireType:s,argPackAdvance:q,readValueFromPointer:s},{ignoreDuplicateRegistrations:!0})},vn=(e,r)=>{xr(e)},dn=(e,r,t,n)=>{if(!(n>0))return 0;for(var i=t,s=t+n-1,c=0;c=55296&&u<=57343){var l=e.charCodeAt(++c);u=65536+((u&1023)<<10)|l&1023}if(u<=127){if(t>=s)break;r[t++]=u}else if(u<=2047){if(t+1>=s)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(u<=65535){if(t+2>=s)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=s)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63}}return r[t]=0,t-i},pn=(e,r,t)=>dn(e,O,r,t),hn=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},Dr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,yn=(e,r,t)=>{for(var n=r+t,i=r;e[i]&&!(i>=n);)++i;if(i-r>16&&e.buffer&&Dr)return Dr.decode(e.subarray(r,i));for(var s="";r>10,56320|d&1023)}}return s},_n=(e,r)=>e?yn(O,e,r):"",mn=(e,r)=>{r=W(r);var t=r==="std::string";N(e,{name:r,fromWireType(n){var i=S[n>>2],s=n+4,c;if(t)for(var u=s,l=0;l<=i;++l){var d=s+l;if(l==i||O[d]==0){var h=d-u,y=_n(u,h);c===void 0?c=y:(c+=String.fromCharCode(0),c+=y),u=d+1}}else{for(var g=new Array(i),l=0;l>2]=s,t&&c)pn(i,l,s+1);else if(c)for(var d=0;d255&&(X(l),P("String has UTF-16 code units that do not fit in 8 bits")),O[l+d]=h}else for(var d=0;d{for(var t=e,n=t>>1,i=n+r/2;!(n>=i)&&_e[n];)++n;if(t=n<<1,t-e>32&&jr)return jr.decode(O.subarray(e,t));for(var s="",c=0;!(c>=r/2);++c){var u=K[e+c*2>>1];if(u==0)break;s+=String.fromCharCode(u)}return s},wn=(e,r,t)=>{if(t??=2147483647,t<2)return 0;t-=2;for(var n=r,i=t>1]=c,r+=2}return K[r>>1]=0,r-n},bn=e=>e.length*2,$n=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var i=Z[e+t*4>>2];if(i==0)break;if(++t,i>=65536){var s=i-65536;n+=String.fromCharCode(55296|s>>10,56320|s&1023)}else n+=String.fromCharCode(i)}return n},Pn=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,i=n+t-4,s=0;s=55296&&c<=57343){var u=e.charCodeAt(++s);c=65536+((c&1023)<<10)|u&1023}if(Z[r>>2]=c,r+=4,r+4>i)break}return Z[r>>2]=0,r-n},Tn=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},Cn=(e,r,t)=>{t=W(t);var n,i,s,c;r===2?(n=gn,i=wn,c=bn,s=u=>_e[u>>1]):r===4&&(n=$n,i=Pn,c=Tn,s=u=>S[u>>2]),N(e,{name:t,fromWireType:u=>{for(var l=S[u>>2],d,h=u+4,y=0;y<=l;++y){var g=u+4+y*r;if(y==l||s(g)==0){var C=g-h,T=n(h,C);d===void 0?d=T:(d+=String.fromCharCode(0),d+=T),h=g+r}}return X(u),d},toWireType:(u,l)=>{typeof l!="string"&&P(`Cannot pass non-string to C++ string type ${t}`);var d=c(l),h=fr(4+d+r);return S[h>>2]=d/r,i(l,h+4,d+r),u!==null&&u.push(X,h),h},argPackAdvance:q,readValueFromPointer:ge,destructorFunction(u){X(u)}})},Sn=(e,r,t,n,i,s)=>{Oe[e]={name:W(r),rawConstructor:z(t,n),rawDestructor:z(i,s),fields:[]}},kn=(e,r,t,n,i,s,c,u,l,d)=>{Oe[e].fields.push({fieldName:W(r),getterReturnType:t,getter:z(n,i),getterContext:s,setterArgumentType:c,setter:z(u,l),setterContext:d})},An=(e,r)=>{r=W(r),N(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},En=(e,r,t)=>O.copyWithin(e,r,r+t),Ur=(e,r,t)=>{var n=[],i=e.toWireType(n,t);return n.length&&(S[r>>2]=R.toHandle(n)),i},Rn=(e,r,t)=>(e=R.toValue(e),r=Le(r,"emval::as"),Ur(r,t,e)),Fn={},Br=e=>{var r=Fn[e];return r===void 0?W(e):r},sr=[],Mn=(e,r,t,n,i)=>(e=sr[e],r=R.toValue(r),t=Br(t),e(r,r[t],n,i)),Wn=(e,r)=>(e=R.toValue(e),r=R.toValue(r),e==r),Vn=e=>{var r=sr.length;return sr.push(e),r},In=(e,r)=>{for(var t=new Array(e),n=0;n>2],"parameter "+n);return t},On=(e,r,t)=>{var n=In(e,r),i=n.shift();e--;var s=`return function (obj, func, destructorsRef, args) { +`,c=0,u=[];t===0&&u.push("obj");for(var l=["retType"],d=[i],h=0;hT.name).join(", ")}) => ${i.name}>`;return Vn(fe(C,g))},xn=(e,r)=>(e=R.toValue(e),r=R.toValue(r),R.toHandle(e[r])),Dn=e=>{e>9&&(J[e+1]+=1)},jn=e=>R.toHandle(Br(e)),Un=()=>R.toHandle({}),Bn=e=>{var r=R.toValue(e);Ke(r),or(e)},Hn=(e,r,t)=>{e=R.toValue(e),r=R.toValue(r),t=R.toValue(t),e[r]=t},Ln=(e,r)=>{e=Le(e,"_emval_take_value");var t=e.readValueFromPointer(r);return R.toHandle(t)},zn=()=>2147483648,Nn=e=>{var r=Re.buffer,t=(e-r.byteLength+65535)/65536;try{return Re.grow(t),hr(),1}catch{}},qn=e=>{var r=O.length;e>>>=0;var t=zn();if(e>t)return!1;for(var n=(l,d)=>l+(d-l%d)%d,i=1;i<=4;i*=2){var s=r*(1+.2/i);s=Math.min(s,e+100663296);var c=Math.min(t,n(Math.max(e,s),65536)),u=Nn(c);if(u)return!0}return!1},Gn=e=>e,Hr=(e,r)=>{e<128?r.push(e):r.push(e%128|128,e>>7)},Jn=e=>{for(var r={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:e[0]=="v"?[]:[r[e[0]]]},n=1;n{var t=e.slice(0,1),n=e.slice(1),i={i:127,p:127,j:126,f:125,d:124,e:111};r.push(96),Hr(n.length,r);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Jn(r),e);var t=[1];Xn(r,t);var n=[0,97,115,109,1,0,0,0,1];Hr(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var i=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(i,{e:{f:e}}),c=s.exports.f;return c},Zn=(e,r)=>{if(ie)for(var t=e;t(ie||(ie=new WeakMap,Zn(0,ne.length)),ie.get(e)||0),ur=[],Yn=()=>{if(ur.length)return ur.pop();try{ne.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return ne.length-1},cr=(e,r)=>{ne.set(e,r),Te[e]=ne.get(e)},Ce=(e,r)=>{var t=Qn(e);if(t)return t;var n=Yn();try{cr(n,e)}catch(s){if(!(s instanceof TypeError))throw s;var i=Kn(e,r);cr(n,i)}return ie.set(e,n),n},Se=e=>{ie.delete(m(e)),cr(e,null),ur.push(e)};Tr=a.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Tt(),ce=a.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Ot(),Mt(),zt(),Mr=a.UnboundTypeError=Jt(Error,"UnboundTypeError"),en();var ei={K:ht,aa:yt,a:mt,k:gt,h:wt,d:_t,Z:bt,oa:$t,Y:Pt,la:St,x:Xt,w:Zt,i:Qt,ka:xr,N:nn,t:on,U:sn,o:un,z:fn,s:ln,A:vn,T:mn,M:Cn,B:Sn,pa:kn,na:An,$:En,ta:Rn,ia:Mn,va:or,sa:Wn,ma:On,ua:xn,ra:Dn,F:jn,V:Un,W:Bn,wa:Hn,E:Ln,_:qn,y:pi,H:Ri,fa:Ei,J:si,u:ii,I:Ci,e:ai,b:ti,m:ni,n:di,D:ci,X:Oi,j:yi,f:oi,ea:Fi,ca:Ii,g:ui,r:_i,ha:ki,ga:Ai,G:Vi,O:Mi,ja:hi,da:Wi,c:ri,L:Si,qa:li,l:fi,v:$i,S:wi,p:mi,Q:Pi,P:Ti,C:gi,q:vi,R:bi,ba:Gn},V=pt(),Lr=e=>(Lr=V.za)(e),X=e=>(X=V.Ba)(e),fr=e=>(fr=V.Ca)(e),w=(e,r)=>(w=V.Da)(e,r),zr=e=>(zr=V.Ea)(e),Nr=e=>(Nr=V.Fa)(e),qr=()=>(qr=V.Ga)(),Gr=e=>(Gr=V.Ha)(e),Jr=e=>(Jr=V.Ia)(e),Xr=(e,r,t)=>(Xr=V.Ja)(e,r,t),Kr=e=>(Kr=V.Ka)(e),Zr=a.dynCall_iiij=(e,r,t,n,i)=>(Zr=a.dynCall_iiij=V.La)(e,r,t,n,i);function ri(e,r,t,n){var i=$();try{m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function ti(e,r,t){var n=$();try{return m(e)(r,t)}catch(i){if(b(n),i!==i+0)throw i;w(1,0)}}function ni(e,r,t,n){var i=$();try{return m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function ii(e,r,t,n,i,s){var c=$();try{return m(e)(r,t,n,i,s)}catch(u){if(b(c),u!==u+0)throw u;w(1,0)}}function oi(e,r){var t=$();try{m(e)(r)}catch(n){if(b(t),n!==n+0)throw n;w(1,0)}}function ai(e,r){var t=$();try{return m(e)(r)}catch(n){if(b(t),n!==n+0)throw n;w(1,0)}}function si(e,r,t,n){var i=$();try{return m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function ui(e,r,t){var n=$();try{m(e)(r,t)}catch(i){if(b(n),i!==i+0)throw i;w(1,0)}}function ci(e,r,t,n,i,s){var c=$();try{return m(e)(r,t,n,i,s)}catch(u){if(b(c),u!==u+0)throw u;w(1,0)}}function fi(e,r,t,n,i){var s=$();try{m(e)(r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}function li(e,r,t,n,i,s,c,u){var l=$();try{m(e)(r,t,n,i,s,c,u)}catch(d){if(b(l),d!==d+0)throw d;w(1,0)}}function vi(e,r,t,n,i,s,c,u,l,d,h){var y=$();try{m(e)(r,t,n,i,s,c,u,l,d,h)}catch(g){if(b(y),g!==g+0)throw g;w(1,0)}}function di(e,r,t,n,i){var s=$();try{return m(e)(r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}function pi(e,r){var t=$();try{return m(e)(r)}catch(n){if(b(t),n!==n+0)throw n;w(1,0)}}function hi(e,r,t,n,i,s,c){var u=$();try{m(e)(r,t,n,i,s,c)}catch(l){if(b(u),l!==l+0)throw l;w(1,0)}}function yi(e){var r=$();try{m(e)()}catch(t){if(b(r),t!==t+0)throw t;w(1,0)}}function _i(e,r,t,n){var i=$();try{m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function mi(e,r,t,n,i,s,c){var u=$();try{m(e)(r,t,n,i,s,c)}catch(l){if(b(u),l!==l+0)throw l;w(1,0)}}function gi(e,r,t,n,i,s,c,u,l,d,h,y,g,C){var T=$();try{m(e)(r,t,n,i,s,c,u,l,d,h,y,g,C)}catch(I){if(b(T),I!==I+0)throw I;w(1,0)}}function wi(e,r,t,n,i,s,c){var u=$();try{m(e)(r,t,n,i,s,c)}catch(l){if(b(u),l!==l+0)throw l;w(1,0)}}function bi(e,r,t,n,i,s,c,u,l,d,h,y,g,C,T,I,x,o,f){var v=$();try{m(e)(r,t,n,i,s,c,u,l,d,h,y,g,C,T,I,x,o,f)}catch(p){if(b(v),p!==p+0)throw p;w(1,0)}}function $i(e,r,t,n,i,s){var c=$();try{m(e)(r,t,n,i,s)}catch(u){if(b(c),u!==u+0)throw u;w(1,0)}}function Pi(e,r,t,n,i,s,c,u){var l=$();try{m(e)(r,t,n,i,s,c,u)}catch(d){if(b(l),d!==d+0)throw d;w(1,0)}}function Ti(e,r,t,n,i,s,c,u,l,d){var h=$();try{m(e)(r,t,n,i,s,c,u,l,d)}catch(y){if(b(h),y!==y+0)throw y;w(1,0)}}function Ci(e){var r=$();try{return m(e)()}catch(t){if(b(r),t!==t+0)throw t;w(1,0)}}function Si(e,r,t,n,i){var s=$();try{m(e)(r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}function ki(e,r,t,n,i){var s=$();try{m(e)(r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}function Ai(e,r,t,n,i,s){var c=$();try{m(e)(r,t,n,i,s)}catch(u){if(b(c),u!==u+0)throw u;w(1,0)}}function Ei(e,r,t,n){var i=$();try{return m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function Ri(e,r,t){var n=$();try{return m(e)(r,t)}catch(i){if(b(n),i!==i+0)throw i;w(1,0)}}function Fi(e,r,t){var n=$();try{m(e)(r,t)}catch(i){if(b(n),i!==i+0)throw i;w(1,0)}}function Mi(e,r,t,n,i){var s=$();try{m(e)(r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}function Wi(e,r,t,n,i,s,c,u,l){var d=$();try{m(e)(r,t,n,i,s,c,u,l)}catch(h){if(b(d),h!==h+0)throw h;w(1,0)}}function Vi(e,r,t,n,i,s){var c=$();try{m(e)(r,t,n,i,s)}catch(u){if(b(c),u!==u+0)throw u;w(1,0)}}function Ii(e,r,t,n){var i=$();try{m(e)(r,t,n)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function Oi(e,r,t,n,i){var s=$();try{return Zr(e,r,t,n,i)}catch(c){if(b(s),c!==c+0)throw c;w(1,0)}}a.addFunction=Ce,a.removeFunction=Se;var ze;me=function e(){ze||Qr(),ze||(me=e)};function Qr(){if(Y>0||(rt(),Y>0))return;function e(){ze||(ze=!0,a.calledRun=!0,!pr&&(tt(),pe(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),nt()))}a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),e()},1)):e()}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return Qr(),oe=U,oe}})();export{Bi as M}; +//# sourceMappingURL=manifold.js.map diff --git a/assets/manifold.js.map b/assets/manifold.js.map new file mode 100644 index 000000000..0f5891f9b --- /dev/null +++ b/assets/manifold.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"k3BACG,IAACA,IAAU,IAAM,CAClB,IAAIC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iseReject","readyPromise","resolve","reject","ENVIRONMENT_IS_WEB","ENVIRONMENT_IS_WORKER","ENVIRONMENT_IS_NODE","createRequire","__vitePreload","require","_ManifoldInitialized","toVec","vec","list","f","x","fromVec","result","size","i","vec2polygons","nPoly","v","nPts","poly","j","polygons2vec","polygons","p","disposePolygons","polygonsVec","vararg2vec2","vararg2vec3","fillRuleToInt","fillRule","joinTypeToInt","joinType","CrossSectionCtor","cross","cs","func","wasmFuncPtr","addFunction","vec2Ptr","getValue","y","vert","setValue","out","removeFunction","delta","miterLimit","circularSegments","height","nDivisions","twistDegrees","scaleTop","center","man","revolveDegrees","other","minSharpAngle","minSmoothness","vec3Ptr","z","status","normalIdx","numProp","oldNumProp","newPtr","oldPtr","newProp","pos","oldProp","xOrVec","normal","offset","manifold","Mesh","triVerts","vertProperties","mergeFromVert","mergeToVert","runIndex","runOriginalID","faceID","halfedgeTangent","runTransform","changed","mesh","tri","halfedge","run","mat4","col","row","code","args","message","base","radius","crossSectionBatchbool","name","pushVec2","ps","pts","polys","t","ManifoldCtor","radiusLow","radiusHigh","sharpenedEdges","sharp","n","manifolds","manifoldBatchbool","m","sdf","bounds","edgeLength","level","precision","bounds2","pushVec3","moduleOverrides","scriptDirectory","locateFile","path","read_","readAsync","readBinary","fs","nodePath","filename","binary","isFileURI","ret","onload","onerror","err","data","url","xhr","response","wasmBinary","wasmMemory","ABORT","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAPF32","HEAPF64","updateMemoryViews","b","__ATPRERUN__","__ATINIT__","__ATPOSTRUN__","preRun","addOnPreRun","callRuntimeCallbacks","initRuntime","postRun","addOnPostRun","cb","addOnInit","runDependencies","dependenciesFulfilled","addRunDependency","id","removeRunDependency","callback","abort","what","e","dataURIPrefix","isDataURI","findWasmBinary","wasmBinaryFile","getBinarySync","file","getBinaryPromise","binaryFile","error","instantiateArrayBuffer","imports","receiver","reason","instantiateAsync","getWasmImports","wasmImports","createWasm","info","receiveInstance","instance","module","wasmExports","wasmTable","receiveInstantiationResult","callbacks","ptr","type","value","stackRestore","val","__emscripten_stack_restore","stackSave","_emscripten_stack_get_current","exceptionCaught","___cxa_begin_catch","ExceptionInfo","___cxa_increment_exception_refcount","exceptionLast","___cxa_end_catch","_setThrew","___cxa_decrement_exception_refcount","excPtr","destructor","caught","rethrown","adjustedPtr","isPointer","___cxa_is_pointer_type","adjusted","___resumeException","setTempRet0","__emscripten_tempret_set","findMatchingCatch","thrown","thrownType","caughtType","adjusted_ptr_addr","___cxa_can_catch","___cxa_find_matching_catch_2","___cxa_find_matching_catch_3","arg0","___cxa_throw","__abort_js","structRegistrations","runDestructors","destructors","del","readPointer","pointer","awaitingDependencies","registeredTypes","typeDependencies","InternalError","throwInternalError","whenDependentTypesAreResolved","myTypes","dependentTypes","getTypeConverters","onComplete","typeConverters","myTypeConverters","registerType","unregisteredTypes","registered","dt","__embind_finalize_value_object","structType","reg","rawConstructor","rawDestructor","fieldRecords","fieldTypes","field","fields","fieldName","getterReturnType","getter","getterContext","setterArgumentType","setter","setterContext","o","rv","GenericWireTypeSize","__embind_register_bigint","primitiveType","minRange","maxRange","embind_init_charCodes","codes","embind_charCodes","readLatin1String","c","BindingError","throwBindingError","sharedRegisterType","rawType","registeredInstance","options","__embind_register_bool","trueValue","falseValue","wt","shallowCopyInternalPointer","throwInstanceAlreadyDeleted","obj","getInstanceTypeName","handle","finalizationRegistry","detachFinalizer","runDestructor","$$","releaseClassHandle","toDelete","downcastPointer","ptrClass","desiredClass","registeredPointers","getInheritedInstanceCount","registeredInstances","getLiveInheritedInstances","k","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","fn","init_embind","getBasestPointer","class_","getInheritedInstance","makeClassHandle","prototype","record","hasSmartPtrType","hasSmartPtr","attachFinalizer","RegisteredPointer_fromWireType","rawPointer","makeDefaultHandle","actualType","registeredPointerRecord","toType","dp","init_ClassHandle","ClassHandle","leftClass","left","rightClass","right","clone","createNamedFunction","body","ensureOverloadTable","proto","methodName","humanName","prevFunc","exposePublicSymbol","numArguments","char_0","char_9","makeLegalFunctionName","RegisteredClass","constructor","instancePrototype","baseClass","getActualType","upcast","downcast","upcastPointer","constNoSmartPtrRawPointerToWireType","embindRepr","handleClass","genericPointerToWireType","clonedHandle","Emval","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","registeredClass","isReference","isConst","isSmartPointer","pointeeType","sharingPolicy","rawGetPointee","rawShare","replacePublicSymbol","dynCallLegacy","sig","wasmTableMirror","getWasmTableEntry","funcPtr","dynCall","rtn","getDynCaller","embind__requireFunction","signature","rawFunction","makeDynCaller","fp","extendError","baseErrorType","errorName","errorClass","stack","UnboundTypeError","getTypeName","___getTypeName","_free","throwUnboundTypeError","types","unboundTypes","seen","visit","__embind_register_class","rawPointerType","rawConstPointerType","baseClassRawType","getActualTypeSignature","upcastSignature","downcastSignature","destructorSignature","legalFunctionName","basePrototype","referenceConverter","pointerConverter","constPointerConverter","heap32VectorToArray","count","firstElement","array","usesDestructorStack","argTypes","newFunc","argumentList","dummy","r","createJsInvoker","isClassMethodFunc","returns","isAsync","needsDestructorStack","argCount","argsList","argsListWired","invokerFnBody","dtorStack","args1","paramName","craftInvokerFunction","classType","cppInvokerFunc","cppTargetFunc","closureArgs","invokerFn","__embind_register_class_constructor","rawClassType","rawArgTypesAddr","invokerSignature","invoker","rawArgTypes","getFunctionName","argsIndex","__embind_register_class_function","rawInvoker","context","isPureVirtual","unboundTypesHandler","method","memberFunction","emval_freelist","emval_handles","__emval_decref","count_emval_handles","init_emval","EmValType","__embind_register_emval","enumReadValueFromPointer","width","signed","__embind_register_enum","isSigned","ctor","requireRegisteredType","impl","__embind_register_enum_value","rawEnumType","enumValue","enumType","Enum","Value","floatReadValueFromPointer","__embind_register_float","__embind_register_function","invokerArgsArray","integerReadValueFromPointer","__embind_register_integer","fromWireType","bitshift","isUnsignedType","checkAssertions","toTypeName","toWireType","__embind_register_memory_view","dataTypeIndex","typeMapping","TA","decodeMemoryView","__embind_register_optional","rawOptionalType","stringToUTF8Array","str","heap","outIdx","maxBytesToWrite","startIdx","endIdx","u1","stringToUTF8","outPtr","lengthBytesUTF8","len","UTF8Decoder","UTF8ArrayToString","heapOrArray","idx","maxBytesToRead","endPtr","u0","u2","ch","UTF8ToString","__embind_register_std_string","stdStringIsUTF8","length","payload","decodeStartPtr","currentBytePtr","maxRead","stringSegment","a","valueIsOfTypeString","_malloc","charCode","UTF16Decoder","UTF16ToString","maxIdx","codeUnit","stringToUTF16","startPtr","numCharsToWrite","lengthBytesUTF16","UTF32ToString","utf32","stringToUTF32","trailSurrogate","lengthBytesUTF32","__embind_register_std_wstring","charSize","decodeString","encodeString","readCharAt","lengthBytesUTF","maxReadBytes","__embind_register_value_object","constructorSignature","__embind_register_value_object_field","getterSignature","setterSignature","__embind_register_void","__emscripten_memcpy_js","dest","src","num","emval_returnValue","returnType","destructorsRef","__emval_as","emval_symbols","getStringOrSymbol","address","symbol","emval_methodCallers","__emval_call_method","caller","objHandle","__emval_equals","first","second","emval_addMethodCaller","emval_lookupTypes","__emval_get_method_caller","kind","retType","functionBody","params","invokerFunction","functionName","__emval_get_property","key","__emval_incref","__emval_new_cstring","__emval_new_object","__emval_run_destructors","__emval_set_property","__emval_take_value","arg","getHeapMax","growMemory","pages","_emscripten_resize_heap","requestedSize","oldSize","maxHeapSize","alignUp","multiple","cutDown","overGrownHeapSize","newSize","replacement","_llvm_eh_typeid_for","uleb128Encode","target","sigToWasmTypes","typeNames","generateFuncType","sigRet","sigParam","typeCodes","convertJsFunctionToWasm","typeSectionBody","bytes","wrappedFunc","updateTableMap","functionsInTableMap","item","getFunctionAddress","freeTableIndexes","getEmptyTableSlot","setWasmTableEntry","wrapped","index","invoke_dd","invoke_dii","invoke_diid","invoke_diii","invoke_diiiii","invoke_i","invoke_ii","invoke_iii","invoke_iiii","invoke_iiiii","invoke_iiiiii","invoke_iiij","invoke_v","invoke_vi","invoke_vid","invoke_vidi","invoke_vii","invoke_viid","invoke_viidd","invoke_viiddd","invoke_viiddi","invoke_viidi","invoke_viididi","invoke_viidiidid","invoke_viii","invoke_viiid","invoke_viiidddi","invoke_viiii","invoke_viiiii","invoke_viiiiid","invoke_viiiiii","invoke_viiiiiii","invoke_viiiiiiiii","invoke_viiiiiiiiidiii","invoke_viiiiiiiiii","invoke_viiiiiiiiiiiiiiiiii","a0","a1","a2","dynCall_iiij","a3","a4","sp","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14","a15","a16","a17","a18","calledRun","runCaller","doRun"],"sources":["../../built/manifold.js"],"sourcesContent":["\nvar Module = (() => {\n var _scriptName = import.meta.url;\n \n return (\nasync function(moduleArg = {}) {\n var moduleRtn;\n\nvar Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window==\"object\";var ENVIRONMENT_IS_WORKER=typeof importScripts==\"function\";var ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){const{createRequire:createRequire}=await import(\"module\");var require=createRequire(import.meta.url)}var _ManifoldInitialized=false;Module.setup=function(){if(_ManifoldInitialized)return;_ManifoldInitialized=true;function toVec(vec,list,f=(x=>x)){if(list){for(let x of list){vec.push_back(f(x))}}return vec}function fromVec(vec,f=(x=>x)){const result=[];const size=vec.size();for(let i=0;ix)){const result=[];const nPoly=vec.size();for(let i=0;itoVec(new Module.Vector_vec2,poly,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p}))}function disposePolygons(polygonsVec){for(let i=0;iresult.min[f]),max:[\"x\",\"y\"].map(f=>result.max[f])}};Module.CrossSection.prototype.offset=function(delta,joinType=\"Square\",miterLimit=2,circularSegments=0){return this._Offset(delta,joinTypeToInt(joinType),miterLimit,circularSegments)};Module.CrossSection.prototype.extrude=function(height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){scaleTop=vararg2vec2([scaleTop]);const man=Module._Extrude(this._ToPolygons(),height,nDivisions,twistDegrees,scaleTop);return center?man.translate([0,0,-height/2]):man};Module.CrossSection.prototype.revolve=function(circularSegments=0,revolveDegrees=360){return Module._Revolve(this._ToPolygons(),circularSegments,revolveDegrees)};Module.CrossSection.prototype.add=function(other){return this._add(cross(other))};Module.CrossSection.prototype.subtract=function(other){return this._subtract(cross(other))};Module.CrossSection.prototype.intersect=function(other){return this._intersect(cross(other))};Module.CrossSection.prototype.toPolygons=function(){const vec=this._ToPolygons();const result=vec2polygons(vec);vec.delete();return result};Module.Manifold.prototype.smoothOut=function(minSharpAngle=60,minSmoothness=0){return this._SmoothOut(minSharpAngle,minSmoothness)};Module.Manifold.prototype.warp=function(func){const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,\"double\");const y=getValue(vec3Ptr+8,\"double\");const z=getValue(vec3Ptr+16,\"double\");const vert=[x,y,z];func(vert);setValue(vec3Ptr,vert[0],\"double\");setValue(vec3Ptr+8,vert[1],\"double\");setValue(vec3Ptr+16,vert[2],\"double\")},\"vi\");const out=this._Warp(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return out};Module.Manifold.prototype.calculateNormals=function(normalIdx,minSharpAngle=60){return this._CalculateNormals(normalIdx,minSharpAngle)};Module.Manifold.prototype.setProperties=function(numProp,func){const oldNumProp=this.numProp();const wasmFuncPtr=addFunction(function(newPtr,vec3Ptr,oldPtr){const newProp=[];for(let i=0;iresult.min[f]),max:[\"x\",\"y\",\"z\"].map(f=>result.max[f])}};class Mesh{constructor({numProp:numProp=3,triVerts:triVerts=new Uint32Array,vertProperties:vertProperties=new Float32Array,mergeFromVert:mergeFromVert,mergeToVert:mergeToVert,runIndex:runIndex,runOriginalID:runOriginalID,faceID:faceID,halfedgeTangent:halfedgeTangent,runTransform:runTransform}={}){this.numProp=numProp;this.triVerts=triVerts;this.vertProperties=vertProperties;this.mergeFromVert=mergeFromVert;this.mergeToVert=mergeToVert;this.runIndex=runIndex;this.runOriginalID=runOriginalID;this.faceID=faceID;this.halfedgeTangent=halfedgeTangent;this.runTransform=runTransform}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:changed,mesh:mesh}=Module._Merge(this);Object.assign(this,{...mesh});return changed}verts(tri){return this.triVerts.subarray(3*tri,3*(tri+1))}position(vert){return this.vertProperties.subarray(this.numProp*vert,this.numProp*vert+3)}extras(vert){return this.vertProperties.subarray(this.numProp*vert+3,this.numProp*(vert+1))}tangent(halfedge){return this.halfedgeTangent.subarray(4*halfedge,4*(halfedge+1))}transform(run){const mat4=new Array(16);for(const col of[0,1,2,3]){for(const row of[0,1,2]){mat4[4*col+row]=this.runTransform[12*run+3*col+row]}}mat4[15]=1;return mat4}}Module.Mesh=Mesh;Module.Manifold.prototype.getMesh=function(normalIdx=[0,0,0]){if(normalIdx instanceof Array)normalIdx={0:normalIdx[0],1:normalIdx[1],2:normalIdx[2]};return new Mesh(this._GetMeshJS(normalIdx))};Module.ManifoldError=function ManifoldError(code,...args){let message=\"Unknown error\";switch(code){case Module.status.NonFiniteVertex.value:message=\"Non-finite vertex\";break;case Module.status.NotManifold.value:message=\"Not manifold\";break;case Module.status.VertexOutOfBounds.value:message=\"Vertex index out of bounds\";break;case Module.status.PropertiesWrongLength.value:message=\"Properties have wrong length\";break;case Module.status.MissingPositionProperties.value:message=\"Less than three properties\";break;case Module.status.MergeVectorsDifferentLengths.value:message=\"Merge vectors have different lengths\";break;case Module.status.MergeIndexOutOfBounds.value:message=\"Merge index out of bounds\";break;case Module.status.TransformWrongLength.value:message=\"Transform vector has wrong length\";break;case Module.status.RunIndexWrongLength.value:message=\"Run index vector has wrong length\";break;case Module.status.FaceIDWrongLength.value:message=\"Face ID vector has wrong length\";case Module.status.InvalidConstruction.value:message=\"Manifold constructed with invalid parameters\"}const base=Error.apply(this,[message,...args]);base.name=this.name=\"ManifoldError\";this.message=base.message;this.stack=base.stack;this.code=code};Module.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:Module.ManifoldError,writable:true,configurable:true}});Module.CrossSection=function(polygons,fillRule=\"Positive\"){const polygonsVec=polygons2vec(polygons);const cs=new CrossSectionCtor(polygonsVec,fillRuleToInt(fillRule));disposePolygons(polygonsVec);return cs};Module.CrossSection.ofPolygons=function(polygons,fillRule=\"Positive\"){return new Module.CrossSection(polygons,fillRule)};Module.CrossSection.square=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1};else if(typeof args[0]==\"number\")size={x:args[0],y:args[0]};else size=vararg2vec2(args);const center=args[1]||false;return Module._Square(size,center)};Module.CrossSection.circle=function(radius,circularSegments=0){return Module._Circle(radius,circularSegments)};function crossSectionBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_crossSection;for(const cs of args)v.push_back(cross(cs));const result=Module[\"_crossSection\"+name](v);v.delete();return result}}Module.CrossSection.compose=crossSectionBatchbool(\"Compose\");Module.CrossSection.union=crossSectionBatchbool(\"UnionN\");Module.CrossSection.difference=crossSectionBatchbool(\"DifferenceN\");Module.CrossSection.intersection=crossSectionBatchbool(\"IntersectionN\");function pushVec2(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p})}Module.CrossSection.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec2;for(const cs of args){if(cs instanceof CrossSectionCtor){Module._crossSectionCollectVertices(pts,cs)}else if(cs instanceof Array&&cs.length==2&&typeof cs[0]==\"number\"){pts.push_back({x:cs[0],y:cs[1]})}else if(cs.x){pts.push_back(cs)}else{const wrap=cs[0].length==2&&typeof cs[0][0]==\"number\"||cs[0].x;const polys=wrap?[cs]:cs;for(const poly of polys)pushVec2(pts,poly)}}const result=Module._crossSectionHullPoints(pts);pts.delete();return result};Module.CrossSection.prototype=Object.create(CrossSectionCtor.prototype);Object.defineProperty(Module.CrossSection,Symbol.hasInstance,{get:()=>t=>t instanceof CrossSectionCtor});const ManifoldCtor=Module.Manifold;Module.Manifold=function(mesh){const manifold=new ManifoldCtor(mesh);const status=manifold.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return manifold};Module.Manifold.ofMesh=function(mesh){return new Module.Manifold(mesh)};Module.Manifold.tetrahedron=function(){return Module._Tetrahedron()};Module.Manifold.cube=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1,z:1};else if(typeof args[0]==\"number\")size={x:args[0],y:args[0],z:args[0]};else size=vararg2vec3(args);const center=args[1]||false;return Module._Cube(size,center)};Module.Manifold.cylinder=function(height,radiusLow,radiusHigh=-1,circularSegments=0,center=false){return Module._Cylinder(height,radiusLow,radiusHigh,circularSegments,center)};Module.Manifold.sphere=function(radius,circularSegments=0){return Module._Sphere(radius,circularSegments)};Module.Manifold.smooth=function(mesh,sharpenedEdges=[]){const sharp=new Module.Vector_smoothness;toVec(sharp,sharpenedEdges);const result=Module._Smooth(mesh,sharp);sharp.delete();return result};Module.Manifold.extrude=function(polygons,height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,\"Positive\");return cs.extrude(height,nDivisions,twistDegrees,scaleTop,center)};Module.Manifold.revolve=function(polygons,circularSegments=0,revolveDegrees=360){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,\"Positive\");return cs.revolve(circularSegments,revolveDegrees)};Module.Manifold.reserveIDs=function(n){return Module._ReserveIDs(n)};Module.Manifold.compose=function(manifolds){const vec=new Module.Vector_manifold;toVec(vec,manifolds);const result=Module._manifoldCompose(vec);vec.delete();return result};function manifoldBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_manifold;for(const m of args)v.push_back(m);const result=Module[\"_manifold\"+name+\"N\"](v);v.delete();return result}}Module.Manifold.union=manifoldBatchbool(\"Union\");Module.Manifold.difference=manifoldBatchbool(\"Difference\");Module.Manifold.intersection=manifoldBatchbool(\"Intersection\");Module.Manifold.levelSet=function(sdf,bounds,edgeLength,level=0,precision=-1){const bounds2={min:{x:bounds.min[0],y:bounds.min[1],z:bounds.min[2]},max:{x:bounds.max[0],y:bounds.max[1],z:bounds.max[2]}};const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,\"double\");const y=getValue(vec3Ptr+8,\"double\");const z=getValue(vec3Ptr+16,\"double\");const vert=[x,y,z];return sdf(vert)},\"di\");const out=Module._LevelSet(wasmFuncPtr,bounds2,edgeLength,level,precision);removeFunction(wasmFuncPtr);return out};function pushVec3(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1],z:p[2]};return p})}Module.Manifold.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec3;for(const m of args){if(m instanceof ManifoldCtor){Module._manifoldCollectVertices(pts,m)}else if(m instanceof Array&&m.length==3&&typeof m[0]==\"number\"){pts.push_back({x:m[0],y:m[1],z:m[2]})}else if(m.x){pts.push_back(m)}else{pushVec3(pts,m)}}const result=Module._manifoldHullPoints(pts);pts.delete();return result};Module.Manifold.prototype=Object.create(ManifoldCtor.prototype);Object.defineProperty(Module.Manifold,Symbol.hasInstance,{get:()=>t=>t instanceof ManifoldCtor});Module.triangulate=function(polygons,precision=-1){const polygonsVec=polygons2vec(polygons);const result=fromVec(Module._Triangulate(polygonsVec,precision),x=>[x[0],x[1],x[2]]);disposePolygons(polygonsVec);return result}};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram=\"./this.program\";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require(\"fs\");var nodePath=require(\"path\");scriptDirectory=require(\"url\").fileURLToPath(new URL(\"./\",import.meta.url));read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:\"utf8\")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:\"utf8\",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module[\"thisProgram\"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\\\/g,\"/\")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith(\"blob:\")){scriptDirectory=\"\"}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1)}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{if(isFileURI(url)){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null);return}fetch(url,{credentials:\"same-origin\"}).then(response=>{if(response.ok){return response.arrayBuffer()}return Promise.reject(new Error(response.status+\" : \"+response.url))}).then(onload,onerror)}}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var wasmMemory;var ABORT=false;var EXITSTATUS;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module[\"HEAP8\"]=HEAP8=new Int8Array(b);Module[\"HEAP16\"]=HEAP16=new Int16Array(b);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(b);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(b);Module[\"HEAP32\"]=HEAP32=new Int32Array(b);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(b);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(b);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module[\"monitorRunDependencies\"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module[\"monitorRunDependencies\"]?.(runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module[\"onAbort\"]?.(what);what=\"Aborted(\"+what+\")\";err(what);ABORT=true;EXITSTATUS=1;what+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix=\"data:application/octet-stream;base64,\";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith(\"file://\");function findWasmBinary(){if(Module[\"locateFile\"]){var f=\"manifold.wasm\";if(!isDataURI(f)){return locateFile(f)}return f}return new URL(\"manifold.wasm\",import.meta.url).href}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw\"both async and sync fetching of the wasm failed\"}function getBinaryPromise(binaryFile){if(!wasmBinary){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),error=>{try{resolve(getBinarySync(binaryFile))}catch(e){reject(e)}})})}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming==\"function\"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch==\"function\"){return fetch(binaryFile,{credentials:\"same-origin\"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function getWasmImports(){return{a:wasmImports}}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports[\"xa\"];updateMemoryViews();wasmTable=wasmExports[\"Aa\"];addOnInit(wasmExports[\"ya\"]);removeRunDependency(\"wasm-instantiate\");return wasmExports}addRunDependency(\"wasm-instantiate\");function receiveInstantiationResult(result){receiveInstance(result[\"instance\"])}if(Module[\"instantiateWasm\"]){try{return Module[\"instantiateWasm\"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":return HEAP8[ptr];case\"i8\":return HEAP8[ptr];case\"i16\":return HEAP16[ptr>>1];case\"i32\":return HEAP32[ptr>>2];case\"i64\":abort(\"to do getValue(i64) use WASM_BIGINT\");case\"float\":return HEAPF32[ptr>>2];case\"double\":return HEAPF64[ptr>>3];case\"*\":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module[\"noExitRuntime\"]||true;function setValue(ptr,value,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":HEAP8[ptr]=value;break;case\"i8\":HEAP8[ptr]=value;break;case\"i16\":HEAP16[ptr>>1]=value;break;case\"i32\":HEAP32[ptr>>2]=value;break;case\"i64\":abort(\"to do setValue(i64) use WASM_BIGINT\");case\"float\":HEAPF32[ptr>>2]=value;break;case\"double\":HEAPF64[ptr>>3]=value;break;case\"*\":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw exceptionLast};var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var __abort_js=()=>{abort(\"\")};var structRegistrations={};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function readPointer(pointer){return this[\"fromWireType\"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError;var throwInternalError=message=>{throw new InternalError(message)};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError(\"Mismatched type converter count\")}for(var i=0;i{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_finalize_value_object=structType=>{var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>getterReturnType[\"fromWireType\"](getter(getterContext,ptr)),write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType[\"toWireType\"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,fromWireType:ptr=>{var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},toWireType:(destructors,o)=>{for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError(`Missing field: \"${fieldName}\"`)}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:rawDestructor}]})};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{};var embind_init_charCodes=()=>{var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes};var embind_charCodes;var readLatin1String=ptr=>{var ret=\"\";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret};var BindingError;var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type \"${name}\" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){if(!(\"argPackAdvance\"in registeredInstance)){throw new TypeError(\"registerType registeredInstance requires argPackAdvance\")}return sharedRegisterType(rawType,registeredInstance,options)}var GenericWireTypeSize=8;var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(pointer){return this[\"fromWireType\"](HEAPU8[pointer])},destructorFunction:null})};var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+\" instance already deleted\")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredPointers={};var getInheritedInstanceCount=()=>Object.keys(registeredInstances).length;var getLiveInheritedInstances=()=>{var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj[\"delete\"]()}};var delayFunction;var setDelayFunction=fn=>{delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}};var init_embind=()=>{Module[\"getInheritedInstanceCount\"]=getInheritedInstanceCount;Module[\"getLiveInheritedInstances\"]=getLiveInheritedInstances;Module[\"flushPendingDeletes\"]=flushPendingDeletes;Module[\"setDelayFunction\"]=setDelayFunction};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError(\"ptr should not be undefined\")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError(\"makeClassHandle requires ptr and ptrType\")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError(\"Both smartPtrType and smartPtr must be specified\")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance[\"clone\"]()}else{var rv=registeredInstance[\"clone\"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var attachFinalizer=handle=>{if(\"undefined\"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError(\"Object already scheduled for deletion\")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError(\"Object already scheduled for deletion\")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}})};function ClassHandle(){}var createNamedFunction=(name,body)=>Object.defineProperty(body,\"name\",{value:name});var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{if(undefined===name){return\"_unknown\"}name=name.replace(/[^a-zA-Z0-9_]/g,\"$\");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError(\"Passing raw pointer to smart pointer is illegal\")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle[\"clone\"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle[\"delete\"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError(\"Unsupporting sharing policy\")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this[\"toWireType\"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this[\"toWireType\"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this[\"toWireType\"]=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError(\"Replacing nonexistent public symbol\")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var dynCallLegacy=(sig,ptr,args)=>{sig=sig.replace(/p/g,\"i\");var f=Module[\"dynCall_\"+sig];return f(ptr,...args)};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args=[])=>{if(sig.includes(\"j\")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr)(...args);return rtn};var getDynCaller=(sig,ptr)=>(...args)=>dynCall(sig,ptr,args);var embind__requireFunction=(signature,rawFunction)=>{signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes(\"j\")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!=\"function\"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};var extendError=(baseErrorType,errorName)=>{var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+\"\\n\"+stack.replace(/^Error(:[^\\n]*)?\\n/,\"\")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return`${this.name}: ${this.message}`}};return errorClass};var UnboundTypeError;var getTypeName=type=>{var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([\", \"]))};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError(\"Use 'new' to construct \"+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+\" has no accessible constructor\")}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+\"*\",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+\" const*\",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i>2])}return array};function usesDestructorStack(argTypes){for(var i=1;i0?\", \":\"\")+argsListWired}invokerFnBody+=(returns||isAsync?\"var rv = \":\"\")+\"invoker(fn\"+(argsListWired.length>0?\", \":\"\")+argsListWired+\");\\n\";if(needsDestructorStack){invokerFnBody+=\"runDestructors(destructors);\\n\"}else{for(var i=isClassMethodFunc?1:2;i{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf(\"(\");if(argsIndex!==-1){return signature.substr(0,argsIndex)}else{return signature}};var __embind_register_class_function=(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);methodName=getFunctionName(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith(\"@@\")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};var emval_freelist=[];var emval_handles=[];var __emval_decref=handle=>{if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}};var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length;var init_emval=()=>{emval_handles.push(0,1,undefined,1,null,1,true,1,false,1);Module[\"count_emval_handles\"]=count_emval_handles};var Emval={toValue:handle=>{if(!handle){throwBindingError(\"Cannot use deleted val. handle = \"+handle)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:\"emscripten::val\",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};var __embind_register_emval=rawType=>registerType(rawType,EmValType);var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this[\"fromWireType\"](HEAP8[pointer])}:function(pointer){return this[\"fromWireType\"](HEAPU8[pointer])};case 2:return signed?function(pointer){return this[\"fromWireType\"](HEAP16[pointer>>1])}:function(pointer){return this[\"fromWireType\"](HEAPU16[pointer>>1])};case 4:return signed?function(pointer){return this[\"fromWireType\"](HEAP32[pointer>>2])}:function(pointer){return this[\"fromWireType\"](HEAPU32[pointer>>2])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_enum=(rawType,name,size,isSigned)=>{name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,fromWireType:function(c){return this.constructor.values[c]},toWireType:(destructors,c)=>c.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};var __embind_register_enum_value=(rawEnumType,name,enumValue)=>{var enumType=requireRegisteredType(rawEnumType,\"enum\");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value};var embindRepr=v=>{if(v===null){return\"null\"}var t=typeof v;if(t===\"object\"||t===\"array\"||t===\"function\"){return v.toString()}else{return\"\"+v}};var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this[\"fromWireType\"](HEAPF32[pointer>>2])};case 8:return function(pointer){return this[\"fromWireType\"](HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:value=>value,toWireType:(destructors,value)=>value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<>>bitshift}var isUnsignedType=name.includes(\"unsigned\");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,fromWireType:fromWireType,toWireType:toWireType,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:decodeMemoryView,argPackAdvance:GenericWireTypeSize,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})};var __embind_register_optional=(rawOptionalType,rawType)=>{__embind_register_emval(rawOptionalType)};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str=\"\";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\";var __embind_register_std_string=(rawType,name)=>{name=readLatin1String(name);var stdStringIsUTF8=name===\"std::string\";registerType(rawType,{name:name,fromWireType(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError(\"String has UTF-16 code units that do not fit in 8 bits\")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i{var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str=\"\";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead)=>{var i=0;var str=\"\";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=readLatin1String(name);var decodeString,encodeString,readCharAt,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;readCharAt=pointer=>HEAPU16[pointer>>1]}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;readCharAt=pointer=>HEAPU32[pointer>>2]}registerType(rawType,{name:name,fromWireType:value=>{var length=HEAPU32[value>>2];var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||readCharAt(currentBytePtr)==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value==\"string\")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var __embind_register_value_object=(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor)=>{structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}};var __embind_register_value_object_field=(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})};var __embind_register_void=(rawType,name)=>{name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,argPackAdvance:0,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var emval_returnValue=(returnType,destructorsRef,handle)=>{var destructors=[];var result=returnType[\"toWireType\"](destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors)}return result};var __emval_as=(handle,returnType,destructorsRef)=>{handle=Emval.toValue(handle);returnType=requireRegisteredType(returnType,\"emval::as\");return emval_returnValue(returnType,destructorsRef,handle)};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol};var emval_methodCallers=[];var __emval_call_method=(caller,objHandle,methodName,destructorsRef,args)=>{caller=emval_methodCallers[caller];objHandle=Emval.toValue(objHandle);methodName=getStringOrSymbol(methodName);return caller(objHandle,objHandle[methodName],destructorsRef,args)};var __emval_equals=(first,second)=>{first=Emval.toValue(first);second=Emval.toValue(second);return first==second};var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i>2],\"parameter \"+i)}return a};var reflectConstruct=Reflect.construct;var __emval_get_method_caller=(argCount,argTypes,kind)=>{var types=emval_lookupTypes(argCount,argTypes);var retType=types.shift();argCount--;var functionBody=`return function (obj, func, destructorsRef, args) {\\n`;var offset=0;var argsList=[];if(kind===0){argsList.push(\"obj\")}var params=[\"retType\"];var args=[retType];for(var i=0;it.name).join(\", \")}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};var __emval_get_property=(handle,key)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>9){emval_handles[handle+1]+=1}};var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_new_object=()=>Emval.toHandle({});var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __emval_set_property=(handle,key,value)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value};var __emval_take_value=(type,arg)=>{type=requireRegisteredType(type,\"_emval_take_value\");var v=type[\"readValueFromPointer\"](arg);return Emval.toHandle(v)};var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _llvm_eh_typeid_for=type=>type;var uleb128Encode=(n,target)=>{if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}};var sigToWasmTypes=sig=>{var typeNames={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\",e:\"externref\",p:\"i32\"};var type={parameters:[],results:sig[0]==\"v\"?[]:[typeNames[sig[0]]]};for(var i=1;i{var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={i:127,p:127,j:126,f:125,d:124,e:111};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i{if(typeof WebAssembly.Function==\"function\"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push(...typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{e:{f:func}});var wrappedFunc=instance.exports[\"f\"];return wrappedFunc};var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\"}return wasmTable.length-1};var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));setWasmTableEntry(index,null);freeTableIndexes.push(index)};InternalError=Module[\"InternalError\"]=class InternalError extends Error{constructor(message){super(message);this.name=\"InternalError\"}};embind_init_charCodes();BindingError=Module[\"BindingError\"]=class BindingError extends Error{constructor(message){super(message);this.name=\"BindingError\"}};init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module[\"UnboundTypeError\"]=extendError(Error,\"UnboundTypeError\");init_emval();var wasmImports={K:___cxa_begin_catch,aa:___cxa_end_catch,a:___cxa_find_matching_catch_2,k:___cxa_find_matching_catch_3,h:___cxa_throw,d:___resumeException,Z:__abort_js,oa:__embind_finalize_value_object,Y:__embind_register_bigint,la:__embind_register_bool,x:__embind_register_class,w:__embind_register_class_constructor,i:__embind_register_class_function,ka:__embind_register_emval,N:__embind_register_enum,t:__embind_register_enum_value,U:__embind_register_float,o:__embind_register_function,z:__embind_register_integer,s:__embind_register_memory_view,A:__embind_register_optional,T:__embind_register_std_string,M:__embind_register_std_wstring,B:__embind_register_value_object,pa:__embind_register_value_object_field,na:__embind_register_void,$:__emscripten_memcpy_js,ta:__emval_as,ia:__emval_call_method,va:__emval_decref,sa:__emval_equals,ma:__emval_get_method_caller,ua:__emval_get_property,ra:__emval_incref,F:__emval_new_cstring,V:__emval_new_object,W:__emval_run_destructors,wa:__emval_set_property,E:__emval_take_value,_:_emscripten_resize_heap,y:invoke_dd,H:invoke_dii,fa:invoke_diid,J:invoke_diii,u:invoke_diiiii,I:invoke_i,e:invoke_ii,b:invoke_iii,m:invoke_iiii,n:invoke_iiiii,D:invoke_iiiiii,X:invoke_iiij,j:invoke_v,f:invoke_vi,ea:invoke_vid,ca:invoke_vidi,g:invoke_vii,r:invoke_viid,ha:invoke_viidd,ga:invoke_viiddd,G:invoke_viiddi,O:invoke_viidi,ja:invoke_viididi,da:invoke_viidiidid,c:invoke_viii,L:invoke_viiid,qa:invoke_viiidddi,l:invoke_viiii,v:invoke_viiiii,S:invoke_viiiiid,p:invoke_viiiiii,Q:invoke_viiiiiii,P:invoke_viiiiiiiii,C:invoke_viiiiiiiiidiii,q:invoke_viiiiiiiiii,R:invoke_viiiiiiiiiiiiiiiiii,ba:_llvm_eh_typeid_for};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports[\"ya\"])();var ___getTypeName=a0=>(___getTypeName=wasmExports[\"za\"])(a0);var _free=a0=>(_free=wasmExports[\"Ba\"])(a0);var _malloc=a0=>(_malloc=wasmExports[\"Ca\"])(a0);var _setThrew=(a0,a1)=>(_setThrew=wasmExports[\"Da\"])(a0,a1);var __emscripten_tempret_set=a0=>(__emscripten_tempret_set=wasmExports[\"Ea\"])(a0);var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports[\"Fa\"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports[\"Ga\"])();var ___cxa_decrement_exception_refcount=a0=>(___cxa_decrement_exception_refcount=wasmExports[\"Ha\"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports[\"Ia\"])(a0);var ___cxa_can_catch=(a0,a1,a2)=>(___cxa_can_catch=wasmExports[\"Ja\"])(a0,a1,a2);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports[\"Ka\"])(a0);var dynCall_iiij=Module[\"dynCall_iiij\"]=(a0,a1,a2,a3,a4)=>(dynCall_iiij=Module[\"dynCall_iiij\"]=wasmExports[\"La\"])(a0,a1,a2,a3,a4);function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiidddi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dd(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viididi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiid(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidd(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddd(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diid(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidiidid(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vidi(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module[\"addFunction\"]=addFunction;Module[\"removeFunction\"]=removeFunction;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();moduleRtn=readyPromise;\n\n\n return moduleRtn;\n}\n);\n})();\nexport default Module;\n"],"file":"assets/manifold.js"} \ No newline at end of file diff --git a/assets/manifold.wasm b/assets/manifold.wasm new file mode 100644 index 000000000..38c5112d6 Binary files /dev/null and b/assets/manifold.wasm differ diff --git a/assets/manifoldCAD.js b/assets/manifoldCAD.js new file mode 100644 index 000000000..2a3bdd76c --- /dev/null +++ b/assets/manifoldCAD.js @@ -0,0 +1,21 @@ +import"./modulepreload-polyfill.js";function ne(){return new Worker("/assets/worker-wrapper-09787a7f.js",{type:"module"})}const T="",y=self.examples.functionBodies;navigator.serviceWorker&&navigator.serviceWorker.register("/service-worker.js",{scope:"./index.html"});let l;const oe=document.querySelector("#undo"),le=document.querySelector("#redo"),ce=document.querySelector("#format"),ie=document.querySelector("#share");oe.onclick=()=>l.trigger("ignored","undo");le.onclick=()=>l.trigger("ignored","redo");ce.onclick=()=>l.trigger("ignored","editor.action.formatDocument");ie.onclick=()=>{const e=new URL(window.location.toString());e.hash="#"+encodeURIComponent(m.textContent+T+l.getValue()),navigator.clipboard.writeText(e.toString()),console.log("Shareable link copied to clipboard!"),console.log("Consider shortening this URL using tinyURL.com")};const re=document.querySelector("#file"),m=document.querySelector("#current"),H=document.querySelector("#file .uparrow"),I=document.querySelector("#fileDropdown"),$=document.querySelector("#save"),h=document.querySelector("#saveDropdown"),E=document.querySelector("#save .uparrow"),se=function(){I.classList.remove("show"),h.classList.remove("show"),H.classList.remove("down"),E.classList.remove("down")},ae=function(e){e.stopPropagation(),I.classList.toggle("show"),H.classList.toggle("down")},ue=function(e){e.stopPropagation(),h.classList.toggle("show"),E.classList.toggle("down")};re.onclick=ae;E.parentElement.onclick=ue;document.body.onclick=se;const C="ManifoldCAD";function L(e){return window.localStorage.getItem(C+e)}function g(e,n){window.localStorage.setItem(C+e,n)}function z(e){window.localStorage.removeItem(C+e)}function de(e){if(e>=window.localStorage.length)return;const n=window.localStorage.key(e);if(n.startsWith(C))return n.slice(C.length)}function R(){if(l){const e=m.textContent;y.get(e)||g(e,l.getValue())}}window.onpagehide=R;window.beforeunload=R;let q=!1,U=!0;function w(e){if(l){q=!0,m.textContent=e,g("currentName",e),U=y.get(e)!=null;const n=U?y.get(e).substring(1):L(e)??"";window.location.hash="#"+e,l.setValue(n)}}function D(e){const n=document.createElement("div");n.classList.add("item");const t=document.createElement("button");n.appendChild(t),t.type="button",t.classList.add("blue","item");const o=document.createElement("span");return t.appendChild(o),o.textContent=e,t.onclick=function(){R(),w(o.textContent)},t.onkeyup=function(c){c.preventDefault()},t}function N(e){const n=document.createElement("button");return n.classList.add("icon"),e.parentElement.appendChild(n),n}function K(e){let n=1,t=e;for(;L(t)!=null||y.get(t)!=null;)t=e+" "+n++;return t}function _(e){const n=e.firstChild,t=N(e);t.classList.add("edit"),t.onclick=function(f){f.stopPropagation();const s=n.textContent,ee=L(s),v=document.createElement("form"),a=document.createElement("input");a.classList.add("name"),a.value=s,n.textContent="",e.appendChild(v),v.appendChild(a),a.focus(),a.setSelectionRange(0,s.length);function te(){const S=a.value;if(a.blur(),!S)return;const M=K(S);n.textContent=M,m.textContent==s&&(m.textContent=M),z(s),g(M,ee)}v.onsubmit=te,a.onclick=function(S){S.stopPropagation()},a.onblur=function(){e.removeChild(v),n.textContent=s}};const o=N(e);o.classList.add("trash");let c=0;o.onclick=function(f){if(f.stopPropagation(),e.classList.contains("blue"))c=performance.now(),e.classList.remove("blue"),e.classList.add("red"),document.body.addEventListener("click",function(){e.classList.add("blue"),e.classList.remove("red")},{once:!0});else if(performance.now()-c>500){z(n.textContent),m.textContent==n.textContent&&w("Intro");const s=e.parentElement;s.parentElement.removeChild(s)}}}const W=document.querySelector("#new");function B(e,n=void 0){const t=K(n??"New Script");g(t,e);const o=D(t);return W.insertAdjacentElement("afterend",o.parentElement),_(o),{button:o,name:t}}W.onclick=function(){B("").button.click()};const r=document.querySelector("#compile"),G=document.querySelector("#poster");let A=!1,x=!0;function J(){r.disabled=!1,x?r.click():G.textContent="Auto-run disabled"}let j;async function fe(){const e=await fetch("/manifold-global-types.d.ts").then(t=>t.text()),n=await fetch("/manifold-encapsulated-types.d.ts").then(t=>t.text());return` +${e.replaceAll("export","")} +${n.replace(/^import.*$/gm,"").replaceAll("export","declare")} +declare interface ManifoldToplevel { + CrossSection: typeof T.CrossSection; + Manifold: typeof T.Manifold; + Mesh: typeof T.Mesh; + triangulate: typeof T.triangulate; + setMinCircularAngle: typeof T.setMinCircularAngle; + setMinCircularEdgeLength: typeof T.setMinCircularEdgeLength; + setCircularSegments: typeof T.setCircularSegments; + getCircularSegments: typeof T.getCircularSegments; + resetToCircularDefaults: typeof T.resetToCircularDefaults; + setup: () => void; +} +declare const module: ManifoldToplevel; +`}async function me(){return`${(await fetch("/editor.d.ts").then(n=>n.text())).replace(/^import.*$/gm,"")}`}require.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs"}});require(["vs/editor/editor.main"],async function(){monaco.languages.typescript.typescriptDefaults.addExtraLib(await fe()),monaco.languages.typescript.typescriptDefaults.addExtraLib(await me()),l=monaco.editor.create(document.getElementById("editor"),{language:"typescript",automaticLayout:!0}),j=await(await monaco.languages.typescript.getTypeScriptWorker())(l.getModel().uri),l.getModel().updateOptions({tabSize:2});for(const[t]of y){const o=D(t);I.appendChild(o.parentElement)}let n=m.textContent;for(let t=0;t0){const t=decodeURIComponent(window.location.hash.substring(1)),o=t.indexOf(T);if(o!=-1){x=!0;const c=t.substring(0,o);w(B(t.substring(o+T.length),c).name)}else t!=n&&(x=!0),w(t)}else w(n);A&&J(),l.onDidChangeModelContent(t=>{if(r.disabled=!1,q){q=!1,l.setScrollTop(0);return}if(U){const o=l.getPosition();B(l.getValue()).button.click(),l.setPosition(o)}}),window.onresize=()=>{l.layout({})}});const u=document.querySelector("model-viewer"),pe=document.querySelector("#animation"),b=document.querySelector("#play"),p=document.querySelector("#scrubber");let P=!1;u.addEventListener("load",()=>{const e=u.availableAnimations.length>0;pe.style.display=e?"flex":"none",e&&Q()});function Q(){u.play(),b.classList.remove("play"),b.classList.add("pause"),P=!1,p.classList.add("hide")}function ge(){u.pause(),b.classList.remove("pause"),b.classList.add("play"),P=!0,p.max=u.duration,p.value=u.currentTime,p.classList.remove("hide")}b.onclick=function(){P?Q():ge()};p.oninput=function(){u.currentTime=p.value};const d=document.querySelector("#console"),he=console.log;console.log=function(e){d.textContent+=e+`\r +`,d.scrollTop=d.scrollHeight,he(e)};function we(){d.textContent=""}function ye(){r.firstChild.style.visibility="hidden",r.classList.add("red","cancel")}function Ce(){r.firstChild.style.visibility="visible",r.classList.remove("red","cancel")}let X=performance.now();function Y(){Ce();const e=performance.now(),n=d.textContent;d.textContent=n.substring(n.indexOf(` +`)+1),console.log(`Took ${(Math.round((e-X)/10)/100).toLocaleString()} seconds`)}const i={glbURL:null,threeMFURL:null};let k=null;function O(){k=new ne,k.onmessage=function(e){if(e.data==null){j!=null&&!A&&J(),A=!0;return}if(e.data.log!=null){d.textContent+=e.data.log+`\r +`,d.scrollTop=d.scrollHeight;return}Y(),r.disabled=!0,i.threeMFURL!=null&&(URL.revokeObjectURL(i.threeMFURL),i.threeMFURL=null),URL.revokeObjectURL(i.glbURL),i.glbURL=e.data.glbURL,i.threeMFURL=e.data.threeMFURL,F.disabled=i.threeMFURL==null,u.src=i.glbURL,i.glbURL==null?(u.showPoster(),G.textContent="Error",O()):g("safe","true")}}O();async function Le(){R(),g("safe","false"),ye(),we(),console.log("Running...");const e=await j.getEmitOutput(l.getModel().uri.toString());k.postMessage(e.outputFiles[0].text),X=performance.now()}function be(){k.terminate(),O(),Y(),console.log("Run canceled")}r.onclick=function(){r.classList.contains("cancel")?be():Le()};function Z(e,n,t){const o=e.parentElement;return()=>{const c=$.firstElementChild;c!==o&&(h.insertBefore(c,h.firstElementChild),$.insertBefore(o,h),o.appendChild(E.parentElement));const f=document.createElement("a");f.download=n,f.href=i[t],f.click()}}const V=document.querySelector("#glb");V.onclick=Z(V,"manifold.glb","glbURL");const F=document.querySelector("#threemf");F.onclick=Z(F,"manifold.3mf","threeMFURL"); +//# sourceMappingURL=manifoldCAD.js.map diff --git a/assets/manifoldCAD.js.map b/assets/manifoldCAD.js.map new file mode 100644 index 000000000..60b2d687d --- /dev/null +++ b/assets/manifoldCAD.js.map @@ -0,0 +1 @@ +{"version":3,"file":"manifoldCAD.js","sources":["../../editor.js"],"sourcesContent":["// Copyright 2022 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport ManifoldWorker from './worker-wrapper?worker';\n\nconst CODE_START = '';\n// Loaded globally by examples.js\nconst exampleFunctions = self.examples.functionBodies;\n\nif (navigator.serviceWorker) {\n navigator.serviceWorker.register(\n '/service-worker.js', {scope: './index.html'});\n}\n\nlet editor = undefined;\n\n// Edit UI ------------------------------------------------------------\n\nconst undoButton = document.querySelector('#undo');\nconst redoButton = document.querySelector('#redo');\nconst formatButton = document.querySelector('#format');\nconst shareButton = document.querySelector('#share');\n\nundoButton.onclick = () => editor.trigger('ignored', 'undo');\nredoButton.onclick = () => editor.trigger('ignored', 'redo');\nformatButton.onclick = () =>\n editor.trigger('ignored', 'editor.action.formatDocument');\nshareButton.onclick = () => {\n const url = new URL(window.location.toString());\n url.hash =\n '#' +\n encodeURIComponent(\n currentFileElement.textContent + CODE_START + editor.getValue());\n navigator.clipboard.writeText(url.toString());\n console.log('Shareable link copied to clipboard!');\n console.log('Consider shortening this URL using tinyURL.com');\n};\n\n// File UI ------------------------------------------------------------\nconst fileButton = document.querySelector('#file');\nconst currentFileElement = document.querySelector('#current');\nconst fileArrow = document.querySelector('#file .uparrow');\nconst fileDropdown = document.querySelector('#fileDropdown');\nconst saveContainer = document.querySelector('#save');\nconst saveDropdown = document.querySelector('#saveDropdown');\nconst saveArrow = document.querySelector('#save .uparrow');\n\nconst hideDropdown = function() {\n fileDropdown.classList.remove('show');\n saveDropdown.classList.remove('show');\n fileArrow.classList.remove('down');\n saveArrow.classList.remove('down');\n};\nconst toggleFileDropdown = function(event) {\n event.stopPropagation();\n fileDropdown.classList.toggle('show');\n fileArrow.classList.toggle('down');\n};\nconst toggleSaveDropdown = function(event) {\n event.stopPropagation();\n saveDropdown.classList.toggle('show');\n saveArrow.classList.toggle('down');\n};\nfileButton.onclick = toggleFileDropdown;\nsaveArrow.parentElement.onclick = toggleSaveDropdown;\ndocument.body.onclick = hideDropdown;\n\nconst prefix = 'ManifoldCAD';\nfunction getScript(name) {\n return window.localStorage.getItem(prefix + name);\n}\nfunction setScript(name, code) {\n window.localStorage.setItem(prefix + name, code);\n}\nfunction removeScript(name) {\n window.localStorage.removeItem(prefix + name);\n}\nfunction nthKey(n) {\n if (n >= window.localStorage.length) return;\n const key = window.localStorage.key(n);\n if (key.startsWith(prefix)) {\n return key.slice(prefix.length);\n }\n}\n\nfunction saveCurrent() {\n if (editor) {\n const currentName = currentFileElement.textContent;\n if (!exampleFunctions.get(currentName)) {\n setScript(currentName, editor.getValue());\n }\n }\n};\n\nwindow.onpagehide = saveCurrent;\nwindow.beforeunload = saveCurrent;\n\nlet switching = false;\nlet isExample = true;\nfunction switchTo(scriptName) {\n if (editor) {\n switching = true;\n currentFileElement.textContent = scriptName;\n setScript('currentName', scriptName);\n isExample = exampleFunctions.get(scriptName) != null;\n const code = isExample ? exampleFunctions.get(scriptName).substring(1) :\n getScript(scriptName) ?? '';\n window.location.hash = '#' + scriptName;\n editor.setValue(code);\n }\n}\n\nfunction createDropdownItem(name) {\n const container = document.createElement('div');\n container.classList.add('item');\n const button = document.createElement('button');\n container.appendChild(button);\n button.type = 'button';\n button.classList.add('blue', 'item');\n const label = document.createElement('span');\n button.appendChild(label);\n label.textContent = name;\n\n button.onclick = function() {\n saveCurrent();\n switchTo(label.textContent);\n };\n // Stop text input spaces from triggering the button\n button.onkeyup = function(event) {\n event.preventDefault();\n };\n return button;\n}\n\nfunction addIcon(button) {\n const icon = document.createElement('button');\n icon.classList.add('icon');\n button.parentElement.appendChild(icon);\n return icon;\n}\n\nfunction uniqueName(name) {\n let num = 1;\n let newName = name;\n while (getScript(newName) != null || exampleFunctions.get(newName) != null) {\n newName = name + ' ' + num++;\n }\n return newName;\n}\n\nfunction addEdit(button) {\n const label = button.firstChild;\n const edit = addIcon(button);\n edit.classList.add('edit');\n\n edit.onclick = function(event) {\n event.stopPropagation();\n const oldName = label.textContent;\n const code = getScript(oldName);\n const form = document.createElement('form');\n const inputElement = document.createElement('input');\n inputElement.classList.add('name');\n inputElement.value = oldName;\n label.textContent = '';\n button.appendChild(form);\n form.appendChild(inputElement);\n inputElement.focus();\n inputElement.setSelectionRange(0, oldName.length);\n\n function rename() {\n const input = inputElement.value;\n inputElement.blur();\n if (!input) return;\n const newName = uniqueName(input);\n label.textContent = newName;\n if (currentFileElement.textContent == oldName) {\n currentFileElement.textContent = newName;\n }\n removeScript(oldName);\n setScript(newName, code);\n }\n\n form.onsubmit = rename;\n inputElement.onclick = function(event) {\n event.stopPropagation();\n };\n\n inputElement.onblur = function() {\n button.removeChild(form);\n label.textContent = oldName;\n };\n };\n\n const trash = addIcon(button);\n trash.classList.add('trash');\n let lastClick = 0;\n\n trash.onclick = function(event) {\n event.stopPropagation();\n if (button.classList.contains('blue')) {\n lastClick = performance.now();\n button.classList.remove('blue');\n button.classList.add('red');\n document.body.addEventListener('click', function() {\n button.classList.add('blue');\n button.classList.remove('red');\n }, {once: true});\n } else if (performance.now() - lastClick > 500) {\n removeScript(label.textContent);\n if (currentFileElement.textContent == label.textContent) {\n switchTo('Intro');\n }\n const container = button.parentElement;\n container.parentElement.removeChild(container);\n }\n };\n}\n\nconst newButton = document.querySelector('#new');\nfunction newItem(code, scriptName = undefined) {\n const name = uniqueName(scriptName ?? 'New Script');\n setScript(name, code);\n const nextButton = createDropdownItem(name);\n newButton.insertAdjacentElement('afterend', nextButton.parentElement);\n addEdit(nextButton);\n return {button: nextButton, name};\n};\nnewButton.onclick = function() {\n newItem('').button.click();\n};\n\nconst runButton = document.querySelector('#compile');\nconst poster = document.querySelector('#poster');\nlet manifoldInitialized = false;\nlet autoExecute = true;\n\nfunction initializeRun() {\n runButton.disabled = false;\n if (autoExecute) {\n runButton.click();\n } else {\n poster.textContent = 'Auto-run disabled';\n }\n}\n\n// Editor ------------------------------------------------------------\nlet tsWorker = undefined;\n\nasync function getManifoldDTS() {\n const global = await fetch('/manifold-global-types.d.ts')\n .then(response => response.text());\n\n const encapsulated = await fetch('/manifold-encapsulated-types.d.ts')\n .then(response => response.text());\n\n return `\n${global.replaceAll('export', '')}\n${encapsulated.replace(/^import.*$/gm, '').replaceAll('export', 'declare')}\ndeclare interface ManifoldToplevel {\n CrossSection: typeof T.CrossSection;\n Manifold: typeof T.Manifold;\n Mesh: typeof T.Mesh;\n triangulate: typeof T.triangulate;\n setMinCircularAngle: typeof T.setMinCircularAngle;\n setMinCircularEdgeLength: typeof T.setMinCircularEdgeLength;\n setCircularSegments: typeof T.setCircularSegments;\n getCircularSegments: typeof T.getCircularSegments;\n resetToCircularDefaults: typeof T.resetToCircularDefaults;\n setup: () => void;\n}\ndeclare const module: ManifoldToplevel;\n`;\n}\n\nasync function getEditorDTS() {\n const global = await fetch('/editor.d.ts').then(response => response.text());\n return `${global.replace(/^import.*$/gm, '')}`;\n}\n\nrequire.config({\n paths:\n {vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs'}\n});\nrequire(['vs/editor/editor.main'], async function() {\n monaco.languages.typescript.typescriptDefaults.addExtraLib(\n await getManifoldDTS());\n monaco.languages.typescript.typescriptDefaults.addExtraLib(\n await getEditorDTS());\n editor = monaco.editor.create(\n document.getElementById('editor'),\n {language: 'typescript', automaticLayout: true});\n const w = await monaco.languages.typescript.getTypeScriptWorker();\n tsWorker = await w(editor.getModel().uri);\n editor.getModel().updateOptions({tabSize: 2});\n\n for (const [name] of exampleFunctions) {\n const button = createDropdownItem(name);\n fileDropdown.appendChild(button.parentElement);\n }\n\n let currentName = currentFileElement.textContent;\n\n for (let i = 0; i < window.localStorage.length; i++) {\n const key = nthKey(i);\n if (!key) continue;\n if (key === 'currentName') {\n currentName = getScript(key);\n } else if (key === 'safe') {\n autoExecute = getScript(key) !== 'false';\n } else {\n const button = createDropdownItem(key);\n newButton.insertAdjacentElement('afterend', button.parentElement);\n addEdit(button);\n }\n }\n\n if (window.location.hash.length > 0) {\n const fragment = decodeURIComponent(window.location.hash.substring(1));\n const codeIdx = fragment.indexOf(CODE_START);\n if (codeIdx != -1) {\n autoExecute = true;\n const name = fragment.substring(0, codeIdx);\n switchTo(\n newItem(fragment.substring(codeIdx + CODE_START.length), name).name);\n } else {\n if (fragment != currentName) {\n autoExecute = true;\n }\n switchTo(fragment);\n }\n } else {\n switchTo(currentName);\n }\n\n if (manifoldInitialized) {\n initializeRun();\n }\n\n editor.onDidChangeModelContent(e => {\n runButton.disabled = false;\n if (switching) {\n switching = false;\n editor.setScrollTop(0);\n return;\n }\n if (isExample) {\n const cursor = editor.getPosition();\n newItem(editor.getValue()).button.click();\n editor.setPosition(cursor);\n }\n });\n\n window.onresize = () => {\n editor.layout({});\n };\n});\n\n// Animation ------------------------------------------------------------\nconst mv = document.querySelector('model-viewer');\nconst animationContainer = document.querySelector('#animation');\nconst playButton = document.querySelector('#play');\nconst scrubber = document.querySelector('#scrubber');\nlet paused = false;\n\nmv.addEventListener('load', () => {\n const hasAnimation = mv.availableAnimations.length > 0;\n animationContainer.style.display = hasAnimation ? 'flex' : 'none';\n if (hasAnimation) {\n play();\n }\n});\n\nfunction play() {\n mv.play();\n playButton.classList.remove('play');\n playButton.classList.add('pause');\n paused = false;\n scrubber.classList.add('hide');\n}\n\nfunction pause() {\n mv.pause();\n playButton.classList.remove('pause');\n playButton.classList.add('play');\n paused = true;\n scrubber.max = mv.duration;\n scrubber.value = mv.currentTime;\n scrubber.classList.remove('hide');\n}\n\nplayButton.onclick = function() {\n if (paused) {\n play();\n } else {\n pause();\n }\n};\n\nscrubber.oninput = function() {\n mv.currentTime = scrubber.value;\n};\n\n// Execution ------------------------------------------------------------\nconst consoleElement = document.querySelector('#console');\nconst oldLog = console.log;\nconsole.log = function(message) {\n consoleElement.textContent += message + '\\r\\n';\n consoleElement.scrollTop = consoleElement.scrollHeight;\n oldLog(message);\n};\n\nfunction clearConsole() {\n consoleElement.textContent = '';\n}\n\nfunction enableCancel() {\n runButton.firstChild.style.visibility = 'hidden';\n runButton.classList.add('red', 'cancel');\n}\n\nfunction disableCancel() {\n runButton.firstChild.style.visibility = 'visible';\n runButton.classList.remove('red', 'cancel');\n}\n\nlet t0 = performance.now();\n\nfunction finishRun() {\n disableCancel();\n const t1 = performance.now();\n const log = consoleElement.textContent;\n // Remove \"Running...\"\n consoleElement.textContent = log.substring(log.indexOf('\\n') + 1);\n console.log(\n `Took ${(Math.round((t1 - t0) / 10) / 100).toLocaleString()} seconds`);\n}\n\nconst output = {\n glbURL: null,\n threeMFURL: null\n};\nlet manifoldWorker = null;\n\nfunction createWorker() {\n manifoldWorker = new ManifoldWorker();\n manifoldWorker.onmessage = function(e) {\n if (e.data == null) {\n if (tsWorker != null && !manifoldInitialized) {\n initializeRun();\n }\n manifoldInitialized = true;\n return;\n }\n\n if (e.data.log != null) {\n consoleElement.textContent += e.data.log + '\\r\\n';\n consoleElement.scrollTop = consoleElement.scrollHeight;\n return;\n }\n\n finishRun();\n runButton.disabled = true;\n\n if (output.threeMFURL != null) {\n URL.revokeObjectURL(output.threeMFURL);\n output.threeMFURL = null;\n }\n URL.revokeObjectURL(output.glbURL);\n output.glbURL = e.data.glbURL;\n output.threeMFURL = e.data.threeMFURL;\n threemfButton.disabled = output.threeMFURL == null;\n mv.src = output.glbURL;\n if (output.glbURL == null) {\n mv.showPoster();\n poster.textContent = 'Error';\n createWorker();\n } else {\n setScript('safe', 'true');\n }\n }\n}\n\ncreateWorker();\n\nasync function run() {\n saveCurrent();\n setScript('safe', 'false');\n enableCancel();\n clearConsole();\n console.log('Running...');\n const output = await tsWorker.getEmitOutput(editor.getModel().uri.toString());\n manifoldWorker.postMessage(output.outputFiles[0].text);\n t0 = performance.now();\n}\n\nfunction cancel() {\n manifoldWorker.terminate();\n createWorker();\n finishRun();\n console.log('Run canceled');\n}\n\nrunButton.onclick = function() {\n if (runButton.classList.contains('cancel')) {\n cancel();\n } else {\n run();\n }\n};\n\nfunction clickSave(saveButton, filename, outputName) {\n const container = saveButton.parentElement;\n return () => {\n const oldSave = saveContainer.firstElementChild;\n if (oldSave !== container) {\n saveDropdown.insertBefore(oldSave, saveDropdown.firstElementChild);\n saveContainer.insertBefore(container, saveDropdown);\n container.appendChild(saveArrow.parentElement);\n }\n const link = document.createElement('a');\n link.download = filename;\n link.href = output[outputName];\n link.click();\n };\n}\n\nconst glbButton = document.querySelector('#glb');\nglbButton.onclick = clickSave(glbButton, 'manifold.glb', 'glbURL');\n\nconst threemfButton = document.querySelector('#threemf');\nthreemfButton.onclick = clickSave(threemfButton, 'manifold.3mf', 'threeMFURL');\n"],"names":["CODE_START","exampleFunctions","editor","undoButton","redoButton","formatButton","shareButton","url","currentFileElement","fileButton","fileArrow","fileDropdown","saveContainer","saveDropdown","saveArrow","hideDropdown","toggleFileDropdown","event","toggleSaveDropdown","prefix","getScript","name","setScript","code","removeScript","nthKey","n","key","saveCurrent","currentName","switching","isExample","switchTo","scriptName","createDropdownItem","container","button","label","addIcon","icon","uniqueName","num","newName","addEdit","edit","oldName","form","inputElement","rename","input","trash","lastClick","newButton","newItem","nextButton","runButton","poster","manifoldInitialized","autoExecute","initializeRun","tsWorker","getManifoldDTS","global","response","encapsulated","getEditorDTS","i","fragment","codeIdx","e","cursor","mv","animationContainer","playButton","scrubber","paused","hasAnimation","play","pause","consoleElement","oldLog","message","clearConsole","enableCancel","disableCancel","t0","finishRun","t1","log","output","manifoldWorker","createWorker","ManifoldWorker","threemfButton","run","cancel","clickSave","saveButton","filename","outputName","oldSave","link","glbButton"],"mappings":"0HAgBA,MAAMA,EAAa,SAEbC,EAAmB,KAAK,SAAS,eAEnC,UAAU,eACZ,UAAU,cAAc,SACpB,qBAAsB,CAAC,MAAO,cAAc,CAAC,EAGnD,IAAIC,EAIJ,MAAMC,GAAa,SAAS,cAAc,OAAO,EAC3CC,GAAa,SAAS,cAAc,OAAO,EAC3CC,GAAe,SAAS,cAAc,SAAS,EAC/CC,GAAc,SAAS,cAAc,QAAQ,EAEnDH,GAAW,QAAU,IAAMD,EAAO,QAAQ,UAAW,MAAM,EAC3DE,GAAW,QAAU,IAAMF,EAAO,QAAQ,UAAW,MAAM,EAC3DG,GAAa,QAAU,IACnBH,EAAO,QAAQ,UAAW,8BAA8B,EAC5DI,GAAY,QAAU,IAAM,CAC1B,MAAMC,EAAM,IAAI,IAAI,OAAO,SAAS,SAAQ,CAAE,EAC9CA,EAAI,KACA,IACA,mBACIC,EAAmB,YAAcR,EAAaE,EAAO,SAAU,CAAA,EACvE,UAAU,UAAU,UAAUK,EAAI,SAAU,CAAA,EAC5C,QAAQ,IAAI,qCAAqC,EACjD,QAAQ,IAAI,gDAAgD,CAC9D,EAGA,MAAME,GAAa,SAAS,cAAc,OAAO,EAC3CD,EAAqB,SAAS,cAAc,UAAU,EACtDE,EAAY,SAAS,cAAc,gBAAgB,EACnDC,EAAe,SAAS,cAAc,eAAe,EACr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,OACZA,EAAO,QAAU,MACnBlB,EAAG,WAAU,EACbf,EAAO,YAAc,QACrBmC,KAEArE,EAAU,OAAQ,MAAM,CAE3B,CACH,CAEAqE,IAEA,eAAeG,IAAM,CACnBlE,IACAN,EAAU,OAAQ,OAAO,EACzB6D,KACAD,KACA,QAAQ,IAAI,YAAY,EACxB,MAAMO,EAAS,MAAM7B,EAAS,cAAc1D,EAAO,WAAW,IAAI,SAAQ,CAAE,EAC5EwF,EAAe,YAAYD,EAAO,YAAY,CAAC,EAAE,IAAI,EACrDJ,EAAK,YAAY,KACnB,CAEA,SAASU,IAAS,CAChBL,EAAe,UAAS,EACxBC,IACAL,IACA,QAAQ,IAAI,cAAc,CAC5B,CAEA/B,EAAU,QAAU,UAAW,CACzBA,EAAU,UAAU,SAAS,QAAQ,EACvCwC,KAEAD,IAEJ,EAEA,SAASE,EAAUC,EAAYC,EAAUC,EAAY,CACnD,MAAMhE,EAAY8D,EAAW,cAC7B,MAAO,IAAM,CACX,MAAMG,EAAUxF,EAAc,kBAC1BwF,IAAYjE,IACdtB,EAAa,aAAauF,EAASvF,EAAa,iBAAiB,EACjED,EAAc,aAAauB,EAAWtB,CAAY,EAClDsB,EAAU,YAAYrB,EAAU,aAAa,GAE/C,MAAMuF,EAAO,SAAS,cAAc,GAAG,EACvCA,EAAK,SAAWH,EAChBG,EAAK,KAAOZ,EAAOU,CAAU,EAC7BE,EAAK,MAAK,CACd,CACA,CAEA,MAAMC,EAAY,SAAS,cAAc,MAAM,EAC/CA,EAAU,QAAUN,EAAUM,EAAW,eAAgB,QAAQ,EAEjE,MAAMT,EAAgB,SAAS,cAAc,UAAU,EACvDA,EAAc,QAAUG,EAAUH,EAAe,eAAgB,YAAY"} \ No newline at end of file diff --git a/assets/modelViewer.js b/assets/modelViewer.js new file mode 100644 index 000000000..af27724f0 --- /dev/null +++ b/assets/modelViewer.js @@ -0,0 +1,2 @@ +import"./modulepreload-polyfill.js";import{s as I,_ as L,j as U,M as k,k as v,r as B,g as D,w as E,z as O}from"./gltf-io.js";import{M as S}from"./manifold.js";const w=I(new L),e=new U,M=await S();M.setup();const{Manifold:i,Mesh:j}=M,f=new Map;async function R(o){const a=Array(),c=await w.read(o);await c.transform(k());const d=c.getRoot().listNodes(),g=Array();for(const t of d){v(t);const r=t.getMesh();if(r==null)continue;const s=B(r);if(s==null)continue;const m=s.runProperties.length,u=i.reserveIDs(m);s.mesh.runOriginalID=new Uint32Array(m);for(let n=0;nt.dispose()),e.getRoot().listBuffers().forEach(t=>t.dispose()),e.getRoot().listAccessors().forEach(t=>t.dispose());for(const[t,r]of g.entries()){const s=e.getRoot().listMaterials()[y+t];f.get(r).material=s}return i.union(a)}const A=await R("/models/space.glb"),q=await R("/models/moon.glb"),h=e.createNode();e.createScene().addChild(h);function b(o){P(i[o](A,q))}b("difference");const p=document.querySelector("select");p.onchange=function(){b(p.value)};let l="";const z=document.querySelector("#download");z.onclick=function(){const o=document.createElement("a");o.download="manifold.glb",o.href=l,o.click()};const N=document.querySelector("model-viewer");async function P(o){D(h.getMesh());const a=E(e,o.getMesh(),f);h.setMesh(a),await e.transform(O());const c=await w.writeBinary(e),d=new Blob([c],{type:"application/octet-stream"});URL.revokeObjectURL(l),l=URL.createObjectURL(d),N.src=l} +//# sourceMappingURL=modelViewer.js.map diff --git a/assets/modelViewer.js.map b/assets/modelViewer.js.map new file mode 100644 index 000000000..da1e9ea19 --- /dev/null +++ b/assets/modelViewer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modelViewer.js","sources":["../../model-viewer-script.ts"],"sourcesContent":["// Copyright 2024 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Document, WebIO} from '@gltf-transform/core';\nimport {clearNodeTransform, flatten, prune} from '@gltf-transform/functions';\n\nimport Module, {Manifold, Mesh} from './built/manifold';\nimport {disposeMesh, Properties, readMesh, setupIO, writeMesh} from './gltf-io';\n\n// Set up gltf-transform\nconst io = setupIO(new WebIO());\nconst doc = new Document();\n\n\n// Set up Manifold WASM library\nconst wasm = await Module();\nwasm.setup();\nconst {Manifold, Mesh} = wasm;\n\n// Map of OriginalID to glTF material and attributes\nconst id2properties = new Map();\n\n// Wrapper for gltf-io readMesh() that processes a whole glTF and stores the\n// properties in the above map. This function is simplified and intended only\n// for reading single-object glTFs, as it simply unions any extra meshes\n// together rather than returning a scene hierarchy.\nasync function readGLB(url: string) {\n const manifolds = Array();\n const docIn = await io.read(url);\n await docIn.transform(flatten());\n const nodes = docIn.getRoot().listNodes();\n const ids = Array();\n for (const node of nodes) {\n clearNodeTransform(node);\n const gltfMesh = node.getMesh();\n if (gltfMesh == null) continue;\n const tmp = readMesh(gltfMesh);\n if (tmp == null) continue;\n\n const numID = tmp.runProperties.length;\n const firstID = Manifold.reserveIDs(numID);\n tmp.mesh.runOriginalID = new Uint32Array(numID);\n for (let i = 0; i < numID; ++i) {\n tmp.mesh.runOriginalID[i] = firstID + i;\n ids.push(firstID + i);\n id2properties.set(firstID + i, tmp.runProperties[i]);\n }\n manifolds.push(new Manifold(new Mesh(tmp.mesh)));\n }\n // pull in materials, TODO: replace with transfer() when available\n const startIdx = doc.getRoot().listMaterials().length;\n doc.merge(docIn);\n doc.getRoot().listScenes().forEach((s) => s.dispose());\n doc.getRoot().listBuffers().forEach((s) => s.dispose());\n doc.getRoot().listAccessors().forEach((s) => s.dispose());\n for (const [i, id] of ids.entries()) {\n const material = doc.getRoot().listMaterials()[startIdx + i];\n id2properties.get(id)!.material = material;\n }\n\n return Manifold.union(manifolds);\n}\n\n// Read static input glTFs\nconst space = await readGLB('/models/space.glb');\nconst moon = await readGLB('/models/moon.glb');\n\nconst node = doc.createNode();\ndoc.createScene().addChild(node);\n\n// Set up UI for operations\ntype BooleanOp = 'union'|'difference'|'intersection';\n\nfunction csg(operation: BooleanOp) {\n push2MV(Manifold[operation](space, moon));\n}\n\ncsg('difference');\nconst selectElement = document.querySelector('select')!;\nselectElement.onchange = function() {\n csg(selectElement.value as BooleanOp);\n};\n\n// The resulting glTF\nlet objectURL = '';\n\n// Set up download UI\nconst downloadButton = document.querySelector('#download') as HTMLButtonElement;\ndownloadButton.onclick = function() {\n const link = document.createElement('a');\n link.download = 'manifold.glb';\n link.href = objectURL;\n link.click();\n};\n\n// element for rendering resulting glTF.\nconst mv = document.querySelector('model-viewer');\n\n// Use gltf-io and gltf-transform to convert the resulting Manifold to a glTF\n// and display it with .\nasync function push2MV(manifold: Manifold) {\n disposeMesh(node.getMesh()!);\n const mesh = writeMesh(doc, manifold.getMesh(), id2properties);\n node.setMesh(mesh);\n await doc.transform(prune());\n\n const glb = await io.writeBinary(doc);\n\n const blob = new Blob([glb], {type: 'application/octet-stream'});\n URL.revokeObjectURL(objectURL);\n objectURL = URL.createObjectURL(blob);\n (mv as any).src = objectURL;\n}"],"names":["io","setupIO","WebIO","doc","Document","wasm","Module","Manifold","Mesh","id2properties","readGLB","url","manifolds","docIn","flatten","nodes","ids","node","clearNodeTransform","gltfMesh","tmp","readMesh","numID","firstID","i","startIdx","s","id","material","space","moon","csg","operation","push2MV","selectElement","objectURL","downloadButton","link","mv","manifold","disposeMesh","mesh","writeMesh","prune","glb","blob"],"mappings":"+JAqBA,MAAMA,EAAKC,EAAQ,IAAIC,CAAO,EACxBC,EAAM,IAAIC,EAIVC,EAAO,MAAMC,IACnBD,EAAK,MAAM,EACX,KAAM,CAAC,SAAAE,EAAU,KAAAC,CAAQ,EAAAH,EAGnBI,MAAoB,IAM1B,eAAeC,EAAQC,EAAa,CAClC,MAAMC,EAAY,QACZC,EAAQ,MAAMb,EAAG,KAAKW,CAAG,EACzB,MAAAE,EAAM,UAAUC,EAA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EAAsB,CACjCC,EAAQ1B,EAASyB,CAAS,EAAEH,EAAOC,CAAI,CAAC,CAC1C,CAEAC,EAAI,YAAY,EAChB,MAAMG,EAAgB,SAAS,cAAc,QAAQ,EACrDA,EAAc,SAAW,UAAW,CAClCH,EAAIG,EAAc,KAAkB,CACtC,EAGA,IAAIC,EAAY,GAGhB,MAAMC,EAAiB,SAAS,cAAc,WAAW,EACzDA,EAAe,QAAU,UAAW,CAC5B,MAAAC,EAAO,SAAS,cAAc,GAAG,EACvCA,EAAK,SAAW,eAChBA,EAAK,KAAOF,EACZE,EAAK,MAAM,CACb,EAGA,MAAMC,EAAK,SAAS,cAAc,cAAc,EAIhD,eAAeL,EAAQM,EAAoB,CAC7BC,EAAAvB,EAAK,SAAU,EAC3B,MAAMwB,EAAOC,EAAUvC,EAAKoC,EAAS,QAAA,EAAW9B,CAAa,EAC7DQ,EAAK,QAAQwB,CAAI,EACX,MAAAtC,EAAI,UAAUwC,EAAA,CAAO,EAE3B,MAAMC,EAAM,MAAM5C,EAAG,YAAYG,CAAG,EAE9B0C,EAAO,IAAI,KAAK,CAACD,CAAG,EAAG,CAAC,KAAM,0BAAA,CAA2B,EAC/D,IAAI,gBAAgBT,CAAS,EACjBA,EAAA,IAAI,gBAAgBU,CAAI,EACnCP,EAAW,IAAMH,CACpB"} \ No newline at end of file diff --git a/assets/modulepreload-polyfill.js b/assets/modulepreload-polyfill.js new file mode 100644 index 000000000..c1e44badf --- /dev/null +++ b/assets/modulepreload-polyfill.js @@ -0,0 +1,2 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})(); +//# sourceMappingURL=modulepreload-polyfill.js.map diff --git a/assets/modulepreload-polyfill.js.map b/assets/modulepreload-polyfill.js.map new file mode 100644 index 000000000..42742f7a3 --- /dev/null +++ b/assets/modulepreload-polyfill.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modulepreload-polyfill.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/assets/three.js b/assets/three.js new file mode 100644 index 000000000..86bc75aab --- /dev/null +++ b/assets/three.js @@ -0,0 +1,3826 @@ +import"./modulepreload-polyfill.js";import{M as yo}from"./manifold.js";/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const Yr="164",To=0,ds=1,Ao=2,Ba=1,bo=2,ke=3,sn=0,pe=1,We=2,nn=0,Vn=1,fs=2,ps=3,ms=4,wo=5,vn=100,Ro=101,Co=102,Po=103,Lo=104,Do=200,Uo=201,Io=202,No=203,Br=204,zr=205,Fo=206,Oo=207,Bo=208,zo=209,Ho=210,Vo=211,Go=212,ko=213,Wo=214,Xo=0,qo=1,Yo=2,zi=3,Ko=4,$o=5,jo=6,Zo=7,Kr=0,Jo=1,Qo=2,rn=0,tl=1,el=2,nl=3,il=4,rl=5,sl=6,al=7,za=300,Wn=301,Xn=302,Hr=303,Vr=304,Xi=306,Gr=1e3,Mn=1001,kr=1002,ye=1003,ol=1004,mi=1005,Re=1006,ir=1007,Sn=1008,an=1009,ll=1010,cl=1011,Ha=1012,Va=1013,qn=1014,en=1015,qi=1016,Ga=1017,ka=1018,ci=1020,hl=35902,ul=1021,dl=1022,Ue=1023,fl=1024,pl=1025,Gn=1026,oi=1027,ml=1028,Wa=1029,_l=1030,Xa=1031,qa=1033,rr=33776,sr=33777,ar=33778,or=33779,_s=35840,gs=35841,vs=35842,xs=35843,Ms=36196,Ss=37492,Es=37496,ys=37808,Ts=37809,As=37810,bs=37811,ws=37812,Rs=37813,Cs=37814,Ps=37815,Ls=37816,Ds=37817,Us=37818,Is=37819,Ns=37820,Fs=37821,lr=36492,Os=36494,Bs=36495,gl=36283,zs=36284,Hs=36285,Vs=36286,vl=3200,xl=3201,$r=0,Ml=1,tn="",Pe="srgb",ln="srgb-linear",jr="display-p3",Yi="display-p3-linear",Hi="linear",Yt="srgb",Vi="rec709",Gi="p3",yn=7680,Gs=519,Sl=512,El=513,yl=514,Ya=515,Tl=516,Al=517,bl=518,wl=519,ks=35044,Ws="300 es",Xe=2e3,ki=2001;class Kn{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const r=n.slice(0);for(let s=0,a=r.length;s>8&255]+le[i>>16&255]+le[i>>24&255]+"-"+le[t&255]+le[t>>8&255]+"-"+le[t>>16&15|64]+le[t>>24&255]+"-"+le[e&63|128]+le[e>>8&255]+"-"+le[e>>16&255]+le[e>>24&255]+le[n&255]+le[n>>8&255]+le[n>>16&255]+le[n>>24&255]).toLowerCase()}function fe(i,t,e){return Math.max(t,Math.min(e,i))}function Rl(i,t){return(i%t+t)%t}function hr(i,t,e){return(1-e)*i+e*t}function ti(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function de(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}class Pt{constructor(t=0,e=0){Pt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(fe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*r+t.x,this.y=s*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(t,e,n,r,s,a,o,l,c){Tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,r,s,a,o,l,c)}set(t,e,n,r,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],p=n[7],f=n[2],m=n[5],v=n[8],S=r[0],d=r[3],u=r[6],y=r[1],M=r[4],T=r[7],U=r[2],b=r[5],w=r[8];return s[0]=a*S+o*y+l*U,s[3]=a*d+o*M+l*b,s[6]=a*u+o*T+l*w,s[1]=c*S+h*y+p*U,s[4]=c*d+h*M+p*b,s[7]=c*u+h*T+p*w,s[2]=f*S+m*y+v*U,s[5]=f*d+m*M+v*b,s[8]=f*u+m*T+v*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*s*h+n*o*l+r*s*c-r*a*l}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],p=h*a-o*c,f=o*l-h*s,m=c*s-a*l,v=e*p+n*f+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return t[0]=p*S,t[1]=(r*c-h*n)*S,t[2]=(o*n-r*a)*S,t[3]=f*S,t[4]=(h*e-r*l)*S,t[5]=(r*s-o*e)*S,t[6]=m*S,t[7]=(n*l-c*e)*S,t[8]=(a*e-n*s)*S,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-r*c,r*l,-r*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(ur.makeScale(t,e)),this}rotate(t){return this.premultiply(ur.makeRotation(-t)),this}translate(t,e){return this.premultiply(ur.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const ur=new Tt;function Ka(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function Wi(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Cl(){const i=Wi("canvas");return i.style.display="block",i}const Xs={};function Pl(i){i in Xs||(Xs[i]=!0,console.warn(i))}const qs=new Tt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ys=new Tt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),_i={[ln]:{transfer:Hi,primaries:Vi,toReference:i=>i,fromReference:i=>i},[Pe]:{transfer:Yt,primaries:Vi,toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[Yi]:{transfer:Hi,primaries:Gi,toReference:i=>i.applyMatrix3(Ys),fromReference:i=>i.applyMatrix3(qs)},[jr]:{transfer:Yt,primaries:Gi,toReference:i=>i.convertSRGBToLinear().applyMatrix3(Ys),fromReference:i=>i.applyMatrix3(qs).convertLinearToSRGB()}},Ll=new Set([ln,Yi]),Gt={enabled:!0,_workingColorSpace:ln,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!Ll.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,t,e){if(this.enabled===!1||t===e||!t||!e)return i;const n=_i[t].toReference,r=_i[e].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,t){return this.convert(i,this._workingColorSpace,t)},toWorkingColorSpace:function(i,t){return this.convert(i,t,this._workingColorSpace)},getPrimaries:function(i){return _i[i].primaries},getTransfer:function(i){return i===tn?Hi:_i[i].transfer}};function kn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function dr(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let Tn;class Dl{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Tn===void 0&&(Tn=Wi("canvas")),Tn.width=t.width,Tn.height=t.height;const n=Tn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Tn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Wi("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==za)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Gr:t.x=t.x-Math.floor(t.x);break;case Mn:t.x=t.x<0?0:1;break;case kr:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Gr:t.y=t.y-Math.floor(t.y);break;case Mn:t.y=t.y<0?0:1;break;case kr:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}me.DEFAULT_IMAGE=null;me.DEFAULT_MAPPING=za;me.DEFAULT_ANISOTROPY=1;class $t{constructor(t=0,e=0,n=0,r=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,s;const l=t.elements,c=l[0],h=l[4],p=l[8],f=l[1],m=l[5],v=l[9],S=l[2],d=l[6],u=l[10];if(Math.abs(h-f)<.01&&Math.abs(p-S)<.01&&Math.abs(v-d)<.01){if(Math.abs(h+f)<.1&&Math.abs(p+S)<.1&&Math.abs(v+d)<.1&&Math.abs(c+m+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const M=(c+1)/2,T=(m+1)/2,U=(u+1)/2,b=(h+f)/4,w=(p+S)/4,O=(v+d)/4;return M>T&&M>U?M<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(M),r=b/n,s=w/n):T>U?T<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),n=b/r,s=O/r):U<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(U),n=w/s,r=O/s),this.set(n,r,s,e),this}let y=Math.sqrt((d-v)*(d-v)+(p-S)*(p-S)+(f-h)*(f-h));return Math.abs(y)<.001&&(y=1),this.x=(d-v)/y,this.y=(p-S)/y,this.z=(f-h)/y,this.w=Math.acos((c+m+u-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nl extends Kn{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new $t(0,0,t,e),this.scissorTest=!1,this.viewport=new $t(0,0,t,e);const r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Re,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new me(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,M=1-u*u;if(M>Number.EPSILON){const U=Math.sqrt(M),b=Math.atan2(U,u*y);d=Math.sin(d*b)/U,o=Math.sin(o*b)/U}const T=o*y;if(l=l*d+f*T,c=c*d+m*T,h=h*d+v*T,p=p*d+S*T,d===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+p*p);l*=U,c*=U,h*=U,p*=U}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=p}static multiplyQuaternionsFlat(t,e,n,r,s,a){const o=n[r],l=n[r+1],c=n[r+2],h=n[r+3],p=s[a],f=s[a+1],m=s[a+2],v=s[a+3];return t[e]=o*v+h*p+l*m-c*f,t[e+1]=l*v+h*f+c*p-o*m,t[e+2]=c*v+h*m+o*f-l*p,t[e+3]=h*v-o*p-l*f-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(r/2),p=o(s/2),f=l(n/2),m=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=f*h*p+c*m*v,this._y=c*m*p-f*h*v,this._z=c*h*v+f*m*p,this._w=c*h*p-f*m*v;break;case"YXZ":this._x=f*h*p+c*m*v,this._y=c*m*p-f*h*v,this._z=c*h*v-f*m*p,this._w=c*h*p+f*m*v;break;case"ZXY":this._x=f*h*p-c*m*v,this._y=c*m*p+f*h*v,this._z=c*h*v+f*m*p,this._w=c*h*p-f*m*v;break;case"ZYX":this._x=f*h*p-c*m*v,this._y=c*m*p+f*h*v,this._z=c*h*v-f*m*p,this._w=c*h*p+f*m*v;break;case"YZX":this._x=f*h*p+c*m*v,this._y=c*m*p+f*h*v,this._z=c*h*v-f*m*p,this._w=c*h*p-f*m*v;break;case"XZY":this._x=f*h*p-c*m*v,this._y=c*m*p-f*h*v,this._z=c*h*v+f*m*p,this._w=c*h*p+f*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],p=e[10],f=n+o+p;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(n>o&&n>p){const m=2*Math.sqrt(1+n-o-p);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>p){const m=2*Math.sqrt(1+o-n-p);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+p-n-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(fe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-r*o,this._w=a*h-n*o-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+n*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*n+e*this._x,this._y=m*r+e*this._y,this._z=m*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),p=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=a*p+this._w*f,this._x=n*p+this._x*f,this._y=r*p+this._y*f,this._z=s*p+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class L{constructor(t=0,e=0,n=0){L.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ks.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ks.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*r,this.y=s[1]*e+s[4]*n+s[7]*r,this.z=s[2]*e+s[5]*n+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*r-o*n),h=2*(o*e-s*r),p=2*(s*n-a*e);return this.x=e+l*c+a*p-o*h,this.y=n+l*h+o*c-s*p,this.z=r+l*p+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r,this.y=s[1]*e+s[5]*n+s[9]*r,this.z=s[2]*e+s[6]*n+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return pr.copy(this).projectOnVector(t),this.sub(pr)}reflect(t){return this.sub(pr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(fe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const pr=new L,Ks=new ui;class di{constructor(t=new L(1/0,1/0,1/0),e=new L(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ae),Ae.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ei),vi.subVectors(this.max,ei),An.subVectors(t.a,ei),bn.subVectors(t.b,ei),wn.subVectors(t.c,ei),Ke.subVectors(bn,An),$e.subVectors(wn,bn),hn.subVectors(An,wn);let e=[0,-Ke.z,Ke.y,0,-$e.z,$e.y,0,-hn.z,hn.y,Ke.z,0,-Ke.x,$e.z,0,-$e.x,hn.z,0,-hn.x,-Ke.y,Ke.x,0,-$e.y,$e.x,0,-hn.y,hn.x,0];return!mr(e,An,bn,wn,vi)||(e=[1,0,0,0,1,0,0,0,1],!mr(e,An,bn,wn,vi))?!1:(xi.crossVectors(Ke,$e),e=[xi.x,xi.y,xi.z],mr(e,An,bn,wn,vi))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ae).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ae).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Be[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Be[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Be[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Be[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Be[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Be[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Be[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Be[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Be),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Be=[new L,new L,new L,new L,new L,new L,new L,new L],Ae=new L,gi=new di,An=new L,bn=new L,wn=new L,Ke=new L,$e=new L,hn=new L,ei=new L,vi=new L,xi=new L,un=new L;function mr(i,t,e,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){un.fromArray(i,s);const o=r.x*Math.abs(un.x)+r.y*Math.abs(un.y)+r.z*Math.abs(un.z),l=t.dot(un),c=e.dot(un),h=n.dot(un);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Ol=new di,ni=new L,_r=new L;class Zr{constructor(t=new L,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Ol.setFromPoints(t).getCenter(n);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ni.subVectors(t,this.center);const e=ni.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=(n-this.radius)*.5;this.center.addScaledVector(ni,r/n),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(_r.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ni.copy(t.center).add(_r)),this.expandByPoint(ni.copy(t.center).sub(_r))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ze=new L,gr=new L,Mi=new L,je=new L,vr=new L,Si=new L,xr=new L;class Bl{constructor(t=new L,e=new L(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ze)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ze.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ze.copy(this.origin).addScaledVector(this.direction,e),ze.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){gr.copy(t).add(e).multiplyScalar(.5),Mi.copy(e).sub(t).normalize(),je.copy(this.origin).sub(gr);const s=t.distanceTo(e)*.5,a=-this.direction.dot(Mi),o=je.dot(this.direction),l=-je.dot(Mi),c=je.lengthSq(),h=Math.abs(1-a*a);let p,f,m,v;if(h>0)if(p=a*l-o,f=a*o-l,v=s*h,p>=0)if(f>=-v)if(f<=v){const S=1/h;p*=S,f*=S,m=p*(p+a*f+2*o)+f*(a*p+f+2*l)+c}else f=s,p=Math.max(0,-(a*f+o)),m=-p*p+f*(f+2*l)+c;else f=-s,p=Math.max(0,-(a*f+o)),m=-p*p+f*(f+2*l)+c;else f<=-v?(p=Math.max(0,-(-a*s+o)),f=p>0?-s:Math.min(Math.max(-s,-l),s),m=-p*p+f*(f+2*l)+c):f<=v?(p=0,f=Math.min(Math.max(-s,-l),s),m=f*(f+2*l)+c):(p=Math.max(0,-(a*s+o)),f=p>0?s:Math.min(Math.max(-s,-l),s),m=-p*p+f*(f+2*l)+c);else f=a>0?-s:s,p=Math.max(0,-(a*f+o)),m=-p*p+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(gr).addScaledVector(Mi,f),m}intersectSphere(t,e){ze.subVectors(t.center,this.origin);const n=ze.dot(this.direction),r=ze.dot(ze)-n*n,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,r=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,r=(t.min.x-f.x)*c),h>=0?(s=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(s=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a=0?(o=(t.min.z-f.z)*p,l=(t.max.z-f.z)*p):(o=(t.max.z-f.z)*p,l=(t.min.z-f.z)*p),n>l||o>r)||((o>n||n!==n)&&(n=o),(l=0?n:r,e)}intersectsBox(t){return this.intersectBox(t,ze)!==null}intersectTriangle(t,e,n,r,s){vr.subVectors(e,t),Si.subVectors(n,t),xr.crossVectors(vr,Si);let a=this.direction.dot(xr),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;je.subVectors(this.origin,t);const l=o*this.direction.dot(Si.crossVectors(je,Si));if(l<0)return null;const c=o*this.direction.dot(vr.cross(je));if(c<0||l+c>a)return null;const h=-o*je.dot(xr);return h<0?null:this.at(h/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Jt{constructor(t,e,n,r,s,a,o,l,c,h,p,f,m,v,S,d){Jt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,r,s,a,o,l,c,h,p,f,m,v,S,d)}set(t,e,n,r,s,a,o,l,c,h,p,f,m,v,S,d){const u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=r,u[1]=s,u[5]=a,u[9]=o,u[13]=l,u[2]=c,u[6]=h,u[10]=p,u[14]=f,u[3]=m,u[7]=v,u[11]=S,u[15]=d,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Jt().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Rn.setFromMatrixColumn(t,0).length(),s=1/Rn.setFromMatrixColumn(t,1).length(),a=1/Rn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,r=t.y,s=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(t.order==="XYZ"){const f=a*h,m=a*p,v=o*h,S=o*p;e[0]=l*h,e[4]=-l*p,e[8]=c,e[1]=m+v*c,e[5]=f-S*c,e[9]=-o*l,e[2]=S-f*c,e[6]=v+m*c,e[10]=a*l}else if(t.order==="YXZ"){const f=l*h,m=l*p,v=c*h,S=c*p;e[0]=f+S*o,e[4]=v*o-m,e[8]=a*c,e[1]=a*p,e[5]=a*h,e[9]=-o,e[2]=m*o-v,e[6]=S+f*o,e[10]=a*l}else if(t.order==="ZXY"){const f=l*h,m=l*p,v=c*h,S=c*p;e[0]=f-S*o,e[4]=-a*p,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*h,e[9]=S-f*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const f=a*h,m=a*p,v=o*h,S=o*p;e[0]=l*h,e[4]=v*c-m,e[8]=f*c+S,e[1]=l*p,e[5]=S*c+f,e[9]=m*c-v,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const f=a*l,m=a*c,v=o*l,S=o*c;e[0]=l*h,e[4]=S-f*p,e[8]=v*p+m,e[1]=p,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*p+v,e[10]=f-S*p}else if(t.order==="XZY"){const f=a*l,m=a*c,v=o*l,S=o*c;e[0]=l*h,e[4]=-p,e[8]=c*h,e[1]=f*p+S,e[5]=a*h,e[9]=m*p-v,e[2]=v*p-m,e[6]=o*h,e[10]=S*p+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zl,t,Hl)}lookAt(t,e,n){const r=this.elements;return ve.subVectors(t,e),ve.lengthSq()===0&&(ve.z=1),ve.normalize(),Ze.crossVectors(n,ve),Ze.lengthSq()===0&&(Math.abs(n.z)===1?ve.x+=1e-4:ve.z+=1e-4,ve.normalize(),Ze.crossVectors(n,ve)),Ze.normalize(),Ei.crossVectors(ve,Ze),r[0]=Ze.x,r[4]=Ei.x,r[8]=ve.x,r[1]=Ze.y,r[5]=Ei.y,r[9]=ve.y,r[2]=Ze.z,r[6]=Ei.z,r[10]=ve.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],p=n[5],f=n[9],m=n[13],v=n[2],S=n[6],d=n[10],u=n[14],y=n[3],M=n[7],T=n[11],U=n[15],b=r[0],w=r[4],O=r[8],E=r[12],_=r[1],F=r[5],k=r[9],C=r[13],G=r[2],q=r[6],j=r[10],st=r[14],H=r[3],J=r[7],Z=r[11],ft=r[15];return s[0]=a*b+o*_+l*G+c*H,s[4]=a*w+o*F+l*q+c*J,s[8]=a*O+o*k+l*j+c*Z,s[12]=a*E+o*C+l*st+c*ft,s[1]=h*b+p*_+f*G+m*H,s[5]=h*w+p*F+f*q+m*J,s[9]=h*O+p*k+f*j+m*Z,s[13]=h*E+p*C+f*st+m*ft,s[2]=v*b+S*_+d*G+u*H,s[6]=v*w+S*F+d*q+u*J,s[10]=v*O+S*k+d*j+u*Z,s[14]=v*E+S*C+d*st+u*ft,s[3]=y*b+M*_+T*G+U*H,s[7]=y*w+M*F+T*q+U*J,s[11]=y*O+M*k+T*j+U*Z,s[15]=y*E+M*C+T*st+U*ft,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],p=t[6],f=t[10],m=t[14],v=t[3],S=t[7],d=t[11],u=t[15];return v*(+s*l*p-r*c*p-s*o*f+n*c*f+r*o*m-n*l*m)+S*(+e*l*m-e*c*f+s*a*f-r*a*m+r*c*h-s*l*h)+d*(+e*c*p-e*o*m-s*a*p+n*a*m+s*o*h-n*c*h)+u*(-r*o*h-e*l*p+e*o*f+r*a*p-n*a*f+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],p=t[9],f=t[10],m=t[11],v=t[12],S=t[13],d=t[14],u=t[15],y=p*d*c-S*f*c+S*l*m-o*d*m-p*l*u+o*f*u,M=v*f*c-h*d*c-v*l*m+a*d*m+h*l*u-a*f*u,T=h*S*c-v*p*c+v*o*m-a*S*m-h*o*u+a*p*u,U=v*p*l-h*S*l-v*o*f+a*S*f+h*o*d-a*p*d,b=e*y+n*M+r*T+s*U;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=y*w,t[1]=(S*f*s-p*d*s-S*r*m+n*d*m+p*r*u-n*f*u)*w,t[2]=(o*d*s-S*l*s+S*r*c-n*d*c-o*r*u+n*l*u)*w,t[3]=(p*l*s-o*f*s-p*r*c+n*f*c+o*r*m-n*l*m)*w,t[4]=M*w,t[5]=(h*d*s-v*f*s+v*r*m-e*d*m-h*r*u+e*f*u)*w,t[6]=(v*l*s-a*d*s-v*r*c+e*d*c+a*r*u-e*l*u)*w,t[7]=(a*f*s-h*l*s+h*r*c-e*f*c-a*r*m+e*l*m)*w,t[8]=T*w,t[9]=(v*p*s-h*S*s-v*n*m+e*S*m+h*n*u-e*p*u)*w,t[10]=(a*S*s-v*o*s+v*n*c-e*S*c-a*n*u+e*o*u)*w,t[11]=(h*o*s-a*p*s-h*n*c+e*p*c+a*n*m-e*o*m)*w,t[12]=U*w,t[13]=(h*S*r-v*p*r+v*n*f-e*S*f-h*n*d+e*p*d)*w,t[14]=(v*o*r-a*S*r-v*n*l+e*S*l+a*n*d-e*o*d)*w,t[15]=(a*p*r-h*o*r+h*n*l-e*p*l-a*n*f+e*o*f)*w,this}scale(t){const e=this.elements,n=t.x,r=t.y,s=t.z;return e[0]*=n,e[4]*=r,e[8]*=s,e[1]*=n,e[5]*=r,e[9]*=s,e[2]*=n,e[6]*=r,e[10]*=s,e[3]*=n,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),s=1-n,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+n,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,s,a){return this.set(1,n,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,p=o+o,f=s*c,m=s*h,v=s*p,S=a*h,d=a*p,u=o*p,y=l*c,M=l*h,T=l*p,U=n.x,b=n.y,w=n.z;return r[0]=(1-(S+u))*U,r[1]=(m+T)*U,r[2]=(v-M)*U,r[3]=0,r[4]=(m-T)*b,r[5]=(1-(f+u))*b,r[6]=(d+y)*b,r[7]=0,r[8]=(v+M)*w,r[9]=(d-y)*w,r[10]=(1-(f+S))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let s=Rn.set(r[0],r[1],r[2]).length();const a=Rn.set(r[4],r[5],r[6]).length(),o=Rn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],be.copy(this);const c=1/s,h=1/a,p=1/o;return be.elements[0]*=c,be.elements[1]*=c,be.elements[2]*=c,be.elements[4]*=h,be.elements[5]*=h,be.elements[6]*=h,be.elements[8]*=p,be.elements[9]*=p,be.elements[10]*=p,e.setFromRotationMatrix(be),n.x=s,n.y=a,n.z=o,this}makePerspective(t,e,n,r,s,a,o=Xe){const l=this.elements,c=2*s/(e-t),h=2*s/(n-r),p=(e+t)/(e-t),f=(n+r)/(n-r);let m,v;if(o===Xe)m=-(a+s)/(a-s),v=-2*a*s/(a-s);else if(o===ki)m=-a/(a-s),v=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=p,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,r,s,a,o=Xe){const l=this.elements,c=1/(e-t),h=1/(n-r),p=1/(a-s),f=(e+t)*c,m=(n+r)*h;let v,S;if(o===Xe)v=(a+s)*p,S=-2*p;else if(o===ki)v=s*p,S=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=S,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Rn=new L,be=new Jt,zl=new L(0,0,0),Hl=new L(1,1,1),Ze=new L,Ei=new L,ve=new L,$s=new Jt,js=new ui;class Fe{constructor(t=0,e=0,n=0,r=Fe.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],p=r[2],f=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(fe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-fe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(fe(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-p,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-fe(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(fe(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-fe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return $s.makeRotationFromQuaternion(t),this.setFromRotationMatrix($s,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return js.setFromEuler(this),this.setFromQuaternion(js,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Fe.DEFAULT_ORDER="XYZ";class Za{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),p.length>0&&(n.shapes=p),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m),v.length>0&&(n.nodes=v)}return n.object=r,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,n,r,s){we.subVectors(r,e),Ve.subVectors(n,e),Sr.subVectors(t,e);const a=we.dot(we),o=we.dot(Ve),l=we.dot(Sr),c=Ve.dot(Ve),h=Ve.dot(Sr),p=a*c-o*o;if(p===0)return s.set(0,0,0),null;const f=1/p,m=(c*l-o*h)*f,v=(a*h-o*l)*f;return s.set(1-m-v,v,m)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Ge)===null?!1:Ge.x>=0&&Ge.y>=0&&Ge.x+Ge.y<=1}static getInterpolation(t,e,n,r,s,a,o,l){return this.getBarycoord(t,e,n,r,Ge)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Ge.x),l.addScaledVector(a,Ge.y),l.addScaledVector(o,Ge.z),l)}static isFrontFacing(t,e,n,r){return we.subVectors(n,e),Ve.subVectors(t,e),we.cross(Ve).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return we.subVectors(this.c,this.b),Ve.subVectors(this.a,this.b),we.cross(Ve).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return De.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return De.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,s){return De.getInterpolation(t,this.a,this.b,this.c,e,n,r,s)}containsPoint(t){return De.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return De.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,s=this.c;let a,o;Ln.subVectors(r,n),Dn.subVectors(s,n),Er.subVectors(t,n);const l=Ln.dot(Er),c=Dn.dot(Er);if(l<=0&&c<=0)return e.copy(n);yr.subVectors(t,r);const h=Ln.dot(yr),p=Dn.dot(yr);if(h>=0&&p<=h)return e.copy(r);const f=l*p-h*c;if(f<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(Ln,a);Tr.subVectors(t,s);const m=Ln.dot(Tr),v=Dn.dot(Tr);if(v>=0&&m<=v)return e.copy(s);const S=m*c-l*v;if(S<=0&&c>=0&&v<=0)return o=c/(c-v),e.copy(n).addScaledVector(Dn,o);const d=h*v-m*p;if(d<=0&&p-h>=0&&m-v>=0)return na.subVectors(s,r),o=(p-h)/(p-h+(m-v)),e.copy(r).addScaledVector(na,o);const u=1/(d+S+f);return a=S*u,o=f*u,e.copy(n).addScaledVector(Ln,a).addScaledVector(Dn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Ja={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Je={h:0,s:0,l:0},Ti={h:0,s:0,l:0};function Ar(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class zt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Pe){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Gt.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Gt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Gt.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Gt.workingColorSpace){if(t=Rl(t,1),e=fe(e,0,1),n=fe(n,0,1),e===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=Ar(a,s,t+1/3),this.g=Ar(a,s,t),this.b=Ar(a,s,t-1/3)}return Gt.toWorkingColorSpace(this,r),this}setStyle(t,e=Pe){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Pe){const n=Ja[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=kn(t.r),this.g=kn(t.g),this.b=kn(t.b),this}copyLinearToSRGB(t){return this.r=dr(t.r),this.g=dr(t.g),this.b=dr(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Pe){return Gt.fromWorkingColorSpace(ce.copy(this),t),Math.round(fe(ce.r*255,0,255))*65536+Math.round(fe(ce.g*255,0,255))*256+Math.round(fe(ce.b*255,0,255))}getHexString(t=Pe){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Gt.workingColorSpace){Gt.fromWorkingColorSpace(ce.copy(this),e);const n=ce.r,r=ce.g,s=ce.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const p=a-o;switch(c=h<=.5?p/(a+o):p/(2-a-o),a){case n:l=(r-s)/p+(r0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vn&&(n.blending=this.blending),this.side!==sn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Br&&(n.blendSrc=this.blendSrc),this.blendDst!==zr&&(n.blendDst=this.blendDst),this.blendEquation!==vn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==zi&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Gs&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yn&&(n.stencilFail=this.stencilFail),this.stencilZFail!==yn&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==yn&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Qa extends $n{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new zt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Fe,this.combine=Kr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const ee=new L,Ai=new Pt;class Te{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=ks,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=en,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Pl("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,s=this.itemSize;r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let p=0,f=c.length;p0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],p=s[c];for(let f=0,m=p.length;f0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(ia.copy(s).invert(),dn.copy(t.ray).applyMatrix4(ia),!(n.boundingBox!==null&&dn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,dn)))}_computeIntersections(t,e,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,f=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,S=f.length;ve.far?null:{distance:c,point:Di.clone(),object:i}}function Ui(i,t,e,n,r,s,a,o,l,c){i.getVertexPosition(o,In),i.getVertexPosition(l,Nn),i.getVertexPosition(c,Fn);const h=Yl(i,t,e,n,In,Nn,Fn,Li);if(h){r&&(Ri.fromBufferAttribute(r,o),Ci.fromBufferAttribute(r,l),Pi.fromBufferAttribute(r,c),h.uv=De.getInterpolation(Li,In,Nn,Fn,Ri,Ci,Pi,new Pt)),s&&(Ri.fromBufferAttribute(s,o),Ci.fromBufferAttribute(s,l),Pi.fromBufferAttribute(s,c),h.uv1=De.getInterpolation(Li,In,Nn,Fn,Ri,Ci,Pi,new Pt)),a&&(sa.fromBufferAttribute(a,o),aa.fromBufferAttribute(a,l),oa.fromBufferAttribute(a,c),h.normal=De.getInterpolation(Li,In,Nn,Fn,sa,aa,oa,new L),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new L,materialIndex:0};De.getNormal(In,Nn,Fn,p.normal),h.face=p}return h}class jn extends qe{constructor(t=1,e=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],p=[];let f=0,m=0;v("z","y","x",-1,-1,n,e,t,a,s,0),v("z","y","x",1,-1,n,e,-t,a,s,1),v("x","z","y",1,1,t,n,e,r,a,2),v("x","z","y",1,-1,t,n,-e,r,a,3),v("x","y","z",1,-1,t,e,n,r,s,4),v("x","y","z",-1,-1,t,e,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Ne(c,3)),this.setAttribute("normal",new Ne(h,3)),this.setAttribute("uv",new Ne(p,2));function v(S,d,u,y,M,T,U,b,w,O,E){const _=T/w,F=U/O,k=T/2,C=U/2,G=b/2,q=w+1,j=O+1;let st=0,H=0;const J=new L;for(let Z=0;Z0?1:-1,h.push(J.x,J.y,J.z),p.push(Lt/w),p.push(1-Z/O),st+=1}}for(let Z=0;Z0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class io extends _e{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Jt,this.projectionMatrix=new Jt,this.projectionMatrixInverse=new Jt,this.coordinateSystem=Xe}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Qe=new L,la=new Pt,ca=new Pt;class Me extends io{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Wr*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(cr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Wr*2*Math.atan(Math.tan(cr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Qe.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Qe.x,Qe.y).multiplyScalar(-t/Qe.z),Qe.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Qe.x,Qe.y).multiplyScalar(-t/Qe.z)}getViewSize(t,e){return this.getViewBounds(t,la,ca),e.subVectors(ca,la)}setViewOffset(t,e,n,r,s,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(cr*.5*this.fov)/this.zoom,n=2*e,r=this.aspect*n,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*r/l,e-=a.offsetY*n/c,r*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const On=-90,Bn=1;class Jl extends _e{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Me(On,Bn,t,e);r.layers=this.layers,this.add(r);const s=new Me(On,Bn,t,e);s.layers=this.layers,this.add(s);const a=new Me(On,Bn,t,e);a.layers=this.layers,this.add(a);const o=new Me(On,Bn,t,e);o.layers=this.layers,this.add(o);const l=new Me(On,Bn,t,e);l.layers=this.layers,this.add(l);const c=new Me(On,Bn,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,s,a,o,l]=e;for(const c of e)this.remove(c);if(t===Xe)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===ki)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,h]=this.children,p=t.getRenderTarget(),f=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),v=t.xr.enabled;t.xr.enabled=!1;const S=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,s),t.setRenderTarget(n,1,r),t.render(e,a),t.setRenderTarget(n,2,r),t.render(e,o),t.setRenderTarget(n,3,r),t.render(e,l),t.setRenderTarget(n,4,r),t.render(e,c),n.texture.generateMipmaps=S,t.setRenderTarget(n,5,r),t.render(e,h),t.setRenderTarget(p,f,m),t.xr.enabled=v,n.texture.needsPMREMUpdate=!0}}class ro extends me{constructor(t,e,n,r,s,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Wn,super(t,e,n,r,s,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Ql extends En{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new ro(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Re}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new jn(5,5,5),s=new on({name:"CubemapFromEquirect",uniforms:Yn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:pe,blending:nn});s.uniforms.tEquirect.value=e;const a=new Ie(r,s),o=e.minFilter;return e.minFilter===Sn&&(e.minFilter=Re),new Jl(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,r){const s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,r);t.setRenderTarget(s)}}const Rr=new L,tc=new L,ec=new Tt;class _n{constructor(t=new L(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=Rr.subVectors(n,e).cross(tc.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Rr),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||ec.getNormalMatrix(t),r=this.coplanarPoint(Rr).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const fn=new Zr,Ii=new L;class Jr{constructor(t=new _n,e=new _n,n=new _n,r=new _n,s=new _n,a=new _n){this.planes=[t,e,n,r,s,a]}set(t,e,n,r,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Xe){const n=this.planes,r=t.elements,s=r[0],a=r[1],o=r[2],l=r[3],c=r[4],h=r[5],p=r[6],f=r[7],m=r[8],v=r[9],S=r[10],d=r[11],u=r[12],y=r[13],M=r[14],T=r[15];if(n[0].setComponents(l-s,f-c,d-m,T-u).normalize(),n[1].setComponents(l+s,f+c,d+m,T+u).normalize(),n[2].setComponents(l+a,f+h,d+v,T+y).normalize(),n[3].setComponents(l-a,f-h,d-v,T-y).normalize(),n[4].setComponents(l-o,f-p,d-S,T-M).normalize(),e===Xe)n[5].setComponents(l+o,f+p,d+S,T+M).normalize();else if(e===ki)n[5].setComponents(o,p,S,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),fn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),fn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(fn)}intersectsSprite(t){return fn.center.set(0,0,0),fn.radius=.7071067811865476,fn.applyMatrix4(t.matrixWorld),this.intersectsSphere(fn)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)0?t.max.x:t.min.x,Ii.y=r.normal.y>0?t.max.y:t.min.y,Ii.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Ii)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function so(){let i=null,t=!1,e=null,n=null;function r(s,a){e(s,a),n=i.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(n=i.requestAnimationFrame(r),t=!0)},stop:function(){i.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){i=s}}}function nc(i){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,p=c.byteLength,f=i.createBuffer();i.bindBuffer(l,f),i.bufferData(l,c,h),o.onUploadCallback();let m;if(c instanceof Float32Array)m=i.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?m=i.HALF_FLOAT:m=i.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=i.SHORT;else if(c instanceof Uint32Array)m=i.UNSIGNED_INT;else if(c instanceof Int32Array)m=i.INT;else if(c instanceof Int8Array)m=i.BYTE;else if(c instanceof Uint8Array)m=i.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:p}}function n(o,l,c){const h=l.array,p=l._updateRange,f=l.updateRanges;if(i.bindBuffer(c,o),p.count===-1&&f.length===0&&i.bufferSubData(c,0,h),f.length!==0){for(let m=0,v=f.length;m 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,xc=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Mc=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Sc=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Ec=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,yc=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Tc=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,Ac=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,bc=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,wc=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Rc=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Cc=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Pc=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Lc=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Dc=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Uc="gl_FragColor = linearToOutputTexel( gl_FragColor );",Ic=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,Nc=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Fc=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Oc=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Bc=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,zc=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Hc=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Vc=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Gc=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,kc=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Wc=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,Xc=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,qc=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Yc=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Kc=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,$c=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,jc=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Zc=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Jc=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,Qc=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,th=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,eh=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,nh=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,ih=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,rh=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,sh=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,ah=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,oh=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,lh=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,ch=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,hh=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,uh=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,dh=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,fh=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,ph=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,mh=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[MORPHTARGETS_COUNT]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,_h=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,gh=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,vh=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + #endif + #ifdef MORPHTARGETS_TEXTURE + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,xh=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,Mh=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Sh=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Eh=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,yh=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Th=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Ah=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,bh=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,wh=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Rh=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,Ch=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Ph=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Lh=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Dh=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Uh=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Ih=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Nh=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Fh=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Oh=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Bh=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return shadow; + } +#endif`,zh=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Hh=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Vh=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Gh=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,kh=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,Wh=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,Xh=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,qh=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,Yh=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Kh=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,$h=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,jh=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,Zh=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,Jh=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,Qh=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,tu=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,eu=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const nu=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,iu=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,ru=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,su=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,au=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,ou=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,lu=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,cu=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,hu=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,uu=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,du=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,fu=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,pu=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,mu=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,_u=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,gu=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,vu=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,xu=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Mu=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Su=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Eu=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,yu=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Tu=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Au=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,bu=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,wu=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Ru=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Cu=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Pu=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Lu=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Du=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Uu=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Iu=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Nu=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,yt={alphahash_fragment:ic,alphahash_pars_fragment:rc,alphamap_fragment:sc,alphamap_pars_fragment:ac,alphatest_fragment:oc,alphatest_pars_fragment:lc,aomap_fragment:cc,aomap_pars_fragment:hc,batching_pars_vertex:uc,batching_vertex:dc,begin_vertex:fc,beginnormal_vertex:pc,bsdfs:mc,iridescence_fragment:_c,bumpmap_pars_fragment:gc,clipping_planes_fragment:vc,clipping_planes_pars_fragment:xc,clipping_planes_pars_vertex:Mc,clipping_planes_vertex:Sc,color_fragment:Ec,color_pars_fragment:yc,color_pars_vertex:Tc,color_vertex:Ac,common:bc,cube_uv_reflection_fragment:wc,defaultnormal_vertex:Rc,displacementmap_pars_vertex:Cc,displacementmap_vertex:Pc,emissivemap_fragment:Lc,emissivemap_pars_fragment:Dc,colorspace_fragment:Uc,colorspace_pars_fragment:Ic,envmap_fragment:Nc,envmap_common_pars_fragment:Fc,envmap_pars_fragment:Oc,envmap_pars_vertex:Bc,envmap_physical_pars_fragment:$c,envmap_vertex:zc,fog_vertex:Hc,fog_pars_vertex:Vc,fog_fragment:Gc,fog_pars_fragment:kc,gradientmap_pars_fragment:Wc,lightmap_pars_fragment:Xc,lights_lambert_fragment:qc,lights_lambert_pars_fragment:Yc,lights_pars_begin:Kc,lights_toon_fragment:jc,lights_toon_pars_fragment:Zc,lights_phong_fragment:Jc,lights_phong_pars_fragment:Qc,lights_physical_fragment:th,lights_physical_pars_fragment:eh,lights_fragment_begin:nh,lights_fragment_maps:ih,lights_fragment_end:rh,logdepthbuf_fragment:sh,logdepthbuf_pars_fragment:ah,logdepthbuf_pars_vertex:oh,logdepthbuf_vertex:lh,map_fragment:ch,map_pars_fragment:hh,map_particle_fragment:uh,map_particle_pars_fragment:dh,metalnessmap_fragment:fh,metalnessmap_pars_fragment:ph,morphinstance_vertex:mh,morphcolor_vertex:_h,morphnormal_vertex:gh,morphtarget_pars_vertex:vh,morphtarget_vertex:xh,normal_fragment_begin:Mh,normal_fragment_maps:Sh,normal_pars_fragment:Eh,normal_pars_vertex:yh,normal_vertex:Th,normalmap_pars_fragment:Ah,clearcoat_normal_fragment_begin:bh,clearcoat_normal_fragment_maps:wh,clearcoat_pars_fragment:Rh,iridescence_pars_fragment:Ch,opaque_fragment:Ph,packing:Lh,premultiplied_alpha_fragment:Dh,project_vertex:Uh,dithering_fragment:Ih,dithering_pars_fragment:Nh,roughnessmap_fragment:Fh,roughnessmap_pars_fragment:Oh,shadowmap_pars_fragment:Bh,shadowmap_pars_vertex:zh,shadowmap_vertex:Hh,shadowmask_pars_fragment:Vh,skinbase_vertex:Gh,skinning_pars_vertex:kh,skinning_vertex:Wh,skinnormal_vertex:Xh,specularmap_fragment:qh,specularmap_pars_fragment:Yh,tonemapping_fragment:Kh,tonemapping_pars_fragment:$h,transmission_fragment:jh,transmission_pars_fragment:Zh,uv_pars_fragment:Jh,uv_pars_vertex:Qh,uv_vertex:tu,worldpos_vertex:eu,background_vert:nu,background_frag:iu,backgroundCube_vert:ru,backgroundCube_frag:su,cube_vert:au,cube_frag:ou,depth_vert:lu,depth_frag:cu,distanceRGBA_vert:hu,distanceRGBA_frag:uu,equirect_vert:du,equirect_frag:fu,linedashed_vert:pu,linedashed_frag:mu,meshbasic_vert:_u,meshbasic_frag:gu,meshlambert_vert:vu,meshlambert_frag:xu,meshmatcap_vert:Mu,meshmatcap_frag:Su,meshnormal_vert:Eu,meshnormal_frag:yu,meshphong_vert:Tu,meshphong_frag:Au,meshphysical_vert:bu,meshphysical_frag:wu,meshtoon_vert:Ru,meshtoon_frag:Cu,points_vert:Pu,points_frag:Lu,shadow_vert:Du,shadow_frag:Uu,sprite_vert:Iu,sprite_frag:Nu},et={common:{diffuse:{value:new zt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tt}},envmap:{envMap:{value:null},envMapRotation:{value:new Tt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tt},normalScale:{value:new Pt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new zt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new zt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0},uvTransform:{value:new Tt}},sprite:{diffuse:{value:new zt(16777215)},opacity:{value:1},center:{value:new Pt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}}},Le={basic:{uniforms:ue([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:ue([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new zt(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:ue([et.common,et.specularmap,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.fog,et.lights,{emissive:{value:new zt(0)},specular:{value:new zt(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:ue([et.common,et.envmap,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.roughnessmap,et.metalnessmap,et.fog,et.lights,{emissive:{value:new zt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:ue([et.common,et.aomap,et.lightmap,et.emissivemap,et.bumpmap,et.normalmap,et.displacementmap,et.gradientmap,et.fog,et.lights,{emissive:{value:new zt(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:ue([et.common,et.bumpmap,et.normalmap,et.displacementmap,et.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:ue([et.points,et.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:ue([et.common,et.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:ue([et.common,et.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:ue([et.common,et.bumpmap,et.normalmap,et.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:ue([et.sprite,et.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Tt}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:ue([et.common,et.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:ue([et.lights,et.fog,{color:{value:new zt(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};Le.physical={uniforms:ue([Le.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tt},clearcoatNormalScale:{value:new Pt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tt},sheen:{value:0},sheenColor:{value:new zt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tt},transmissionSamplerSize:{value:new Pt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tt},attenuationDistance:{value:0},attenuationColor:{value:new zt(0)},specularColor:{value:new zt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tt},anisotropyVector:{value:new Pt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tt}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const Ni={r:0,b:0,g:0},pn=new Fe,Fu=new Jt;function Ou(i,t,e,n,r,s,a){const o=new zt(0);let l=s===!0?0:1,c,h,p=null,f=0,m=null;function v(y){let M=y.isScene===!0?y.background:null;return M&&M.isTexture&&(M=(y.backgroundBlurriness>0?e:t).get(M)),M}function S(y){let M=!1;const T=v(y);T===null?u(o,l):T&&T.isColor&&(u(T,1),M=!0);const U=i.xr.getEnvironmentBlendMode();U==="additive"?n.buffers.color.setClear(0,0,0,1,a):U==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||M)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil)}function d(y,M){const T=v(M);T&&(T.isCubeTexture||T.mapping===Xi)?(h===void 0&&(h=new Ie(new jn(1,1,1),new on({name:"BackgroundCubeMaterial",uniforms:Yn(Le.backgroundCube.uniforms),vertexShader:Le.backgroundCube.vertexShader,fragmentShader:Le.backgroundCube.fragmentShader,side:pe,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(U,b,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),pn.copy(M.backgroundRotation),pn.x*=-1,pn.y*=-1,pn.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(pn.y*=-1,pn.z*=-1),h.material.uniforms.envMap.value=T,h.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Fu.makeRotationFromEuler(pn)),h.material.toneMapped=Gt.getTransfer(T.colorSpace)!==Yt,(p!==T||f!==T.version||m!==i.toneMapping)&&(h.material.needsUpdate=!0,p=T,f=T.version,m=i.toneMapping),h.layers.enableAll(),y.unshift(h,h.geometry,h.material,0,0,null)):T&&T.isTexture&&(c===void 0&&(c=new Ie(new Ki(2,2),new on({name:"BackgroundMaterial",uniforms:Yn(Le.background.uniforms),vertexShader:Le.background.vertexShader,fragmentShader:Le.background.fragmentShader,side:sn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,c.material.toneMapped=Gt.getTransfer(T.colorSpace)!==Yt,T.matrixAutoUpdate===!0&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),(p!==T||f!==T.version||m!==i.toneMapping)&&(c.material.needsUpdate=!0,p=T,f=T.version,m=i.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function u(y,M){y.getRGB(Ni,no(i)),n.buffers.color.setClear(Ni.r,Ni.g,Ni.b,M,a)}return{getClearColor:function(){return o},setClearColor:function(y,M=1){o.set(y),l=M,u(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,u(o,l)},render:S,addToRenderList:d}}function Bu(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=f(null);let s=r,a=!1;function o(_,F,k,C,G){let q=!1;const j=p(C,k,F);s!==j&&(s=j,c(s.object)),q=m(_,C,k,G),q&&v(_,C,k,G),G!==null&&t.update(G,i.ELEMENT_ARRAY_BUFFER),(q||a)&&(a=!1,T(_,F,k,C),G!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(G).buffer))}function l(){return i.createVertexArray()}function c(_){return i.bindVertexArray(_)}function h(_){return i.deleteVertexArray(_)}function p(_,F,k){const C=k.wireframe===!0;let G=n[_.id];G===void 0&&(G={},n[_.id]=G);let q=G[F.id];q===void 0&&(q={},G[F.id]=q);let j=q[C];return j===void 0&&(j=f(l()),q[C]=j),j}function f(_){const F=[],k=[],C=[];for(let G=0;G=0){const Z=G[H];let ft=q[H];if(ft===void 0&&(H==="instanceMatrix"&&_.instanceMatrix&&(ft=_.instanceMatrix),H==="instanceColor"&&_.instanceColor&&(ft=_.instanceColor)),Z===void 0||Z.attribute!==ft||ft&&Z.data!==ft.data)return!0;j++}return s.attributesNum!==j||s.index!==C}function v(_,F,k,C){const G={},q=F.attributes;let j=0;const st=k.getAttributes();for(const H in st)if(st[H].location>=0){let Z=q[H];Z===void 0&&(H==="instanceMatrix"&&_.instanceMatrix&&(Z=_.instanceMatrix),H==="instanceColor"&&_.instanceColor&&(Z=_.instanceColor));const ft={};ft.attribute=Z,Z&&Z.data&&(ft.data=Z.data),G[H]=ft,j++}s.attributes=G,s.attributesNum=j,s.index=C}function S(){const _=s.newAttributes;for(let F=0,k=_.length;F=0){let J=G[st];if(J===void 0&&(st==="instanceMatrix"&&_.instanceMatrix&&(J=_.instanceMatrix),st==="instanceColor"&&_.instanceColor&&(J=_.instanceColor)),J!==void 0){const Z=J.normalized,ft=J.itemSize,Lt=t.get(J);if(Lt===void 0)continue;const kt=Lt.buffer,V=Lt.type,Q=Lt.bytesPerElement,ht=V===i.INT||V===i.UNSIGNED_INT||J.gpuType===Va;if(J.isInterleavedBufferAttribute){const nt=J.data,Dt=nt.stride,Ut=J.offset;if(nt.isInstancedInterleavedBuffer){for(let D=0;D0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";b="mediump"}return b==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const p=e.logarithmicDepthBuffer===!0,f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_TEXTURE_SIZE),S=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),d=i.getParameter(i.MAX_VERTEX_ATTRIBS),u=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),y=i.getParameter(i.MAX_VARYING_VECTORS),M=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),T=m>0,U=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:p,maxTextures:f,maxVertexTextures:m,maxTextureSize:v,maxCubemapSize:S,maxAttributes:d,maxVertexUniforms:u,maxVaryings:y,maxFragmentUniforms:M,vertexTextures:T,maxSamples:U}}function Vu(i){const t=this;let e=null,n=0,r=!1,s=!1;const a=new _n,o=new Tt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,f){const m=p.length!==0||f||n!==0||r;return r=f,n=p.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,f){e=h(p,f,0)},this.setState=function(p,f,m){const v=p.clippingPlanes,S=p.clipIntersection,d=p.clipShadows,u=i.get(p);if(!r||v===null||v.length===0||s&&!d)s?h(null):c();else{const y=s?0:n,M=y*4;let T=u.clippingState||null;l.value=T,T=h(v,f,M,m);for(let U=0;U!==M;++U)T[U]=e[U];u.clippingState=T,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(p,f,m,v){const S=p!==null?p.length:0;let d=null;if(S!==0){if(d=l.value,v!==!0||d===null){const u=m+S*4,y=f.matrixWorldInverse;o.getNormalMatrix(y),(d===null||d.length0){const c=new Ql(l.height);return c.fromEquirectangularTexture(i,a),t.set(a,c),a.addEventListener("dispose",r),e(c.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}class ku extends io{constructor(t=-1,e=1,n=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-t,a=n+t,o=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const Hn=4,ha=[.125,.215,.35,.446,.526,.582],xn=20,Cr=new ku,ua=new zt;let Pr=null,Lr=0,Dr=0,Ur=!1;const gn=(1+Math.sqrt(5))/2,zn=1/gn,da=[new L(-gn,zn,0),new L(gn,zn,0),new L(-zn,0,gn),new L(zn,0,gn),new L(0,gn,-zn),new L(0,gn,zn),new L(-1,1,-1),new L(1,1,-1),new L(-1,1,1),new L(1,1,1)];class fa{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,r=100){Pr=this._renderer.getRenderTarget(),Lr=this._renderer.getActiveCubeFace(),Dr=this._renderer.getActiveMipmapLevel(),Ur=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,r,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_a(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ma(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?M:0,M,M),h.setRenderTarget(r),S&&h.render(v,o),h.render(t,o)}v.geometry.dispose(),v.material.dispose(),h.toneMapping=f,h.autoClear=p,t.background=d}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===Wn||t.mapping===Xn;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=_a()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ma());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new Ie(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;const l=this._cubeSize;Fi(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,Cr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sxn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${d} samples when the maximum is set to ${xn}`);const u=[];let y=0;for(let w=0;wM-Hn?r-M+Hn:0),b=4*(this._cubeSize-T);Fi(e,U,b,3*T,2*T),l.setRenderTarget(e),l.render(p,Cr)}}function Wu(i){const t=[],e=[],n=[];let r=i;const s=i-Hn+1+ha.length;for(let a=0;ai-Hn?l=ha[a-i+Hn-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,p=1+c,f=[h,h,p,h,p,p,h,h,p,p,h,p],m=6,v=6,S=3,d=2,u=1,y=new Float32Array(S*v*m),M=new Float32Array(d*v*m),T=new Float32Array(u*v*m);for(let b=0;b2?0:-1,E=[w,O,0,w+2/3,O,0,w+2/3,O+1,0,w,O,0,w+2/3,O+1,0,w,O+1,0];y.set(E,S*v*b),M.set(f,d*v*b);const _=[b,b,b,b,b,b];T.set(_,u*v*b)}const U=new qe;U.setAttribute("position",new Te(y,S)),U.setAttribute("uv",new Te(M,d)),U.setAttribute("faceIndex",new Te(T,u)),t.push(U),r>Hn&&r--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function pa(i,t,e){const n=new En(i,t,e);return n.texture.mapping=Xi,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Fi(i,t,e,n,r){i.viewport.set(t,e,n,r),i.scissor.set(t,e,n,r)}function Xu(i,t,e){const n=new Float32Array(xn),r=new L(0,1,0);return new on({name:"SphericalGaussianBlur",defines:{n:xn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Qr(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:nn,depthTest:!1,depthWrite:!1})}function ma(){return new on({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Qr(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:nn,depthTest:!1,depthWrite:!1})}function _a(){return new on({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Qr(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:nn,depthTest:!1,depthWrite:!1})}function Qr(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function qu(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Hr||l===Vr,h=l===Wn||l===Xn;if(c||h){let p=t.get(o);const f=p!==void 0?p.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new fa(i)),p=c?e.fromEquirectangular(o,p):e.fromCubemap(o,p),p.texture.pmremVersion=o.pmremVersion,t.set(o,p),p.texture;if(p!==void 0)return p.texture;{const m=o.image;return c&&m&&m.height>0||h&&m&&r(m)?(e===null&&(e=new fa(i)),p=c?e.fromEquirectangular(o):e.fromCubemap(o),p.texture.pmremVersion=o.pmremVersion,t.set(o,p),o.addEventListener("dispose",s),p.texture):null}}}return o}function r(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(U=Math.ceil(T/t.maxTextureSize),T=t.maxTextureSize);const b=new Float32Array(T*U*4*p),w=new ja(b,T,U,p);w.type=en,w.needsUpdate=!0;const O=M*4;for(let _=0;_0)return i;const r=t*e;let s=ga[r];if(s===void 0&&(s=new Float32Array(r),ga[r]=s),t!==0){n.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(s,o)}return s}function ne(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}function qd(i){const t=Gt.getPrimaries(Gt.workingColorSpace),e=Gt.getPrimaries(i);let n;switch(t===e?n="":t===Gi&&e===Vi?n="LinearDisplayP3ToLinearSRGB":t===Vi&&e===Gi&&(n="LinearSRGBToLinearDisplayP3"),i){case ln:case Yi:return[n,"LinearTransferOETF"];case Pe:case jr:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",i),[n,"LinearTransferOETF"]}}function Ta(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),r=i.getShaderInfoLog(t).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const a=parseInt(s[1]);return e.toUpperCase()+` + +`+r+` + +`+Xd(i.getShaderSource(t),a)}else return r}function Yd(i,t){const e=qd(t);return`vec4 ${i}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function Kd(i,t){let e;switch(t){case tl:e="Linear";break;case el:e="Reinhard";break;case nl:e="OptimizedCineon";break;case il:e="ACESFilmic";break;case sl:e="AgX";break;case al:e="Neutral";break;case rl:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function $d(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(ai).join(` +`)}function jd(i){const t=[];for(const e in i){const n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function Zd(i,t){const e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function Xr(i){return i.replace(Jd,tf)}const Qd=new Map;function tf(i,t){let e=yt[t];if(e===void 0){const n=Qd.get(t);if(n!==void 0)e=yt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Xr(e)}const ef=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function wa(i){return i.replace(ef,nf)}function nf(i,t,e,n){let r="";for(let s=parseInt(t);s0&&(d+=` +`),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v].filter(ai).join(` +`),u.length>0&&(u+=` +`)):(d=[Ra(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(ai).join(` +`),u=[Ra(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+p:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==rn?"#define TONE_MAPPING":"",e.toneMapping!==rn?yt.tonemapping_pars_fragment:"",e.toneMapping!==rn?Kd("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",yt.colorspace_pars_fragment,Yd("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(ai).join(` +`)),a=Xr(a),a=Aa(a,e),a=ba(a,e),o=Xr(o),o=Aa(o,e),o=ba(o,e),a=wa(a),o=wa(o),e.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,d=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+d,u=["#define varying in",e.glslVersion===Ws?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Ws?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+u);const M=y+d+a,T=y+u+o,U=ya(r,r.VERTEX_SHADER,M),b=ya(r,r.FRAGMENT_SHADER,T);r.attachShader(S,U),r.attachShader(S,b),e.index0AttributeName!==void 0?r.bindAttribLocation(S,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function w(F){if(i.debug.checkShaderErrors){const k=r.getProgramInfoLog(S).trim(),C=r.getShaderInfoLog(U).trim(),G=r.getShaderInfoLog(b).trim();let q=!0,j=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(q=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,S,U,b);else{const st=Ta(r,U,"vertex"),H=Ta(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` + +Material Name: `+F.name+` +Material Type: `+F.type+` + +Program Info Log: `+k+` +`+st+` +`+H)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(C===""||G==="")&&(j=!1);j&&(F.diagnostics={runnable:q,programLog:k,vertexShader:{log:C,prefix:d},fragmentShader:{log:G,prefix:u}})}r.deleteShader(U),r.deleteShader(b),O=new Bi(r,S),E=Zd(r,S)}let O;this.getUniforms=function(){return O===void 0&&w(this),O};let E;this.getAttributes=function(){return E===void 0&&w(this),E};let _=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return _===!1&&(_=r.getProgramParameter(S,kd)),_},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Wd++,this.cacheKey=t,this.usedTimes=1,this.program=S,this.vertexShader=U,this.fragmentShader=b,this}let hf=0;class uf{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new df(t),e.set(t,n)),n}}class df{constructor(t){this.id=hf++,this.code=t,this.usedTimes=0}}function ff(i,t,e,n,r,s,a){const o=new Za,l=new uf,c=new Set,h=[],p=r.logarithmicDepthBuffer,f=r.vertexTextures;let m=r.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function S(E){return c.add(E),E===0?"uv":`uv${E}`}function d(E,_,F,k,C){const G=k.fog,q=C.geometry,j=E.isMeshStandardMaterial?k.environment:null,st=(E.isMeshStandardMaterial?e:t).get(E.envMap||j),H=st&&st.mapping===Xi?st.image.height:null,J=v[E.type];E.precision!==null&&(m=r.getMaxPrecision(E.precision),m!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",m,"instead."));const Z=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,ft=Z!==void 0?Z.length:0;let Lt=0;q.morphAttributes.position!==void 0&&(Lt=1),q.morphAttributes.normal!==void 0&&(Lt=2),q.morphAttributes.color!==void 0&&(Lt=3);let kt,V,Q,ht;if(J){const Vt=Le[J];kt=Vt.vertexShader,V=Vt.fragmentShader}else kt=E.vertexShader,V=E.fragmentShader,l.update(E),Q=l.getVertexShaderID(E),ht=l.getFragmentShaderID(E);const nt=i.getRenderTarget(),Dt=C.isInstancedMesh===!0,Ut=C.isBatchedMesh===!0,D=!!E.map,Xt=!!E.matcap,_t=!!st,Wt=!!E.aoMap,xt=!!E.lightMap,Nt=!!E.bumpMap,Rt=!!E.normalMap,Ft=!!E.displacementMap,jt=!!E.emissiveMap,A=!!E.metalnessMap,g=!!E.roughnessMap,z=E.anisotropy>0,X=E.clearcoat>0,K=E.dispersion>0,$=E.iridescence>0,mt=E.sheen>0,ot=E.transmission>0,at=z&&!!E.anisotropyMap,At=X&&!!E.clearcoatMap,tt=X&&!!E.clearcoatNormalMap,pt=X&&!!E.clearcoatRoughnessMap,Ot=$&&!!E.iridescenceMap,gt=$&&!!E.iridescenceThicknessMap,ct=mt&&!!E.sheenColorMap,bt=mt&&!!E.sheenRoughnessMap,It=!!E.specularMap,Qt=!!E.specularColorMap,wt=!!E.specularIntensityMap,R=ot&&!!E.transmissionMap,Y=ot&&!!E.thicknessMap,W=!!E.gradientMap,it=!!E.alphaMap,lt=E.alphaTest>0,Bt=!!E.alphaHash,qt=!!E.extensions;let Zt=rn;E.toneMapped&&(nt===null||nt.isXRRenderTarget===!0)&&(Zt=i.toneMapping);const se={shaderID:J,shaderType:E.type,shaderName:E.name,vertexShader:kt,fragmentShader:V,defines:E.defines,customVertexShaderID:Q,customFragmentShaderID:ht,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:m,batching:Ut,instancing:Dt,instancingColor:Dt&&C.instanceColor!==null,instancingMorph:Dt&&C.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:nt===null?i.outputColorSpace:nt.isXRRenderTarget===!0?nt.texture.colorSpace:ln,alphaToCoverage:!!E.alphaToCoverage,map:D,matcap:Xt,envMap:_t,envMapMode:_t&&st.mapping,envMapCubeUVHeight:H,aoMap:Wt,lightMap:xt,bumpMap:Nt,normalMap:Rt,displacementMap:f&&Ft,emissiveMap:jt,normalMapObjectSpace:Rt&&E.normalMapType===Ml,normalMapTangentSpace:Rt&&E.normalMapType===$r,metalnessMap:A,roughnessMap:g,anisotropy:z,anisotropyMap:at,clearcoat:X,clearcoatMap:At,clearcoatNormalMap:tt,clearcoatRoughnessMap:pt,dispersion:K,iridescence:$,iridescenceMap:Ot,iridescenceThicknessMap:gt,sheen:mt,sheenColorMap:ct,sheenRoughnessMap:bt,specularMap:It,specularColorMap:Qt,specularIntensityMap:wt,transmission:ot,transmissionMap:R,thicknessMap:Y,gradientMap:W,opaque:E.transparent===!1&&E.blending===Vn&&E.alphaToCoverage===!1,alphaMap:it,alphaTest:lt,alphaHash:Bt,combine:E.combine,mapUv:D&&S(E.map.channel),aoMapUv:Wt&&S(E.aoMap.channel),lightMapUv:xt&&S(E.lightMap.channel),bumpMapUv:Nt&&S(E.bumpMap.channel),normalMapUv:Rt&&S(E.normalMap.channel),displacementMapUv:Ft&&S(E.displacementMap.channel),emissiveMapUv:jt&&S(E.emissiveMap.channel),metalnessMapUv:A&&S(E.metalnessMap.channel),roughnessMapUv:g&&S(E.roughnessMap.channel),anisotropyMapUv:at&&S(E.anisotropyMap.channel),clearcoatMapUv:At&&S(E.clearcoatMap.channel),clearcoatNormalMapUv:tt&&S(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&S(E.clearcoatRoughnessMap.channel),iridescenceMapUv:Ot&&S(E.iridescenceMap.channel),iridescenceThicknessMapUv:gt&&S(E.iridescenceThicknessMap.channel),sheenColorMapUv:ct&&S(E.sheenColorMap.channel),sheenRoughnessMapUv:bt&&S(E.sheenRoughnessMap.channel),specularMapUv:It&&S(E.specularMap.channel),specularColorMapUv:Qt&&S(E.specularColorMap.channel),specularIntensityMapUv:wt&&S(E.specularIntensityMap.channel),transmissionMapUv:R&&S(E.transmissionMap.channel),thicknessMapUv:Y&&S(E.thicknessMap.channel),alphaMapUv:it&&S(E.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(Rt||z),vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:C.isPoints===!0&&!!q.attributes.uv&&(D||it),fog:!!G,useFog:E.fog===!0,fogExp2:!!G&&G.isFogExp2,flatShading:E.flatShading===!0,sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:C.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:ft,morphTextureStride:Lt,numDirLights:_.directional.length,numPointLights:_.point.length,numSpotLights:_.spot.length,numSpotLightMaps:_.spotLightMap.length,numRectAreaLights:_.rectArea.length,numHemiLights:_.hemi.length,numDirLightShadows:_.directionalShadowMap.length,numPointLightShadows:_.pointShadowMap.length,numSpotLightShadows:_.spotShadowMap.length,numSpotLightShadowsWithMaps:_.numSpotLightShadowsWithMaps,numLightProbes:_.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:E.dithering,shadowMapEnabled:i.shadowMap.enabled&&F.length>0,shadowMapType:i.shadowMap.type,toneMapping:Zt,useLegacyLights:i._useLegacyLights,decodeVideoTexture:D&&E.map.isVideoTexture===!0&&Gt.getTransfer(E.map.colorSpace)===Yt,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===We,flipSided:E.side===pe,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:qt&&E.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:qt&&E.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return se.vertexUv1s=c.has(1),se.vertexUv2s=c.has(2),se.vertexUv3s=c.has(3),c.clear(),se}function u(E){const _=[];if(E.shaderID?_.push(E.shaderID):(_.push(E.customVertexShaderID),_.push(E.customFragmentShaderID)),E.defines!==void 0)for(const F in E.defines)_.push(F),_.push(E.defines[F]);return E.isRawShaderMaterial===!1&&(y(_,E),M(_,E),_.push(i.outputColorSpace)),_.push(E.customProgramCacheKey),_.join()}function y(E,_){E.push(_.precision),E.push(_.outputColorSpace),E.push(_.envMapMode),E.push(_.envMapCubeUVHeight),E.push(_.mapUv),E.push(_.alphaMapUv),E.push(_.lightMapUv),E.push(_.aoMapUv),E.push(_.bumpMapUv),E.push(_.normalMapUv),E.push(_.displacementMapUv),E.push(_.emissiveMapUv),E.push(_.metalnessMapUv),E.push(_.roughnessMapUv),E.push(_.anisotropyMapUv),E.push(_.clearcoatMapUv),E.push(_.clearcoatNormalMapUv),E.push(_.clearcoatRoughnessMapUv),E.push(_.iridescenceMapUv),E.push(_.iridescenceThicknessMapUv),E.push(_.sheenColorMapUv),E.push(_.sheenRoughnessMapUv),E.push(_.specularMapUv),E.push(_.specularColorMapUv),E.push(_.specularIntensityMapUv),E.push(_.transmissionMapUv),E.push(_.thicknessMapUv),E.push(_.combine),E.push(_.fogExp2),E.push(_.sizeAttenuation),E.push(_.morphTargetsCount),E.push(_.morphAttributeCount),E.push(_.numDirLights),E.push(_.numPointLights),E.push(_.numSpotLights),E.push(_.numSpotLightMaps),E.push(_.numHemiLights),E.push(_.numRectAreaLights),E.push(_.numDirLightShadows),E.push(_.numPointLightShadows),E.push(_.numSpotLightShadows),E.push(_.numSpotLightShadowsWithMaps),E.push(_.numLightProbes),E.push(_.shadowMapType),E.push(_.toneMapping),E.push(_.numClippingPlanes),E.push(_.numClipIntersection),E.push(_.depthPacking)}function M(E,_){o.disableAll(),_.supportsVertexTextures&&o.enable(0),_.instancing&&o.enable(1),_.instancingColor&&o.enable(2),_.instancingMorph&&o.enable(3),_.matcap&&o.enable(4),_.envMap&&o.enable(5),_.normalMapObjectSpace&&o.enable(6),_.normalMapTangentSpace&&o.enable(7),_.clearcoat&&o.enable(8),_.iridescence&&o.enable(9),_.alphaTest&&o.enable(10),_.vertexColors&&o.enable(11),_.vertexAlphas&&o.enable(12),_.vertexUv1s&&o.enable(13),_.vertexUv2s&&o.enable(14),_.vertexUv3s&&o.enable(15),_.vertexTangents&&o.enable(16),_.anisotropy&&o.enable(17),_.alphaHash&&o.enable(18),_.batching&&o.enable(19),_.dispersion&&o.enable(20),E.push(o.mask),o.disableAll(),_.fog&&o.enable(0),_.useFog&&o.enable(1),_.flatShading&&o.enable(2),_.logarithmicDepthBuffer&&o.enable(3),_.skinning&&o.enable(4),_.morphTargets&&o.enable(5),_.morphNormals&&o.enable(6),_.morphColors&&o.enable(7),_.premultipliedAlpha&&o.enable(8),_.shadowMapEnabled&&o.enable(9),_.useLegacyLights&&o.enable(10),_.doubleSided&&o.enable(11),_.flipSided&&o.enable(12),_.useDepthPacking&&o.enable(13),_.dithering&&o.enable(14),_.transmission&&o.enable(15),_.sheen&&o.enable(16),_.opaque&&o.enable(17),_.pointsUvs&&o.enable(18),_.decodeVideoTexture&&o.enable(19),_.alphaToCoverage&&o.enable(20),E.push(o.mask)}function T(E){const _=v[E.type];let F;if(_){const k=Le[_];F=$l.clone(k.uniforms)}else F=E.uniforms;return F}function U(E,_){let F;for(let k=0,C=h.length;k0?n.push(u):m.transparent===!0?r.push(u):e.push(u)}function l(p,f,m,v,S,d){const u=a(p,f,m,v,S,d);m.transmission>0?n.unshift(u):m.transparent===!0?r.unshift(u):e.unshift(u)}function c(p,f){e.length>1&&e.sort(p||mf),n.length>1&&n.sort(f||Ca),r.length>1&&r.sort(f||Ca)}function h(){for(let p=t,f=i.length;p=s.length?(a=new Pa,s.push(a)):a=s[r],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function gf(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new L,color:new zt};break;case"SpotLight":e={position:new L,direction:new L,color:new zt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new L,color:new zt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new L,skyColor:new zt,groundColor:new zt};break;case"RectAreaLight":e={color:new zt,position:new L,halfWidth:new L,halfHeight:new L};break}return i[t.id]=e,e}}}function vf(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let xf=0;function Mf(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Sf(i){const t=new gf,e=vf(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new L);const r=new L,s=new Jt,a=new Jt;function o(c,h){let p=0,f=0,m=0;for(let F=0;F<9;F++)n.probe[F].set(0,0,0);let v=0,S=0,d=0,u=0,y=0,M=0,T=0,U=0,b=0,w=0,O=0;c.sort(Mf);const E=h===!0?Math.PI:1;for(let F=0,k=c.length;F0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=et.LTC_FLOAT_1,n.rectAreaLTC2=et.LTC_FLOAT_2):(n.rectAreaLTC1=et.LTC_HALF_1,n.rectAreaLTC2=et.LTC_HALF_2)),n.ambient[0]=p,n.ambient[1]=f,n.ambient[2]=m;const _=n.hash;(_.directionalLength!==v||_.pointLength!==S||_.spotLength!==d||_.rectAreaLength!==u||_.hemiLength!==y||_.numDirectionalShadows!==M||_.numPointShadows!==T||_.numSpotShadows!==U||_.numSpotMaps!==b||_.numLightProbes!==O)&&(n.directional.length=v,n.spot.length=d,n.rectArea.length=u,n.point.length=S,n.hemi.length=y,n.directionalShadow.length=M,n.directionalShadowMap.length=M,n.pointShadow.length=T,n.pointShadowMap.length=T,n.spotShadow.length=U,n.spotShadowMap.length=U,n.directionalShadowMatrix.length=M,n.pointShadowMatrix.length=T,n.spotLightMatrix.length=U+b-w,n.spotLightMap.length=b,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=O,_.directionalLength=v,_.pointLength=S,_.spotLength=d,_.rectAreaLength=u,_.hemiLength=y,_.numDirectionalShadows=M,_.numPointShadows=T,_.numSpotShadows=U,_.numSpotMaps=b,_.numLightProbes=O,n.version=xf++)}function l(c,h){let p=0,f=0,m=0,v=0,S=0;const d=h.matrixWorldInverse;for(let u=0,y=c.length;u=a.length?(o=new La(i),a.push(o)):o=a[s],o}function n(){t=new WeakMap}return{get:e,dispose:n}}class yf extends $n{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=vl,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Tf extends $n{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const Af=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,bf=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function wf(i,t,e){let n=new Jr;const r=new Pt,s=new Pt,a=new $t,o=new yf({depthPacking:xl}),l=new Tf,c={},h=e.maxTextureSize,p={[sn]:pe,[pe]:sn,[We]:We},f=new on({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Pt},radius:{value:4}},vertexShader:Af,fragmentShader:bf}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const v=new qe;v.setAttribute("position",new Te(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new Ie(v,f),d=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ba;let u=this.type;this.render=function(b,w,O){if(d.enabled===!1||d.autoUpdate===!1&&d.needsUpdate===!1||b.length===0)return;const E=i.getRenderTarget(),_=i.getActiveCubeFace(),F=i.getActiveMipmapLevel(),k=i.state;k.setBlending(nn),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);const C=u!==ke&&this.type===ke,G=u===ke&&this.type!==ke;for(let q=0,j=b.length;qh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/J.x),r.x=s.x*J.x,H.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/J.y),r.y=s.y*J.y,H.mapSize.y=s.y)),H.map===null||C===!0||G===!0){const ft=this.type!==ke?{minFilter:ye,magFilter:ye}:{};H.map!==null&&H.map.dispose(),H.map=new En(r.x,r.y,ft),H.map.texture.name=st.name+".shadowMap",H.camera.updateProjectionMatrix()}i.setRenderTarget(H.map),i.clear();const Z=H.getViewportCount();for(let ft=0;ft0||w.map&&w.alphaTest>0){const k=_.uuid,C=w.uuid;let G=c[k];G===void 0&&(G={},c[k]=G);let q=G[C];q===void 0&&(q=_.clone(),G[C]=q,w.addEventListener("dispose",U)),_=q}if(_.visible=w.visible,_.wireframe=w.wireframe,E===ke?_.side=w.shadowSide!==null?w.shadowSide:w.side:_.side=w.shadowSide!==null?w.shadowSide:p[w.side],_.alphaMap=w.alphaMap,_.alphaTest=w.alphaTest,_.map=w.map,_.clipShadows=w.clipShadows,_.clippingPlanes=w.clippingPlanes,_.clipIntersection=w.clipIntersection,_.displacementMap=w.displacementMap,_.displacementScale=w.displacementScale,_.displacementBias=w.displacementBias,_.wireframeLinewidth=w.wireframeLinewidth,_.linewidth=w.linewidth,O.isPointLight===!0&&_.isMeshDistanceMaterial===!0){const k=i.properties.get(_);k.light=O}return _}function T(b,w,O,E,_){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&_===ke)&&(!b.frustumCulled||n.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,b.matrixWorld);const C=t.update(b),G=b.material;if(Array.isArray(G)){const q=C.groups;for(let j=0,st=q.length;j=1):st.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(st)[1]),q=j>=2);let H=null,J={};const Z=i.getParameter(i.SCISSOR_BOX),ft=i.getParameter(i.VIEWPORT),Lt=new $t().fromArray(Z),kt=new $t().fromArray(ft);function V(R,Y,W,it){const lt=new Uint8Array(4),Bt=i.createTexture();i.bindTexture(R,Bt),i.texParameteri(R,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(R,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let qt=0;qt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Pt,h=new WeakMap;let p;const f=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(A,g){return m?new OffscreenCanvas(A,g):Wi("canvas")}function S(A,g,z){let X=1;const K=jt(A);if((K.width>z||K.height>z)&&(X=z/Math.max(K.width,K.height)),X<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const $=Math.floor(X*K.width),mt=Math.floor(X*K.height);p===void 0&&(p=v($,mt));const ot=g?v($,mt):p;return ot.width=$,ot.height=mt,ot.getContext("2d").drawImage(A,0,0,$,mt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+$+"x"+mt+")."),ot}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),A;return A}function d(A){return A.generateMipmaps&&A.minFilter!==ye&&A.minFilter!==Re}function u(A){i.generateMipmap(A)}function y(A,g,z,X,K=!1){if(A!==null){if(i[A]!==void 0)return i[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let $=g;if(g===i.RED&&(z===i.FLOAT&&($=i.R32F),z===i.HALF_FLOAT&&($=i.R16F),z===i.UNSIGNED_BYTE&&($=i.R8)),g===i.RED_INTEGER&&(z===i.UNSIGNED_BYTE&&($=i.R8UI),z===i.UNSIGNED_SHORT&&($=i.R16UI),z===i.UNSIGNED_INT&&($=i.R32UI),z===i.BYTE&&($=i.R8I),z===i.SHORT&&($=i.R16I),z===i.INT&&($=i.R32I)),g===i.RG&&(z===i.FLOAT&&($=i.RG32F),z===i.HALF_FLOAT&&($=i.RG16F),z===i.UNSIGNED_BYTE&&($=i.RG8)),g===i.RG_INTEGER&&(z===i.UNSIGNED_BYTE&&($=i.RG8UI),z===i.UNSIGNED_SHORT&&($=i.RG16UI),z===i.UNSIGNED_INT&&($=i.RG32UI),z===i.BYTE&&($=i.RG8I),z===i.SHORT&&($=i.RG16I),z===i.INT&&($=i.RG32I)),g===i.RGB&&z===i.UNSIGNED_INT_5_9_9_9_REV&&($=i.RGB9_E5),g===i.RGBA){const mt=K?Hi:Gt.getTransfer(X);z===i.FLOAT&&($=i.RGBA32F),z===i.HALF_FLOAT&&($=i.RGBA16F),z===i.UNSIGNED_BYTE&&($=mt===Yt?i.SRGB8_ALPHA8:i.RGBA8),z===i.UNSIGNED_SHORT_4_4_4_4&&($=i.RGBA4),z===i.UNSIGNED_SHORT_5_5_5_1&&($=i.RGB5_A1)}return($===i.R16F||$===i.R32F||$===i.RG16F||$===i.RG32F||$===i.RGBA16F||$===i.RGBA32F)&&t.get("EXT_color_buffer_float"),$}function M(A,g){return d(A)===!0||A.isFramebufferTexture&&A.minFilter!==ye&&A.minFilter!==Re?Math.log2(Math.max(g.width,g.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?g.mipmaps.length:1}function T(A){const g=A.target;g.removeEventListener("dispose",T),b(g),g.isVideoTexture&&h.delete(g)}function U(A){const g=A.target;g.removeEventListener("dispose",U),O(g)}function b(A){const g=n.get(A);if(g.__webglInit===void 0)return;const z=A.source,X=f.get(z);if(X){const K=X[g.__cacheKey];K.usedTimes--,K.usedTimes===0&&w(A),Object.keys(X).length===0&&f.delete(z)}n.remove(A)}function w(A){const g=n.get(A);i.deleteTexture(g.__webglTexture);const z=A.source,X=f.get(z);delete X[g.__cacheKey],a.memory.textures--}function O(A){const g=n.get(A);if(A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(g.__webglFramebuffer[X]))for(let K=0;K=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+r.maxTextures),E+=1,A}function k(A){const g=[];return g.push(A.wrapS),g.push(A.wrapT),g.push(A.wrapR||0),g.push(A.magFilter),g.push(A.minFilter),g.push(A.anisotropy),g.push(A.internalFormat),g.push(A.format),g.push(A.type),g.push(A.generateMipmaps),g.push(A.premultiplyAlpha),g.push(A.flipY),g.push(A.unpackAlignment),g.push(A.colorSpace),g.join()}function C(A,g){const z=n.get(A);if(A.isVideoTexture&&Rt(A),A.isRenderTargetTexture===!1&&A.version>0&&z.__version!==A.version){const X=A.image;if(X===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Lt(z,A,g);return}}e.bindTexture(i.TEXTURE_2D,z.__webglTexture,i.TEXTURE0+g)}function G(A,g){const z=n.get(A);if(A.version>0&&z.__version!==A.version){Lt(z,A,g);return}e.bindTexture(i.TEXTURE_2D_ARRAY,z.__webglTexture,i.TEXTURE0+g)}function q(A,g){const z=n.get(A);if(A.version>0&&z.__version!==A.version){Lt(z,A,g);return}e.bindTexture(i.TEXTURE_3D,z.__webglTexture,i.TEXTURE0+g)}function j(A,g){const z=n.get(A);if(A.version>0&&z.__version!==A.version){kt(z,A,g);return}e.bindTexture(i.TEXTURE_CUBE_MAP,z.__webglTexture,i.TEXTURE0+g)}const st={[Gr]:i.REPEAT,[Mn]:i.CLAMP_TO_EDGE,[kr]:i.MIRRORED_REPEAT},H={[ye]:i.NEAREST,[ol]:i.NEAREST_MIPMAP_NEAREST,[mi]:i.NEAREST_MIPMAP_LINEAR,[Re]:i.LINEAR,[ir]:i.LINEAR_MIPMAP_NEAREST,[Sn]:i.LINEAR_MIPMAP_LINEAR},J={[Sl]:i.NEVER,[wl]:i.ALWAYS,[El]:i.LESS,[Ya]:i.LEQUAL,[yl]:i.EQUAL,[bl]:i.GEQUAL,[Tl]:i.GREATER,[Al]:i.NOTEQUAL};function Z(A,g){if(g.type===en&&t.has("OES_texture_float_linear")===!1&&(g.magFilter===Re||g.magFilter===ir||g.magFilter===mi||g.magFilter===Sn||g.minFilter===Re||g.minFilter===ir||g.minFilter===mi||g.minFilter===Sn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(A,i.TEXTURE_WRAP_S,st[g.wrapS]),i.texParameteri(A,i.TEXTURE_WRAP_T,st[g.wrapT]),(A===i.TEXTURE_3D||A===i.TEXTURE_2D_ARRAY)&&i.texParameteri(A,i.TEXTURE_WRAP_R,st[g.wrapR]),i.texParameteri(A,i.TEXTURE_MAG_FILTER,H[g.magFilter]),i.texParameteri(A,i.TEXTURE_MIN_FILTER,H[g.minFilter]),g.compareFunction&&(i.texParameteri(A,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(A,i.TEXTURE_COMPARE_FUNC,J[g.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(g.magFilter===ye||g.minFilter!==mi&&g.minFilter!==Sn||g.type===en&&t.has("OES_texture_float_linear")===!1)return;if(g.anisotropy>1||n.get(g).__currentAnisotropy){const z=t.get("EXT_texture_filter_anisotropic");i.texParameterf(A,z.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,r.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy}}}function ft(A,g){let z=!1;A.__webglInit===void 0&&(A.__webglInit=!0,g.addEventListener("dispose",T));const X=g.source;let K=f.get(X);K===void 0&&(K={},f.set(X,K));const $=k(g);if($!==A.__cacheKey){K[$]===void 0&&(K[$]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,z=!0),K[$].usedTimes++;const mt=K[A.__cacheKey];mt!==void 0&&(K[A.__cacheKey].usedTimes--,mt.usedTimes===0&&w(g)),A.__cacheKey=$,A.__webglTexture=K[$].texture}return z}function Lt(A,g,z){let X=i.TEXTURE_2D;(g.isDataArrayTexture||g.isCompressedArrayTexture)&&(X=i.TEXTURE_2D_ARRAY),g.isData3DTexture&&(X=i.TEXTURE_3D);const K=ft(A,g),$=g.source;e.bindTexture(X,A.__webglTexture,i.TEXTURE0+z);const mt=n.get($);if($.version!==mt.__version||K===!0){e.activeTexture(i.TEXTURE0+z);const ot=Gt.getPrimaries(Gt.workingColorSpace),at=g.colorSpace===tn?null:Gt.getPrimaries(g.colorSpace),At=g.colorSpace===tn||ot===at?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,g.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,g.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,At);let tt=S(g.image,!1,r.maxTextureSize);tt=Ft(g,tt);const pt=s.convert(g.format,g.colorSpace),Ot=s.convert(g.type);let gt=y(g.internalFormat,pt,Ot,g.colorSpace,g.isVideoTexture);Z(X,g);let ct;const bt=g.mipmaps,It=g.isVideoTexture!==!0,Qt=mt.__version===void 0||K===!0,wt=$.dataReady,R=M(g,tt);if(g.isDepthTexture)gt=i.DEPTH_COMPONENT16,g.type===en?gt=i.DEPTH_COMPONENT32F:g.type===qn?gt=i.DEPTH_COMPONENT24:g.type===ci&&(gt=i.DEPTH24_STENCIL8),Qt&&(It?e.texStorage2D(i.TEXTURE_2D,1,gt,tt.width,tt.height):e.texImage2D(i.TEXTURE_2D,0,gt,tt.width,tt.height,0,pt,Ot,null));else if(g.isDataTexture)if(bt.length>0){It&&Qt&&e.texStorage2D(i.TEXTURE_2D,R,gt,bt[0].width,bt[0].height);for(let Y=0,W=bt.length;Y>=1,W>>=1}}else if(bt.length>0){if(It&&Qt){const Y=jt(bt[0]);e.texStorage2D(i.TEXTURE_2D,R,gt,Y.width,Y.height)}for(let Y=0,W=bt.length;Y0&&R++;const W=jt(pt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,R,bt,W.width,W.height)}for(let W=0;W<6;W++)if(tt){It?wt&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+W,0,0,0,pt[W].width,pt[W].height,gt,ct,pt[W].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+W,0,bt,pt[W].width,pt[W].height,0,gt,ct,pt[W].data);for(let it=0;it>$),pt=Math.max(1,g.height>>$);K===i.TEXTURE_3D||K===i.TEXTURE_2D_ARRAY?e.texImage3D(K,$,at,tt,pt,g.depth,0,mt,ot,null):e.texImage2D(K,$,at,tt,pt,0,mt,ot,null)}e.bindFramebuffer(i.FRAMEBUFFER,A),Nt(g)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,X,K,n.get(z).__webglTexture,0,xt(g)):(K===i.TEXTURE_2D||K>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,X,K,n.get(z).__webglTexture,$),e.bindFramebuffer(i.FRAMEBUFFER,null)}function Q(A,g,z){if(i.bindRenderbuffer(i.RENDERBUFFER,A),g.depthBuffer&&!g.stencilBuffer){let X=i.DEPTH_COMPONENT24;if(z||Nt(g)){const K=g.depthTexture;K&&K.isDepthTexture&&(K.type===en?X=i.DEPTH_COMPONENT32F:K.type===qn&&(X=i.DEPTH_COMPONENT24));const $=xt(g);Nt(g)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,$,X,g.width,g.height):i.renderbufferStorageMultisample(i.RENDERBUFFER,$,X,g.width,g.height)}else i.renderbufferStorage(i.RENDERBUFFER,X,g.width,g.height);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,A)}else if(g.depthBuffer&&g.stencilBuffer){const X=xt(g);z&&Nt(g)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,X,i.DEPTH24_STENCIL8,g.width,g.height):Nt(g)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,X,i.DEPTH24_STENCIL8,g.width,g.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,g.width,g.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,A)}else{const X=g.textures;for(let K=0;K1;if(mt||(X.__webglTexture===void 0&&(X.__webglTexture=i.createTexture()),X.__version=g.version,a.memory.textures++),$){z.__webglFramebuffer=[];for(let ot=0;ot<6;ot++)if(g.mipmaps&&g.mipmaps.length>0){z.__webglFramebuffer[ot]=[];for(let at=0;at0){z.__webglFramebuffer=[];for(let ot=0;ot0&&Nt(A)===!1){z.__webglMultisampledFramebuffer=i.createFramebuffer(),z.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let ot=0;ot0)for(let at=0;at0)for(let at=0;at0){if(Nt(A)===!1){const g=A.textures,z=A.width,X=A.height;let K=i.COLOR_BUFFER_BIT;const $=A.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,mt=n.get(A),ot=g.length>1;if(ot)for(let at=0;at0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function Rt(A){const g=a.render.frame;h.get(A)!==g&&(h.set(A,g),A.update())}function Ft(A,g){const z=A.colorSpace,X=A.format,K=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||z!==ln&&z!==tn&&(Gt.getTransfer(z)===Yt?(X!==Ue||K!==an)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",z)),g}function jt(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=_,this.setTexture2D=C,this.setTexture2DArray=G,this.setTexture3D=q,this.setTextureCube=j,this.rebindTextures=Dt,this.setupRenderTarget=Ut,this.updateRenderTargetMipmap=D,this.updateMultisampleRenderTarget=Wt,this.setupDepthRenderbuffer=nt,this.setupFrameBufferTexture=V,this.useMultisampledRTT=Nt}function Pf(i,t){function e(n,r=tn){let s;const a=Gt.getTransfer(r);if(n===an)return i.UNSIGNED_BYTE;if(n===Ga)return i.UNSIGNED_SHORT_4_4_4_4;if(n===ka)return i.UNSIGNED_SHORT_5_5_5_1;if(n===hl)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===ll)return i.BYTE;if(n===cl)return i.SHORT;if(n===Ha)return i.UNSIGNED_SHORT;if(n===Va)return i.INT;if(n===qn)return i.UNSIGNED_INT;if(n===en)return i.FLOAT;if(n===qi)return i.HALF_FLOAT;if(n===ul)return i.ALPHA;if(n===dl)return i.RGB;if(n===Ue)return i.RGBA;if(n===fl)return i.LUMINANCE;if(n===pl)return i.LUMINANCE_ALPHA;if(n===Gn)return i.DEPTH_COMPONENT;if(n===oi)return i.DEPTH_STENCIL;if(n===ml)return i.RED;if(n===Wa)return i.RED_INTEGER;if(n===_l)return i.RG;if(n===Xa)return i.RG_INTEGER;if(n===qa)return i.RGBA_INTEGER;if(n===rr||n===sr||n===ar||n===or)if(a===Yt)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===rr)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===sr)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===ar)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===or)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===rr)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===sr)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ar)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===or)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===_s||n===gs||n===vs||n===xs)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===_s)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===gs)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===vs)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===xs)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ms||n===Ss||n===Es)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Ms||n===Ss)return a===Yt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Es)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ys||n===Ts||n===As||n===bs||n===ws||n===Rs||n===Cs||n===Ps||n===Ls||n===Ds||n===Us||n===Is||n===Ns||n===Fs)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===ys)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ts)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===As)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===bs)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ws)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Rs)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Cs)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ps)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ls)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ds)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Us)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Is)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ns)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Fs)return a===Yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===lr||n===Os||n===Bs)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===lr)return a===Yt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Os)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Bs)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===gl||n===zs||n===Hs||n===Vs)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===lr)return s.COMPRESSED_RED_RGTC1_EXT;if(n===zs)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Hs)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Vs)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ci?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}class Lf extends Me{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Oi extends _e{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Df={type:"move"};class Nr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Oi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Oi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Oi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const S of t.hand.values()){const d=e.getJointPose(S,n),u=this._getHandJoint(c,S);d!==null&&(u.matrix.fromArray(d.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=d.radius),u.visible=d!==null}const h=c.joints["index-finger-tip"],p=c.joints["thumb-tip"],f=h.position.distanceTo(p.position),m=.02,v=.005;c.inputState.pinching&&f>m+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=m-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=e.getPose(t.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Df)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Oi;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const Uf=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,If=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class Nf{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const r=new me,s=t.properties.get(r);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}render(t,e){if(this.texture!==null){if(this.mesh===null){const n=e.cameras[0].viewport,r=new on({vertexShader:Uf,fragmentShader:If,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Ie(new Ki(20,20),r)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}}class Ff extends Kn{constructor(t,e){super();const n=this;let r=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,p=null,f=null,m=null,v=null;const S=new Nf,d=e.getContextAttributes();let u=null,y=null;const M=[],T=[],U=new Pt;let b=null;const w=new Me;w.layers.enable(1),w.viewport=new $t;const O=new Me;O.layers.enable(2),O.viewport=new $t;const E=[w,O],_=new Lf;_.layers.enable(1),_.layers.enable(2);let F=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let Q=M[V];return Q===void 0&&(Q=new Nr,M[V]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(V){let Q=M[V];return Q===void 0&&(Q=new Nr,M[V]=Q),Q.getGripSpace()},this.getHand=function(V){let Q=M[V];return Q===void 0&&(Q=new Nr,M[V]=Q),Q.getHandSpace()};function C(V){const Q=T.indexOf(V.inputSource);if(Q===-1)return;const ht=M[Q];ht!==void 0&&(ht.update(V.inputSource,V.frame,c||a),ht.dispatchEvent({type:V.type,data:V.inputSource}))}function G(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",G),r.removeEventListener("inputsourceschange",q);for(let V=0;V=0&&(T[nt]=null,M[nt].disconnect(ht))}for(let Q=0;Q=T.length){T.push(ht),nt=Ut;break}else if(T[Ut]===null){T[Ut]=ht,nt=Ut;break}if(nt===-1)break}const Dt=M[nt];Dt&&Dt.connect(ht)}}const j=new L,st=new L;function H(V,Q,ht){j.setFromMatrixPosition(Q.matrixWorld),st.setFromMatrixPosition(ht.matrixWorld);const nt=j.distanceTo(st),Dt=Q.projectionMatrix.elements,Ut=ht.projectionMatrix.elements,D=Dt[14]/(Dt[10]-1),Xt=Dt[14]/(Dt[10]+1),_t=(Dt[9]+1)/Dt[5],Wt=(Dt[9]-1)/Dt[5],xt=(Dt[8]-1)/Dt[0],Nt=(Ut[8]+1)/Ut[0],Rt=D*xt,Ft=D*Nt,jt=nt/(-xt+Nt),A=jt*-xt;Q.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(A),V.translateZ(jt),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();const g=D+jt,z=Xt+jt,X=Rt-A,K=Ft+(nt-A),$=_t*Xt/z*g,mt=Wt*Xt/z*g;V.projectionMatrix.makePerspective(X,K,$,mt,g,z),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function J(V,Q){Q===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(Q.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(r===null)return;S.texture!==null&&(V.near=S.depthNear,V.far=S.depthFar),_.near=O.near=w.near=V.near,_.far=O.far=w.far=V.far,(F!==_.near||k!==_.far)&&(r.updateRenderState({depthNear:_.near,depthFar:_.far}),F=_.near,k=_.far,w.near=F,w.far=k,O.near=F,O.far=k,w.updateProjectionMatrix(),O.updateProjectionMatrix(),V.updateProjectionMatrix());const Q=V.parent,ht=_.cameras;J(_,Q);for(let nt=0;nt0&&(d.alphaTest.value=u.alphaTest);const y=t.get(u),M=y.envMap,T=y.envMapRotation;if(M&&(d.envMap.value=M,mn.copy(T),mn.x*=-1,mn.y*=-1,mn.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(mn.y*=-1,mn.z*=-1),d.envMapRotation.value.setFromMatrix4(Of.makeRotationFromEuler(mn)),d.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,d.reflectivity.value=u.reflectivity,d.ior.value=u.ior,d.refractionRatio.value=u.refractionRatio),u.lightMap){d.lightMap.value=u.lightMap;const U=i._useLegacyLights===!0?Math.PI:1;d.lightMapIntensity.value=u.lightMapIntensity*U,e(u.lightMap,d.lightMapTransform)}u.aoMap&&(d.aoMap.value=u.aoMap,d.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,d.aoMapTransform))}function a(d,u){d.diffuse.value.copy(u.color),d.opacity.value=u.opacity,u.map&&(d.map.value=u.map,e(u.map,d.mapTransform))}function o(d,u){d.dashSize.value=u.dashSize,d.totalSize.value=u.dashSize+u.gapSize,d.scale.value=u.scale}function l(d,u,y,M){d.diffuse.value.copy(u.color),d.opacity.value=u.opacity,d.size.value=u.size*y,d.scale.value=M*.5,u.map&&(d.map.value=u.map,e(u.map,d.uvTransform)),u.alphaMap&&(d.alphaMap.value=u.alphaMap,e(u.alphaMap,d.alphaMapTransform)),u.alphaTest>0&&(d.alphaTest.value=u.alphaTest)}function c(d,u){d.diffuse.value.copy(u.color),d.opacity.value=u.opacity,d.rotation.value=u.rotation,u.map&&(d.map.value=u.map,e(u.map,d.mapTransform)),u.alphaMap&&(d.alphaMap.value=u.alphaMap,e(u.alphaMap,d.alphaMapTransform)),u.alphaTest>0&&(d.alphaTest.value=u.alphaTest)}function h(d,u){d.specular.value.copy(u.specular),d.shininess.value=Math.max(u.shininess,1e-4)}function p(d,u){u.gradientMap&&(d.gradientMap.value=u.gradientMap)}function f(d,u){d.metalness.value=u.metalness,u.metalnessMap&&(d.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,d.metalnessMapTransform)),d.roughness.value=u.roughness,u.roughnessMap&&(d.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,d.roughnessMapTransform)),u.envMap&&(d.envMapIntensity.value=u.envMapIntensity)}function m(d,u,y){d.ior.value=u.ior,u.sheen>0&&(d.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),d.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(d.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,d.sheenColorMapTransform)),u.sheenRoughnessMap&&(d.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,d.sheenRoughnessMapTransform))),u.clearcoat>0&&(d.clearcoat.value=u.clearcoat,d.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(d.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,d.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(d.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,d.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(d.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,d.clearcoatNormalMapTransform),d.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===pe&&d.clearcoatNormalScale.value.negate())),u.dispersion>0&&(d.dispersion.value=u.dispersion),u.iridescence>0&&(d.iridescence.value=u.iridescence,d.iridescenceIOR.value=u.iridescenceIOR,d.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],d.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(d.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,d.iridescenceMapTransform)),u.iridescenceThicknessMap&&(d.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,d.iridescenceThicknessMapTransform))),u.transmission>0&&(d.transmission.value=u.transmission,d.transmissionSamplerMap.value=y.texture,d.transmissionSamplerSize.value.set(y.width,y.height),u.transmissionMap&&(d.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,d.transmissionMapTransform)),d.thickness.value=u.thickness,u.thicknessMap&&(d.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,d.thicknessMapTransform)),d.attenuationDistance.value=u.attenuationDistance,d.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(d.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(d.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,d.anisotropyMapTransform))),d.specularIntensity.value=u.specularIntensity,d.specularColor.value.copy(u.specularColor),u.specularColorMap&&(d.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,d.specularColorMapTransform)),u.specularIntensityMap&&(d.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,d.specularIntensityMapTransform))}function v(d,u){u.matcap&&(d.matcap.value=u.matcap)}function S(d,u){const y=t.get(u).light;d.referencePosition.value.setFromMatrixPosition(y.matrixWorld),d.nearDistance.value=y.shadow.camera.near,d.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function zf(i,t,e,n){let r={},s={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,M){const T=M.program;n.uniformBlockBinding(y,T)}function c(y,M){let T=r[y.id];T===void 0&&(v(y),T=h(y),r[y.id]=T,y.addEventListener("dispose",d));const U=M.program;n.updateUBOMapping(y,U);const b=t.render.frame;s[y.id]!==b&&(f(y),s[y.id]=b)}function h(y){const M=p();y.__bindingPointIndex=M;const T=i.createBuffer(),U=y.__size,b=y.usage;return i.bindBuffer(i.UNIFORM_BUFFER,T),i.bufferData(i.UNIFORM_BUFFER,U,b),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,M,T),T}function p(){for(let y=0;y0&&(T+=U-b),y.__size=T,y.__cache={},this}function S(y){const M={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(M.boundary=4,M.storage=4):y.isVector2?(M.boundary=8,M.storage=8):y.isVector3||y.isColor?(M.boundary=16,M.storage=12):y.isVector4?(M.boundary=16,M.storage=16):y.isMatrix3?(M.boundary=48,M.storage=48):y.isMatrix4?(M.boundary=64,M.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),M}function d(y){const M=y.target;M.removeEventListener("dispose",d);const T=a.indexOf(M.__bindingPointIndex);a.splice(T,1),i.deleteBuffer(r[M.id]),delete r[M.id],delete s[M.id]}function u(){for(const y in r)i.deleteBuffer(r[y]);a=[],r={},s={}}return{bind:l,update:c,dispose:u}}class Hf{constructor(t={}){const{canvas:e=Cl(),context:n=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),v=new Int32Array(4);let S=null,d=null;const u=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Pe,this._useLegacyLights=!1,this.toneMapping=rn,this.toneMappingExposure=1;const M=this;let T=!1,U=0,b=0,w=null,O=-1,E=null;const _=new $t,F=new $t;let k=null;const C=new zt(0);let G=0,q=e.width,j=e.height,st=1,H=null,J=null;const Z=new $t(0,0,q,j),ft=new $t(0,0,q,j);let Lt=!1;const kt=new Jr;let V=!1,Q=!1;const ht=new Jt,nt=new L,Dt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ut(){return w===null?st:1}let D=n;function Xt(x,P){return e.getContext(x,P)}try{const x={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:p};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Yr}`),e.addEventListener("webglcontextlost",R,!1),e.addEventListener("webglcontextrestored",Y,!1),e.addEventListener("webglcontextcreationerror",W,!1),D===null){const P="webgl2";if(D=Xt(P,x),D===null)throw Xt(P)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let _t,Wt,xt,Nt,Rt,Ft,jt,A,g,z,X,K,$,mt,ot,at,At,tt,pt,Ot,gt,ct,bt,It;function Qt(){_t=new Yu(D),_t.init(),ct=new Pf(D,_t),Wt=new Hu(D,_t,t,ct),xt=new Rf(D),Nt=new ju(D),Rt=new pf,Ft=new Cf(D,_t,xt,Rt,Wt,ct,Nt),jt=new Gu(M),A=new qu(M),g=new nc(D),bt=new Bu(D,g),z=new Ku(D,g,Nt,bt),X=new Ju(D,z,g,Nt),pt=new Zu(D,Wt,Ft),at=new Vu(Rt),K=new ff(M,jt,A,_t,Wt,bt,at),$=new Bf(M,Rt),mt=new _f,ot=new Ef(_t),tt=new Ou(M,jt,A,xt,X,f,l),At=new wf(M,X,Wt),It=new zf(D,Nt,Wt,xt),Ot=new zu(D,_t,Nt),gt=new $u(D,_t,Nt),Nt.programs=K.programs,M.capabilities=Wt,M.extensions=_t,M.properties=Rt,M.renderLists=mt,M.shadowMap=At,M.state=xt,M.info=Nt}Qt();const wt=new Ff(M,D);this.xr=wt,this.getContext=function(){return D},this.getContextAttributes=function(){return D.getContextAttributes()},this.forceContextLoss=function(){const x=_t.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){const x=_t.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return st},this.setPixelRatio=function(x){x!==void 0&&(st=x,this.setSize(q,j,!1))},this.getSize=function(x){return x.set(q,j)},this.setSize=function(x,P,B=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}q=x,j=P,e.width=Math.floor(x*st),e.height=Math.floor(P*st),B===!0&&(e.style.width=x+"px",e.style.height=P+"px"),this.setViewport(0,0,x,P)},this.getDrawingBufferSize=function(x){return x.set(q*st,j*st).floor()},this.setDrawingBufferSize=function(x,P,B){q=x,j=P,st=B,e.width=Math.floor(x*B),e.height=Math.floor(P*B),this.setViewport(0,0,x,P)},this.getCurrentViewport=function(x){return x.copy(_)},this.getViewport=function(x){return x.copy(Z)},this.setViewport=function(x,P,B,I){x.isVector4?Z.set(x.x,x.y,x.z,x.w):Z.set(x,P,B,I),xt.viewport(_.copy(Z).multiplyScalar(st).round())},this.getScissor=function(x){return x.copy(ft)},this.setScissor=function(x,P,B,I){x.isVector4?ft.set(x.x,x.y,x.z,x.w):ft.set(x,P,B,I),xt.scissor(F.copy(ft).multiplyScalar(st).round())},this.getScissorTest=function(){return Lt},this.setScissorTest=function(x){xt.setScissorTest(Lt=x)},this.setOpaqueSort=function(x){H=x},this.setTransparentSort=function(x){J=x},this.getClearColor=function(x){return x.copy(tt.getClearColor())},this.setClearColor=function(){tt.setClearColor.apply(tt,arguments)},this.getClearAlpha=function(){return tt.getClearAlpha()},this.setClearAlpha=function(){tt.setClearAlpha.apply(tt,arguments)},this.clear=function(x=!0,P=!0,B=!0){let I=0;if(x){let N=!1;if(w!==null){const rt=w.texture.format;N=rt===qa||rt===Xa||rt===Wa}if(N){const rt=w.texture.type,ut=rt===an||rt===qn||rt===Ha||rt===ci||rt===Ga||rt===ka,dt=tt.getClearColor(),vt=tt.getClearAlpha(),Mt=dt.r,Et=dt.g,Ct=dt.b;ut?(m[0]=Mt,m[1]=Et,m[2]=Ct,m[3]=vt,D.clearBufferuiv(D.COLOR,0,m)):(v[0]=Mt,v[1]=Et,v[2]=Ct,v[3]=vt,D.clearBufferiv(D.COLOR,0,v))}else I|=D.COLOR_BUFFER_BIT}P&&(I|=D.DEPTH_BUFFER_BIT),B&&(I|=D.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),D.clear(I)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",R,!1),e.removeEventListener("webglcontextrestored",Y,!1),e.removeEventListener("webglcontextcreationerror",W,!1),mt.dispose(),ot.dispose(),Rt.dispose(),jt.dispose(),A.dispose(),X.dispose(),bt.dispose(),It.dispose(),K.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",Vt),wt.removeEventListener("sessionend",Ce),he.stop()};function R(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function Y(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const x=Nt.autoReset,P=At.enabled,B=At.autoUpdate,I=At.needsUpdate,N=At.type;Qt(),Nt.autoReset=x,At.enabled=P,At.autoUpdate=B,At.needsUpdate=I,At.type=N}function W(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function it(x){const P=x.target;P.removeEventListener("dispose",it),lt(P)}function lt(x){Bt(x),Rt.remove(x)}function Bt(x){const P=Rt.get(x).programs;P!==void 0&&(P.forEach(function(B){K.releaseProgram(B)}),x.isShaderMaterial&&K.releaseShaderCache(x))}this.renderBufferDirect=function(x,P,B,I,N,rt){P===null&&(P=Dt);const ut=N.isMesh&&N.matrixWorld.determinant()<0,dt=xo(x,P,B,I,N);xt.setMaterial(I,ut);let vt=B.index,Mt=1;if(I.wireframe===!0){if(vt=z.getWireframeAttribute(B),vt===void 0)return;Mt=2}const Et=B.drawRange,Ct=B.attributes.position;let te=Et.start*Mt,ae=(Et.start+Et.count)*Mt;rt!==null&&(te=Math.max(te,rt.start*Mt),ae=Math.min(ae,(rt.start+rt.count)*Mt)),vt!==null?(te=Math.max(te,0),ae=Math.min(ae,vt.count)):Ct!=null&&(te=Math.max(te,0),ae=Math.min(ae,Ct.count));const ge=ae-te;if(ge<0||ge===1/0)return;bt.setup(N,I,dt,B,vt);let Oe,Ht=Ot;if(vt!==null&&(Oe=g.get(vt),Ht=gt,Ht.setIndex(Oe)),N.isMesh)I.wireframe===!0?(xt.setLineWidth(I.wireframeLinewidth*Ut()),Ht.setMode(D.LINES)):Ht.setMode(D.TRIANGLES);else if(N.isLine){let St=I.linewidth;St===void 0&&(St=1),xt.setLineWidth(St*Ut()),N.isLineSegments?Ht.setMode(D.LINES):N.isLineLoop?Ht.setMode(D.LINE_LOOP):Ht.setMode(D.LINE_STRIP)}else N.isPoints?Ht.setMode(D.POINTS):N.isSprite&&Ht.setMode(D.TRIANGLES);if(N.isBatchedMesh)N._multiDrawInstances!==null?Ht.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances):Ht.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else if(N.isInstancedMesh)Ht.renderInstances(te,ge,N.count);else if(B.isInstancedBufferGeometry){const St=B._maxInstanceCount!==void 0?B._maxInstanceCount:1/0,Jn=Math.min(B.instanceCount,St);Ht.renderInstances(te,ge,Jn)}else Ht.render(te,ge)};function qt(x,P,B){x.transparent===!0&&x.side===We&&x.forceSinglePass===!1?(x.side=pe,x.needsUpdate=!0,pi(x,P,B),x.side=sn,x.needsUpdate=!0,pi(x,P,B),x.side=We):pi(x,P,B)}this.compile=function(x,P,B=null){B===null&&(B=x),d=ot.get(B),d.init(P),y.push(d),B.traverseVisible(function(N){N.isLight&&N.layers.test(P.layers)&&(d.pushLight(N),N.castShadow&&d.pushShadow(N))}),x!==B&&x.traverseVisible(function(N){N.isLight&&N.layers.test(P.layers)&&(d.pushLight(N),N.castShadow&&d.pushShadow(N))}),d.setupLights(M._useLegacyLights);const I=new Set;return x.traverse(function(N){const rt=N.material;if(rt)if(Array.isArray(rt))for(let ut=0;ut{function rt(){if(I.forEach(function(ut){Rt.get(ut).currentProgram.isReady()&&I.delete(ut)}),I.size===0){N(x);return}setTimeout(rt,10)}_t.get("KHR_parallel_shader_compile")!==null?rt():setTimeout(rt,10)})};let Zt=null;function se(x){Zt&&Zt(x)}function Vt(){he.stop()}function Ce(){he.start()}const he=new so;he.setAnimationLoop(se),typeof self<"u"&&he.setContext(self),this.setAnimationLoop=function(x){Zt=x,wt.setAnimationLoop(x),x===null?he.stop():he.start()},wt.addEventListener("sessionstart",Vt),wt.addEventListener("sessionend",Ce),this.render=function(x,P){if(P!==void 0&&P.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),P.parent===null&&P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(P),P=wt.getCamera()),x.isScene===!0&&x.onBeforeRender(M,x,P,w),d=ot.get(x,y.length),d.init(P),y.push(d),ht.multiplyMatrices(P.projectionMatrix,P.matrixWorldInverse),kt.setFromProjectionMatrix(ht),Q=this.localClippingEnabled,V=at.init(this.clippingPlanes,Q),S=mt.get(x,u.length),S.init(),u.push(S),rs(x,P,0,M.sortObjects),S.finish(),M.sortObjects===!0&&S.sort(H,J);const B=wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1;B&&tt.addToRenderList(S,x),this.info.render.frame++,V===!0&&at.beginShadows();const I=d.state.shadowsArray;At.render(I,x,P),V===!0&&at.endShadows(),this.info.autoReset===!0&&this.info.reset();const N=S.opaque,rt=S.transmissive;if(d.setupLights(M._useLegacyLights),P.isArrayCamera){const ut=P.cameras;if(rt.length>0)for(let dt=0,vt=ut.length;dt0&&as(N,rt,x,P),B&&tt.render(x),ss(S,x,P);w!==null&&(Ft.updateMultisampleRenderTarget(w),Ft.updateRenderTargetMipmap(w)),x.isScene===!0&&x.onAfterRender(M,x,P),bt.resetDefaultState(),O=-1,E=null,y.pop(),y.length>0?(d=y[y.length-1],V===!0&&at.setGlobalState(M.clippingPlanes,d.state.camera)):d=null,u.pop(),u.length>0?S=u[u.length-1]:S=null};function rs(x,P,B,I){if(x.visible===!1)return;if(x.layers.test(P.layers)){if(x.isGroup)B=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(P);else if(x.isLight)d.pushLight(x),x.castShadow&&d.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||kt.intersectsSprite(x)){I&&nt.setFromMatrixPosition(x.matrixWorld).applyMatrix4(ht);const ut=X.update(x),dt=x.material;dt.visible&&S.push(x,ut,dt,B,nt.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||kt.intersectsObject(x))){const ut=X.update(x),dt=x.material;if(I&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),nt.copy(x.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),nt.copy(ut.boundingSphere.center)),nt.applyMatrix4(x.matrixWorld).applyMatrix4(ht)),Array.isArray(dt)){const vt=ut.groups;for(let Mt=0,Et=vt.length;Mt0&&fi(N,P,B),rt.length>0&&fi(rt,P,B),ut.length>0&&fi(ut,P,B),xt.buffers.depth.setTest(!0),xt.buffers.depth.setMask(!0),xt.buffers.color.setMask(!0),xt.setPolygonOffset(!1)}function as(x,P,B,I){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;d.state.transmissionRenderTarget[I.id]===void 0&&(d.state.transmissionRenderTarget[I.id]=new En(1,1,{generateMipmaps:!0,type:_t.has("EXT_color_buffer_half_float")||_t.has("EXT_color_buffer_float")?qi:an,minFilter:Sn,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));const rt=d.state.transmissionRenderTarget[I.id],ut=I.viewport||_;rt.setSize(ut.z,ut.w);const dt=M.getRenderTarget();M.setRenderTarget(rt),M.getClearColor(C),G=M.getClearAlpha(),G<1&&M.setClearColor(16777215,.5),M.clear();const vt=M.toneMapping;M.toneMapping=rn;const Mt=I.viewport;if(I.viewport!==void 0&&(I.viewport=void 0),d.setupLightsView(I),V===!0&&at.setGlobalState(M.clippingPlanes,I),fi(x,B,I),Ft.updateMultisampleRenderTarget(rt),Ft.updateRenderTargetMipmap(rt),_t.has("WEBGL_multisampled_render_to_texture")===!1){let Et=!1;for(let Ct=0,te=P.length;Ct0),Ct=!!B.morphAttributes.position,te=!!B.morphAttributes.normal,ae=!!B.morphAttributes.color;let ge=rn;I.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(ge=M.toneMapping);const Oe=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Ht=Oe!==void 0?Oe.length:0,St=Rt.get(I),Jn=d.state.lights;if(V===!0&&(Q===!0||x!==E)){const Se=x===E&&I.id===O;at.setState(I,x,Se)}let Kt=!1;I.version===St.__version?(St.needsLights&&St.lightsStateVersion!==Jn.state.version||St.outputColorSpace!==dt||N.isBatchedMesh&&St.batching===!1||!N.isBatchedMesh&&St.batching===!0||N.isInstancedMesh&&St.instancing===!1||!N.isInstancedMesh&&St.instancing===!0||N.isSkinnedMesh&&St.skinning===!1||!N.isSkinnedMesh&&St.skinning===!0||N.isInstancedMesh&&St.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&St.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&St.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&St.instancingMorph===!1&&N.morphTexture!==null||St.envMap!==vt||I.fog===!0&&St.fog!==rt||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==at.numPlanes||St.numIntersection!==at.numIntersection)||St.vertexAlphas!==Mt||St.vertexTangents!==Et||St.morphTargets!==Ct||St.morphNormals!==te||St.morphColors!==ae||St.toneMapping!==ge||St.morphTargetsCount!==Ht)&&(Kt=!0):(Kt=!0,St.__version=I.version);let cn=St.currentProgram;Kt===!0&&(cn=pi(I,P,N));let hs=!1,Qn=!1,tr=!1;const oe=cn.getUniforms(),Ye=St.uniforms;if(xt.useProgram(cn.program)&&(hs=!0,Qn=!0,tr=!0),I.id!==O&&(O=I.id,Qn=!0),hs||E!==x){oe.setValue(D,"projectionMatrix",x.projectionMatrix),oe.setValue(D,"viewMatrix",x.matrixWorldInverse);const Se=oe.map.cameraPosition;Se!==void 0&&Se.setValue(D,nt.setFromMatrixPosition(x.matrixWorld)),Wt.logarithmicDepthBuffer&&oe.setValue(D,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(I.isMeshPhongMaterial||I.isMeshToonMaterial||I.isMeshLambertMaterial||I.isMeshBasicMaterial||I.isMeshStandardMaterial||I.isShaderMaterial)&&oe.setValue(D,"isOrthographic",x.isOrthographicCamera===!0),E!==x&&(E=x,Qn=!0,tr=!0)}if(N.isSkinnedMesh){oe.setOptional(D,N,"bindMatrix"),oe.setOptional(D,N,"bindMatrixInverse");const Se=N.skeleton;Se&&(Se.boneTexture===null&&Se.computeBoneTexture(),oe.setValue(D,"boneTexture",Se.boneTexture,Ft))}N.isBatchedMesh&&(oe.setOptional(D,N,"batchingTexture"),oe.setValue(D,"batchingTexture",N._matricesTexture,Ft));const er=B.morphAttributes;if((er.position!==void 0||er.normal!==void 0||er.color!==void 0)&&pt.update(N,B,cn),(Qn||St.receiveShadow!==N.receiveShadow)&&(St.receiveShadow=N.receiveShadow,oe.setValue(D,"receiveShadow",N.receiveShadow)),I.isMeshGouraudMaterial&&I.envMap!==null&&(Ye.envMap.value=vt,Ye.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),I.isMeshStandardMaterial&&I.envMap===null&&P.environment!==null&&(Ye.envMapIntensity.value=P.environmentIntensity),Qn&&(oe.setValue(D,"toneMappingExposure",M.toneMappingExposure),St.needsLights&&Mo(Ye,tr),rt&&I.fog===!0&&$.refreshFogUniforms(Ye,rt),$.refreshMaterialUniforms(Ye,I,st,j,d.state.transmissionRenderTarget[x.id]),Bi.upload(D,ls(St),Ye,Ft)),I.isShaderMaterial&&I.uniformsNeedUpdate===!0&&(Bi.upload(D,ls(St),Ye,Ft),I.uniformsNeedUpdate=!1),I.isSpriteMaterial&&oe.setValue(D,"center",N.center),oe.setValue(D,"modelViewMatrix",N.modelViewMatrix),oe.setValue(D,"normalMatrix",N.normalMatrix),oe.setValue(D,"modelMatrix",N.matrixWorld),I.isShaderMaterial||I.isRawShaderMaterial){const Se=I.uniformsGroups;for(let nr=0,Eo=Se.length;nr0&&Ft.useMultisampledRTT(x)===!1?N=Rt.get(x).__webglMultisampledFramebuffer:Array.isArray(Et)?N=Et[B]:N=Et,_.copy(x.viewport),F.copy(x.scissor),k=x.scissorTest}else _.copy(Z).multiplyScalar(st).floor(),F.copy(ft).multiplyScalar(st).floor(),k=Lt;if(xt.bindFramebuffer(D.FRAMEBUFFER,N)&&I&&xt.drawBuffers(x,N),xt.viewport(_),xt.scissor(F),xt.setScissorTest(k),rt){const vt=Rt.get(x.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+P,vt.__webglTexture,B)}else if(ut){const vt=Rt.get(x.texture),Mt=P||0;D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,vt.__webglTexture,B||0,Mt)}O=-1},this.readRenderTargetPixels=function(x,P,B,I,N,rt,ut){if(!(x&&x.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let dt=Rt.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ut!==void 0&&(dt=dt[ut]),dt){xt.bindFramebuffer(D.FRAMEBUFFER,dt);try{const vt=x.texture,Mt=vt.format,Et=vt.type;if(!Wt.textureFormatReadable(Mt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Wt.textureTypeReadable(Et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}P>=0&&P<=x.width-I&&B>=0&&B<=x.height-N&&D.readPixels(P,B,I,N,ct.convert(Mt),ct.convert(Et),rt)}finally{const vt=w!==null?Rt.get(w).__webglFramebuffer:null;xt.bindFramebuffer(D.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(x,P,B=0){const I=Math.pow(2,-B),N=Math.floor(P.image.width*I),rt=Math.floor(P.image.height*I);Ft.setTexture2D(P,0),D.copyTexSubImage2D(D.TEXTURE_2D,B,0,0,x.x,x.y,N,rt),xt.unbindTexture()},this.copyTextureToTexture=function(x,P,B,I=0){const N=P.image.width,rt=P.image.height,ut=ct.convert(B.format),dt=ct.convert(B.type);Ft.setTexture2D(B,0),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,B.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,B.unpackAlignment),P.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,I,x.x,x.y,N,rt,ut,dt,P.image.data):P.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,I,x.x,x.y,P.mipmaps[0].width,P.mipmaps[0].height,ut,P.mipmaps[0].data):D.texSubImage2D(D.TEXTURE_2D,I,x.x,x.y,ut,dt,P.image),I===0&&B.generateMipmaps&&D.generateMipmap(D.TEXTURE_2D),xt.unbindTexture()},this.copyTextureToTexture3D=function(x,P,B,I,N=0){const rt=x.max.x-x.min.x,ut=x.max.y-x.min.y,dt=x.max.z-x.min.z,vt=ct.convert(I.format),Mt=ct.convert(I.type);let Et;if(I.isData3DTexture)Ft.setTexture3D(I,0),Et=D.TEXTURE_3D;else if(I.isDataArrayTexture||I.isCompressedArrayTexture)Ft.setTexture2DArray(I,0),Et=D.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,I.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,I.unpackAlignment);const Ct=D.getParameter(D.UNPACK_ROW_LENGTH),te=D.getParameter(D.UNPACK_IMAGE_HEIGHT),ae=D.getParameter(D.UNPACK_SKIP_PIXELS),ge=D.getParameter(D.UNPACK_SKIP_ROWS),Oe=D.getParameter(D.UNPACK_SKIP_IMAGES),Ht=B.isCompressedTexture?B.mipmaps[N]:B.image;D.pixelStorei(D.UNPACK_ROW_LENGTH,Ht.width),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Ht.height),D.pixelStorei(D.UNPACK_SKIP_PIXELS,x.min.x),D.pixelStorei(D.UNPACK_SKIP_ROWS,x.min.y),D.pixelStorei(D.UNPACK_SKIP_IMAGES,x.min.z),B.isDataTexture||B.isData3DTexture?D.texSubImage3D(Et,N,P.x,P.y,P.z,rt,ut,dt,vt,Mt,Ht.data):I.isCompressedArrayTexture?D.compressedTexSubImage3D(Et,N,P.x,P.y,P.z,rt,ut,dt,vt,Ht.data):D.texSubImage3D(Et,N,P.x,P.y,P.z,rt,ut,dt,vt,Mt,Ht),D.pixelStorei(D.UNPACK_ROW_LENGTH,Ct),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,te),D.pixelStorei(D.UNPACK_SKIP_PIXELS,ae),D.pixelStorei(D.UNPACK_SKIP_ROWS,ge),D.pixelStorei(D.UNPACK_SKIP_IMAGES,Oe),N===0&&I.generateMipmaps&&D.generateMipmap(Et),xt.unbindTexture()},this.initTexture=function(x){x.isCubeTexture?Ft.setTextureCube(x,0):x.isData3DTexture?Ft.setTexture3D(x,0):x.isDataArrayTexture||x.isCompressedArrayTexture?Ft.setTexture2DArray(x,0):Ft.setTexture2D(x,0),xt.unbindTexture()},this.resetState=function(){U=0,b=0,w=null,xt.reset(),bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Xe}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===jr?"display-p3":"srgb",e.unpackColorSpace=Gt.workingColorSpace===Yi?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Vf extends _e{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Fe,this.environmentIntensity=1,this.environmentRotation=new Fe,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class ts extends qe{constructor(t=[],e=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r};const s=[],a=[];o(r),c(n),h(),this.setAttribute("position",new Ne(s,3)),this.setAttribute("normal",new Ne(s.slice(),3)),this.setAttribute("uv",new Ne(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(y){const M=new L,T=new L,U=new L;for(let b=0;b.9&&w<.1&&(M<.2&&(a[y+0]+=1),T<.2&&(a[y+2]+=1),U<.2&&(a[y+4]+=1))}}function f(y){s.push(y.x,y.y,y.z)}function m(y,M){const T=y*3;M.x=t[T+0],M.y=t[T+1],M.z=t[T+2]}function v(){const y=new L,M=new L,T=new L,U=new L,b=new Pt,w=new Pt,O=new Pt;for(let E=0,_=0;EKf+t),mo=new Map;po.forEach((i,t)=>mo.set(i,t));const is=new Vf,Zi=new Me(30,1,.01,10);Zi.position.z=1;Zi.add(new qf(16777215,1));is.add(Zi);is.add(li);const _o=document.querySelector("#output"),qr=new Hf({canvas:_o,antialias:!0}),Fa=_o.getBoundingClientRect();qr.setSize(Fa.width,Fa.height);qr.setAnimationLoop(function(i){li.rotation.x=i/2e3,li.rotation.y=i/1e3,qr.render(is,Zi)});const Ji=new jn(.2,.2,.2);Ji.clearGroups();Ji.addGroup(0,18,0);Ji.addGroup(18,1/0,1);const Qi=new es(.16);Qi.clearGroups();Qi.addGroup(30,1/0,2);Qi.addGroup(0,30,0);const $f=new ji(vo(Ji)),jf=new ji(vo(Qi));function go(i){li.geometry?.dispose(),li.geometry=Zf(ji[i]($f,jf).getMesh())}go("union");const Oa=document.querySelector("select");Oa.onchange=function(){go(Oa.value)};function vo(i){const t=i.attributes.position.array,e=i.index!=null?i.index.array:new Uint32Array(t.length/3).map((c,h)=>h),n=[...Array(i.groups.length)].map((c,h)=>i.groups[h].start),r=[...Array(i.groups.length)].map((c,h)=>po[i.groups[h].materialIndex]),s=Array.from(n.keys());s.sort((c,h)=>n[c]-n[h]);const a=new Uint32Array(s.map(c=>n[c])),o=new Uint32Array(s.map(c=>r[c])),l=new Yf({numProp:3,vertProperties:t,triVerts:e,runIndex:a,runOriginalID:o});return l.merge(),l}function Zf(i){const t=new qe;t.setAttribute("position",new Te(i.vertProperties,3)),t.setIndex(new Te(i.triVerts,1));let e=i.runOriginalID[0],n=i.runIndex[0];for(let r=0;r> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] +\n\t\t\t_lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ];\n\n\t// .toLowerCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toLowerCase();\n\n}\n\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n// compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\nfunction euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n// Linear mapping from range to range \nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\nfunction inverseLerp( x, y, value ) {\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n// https://en.wikipedia.org/wiki/Linear_interpolation\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n// https://www.desmos.com/calculator/vcsjnyz7x4\nfunction pingpong( x, length = 1 ) {\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n// http://en.wikipedia.org/wiki/Smoothstep\nfunction smoothstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\nfunction smootherstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n// Random integer from interval\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n// Random float from interval\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n// Random float from <-range/2, range/2> interval\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n// Deterministic pseudo-random float in the interval [ 0, 1 ]\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s;\n\n\t// Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\n\tt = Math.imul( t ^ t >>> 15, t | 1 );\n\n\tt ^= t + Math.imul( t ^ t >>> 7, t | 61 );\n\n\treturn ( ( t ^ t >>> 14 ) >>> 0 ) / 4294967296;\n\n}\n\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n}\n\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\nfunction denormalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn value / 4294967295.0;\n\n\t\tcase Uint16Array:\n\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\n\t\t\treturn value / 255.0;\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.max( value / 2147483647.0, - 1.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.max( value / 32767.0, - 1.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.max( value / 127.0, - 1.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\nfunction normalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn Math.round( value * 4294967295.0 );\n\n\t\tcase Uint16Array:\n\n\t\t\treturn Math.round( value * 65535.0 );\n\n\t\tcase Uint8Array:\n\n\t\t\treturn Math.round( value * 255.0 );\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.round( value * 2147483647.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.round( value * 32767.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.round( value * 127.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\nconst MathUtils = {\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n};\n\nclass Vector2 {\n\n\tconstructor( x = 0, y = 0 ) {\n\n\t\tVector2.prototype.isVector2 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.x;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.x = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.y;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.y = value;\n\n\t}\n\n\tset( x, y ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y;\n\n\t}\n\n\tcross( v ) {\n\n\t\treturn this.x * v.y - this.y * v.x;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tangle() {\n\n\t\t// computes the angle in radians with respect to the positive x-axis\n\n\t\tconst angle = Math.atan2( - this.y, - this.x ) + Math.PI;\n\n\t\treturn angle;\n\n\t}\n\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, - 1, 1 ) );\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\n\t\treturn this;\n\n\t}\n\n\trotateAround( center, angle ) {\n\n\t\tconst c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\n\t}\n\n}\n\nclass Matrix3 {\n\n\tconstructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tMatrix3.prototype.isMatrix3 = true;\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];\n\t\tte[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];\n\t\tte[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrix3Column( this, 0 );\n\t\tyAxis.setFromMatrix3Column( this, 1 );\n\t\tzAxis.setFromMatrix3Column( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix4( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t}\n\n\tinvert() {\n\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ],\n\t\t\tn12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ],\n\t\t\tn13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ],\n\n\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\tte[ 3 ] = t12 * detInv;\n\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\tte[ 6 ] = t13 * detInv;\n\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\ttranspose() {\n\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\n\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tgetNormalMatrix( matrix4 ) {\n\n\t\treturn this.setFromMatrix4( matrix4 ).invert().transpose();\n\n\t}\n\n\ttransposeIntoArray( r ) {\n\n\t\tconst m = this.elements;\n\n\t\tr[ 0 ] = m[ 0 ];\n\t\tr[ 1 ] = m[ 3 ];\n\t\tr[ 2 ] = m[ 6 ];\n\t\tr[ 3 ] = m[ 1 ];\n\t\tr[ 4 ] = m[ 4 ];\n\t\tr[ 5 ] = m[ 7 ];\n\t\tr[ 6 ] = m[ 2 ];\n\t\tr[ 7 ] = m[ 5 ];\n\t\tr[ 8 ] = m[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetUvTransform( tx, ty, sx, sy, rotation, cx, cy ) {\n\n\t\tconst c = Math.cos( rotation );\n\t\tconst s = Math.sin( rotation );\n\n\t\tthis.set(\n\t\t\tsx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,\n\t\t\t- sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,\n\t\t\t0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t//\n\n\tscale( sx, sy ) {\n\n\t\tthis.premultiply( _m3.makeScale( sx, sy ) );\n\n\t\treturn this;\n\n\t}\n\n\trotate( theta ) {\n\n\t\tthis.premultiply( _m3.makeRotation( - theta ) );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( tx, ty ) {\n\n\t\tthis.premultiply( _m3.makeTranslation( tx, ty ) );\n\n\t\treturn this;\n\n\t}\n\n\t// for 2D Transforms\n\n\tmakeTranslation( x, y ) {\n\n\t\tif ( x.isVector2 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x.x,\n\t\t\t\t0, 1, x.y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x,\n\t\t\t\t0, 1, y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotation( theta ) {\n\n\t\t// counterclockwise\n\n\t\tconst c = Math.cos( theta );\n\t\tconst s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0,\n\t\t\ts, c, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeScale( x, y ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0,\n\t\t\t0, y, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t//\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\treturn array;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().fromArray( this.elements );\n\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/ new Matrix3();\n\nfunction arrayNeedsUint32( array ) {\n\n\t// assumes larger values usually on last\n\n\tfor ( let i = array.length - 1; i >= 0; -- i ) {\n\n\t\tif ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565\n\n\t}\n\n\treturn false;\n\n}\n\nconst TYPED_ARRAYS = {\n\tInt8Array: Int8Array,\n\tUint8Array: Uint8Array,\n\tUint8ClampedArray: Uint8ClampedArray,\n\tInt16Array: Int16Array,\n\tUint16Array: Uint16Array,\n\tInt32Array: Int32Array,\n\tUint32Array: Uint32Array,\n\tFloat32Array: Float32Array,\n\tFloat64Array: Float64Array\n};\n\nfunction getTypedArray( type, buffer ) {\n\n\treturn new TYPED_ARRAYS[ type ]( buffer );\n\n}\n\nfunction createElementNS( name ) {\n\n\treturn document.createElementNS( 'http://www.w3.org/1999/xhtml', name );\n\n}\n\nfunction createCanvasElement() {\n\n\tconst canvas = createElementNS( 'canvas' );\n\tcanvas.style.display = 'block';\n\treturn canvas;\n\n}\n\nconst _cache = {};\n\nfunction warnOnce( message ) {\n\n\tif ( message in _cache ) return;\n\n\t_cache[ message ] = true;\n\n\tconsole.warn( message );\n\n}\n\n/**\n * Matrices converting P3 <-> Rec. 709 primaries, without gamut mapping\n * or clipping. Based on W3C specifications for sRGB and Display P3,\n * and ICC specifications for the D50 connection space. Values in/out\n * are _linear_ sRGB and _linear_ Display P3.\n *\n * Note that both sRGB and Display P3 use the sRGB transfer functions.\n *\n * Reference:\n * - http://www.russellcottrell.com/photo/matrixCalculator.htm\n */\n\nconst LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = /*@__PURE__*/ new Matrix3().set(\n\t0.8224621, 0.177538, 0.0,\n\t0.0331941, 0.9668058, 0.0,\n\t0.0170827, 0.0723974, 0.9105199,\n);\n\nconst LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = /*@__PURE__*/ new Matrix3().set(\n\t1.2249401, - 0.2249404, 0.0,\n\t- 0.0420569, 1.0420571, 0.0,\n\t- 0.0196376, - 0.0786361, 1.0982735\n);\n\n/**\n * Defines supported color spaces by transfer function and primaries,\n * and provides conversions to/from the Linear-sRGB reference space.\n */\nconst COLOR_SPACES = {\n\t[ LinearSRGBColorSpace ]: {\n\t\ttransfer: LinearTransfer,\n\t\tprimaries: Rec709Primaries,\n\t\ttoReference: ( color ) => color,\n\t\tfromReference: ( color ) => color,\n\t},\n\t[ SRGBColorSpace ]: {\n\t\ttransfer: SRGBTransfer,\n\t\tprimaries: Rec709Primaries,\n\t\ttoReference: ( color ) => color.convertSRGBToLinear(),\n\t\tfromReference: ( color ) => color.convertLinearToSRGB(),\n\t},\n\t[ LinearDisplayP3ColorSpace ]: {\n\t\ttransfer: LinearTransfer,\n\t\tprimaries: P3Primaries,\n\t\ttoReference: ( color ) => color.applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),\n\t\tfromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ),\n\t},\n\t[ DisplayP3ColorSpace ]: {\n\t\ttransfer: SRGBTransfer,\n\t\tprimaries: P3Primaries,\n\t\ttoReference: ( color ) => color.convertSRGBToLinear().applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),\n\t\tfromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ).convertLinearToSRGB(),\n\t},\n};\n\nconst SUPPORTED_WORKING_COLOR_SPACES = new Set( [ LinearSRGBColorSpace, LinearDisplayP3ColorSpace ] );\n\nconst ColorManagement = {\n\n\tenabled: true,\n\n\t_workingColorSpace: LinearSRGBColorSpace,\n\n\tget workingColorSpace() {\n\n\t\treturn this._workingColorSpace;\n\n\t},\n\n\tset workingColorSpace( colorSpace ) {\n\n\t\tif ( ! SUPPORTED_WORKING_COLOR_SPACES.has( colorSpace ) ) {\n\n\t\t\tthrow new Error( `Unsupported working color space, \"${ colorSpace }\".` );\n\n\t\t}\n\n\t\tthis._workingColorSpace = colorSpace;\n\n\t},\n\n\tconvert: function ( color, sourceColorSpace, targetColorSpace ) {\n\n\t\tif ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {\n\n\t\t\treturn color;\n\n\t\t}\n\n\t\tconst sourceToReference = COLOR_SPACES[ sourceColorSpace ].toReference;\n\t\tconst targetFromReference = COLOR_SPACES[ targetColorSpace ].fromReference;\n\n\t\treturn targetFromReference( sourceToReference( color ) );\n\n\t},\n\n\tfromWorkingColorSpace: function ( color, targetColorSpace ) {\n\n\t\treturn this.convert( color, this._workingColorSpace, targetColorSpace );\n\n\t},\n\n\ttoWorkingColorSpace: function ( color, sourceColorSpace ) {\n\n\t\treturn this.convert( color, sourceColorSpace, this._workingColorSpace );\n\n\t},\n\n\tgetPrimaries: function ( colorSpace ) {\n\n\t\treturn COLOR_SPACES[ colorSpace ].primaries;\n\n\t},\n\n\tgetTransfer: function ( colorSpace ) {\n\n\t\tif ( colorSpace === NoColorSpace ) return LinearTransfer;\n\n\t\treturn COLOR_SPACES[ colorSpace ].transfer;\n\n\t},\n\n};\n\n\nfunction SRGBToLinear( c ) {\n\n\treturn ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nfunction LinearToSRGB( c ) {\n\n\treturn ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n\nlet _canvas;\n\nclass ImageUtils {\n\n\tstatic getDataURL( image ) {\n\n\t\tif ( /^data:/i.test( image.src ) ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tif ( typeof HTMLCanvasElement === 'undefined' ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tlet canvas;\n\n\t\tif ( image instanceof HTMLCanvasElement ) {\n\n\t\t\tcanvas = image;\n\n\t\t} else {\n\n\t\t\tif ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );\n\n\t\t\t_canvas.width = image.width;\n\t\t\t_canvas.height = image.height;\n\n\t\t\tconst context = _canvas.getContext( '2d' );\n\n\t\t\tif ( image instanceof ImageData ) {\n\n\t\t\t\tcontext.putImageData( image, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tcanvas = _canvas;\n\n\t\t}\n\n\t\tif ( canvas.width > 2048 || canvas.height > 2048 ) {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image );\n\n\t\t\treturn canvas.toDataURL( 'image/jpeg', 0.6 );\n\n\t\t} else {\n\n\t\t\treturn canvas.toDataURL( 'image/png' );\n\n\t\t}\n\n\t}\n\n\tstatic sRGBToLinear( image ) {\n\n\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t\tconst canvas = createElementNS( 'canvas' );\n\n\t\t\tcanvas.width = image.width;\n\t\t\tcanvas.height = image.height;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\tconst imageData = context.getImageData( 0, 0, image.width, image.height );\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255;\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imageData, 0, 0 );\n\n\t\t\treturn canvas;\n\n\t\t} else if ( image.data ) {\n\n\t\t\tconst data = image.data.slice( 0 );\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tif ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) {\n\n\t\t\t\t\tdata[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assuming float\n\n\t\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: data,\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );\n\t\t\treturn image;\n\n\t\t}\n\n\t}\n\n}\n\nlet _sourceId = 0;\n\nclass Source {\n\n\tconstructor( data = null ) {\n\n\t\tthis.isSource = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _sourceId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.data = data;\n\t\tthis.dataReady = true;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.images[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.images[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\t\t\tuuid: this.uuid,\n\t\t\turl: ''\n\t\t};\n\n\t\tconst data = this.data;\n\n\t\tif ( data !== null ) {\n\n\t\t\tlet url;\n\n\t\t\tif ( Array.isArray( data ) ) {\n\n\t\t\t\t// cube texture\n\n\t\t\t\turl = [];\n\n\t\t\t\tfor ( let i = 0, l = data.length; i < l; i ++ ) {\n\n\t\t\t\t\tif ( data[ i ].isDataTexture ) {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ].image ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ] ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// texture\n\n\t\t\t\turl = serializeImage( data );\n\n\t\t\t}\n\n\t\t\toutput.url = url;\n\n\t\t}\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.images[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n\nfunction serializeImage( image ) {\n\n\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t// default images\n\n\t\treturn ImageUtils.getDataURL( image );\n\n\t} else {\n\n\t\tif ( image.data ) {\n\n\t\t\t// images of DataTexture\n\n\t\t\treturn {\n\t\t\t\tdata: Array.from( image.data ),\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height,\n\t\t\t\ttype: image.data.constructor.name\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Texture: Unable to serialize Texture.' );\n\t\t\treturn {};\n\n\t\t}\n\n\t}\n\n}\n\nlet _textureId = 0;\n\nclass Texture extends EventDispatcher {\n\n\tconstructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace ) {\n\n\t\tsuper();\n\n\t\tthis.isTexture = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _textureId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\n\t\tthis.source = new Source( image );\n\t\tthis.mipmaps = [];\n\n\t\tthis.mapping = mapping;\n\t\tthis.channel = 0;\n\n\t\tthis.wrapS = wrapS;\n\t\tthis.wrapT = wrapT;\n\n\t\tthis.magFilter = magFilter;\n\t\tthis.minFilter = minFilter;\n\n\t\tthis.anisotropy = anisotropy;\n\n\t\tthis.format = format;\n\t\tthis.internalFormat = null;\n\t\tthis.type = type;\n\n\t\tthis.offset = new Vector2( 0, 0 );\n\t\tthis.repeat = new Vector2( 1, 1 );\n\t\tthis.center = new Vector2( 0, 0 );\n\t\tthis.rotation = 0;\n\n\t\tthis.matrixAutoUpdate = true;\n\t\tthis.matrix = new Matrix3();\n\n\t\tthis.generateMipmaps = true;\n\t\tthis.premultiplyAlpha = false;\n\t\tthis.flipY = true;\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\t\tthis.colorSpace = colorSpace;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\t\tthis.onUpdate = null;\n\n\t\tthis.isRenderTargetTexture = false; // indicates whether a texture belongs to a render target or not\n\t\tthis.pmremVersion = 0; // indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures)\n\n\t}\n\n\tget image() {\n\n\t\treturn this.source.data;\n\n\t}\n\n\tset image( value = null ) {\n\n\t\tthis.source.data = value;\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.source = source.source;\n\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\tthis.mapping = source.mapping;\n\t\tthis.channel = source.channel;\n\n\t\tthis.wrapS = source.wrapS;\n\t\tthis.wrapT = source.wrapT;\n\n\t\tthis.magFilter = source.magFilter;\n\t\tthis.minFilter = source.minFilter;\n\n\t\tthis.anisotropy = source.anisotropy;\n\n\t\tthis.format = source.format;\n\t\tthis.internalFormat = source.internalFormat;\n\t\tthis.type = source.type;\n\n\t\tthis.offset.copy( source.offset );\n\t\tthis.repeat.copy( source.repeat );\n\t\tthis.center.copy( source.center );\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrix.copy( source.matrix );\n\n\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\tthis.flipY = source.flipY;\n\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\tthis.colorSpace = source.colorSpace;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tthis.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Texture',\n\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t},\n\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\n\t\t\timage: this.source.toJSON( meta ).uuid,\n\n\t\t\tmapping: this.mapping,\n\t\t\tchannel: this.channel,\n\n\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\tcenter: [ this.center.x, this.center.y ],\n\t\t\trotation: this.rotation,\n\n\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\tformat: this.format,\n\t\t\tinternalFormat: this.internalFormat,\n\t\t\ttype: this.type,\n\t\t\tcolorSpace: this.colorSpace,\n\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\n\t\t\tflipY: this.flipY,\n\n\t\t\tgenerateMipmaps: this.generateMipmaps,\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\n\t\t};\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) output.userData = this.userData;\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\ttransformUv( uv ) {\n\n\t\tif ( this.mapping !== UVMapping ) return uv;\n\n\t\tuv.applyMatrix3( this.matrix );\n\n\t\tif ( uv.x < 0 || uv.x > 1 ) {\n\n\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( uv.y < 0 || uv.y > 1 ) {\n\n\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.flipY ) {\n\n\t\t\tuv.y = 1 - uv.y;\n\n\t\t}\n\n\t\treturn uv;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.version ++;\n\t\t\tthis.source.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tset needsPMREMUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.pmremVersion ++;\n\n\t\t}\n\n\t}\n\n}\n\nTexture.DEFAULT_IMAGE = null;\nTexture.DEFAULT_MAPPING = UVMapping;\nTexture.DEFAULT_ANISOTROPY = 1;\n\nclass Vector4 {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tVector4.prototype.isVector4 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\t\tthis.w = Math.max( min.w, Math.min( max.w, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\t\tthis.w = Math.max( minVal, Math.min( maxVal, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\n/*\n In options, we can specify:\n * Texture parameters for an auto-generated target texture\n * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n*/\nclass RenderTarget extends EventDispatcher {\n\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.isRenderTarget = true;\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.depth = 1;\n\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\t\tthis.scissorTest = false;\n\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\tconst image = { width: width, height: height, depth: 1 };\n\n\t\toptions = Object.assign( {\n\t\t\tgenerateMipmaps: false,\n\t\t\tinternalFormat: null,\n\t\t\tminFilter: LinearFilter,\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tresolveDepthBuffer: true,\n\t\t\tresolveStencilBuffer: true,\n\t\t\tdepthTexture: null,\n\t\t\tsamples: 0,\n\t\t\tcount: 1\n\t\t}, options );\n\n\t\tconst texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );\n\n\t\ttexture.flipY = false;\n\t\ttexture.generateMipmaps = options.generateMipmaps;\n\t\ttexture.internalFormat = options.internalFormat;\n\n\t\tthis.textures = [];\n\n\t\tconst count = options.count;\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.textures[ i ] = texture.clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\n\t\t}\n\n\t\tthis.depthBuffer = options.depthBuffer;\n\t\tthis.stencilBuffer = options.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = options.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = options.resolveStencilBuffer;\n\n\t\tthis.depthTexture = options.depthTexture;\n\n\t\tthis.samples = options.samples;\n\n\t}\n\n\tget texture() {\n\n\t\treturn this.textures[ 0 ];\n\n\t}\n\n\tset texture( value ) {\n\n\t\tthis.textures[ 0 ] = value;\n\n\t}\n\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tfor ( let i = 0, il = this.textures.length; i < il; i ++ ) {\n\n\t\t\t\tthis.textures[ i ].image.width = width;\n\t\t\t\tthis.textures[ i ].image.height = height;\n\t\t\t\tthis.textures[ i ].image.depth = depth;\n\n\t\t\t}\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.scissor.copy( source.scissor );\n\t\tthis.scissorTest = source.scissorTest;\n\n\t\tthis.viewport.copy( source.viewport );\n\n\t\tthis.textures.length = 0;\n\n\t\tfor ( let i = 0, il = source.textures.length; i < il; i ++ ) {\n\n\t\t\tthis.textures[ i ] = source.textures[ i ].clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\n\t\t}\n\n\t\t// ensure image object is not shared, see #20328\n\n\t\tconst image = Object.assign( {}, source.texture.image );\n\t\tthis.texture.source = new Source( image );\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = source.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = source.resolveStencilBuffer;\n\n\t\tif ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();\n\n\t\tthis.samples = source.samples;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nclass WebGLRenderTarget extends RenderTarget {\n\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGLRenderTarget = true;\n\n\t}\n\n}\n\nclass DataArrayTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\tsuper( null );\n\n\t\tthis.isDataArrayTexture = true;\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nclass WebGLArrayRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGLArrayRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\tthis.texture = new DataArrayTexture( null, width, height, depth );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\nclass Data3DTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t// Users can still set in DataTexture3D directly.\n\t\t//\n\t\t//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n\t\t// \ttexture.anisotropy = 16;\n\t\t//\n\t\t// See #14839\n\n\t\tsuper( null );\n\n\t\tthis.isData3DTexture = true;\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nclass WebGL3DRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGL3DRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\nclass Quaternion {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tthis.isQuaternion = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t}\n\n\tstatic slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\tlet x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( t === 0 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( t === 1 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x1;\n\t\t\tdst[ dstOffset + 1 ] = y1;\n\t\t\tdst[ dstOffset + 2 ] = z1;\n\t\t\tdst[ dstOffset + 3 ] = w1;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\tdir = ( cos >= 0 ? 1 : - 1 ),\n\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\tconst sin = Math.sqrt( sqrSin ),\n\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t// Normalize in case we just did a lerp:\n\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\tconst f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n\tstatic multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) {\n\n\t\tconst x0 = src0[ srcOffset0 ];\n\t\tconst y0 = src0[ srcOffset0 + 1 ];\n\t\tconst z0 = src0[ srcOffset0 + 2 ];\n\t\tconst w0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 ];\n\t\tconst y1 = src1[ srcOffset1 + 1 ];\n\t\tconst z1 = src1[ srcOffset1 + 2 ];\n\t\tconst w1 = src1[ srcOffset1 + 3 ];\n\n\t\tdst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\n\t\treturn dst;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget w() {\n\n\t\treturn this._w;\n\n\t}\n\n\tset w( value ) {\n\n\t\tthis._w = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t}\n\n\tcopy( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromEuler( euler, update = true ) {\n\n\t\tconst x = euler._x, y = euler._y, z = euler._z, order = euler._order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\n\t\tconst c1 = cos( x / 2 );\n\t\tconst c2 = cos( y / 2 );\n\t\tconst c3 = cos( z / 2 );\n\n\t\tconst s1 = sin( x / 2 );\n\t\tconst s2 = sin( y / 2 );\n\t\tconst s3 = sin( z / 2 );\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAxisAngle( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\t// assumes axis is normalized\n\n\t\tconst halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif ( trace > 0 ) {\n\n\t\t\tconst s = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromUnitVectors( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tlet r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r < Number.EPSILON ) {\n\n\t\t\t// vFrom and vTo point in opposite directions\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t}\n\n\tangleTo( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( clamp( this.dot( q ), - 1, 1 ) ) );\n\n\t}\n\n\trotateTowards( q, step ) {\n\n\t\tconst angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tconst t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\treturn this.set( 0, 0, 0, 1 );\n\n\t}\n\n\tinvert() {\n\n\t\t// quaternion is assumed to have unit length\n\n\t\treturn this.conjugate();\n\n\t}\n\n\tconjugate() {\n\n\t\tthis._x *= - 1;\n\t\tthis._y *= - 1;\n\t\tthis._z *= - 1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t}\n\n\tnormalize() {\n\n\t\tlet l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t}\n\n\tpremultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t}\n\n\tmultiplyQuaternions( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tconst qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tconst qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerp( qb, t ) {\n\n\t\tif ( t === 0 ) return this;\n\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\tconst x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\tthis._w = - qb._w;\n\t\t\tthis._x = - qb._x;\n\t\t\tthis._y = - qb._y;\n\t\t\tthis._z = - qb._z;\n\n\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t} else {\n\n\t\t\tthis.copy( qb );\n\n\t\t}\n\n\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif ( sqrSinHalfTheta <= Number.EPSILON ) {\n\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\n\t\t\tthis.normalize(); // normalize calls _onChangeCallback()\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt( sqrSinHalfTheta );\n\t\tconst halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\tconst ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerpQuaternions( qa, qb, t ) {\n\n\t\treturn this.copy( qa ).slerp( qb, t );\n\n\t}\n\n\trandom() {\n\n\t\t// sets this quaternion to a uniform random unit quaternnion\n\n\t\t// Ken Shoemake\n\t\t// Uniform random rotations\n\t\t// D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.\n\n\t\tconst theta1 = 2 * Math.PI * Math.random();\n\t\tconst theta2 = 2 * Math.PI * Math.random();\n\n\t\tconst x0 = Math.random();\n\t\tconst r1 = Math.sqrt( 1 - x0 );\n\t\tconst r2 = Math.sqrt( x0 );\n\n\t\treturn this.set(\n\t\t\tr1 * Math.sin( theta1 ),\n\t\t\tr1 * Math.cos( theta1 ),\n\t\t\tr2 * Math.sin( theta2 ),\n\t\t\tr2 * Math.cos( theta2 ),\n\t\t);\n\n\t}\n\n\tequals( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis._x = attribute.getX( index );\n\t\tthis._y = attribute.getY( index );\n\t\tthis._z = attribute.getZ( index );\n\t\tthis._w = attribute.getW( index );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.toArray();\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\n\t}\n\n}\n\nclass Vector3 {\n\n\tconstructor( x = 0, y = 0, z = 0 ) {\n\n\t\tVector3.prototype.isVector3 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t}\n\n\tset( x, y, z ) {\n\n\t\tif ( z === undefined ) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyVectors( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyEuler( euler ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );\n\n\t}\n\n\tapplyAxisAngle( axis, angle ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\treturn this.applyMatrix3( m ).normalize();\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tconst w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\t// quaternion q is assumed to have unit length\n\n\t\tconst vx = this.x, vy = this.y, vz = this.z;\n\t\tconst qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// t = 2 * cross( q.xyz, v );\n\t\tconst tx = 2 * ( qy * vz - qz * vy );\n\t\tconst ty = 2 * ( qz * vx - qx * vz );\n\t\tconst tz = 2 * ( qx * vy - qy * vx );\n\n\t\t// v + q.w * t + cross( q.xyz, t );\n\t\tthis.x = vx + qw * tx + qy * tz - qz * ty;\n\t\tthis.y = vy + qw * ty + qz * tx - qx * tz;\n\t\tthis.z = vz + qw * tz + qx * ty - qy * tx;\n\n\t\treturn this;\n\n\t}\n\n\tproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t}\n\n\tunproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t}\n\n\t// TODO lengthSquared?\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tcross( v ) {\n\n\t\treturn this.crossVectors( this, v );\n\n\t}\n\n\tcrossVectors( a, b ) {\n\n\t\tconst ax = a.x, ay = a.y, az = a.z;\n\t\tconst bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t}\n\n\tprojectOnVector( v ) {\n\n\t\tconst denominator = v.lengthSq();\n\n\t\tif ( denominator === 0 ) return this.set( 0, 0, 0 );\n\n\t\tconst scalar = v.dot( this ) / denominator;\n\n\t\treturn this.copy( v ).multiplyScalar( scalar );\n\n\t}\n\n\tprojectOnPlane( planeNormal ) {\n\n\t\t_vector$c.copy( this ).projectOnVector( planeNormal );\n\n\t\treturn this.sub( _vector$c );\n\n\t}\n\n\treflect( normal ) {\n\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\n\t\treturn this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t}\n\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, - 1, 1 ) );\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t}\n\n\tsetFromSpherical( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t}\n\n\tsetFromSphericalCoords( radius, phi, theta ) {\n\n\t\tconst sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCylindrical( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t}\n\n\tsetFromCylindricalCoords( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixScale( m ) {\n\n\t\tconst sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tconst sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tconst sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixColumn( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t}\n\n\tsetFromMatrix3Column( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 3 );\n\n\t}\n\n\tsetFromEuler( e ) {\n\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromColor( c ) {\n\n\t\tthis.x = c.r;\n\t\tthis.y = c.g;\n\t\tthis.z = c.b;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\trandomDirection() {\n\n\t\t// https://mathworld.wolfram.com/SpherePointPicking.html\n\n\t\tconst theta = Math.random() * Math.PI * 2;\n\t\tconst u = Math.random() * 2 - 1;\n\t\tconst c = Math.sqrt( 1 - u * u );\n\n\t\tthis.x = c * Math.cos( theta );\n\t\tthis.y = u;\n\t\tthis.z = c * Math.sin( theta );\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\n\t}\n\n}\n\nconst _vector$c = /*@__PURE__*/ new Vector3();\nconst _quaternion$4 = /*@__PURE__*/ new Quaternion();\n\nclass Box3 {\n\n\tconstructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {\n\n\t\tthis.isBox3 = true;\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromArray( array ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = array.length; i < il; i += 3 ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromArray( array, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromBufferAttribute( attribute ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = attribute.count; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromBufferAttribute( attribute, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 );\n\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromObject( object, precise = false ) {\n\n\t\tthis.makeEmpty();\n\n\t\treturn this.expandByObject( object, precise );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\texpandByObject( object, precise = false ) {\n\n\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t// accounting for both the object's, and children's, world transforms\n\n\t\tobject.updateWorldMatrix( false, false );\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry !== undefined ) {\n\n\t\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\t\t// precise AABB computation based on vertex data requires at least a position attribute.\n\t\t\t// instancing isn't supported so far and uses the normal (conservative) code path.\n\n\t\t\tif ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {\n\n\t\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t\tif ( object.isMesh === true ) {\n\n\t\t\t\t\t\tobject.getVertexPosition( i, _vector$b );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_vector$b.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_vector$b.applyMatrix4( object.matrixWorld );\n\t\t\t\t\tthis.expandByPoint( _vector$b );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( object.boundingBox !== undefined ) {\n\n\t\t\t\t\t// object-level bounding box\n\n\t\t\t\t\tif ( object.boundingBox === null ) {\n\n\t\t\t\t\t\tobject.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( object.boundingBox );\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// geometry-level bounding box\n\n\t\t\t\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\t\t\t\tgeometry.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( geometry.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\t_box$4.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tthis.union( _box$4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tthis.expandByObject( children[ i ], precise );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x < this.min.x || point.x > this.max.x ||\n\t\t\tpoint.y < this.min.y || point.y > this.max.y ||\n\t\t\tpoint.z < this.min.z || point.z > this.max.z ? false : true;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y &&\n\t\t\tthis.min.z <= box.min.z && box.max.z <= this.max.z;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\tbox.max.y < this.min.y || box.min.y > this.max.y ||\n\t\t\tbox.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint( sphere.center, _vector$b );\n\n\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\treturn _vector$b.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\tlet min, max;\n\n\t\tif ( plane.normal.x > 0 ) {\n\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t} else {\n\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t}\n\n\t\tif ( plane.normal.y > 0 ) {\n\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t}\n\n\t\tif ( plane.normal.z > 0 ) {\n\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t}\n\n\t\treturn ( min <= - plane.constant && max >= - plane.constant );\n\n\t}\n\n\tintersectsTriangle( triangle ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// compute box center and extents\n\t\tthis.getCenter( _center );\n\t\t_extents.subVectors( this.max, _center );\n\n\t\t// translate triangle to aabb origin\n\t\t_v0$2.subVectors( triangle.a, _center );\n\t\t_v1$7.subVectors( triangle.b, _center );\n\t\t_v2$4.subVectors( triangle.c, _center );\n\n\t\t// compute edge vectors for triangle\n\t\t_f0.subVectors( _v1$7, _v0$2 );\n\t\t_f1.subVectors( _v2$4, _v1$7 );\n\t\t_f2.subVectors( _v0$2, _v2$4 );\n\n\t\t// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\t\tlet axes = [\n\t\t\t0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,\n\t\t\t_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,\n\t\t\t- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0\n\t\t];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// test 3 face normals from the aabb\n\t\taxes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\t\t_triangleNormal.crossVectors( _f0, _f1 );\n\t\taxes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];\n\n\t\treturn satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents );\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$b ).distanceTo( point );\n\n\t}\n\n\tgetBoundingSphere( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\ttarget.makeEmpty();\n\n\t\t} else {\n\n\t\t\tthis.getCenter( target.center );\n\n\t\t\ttarget.radius = this.getSize( _vector$b ).length() * 0.5;\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\t// transform of empty box is an empty box.\n\t\tif ( this.isEmpty() ) return this;\n\n\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111\n\n\t\tthis.setFromPoints( _points );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _points = [\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3()\n];\n\nconst _vector$b = /*@__PURE__*/ new Vector3();\n\nconst _box$4 = /*@__PURE__*/ new Box3();\n\n// triangle centered vertices\n\nconst _v0$2 = /*@__PURE__*/ new Vector3();\nconst _v1$7 = /*@__PURE__*/ new Vector3();\nconst _v2$4 = /*@__PURE__*/ new Vector3();\n\n// triangle edge vectors\n\nconst _f0 = /*@__PURE__*/ new Vector3();\nconst _f1 = /*@__PURE__*/ new Vector3();\nconst _f2 = /*@__PURE__*/ new Vector3();\n\nconst _center = /*@__PURE__*/ new Vector3();\nconst _extents = /*@__PURE__*/ new Vector3();\nconst _triangleNormal = /*@__PURE__*/ new Vector3();\nconst _testAxis = /*@__PURE__*/ new Vector3();\n\nfunction satForAxes( axes, v0, v1, v2, extents ) {\n\n\tfor ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) {\n\n\t\t_testAxis.fromArray( axes, i );\n\t\t// project the aabb onto the separating axis\n\t\tconst r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );\n\t\t// project all 3 vertices of the triangle onto the separating axis\n\t\tconst p0 = v0.dot( _testAxis );\n\t\tconst p1 = v1.dot( _testAxis );\n\t\tconst p2 = v2.dot( _testAxis );\n\t\t// actual test, basically see if either of the most extreme of the triangle points intersects r\n\t\tif ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) {\n\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nconst _box$3 = /*@__PURE__*/ new Box3();\nconst _v1$6 = /*@__PURE__*/ new Vector3();\nconst _v2$3 = /*@__PURE__*/ new Vector3();\n\nclass Sphere {\n\n\tconstructor( center = new Vector3(), radius = - 1 ) {\n\n\t\tthis.isSphere = true;\n\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\n\t}\n\n\tset( center, radius ) {\n\n\t\tthis.center.copy( center );\n\t\tthis.radius = radius;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points, optionalCenter ) {\n\n\t\tconst center = this.center;\n\n\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\tcenter.copy( optionalCenter );\n\n\t\t} else {\n\n\t\t\t_box$3.setFromPoints( points ).getCenter( center );\n\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t}\n\n\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( sphere ) {\n\n\t\tthis.center.copy( sphere.center );\n\t\tthis.radius = sphere.radius;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\treturn ( this.radius < 0 );\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.center.set( 0, 0, 0 );\n\t\tthis.radius = - 1;\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst radiusSum = this.radius + sphere.radius;\n\n\t\treturn sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsSphere( this );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\treturn Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\tconst deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\ttarget.copy( point );\n\n\t\tif ( deltaLengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\ttarget.sub( this.center ).normalize();\n\t\t\ttarget.multiplyScalar( this.radius ).add( this.center );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\tgetBoundingBox( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\n\t\t}\n\n\t\ttarget.set( this.center, this.center );\n\t\ttarget.expandByScalar( this.radius );\n\n\t\treturn target;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.center.applyMatrix4( matrix );\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.center.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.center.copy( point );\n\n\t\t\tthis.radius = 0;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_v1$6.subVectors( point, this.center );\n\n\t\tconst lengthSq = _v1$6.lengthSq();\n\n\t\tif ( lengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\t// calculate the minimal sphere\n\n\t\t\tconst length = Math.sqrt( lengthSq );\n\n\t\t\tconst delta = ( length - this.radius ) * 0.5;\n\n\t\t\tthis.center.addScaledVector( _v1$6, delta / length );\n\n\t\t\tthis.radius += delta;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tunion( sphere ) {\n\n\t\tif ( sphere.isEmpty() ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.copy( sphere );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.center.equals( sphere.center ) === true ) {\n\n\t\t\t this.radius = Math.max( this.radius, sphere.radius );\n\n\t\t} else {\n\n\t\t\t_v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tequals( sphere ) {\n\n\t\treturn sphere.center.equals( this.center ) && ( sphere.radius === this.radius );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$a = /*@__PURE__*/ new Vector3();\nconst _segCenter = /*@__PURE__*/ new Vector3();\nconst _segDir = /*@__PURE__*/ new Vector3();\nconst _diff = /*@__PURE__*/ new Vector3();\n\nconst _edge1 = /*@__PURE__*/ new Vector3();\nconst _edge2 = /*@__PURE__*/ new Vector3();\nconst _normal$1 = /*@__PURE__*/ new Vector3();\n\nclass Ray {\n\n\tconstructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) {\n\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\tthis.origin.copy( origin );\n\t\tthis.direction.copy( direction );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( ray ) {\n\n\t\tthis.origin.copy( ray.origin );\n\t\tthis.direction.copy( ray.direction );\n\n\t\treturn this;\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, t );\n\n\t}\n\n\tlookAt( v ) {\n\n\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\trecast( t ) {\n\n\t\tthis.origin.copy( this.at( t, _vector$a ) );\n\n\t\treturn this;\n\n\t}\n\n\tclosestPointToPoint( point, target ) {\n\n\t\ttarget.subVectors( point, this.origin );\n\n\t\tconst directionDistance = target.dot( this.direction );\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn target.copy( this.origin );\n\n\t\t}\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t}\n\n\tdistanceSqToPoint( point ) {\n\n\t\tconst directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t// point behind the ray\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t}\n\n\t\t_vector$a.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t\treturn _vector$a.distanceToSquared( point );\n\n\t}\n\n\tdistanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\n\t\t_segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t_segDir.copy( v1 ).sub( v0 ).normalize();\n\t\t_diff.copy( this.origin ).sub( _segCenter );\n\n\t\tconst segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\tconst a01 = - this.direction.dot( _segDir );\n\t\tconst b0 = _diff.dot( this.direction );\n\t\tconst b1 = - _diff.dot( _segDir );\n\t\tconst c = _diff.lengthSq();\n\t\tconst det = Math.abs( 1 - a01 * a01 );\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif ( det > 0 ) {\n\n\t\t\t// The ray and segment are not parallel.\n\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif ( s0 >= 0 ) {\n\n\t\t\t\tif ( s1 >= - extDet ) {\n\n\t\t\t\t\tif ( s1 <= extDet ) {\n\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 5\n\n\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( s1 <= - extDet ) {\n\n\t\t\t\t\t// region 4\n\n\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else if ( s1 <= extDet ) {\n\n\t\t\t\t\t// region 3\n\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 2\n\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ray and segment are parallel.\n\n\t\t\ts1 = ( a01 > 0 ) ? - segExtent : segExtent;\n\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t}\n\n\t\tif ( optionalPointOnRay ) {\n\n\t\t\toptionalPointOnRay.copy( this.origin ).addScaledVector( this.direction, s0 );\n\n\t\t}\n\n\t\tif ( optionalPointOnSegment ) {\n\n\t\t\toptionalPointOnSegment.copy( _segCenter ).addScaledVector( _segDir, s1 );\n\n\t\t}\n\n\t\treturn sqrDist;\n\n\t}\n\n\tintersectSphere( sphere, target ) {\n\n\t\t_vector$a.subVectors( sphere.center, this.origin );\n\t\tconst tca = _vector$a.dot( this.direction );\n\t\tconst d2 = _vector$a.dot( _vector$a ) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\n\t\tif ( d2 > radius2 ) return null;\n\n\t\tconst thc = Math.sqrt( radius2 - d2 );\n\n\t\t// t0 = first intersect point - entrance on front of sphere\n\t\tconst t0 = tca - thc;\n\n\t\t// t1 = second intersect point - exit point on back of sphere\n\t\tconst t1 = tca + thc;\n\n\t\t// test to see if t1 is behind the ray - if so, return null\n\t\tif ( t1 < 0 ) return null;\n\n\t\t// test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\t\tif ( t0 < 0 ) return this.at( t1, target );\n\n\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\treturn this.at( t0, target );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tdistanceToPlane( plane ) {\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t// Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\n\t}\n\n\tintersectPlane( plane, target ) {\n\n\t\tconst t = this.distanceToPlane( plane );\n\n\t\tif ( t === null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn this.at( t, target );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// check if the ray lies on the plane first\n\n\t\tconst distToPoint = plane.distanceToPoint( this.origin );\n\n\t\tif ( distToPoint === 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator * distToPoint < 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\treturn false;\n\n\t}\n\n\tintersectBox( box, target ) {\n\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\tconst origin = this.origin;\n\n\t\tif ( invdirx >= 0 ) {\n\n\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t} else {\n\n\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t}\n\n\t\tif ( invdiry >= 0 ) {\n\n\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t} else {\n\n\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t}\n\n\t\tif ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;\n\n\t\tif ( tymin > tmin || isNaN( tmin ) ) tmin = tymin;\n\n\t\tif ( tymax < tmax || isNaN( tmax ) ) tmax = tymax;\n\n\t\tif ( invdirz >= 0 ) {\n\n\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t} else {\n\n\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t}\n\n\t\tif ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null;\n\n\t\tif ( tzmin > tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\tif ( tzmax < tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t//return point closest to the ray (positive side)\n\n\t\tif ( tmax < 0 ) return null;\n\n\t\treturn this.at( tmin >= 0 ? tmin : tmax, target );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn this.intersectBox( box, _vector$a ) !== null;\n\n\t}\n\n\tintersectTriangle( a, b, c, backfaceCulling, target ) {\n\n\t\t// Compute the offset origin, edges, and normal.\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t_edge1.subVectors( b, a );\n\t\t_edge2.subVectors( c, a );\n\t\t_normal$1.crossVectors( _edge1, _edge2 );\n\n\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\tlet DdN = this.direction.dot( _normal$1 );\n\t\tlet sign;\n\n\t\tif ( DdN > 0 ) {\n\n\t\t\tif ( backfaceCulling ) return null;\n\t\t\tsign = 1;\n\n\t\t} else if ( DdN < 0 ) {\n\n\t\t\tsign = - 1;\n\t\t\tDdN = - DdN;\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_diff.subVectors( this.origin, a );\n\t\tconst DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) );\n\n\t\t// b1 < 0, no intersection\n\t\tif ( DdQxE2 < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) );\n\n\t\t// b2 < 0, no intersection\n\t\tif ( DdE1xQ < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// b1+b2 > 1, no intersection\n\t\tif ( DdQxE2 + DdE1xQ > DdN ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Line intersects triangle, check if ray does.\n\t\tconst QdN = - sign * _diff.dot( _normal$1 );\n\n\t\t// t < 0, no intersection\n\t\tif ( QdN < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Ray intersects triangle.\n\t\treturn this.at( QdN / DdN, target );\n\n\t}\n\n\tapplyMatrix4( matrix4 ) {\n\n\t\tthis.origin.applyMatrix4( matrix4 );\n\t\tthis.direction.transformDirection( matrix4 );\n\n\t\treturn this;\n\n\t}\n\n\tequals( ray ) {\n\n\t\treturn ray.origin.equals( this.origin ) && ray.direction.equals( this.direction );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass Matrix4 {\n\n\tconstructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tMatrix4.prototype.isMatrix4 = true;\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\tcopyPosition( m ) {\n\n\t\tconst te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix3( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 3 ], me[ 6 ], 0,\n\t\t\tme[ 1 ], me[ 4 ], me[ 7 ], 0,\n\t\t\tme[ 2 ], me[ 5 ], me[ 8 ], 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tmakeBasis( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractRotation( m ) {\n\n\t\t// this method does not support reflection matrices\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length();\n\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length();\n\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length();\n\n\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromEuler( euler ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = euler.x, y = euler.y, z = euler.z;\n\t\tconst a = Math.cos( x ), b = Math.sin( x );\n\t\tconst c = Math.cos( y ), d = Math.sin( y );\n\t\tconst e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromQuaternion( q ) {\n\n\t\treturn this.compose( _zero, q, _one );\n\n\t}\n\n\tlookAt( eye, target, up ) {\n\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors( eye, target );\n\n\t\tif ( _z.lengthSq() === 0 ) {\n\n\t\t\t// eye and target are in the same position\n\n\t\t\t_z.z = 1;\n\n\t\t}\n\n\t\t_z.normalize();\n\t\t_x.crossVectors( up, _z );\n\n\t\tif ( _x.lengthSq() === 0 ) {\n\n\t\t\t// up and z are parallel\n\n\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t_z.x += 0.0001;\n\n\t\t\t} else {\n\n\t\t\t\t_z.z += 0.0001;\n\n\t\t\t}\n\n\t\t\t_z.normalize();\n\t\t\t_x.crossVectors( up, _z );\n\n\t\t}\n\n\t\t_x.normalize();\n\t\t_y.crossVectors( _z, _x );\n\n\t\tte[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x;\n\t\tte[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y;\n\t\tte[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tconst a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tconst b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tconst n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tconst n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tconst n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t//TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn (\n\t\t\tn41 * (\n\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t - n13 * n24 * n32\n\t\t\t\t - n14 * n22 * n33\n\t\t\t\t + n12 * n24 * n33\n\t\t\t\t + n13 * n22 * n34\n\t\t\t\t - n12 * n23 * n34\n\t\t\t) +\n\t\t\tn42 * (\n\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t - n11 * n24 * n33\n\t\t\t\t + n14 * n21 * n33\n\t\t\t\t - n13 * n21 * n34\n\t\t\t\t + n13 * n24 * n31\n\t\t\t\t - n14 * n23 * n31\n\t\t\t) +\n\t\t\tn43 * (\n\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t - n11 * n22 * n34\n\t\t\t\t - n14 * n21 * n32\n\t\t\t\t + n12 * n21 * n34\n\t\t\t\t + n14 * n22 * n31\n\t\t\t\t - n12 * n24 * n31\n\t\t\t) +\n\t\t\tn44 * (\n\t\t\t\t- n13 * n22 * n31\n\t\t\t\t - n11 * n23 * n32\n\t\t\t\t + n11 * n22 * n33\n\t\t\t\t + n13 * n21 * n32\n\t\t\t\t - n12 * n21 * n33\n\t\t\t\t + n12 * n23 * n31\n\t\t\t)\n\n\t\t);\n\n\t}\n\n\ttranspose() {\n\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tsetPosition( x, y, z ) {\n\n\t\tconst te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tinvert() {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ],\n\t\t\tn12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ],\n\t\t\tn13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ],\n\t\t\tn14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\tscale( v ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxScaleOnAxis() {\n\n\t\tconst te = this.elements;\n\n\t\tconst scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tconst scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tconst scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t}\n\n\tmakeTranslation( x, y, z ) {\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x.x,\n\t\t\t\t0, 1, 0, x.y,\n\t\t\t\t0, 0, 1, x.z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationX( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationY( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationZ( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationAxis( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tconst c = Math.cos( angle );\n\t\tconst s = Math.sin( angle );\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x, y = axis.y, z = axis.z;\n\t\tconst tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeScale( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeShear( xy, xz, yx, yz, zx, zy ) {\n\n\t\tthis.set(\n\n\t\t\t1, yx, zx, 0,\n\t\t\txy, 1, zy, 0,\n\t\t\txz, yz, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tconst x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tconst xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tconst yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tconst wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tconst sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tdecompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\tconst sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\tconst sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t// if determine is negative, we need to invert one scale\n\t\tconst det = this.determinant();\n\t\tif ( det < 0 ) sx = - sx;\n\n\t\tposition.x = te[ 12 ];\n\t\tposition.y = te[ 13 ];\n\t\tposition.z = te[ 14 ];\n\n\t\t// scale the rotation part\n\t\t_m1$4.copy( this );\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\n\t\t_m1$4.elements[ 0 ] *= invSX;\n\t\t_m1$4.elements[ 1 ] *= invSX;\n\t\t_m1$4.elements[ 2 ] *= invSX;\n\n\t\t_m1$4.elements[ 4 ] *= invSY;\n\t\t_m1$4.elements[ 5 ] *= invSY;\n\t\t_m1$4.elements[ 6 ] *= invSY;\n\n\t\t_m1$4.elements[ 8 ] *= invSZ;\n\t\t_m1$4.elements[ 9 ] *= invSZ;\n\t\t_m1$4.elements[ 10 ] *= invSZ;\n\n\t\tquaternion.setFromRotationMatrix( _m1$4 );\n\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tmakePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / ( right - left );\n\t\tconst y = 2 * near / ( top - bottom );\n\n\t\tconst a = ( right + left ) / ( right - left );\n\t\tconst b = ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tc = - ( far + near ) / ( far - near );\n\t\t\td = ( - 2 * far * near ) / ( far - near );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tc = - far / ( far - near );\n\t\t\td = ( - far * near ) / ( far - near );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a; \tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b; \tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c; \tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = - 1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t}\n\n\tmakeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / ( right - left );\n\t\tconst h = 1.0 / ( top - bottom );\n\t\tconst p = 1.0 / ( far - near );\n\n\t\tconst x = ( right + left ) * w;\n\t\tconst y = ( top + bottom ) * h;\n\n\t\tlet z, zInv;\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tz = ( far + near ) * p;\n\t\t\tzInv = - 2 * p;\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tz = near * p;\n\t\t\tzInv = - 1 * p;\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tte[ 0 ] = 2 * w;\tte[ 4 ] = 0;\t\tte[ 8 ] = 0; \t\tte[ 12 ] = - x;\n\t\tte[ 1 ] = 0; \t\tte[ 5 ] = 2 * h;\tte[ 9 ] = 0; \t\tte[ 13 ] = - y;\n\t\tte[ 2 ] = 0; \t\tte[ 6 ] = 0;\t\tte[ 10 ] = zInv;\tte[ 14 ] = - z;\n\t\tte[ 3 ] = 0; \t\tte[ 7 ] = 0;\t\tte[ 11 ] = 0;\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n}\n\nconst _v1$5 = /*@__PURE__*/ new Vector3();\nconst _m1$4 = /*@__PURE__*/ new Matrix4();\nconst _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );\nconst _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );\nconst _x = /*@__PURE__*/ new Vector3();\nconst _y = /*@__PURE__*/ new Vector3();\nconst _z = /*@__PURE__*/ new Vector3();\n\nconst _matrix$2 = /*@__PURE__*/ new Matrix4();\nconst _quaternion$3 = /*@__PURE__*/ new Quaternion();\n\nclass Euler {\n\n\tconstructor( x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER ) {\n\n\t\tthis.isEuler = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget order() {\n\n\t\treturn this._order;\n\n\t}\n\n\tset order( value ) {\n\n\t\tthis._order = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, order = this._order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t}\n\n\tcopy( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m, order = this._order, update = true ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements;\n\t\tconst m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tconst m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tconst m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromQuaternion( q, order, update ) {\n\n\t\t_matrix$2.makeRotationFromQuaternion( q );\n\n\t\treturn this.setFromRotationMatrix( _matrix$2, order, update );\n\n\t}\n\n\tsetFromVector3( v, order = this._order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order );\n\n\t}\n\n\treorder( newOrder ) {\n\n\t\t// WARNING: this discards revolution information -bhouston\n\n\t\t_quaternion$3.setFromEuler( this );\n\n\t\treturn this.setFromQuaternion( _quaternion$3, newOrder );\n\n\t}\n\n\tequals( euler ) {\n\n\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t}\n\n\tfromArray( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\n\t}\n\n}\n\nEuler.DEFAULT_ORDER = 'XYZ';\n\nclass Layers {\n\n\tconstructor() {\n\n\t\tthis.mask = 1 | 0;\n\n\t}\n\n\tset( channel ) {\n\n\t\tthis.mask = ( 1 << channel | 0 ) >>> 0;\n\n\t}\n\n\tenable( channel ) {\n\n\t\tthis.mask |= 1 << channel | 0;\n\n\t}\n\n\tenableAll() {\n\n\t\tthis.mask = 0xffffffff | 0;\n\n\t}\n\n\ttoggle( channel ) {\n\n\t\tthis.mask ^= 1 << channel | 0;\n\n\t}\n\n\tdisable( channel ) {\n\n\t\tthis.mask &= ~ ( 1 << channel | 0 );\n\n\t}\n\n\tdisableAll() {\n\n\t\tthis.mask = 0;\n\n\t}\n\n\ttest( layers ) {\n\n\t\treturn ( this.mask & layers.mask ) !== 0;\n\n\t}\n\n\tisEnabled( channel ) {\n\n\t\treturn ( this.mask & ( 1 << channel | 0 ) ) !== 0;\n\n\t}\n\n}\n\nlet _object3DId = 0;\n\nconst _v1$4 = /*@__PURE__*/ new Vector3();\nconst _q1 = /*@__PURE__*/ new Quaternion();\nconst _m1$3 = /*@__PURE__*/ new Matrix4();\nconst _target = /*@__PURE__*/ new Vector3();\n\nconst _position$3 = /*@__PURE__*/ new Vector3();\nconst _scale$2 = /*@__PURE__*/ new Vector3();\nconst _quaternion$2 = /*@__PURE__*/ new Quaternion();\n\nconst _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 );\nconst _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nconst _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );\n\nconst _addedEvent = { type: 'added' };\nconst _removedEvent = { type: 'removed' };\n\nconst _childaddedEvent = { type: 'childadded', child: null };\nconst _childremovedEvent = { type: 'childremoved', child: null };\n\nclass Object3D extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isObject3D = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _object3DId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Object3D';\n\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\tthis.up = Object3D.DEFAULT_UP.clone();\n\n\t\tconst position = new Vector3();\n\t\tconst rotation = new Euler();\n\t\tconst quaternion = new Quaternion();\n\t\tconst scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation._onChange( onRotationChange );\n\t\tquaternion._onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\tposition: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\tthis.matrix = new Matrix4();\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\tthis.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE;\n\n\t\tthis.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; // checked by the renderer\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\tthis.layers = new Layers();\n\t\tthis.visible = true;\n\n\t\tthis.castShadow = false;\n\t\tthis.receiveShadow = false;\n\n\t\tthis.frustumCulled = true;\n\t\tthis.renderOrder = 0;\n\n\t\tthis.animations = [];\n\n\t\tthis.userData = {};\n\n\t}\n\n\tonBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\tonAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tonAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tthis.matrix.premultiply( matrix );\n\n\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\tthis.quaternion.premultiply( q );\n\n\t\treturn this;\n\n\t}\n\n\tsetRotationFromAxisAngle( axis, angle ) {\n\n\t\t// assumes axis is normalized\n\n\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t}\n\n\tsetRotationFromEuler( euler ) {\n\n\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t}\n\n\tsetRotationFromMatrix( m ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t}\n\n\tsetRotationFromQuaternion( q ) {\n\n\t\t// assumes q is normalized\n\n\t\tthis.quaternion.copy( q );\n\n\t}\n\n\trotateOnAxis( axis, angle ) {\n\n\t\t// rotate object on axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.multiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateOnWorldAxis( axis, angle ) {\n\n\t\t// rotate object on axis in world space\n\t\t// axis is assumed to be normalized\n\t\t// method assumes no rotated parent\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.premultiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\treturn this.rotateOnAxis( _xAxis, angle );\n\n\t}\n\n\trotateY( angle ) {\n\n\t\treturn this.rotateOnAxis( _yAxis, angle );\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\treturn this.rotateOnAxis( _zAxis, angle );\n\n\t}\n\n\ttranslateOnAxis( axis, distance ) {\n\n\t\t// translate object by distance along axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_v1$4.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\tthis.position.add( _v1$4.multiplyScalar( distance ) );\n\n\t\treturn this;\n\n\t}\n\n\ttranslateX( distance ) {\n\n\t\treturn this.translateOnAxis( _xAxis, distance );\n\n\t}\n\n\ttranslateY( distance ) {\n\n\t\treturn this.translateOnAxis( _yAxis, distance );\n\n\t}\n\n\ttranslateZ( distance ) {\n\n\t\treturn this.translateOnAxis( _zAxis, distance );\n\n\t}\n\n\tlocalToWorld( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t}\n\n\tworldToLocal( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( _m1$3.copy( this.matrixWorld ).invert() );\n\n\t}\n\n\tlookAt( x, y, z ) {\n\n\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\t_target.copy( x );\n\n\t\t} else {\n\n\t\t\t_target.set( x, y, z );\n\n\t\t}\n\n\t\tconst parent = this.parent;\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_position$3.setFromMatrixPosition( this.matrixWorld );\n\n\t\tif ( this.isCamera || this.isLight ) {\n\n\t\t\t_m1$3.lookAt( _position$3, _target, this.up );\n\n\t\t} else {\n\n\t\t\t_m1$3.lookAt( _target, _position$3, this.up );\n\n\t\t}\n\n\t\tthis.quaternion.setFromRotationMatrix( _m1$3 );\n\n\t\tif ( parent ) {\n\n\t\t\t_m1$3.extractRotation( parent.matrixWorld );\n\t\t\t_q1.setFromRotationMatrix( _m1$3 );\n\t\t\tthis.quaternion.premultiply( _q1.invert() );\n\n\t\t}\n\n\t}\n\n\tadd( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object === this ) {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object can\\'t be added as a child of itself.', object );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object && object.isObject3D ) {\n\n\t\t\tobject.removeFromParent();\n\t\t\tobject.parent = this;\n\t\t\tthis.children.push( object );\n\n\t\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t\t_childaddedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t\t_childaddedEvent.child = null;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst index = this.children.indexOf( object );\n\n\t\tif ( index !== - 1 ) {\n\n\t\t\tobject.parent = null;\n\t\t\tthis.children.splice( index, 1 );\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t\t_childremovedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childremovedEvent );\n\t\t\t_childremovedEvent.child = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremoveFromParent() {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tparent.remove( this );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclear() {\n\n\t\treturn this.remove( ... this.children );\n\n\t}\n\n\tattach( object ) {\n\n\t\t// adds object as a child of this, while maintaining the object's world transform\n\n\t\t// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_m1$3.copy( this.matrixWorld ).invert();\n\n\t\tif ( object.parent !== null ) {\n\n\t\t\tobject.parent.updateWorldMatrix( true, false );\n\n\t\t\t_m1$3.multiply( object.parent.matrixWorld );\n\n\t\t}\n\n\t\tobject.applyMatrix4( _m1$3 );\n\n\t\tobject.removeFromParent();\n\t\tobject.parent = this;\n\t\tthis.children.push( object );\n\n\t\tobject.updateWorldMatrix( false, true );\n\n\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t_childaddedEvent.child = object;\n\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t_childaddedEvent.child = null;\n\n\t\treturn this;\n\n\t}\n\n\tgetObjectById( id ) {\n\n\t\treturn this.getObjectByProperty( 'id', id );\n\n\t}\n\n\tgetObjectByName( name ) {\n\n\t\treturn this.getObjectByProperty( 'name', name );\n\n\t}\n\n\tgetObjectByProperty( name, value ) {\n\n\t\tif ( this[ name ] === value ) return this;\n\n\t\tfor ( let i = 0, l = this.children.length; i < l; i ++ ) {\n\n\t\t\tconst child = this.children[ i ];\n\t\t\tconst object = child.getObjectByProperty( name, value );\n\n\t\t\tif ( object !== undefined ) {\n\n\t\t\t\treturn object;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tgetObjectsByProperty( name, value, result = [] ) {\n\n\t\tif ( this[ name ] === value ) result.push( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].getObjectsByProperty( name, value, result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tgetWorldPosition( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn target.setFromMatrixPosition( this.matrixWorld );\n\n\t}\n\n\tgetWorldQuaternion( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, target, _scale$2 );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldScale( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, _quaternion$2, target );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();\n\n\t}\n\n\traycast( /* raycaster, intersects */ ) {}\n\n\ttraverse( callback ) {\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverse( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseVisible( callback ) {\n\n\t\tif ( this.visible === false ) return;\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseAncestors( callback ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tcallback( parent );\n\n\t\t\tparent.traverseAncestors( callback );\n\n\t\t}\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\n\n\t\t\tif ( this.parent === null ) {\n\n\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t}\n\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\tforce = true;\n\n\t\t}\n\n\t\t// update children\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tif ( child.matrixWorldAutoUpdate === true || force === true ) {\n\n\t\t\t\tchild.updateMatrixWorld( force );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( updateParents === true && parent !== null && parent.matrixWorldAutoUpdate === true ) {\n\n\t\t\tparent.updateWorldMatrix( true, false );\n\n\t\t}\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.parent === null ) {\n\n\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t} else {\n\n\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t}\n\n\t\t// update children\n\n\t\tif ( updateChildren === true ) {\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tconst child = children[ i ];\n\n\t\t\t\tif ( child.matrixWorldAutoUpdate === true ) {\n\n\t\t\t\t\tchild.updateWorldMatrix( false, true );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\t// meta is a string when called from JSON.stringify\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tconst output = {};\n\n\t\t// meta is a hash used to collect geometries, materials.\n\t\t// not providing it implies that this is the root object\n\t\t// being serialized.\n\t\tif ( isRootObject ) {\n\n\t\t\t// initialize meta obj\n\t\t\tmeta = {\n\t\t\t\tgeometries: {},\n\t\t\t\tmaterials: {},\n\t\t\t\ttextures: {},\n\t\t\t\timages: {},\n\t\t\t\tshapes: {},\n\t\t\t\tskeletons: {},\n\t\t\t\tanimations: {},\n\t\t\t\tnodes: {}\n\t\t\t};\n\n\t\t\toutput.metadata = {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t};\n\n\t\t}\n\n\t\t// standard Object3D serialization\n\n\t\tconst object = {};\n\n\t\tobject.uuid = this.uuid;\n\t\tobject.type = this.type;\n\n\t\tif ( this.name !== '' ) object.name = this.name;\n\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\tif ( this.visible === false ) object.visible = false;\n\t\tif ( this.frustumCulled === false ) object.frustumCulled = false;\n\t\tif ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;\n\t\tif ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData;\n\n\t\tobject.layers = this.layers.mask;\n\t\tobject.matrix = this.matrix.toArray();\n\t\tobject.up = this.up.toArray();\n\n\t\tif ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;\n\n\t\t// object specific properties\n\n\t\tif ( this.isInstancedMesh ) {\n\n\t\t\tobject.type = 'InstancedMesh';\n\t\t\tobject.count = this.count;\n\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\tif ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON();\n\n\t\t}\n\n\t\tif ( this.isBatchedMesh ) {\n\n\t\t\tobject.type = 'BatchedMesh';\n\t\t\tobject.perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\t\tobject.sortObjects = this.sortObjects;\n\n\t\t\tobject.drawRanges = this._drawRanges;\n\t\t\tobject.reservedRanges = this._reservedRanges;\n\n\t\t\tobject.visibility = this._visibility;\n\t\t\tobject.active = this._active;\n\t\t\tobject.bounds = this._bounds.map( bound => ( {\n\t\t\t\tboxInitialized: bound.boxInitialized,\n\t\t\t\tboxMin: bound.box.min.toArray(),\n\t\t\t\tboxMax: bound.box.max.toArray(),\n\n\t\t\t\tsphereInitialized: bound.sphereInitialized,\n\t\t\t\tsphereRadius: bound.sphere.radius,\n\t\t\t\tsphereCenter: bound.sphere.center.toArray()\n\t\t\t} ) );\n\n\t\t\tobject.maxGeometryCount = this._maxGeometryCount;\n\t\t\tobject.maxVertexCount = this._maxVertexCount;\n\t\t\tobject.maxIndexCount = this._maxIndexCount;\n\n\t\t\tobject.geometryInitialized = this._geometryInitialized;\n\t\t\tobject.geometryCount = this._geometryCount;\n\n\t\t\tobject.matricesTexture = this._matricesTexture.toJSON( meta );\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tobject.boundingSphere = {\n\t\t\t\t\tcenter: object.boundingSphere.center.toArray(),\n\t\t\t\t\tradius: object.boundingSphere.radius\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tobject.boundingBox = {\n\t\t\t\t\tmin: object.boundingBox.min.toArray(),\n\t\t\t\t\tmax: object.boundingBox.max.toArray()\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tfunction serialize( library, element ) {\n\n\t\t\tif ( library[ element.uuid ] === undefined ) {\n\n\t\t\t\tlibrary[ element.uuid ] = element.toJSON( meta );\n\n\t\t\t}\n\n\t\t\treturn element.uuid;\n\n\t\t}\n\n\t\tif ( this.isScene ) {\n\n\t\t\tif ( this.background ) {\n\n\t\t\t\tif ( this.background.isColor ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON();\n\n\t\t\t\t} else if ( this.background.isTexture ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON( meta ).uuid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) {\n\n\t\t\t\tobject.environment = this.environment.toJSON( meta ).uuid;\n\n\t\t\t}\n\n\t\t} else if ( this.isMesh || this.isLine || this.isPoints ) {\n\n\t\t\tobject.geometry = serialize( meta.geometries, this.geometry );\n\n\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\tif ( parameters !== undefined && parameters.shapes !== undefined ) {\n\n\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\tif ( Array.isArray( shapes ) ) {\n\n\t\t\t\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst shape = shapes[ i ];\n\n\t\t\t\t\t\tserialize( meta.shapes, shape );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tserialize( meta.shapes, shapes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.isSkinnedMesh ) {\n\n\t\t\tobject.bindMode = this.bindMode;\n\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\tif ( this.skeleton !== undefined ) {\n\n\t\t\t\tserialize( meta.skeletons, this.skeleton );\n\n\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.material !== undefined ) {\n\n\t\t\tif ( Array.isArray( this.material ) ) {\n\n\t\t\t\tconst uuids = [];\n\n\t\t\t\tfor ( let i = 0, l = this.material.length; i < l; i ++ ) {\n\n\t\t\t\t\tuuids.push( serialize( meta.materials, this.material[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = uuids;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = serialize( meta.materials, this.material );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.children.length > 0 ) {\n\n\t\t\tobject.children = [];\n\n\t\t\tfor ( let i = 0; i < this.children.length; i ++ ) {\n\n\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.animations.length > 0 ) {\n\n\t\t\tobject.animations = [];\n\n\t\t\tfor ( let i = 0; i < this.animations.length; i ++ ) {\n\n\t\t\t\tconst animation = this.animations[ i ];\n\n\t\t\t\tobject.animations.push( serialize( meta.animations, animation ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst geometries = extractFromCache( meta.geometries );\n\t\t\tconst materials = extractFromCache( meta.materials );\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\t\t\tconst shapes = extractFromCache( meta.shapes );\n\t\t\tconst skeletons = extractFromCache( meta.skeletons );\n\t\t\tconst animations = extractFromCache( meta.animations );\n\t\t\tconst nodes = extractFromCache( meta.nodes );\n\n\t\t\tif ( geometries.length > 0 ) output.geometries = geometries;\n\t\t\tif ( materials.length > 0 ) output.materials = materials;\n\t\t\tif ( textures.length > 0 ) output.textures = textures;\n\t\t\tif ( images.length > 0 ) output.images = images;\n\t\t\tif ( shapes.length > 0 ) output.shapes = shapes;\n\t\t\tif ( skeletons.length > 0 ) output.skeletons = skeletons;\n\t\t\tif ( animations.length > 0 ) output.animations = animations;\n\t\t\tif ( nodes.length > 0 ) output.nodes = nodes;\n\n\t\t}\n\n\t\toutput.object = object;\n\n\t\treturn output;\n\n\t\t// extract data from the cache hash\n\t\t// remove metadata on each item\n\t\t// and return as array\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t}\n\n\tclone( recursive ) {\n\n\t\treturn new this.constructor().copy( this, recursive );\n\n\t}\n\n\tcopy( source, recursive = true ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.up.copy( source.up );\n\n\t\tthis.position.copy( source.position );\n\t\tthis.rotation.order = source.rotation.order;\n\t\tthis.quaternion.copy( source.quaternion );\n\t\tthis.scale.copy( source.scale );\n\n\t\tthis.matrix.copy( source.matrix );\n\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\tthis.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\tthis.layers.mask = source.layers.mask;\n\t\tthis.visible = source.visible;\n\n\t\tthis.castShadow = source.castShadow;\n\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\tthis.frustumCulled = source.frustumCulled;\n\t\tthis.renderOrder = source.renderOrder;\n\n\t\tthis.animations = source.animations.slice();\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tfor ( let i = 0; i < source.children.length; i ++ ) {\n\n\t\t\t\tconst child = source.children[ i ];\n\t\t\t\tthis.add( child.clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nObject3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nObject3D.DEFAULT_MATRIX_AUTO_UPDATE = true;\nObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;\n\nconst _v0$1 = /*@__PURE__*/ new Vector3();\nconst _v1$3 = /*@__PURE__*/ new Vector3();\nconst _v2$2 = /*@__PURE__*/ new Vector3();\nconst _v3$2 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nclass Triangle {\n\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\n\t}\n\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0$1.subVectors( a, b );\n\t\ttarget.cross( _v0$1 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t// static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t_v0$1.subVectors( c, a );\n\t\t_v1$3.subVectors( b, a );\n\t\t_v2$2.subVectors( point, a );\n\n\t\tconst dot00 = _v0$1.dot( _v0$1 );\n\t\tconst dot01 = _v0$1.dot( _v1$3 );\n\t\tconst dot02 = _v0$1.dot( _v2$2 );\n\t\tconst dot11 = _v1$3.dot( _v1$3 );\n\t\tconst dot12 = _v1$3.dot( _v2$2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3$2 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3$2.x >= 0 ) && ( _v3$2.y >= 0 ) && ( ( _v3$2.x + _v3$2.y ) <= 1 );\n\n\t}\n\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3$2 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3$2.x );\n\t\ttarget.addScaledVector( v2, _v3$2.y );\n\t\ttarget.addScaledVector( v3, _v3$2.z );\n\n\t\treturn target;\n\n\t}\n\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0$1.subVectors( c, b );\n\t\t_v1$3.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false;\n\n\t}\n\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\tgetArea() {\n\n\t\t_v0$1.subVectors( this.c, this.b );\n\t\t_v1$3.subVectors( this.a, this.b );\n\n\t\treturn _v0$1.cross( _v1$3 ).length() * 0.5;\n\n\t}\n\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nconst _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\nconst _hslA = { h: 0, s: 0, l: 0 };\nconst _hslB = { h: 0, s: 0, l: 0 };\n\nfunction hue2rgb( p, q, t ) {\n\n\tif ( t < 0 ) t += 1;\n\tif ( t > 1 ) t -= 1;\n\tif ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;\n\tif ( t < 1 / 2 ) return q;\n\tif ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\treturn p;\n\n}\n\nclass Color {\n\n\tconstructor( r, g, b ) {\n\n\t\tthis.isColor = true;\n\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\treturn this.set( r, g, b );\n\n\t}\n\n\tset( r, g, b ) {\n\n\t\tif ( g === undefined && b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\n\t\t\tconst value = r;\n\n\t\t\tif ( value && value.isColor ) {\n\n\t\t\t\tthis.copy( value );\n\n\t\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\t\tthis.setHex( value );\n\n\t\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\t\tthis.setStyle( value );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.setRGB( r, g, b );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetHex( hex, colorSpace = SRGBColorSpace ) {\n\n\t\thex = Math.floor( hex );\n\n\t\tthis.r = ( hex >> 16 & 255 ) / 255;\n\t\tthis.g = ( hex >> 8 & 255 ) / 255;\n\t\tthis.b = ( hex & 255 ) / 255;\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo( h, 1 );\n\t\ts = clamp( s, 0, 1 );\n\t\tl = clamp( l, 0, 1 );\n\n\t\tif ( s === 0 ) {\n\n\t\t\tthis.r = this.g = this.b = l;\n\n\t\t} else {\n\n\t\t\tconst p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\tconst q = ( 2 * l ) - p;\n\n\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetStyle( style, colorSpace = SRGBColorSpace ) {\n\n\t\tfunction handleAlpha( string ) {\n\n\t\t\tif ( string === undefined ) return;\n\n\t\t\tif ( parseFloat( string ) < 1 ) {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tlet m;\n\n\t\tif ( m = /^(\\w+)\\(([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t// rgb / hsl\n\n\t\t\tlet color;\n\t\t\tconst name = m[ 1 ];\n\t\t\tconst components = m[ 2 ];\n\n\t\t\tswitch ( name ) {\n\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 1 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 2 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 3 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 1 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 2 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 3 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setHSL(\n\t\t\t\t\t\t\tparseFloat( color[ 1 ] ) / 360,\n\t\t\t\t\t\t\tparseFloat( color[ 2 ] ) / 100,\n\t\t\t\t\t\t\tparseFloat( color[ 3 ] ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.warn( 'THREE.Color: Unknown color model ' + style );\n\n\t\t\t}\n\n\t\t} else if ( m = /^\\#([A-Fa-f\\d]+)$/.exec( style ) ) {\n\n\t\t\t// hex color\n\n\t\t\tconst hex = m[ 1 ];\n\t\t\tconst size = hex.length;\n\n\t\t\tif ( size === 3 ) {\n\n\t\t\t\t// #ff0\n\t\t\t\treturn this.setRGB(\n\t\t\t\t\tparseInt( hex.charAt( 0 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 1 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 2 ), 16 ) / 15,\n\t\t\t\t\tcolorSpace\n\t\t\t\t);\n\n\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t// #ff0000\n\t\t\t\treturn this.setHex( parseInt( hex, 16 ), colorSpace );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Invalid hex color ' + style );\n\n\t\t\t}\n\n\t\t} else if ( style && style.length > 0 ) {\n\n\t\t\treturn this.setColorName( style, colorSpace );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetColorName( style, colorSpace = SRGBColorSpace ) {\n\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[ style.toLowerCase() ];\n\n\t\tif ( hex !== undefined ) {\n\n\t\t\t// red\n\t\t\tthis.setHex( hex, colorSpace );\n\n\t\t} else {\n\n\t\t\t// unknown color\n\t\t\tconsole.warn( 'THREE.Color: Unknown color ' + style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t}\n\n\tcopy( color ) {\n\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\n\t\treturn this;\n\n\t}\n\n\tcopySRGBToLinear( color ) {\n\n\t\tthis.r = SRGBToLinear( color.r );\n\t\tthis.g = SRGBToLinear( color.g );\n\t\tthis.b = SRGBToLinear( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tcopyLinearToSRGB( color ) {\n\n\t\tthis.r = LinearToSRGB( color.r );\n\t\tthis.g = LinearToSRGB( color.g );\n\t\tthis.b = LinearToSRGB( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tconvertSRGBToLinear() {\n\n\t\tthis.copySRGBToLinear( this );\n\n\t\treturn this;\n\n\t}\n\n\tconvertLinearToSRGB() {\n\n\t\tthis.copyLinearToSRGB( this );\n\n\t\treturn this;\n\n\t}\n\n\tgetHex( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\treturn Math.round( clamp( _color.r * 255, 0, 255 ) ) * 65536 + Math.round( clamp( _color.g * 255, 0, 255 ) ) * 256 + Math.round( clamp( _color.b * 255, 0, 255 ) );\n\n\t}\n\n\tgetHexString( colorSpace = SRGBColorSpace ) {\n\n\t\treturn ( '000000' + this.getHex( colorSpace ).toString( 16 ) ).slice( - 6 );\n\n\t}\n\n\tgetHSL( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tconst max = Math.max( r, g, b );\n\t\tconst min = Math.min( r, g, b );\n\n\t\tlet hue, saturation;\n\t\tconst lightness = ( min + max ) / 2.0;\n\n\t\tif ( min === max ) {\n\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\n\t\t} else {\n\n\t\t\tconst delta = max - min;\n\n\t\t\tsaturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\tswitch ( max ) {\n\n\t\t\t\tcase r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;\n\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t}\n\n\t\t\thue /= 6;\n\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\n\t\treturn target;\n\n\t}\n\n\tgetRGB( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\ttarget.r = _color.r;\n\t\ttarget.g = _color.g;\n\t\ttarget.b = _color.b;\n\n\t\treturn target;\n\n\t}\n\n\tgetStyle( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tif ( colorSpace !== SRGBColorSpace ) {\n\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${ colorSpace } ${ r.toFixed( 3 ) } ${ g.toFixed( 3 ) } ${ b.toFixed( 3 ) })`;\n\n\t\t}\n\n\t\treturn `rgb(${ Math.round( r * 255 ) },${ Math.round( g * 255 ) },${ Math.round( b * 255 ) })`;\n\n\t}\n\n\toffsetHSL( h, s, l ) {\n\n\t\tthis.getHSL( _hslA );\n\n\t\treturn this.setHSL( _hslA.h + h, _hslA.s + s, _hslA.l + l );\n\n\t}\n\n\tadd( color ) {\n\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\n\t\treturn this;\n\n\t}\n\n\taddColors( color1, color2 ) {\n\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( color ) {\n\n\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( color ) {\n\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\n\t\treturn this;\n\n\t}\n\n\tlerp( color, alpha ) {\n\n\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpColors( color1, color2, alpha ) {\n\n\t\tthis.r = color1.r + ( color2.r - color1.r ) * alpha;\n\t\tthis.g = color1.g + ( color2.g - color1.g ) * alpha;\n\t\tthis.b = color1.b + ( color2.b - color1.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpHSL( color, alpha ) {\n\n\t\tthis.getHSL( _hslA );\n\t\tcolor.getHSL( _hslB );\n\n\t\tconst h = lerp( _hslA.h, _hslB.h, alpha );\n\t\tconst s = lerp( _hslA.s, _hslB.s, alpha );\n\t\tconst l = lerp( _hslA.l, _hslB.l, alpha );\n\n\t\tthis.setHSL( h, s, l );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\tthis.r = v.x;\n\t\tthis.g = v.y;\n\t\tthis.b = v.z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst r = this.r, g = this.g, b = this.b;\n\t\tconst e = m.elements;\n\n\t\tthis.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b;\n\t\tthis.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b;\n\t\tthis.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b;\n\n\t\treturn this;\n\n\t}\n\n\tequals( c ) {\n\n\t\treturn ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.r = array[ offset ];\n\t\tthis.g = array[ offset + 1 ];\n\t\tthis.b = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.r;\n\t\tarray[ offset + 1 ] = this.g;\n\t\tarray[ offset + 2 ] = this.b;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.r = attribute.getX( index );\n\t\tthis.g = attribute.getY( index );\n\t\tthis.b = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.getHex();\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\n\t}\n\n}\n\nconst _color = /*@__PURE__*/ new Color();\n\nColor.NAMES = _colorKeywords;\n\nlet _materialId = 0;\n\nclass Material extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isMaterial = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _materialId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Material';\n\n\t\tthis.blending = NormalBlending;\n\t\tthis.side = FrontSide;\n\t\tthis.vertexColors = false;\n\n\t\tthis.opacity = 1;\n\t\tthis.transparent = false;\n\t\tthis.alphaHash = false;\n\n\t\tthis.blendSrc = SrcAlphaFactor;\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\tthis.blendEquation = AddEquation;\n\t\tthis.blendSrcAlpha = null;\n\t\tthis.blendDstAlpha = null;\n\t\tthis.blendEquationAlpha = null;\n\t\tthis.blendColor = new Color( 0, 0, 0 );\n\t\tthis.blendAlpha = 0;\n\n\t\tthis.depthFunc = LessEqualDepth;\n\t\tthis.depthTest = true;\n\t\tthis.depthWrite = true;\n\n\t\tthis.stencilWriteMask = 0xff;\n\t\tthis.stencilFunc = AlwaysStencilFunc;\n\t\tthis.stencilRef = 0;\n\t\tthis.stencilFuncMask = 0xff;\n\t\tthis.stencilFail = KeepStencilOp;\n\t\tthis.stencilZFail = KeepStencilOp;\n\t\tthis.stencilZPass = KeepStencilOp;\n\t\tthis.stencilWrite = false;\n\n\t\tthis.clippingPlanes = null;\n\t\tthis.clipIntersection = false;\n\t\tthis.clipShadows = false;\n\n\t\tthis.shadowSide = null;\n\n\t\tthis.colorWrite = true;\n\n\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\tthis.polygonOffset = false;\n\t\tthis.polygonOffsetFactor = 0;\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\tthis.dithering = false;\n\n\t\tthis.alphaToCoverage = false;\n\t\tthis.premultipliedAlpha = false;\n\t\tthis.forceSinglePass = false;\n\n\t\tthis.visible = true;\n\n\t\tthis.toneMapped = true;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\n\t\tthis._alphaTest = 0;\n\n\t}\n\n\tget alphaTest() {\n\n\t\treturn this._alphaTest;\n\n\t}\n\n\tset alphaTest( value ) {\n\n\t\tif ( this._alphaTest > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._alphaTest = value;\n\n\t}\n\n\tonBuild( /* shaderobject, renderer */ ) {}\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}\n\n\tonBeforeCompile( /* shaderobject, renderer */ ) {}\n\n\tcustomProgramCacheKey() {\n\n\t\treturn this.onBeforeCompile.toString();\n\n\t}\n\n\tsetValues( values ) {\n\n\t\tif ( values === undefined ) return;\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( currentValue && currentValue.isColor ) {\n\n\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( isRootObject ) {\n\n\t\t\tmeta = {\n\t\t\t\ttextures: {},\n\t\t\t\timages: {}\n\t\t\t};\n\n\t\t}\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Material',\n\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard Material serialization\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\tif ( this.color && this.color.isColor ) data.color = this.color.getHex();\n\n\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\tif ( this.sheen !== undefined ) data.sheen = this.sheen;\n\t\tif ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();\n\t\tif ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;\n\t\tif ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();\n\t\tif ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;\n\n\t\tif ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();\n\t\tif ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;\n\t\tif ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex();\n\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\t\tif ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;\n\t\tif ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\tif ( this.clearcoatMap && this.clearcoatMap.isTexture ) {\n\n\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) {\n\n\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) {\n\n\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;\n\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.dispersion !== undefined ) data.dispersion = this.dispersion;\n\n\t\tif ( this.iridescence !== undefined ) data.iridescence = this.iridescence;\n\t\tif ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;\n\t\tif ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;\n\n\t\tif ( this.iridescenceMap && this.iridescenceMap.isTexture ) {\n\n\t\t\tdata.iridescenceMap = this.iridescenceMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture ) {\n\n\t\t\tdata.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;\n\t\tif ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;\n\n\t\tif ( this.anisotropyMap && this.anisotropyMap.isTexture ) {\n\n\t\t\tdata.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;\n\t\tif ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;\n\t\tif ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\n\t\tif ( this.lightMap && this.lightMap.isTexture ) {\n\n\t\t\tdata.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( this.aoMap && this.aoMap.isTexture ) {\n\n\t\t\tdata.aoMap = this.aoMap.toJSON( meta ).uuid;\n\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\n\t\t}\n\n\t\tif ( this.bumpMap && this.bumpMap.isTexture ) {\n\n\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t}\n\n\t\tif ( this.normalMap && this.normalMap.isTexture ) {\n\n\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.displacementMap && this.displacementMap.isTexture ) {\n\n\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t}\n\n\t\tif ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\tif ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\tif ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\tif ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\t\tif ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid;\n\t\tif ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid;\n\n\t\tif ( this.envMap && this.envMap.isTexture ) {\n\n\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\n\t\t\tif ( this.combine !== undefined ) data.combine = this.combine;\n\n\t\t}\n\n\t\tif ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();\n\t\tif ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;\n\t\tif ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;\n\t\tif ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;\n\n\t\tif ( this.gradientMap && this.gradientMap.isTexture ) {\n\n\t\t\tdata.gradientMap = this.gradientMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.transmission !== undefined ) data.transmission = this.transmission;\n\t\tif ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;\n\t\tif ( this.thickness !== undefined ) data.thickness = this.thickness;\n\t\tif ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;\n\t\tif ( this.attenuationDistance !== undefined && this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance;\n\t\tif ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();\n\n\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\tif ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;\n\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\tif ( this.vertexColors === true ) data.vertexColors = true;\n\n\t\tif ( this.opacity < 1 ) data.opacity = this.opacity;\n\t\tif ( this.transparent === true ) data.transparent = true;\n\n\t\tif ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;\n\t\tif ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;\n\t\tif ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;\n\t\tif ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;\n\t\tif ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;\n\t\tif ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;\n\t\tif ( this.blendColor && this.blendColor.isColor ) data.blendColor = this.blendColor.getHex();\n\t\tif ( this.blendAlpha !== 0 ) data.blendAlpha = this.blendAlpha;\n\n\t\tif ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;\n\t\tif ( this.depthTest === false ) data.depthTest = this.depthTest;\n\t\tif ( this.depthWrite === false ) data.depthWrite = this.depthWrite;\n\t\tif ( this.colorWrite === false ) data.colorWrite = this.colorWrite;\n\n\t\tif ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;\n\t\tif ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;\n\t\tif ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;\n\t\tif ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;\n\t\tif ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;\n\t\tif ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;\n\t\tif ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;\n\t\tif ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;\n\n\t\t// rotation (SpriteMaterial)\n\t\tif ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;\n\n\t\tif ( this.polygonOffset === true ) data.polygonOffset = true;\n\t\tif ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\tif ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\n\t\tif ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth;\n\t\tif ( this.dashSize !== undefined ) data.dashSize = this.dashSize;\n\t\tif ( this.gapSize !== undefined ) data.gapSize = this.gapSize;\n\t\tif ( this.scale !== undefined ) data.scale = this.scale;\n\n\t\tif ( this.dithering === true ) data.dithering = true;\n\n\t\tif ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;\n\t\tif ( this.alphaHash === true ) data.alphaHash = true;\n\t\tif ( this.alphaToCoverage === true ) data.alphaToCoverage = true;\n\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = true;\n\t\tif ( this.forceSinglePass === true ) data.forceSinglePass = true;\n\n\t\tif ( this.wireframe === true ) data.wireframe = true;\n\t\tif ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\tif ( this.flatShading === true ) data.flatShading = true;\n\n\t\tif ( this.visible === false ) data.visible = false;\n\n\t\tif ( this.toneMapped === false ) data.toneMapped = false;\n\n\t\tif ( this.fog === false ) data.fog = false;\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\t// TODO: Copied from Object3D.toJSON\n\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\n\t\t\tif ( textures.length > 0 ) data.textures = textures;\n\t\t\tif ( images.length > 0 ) data.images = images;\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.blending = source.blending;\n\t\tthis.side = source.side;\n\t\tthis.vertexColors = source.vertexColors;\n\n\t\tthis.opacity = source.opacity;\n\t\tthis.transparent = source.transparent;\n\n\t\tthis.blendSrc = source.blendSrc;\n\t\tthis.blendDst = source.blendDst;\n\t\tthis.blendEquation = source.blendEquation;\n\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\tthis.blendColor.copy( source.blendColor );\n\t\tthis.blendAlpha = source.blendAlpha;\n\n\t\tthis.depthFunc = source.depthFunc;\n\t\tthis.depthTest = source.depthTest;\n\t\tthis.depthWrite = source.depthWrite;\n\n\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\tthis.stencilFunc = source.stencilFunc;\n\t\tthis.stencilRef = source.stencilRef;\n\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\tthis.stencilFail = source.stencilFail;\n\t\tthis.stencilZFail = source.stencilZFail;\n\t\tthis.stencilZPass = source.stencilZPass;\n\t\tthis.stencilWrite = source.stencilWrite;\n\n\t\tconst srcPlanes = source.clippingPlanes;\n\t\tlet dstPlanes = null;\n\n\t\tif ( srcPlanes !== null ) {\n\n\t\t\tconst n = srcPlanes.length;\n\t\t\tdstPlanes = new Array( n );\n\n\t\t\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.clippingPlanes = dstPlanes;\n\t\tthis.clipIntersection = source.clipIntersection;\n\t\tthis.clipShadows = source.clipShadows;\n\n\t\tthis.shadowSide = source.shadowSide;\n\n\t\tthis.colorWrite = source.colorWrite;\n\n\t\tthis.precision = source.precision;\n\n\t\tthis.polygonOffset = source.polygonOffset;\n\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\tthis.dithering = source.dithering;\n\n\t\tthis.alphaTest = source.alphaTest;\n\t\tthis.alphaHash = source.alphaHash;\n\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\tthis.forceSinglePass = source.forceSinglePass;\n\n\t\tthis.visible = source.visible;\n\n\t\tthis.toneMapped = source.toneMapped;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n}\n\nclass MeshBasicMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // emissive\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\nconst _tables = /*@__PURE__*/ _generateTables();\n\nfunction _generateTables() {\n\n\t// float32 to float16 helpers\n\n\tconst buffer = new ArrayBuffer( 4 );\n\tconst floatView = new Float32Array( buffer );\n\tconst uint32View = new Uint32Array( buffer );\n\n\tconst baseTable = new Uint32Array( 512 );\n\tconst shiftTable = new Uint32Array( 512 );\n\n\tfor ( let i = 0; i < 256; ++ i ) {\n\n\t\tconst e = i - 127;\n\n\t\t// very small number (0, -0)\n\n\t\tif ( e < - 27 ) {\n\n\t\t\tbaseTable[ i ] = 0x0000;\n\t\t\tbaseTable[ i | 0x100 ] = 0x8000;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// small number (denorm)\n\n\t\t} else if ( e < - 14 ) {\n\n\t\t\tbaseTable[ i ] = 0x0400 >> ( - e - 14 );\n\t\t\tbaseTable[ i | 0x100 ] = ( 0x0400 >> ( - e - 14 ) ) | 0x8000;\n\t\t\tshiftTable[ i ] = - e - 1;\n\t\t\tshiftTable[ i | 0x100 ] = - e - 1;\n\n\t\t\t// normal number\n\n\t\t} else if ( e <= 15 ) {\n\n\t\t\tbaseTable[ i ] = ( e + 15 ) << 10;\n\t\t\tbaseTable[ i | 0x100 ] = ( ( e + 15 ) << 10 ) | 0x8000;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t\t// large number (Infinity, -Infinity)\n\n\t\t} else if ( e < 128 ) {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// stay (NaN, Infinity, -Infinity)\n\n\t\t} else {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t}\n\n\t}\n\n\t// float16 to float32 helpers\n\n\tconst mantissaTable = new Uint32Array( 2048 );\n\tconst exponentTable = new Uint32Array( 64 );\n\tconst offsetTable = new Uint32Array( 64 );\n\n\tfor ( let i = 1; i < 1024; ++ i ) {\n\n\t\tlet m = i << 13; // zero pad mantissa bits\n\t\tlet e = 0; // zero exponent\n\n\t\t// normalized\n\t\twhile ( ( m & 0x00800000 ) === 0 ) {\n\n\t\t\tm <<= 1;\n\t\t\te -= 0x00800000; // decrement exponent\n\n\t\t}\n\n\t\tm &= ~ 0x00800000; // clear leading 1 bit\n\t\te += 0x38800000; // adjust bias\n\n\t\tmantissaTable[ i ] = m | e;\n\n\t}\n\n\tfor ( let i = 1024; i < 2048; ++ i ) {\n\n\t\tmantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) << 13 );\n\n\t}\n\n\tfor ( let i = 1; i < 31; ++ i ) {\n\n\t\texponentTable[ i ] = i << 23;\n\n\t}\n\n\texponentTable[ 31 ] = 0x47800000;\n\texponentTable[ 32 ] = 0x80000000;\n\n\tfor ( let i = 33; i < 63; ++ i ) {\n\n\t\texponentTable[ i ] = 0x80000000 + ( ( i - 32 ) << 23 );\n\n\t}\n\n\texponentTable[ 63 ] = 0xc7800000;\n\n\tfor ( let i = 1; i < 64; ++ i ) {\n\n\t\tif ( i !== 32 ) {\n\n\t\t\toffsetTable[ i ] = 1024;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tfloatView: floatView,\n\t\tuint32View: uint32View,\n\t\tbaseTable: baseTable,\n\t\tshiftTable: shiftTable,\n\t\tmantissaTable: mantissaTable,\n\t\texponentTable: exponentTable,\n\t\toffsetTable: offsetTable\n\t};\n\n}\n\n// float32 to float16\n\nfunction toHalfFloat( val ) {\n\n\tif ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' );\n\n\tval = clamp( val, - 65504, 65504 );\n\n\t_tables.floatView[ 0 ] = val;\n\tconst f = _tables.uint32View[ 0 ];\n\tconst e = ( f >> 23 ) & 0x1ff;\n\treturn _tables.baseTable[ e ] + ( ( f & 0x007fffff ) >> _tables.shiftTable[ e ] );\n\n}\n\n// float16 to float32\n\nfunction fromHalfFloat( val ) {\n\n\tconst m = val >> 10;\n\t_tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val & 0x3ff ) ] + _tables.exponentTable[ m ];\n\treturn _tables.floatView[ 0 ];\n\n}\n\nconst DataUtils = {\n\ttoHalfFloat: toHalfFloat,\n\tfromHalfFloat: fromHalfFloat,\n};\n\nconst _vector$9 = /*@__PURE__*/ new Vector3();\nconst _vector2$1 = /*@__PURE__*/ new Vector2();\n\nclass BufferAttribute {\n\n\tconstructor( array, itemSize, normalized = false ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\tthis.isBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.array = array;\n\t\tthis.itemSize = itemSize;\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\tthis.normalized = normalized;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis._updateRange = { offset: 0, count: - 1 };\n\t\tthis.updateRanges = [];\n\t\tthis.gpuType = FloatType;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tget updateRange() {\n\n\t\twarnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159\n\t\treturn this._updateRange;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.itemSize = source.itemSize;\n\t\tthis.count = source.count;\n\t\tthis.normalized = source.normalized;\n\n\t\tthis.usage = source.usage;\n\t\tthis.gpuType = source.gpuType;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.itemSize;\n\t\tindex2 *= attribute.itemSize;\n\n\t\tfor ( let i = 0, l = this.itemSize; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyArray( array ) {\n\n\t\tthis.array.set( array );\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tif ( this.itemSize === 2 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector2$1.fromBufferAttribute( this, i );\n\t\t\t\t_vector2$1.applyMatrix3( m );\n\n\t\t\t\tthis.setXY( i, _vector2$1.x, _vector2$1.y );\n\n\t\t\t}\n\n\t\t} else if ( this.itemSize === 3 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector$9.fromBufferAttribute( this, i );\n\t\t\t\t_vector$9.applyMatrix3( m );\n\n\t\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\t// Matching BufferAttribute constructor, do not normalize the array.\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.itemSize + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.array[ index * this.itemSize + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = this.array[ index * this.itemSize ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = this.array[ index * this.itemSize + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = this.array[ index * this.itemSize + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = this.array[ index * this.itemSize + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\t\tthis.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.array, this.itemSize ).copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.from( this.array ),\n\t\t\tnormalized: this.normalized\n\t\t};\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( this.usage !== StaticDrawUsage ) data.usage = this.usage;\n\n\t\treturn data;\n\n\t}\n\n}\n\n//\n\nclass Int8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8ClampedArray( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Float16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t\tthis.isFloat16BufferAttribute = true;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = fromHalfFloat( this.array[ index * this.itemSize ] );\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = toHalfFloat( x );\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = fromHalfFloat( this.array[ index * this.itemSize + 1 ] );\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = fromHalfFloat( this.array[ index * this.itemSize + 2 ] );\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = fromHalfFloat( this.array[ index * this.itemSize + 3 ] );\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\t\tthis.array[ index + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n}\n\n\nclass Float32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nlet _id$2 = 0;\n\nconst _m1$2 = /*@__PURE__*/ new Matrix4();\nconst _obj = /*@__PURE__*/ new Object3D();\nconst _offset = /*@__PURE__*/ new Vector3();\nconst _box$2 = /*@__PURE__*/ new Box3();\nconst _boxMorphTargets = /*@__PURE__*/ new Box3();\nconst _vector$8 = /*@__PURE__*/ new Vector3();\n\nclass BufferGeometry extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isBufferGeometry = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _id$2 ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\n\t\tthis.morphAttributes = {};\n\t\tthis.morphTargetsRelative = false;\n\n\t\tthis.groups = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t\tthis.userData = {};\n\n\t}\n\n\tgetIndex() {\n\n\t\treturn this.index;\n\n\t}\n\n\tsetIndex( index ) {\n\n\t\tif ( Array.isArray( index ) ) {\n\n\t\t\tthis.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );\n\n\t\t} else {\n\n\t\t\tthis.index = index;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetAttribute( name ) {\n\n\t\treturn this.attributes[ name ];\n\n\t}\n\n\tsetAttribute( name, attribute ) {\n\n\t\tthis.attributes[ name ] = attribute;\n\n\t\treturn this;\n\n\t}\n\n\tdeleteAttribute( name ) {\n\n\t\tdelete this.attributes[ name ];\n\n\t\treturn this;\n\n\t}\n\n\thasAttribute( name ) {\n\n\t\treturn this.attributes[ name ] !== undefined;\n\n\t}\n\n\taddGroup( start, count, materialIndex = 0 ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t}\n\n\tclearGroups() {\n\n\t\tthis.groups = [];\n\n\t}\n\n\tsetDrawRange( start, count ) {\n\n\t\tthis.drawRange.start = start;\n\t\tthis.drawRange.count = count;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tconst position = this.attributes.position;\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tposition.applyMatrix4( matrix );\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t}\n\n\t\tconst normal = this.attributes.normal;\n\n\t\tif ( normal !== undefined ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tnormal.applyNormalMatrix( normalMatrix );\n\n\t\t\tnormal.needsUpdate = true;\n\n\t\t}\n\n\t\tconst tangent = this.attributes.tangent;\n\n\t\tif ( tangent !== undefined ) {\n\n\t\t\ttangent.transformDirection( matrix );\n\n\t\t\ttangent.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\t_m1$2.makeRotationFromQuaternion( q );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\t// rotate geometry around world x-axis\n\n\t\t_m1$2.makeRotationX( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateY( angle ) {\n\n\t\t// rotate geometry around world y-axis\n\n\t\t_m1$2.makeRotationY( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\t// rotate geometry around world z-axis\n\n\t\t_m1$2.makeRotationZ( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( x, y, z ) {\n\n\t\t// translate geometry\n\n\t\t_m1$2.makeTranslation( x, y, z );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\tscale( x, y, z ) {\n\n\t\t// scale geometry\n\n\t\t_m1$2.makeScale( x, y, z );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\tlookAt( vector ) {\n\n\t\t_obj.lookAt( vector );\n\n\t\t_obj.updateMatrix();\n\n\t\tthis.applyMatrix4( _obj.matrix );\n\n\t\treturn this;\n\n\t}\n\n\tcenter() {\n\n\t\tthis.computeBoundingBox();\n\n\t\tthis.boundingBox.getCenter( _offset ).negate();\n\n\t\tthis.translate( _offset.x, _offset.y, _offset.z );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tconst position = [];\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tconst point = points[ i ];\n\t\t\tposition.push( point.x, point.y, point.z || 0 );\n\n\t\t}\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );\n\n\t\treturn this;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );\n\n\t\t\tthis.boundingBox.set(\n\t\t\t\tnew Vector3( - Infinity, - Infinity, - Infinity ),\n\t\t\t\tnew Vector3( + Infinity, + Infinity, + Infinity )\n\t\t\t);\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tthis.boundingBox.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_box$2.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.min, _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.max, _box$2.max );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t}\n\n\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );\n\n\t\t\tthis.boundingSphere.set( new Vector3(), Infinity );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position ) {\n\n\t\t\t// first, find the center of the bounding sphere\n\n\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t_box$2.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.min, _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.max, _boxMorphTargets.max );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_box$2.getCenter( center );\n\n\t\t\t// second, try to find a boundingSphere with a radius smaller than the\n\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor ( let i = 0, il = position.count; i < il; i ++ ) {\n\n\t\t\t\t_vector$8.fromBufferAttribute( position, i );\n\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t}\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\tfor ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) {\n\n\t\t\t\t\t\t_vector$8.fromBufferAttribute( morphAttribute, j );\n\n\t\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t\t_offset.fromBufferAttribute( position, j );\n\t\t\t\t\t\t\t_vector$8.add( _offset );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeTangents() {\n\n\t\tconst index = this.index;\n\t\tconst attributes = this.attributes;\n\n\t\t// based on http://www.terathon.com/code/tangent.html\n\t\t// (per vertex tangents)\n\n\t\tif ( index === null ||\n\t\t\t attributes.position === undefined ||\n\t\t\t attributes.normal === undefined ||\n\t\t\t attributes.uv === undefined ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst positionAttribute = attributes.position;\n\t\tconst normalAttribute = attributes.normal;\n\t\tconst uvAttribute = attributes.uv;\n\n\t\tif ( this.hasAttribute( 'tangent' ) === false ) {\n\n\t\t\tthis.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );\n\n\t\t}\n\n\t\tconst tangentAttribute = this.getAttribute( 'tangent' );\n\n\t\tconst tan1 = [], tan2 = [];\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\ttan1[ i ] = new Vector3();\n\t\t\ttan2[ i ] = new Vector3();\n\n\t\t}\n\n\t\tconst vA = new Vector3(),\n\t\t\tvB = new Vector3(),\n\t\t\tvC = new Vector3(),\n\n\t\t\tuvA = new Vector2(),\n\t\t\tuvB = new Vector2(),\n\t\t\tuvC = new Vector2(),\n\n\t\t\tsdir = new Vector3(),\n\t\t\ttdir = new Vector3();\n\n\t\tfunction handleTriangle( a, b, c ) {\n\n\t\t\tvA.fromBufferAttribute( positionAttribute, a );\n\t\t\tvB.fromBufferAttribute( positionAttribute, b );\n\t\t\tvC.fromBufferAttribute( positionAttribute, c );\n\n\t\t\tuvA.fromBufferAttribute( uvAttribute, a );\n\t\t\tuvB.fromBufferAttribute( uvAttribute, b );\n\t\t\tuvC.fromBufferAttribute( uvAttribute, c );\n\n\t\t\tvB.sub( vA );\n\t\t\tvC.sub( vA );\n\n\t\t\tuvB.sub( uvA );\n\t\t\tuvC.sub( uvA );\n\n\t\t\tconst r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y );\n\n\t\t\t// silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\tif ( ! isFinite( r ) ) return;\n\n\t\t\tsdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r );\n\t\t\ttdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r );\n\n\t\t\ttan1[ a ].add( sdir );\n\t\t\ttan1[ b ].add( sdir );\n\t\t\ttan1[ c ].add( sdir );\n\n\t\t\ttan2[ a ].add( tdir );\n\t\t\ttan2[ b ].add( tdir );\n\t\t\ttan2[ c ].add( tdir );\n\n\t\t}\n\n\t\tlet groups = this.groups;\n\n\t\tif ( groups.length === 0 ) {\n\n\t\t\tgroups = [ {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: index.count\n\t\t\t} ];\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleTriangle(\n\t\t\t\t\tindex.getX( j + 0 ),\n\t\t\t\t\tindex.getX( j + 1 ),\n\t\t\t\t\tindex.getX( j + 2 )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst tmp = new Vector3(), tmp2 = new Vector3();\n\t\tconst n = new Vector3(), n2 = new Vector3();\n\n\t\tfunction handleVertex( v ) {\n\n\t\t\tn.fromBufferAttribute( normalAttribute, v );\n\t\t\tn2.copy( n );\n\n\t\t\tconst t = tan1[ v ];\n\n\t\t\t// Gram-Schmidt orthogonalize\n\n\t\t\ttmp.copy( t );\n\t\t\ttmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();\n\n\t\t\t// Calculate handedness\n\n\t\t\ttmp2.crossVectors( n2, t );\n\t\t\tconst test = tmp2.dot( tan2[ v ] );\n\t\t\tconst w = ( test < 0.0 ) ? - 1.0 : 1.0;\n\n\t\t\ttangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleVertex( index.getX( j + 0 ) );\n\t\t\t\thandleVertex( index.getX( j + 1 ) );\n\t\t\t\thandleVertex( index.getX( j + 2 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeVertexNormals() {\n\n\t\tconst index = this.index;\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute !== undefined ) {\n\n\t\t\tlet normalAttribute = this.getAttribute( 'normal' );\n\n\t\t\tif ( normalAttribute === undefined ) {\n\n\t\t\t\tnormalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );\n\t\t\t\tthis.setAttribute( 'normal', normalAttribute );\n\n\t\t\t} else {\n\n\t\t\t\t// reset existing normals to zero\n\n\t\t\t\tfor ( let i = 0, il = normalAttribute.count; i < il; i ++ ) {\n\n\t\t\t\t\tnormalAttribute.setXYZ( i, 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst pA = new Vector3(), pB = new Vector3(), pC = new Vector3();\n\t\t\tconst nA = new Vector3(), nB = new Vector3(), nC = new Vector3();\n\t\t\tconst cb = new Vector3(), ab = new Vector3();\n\n\t\t\t// indexed elements\n\n\t\t\tif ( index ) {\n\n\t\t\t\tfor ( let i = 0, il = index.count; i < il; i += 3 ) {\n\n\t\t\t\t\tconst vA = index.getX( i + 0 );\n\t\t\t\t\tconst vB = index.getX( i + 1 );\n\t\t\t\t\tconst vC = index.getX( i + 2 );\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, vA );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, vB );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, vC );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnA.fromBufferAttribute( normalAttribute, vA );\n\t\t\t\t\tnB.fromBufferAttribute( normalAttribute, vB );\n\t\t\t\t\tnC.fromBufferAttribute( normalAttribute, vC );\n\n\t\t\t\t\tnA.add( cb );\n\t\t\t\t\tnB.add( cb );\n\t\t\t\t\tnC.add( cb );\n\n\t\t\t\t\tnormalAttribute.setXYZ( vA, nA.x, nA.y, nA.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vB, nB.x, nB.y, nB.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vC, nC.x, nC.y, nC.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\tfor ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) {\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, i + 0 );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, i + 1 );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, i + 2 );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnormalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.normalizeNormals();\n\n\t\t\tnormalAttribute.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tnormalizeNormals() {\n\n\t\tconst normals = this.attributes.normal;\n\n\t\tfor ( let i = 0, il = normals.count; i < il; i ++ ) {\n\n\t\t\t_vector$8.fromBufferAttribute( normals, i );\n\n\t\t\t_vector$8.normalize();\n\n\t\t\tnormals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z );\n\n\t\t}\n\n\t}\n\n\ttoNonIndexed() {\n\n\t\tfunction convertBufferAttribute( attribute, indices ) {\n\n\t\t\tconst array = attribute.array;\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst normalized = attribute.normalized;\n\n\t\t\tconst array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\tlet index = 0, index2 = 0;\n\n\t\t\tfor ( let i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\tindex = indices[ i ] * attribute.data.stride + attribute.offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( array2, itemSize, normalized );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.index === null ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst geometry2 = new BufferGeometry();\n\n\t\tconst indices = this.index.array;\n\t\tconst attributes = this.attributes;\n\n\t\t// attributes\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\n\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\tgeometry2.setAttribute( name, newAttribute );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = this.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst morphArray = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = morphAttribute[ i ];\n\n\t\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\t\tmorphArray.push( newAttribute );\n\n\t\t\t}\n\n\t\t\tgeometry2.morphAttributes[ name ] = morphArray;\n\n\t\t}\n\n\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = this.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tgeometry2.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn geometry2;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard BufferGeometry serialization\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\tif ( this.parameters !== undefined ) {\n\n\t\t\tconst parameters = this.parameters;\n\n\t\t\tfor ( const key in parameters ) {\n\n\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\t// for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\t\tdata.data = { attributes: {} };\n\n\t\tconst index = this.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tdata.data.index = {\n\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call( index.array )\n\t\t\t};\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tdata.data.attributes[ key ] = attribute.toJSON( data.data );\n\n\t\t}\n\n\t\tconst morphAttributes = {};\n\t\tlet hasMorphAttributes = false;\n\n\t\tfor ( const key in this.morphAttributes ) {\n\n\t\t\tconst attributeArray = this.morphAttributes[ key ];\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = attributeArray[ i ];\n\n\t\t\t\tarray.push( attribute.toJSON( data.data ) );\n\n\t\t\t}\n\n\t\t\tif ( array.length > 0 ) {\n\n\t\t\t\tmorphAttributes[ key ] = array;\n\n\t\t\t\thasMorphAttributes = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( hasMorphAttributes ) {\n\n\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t}\n\n\t\tconst groups = this.groups;\n\n\t\tif ( groups.length > 0 ) {\n\n\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tdata.data.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t};\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\t// reset\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\t\tthis.morphAttributes = {};\n\t\tthis.groups = [];\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// used for storing cloned, shared data\n\n\t\tconst data = {};\n\n\t\t// name\n\n\t\tthis.name = source.name;\n\n\t\t// index\n\n\t\tconst index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone( data ) );\n\n\t\t}\n\n\t\t// attributes\n\n\t\tconst attributes = source.attributes;\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\t\t\tthis.setAttribute( name, attribute.clone( data ) );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = source.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, l = morphAttribute.length; i < l; i ++ ) {\n\n\t\t\t\tarray.push( morphAttribute[ i ].clone( data ) );\n\n\t\t\t}\n\n\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t}\n\n\t\tthis.morphTargetsRelative = source.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = source.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\t// bounding box\n\n\t\tconst boundingBox = source.boundingBox;\n\n\t\tif ( boundingBox !== null ) {\n\n\t\t\tthis.boundingBox = boundingBox.clone();\n\n\t\t}\n\n\t\t// bounding sphere\n\n\t\tconst boundingSphere = source.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tthis.boundingSphere = boundingSphere.clone();\n\n\t\t}\n\n\t\t// draw range\n\n\t\tthis.drawRange.start = source.drawRange.start;\n\t\tthis.drawRange.count = source.drawRange.count;\n\n\t\t// user data\n\n\t\tthis.userData = source.userData;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nconst _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();\nconst _ray$3 = /*@__PURE__*/ new Ray();\nconst _sphere$6 = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA$1 = /*@__PURE__*/ new Vector3();\nconst _vB$1 = /*@__PURE__*/ new Vector3();\nconst _vC$1 = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _uvA$1 = /*@__PURE__*/ new Vector2();\nconst _uvB$1 = /*@__PURE__*/ new Vector2();\nconst _uvC$1 = /*@__PURE__*/ new Vector2();\n\nconst _normalA = /*@__PURE__*/ new Vector3();\nconst _normalB = /*@__PURE__*/ new Vector3();\nconst _normalC = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\nclass Mesh extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$6.copy( geometry.boundingSphere );\n\t\t_sphere$6.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray$3.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere$6.containsPoint( _ray$3.origin ) === false ) {\n\n\t\t\tif ( _ray$3.intersectSphere( _sphere$6, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix$3.copy( matrixWorld ).invert();\n\t\t_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$3 );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection$1( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA$1 );\n\tobject.getVertexPosition( b, _vB$1 );\n\tobject.getVertexPosition( c, _vC$1 );\n\n\tconst intersection = checkIntersection$1( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tif ( uv ) {\n\n\t\t\t_uvA$1.fromBufferAttribute( uv, a );\n\t\t\t_uvB$1.fromBufferAttribute( uv, b );\n\t\t\t_uvC$1.fromBufferAttribute( uv, c );\n\n\t\t\tintersection.uv = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\t_uvA$1.fromBufferAttribute( uv1, a );\n\t\t\t_uvB$1.fromBufferAttribute( uv1, b );\n\t\t\t_uvC$1.fromBufferAttribute( uv1, c );\n\n\t\t\tintersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\t_normalA.fromBufferAttribute( normal, a );\n\t\t\t_normalB.fromBufferAttribute( normal, b );\n\t\t\t_normalC.fromBufferAttribute( normal, c );\n\n\t\t\tintersection.normal = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _normalA, _normalB, _normalC, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) > 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( - 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal );\n\n\t\tintersection.face = face;\n\n\t}\n\n\treturn intersection;\n\n}\n\nclass BoxGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tconst scope = this;\n\n\t\t// segments\n\n\t\twidthSegments = Math.floor( widthSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\t\tdepthSegments = Math.floor( depthSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet numberOfVertices = 0;\n\t\tlet groupStart = 0;\n\n\t\t// build each side of the box geometry\n\n\t\tbuildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tconst segmentWidth = width / gridX;\n\t\t\tconst segmentHeight = height / gridY;\n\n\t\t\tconst widthHalf = width / 2;\n\t\t\tconst heightHalf = height / 2;\n\t\t\tconst depthHalf = depth / 2;\n\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\n\t\t\tlet vertexCounter = 0;\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\t\tconst x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\n\t\t\t\t\tvertices.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth > 0 ? 1 : - 1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\n\t\t\t\t\tnormals.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// uvs\n\n\t\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t\t\t// counters\n\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// increase counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );\n\n\t}\n\n}\n\n/**\n * Uniform Utilities\n */\n\nfunction cloneUniforms( src ) {\n\n\tconst dst = {};\n\n\tfor ( const u in src ) {\n\n\t\tdst[ u ] = {};\n\n\t\tfor ( const p in src[ u ] ) {\n\n\t\t\tconst property = src[ u ][ p ];\n\n\t\t\tif ( property && ( property.isColor ||\n\t\t\t\tproperty.isMatrix3 || property.isMatrix4 ||\n\t\t\t\tproperty.isVector2 || property.isVector3 || property.isVector4 ||\n\t\t\t\tproperty.isTexture || property.isQuaternion ) ) {\n\n\t\t\t\tif ( property.isRenderTargetTexture ) {\n\n\t\t\t\t\tconsole.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );\n\t\t\t\t\tdst[ u ][ p ] = null;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdst[ u ][ p ] = property.clone();\n\n\t\t\t\t}\n\n\t\t\t} else if ( Array.isArray( property ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.slice();\n\n\t\t\t} else {\n\n\t\t\t\tdst[ u ][ p ] = property;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction mergeUniforms( uniforms ) {\n\n\tconst merged = {};\n\n\tfor ( let u = 0; u < uniforms.length; u ++ ) {\n\n\t\tconst tmp = cloneUniforms( uniforms[ u ] );\n\n\t\tfor ( const p in tmp ) {\n\n\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t}\n\n\t}\n\n\treturn merged;\n\n}\n\nfunction cloneUniformsGroups( src ) {\n\n\tconst dst = [];\n\n\tfor ( let u = 0; u < src.length; u ++ ) {\n\n\t\tdst.push( src[ u ].clone() );\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction getUnlitUniformColorSpace( renderer ) {\n\n\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\tif ( currentRenderTarget === null ) {\n\n\t\t// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398\n\t\treturn renderer.outputColorSpace;\n\n\t}\n\n\t// https://github.com/mrdoob/three.js/issues/27868\n\tif ( currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\treturn currentRenderTarget.texture.colorSpace;\n\n\t}\n\n\treturn ColorManagement.workingColorSpace;\n\n}\n\n// Legacy\n\nconst UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };\n\nvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\nvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\nclass ShaderMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isShaderMaterial = true;\n\n\t\tthis.type = 'ShaderMaterial';\n\n\t\tthis.defines = {};\n\t\tthis.uniforms = {};\n\t\tthis.uniformsGroups = [];\n\n\t\tthis.vertexShader = default_vertex;\n\t\tthis.fragmentShader = default_fragment;\n\n\t\tthis.linewidth = 1;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false; // set to use scene fog\n\t\tthis.lights = false; // set to use scene lights\n\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\tthis.forceSinglePass = true;\n\n\t\tthis.extensions = {\n\t\t\tclipCullDistance: false, // set to use vertex shader clipping\n\t\t\tmultiDraw: false // set to use vertex shader multi_draw / enable gl_DrawID\n\t\t};\n\n\t\t// When rendered geometry doesn't include these attributes but the material does,\n\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv1': [ 0, 0 ]\n\t\t};\n\n\t\tthis.index0AttributeName = undefined;\n\t\tthis.uniformsNeedUpdate = false;\n\n\t\tthis.glslVersion = null;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = cloneUniforms( source.uniforms );\n\t\tthis.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );\n\n\t\tthis.defines = Object.assign( {}, source.defines );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.fog = source.fog;\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.extensions = Object.assign( {}, source.extensions );\n\n\t\tthis.glslVersion = source.glslVersion;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.glslVersion = this.glslVersion;\n\t\tdata.uniforms = {};\n\n\t\tfor ( const name in this.uniforms ) {\n\n\t\t\tconst uniform = this.uniforms[ name ];\n\t\t\tconst value = uniform.value;\n\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: value.toJSON( meta ).uuid\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isColor ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector2 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\tvalue: value\n\t\t\t\t};\n\n\t\t\t\t// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines;\n\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\tdata.lights = this.lights;\n\t\tdata.clipping = this.clipping;\n\n\t\tconst extensions = {};\n\n\t\tfor ( const key in this.extensions ) {\n\n\t\t\tif ( this.extensions[ key ] === true ) extensions[ key ] = true;\n\n\t\t}\n\n\t\tif ( Object.keys( extensions ).length > 0 ) data.extensions = extensions;\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass Camera extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isCamera = true;\n\n\t\tthis.type = 'Camera';\n\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\tthis.projectionMatrix = new Matrix4();\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\tthis.coordinateSystem = source.coordinateSystem;\n\n\t\treturn this;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\treturn super.getWorldDirection( target ).negate();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _v3$1 = /*@__PURE__*/ new Vector3();\nconst _minTarget = /*@__PURE__*/ new Vector2();\nconst _maxTarget = /*@__PURE__*/ new Vector2();\n\n\nclass PerspectiveCamera extends Camera {\n\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.isPerspectiveCamera = true;\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\tthis.fov = fov;\n\t\tthis.zoom = 1;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.focus = 10;\n\n\t\tthis.aspect = aspect;\n\t\tthis.view = null;\n\n\t\tthis.filmGauge = 35;\t// width of the film (default in millimeters)\n\t\tthis.filmOffset = 0;\t// horizontal film offset (same unit as gauge)\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Calculates the focal length from the current .fov and .filmGauge.\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect < 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect > 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.\n\t */\n\tgetViewBounds( distance, minTarget, maxTarget ) {\n\n\t\t_v3$1.set( - 1, - 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tminTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t\t_v3$1.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tmaxTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t}\n\n\t/**\n\t * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Copies the result into the target Vector2, where x is width and y is height.\n\t */\n\tgetViewSize( distance, target ) {\n\n\t\tthis.getViewBounds( distance, _minTarget, _maxTarget );\n\n\t\treturn target.subVectors( _maxTarget, _minTarget );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = - 0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst fov = - 90; // negative fov is not an error\nconst aspect = 1;\n\nclass CubeCamera extends Object3D {\n\n\tconstructor( near, far, renderTarget ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubeCamera';\n\n\t\tthis.renderTarget = renderTarget;\n\t\tthis.coordinateSystem = null;\n\t\tthis.activeMipmapLevel = 0;\n\n\t\tconst cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.layers = this.layers;\n\t\tthis.add( cameraPX );\n\n\t\tconst cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.layers = this.layers;\n\t\tthis.add( cameraNX );\n\n\t\tconst cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.layers = this.layers;\n\t\tthis.add( cameraPY );\n\n\t\tconst cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.layers = this.layers;\n\t\tthis.add( cameraNY );\n\n\t\tconst cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.layers = this.layers;\n\t\tthis.add( cameraPZ );\n\n\t\tconst cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.layers = this.layers;\n\t\tthis.add( cameraNZ );\n\n\t}\n\n\tupdateCoordinateSystem() {\n\n\t\tconst coordinateSystem = this.coordinateSystem;\n\n\t\tconst cameras = this.children.concat();\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;\n\n\t\tfor ( const camera of cameras ) this.remove( camera );\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, 1, 0 );\n\t\t\tcameraPX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, 1, 0 );\n\t\t\tcameraNX.lookAt( - 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, - 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, 1 );\n\t\t\tcameraNY.lookAt( 0, - 1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, - 1 );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, - 1, 0 );\n\t\t\tcameraPX.lookAt( - 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, - 1, 0 );\n\t\t\tcameraNX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, - 1 );\n\t\t\tcameraNY.lookAt( 0, - 1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, - 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, - 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, - 1 );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tfor ( const camera of cameras ) {\n\n\t\t\tthis.add( camera );\n\n\t\t\tcamera.updateMatrixWorld();\n\n\t\t}\n\n\t}\n\n\tupdate( renderer, scene ) {\n\n\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\tconst { renderTarget, activeMipmapLevel } = this;\n\n\t\tif ( this.coordinateSystem !== renderer.coordinateSystem ) {\n\n\t\t\tthis.coordinateSystem = renderer.coordinateSystem;\n\n\t\t\tthis.updateCoordinateSystem();\n\n\t\t}\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst currentActiveCubeFace = renderer.getActiveCubeFace();\n\t\tconst currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst currentXrEnabled = renderer.xr.enabled;\n\n\t\trenderer.xr.enabled = false;\n\n\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\trenderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPX );\n\n\t\trenderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNX );\n\n\t\trenderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPY );\n\n\t\trenderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNY );\n\n\t\trenderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPZ );\n\n\t\t// mipmaps are generated during the last call of render()\n\t\t// at this point, all sides of the cube render target are defined\n\n\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\trenderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNZ );\n\n\t\trenderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );\n\n\t\trenderer.xr.enabled = currentXrEnabled;\n\n\t\trenderTarget.texture.needsPMREMUpdate = true;\n\n\t}\n\n}\n\nclass CubeTexture extends Texture {\n\n\tconstructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ) {\n\n\t\timages = images !== undefined ? images : [];\n\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\n\t\tsuper( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.flipY = false;\n\n\t}\n\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\nclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( size = 1, options = {} ) {\n\n\t\tsuper( size, size, options );\n\n\t\tthis.isWebGLCubeRenderTarget = true;\n\n\t\tconst image = { width: size, height: size, depth: 1 };\n\t\tconst images = [ image, image, image, image, image, image ];\n\n\t\tthis.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );\n\n\t\t// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\n\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\n\t}\n\n\tfromEquirectangularTexture( renderer, texture ) {\n\n\t\tthis.texture.type = texture.type;\n\t\tthis.texture.colorSpace = texture.colorSpace;\n\n\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\tthis.texture.minFilter = texture.minFilter;\n\t\tthis.texture.magFilter = texture.magFilter;\n\n\t\tconst shader = {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n\t\t};\n\n\t\tconst geometry = new BoxGeometry( 5, 5, 5 );\n\n\t\tconst material = new ShaderMaterial( {\n\n\t\t\tname: 'CubemapFromEquirect',\n\n\t\t\tuniforms: cloneUniforms( shader.uniforms ),\n\t\t\tvertexShader: shader.vertexShader,\n\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\tside: BackSide,\n\t\t\tblending: NoBlending\n\n\t\t} );\n\n\t\tmaterial.uniforms.tEquirect.value = texture;\n\n\t\tconst mesh = new Mesh( geometry, material );\n\n\t\tconst currentMinFilter = texture.minFilter;\n\n\t\t// Avoid blurred poles\n\t\tif ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;\n\n\t\tconst camera = new CubeCamera( 1, 10, this );\n\t\tcamera.update( renderer, mesh );\n\n\t\ttexture.minFilter = currentMinFilter;\n\n\t\tmesh.geometry.dispose();\n\t\tmesh.material.dispose();\n\n\t\treturn this;\n\n\t}\n\n\tclear( renderer, color, depth, stencil ) {\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\trenderer.setRenderTarget( this, i );\n\n\t\t\trenderer.clear( color, depth, stencil );\n\n\t\t}\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n}\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\nclass Plane {\n\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\tthis.isPlane = true;\n\n\t\t// normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\n\t}\n\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.constant *= - 1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );\n\n\t}\n\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( line.start ).addScaledVector( direction, t );\n\n\t}\n\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _sphere$5 = /*@__PURE__*/ new Sphere();\nconst _vector$7 = /*@__PURE__*/ new Vector3();\n\nclass Frustum {\n\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tintersectsObject( object ) {\n\n\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\n\t\t\t_sphere$5.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t} else {\n\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$5.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t}\n\n\t\treturn this.intersectsSphere( _sphere$5 );\n\n\t}\n\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere$5.center.set( 0, 0, 0 );\n\t\t_sphere$5.radius = 0.7071067811865476;\n\t\t_sphere$5.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$5 );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t_vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t_vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector$7 ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nfunction WebGLAnimation() {\n\n\tlet context = null;\n\tlet isAnimating = false;\n\tlet animationLoop = null;\n\tlet requestId = null;\n\n\tfunction onAnimationFrame( time, frame ) {\n\n\t\tanimationLoop( time, frame );\n\n\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t}\n\n\treturn {\n\n\t\tstart: function () {\n\n\t\t\tif ( isAnimating === true ) return;\n\t\t\tif ( animationLoop === null ) return;\n\n\t\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t\t\tisAnimating = true;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tcontext.cancelAnimationFrame( requestId );\n\n\t\t\tisAnimating = false;\n\n\t\t},\n\n\t\tsetAnimationLoop: function ( callback ) {\n\n\t\t\tanimationLoop = callback;\n\n\t\t},\n\n\t\tsetContext: function ( value ) {\n\n\t\t\tcontext = value;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLAttributes( gl ) {\n\n\tconst buffers = new WeakMap();\n\n\tfunction createBuffer( attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst usage = attribute.usage;\n\t\tconst size = array.byteLength;\n\n\t\tconst buffer = gl.createBuffer();\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\t\tgl.bufferData( bufferType, array, usage );\n\n\t\tattribute.onUploadCallback();\n\n\t\tlet type;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\ttype = gl.FLOAT;\n\n\t\t} else if ( array instanceof Uint16Array ) {\n\n\t\t\tif ( attribute.isFloat16BufferAttribute ) {\n\n\t\t\t\ttype = gl.HALF_FLOAT;\n\n\t\t\t} else {\n\n\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\n\t\t\t}\n\n\t\t} else if ( array instanceof Int16Array ) {\n\n\t\t\ttype = gl.SHORT;\n\n\t\t} else if ( array instanceof Uint32Array ) {\n\n\t\t\ttype = gl.UNSIGNED_INT;\n\n\t\t} else if ( array instanceof Int32Array ) {\n\n\t\t\ttype = gl.INT;\n\n\t\t} else if ( array instanceof Int8Array ) {\n\n\t\t\ttype = gl.BYTE;\n\n\t\t} else if ( array instanceof Uint8Array ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else if ( array instanceof Uint8ClampedArray ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.WebGLAttributes: Unsupported buffer data format: ' + array );\n\n\t\t}\n\n\t\treturn {\n\t\t\tbuffer: buffer,\n\t\t\ttype: type,\n\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\tversion: attribute.version,\n\t\t\tsize: size\n\t\t};\n\n\t}\n\n\tfunction updateBuffer( buffer, attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst updateRange = attribute._updateRange; // @deprecated, r159\n\t\tconst updateRanges = attribute.updateRanges;\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\n\t\tif ( updateRange.count === - 1 && updateRanges.length === 0 ) {\n\n\t\t\t// Not using update ranges\n\t\t\tgl.bufferSubData( bufferType, 0, array );\n\n\t\t}\n\n\t\tif ( updateRanges.length !== 0 ) {\n\n\t\t\tfor ( let i = 0, l = updateRanges.length; i < l; i ++ ) {\n\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\tgl.bufferSubData( bufferType, range.start * array.BYTES_PER_ELEMENT,\n\t\t\t\t\tarray, range.start, range.count );\n\n\t\t\t}\n\n\t\t\tattribute.clearUpdateRanges();\n\n\t\t}\n\n\t\t// @deprecated, r159\n\t\tif ( updateRange.count !== - 1 ) {\n\n\t\t\tgl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,\n\t\t\t\tarray, updateRange.offset, updateRange.count );\n\n\t\t\tupdateRange.count = - 1; // reset range\n\n\t\t}\n\n\t\tattribute.onUploadCallback();\n\n\t}\n\n\t//\n\n\tfunction get( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\treturn buffers.get( attribute );\n\n\t}\n\n\tfunction remove( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data ) {\n\n\t\t\tgl.deleteBuffer( data.buffer );\n\n\t\t\tbuffers.delete( attribute );\n\n\t\t}\n\n\t}\n\n\tfunction update( attribute, bufferType ) {\n\n\t\tif ( attribute.isGLBufferAttribute ) {\n\n\t\t\tconst cached = buffers.get( attribute );\n\n\t\t\tif ( ! cached || cached.version < attribute.version ) {\n\n\t\t\t\tbuffers.set( attribute, {\n\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\tversion: attribute.version\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data === undefined ) {\n\n\t\t\tbuffers.set( attribute, createBuffer( attribute, bufferType ) );\n\n\t\t} else if ( data.version < attribute.version ) {\n\n\t\t\tif ( data.size !== attribute.array.byteLength ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLAttributes: The size of the buffer attribute\\'s array buffer does not match the original size. Resizing buffer attributes is not supported.' );\n\n\t\t\t}\n\n\t\t\tupdateBuffer( data.buffer, attribute, bufferType );\n\n\t\t\tdata.version = attribute.version;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update\n\n\t};\n\n}\n\nclass PlaneGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PlaneGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tconst width_half = width / 2;\n\t\tconst height_half = height / 2;\n\n\t\tconst gridX = Math.floor( widthSegments );\n\t\tconst gridY = Math.floor( heightSegments );\n\n\t\tconst gridX1 = gridX + 1;\n\t\tconst gridY1 = gridY + 1;\n\n\t\tconst segment_width = width / gridX;\n\t\tconst segment_height = height / gridY;\n\n\t\t//\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tconst x = ix * segment_width - width_half;\n\n\t\t\t\tvertices.push( x, - y, 0 );\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\tconst b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tconst c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tconst d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );\n\n\t}\n\n}\n\nvar alphahash_fragment = \"#ifdef USE_ALPHAHASH\\n\\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\\n#endif\";\n\nvar alphahash_pars_fragment = \"#ifdef USE_ALPHAHASH\\n\\tconst float ALPHA_HASH_SCALE = 0.05;\\n\\tfloat hash2D( vec2 value ) {\\n\\t\\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\\n\\t}\\n\\tfloat hash3D( vec3 value ) {\\n\\t\\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\\n\\t}\\n\\tfloat getAlphaHashThreshold( vec3 position ) {\\n\\t\\tfloat maxDeriv = max(\\n\\t\\t\\tlength( dFdx( position.xyz ) ),\\n\\t\\t\\tlength( dFdy( position.xyz ) )\\n\\t\\t);\\n\\t\\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\\n\\t\\tvec2 pixScales = vec2(\\n\\t\\t\\texp2( floor( log2( pixScale ) ) ),\\n\\t\\t\\texp2( ceil( log2( pixScale ) ) )\\n\\t\\t);\\n\\t\\tvec2 alpha = vec2(\\n\\t\\t\\thash3D( floor( pixScales.x * position.xyz ) ),\\n\\t\\t\\thash3D( floor( pixScales.y * position.xyz ) )\\n\\t\\t);\\n\\t\\tfloat lerpFactor = fract( log2( pixScale ) );\\n\\t\\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\\n\\t\\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\\n\\t\\tvec3 cases = vec3(\\n\\t\\t\\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\\n\\t\\t\\t( x - 0.5 * a ) / ( 1.0 - a ),\\n\\t\\t\\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\\n\\t\\t);\\n\\t\\tfloat threshold = ( x < ( 1.0 - a ) )\\n\\t\\t\\t? ( ( x < a ) ? cases.x : cases.y )\\n\\t\\t\\t: cases.z;\\n\\t\\treturn clamp( threshold , 1.0e-6, 1.0 );\\n\\t}\\n#endif\";\n\nvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\\n#endif\";\n\nvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar alphatest_fragment = \"#ifdef USE_ALPHATEST\\n\\t#ifdef ALPHA_TO_COVERAGE\\n\\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\\n\\tif ( diffuseColor.a == 0.0 ) discard;\\n\\t#else\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n\\t#endif\\n#endif\";\n\nvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\nvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_CLEARCOAT ) \\n\\t\\tclearcoatSpecularIndirect *= ambientOcclusion;\\n\\t#endif\\n\\t#if defined( USE_SHEEN ) \\n\\t\\tsheenSpecularIndirect *= ambientOcclusion;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";\n\nvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\nvar batching_pars_vertex = \"#ifdef USE_BATCHING\\n\\tattribute float batchId;\\n\\tuniform highp sampler2D batchingTexture;\\n\\tmat4 getBatchingMatrix( const in float i ) {\\n\\t\\tint size = textureSize( batchingTexture, 0 ).x;\\n\\t\\tint j = int( i ) * 4;\\n\\t\\tint x = j % size;\\n\\t\\tint y = j / size;\\n\\t\\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\\n\\t\\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\\n\\t\\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\\n\\t\\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\\n\\t\\treturn mat4( v1, v2, v3, v4 );\\n\\t}\\n#endif\";\n\nvar batching_vertex = \"#ifdef USE_BATCHING\\n\\tmat4 batchingMatrix = getBatchingMatrix( batchId );\\n#endif\";\n\nvar begin_vertex = \"vec3 transformed = vec3( position );\\n#ifdef USE_ALPHAHASH\\n\\tvPosition = vec3( position );\\n#endif\";\n\nvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\nvar bsdfs = \"float G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n} // validated\";\n\nvar iridescence_fragment = \"#ifdef USE_IRIDESCENCE\\n\\tconst mat3 XYZ_TO_REC709 = mat3(\\n\\t\\t 3.2404542, -0.9692660, 0.0556434,\\n\\t\\t-1.5371385, 1.8760108, -0.2040259,\\n\\t\\t-0.4985314, 0.0415560, 1.0572252\\n\\t);\\n\\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\\n\\t\\tvec3 sqrtF0 = sqrt( fresnel0 );\\n\\t\\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\\n\\t}\\n\\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\\n\\t}\\n\\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\\n\\t}\\n\\tvec3 evalSensitivity( float OPD, vec3 shift ) {\\n\\t\\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\\n\\t\\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\\n\\t\\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\\n\\t\\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\\n\\t\\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\\n\\t\\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\\n\\t\\txyz /= 1.0685e-7;\\n\\t\\tvec3 rgb = XYZ_TO_REC709 * xyz;\\n\\t\\treturn rgb;\\n\\t}\\n\\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\\n\\t\\tvec3 I;\\n\\t\\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\\n\\t\\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\\n\\t\\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\\n\\t\\tif ( cosTheta2Sq < 0.0 ) {\\n\\t\\t\\treturn vec3( 1.0 );\\n\\t\\t}\\n\\t\\tfloat cosTheta2 = sqrt( cosTheta2Sq );\\n\\t\\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\\n\\t\\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\\n\\t\\tfloat T121 = 1.0 - R12;\\n\\t\\tfloat phi12 = 0.0;\\n\\t\\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\\n\\t\\tfloat phi21 = PI - phi12;\\n\\t\\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\\t\\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\\n\\t\\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\\n\\t\\tvec3 phi23 = vec3( 0.0 );\\n\\t\\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\\n\\t\\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\\n\\t\\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\\n\\t\\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\\n\\t\\tvec3 phi = vec3( phi21 ) + phi23;\\n\\t\\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\\n\\t\\tvec3 r123 = sqrt( R123 );\\n\\t\\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\\n\\t\\tvec3 C0 = R12 + Rs;\\n\\t\\tI = C0;\\n\\t\\tvec3 Cm = Rs - T121;\\n\\t\\tfor ( int m = 1; m <= 2; ++ m ) {\\n\\t\\t\\tCm *= r123;\\n\\t\\t\\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\\n\\t\\t\\tI += Cm * Sm;\\n\\t\\t}\\n\\t\\treturn max( I, vec3( 0.0 ) );\\n\\t}\\n#endif\";\n\nvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vBumpMapUv );\\n\\t\\tvec2 dSTdy = dFdy( vBumpMapUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\\t\\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\\n\\t\\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\";\n\nvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#ifdef ALPHA_TO_COVERAGE\\n\\t\\tfloat distanceToPlane, distanceGradient;\\n\\t\\tfloat clipOpacity = 1.0;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\\t\\t\\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\\t\\t\\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\\t\\t\\tif ( clipOpacity == 0.0 ) discard;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\t\\tfloat unionClipOpacity = 1.0;\\n\\t\\t\\t#pragma unroll_loop_start\\n\\t\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\t\\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\\t\\t\\t\\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\\t\\t\\t\\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\\t\\t\\t}\\n\\t\\t\\t#pragma unroll_loop_end\\n\\t\\t\\tclipOpacity *= 1.0 - unionClipOpacity;\\n\\t\\t#endif\\n\\t\\tdiffuseColor.a *= clipOpacity;\\n\\t\\tif ( diffuseColor.a == 0.0 ) discard;\\n\\t#else\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\t\\tbool clipped = true;\\n\\t\\t\\t#pragma unroll_loop_start\\n\\t\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t\\t}\\n\\t\\t\\t#pragma unroll_loop_end\\n\\t\\t\\tif ( clipped ) discard;\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\nvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\nvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\nvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\nvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_pars_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\";\n\nvar common = \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nvec3 pow2( const in vec3 x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\n#ifdef USE_ALPHAHASH\\n\\tvarying vec3 vPosition;\\n#endif\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat luminance( const in vec3 rgb ) {\\n\\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\\n\\treturn dot( weights, rgb );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n} // validated\";\n\nvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\\n\\t\\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\\n\\t\\tuv.x *= CUBEUV_TEXEL_WIDTH;\\n\\t\\tuv.y *= CUBEUV_TEXEL_HEIGHT;\\n\\t\\t#ifdef texture2DGradEXT\\n\\t\\t\\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( envMap, uv ).rgb;\\n\\t\\t#endif\\n\\t}\\n\\t#define cubeUV_r0 1.0\\n\\t#define cubeUV_m0 - 2.0\\n\\t#define cubeUV_r1 0.8\\n\\t#define cubeUV_m1 - 1.0\\n\\t#define cubeUV_r4 0.4\\n\\t#define cubeUV_m4 2.0\\n\\t#define cubeUV_r5 0.305\\n\\t#define cubeUV_m5 3.0\\n\\t#define cubeUV_r6 0.21\\n\\t#define cubeUV_m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= cubeUV_r1 ) {\\n\\t\\t\\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\\n\\t\\t} else if ( roughness >= cubeUV_r4 ) {\\n\\t\\t\\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\\n\\t\\t} else if ( roughness >= cubeUV_r5 ) {\\n\\t\\t\\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\\n\\t\\t} else if ( roughness >= cubeUV_r6 ) {\\n\\t\\t\\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\";\n\nvar defaultnormal_vertex = \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = objectTangent;\\n#endif\\n#ifdef USE_BATCHING\\n\\tmat3 bm = mat3( batchingMatrix );\\n\\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\\n\\ttransformedNormal = bm * transformedNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\ttransformedTangent = bm * transformedTangent;\\n\\t#endif\\n#endif\\n#ifdef USE_INSTANCING\\n\\tmat3 im = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\\n\\ttransformedNormal = im * transformedNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\ttransformedTangent = im * transformedTangent;\\n\\t#endif\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";\n\nvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\nvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\\n#endif\";\n\nvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";\n\nvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\nvar colorspace_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\nvar colorspace_pars_fragment = \"\\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\\n\\tvec3( 0.8224621, 0.177538, 0.0 ),\\n\\tvec3( 0.0331941, 0.9668058, 0.0 ),\\n\\tvec3( 0.0170827, 0.0723974, 0.9105199 )\\n);\\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\\n\\tvec3( 1.2249401, - 0.2249404, 0.0 ),\\n\\tvec3( - 0.0420569, 1.0420571, 0.0 ),\\n\\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\\n);\\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\\n\\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\\n}\\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\\n\\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\\n}\\nvec4 LinearTransferOETF( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 sRGBTransferOETF( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\\nvec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn sRGBTransferOETF( value );\\n}\";\n\nvar envmap_fragment = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\";\n\nvar envmap_common_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\tuniform mat3 envMapRotation;\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\t\\n#endif\";\n\nvar envmap_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\";\n\nvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\";\n\nvar envmap_vertex = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\nvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\nvar fog_fragment = \"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\";\n\nvar fog_pars_fragment = \"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";\n\nvar gradientmap_pars_fragment = \"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn vec3( texture2D( gradientMap, coord ).r );\\n\\t#else\\n\\t\\tvec2 fw = fwidth( coord ) * 0.5;\\n\\t\\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\\n\\t#endif\\n}\";\n\nvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\nvar lights_lambert_fragment = \"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\";\n\nvar lights_lambert_pars_fragment = \"varying vec3 vViewPosition;\\nstruct LambertMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Lambert\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Lambert\";\n\nvar lights_pars_begin = \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\n#if defined( USE_LIGHT_PROBES )\\n\\tuniform vec3 lightProbe[ 9 ];\\n#endif\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t#if defined ( LEGACY_LIGHTS )\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#else\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#endif\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometryPosition;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometryPosition;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\";\n\nvar envmap_physical_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\tvec3 reflectVec = reflect( - viewDir, normal );\\n\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\\n\\t\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\t\\tvec3 bentNormal = cross( bitangent, viewDir );\\n\\t\\t\\t\\tbentNormal = normalize( cross( bentNormal, bitangent ) );\\n\\t\\t\\t\\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\\n\\t\\t\\t\\treturn getIBLRadiance( viewDir, bentNormal, roughness );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\nvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\nvar lights_toon_pars_fragment = \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\";\n\nvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\nvar lights_phong_pars_fragment = \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\";\n\nvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\tmaterial.ior = ior;\\n\\t#ifdef USE_SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularColorFactor = specularColor;\\n\\t\\t#ifdef USE_SPECULAR_COLORMAP\\n\\t\\t\\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularColorFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_DISPERSION\\n\\tmaterial.dispersion = dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tmaterial.iridescence = iridescence;\\n\\tmaterial.iridescenceIOR = iridescenceIOR;\\n\\t#ifdef USE_IRIDESCENCEMAP\\n\\t\\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\t\\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\\n\\t#else\\n\\t\\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\\n\\t#endif\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenColor = sheenColor;\\n\\t#ifdef USE_SHEEN_COLORMAP\\n\\t\\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\\n\\t#endif\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n\\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\t\\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\\n\\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\\t#ifdef USE_ANISOTROPYMAP\\n\\t\\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\\n\\t\\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\\n\\t\\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\\n\\t#else\\n\\t\\tvec2 anisotropyV = anisotropyVector;\\n\\t#endif\\n\\tmaterial.anisotropy = length( anisotropyV );\\n\\tif( material.anisotropy == 0.0 ) {\\n\\t\\tanisotropyV = vec2( 1.0, 0.0 );\\n\\t} else {\\n\\t\\tanisotropyV /= material.anisotropy;\\n\\t\\tmaterial.anisotropy = saturate( material.anisotropy );\\n\\t}\\n\\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\\n\\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\\n\\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\\n#endif\";\n\nvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\tfloat dispersion;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tfloat iridescence;\\n\\t\\tfloat iridescenceIOR;\\n\\t\\tfloat iridescenceThickness;\\n\\t\\tvec3 iridescenceFresnel;\\n\\t\\tvec3 iridescenceF0;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenColor;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n\\t#ifdef IOR\\n\\t\\tfloat ior;\\n\\t#endif\\n\\t#ifdef USE_TRANSMISSION\\n\\t\\tfloat transmission;\\n\\t\\tfloat transmissionAlpha;\\n\\t\\tfloat thickness;\\n\\t\\tfloat attenuationDistance;\\n\\t\\tvec3 attenuationColor;\\n\\t#endif\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tfloat anisotropy;\\n\\t\\tfloat alphaT;\\n\\t\\tvec3 anisotropyT;\\n\\t\\tvec3 anisotropyB;\\n\\t#endif\\n};\\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\\nvec3 sheenSpecularDirect = vec3( 0.0 );\\nvec3 sheenSpecularIndirect = vec3(0.0 );\\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\\n float x2 = x * x;\\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\n#ifdef USE_ANISOTROPY\\n\\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\\n\\t\\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\\n\\t\\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\\n\\t\\tfloat v = 0.5 / ( gv + gl );\\n\\t\\treturn saturate(v);\\n\\t}\\n\\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\\n\\t\\tfloat a2 = alphaT * alphaB;\\n\\t\\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\\n\\t\\thighp float v2 = dot( v, v );\\n\\t\\tfloat w2 = a2 / v2;\\n\\t\\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\\n\\t}\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\\n\\t\\tvec3 f0 = material.clearcoatF0;\\n\\t\\tfloat f90 = material.clearcoatF90;\\n\\t\\tfloat roughness = material.clearcoatRoughness;\\n\\t\\tfloat alpha = pow2( roughness );\\n\\t\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\t\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\t\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\t\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\t\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\t\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\t\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\t\\tfloat D = D_GGX( alpha, dotNH );\\n\\t\\treturn F * ( V * D );\\n\\t}\\n#endif\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\\tvec3 f0 = material.specularColor;\\n\\tfloat f90 = material.specularF90;\\n\\tfloat roughness = material.roughness;\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tF = mix( F, material.iridescenceFresnel, material.iridescence );\\n\\t#endif\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tfloat dotTL = dot( material.anisotropyT, lightDir );\\n\\t\\tfloat dotTV = dot( material.anisotropyT, viewDir );\\n\\t\\tfloat dotTH = dot( material.anisotropyT, halfDir );\\n\\t\\tfloat dotBL = dot( material.anisotropyB, lightDir );\\n\\t\\tfloat dotBV = dot( material.anisotropyB, viewDir );\\n\\t\\tfloat dotBH = dot( material.anisotropyB, halfDir );\\n\\t\\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\\n\\t\\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\\n\\t#else\\n\\t\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\t\\tfloat D = D_GGX( alpha, dotNH );\\n\\t#endif\\n\\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenColor * ( D * V );\\n}\\n#endif\\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat r2 = roughness * roughness;\\n\\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\\n\\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\\n\\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\\n\\treturn saturate( DG * RECIPROCAL_PI );\\n}\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\n#ifdef USE_IRIDESCENCE\\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#else\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#endif\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\\n\\t#else\\n\\t\\tvec3 Fr = specularColor;\\n\\t#endif\\n\\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometryNormal;\\n\\t\\tvec3 viewDir = geometryViewDir;\\n\\t\\tvec3 position = geometryPosition;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3( 0, 1, 0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\\n\\t#else\\n\\t\\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\t#endif\\n\\tvec3 totalScattering = singleScattering + multiScattering;\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\";\n\nvar lights_fragment_begin = \"\\nvec3 geometryPosition = - vViewPosition;\\nvec3 geometryNormal = normal;\\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\nvec3 geometryClearcoatNormal = vec3( 0.0 );\\n#ifdef USE_CLEARCOAT\\n\\tgeometryClearcoatNormal = clearcoatNormal;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\\n\\tif ( material.iridescenceThickness == 0.0 ) {\\n\\t\\tmaterial.iridescence = 0.0;\\n\\t} else {\\n\\t\\tmaterial.iridescence = saturate( material.iridescence );\\n\\t}\\n\\tif ( material.iridescence > 0.0 ) {\\n\\t\\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\\n\\t\\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\\n\\t}\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometryPosition, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\tvec4 spotColor;\\n\\tvec3 spotLightCoord;\\n\\tbool inSpotLightMap;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\\n\\t\\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\\n\\t\\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\\n\\t\\t#else\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#endif\\n\\t\\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\\n\\t\\t\\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\\n\\t\\t\\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\\n\\t\\t\\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\\n\\t\\t\\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\\n\\t\\t#endif\\n\\t\\t#undef SPOT_LIGHT_MAP_INDEX\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\t#if defined( USE_LIGHT_PROBES )\\n\\t\\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\\n\\t#endif\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\";\n\nvar lights_fragment_maps = \"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometryNormal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\\n\\t#else\\n\\t\\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";\n\nvar lights_fragment_end = \"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\";\n\nvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\nvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvFragDepth = 1.0 + gl_Position.w;\\n\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n#endif\";\n\nvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\\n\\t\\n\\t#endif\\n\\tdiffuseColor *= sampledDiffuseColor;\\n#endif\";\n\nvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\nvar map_particle_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\t#if defined( USE_POINTS_UV )\\n\\t\\tvec2 uv = vUv;\\n\\t#else\\n\\t\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\\t#endif\\n#endif\\n#ifdef USE_MAP\\n\\tdiffuseColor *= texture2D( map, uv );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\";\n\nvar map_particle_pars_fragment = \"#if defined( USE_POINTS_UV )\\n\\tvarying vec2 vUv;\\n#else\\n\\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\t\\tuniform mat3 uvTransform;\\n\\t#endif\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\nvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\nvar morphinstance_vertex = \"#ifdef USE_INSTANCING_MORPH\\n\\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\\n\\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\\n\\t}\\n#endif\";\n\nvar morphcolor_vertex = \"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\\n\\tvColor *= morphTargetBaseInfluence;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t#if defined( USE_COLOR_ALPHA )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t#elif defined( USE_COLOR )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\nvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\";\n\nvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\t#ifndef USE_INSTANCING_MORPH\\n\\t\\tuniform float morphTargetBaseInfluence;\\n\\t#endif\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\t#ifndef USE_INSTANCING_MORPH\\n\\t\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\t#endif\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform ivec2 morphTargetsTextureSize;\\n\\t\\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\\n\\t\\t\\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\\n\\t\\t\\tint y = texelIndex / morphTargetsTextureSize.x;\\n\\t\\t\\tint x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\\n\\t\\t\\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar normal_fragment_begin = \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = dFdx( vViewPosition );\\n\\tvec3 fdy = dFdy( vViewPosition );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal *= faceDirection;\\n\\t#endif\\n#endif\\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\\n\\t#ifdef USE_TANGENT\\n\\t\\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\\t#else\\n\\t\\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\\n\\t\\t#if defined( USE_NORMALMAP )\\n\\t\\t\\tvNormalMapUv\\n\\t\\t#elif defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tvClearcoatNormalMapUv\\n\\t\\t#else\\n\\t\\t\\tvUv\\n\\t\\t#endif\\n\\t\\t);\\n\\t#endif\\n\\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\\t\\ttbn[0] *= faceDirection;\\n\\t\\ttbn[1] *= faceDirection;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\t#ifdef USE_TANGENT\\n\\t\\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\\t#else\\n\\t\\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\\n\\t#endif\\n\\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\\t\\ttbn2[0] *= faceDirection;\\n\\t\\ttbn2[1] *= faceDirection;\\n\\t#endif\\n#endif\\nvec3 nonPerturbedNormal = normal;\";\n\nvar normal_fragment_maps = \"#ifdef USE_NORMALMAP_OBJECTSPACE\\n\\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\tnormal = normalize( tbn * mapN );\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";\n\nvar normal_pars_fragment = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\nvar normal_pars_vertex = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\nvar normal_vertex = \"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\";\n\nvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef USE_NORMALMAP_OBJECTSPACE\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\\n\\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( uv.st );\\n\\t\\tvec2 st1 = dFdy( uv.st );\\n\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\\n\\t\\treturn mat3( T * scale, B * scale, N );\\n\\t}\\n#endif\";\n\nvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = nonPerturbedNormal;\\n#endif\";\n\nvar clearcoat_normal_fragment_maps = \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\\n#endif\";\n\nvar clearcoat_pars_fragment = \"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\";\n\nvar iridescence_pars_fragment = \"#ifdef USE_IRIDESCENCEMAP\\n\\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform sampler2D iridescenceThicknessMap;\\n#endif\";\n\nvar opaque_fragment = \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= material.transmissionAlpha;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";\n\nvar packing = \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nvec2 packDepthToRG( in highp float v ) {\\n\\treturn packDepthToRGBA( v ).yx;\\n}\\nfloat unpackRGToDepth( const in highp vec2 v ) {\\n\\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\\n}\\nvec4 pack2HalfToRGBA( vec2 v ) {\\n\\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( vec4 v ) {\\n\\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\\treturn depth * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * depth - far );\\n}\";\n\nvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\nvar project_vertex = \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_BATCHING\\n\\tmvPosition = batchingMatrix * mvPosition;\\n#endif\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";\n\nvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\nvar dithering_pars_fragment = \"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\";\n\nvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\nvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\nvar shadowmap_pars_fragment = \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#if NUM_SPOT_LIGHT_MAPS > 0\\n\\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\n\\t\\t\\tfloat distance = compare - distribution.x ;\\n\\t\\t\\tfloat variance = max( 0.00000, distribution.y * distribution.y );\\n\\t\\t\\tfloat softness_probability = variance / (variance + distance * distance );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\\t\\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx2 = dx0 / 2.0;\\n\\t\\t\\tfloat dy2 = dy0 / 2.0;\\n\\t\\t\\tfloat dx3 = dx1 / 2.0;\\n\\t\\t\\tfloat dy3 = dy1 / 2.0;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 17.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\t\\n\\t\\tfloat lightToPositionLength = length( lightToPosition );\\n\\t\\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\\n\\t\\t\\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\t\\tdp += shadowBias;\\n\\t\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\t\\tshadow = (\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n#endif\";\n\nvar shadowmap_pars_vertex = \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\\n\\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\";\n\nvar shadowmap_vertex = \"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\\n\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\tvec4 shadowWorldPosition;\\n#endif\\n#if defined( USE_SHADOWMAP )\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if NUM_SPOT_LIGHT_COORDS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition;\\n\\t\\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t\\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\\n\\t\\t#endif\\n\\t\\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\";\n\nvar shadowmask_pars_fragment = \"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tpointLight = pointLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\";\n\nvar skinbase_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\";\n\nvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\tuniform highp sampler2D boneTexture;\\n\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\tint size = textureSize( boneTexture, 0 ).x;\\n\\t\\tint j = int( i ) * 4;\\n\\t\\tint x = j % size;\\n\\t\\tint y = j / size;\\n\\t\\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\\n\\t\\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\\n\\t\\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\\n\\t\\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\\n\\t\\treturn mat4( v1, v2, v3, v4 );\\n\\t}\\n#endif\";\n\nvar skinning_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\";\n\nvar skinnormal_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\";\n\nvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\nvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\nvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\nvar tonemapping_pars_fragment = \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn saturate( toneMappingExposure * color );\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3( 1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108, 1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605, 1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\\n\\tvec3( 1.6605, - 0.1246, - 0.0182 ),\\n\\tvec3( - 0.5876, 1.1329, - 0.1006 ),\\n\\tvec3( - 0.0728, - 0.0083, 1.1187 )\\n);\\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\\n\\tvec3( 0.6274, 0.0691, 0.0164 ),\\n\\tvec3( 0.3293, 0.9195, 0.0880 ),\\n\\tvec3( 0.0433, 0.0113, 0.8956 )\\n);\\nvec3 agxDefaultContrastApprox( vec3 x ) {\\n\\tvec3 x2 = x * x;\\n\\tvec3 x4 = x2 * x2;\\n\\treturn + 15.5 * x4 * x2\\n\\t\\t- 40.14 * x4 * x\\n\\t\\t+ 31.96 * x4\\n\\t\\t- 6.868 * x2 * x\\n\\t\\t+ 0.4298 * x2\\n\\t\\t+ 0.1191 * x\\n\\t\\t- 0.00232;\\n}\\nvec3 AgXToneMapping( vec3 color ) {\\n\\tconst mat3 AgXInsetMatrix = mat3(\\n\\t\\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\\n\\t\\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\\n\\t\\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\\n\\t);\\n\\tconst mat3 AgXOutsetMatrix = mat3(\\n\\t\\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\\n\\t\\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\\n\\t\\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\\n\\t);\\n\\tconst float AgxMinEv = - 12.47393;\\tconst float AgxMaxEv = 4.026069;\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\\n\\tcolor = AgXInsetMatrix * color;\\n\\tcolor = max( color, 1e-10 );\\tcolor = log2( color );\\n\\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\\n\\tcolor = clamp( color, 0.0, 1.0 );\\n\\tcolor = agxDefaultContrastApprox( color );\\n\\tcolor = AgXOutsetMatrix * color;\\n\\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\\n\\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\\n\\tcolor = clamp( color, 0.0, 1.0 );\\n\\treturn color;\\n}\\nvec3 NeutralToneMapping( vec3 color ) {\\n\\tconst float StartCompression = 0.8 - 0.04;\\n\\tconst float Desaturation = 0.15;\\n\\tcolor *= toneMappingExposure;\\n\\tfloat x = min( color.r, min( color.g, color.b ) );\\n\\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\\n\\tcolor -= offset;\\n\\tfloat peak = max( color.r, max( color.g, color.b ) );\\n\\tif ( peak < StartCompression ) return color;\\n\\tfloat d = 1. - StartCompression;\\n\\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\\n\\tcolor *= newPeak / peak;\\n\\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\\n\\treturn mix( color, vec3( newPeak ), g );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";\n\nvar transmission_fragment = \"#ifdef USE_TRANSMISSION\\n\\tmaterial.transmission = transmission;\\n\\tmaterial.transmissionAlpha = 1.0;\\n\\tmaterial.thickness = thickness;\\n\\tmaterial.attenuationDistance = attenuationDistance;\\n\\tmaterial.attenuationColor = attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmitted = getIBLVolumeRefraction(\\n\\t\\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\\n\\t\\tmaterial.attenuationColor, material.attenuationDistance );\\n\\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\\n\\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\\n#endif\";\n\nvar transmission_pars_fragment = \"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tfloat w0( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\\n\\t}\\n\\tfloat w1( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\\n\\t}\\n\\tfloat w2( float a ){\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\\n\\t}\\n\\tfloat w3( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * a * a );\\n\\t}\\n\\tfloat g0( float a ) {\\n\\t\\treturn w0( a ) + w1( a );\\n\\t}\\n\\tfloat g1( float a ) {\\n\\t\\treturn w2( a ) + w3( a );\\n\\t}\\n\\tfloat h0( float a ) {\\n\\t\\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\\n\\t}\\n\\tfloat h1( float a ) {\\n\\t\\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\\n\\t}\\n\\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\\n\\t\\tuv = uv * texelSize.zw + 0.5;\\n\\t\\tvec2 iuv = floor( uv );\\n\\t\\tvec2 fuv = fract( uv );\\n\\t\\tfloat g0x = g0( fuv.x );\\n\\t\\tfloat g1x = g1( fuv.x );\\n\\t\\tfloat h0x = h0( fuv.x );\\n\\t\\tfloat h1x = h1( fuv.x );\\n\\t\\tfloat h0y = h0( fuv.y );\\n\\t\\tfloat h1y = h1( fuv.y );\\n\\t\\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\\t\\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\\n\\t\\t\\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\\n\\t}\\n\\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\\n\\t\\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\\n\\t\\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\\n\\t\\tvec2 fLodSizeInv = 1.0 / fLodSize;\\n\\t\\tvec2 cLodSizeInv = 1.0 / cLodSize;\\n\\t\\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\\n\\t\\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\\n\\t\\treturn mix( fSample, cSample, fract( lod ) );\\n\\t}\\n\\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\\n\\t\\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\\n\\t}\\n\\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tif ( isinf( attenuationDistance ) ) {\\n\\t\\t\\treturn vec3( 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\\n\\t\\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\\n\\t\\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\\n\\t\\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tvec4 transmittedLight;\\n\\t\\tvec3 transmittance;\\n\\t\\t#ifdef USE_DISPERSION\\n\\t\\t\\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\\n\\t\\t\\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\\n\\t\\t\\tfor ( int i = 0; i < 3; i ++ ) {\\n\\t\\t\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\\n\\t\\t\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\t\\n\\t\\t\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\t\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\t\\t\\trefractionCoords += 1.0;\\n\\t\\t\\t\\trefractionCoords /= 2.0;\\n\\t\\t\\n\\t\\t\\t\\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\\n\\t\\t\\t\\ttransmittedLight[ i ] = transmissionSample[ i ];\\n\\t\\t\\t\\ttransmittedLight.a += transmissionSample.a;\\n\\t\\t\\t\\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\\n\\t\\t\\t}\\n\\t\\t\\ttransmittedLight.a /= 3.0;\\n\\t\\t\\n\\t\\t#else\\n\\t\\t\\n\\t\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\t\\trefractionCoords += 1.0;\\n\\t\\t\\trefractionCoords /= 2.0;\\n\\t\\t\\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\t\\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\t\\n\\t\\t#endif\\n\\t\\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\\n\\t}\\n#endif\";\n\nvar uv_pars_fragment = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tuniform mat3 transmissionMapTransform;\\n\\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tuniform mat3 thicknessMapTransform;\\n\\tvarying vec2 vThicknessMapUv;\\n#endif\";\n\nvar uv_pars_vertex = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform mat3 mapTransform;\\n\\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform mat3 alphaMapTransform;\\n\\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tuniform mat3 lightMapTransform;\\n\\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\\tuniform mat3 aoMapTransform;\\n\\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tuniform mat3 bumpMapTransform;\\n\\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tuniform mat3 normalMapTransform;\\n\\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\\tuniform mat3 displacementMapTransform;\\n\\tvarying vec2 vDisplacementMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tuniform mat3 emissiveMapTransform;\\n\\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tuniform mat3 metalnessMapTransform;\\n\\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tuniform mat3 roughnessMapTransform;\\n\\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tuniform mat3 anisotropyMapTransform;\\n\\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tuniform mat3 clearcoatMapTransform;\\n\\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform mat3 clearcoatNormalMapTransform;\\n\\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform mat3 clearcoatRoughnessMapTransform;\\n\\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tuniform mat3 sheenColorMapTransform;\\n\\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tuniform mat3 sheenRoughnessMapTransform;\\n\\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tuniform mat3 iridescenceMapTransform;\\n\\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform mat3 iridescenceThicknessMapTransform;\\n\\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tuniform mat3 specularMapTransform;\\n\\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tuniform mat3 specularColorMapTransform;\\n\\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tuniform mat3 specularIntensityMapTransform;\\n\\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tuniform mat3 transmissionMapTransform;\\n\\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tuniform mat3 thicknessMapTransform;\\n\\tvarying vec2 vThicknessMapUv;\\n#endif\";\n\nvar uv_vertex = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvUv = vec3( uv, 1 ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_AOMAP\\n\\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\";\n\nvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_BATCHING\\n\\t\\tworldPosition = batchingMatrix * worldPosition;\\n\\t#endif\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";\n\nconst vertex$h = \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\";\n\nconst fragment$h = \"uniform sampler2D t2D;\\nuniform float backgroundIntensity;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tvec4 texColor = texture2D( t2D, vUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\\n\\t#endif\\n\\ttexColor.rgb *= backgroundIntensity;\\n\\tgl_FragColor = texColor;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$g = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\nconst fragment$g = \"#ifdef ENVMAP_TYPE_CUBE\\n\\tuniform samplerCube envMap;\\n#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\tuniform sampler2D envMap;\\n#endif\\nuniform float flipEnvMap;\\nuniform float backgroundBlurriness;\\nuniform float backgroundIntensity;\\nuniform mat3 backgroundRotation;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\\n\\t#else\\n\\t\\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\t#endif\\n\\ttexColor.rgb *= backgroundIntensity;\\n\\tgl_FragColor = texColor;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$f = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\nconst fragment$f = \"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\nvoid main() {\\n\\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\\n\\tgl_FragColor = texColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$e = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\";\n\nconst fragment$e = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#endif\\n}\";\n\nconst vertex$d = \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvWorldPosition = worldPosition.xyz;\\n}\";\n\nconst fragment$d = \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main () {\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";\n\nconst vertex$c = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$c = \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$b = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$b = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$a = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$a = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include \\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$9 = \"#define LAMBERT\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$9 = \"#define LAMBERT\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$8 = \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n}\";\n\nconst fragment$8 = \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 viewDir = normalize( vViewPosition );\\n\\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\\tvec3 y = cross( viewDir, x );\\n\\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$7 = \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$7 = \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\\n\\t#ifdef OPAQUE\\n\\t\\tgl_FragColor.a = 1.0;\\n\\t#endif\\n}\";\n\nconst vertex$6 = \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$6 = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$5 = \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$5 = \"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define USE_SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef USE_SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\t#ifdef USE_SPECULAR_COLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_DISPERSION\\n\\tuniform float dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tuniform float iridescence;\\n\\tuniform float iridescenceIOR;\\n\\tuniform float iridescenceThicknessMinimum;\\n\\tuniform float iridescenceThicknessMaximum;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\t#ifdef USE_SHEEN_COLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\\tuniform vec2 anisotropyVector;\\n\\t#ifdef USE_ANISOTROPYMAP\\n\\t\\tuniform sampler2D anisotropyMap;\\n\\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include \\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_SHEEN\\n\\t\\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\\n\\t\\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$4 = \"#define TOON\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$4 = \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$3 = \"uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#ifdef USE_POINTS_UV\\n\\tvarying vec2 vUv;\\n\\tuniform mat3 uvTransform;\\n#endif\\nvoid main() {\\n\\t#ifdef USE_POINTS_UV\\n\\t\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$3 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$2 = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$2 = \"uniform vec3 color;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$1 = \"uniform float rotation;\\nuniform vec2 center;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tvec2 scale;\\n\\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\\n\\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\\n\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\\tvec2 rotatedPosition;\\n\\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$1 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst ShaderChunk = {\n\talphahash_fragment: alphahash_fragment,\n\talphahash_pars_fragment: alphahash_pars_fragment,\n\talphamap_fragment: alphamap_fragment,\n\talphamap_pars_fragment: alphamap_pars_fragment,\n\talphatest_fragment: alphatest_fragment,\n\talphatest_pars_fragment: alphatest_pars_fragment,\n\taomap_fragment: aomap_fragment,\n\taomap_pars_fragment: aomap_pars_fragment,\n\tbatching_pars_vertex: batching_pars_vertex,\n\tbatching_vertex: batching_vertex,\n\tbegin_vertex: begin_vertex,\n\tbeginnormal_vertex: beginnormal_vertex,\n\tbsdfs: bsdfs,\n\tiridescence_fragment: iridescence_fragment,\n\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\tclipping_planes_fragment: clipping_planes_fragment,\n\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\tclipping_planes_vertex: clipping_planes_vertex,\n\tcolor_fragment: color_fragment,\n\tcolor_pars_fragment: color_pars_fragment,\n\tcolor_pars_vertex: color_pars_vertex,\n\tcolor_vertex: color_vertex,\n\tcommon: common,\n\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\tdefaultnormal_vertex: defaultnormal_vertex,\n\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\tdisplacementmap_vertex: displacementmap_vertex,\n\temissivemap_fragment: emissivemap_fragment,\n\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\tcolorspace_fragment: colorspace_fragment,\n\tcolorspace_pars_fragment: colorspace_pars_fragment,\n\tenvmap_fragment: envmap_fragment,\n\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\tenvmap_pars_fragment: envmap_pars_fragment,\n\tenvmap_pars_vertex: envmap_pars_vertex,\n\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\tenvmap_vertex: envmap_vertex,\n\tfog_vertex: fog_vertex,\n\tfog_pars_vertex: fog_pars_vertex,\n\tfog_fragment: fog_fragment,\n\tfog_pars_fragment: fog_pars_fragment,\n\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\tlightmap_pars_fragment: lightmap_pars_fragment,\n\tlights_lambert_fragment: lights_lambert_fragment,\n\tlights_lambert_pars_fragment: lights_lambert_pars_fragment,\n\tlights_pars_begin: lights_pars_begin,\n\tlights_toon_fragment: lights_toon_fragment,\n\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\tlights_phong_fragment: lights_phong_fragment,\n\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\tlights_physical_fragment: lights_physical_fragment,\n\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\tlights_fragment_begin: lights_fragment_begin,\n\tlights_fragment_maps: lights_fragment_maps,\n\tlights_fragment_end: lights_fragment_end,\n\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\tmap_fragment: map_fragment,\n\tmap_pars_fragment: map_pars_fragment,\n\tmap_particle_fragment: map_particle_fragment,\n\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\tmetalnessmap_fragment: metalnessmap_fragment,\n\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\tmorphinstance_vertex: morphinstance_vertex,\n\tmorphcolor_vertex: morphcolor_vertex,\n\tmorphnormal_vertex: morphnormal_vertex,\n\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\tmorphtarget_vertex: morphtarget_vertex,\n\tnormal_fragment_begin: normal_fragment_begin,\n\tnormal_fragment_maps: normal_fragment_maps,\n\tnormal_pars_fragment: normal_pars_fragment,\n\tnormal_pars_vertex: normal_pars_vertex,\n\tnormal_vertex: normal_vertex,\n\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\tiridescence_pars_fragment: iridescence_pars_fragment,\n\topaque_fragment: opaque_fragment,\n\tpacking: packing,\n\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\tproject_vertex: project_vertex,\n\tdithering_fragment: dithering_fragment,\n\tdithering_pars_fragment: dithering_pars_fragment,\n\troughnessmap_fragment: roughnessmap_fragment,\n\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\tshadowmap_vertex: shadowmap_vertex,\n\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\tskinbase_vertex: skinbase_vertex,\n\tskinning_pars_vertex: skinning_pars_vertex,\n\tskinning_vertex: skinning_vertex,\n\tskinnormal_vertex: skinnormal_vertex,\n\tspecularmap_fragment: specularmap_fragment,\n\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\ttonemapping_fragment: tonemapping_fragment,\n\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\ttransmission_fragment: transmission_fragment,\n\ttransmission_pars_fragment: transmission_pars_fragment,\n\tuv_pars_fragment: uv_pars_fragment,\n\tuv_pars_vertex: uv_pars_vertex,\n\tuv_vertex: uv_vertex,\n\tworldpos_vertex: worldpos_vertex,\n\n\tbackground_vert: vertex$h,\n\tbackground_frag: fragment$h,\n\tbackgroundCube_vert: vertex$g,\n\tbackgroundCube_frag: fragment$g,\n\tcube_vert: vertex$f,\n\tcube_frag: fragment$f,\n\tdepth_vert: vertex$e,\n\tdepth_frag: fragment$e,\n\tdistanceRGBA_vert: vertex$d,\n\tdistanceRGBA_frag: fragment$d,\n\tequirect_vert: vertex$c,\n\tequirect_frag: fragment$c,\n\tlinedashed_vert: vertex$b,\n\tlinedashed_frag: fragment$b,\n\tmeshbasic_vert: vertex$a,\n\tmeshbasic_frag: fragment$a,\n\tmeshlambert_vert: vertex$9,\n\tmeshlambert_frag: fragment$9,\n\tmeshmatcap_vert: vertex$8,\n\tmeshmatcap_frag: fragment$8,\n\tmeshnormal_vert: vertex$7,\n\tmeshnormal_frag: fragment$7,\n\tmeshphong_vert: vertex$6,\n\tmeshphong_frag: fragment$6,\n\tmeshphysical_vert: vertex$5,\n\tmeshphysical_frag: fragment$5,\n\tmeshtoon_vert: vertex$4,\n\tmeshtoon_frag: fragment$4,\n\tpoints_vert: vertex$3,\n\tpoints_frag: fragment$3,\n\tshadow_vert: vertex$2,\n\tshadow_frag: fragment$2,\n\tsprite_vert: vertex$1,\n\tsprite_frag: fragment$1\n};\n\n/**\n * Uniforms library for shared webgl shaders\n */\n\nconst UniformsLib = {\n\n\tcommon: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaTest: { value: 0 }\n\n\t},\n\n\tspecularmap: {\n\n\t\tspecularMap: { value: null },\n\t\tspecularMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tenvmap: {\n\n\t\tenvMap: { value: null },\n\t\tenvMapRotation: { value: /*@__PURE__*/ new Matrix3() },\n\t\tflipEnvMap: { value: - 1 },\n\t\treflectivity: { value: 1.0 }, // basic, lambert, phong\n\t\tior: { value: 1.5 }, // physical\n\t\trefractionRatio: { value: 0.98 }, // basic, lambert, phong\n\n\t},\n\n\taomap: {\n\n\t\taoMap: { value: null },\n\t\taoMapIntensity: { value: 1 },\n\t\taoMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tlightmap: {\n\n\t\tlightMap: { value: null },\n\t\tlightMapIntensity: { value: 1 },\n\t\tlightMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tbumpmap: {\n\n\t\tbumpMap: { value: null },\n\t\tbumpMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tbumpScale: { value: 1 }\n\n\t},\n\n\tnormalmap: {\n\n\t\tnormalMap: { value: null },\n\t\tnormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tnormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }\n\n\t},\n\n\tdisplacementmap: {\n\n\t\tdisplacementMap: { value: null },\n\t\tdisplacementMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tdisplacementScale: { value: 1 },\n\t\tdisplacementBias: { value: 0 }\n\n\t},\n\n\temissivemap: {\n\n\t\temissiveMap: { value: null },\n\t\temissiveMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tmetalnessmap: {\n\n\t\tmetalnessMap: { value: null },\n\t\tmetalnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\troughnessmap: {\n\n\t\troughnessMap: { value: null },\n\t\troughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tgradientmap: {\n\n\t\tgradientMap: { value: null }\n\n\t},\n\n\tfog: {\n\n\t\tfogDensity: { value: 0.00025 },\n\t\tfogNear: { value: 1 },\n\t\tfogFar: { value: 2000 },\n\t\tfogColor: { value: /*@__PURE__*/ new Color( 0xffffff ) }\n\n\t},\n\n\tlights: {\n\n\t\tambientLightColor: { value: [] },\n\n\t\tlightProbe: { value: [] },\n\n\t\tdirectionalLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tcolor: {}\n\t\t} },\n\n\t\tdirectionalLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tdirectionalShadowMap: { value: [] },\n\t\tdirectionalShadowMatrix: { value: [] },\n\n\t\tspotLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdirection: {},\n\t\t\tdistance: {},\n\t\t\tconeCos: {},\n\t\t\tpenumbraCos: {},\n\t\t\tdecay: {}\n\t\t} },\n\n\t\tspotLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tspotLightMap: { value: [] },\n\t\tspotShadowMap: { value: [] },\n\t\tspotLightMatrix: { value: [] },\n\n\t\tpointLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdecay: {},\n\t\t\tdistance: {}\n\t\t} },\n\n\t\tpointLightShadows: { value: [], properties: {\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {},\n\t\t\tshadowCameraNear: {},\n\t\t\tshadowCameraFar: {}\n\t\t} },\n\n\t\tpointShadowMap: { value: [] },\n\t\tpointShadowMatrix: { value: [] },\n\n\t\themisphereLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tskyColor: {},\n\t\t\tgroundColor: {}\n\t\t} },\n\n\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\trectAreaLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\twidth: {},\n\t\t\theight: {}\n\t\t} },\n\n\t\tltc_1: { value: null },\n\t\tltc_2: { value: null }\n\n\t},\n\n\tpoints: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tsize: { value: 1.0 },\n\t\tscale: { value: 1.0 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tsprite: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tcenter: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },\n\t\trotation: { value: 0.0 },\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 }\n\n\t}\n\n};\n\nconst ShaderLib = {\n\n\tbasic: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\n\t},\n\n\tlambert: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\n\t},\n\n\tphong: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\tspecular: { value: /*@__PURE__*/ new Color( 0x111111 ) },\n\t\t\t\tshininess: { value: 30 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\tfragmentShader: ShaderChunk.meshphong_frag\n\n\t},\n\n\tstandard: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.roughnessmap,\n\t\t\tUniformsLib.metalnessmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\troughness: { value: 1.0 },\n\t\t\t\tmetalness: { value: 0.0 },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t},\n\n\ttoon: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.gradientmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\n\t},\n\n\tmatcap: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tmatcap: { value: null }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\n\t},\n\n\tpoints: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.points,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.points_vert,\n\t\tfragmentShader: ShaderChunk.points_frag\n\n\t},\n\n\tdashed: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tscale: { value: 1 },\n\t\t\t\tdashSize: { value: 1 },\n\t\t\t\ttotalSize: { value: 2 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\tfragmentShader: ShaderChunk.linedashed_frag\n\n\t},\n\n\tdepth: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.depth_vert,\n\t\tfragmentShader: ShaderChunk.depth_frag\n\n\t},\n\n\tnormal: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\n\t},\n\n\tsprite: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.sprite,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\tfragmentShader: ShaderChunk.sprite_frag\n\n\t},\n\n\tbackground: {\n\n\t\tuniforms: {\n\t\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tt2D: { value: null },\n\t\t\tbackgroundIntensity: { value: 1 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.background_vert,\n\t\tfragmentShader: ShaderChunk.background_frag\n\n\t},\n\n\tbackgroundCube: {\n\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tflipEnvMap: { value: - 1 },\n\t\t\tbackgroundBlurriness: { value: 0 },\n\t\t\tbackgroundIntensity: { value: 1 },\n\t\t\tbackgroundRotation: { value: /*@__PURE__*/ new Matrix3() }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.backgroundCube_vert,\n\t\tfragmentShader: ShaderChunk.backgroundCube_frag\n\n\t},\n\n\tcube: {\n\n\t\tuniforms: {\n\t\t\ttCube: { value: null },\n\t\t\ttFlip: { value: - 1 },\n\t\t\topacity: { value: 1.0 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.cube_vert,\n\t\tfragmentShader: ShaderChunk.cube_frag\n\n\t},\n\n\tequirect: {\n\n\t\tuniforms: {\n\t\t\ttEquirect: { value: null },\n\t\t},\n\n\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\tfragmentShader: ShaderChunk.equirect_frag\n\n\t},\n\n\tdistanceRGBA: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\treferencePosition: { value: /*@__PURE__*/ new Vector3() },\n\t\t\t\tnearDistance: { value: 1 },\n\t\t\t\tfarDistance: { value: 1000 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\n\t},\n\n\tshadow: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.lights,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tcolor: { value: /*@__PURE__*/ new Color( 0x00000 ) },\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t},\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\tfragmentShader: ShaderChunk.shadow_frag\n\n\t}\n\n};\n\nShaderLib.physical = {\n\n\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\tShaderLib.standard.uniforms,\n\t\t{\n\t\t\tclearcoat: { value: 0 },\n\t\t\tclearcoatMap: { value: null },\n\t\t\tclearcoatMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalMap: { value: null },\n\t\t\tclearcoatNormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) },\n\t\t\tclearcoatRoughness: { value: 0 },\n\t\t\tclearcoatRoughnessMap: { value: null },\n\t\t\tclearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tdispersion: { value: 0 },\n\t\t\tiridescence: { value: 0 },\n\t\t\tiridescenceMap: { value: null },\n\t\t\tiridescenceMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tiridescenceIOR: { value: 1.3 },\n\t\t\tiridescenceThicknessMinimum: { value: 100 },\n\t\t\tiridescenceThicknessMaximum: { value: 400 },\n\t\t\tiridescenceThicknessMap: { value: null },\n\t\t\tiridescenceThicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheen: { value: 0 },\n\t\t\tsheenColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tsheenColorMap: { value: null },\n\t\t\tsheenColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheenRoughness: { value: 1 },\n\t\t\tsheenRoughnessMap: { value: null },\n\t\t\tsheenRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmission: { value: 0 },\n\t\t\ttransmissionMap: { value: null },\n\t\t\ttransmissionMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() },\n\t\t\ttransmissionSamplerMap: { value: null },\n\t\t\tthickness: { value: 0 },\n\t\t\tthicknessMap: { value: null },\n\t\t\tthicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tattenuationDistance: { value: 0 },\n\t\t\tattenuationColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tspecularColor: { value: /*@__PURE__*/ new Color( 1, 1, 1 ) },\n\t\t\tspecularColorMap: { value: null },\n\t\t\tspecularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tspecularIntensity: { value: 1 },\n\t\t\tspecularIntensityMap: { value: null },\n\t\t\tspecularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tanisotropyVector: { value: /*@__PURE__*/ new Vector2() },\n\t\t\tanisotropyMap: { value: null },\n\t\t\tanisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t}\n\t] ),\n\n\tvertexShader: ShaderChunk.meshphysical_vert,\n\tfragmentShader: ShaderChunk.meshphysical_frag\n\n};\n\nconst _rgb = { r: 0, b: 0, g: 0 };\nconst _e1$1 = /*@__PURE__*/ new Euler();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {\n\n\tconst clearColor = new Color( 0x000000 );\n\tlet clearAlpha = alpha === true ? 0 : 1;\n\n\tlet planeMesh;\n\tlet boxMesh;\n\n\tlet currentBackground = null;\n\tlet currentBackgroundVersion = 0;\n\tlet currentTonemapping = null;\n\n\tfunction getBackground( scene ) {\n\n\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\tif ( background && background.isTexture ) {\n\n\t\t\tconst usePMREM = scene.backgroundBlurriness > 0; // use PMREM if the user wants to blur the background\n\t\t\tbackground = ( usePMREM ? cubeuvmaps : cubemaps ).get( background );\n\n\t\t}\n\n\t\treturn background;\n\n\t}\n\n\tfunction render( scene ) {\n\n\t\tlet forceClear = false;\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background === null ) {\n\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t} else if ( background && background.isColor ) {\n\n\t\t\tsetClear( background, 1 );\n\t\t\tforceClear = true;\n\n\t\t}\n\n\t\tconst environmentBlendMode = renderer.xr.getEnvironmentBlendMode();\n\n\t\tif ( environmentBlendMode === 'additive' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );\n\n\t\t} else if ( environmentBlendMode === 'alpha-blend' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );\n\n\t\t}\n\n\t\tif ( renderer.autoClear || forceClear ) {\n\n\t\t\trenderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\n\t\t}\n\n\t}\n\n\tfunction addToRenderList( renderList, scene ) {\n\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) {\n\n\t\t\tif ( boxMesh === undefined ) {\n\n\t\t\t\tboxMesh = new Mesh(\n\t\t\t\t\tnew BoxGeometry( 1, 1, 1 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.backgroundCube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.backgroundCube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'normal' );\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'uv' );\n\n\t\t\t\tboxMesh.onBeforeRender = function ( renderer, scene, camera ) {\n\n\t\t\t\t\tthis.matrixWorld.copyPosition( camera.matrixWorld );\n\n\t\t\t\t};\n\n\t\t\t\t// add \"envMap\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( boxMesh.material, 'envMap', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( boxMesh );\n\n\t\t\t}\n\n\t\t\t_e1$1.copy( scene.backgroundRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1$1.x *= - 1; _e1$1.y *= - 1; _e1$1.z *= - 1;\n\n\t\t\tif ( background.isCubeTexture && background.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1$1.y *= - 1;\n\t\t\t\t_e1$1.z *= - 1;\n\n\t\t\t}\n\n\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\tboxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;\n\t\t\tboxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;\n\t\t\tboxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tboxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );\n\t\t\tboxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tboxMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tboxMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null );\n\n\t\t} else if ( background && background.isTexture ) {\n\n\t\t\tif ( planeMesh === undefined ) {\n\n\t\t\t\tplaneMesh = new Mesh(\n\t\t\t\t\tnew PlaneGeometry( 2, 2 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.background.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tplaneMesh.geometry.deleteAttribute( 'normal' );\n\n\t\t\t\t// add \"map\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( planeMesh.material, 'map', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( planeMesh );\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\t\t\tplaneMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tplaneMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( background.matrixAutoUpdate === true ) {\n\n\t\t\t\tbackground.updateMatrix();\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy( background.matrix );\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tplaneMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tplaneMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null );\n\n\t\t}\n\n\t}\n\n\tfunction setClear( color, alpha ) {\n\n\t\tcolor.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) );\n\n\t\tstate.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha );\n\n\t}\n\n\treturn {\n\n\t\tgetClearColor: function () {\n\n\t\t\treturn clearColor;\n\n\t\t},\n\t\tsetClearColor: function ( color, alpha = 1 ) {\n\n\t\t\tclearColor.set( color );\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\tgetClearAlpha: function () {\n\n\t\t\treturn clearAlpha;\n\n\t\t},\n\t\tsetClearAlpha: function ( alpha ) {\n\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\trender: render,\n\t\taddToRenderList: addToRenderList\n\n\t};\n\n}\n\nfunction WebGLBindingStates( gl, attributes ) {\n\n\tconst maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\n\tconst bindingStates = {};\n\n\tconst defaultState = createBindingState( null );\n\tlet currentState = defaultState;\n\tlet forceUpdate = false;\n\n\tfunction setup( object, material, program, geometry, index ) {\n\n\t\tlet updateBuffers = false;\n\n\t\tconst state = getBindingState( geometry, program, material );\n\n\t\tif ( currentState !== state ) {\n\n\t\t\tcurrentState = state;\n\t\t\tbindVertexArrayObject( currentState.object );\n\n\t\t}\n\n\t\tupdateBuffers = needsUpdate( object, geometry, program, index );\n\n\t\tif ( updateBuffers ) saveCache( object, geometry, program, index );\n\n\t\tif ( index !== null ) {\n\n\t\t\tattributes.update( index, gl.ELEMENT_ARRAY_BUFFER );\n\n\t\t}\n\n\t\tif ( updateBuffers || forceUpdate ) {\n\n\t\t\tforceUpdate = false;\n\n\t\t\tsetupVertexAttributes( object, material, program, geometry );\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, attributes.get( index ).buffer );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createVertexArrayObject() {\n\n\t\treturn gl.createVertexArray();\n\n\t}\n\n\tfunction bindVertexArrayObject( vao ) {\n\n\t\treturn gl.bindVertexArray( vao );\n\n\t}\n\n\tfunction deleteVertexArrayObject( vao ) {\n\n\t\treturn gl.deleteVertexArray( vao );\n\n\t}\n\n\tfunction getBindingState( geometry, program, material ) {\n\n\t\tconst wireframe = ( material.wireframe === true );\n\n\t\tlet programMap = bindingStates[ geometry.id ];\n\n\t\tif ( programMap === undefined ) {\n\n\t\t\tprogramMap = {};\n\t\t\tbindingStates[ geometry.id ] = programMap;\n\n\t\t}\n\n\t\tlet stateMap = programMap[ program.id ];\n\n\t\tif ( stateMap === undefined ) {\n\n\t\t\tstateMap = {};\n\t\t\tprogramMap[ program.id ] = stateMap;\n\n\t\t}\n\n\t\tlet state = stateMap[ wireframe ];\n\n\t\tif ( state === undefined ) {\n\n\t\t\tstate = createBindingState( createVertexArrayObject() );\n\t\t\tstateMap[ wireframe ] = state;\n\n\t\t}\n\n\t\treturn state;\n\n\t}\n\n\tfunction createBindingState( vao ) {\n\n\t\tconst newAttributes = [];\n\t\tconst enabledAttributes = [];\n\t\tconst attributeDivisors = [];\n\n\t\tfor ( let i = 0; i < maxVertexAttributes; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\t\t\tenabledAttributes[ i ] = 0;\n\t\t\tattributeDivisors[ i ] = 0;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\tgeometry: null,\n\t\t\tprogram: null,\n\t\t\twireframe: false,\n\n\t\t\tnewAttributes: newAttributes,\n\t\t\tenabledAttributes: enabledAttributes,\n\t\t\tattributeDivisors: attributeDivisors,\n\t\t\tobject: vao,\n\t\t\tattributes: {},\n\t\t\tindex: null\n\n\t\t};\n\n\t}\n\n\tfunction needsUpdate( object, geometry, program, index ) {\n\n\t\tconst cachedAttributes = currentState.attributes;\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tconst cachedAttribute = cachedAttributes[ name ];\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( cachedAttribute === undefined ) return true;\n\n\t\t\t\tif ( cachedAttribute.attribute !== geometryAttribute ) return true;\n\n\t\t\t\tif ( geometryAttribute && cachedAttribute.data !== geometryAttribute.data ) return true;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( currentState.attributesNum !== attributesNum ) return true;\n\n\t\tif ( currentState.index !== index ) return true;\n\n\t\treturn false;\n\n\t}\n\n\tfunction saveCache( object, geometry, program, index ) {\n\n\t\tconst cache = {};\n\t\tconst attributes = geometry.attributes;\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet attribute = attributes[ name ];\n\n\t\t\t\tif ( attribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) attribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) attribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tconst data = {};\n\t\t\t\tdata.attribute = attribute;\n\n\t\t\t\tif ( attribute && attribute.data ) {\n\n\t\t\t\t\tdata.data = attribute.data;\n\n\t\t\t\t}\n\n\t\t\t\tcache[ name ] = data;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentState.attributes = cache;\n\t\tcurrentState.attributesNum = attributesNum;\n\n\t\tcurrentState.index = index;\n\n\t}\n\n\tfunction initAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\n\t\tfor ( let i = 0, il = newAttributes.length; i < il; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\tfunction enableAttribute( attribute ) {\n\n\t\tenableAttributeAndDivisor( attribute, 0 );\n\n\t}\n\n\tfunction enableAttributeAndDivisor( attribute, meshPerAttribute ) {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\tconst attributeDivisors = currentState.attributeDivisors;\n\n\t\tnewAttributes[ attribute ] = 1;\n\n\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t}\n\n\t\tif ( attributeDivisors[ attribute ] !== meshPerAttribute ) {\n\n\t\t\tgl.vertexAttribDivisor( attribute, meshPerAttribute );\n\t\t\tattributeDivisors[ attribute ] = meshPerAttribute;\n\n\t\t}\n\n\t}\n\n\tfunction disableUnusedAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\tfor ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) {\n\n\t\t\tif ( enabledAttributes[ i ] !== newAttributes[ i ] ) {\n\n\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {\n\n\t\tif ( integer === true ) {\n\n\t\t\tgl.vertexAttribIPointer( index, size, type, stride, offset );\n\n\t\t} else {\n\n\t\t\tgl.vertexAttribPointer( index, size, type, normalized, stride, offset );\n\n\t\t}\n\n\t}\n\n\tfunction setupVertexAttributes( object, material, program, geometry ) {\n\n\t\tinitAttributes();\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometryAttribute !== undefined ) {\n\n\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\n\t\t\t\t\tconst attribute = attributes.get( geometryAttribute );\n\n\t\t\t\t\t// TODO Attribute may not be available on context restore\n\n\t\t\t\t\tif ( attribute === undefined ) continue;\n\n\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\t// check for integer attributes\n\n\t\t\t\t\tconst integer = ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType );\n\n\t\t\t\t\tif ( geometryAttribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\tif ( data.isInstancedInterleavedBuffer ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tstride * bytesPerElement,\n\t\t\t\t\t\t\t\t( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( geometryAttribute.isInstancedBufferAttribute ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tsize * bytesPerElement,\n\t\t\t\t\t\t\t\t( size / programAttribute.locationSize ) * i * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( materialDefaultAttributeValues !== undefined ) {\n\n\t\t\t\t\tconst value = materialDefaultAttributeValues[ name ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\tswitch ( value.length ) {\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tgl.vertexAttrib2fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tgl.vertexAttrib3fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tgl.vertexAttrib4fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tgl.vertexAttrib1fv( programAttribute.location, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tdisableUnusedAttributes();\n\n\t}\n\n\tfunction dispose() {\n\n\t\treset();\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tfor ( const programId in programMap ) {\n\n\t\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[ programId ];\n\n\t\t\t}\n\n\t\t\tdelete bindingStates[ geometryId ];\n\n\t\t}\n\n\t}\n\n\tfunction releaseStatesOfGeometry( geometry ) {\n\n\t\tif ( bindingStates[ geometry.id ] === undefined ) return;\n\n\t\tconst programMap = bindingStates[ geometry.id ];\n\n\t\tfor ( const programId in programMap ) {\n\n\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ programId ];\n\n\t\t}\n\n\t\tdelete bindingStates[ geometry.id ];\n\n\t}\n\n\tfunction releaseStatesOfProgram( program ) {\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tif ( programMap[ program.id ] === undefined ) continue;\n\n\t\t\tconst stateMap = programMap[ program.id ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ program.id ];\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\tresetDefaultState();\n\t\tforceUpdate = true;\n\n\t\tif ( currentState === defaultState ) return;\n\n\t\tcurrentState = defaultState;\n\t\tbindVertexArrayObject( currentState.object );\n\n\t}\n\n\t// for backward-compatibility\n\n\tfunction resetDefaultState() {\n\n\t\tdefaultState.geometry = null;\n\t\tdefaultState.program = null;\n\t\tdefaultState.wireframe = false;\n\n\t}\n\n\treturn {\n\n\t\tsetup: setup,\n\t\treset: reset,\n\t\tresetDefaultState: resetDefaultState,\n\t\tdispose: dispose,\n\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\n\t\tinitAttributes: initAttributes,\n\t\tenableAttribute: enableAttribute,\n\t\tdisableUnusedAttributes: disableUnusedAttributes\n\n\t};\n\n}\n\nfunction WebGLBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawArrays( mode, start, count );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawArraysInstanced( mode, start, count, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\tthis.render( starts[ i ], counts[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawArraysWEBGL( mode, starts, 0, counts, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ], counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawArraysInstancedWEBGL( mode, starts, 0, counts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ];\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < primcount.length; i ++ ) {\n\n\t\t\t\tinfo.update( elementCount, mode, primcount[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLCapabilities( gl, extensions, parameters, utils ) {\n\n\tlet maxAnisotropy;\n\n\tfunction getMaxAnisotropy() {\n\n\t\tif ( maxAnisotropy !== undefined ) return maxAnisotropy;\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tmaxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n\n\t\t} else {\n\n\t\t\tmaxAnisotropy = 0;\n\n\t\t}\n\n\t\treturn maxAnisotropy;\n\n\t}\n\n\tfunction textureFormatReadable( textureFormat ) {\n\n\t\tif ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction textureTypeReadable( textureType ) {\n\n\t\tconst halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) );\n\n\t\tif ( textureType !== UnsignedByteType && utils.convert( textureType ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\ttextureType !== FloatType && ! halfFloatSupportedByExt ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction getMaxPrecision( precision ) {\n\n\t\tif ( precision === 'highp' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'highp';\n\n\t\t\t}\n\n\t\t\tprecision = 'mediump';\n\n\t\t}\n\n\t\tif ( precision === 'mediump' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'mediump';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'lowp';\n\n\t}\n\n\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\tconst maxPrecision = getMaxPrecision( precision );\n\n\tif ( maxPrecision !== precision ) {\n\n\t\tconsole.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );\n\t\tprecision = maxPrecision;\n\n\t}\n\n\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\n\tconst maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );\n\tconst maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );\n\tconst maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );\n\tconst maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE );\n\n\tconst maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\tconst maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS );\n\tconst maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS );\n\tconst maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS );\n\n\tconst vertexTextures = maxVertexTextures > 0;\n\n\tconst maxSamples = gl.getParameter( gl.MAX_SAMPLES );\n\n\treturn {\n\n\t\tisWebGL2: true, // keeping this for backwards compatibility\n\n\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\tgetMaxPrecision: getMaxPrecision,\n\n\t\ttextureFormatReadable: textureFormatReadable,\n\t\ttextureTypeReadable: textureTypeReadable,\n\n\t\tprecision: precision,\n\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\n\t\tmaxTextures: maxTextures,\n\t\tmaxVertexTextures: maxVertexTextures,\n\t\tmaxTextureSize: maxTextureSize,\n\t\tmaxCubemapSize: maxCubemapSize,\n\n\t\tmaxAttributes: maxAttributes,\n\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\tmaxVaryings: maxVaryings,\n\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\n\t\tvertexTextures: vertexTextures,\n\n\t\tmaxSamples: maxSamples\n\n\t};\n\n}\n\nfunction WebGLClipping( properties ) {\n\n\tconst scope = this;\n\n\tlet globalState = null,\n\t\tnumGlobalPlanes = 0,\n\t\tlocalClippingEnabled = false,\n\t\trenderingShadows = false;\n\n\tconst plane = new Plane(),\n\t\tviewNormalMatrix = new Matrix3(),\n\n\t\tuniform = { value: null, needsUpdate: false };\n\n\tthis.uniform = uniform;\n\tthis.numPlanes = 0;\n\tthis.numIntersection = 0;\n\n\tthis.init = function ( planes, enableLocalClipping ) {\n\n\t\tconst enabled =\n\t\t\tplanes.length !== 0 ||\n\t\t\tenableLocalClipping ||\n\t\t\t// enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 ||\n\t\t\tlocalClippingEnabled;\n\n\t\tlocalClippingEnabled = enableLocalClipping;\n\n\t\tnumGlobalPlanes = planes.length;\n\n\t\treturn enabled;\n\n\t};\n\n\tthis.beginShadows = function () {\n\n\t\trenderingShadows = true;\n\t\tprojectPlanes( null );\n\n\t};\n\n\tthis.endShadows = function () {\n\n\t\trenderingShadows = false;\n\n\t};\n\n\tthis.setGlobalState = function ( planes, camera ) {\n\n\t\tglobalState = projectPlanes( planes, camera, 0 );\n\n\t};\n\n\tthis.setState = function ( material, camera, useCache ) {\n\n\t\tconst planes = material.clippingPlanes,\n\t\t\tclipIntersection = material.clipIntersection,\n\t\t\tclipShadows = material.clipShadows;\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tif ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) {\n\n\t\t\t// there's no local clipping\n\n\t\t\tif ( renderingShadows ) {\n\n\t\t\t\t// there's no global clipping\n\n\t\t\t\tprojectPlanes( null );\n\n\t\t\t} else {\n\n\t\t\t\tresetGlobalState();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\tlGlobal = nGlobal * 4;\n\n\t\t\tlet dstArray = materialProperties.clippingState || null;\n\n\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\tdstArray = projectPlanes( planes, camera, lGlobal, useCache );\n\n\t\t\tfor ( let i = 0; i !== lGlobal; ++ i ) {\n\n\t\t\t\tdstArray[ i ] = globalState[ i ];\n\n\t\t\t}\n\n\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\tthis.numPlanes += nGlobal;\n\n\t\t}\n\n\n\t};\n\n\tfunction resetGlobalState() {\n\n\t\tif ( uniform.value !== globalState ) {\n\n\t\t\tuniform.value = globalState;\n\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\n\t\t}\n\n\t\tscope.numPlanes = numGlobalPlanes;\n\t\tscope.numIntersection = 0;\n\n\t}\n\n\tfunction projectPlanes( planes, camera, dstOffset, skipTransform ) {\n\n\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\tlet dstArray = null;\n\n\t\tif ( nPlanes !== 0 ) {\n\n\t\t\tdstArray = uniform.value;\n\n\t\t\tif ( skipTransform !== true || dstArray === null ) {\n\n\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\n\t\t\t\tviewNormalMatrix.getNormalMatrix( viewMatrix );\n\n\t\t\t\tif ( dstArray === null || dstArray.length < flatSize ) {\n\n\t\t\t\t\tdstArray = new Float32Array( flatSize );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) {\n\n\t\t\t\t\tplane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix );\n\n\t\t\t\t\tplane.normal.toArray( dstArray, i4 );\n\t\t\t\t\tdstArray[ i4 + 3 ] = plane.constant;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tuniform.value = dstArray;\n\t\t\tuniform.needsUpdate = true;\n\n\t\t}\n\n\t\tscope.numPlanes = nPlanes;\n\t\tscope.numIntersection = 0;\n\n\t\treturn dstArray;\n\n\t}\n\n}\n\nfunction WebGLCubeMaps( renderer ) {\n\n\tlet cubemaps = new WeakMap();\n\n\tfunction mapTextureMapping( texture, mapping ) {\n\n\t\tif ( mapping === EquirectangularReflectionMapping ) {\n\n\t\t\ttexture.mapping = CubeReflectionMapping;\n\n\t\t} else if ( mapping === EquirectangularRefractionMapping ) {\n\n\t\t\ttexture.mapping = CubeRefractionMapping;\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tif ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) {\n\n\t\t\t\tif ( cubemaps.has( texture ) ) {\n\n\t\t\t\t\tconst cubemap = cubemaps.get( texture ).texture;\n\t\t\t\t\treturn mapTextureMapping( cubemap, texture.mapping );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\tif ( image && image.height > 0 ) {\n\n\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget( image.height );\n\t\t\t\t\t\trenderTarget.fromEquirectangularTexture( renderer, texture );\n\t\t\t\t\t\tcubemaps.set( texture, renderTarget );\n\n\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\treturn mapTextureMapping( renderTarget.texture, texture.mapping );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemap = cubemaps.get( texture );\n\n\t\tif ( cubemap !== undefined ) {\n\n\t\t\tcubemaps.delete( texture );\n\t\t\tcubemap.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubemaps = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nclass OrthographicCamera extends Camera {\n\n\tconstructor( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.isOrthographicCamera = true;\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\tthis.zoom = 1;\n\t\tthis.view = null;\n\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.top = top;\n\t\tthis.bottom = bottom;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.left = source.left;\n\t\tthis.right = source.right;\n\t\tthis.top = source.top;\n\t\tthis.bottom = source.bottom;\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\n\t\tthis.zoom = source.zoom;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\treturn this;\n\n\t}\n\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\tconst dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\tconst cx = ( this.right + this.left ) / 2;\n\t\tconst cy = ( this.top + this.bottom ) / 2;\n\n\t\tlet left = cx - dx;\n\t\tlet right = cx + dx;\n\t\tlet top = cy + dy;\n\t\tlet bottom = cy - dy;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom;\n\t\t\tconst scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom;\n\n\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\tright = left + scaleW * this.view.width;\n\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\tbottom = top - scaleH * this.view.height;\n\n\t\t}\n\n\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.zoom = this.zoom;\n\t\tdata.object.left = this.left;\n\t\tdata.object.right = this.right;\n\t\tdata.object.top = this.top;\n\t\tdata.object.bottom = this.bottom;\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst LOD_MIN = 4;\n\n// The standard deviations (radians) associated with the extra mips. These are\n// chosen to approximate a Trowbridge-Reitz distribution function times the\n// geometric shadowing function. These sigma values squared must match the\n// variance #defines in cube_uv_reflection_fragment.glsl.js.\nconst EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];\n\n// The maximum length of the blur for loop. Smaller sigmas will use fewer\n// samples and exit early, but not recompile the shader.\nconst MAX_SAMPLES = 20;\n\nconst _flatCamera = /*@__PURE__*/ new OrthographicCamera();\nconst _clearColor = /*@__PURE__*/ new Color();\nlet _oldTarget = null;\nlet _oldActiveCubeFace = 0;\nlet _oldActiveMipmapLevel = 0;\nlet _oldXrEnabled = false;\n\n// Golden Ratio\nconst PHI = ( 1 + Math.sqrt( 5 ) ) / 2;\nconst INV_PHI = 1 / PHI;\n\n// Vertices of a dodecahedron (except the opposites, which represent the\n// same axis), used as axis directions evenly spread on a sphere.\nconst _axisDirections = [\n\t/*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, 1 ) ];\n\n/**\n * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n * (PMREM) from a cubeMap environment texture. This allows different levels of\n * blur to be quickly accessed based on material roughness. It is packed into a\n * special CubeUV format that allows us to perform custom interpolation so that\n * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n * higher roughness levels. In this way we maintain resolution to smoothly\n * interpolate diffuse lighting while limiting sampling computation.\n *\n * Paper: Fast, Accurate Image-Based Lighting\n * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n*/\n\nclass PMREMGenerator {\n\n\tconstructor( renderer ) {\n\n\t\tthis._renderer = renderer;\n\t\tthis._pingPongRenderTarget = null;\n\n\t\tthis._lodMax = 0;\n\t\tthis._cubeSize = 0;\n\t\tthis._lodPlanes = [];\n\t\tthis._sizeLods = [];\n\t\tthis._sigmas = [];\n\n\t\tthis._blurMaterial = null;\n\t\tthis._cubemapMaterial = null;\n\t\tthis._equirectMaterial = null;\n\n\t\tthis._compileMaterial( this._blurMaterial );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t * is placed at the origin).\n\t */\n\tfromScene( scene, sigma = 0, near = 0.1, far = 100 ) {\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tthis._setSize( 256 );\n\n\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\t\tcubeUVRenderTarget.depthBuffer = true;\n\n\t\tthis._sceneToCubeUV( scene, near, far, cubeUVRenderTarget );\n\n\t\tif ( sigma > 0 ) {\n\n\t\t\tthis._blur( cubeUVRenderTarget, 0, 0, sigma );\n\n\t\t}\n\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t * or HDR. The ideal input image size is 1k (1024 x 512),\n\t * as this matches best with the 256 x 256 cubemap output.\n\t * The smallest supported equirectangular image size is 64 x 32.\n\t */\n\tfromEquirectangular( equirectangular, renderTarget = null ) {\n\n\t\treturn this._fromTexture( equirectangular, renderTarget );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t * or HDR. The ideal input cube size is 256 x 256,\n\t * as this matches best with the 256 x 256 cubemap output.\n\t * The smallest supported cube size is 16 x 16.\n\t */\n\tfromCubemap( cubemap, renderTarget = null ) {\n\n\t\treturn this._fromTexture( cubemap, renderTarget );\n\n\t}\n\n\t/**\n\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileCubemapShader() {\n\n\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\t\t\tthis._compileMaterial( this._cubemapMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileEquirectangularShader() {\n\n\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\t\t\tthis._compileMaterial( this._equirectMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t * one of them will cause any others to also become unusable.\n\t */\n\tdispose() {\n\n\t\tthis._dispose();\n\n\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t}\n\n\t// private interface\n\n\t_setSize( cubeSize ) {\n\n\t\tthis._lodMax = Math.floor( Math.log2( cubeSize ) );\n\t\tthis._cubeSize = Math.pow( 2, this._lodMax );\n\n\t}\n\n\t_dispose() {\n\n\t\tif ( this._blurMaterial !== null ) this._blurMaterial.dispose();\n\n\t\tif ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();\n\n\t\tfor ( let i = 0; i < this._lodPlanes.length; i ++ ) {\n\n\t\t\tthis._lodPlanes[ i ].dispose();\n\n\t\t}\n\n\t}\n\n\t_cleanup( outputTarget ) {\n\n\t\tthis._renderer.setRenderTarget( _oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel );\n\t\tthis._renderer.xr.enabled = _oldXrEnabled;\n\n\t\toutputTarget.scissorTest = false;\n\t\t_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );\n\n\t}\n\n\t_fromTexture( texture, renderTarget ) {\n\n\t\tif ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ) {\n\n\t\t\tthis._setSize( texture.image.length === 0 ? 16 : ( texture.image[ 0 ].width || texture.image[ 0 ].image.width ) );\n\n\t\t} else { // Equirectangular\n\n\t\t\tthis._setSize( texture.image.width / 4 );\n\n\t\t}\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tconst cubeUVRenderTarget = renderTarget || this._allocateTargets();\n\t\tthis._textureToCubeUV( texture, cubeUVRenderTarget );\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_allocateTargets() {\n\n\t\tconst width = 3 * Math.max( this._cubeSize, 16 * 7 );\n\t\tconst height = 4 * this._cubeSize;\n\n\t\tconst params = {\n\t\t\tmagFilter: LinearFilter,\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\ttype: HalfFloatType,\n\t\t\tformat: RGBAFormat,\n\t\t\tcolorSpace: LinearSRGBColorSpace,\n\t\t\tdepthBuffer: false\n\t\t};\n\n\t\tconst cubeUVRenderTarget = _createRenderTarget( width, height, params );\n\n\t\tif ( this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width || this._pingPongRenderTarget.height !== height ) {\n\n\t\t\tif ( this._pingPongRenderTarget !== null ) {\n\n\t\t\t\tthis._dispose();\n\n\t\t\t}\n\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget( width, height, params );\n\n\t\t\tconst { _lodMax } = this;\n\t\t\t( { sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes( _lodMax ) );\n\n\t\t\tthis._blurMaterial = _getBlurShader( _lodMax, width, height );\n\n\t\t}\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_compileMaterial( material ) {\n\n\t\tconst tmpMesh = new Mesh( this._lodPlanes[ 0 ], material );\n\t\tthis._renderer.compile( tmpMesh, _flatCamera );\n\n\t}\n\n\t_sceneToCubeUV( scene, near, far, cubeUVRenderTarget ) {\n\n\t\tconst fov = 90;\n\t\tconst aspect = 1;\n\t\tconst cubeCamera = new PerspectiveCamera( fov, aspect, near, far );\n\t\tconst upSign = [ 1, - 1, 1, 1, 1, 1 ];\n\t\tconst forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ];\n\t\tconst renderer = this._renderer;\n\n\t\tconst originalAutoClear = renderer.autoClear;\n\t\tconst toneMapping = renderer.toneMapping;\n\t\trenderer.getClearColor( _clearColor );\n\n\t\trenderer.toneMapping = NoToneMapping;\n\t\trenderer.autoClear = false;\n\n\t\tconst backgroundMaterial = new MeshBasicMaterial( {\n\t\t\tname: 'PMREM.Background',\n\t\t\tside: BackSide,\n\t\t\tdepthWrite: false,\n\t\t\tdepthTest: false,\n\t\t} );\n\n\t\tconst backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial );\n\n\t\tlet useSolidColor = false;\n\t\tconst background = scene.background;\n\n\t\tif ( background ) {\n\n\t\t\tif ( background.isColor ) {\n\n\t\t\t\tbackgroundMaterial.color.copy( background );\n\t\t\t\tscene.background = null;\n\t\t\t\tuseSolidColor = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tbackgroundMaterial.color.copy( _clearColor );\n\t\t\tuseSolidColor = true;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst col = i % 3;\n\n\t\t\tif ( col === 0 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( forwardSign[ i ], 0, 0 );\n\n\t\t\t} else if ( col === 1 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, 0, upSign[ i ] );\n\t\t\t\tcubeCamera.lookAt( 0, forwardSign[ i ], 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( 0, 0, forwardSign[ i ] );\n\n\t\t\t}\n\n\t\t\tconst size = this._cubeSize;\n\n\t\t\t_setViewport( cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size );\n\n\t\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\n\t\t\tif ( useSolidColor ) {\n\n\t\t\t\trenderer.render( backgroundBox, cubeCamera );\n\n\t\t\t}\n\n\t\t\trenderer.render( scene, cubeCamera );\n\n\t\t}\n\n\t\tbackgroundBox.geometry.dispose();\n\t\tbackgroundBox.material.dispose();\n\n\t\trenderer.toneMapping = toneMapping;\n\t\trenderer.autoClear = originalAutoClear;\n\t\tscene.background = background;\n\n\t}\n\n\t_textureToCubeUV( texture, cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\n\t\tconst isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );\n\n\t\tif ( isCubeTexture ) {\n\n\t\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\n\t\t\t}\n\n\t\t\tthis._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t} else {\n\n\t\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial;\n\t\tconst mesh = new Mesh( this._lodPlanes[ 0 ], material );\n\n\t\tconst uniforms = material.uniforms;\n\n\t\tuniforms[ 'envMap' ].value = texture;\n\n\t\tconst size = this._cubeSize;\n\n\t\t_setViewport( cubeUVRenderTarget, 0, 0, 3 * size, 2 * size );\n\n\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\t\trenderer.render( mesh, _flatCamera );\n\n\t}\n\n\t_applyPMREM( cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst autoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\t\tconst n = this._lodPlanes.length;\n\n\t\tfor ( let i = 1; i < n; i ++ ) {\n\n\t\t\tconst sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );\n\n\t\t\tconst poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];\n\n\t\t\tthis._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );\n\n\t\t}\n\n\t\trenderer.autoClear = autoClear;\n\n\t}\n\n\t/**\n\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t * accurate at the poles, but still does a decent job.\n\t */\n\t_blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) {\n\n\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\tthis._halfBlur(\n\t\t\tcubeUVRenderTarget,\n\t\t\tpingPongRenderTarget,\n\t\t\tlodIn,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'latitudinal',\n\t\t\tpoleAxis );\n\n\t\tthis._halfBlur(\n\t\t\tpingPongRenderTarget,\n\t\t\tcubeUVRenderTarget,\n\t\t\tlodOut,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'longitudinal',\n\t\t\tpoleAxis );\n\n\t}\n\n\t_halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst blurMaterial = this._blurMaterial;\n\n\t\tif ( direction !== 'latitudinal' && direction !== 'longitudinal' ) {\n\n\t\t\tconsole.error(\n\t\t\t\t'blur direction must be either latitudinal or longitudinal!' );\n\n\t\t}\n\n\t\t// Number of standard deviations at which to cut off the discrete approximation.\n\t\tconst STANDARD_DEVIATIONS = 3;\n\n\t\tconst blurMesh = new Mesh( this._lodPlanes[ lodOut ], blurMaterial );\n\t\tconst blurUniforms = blurMaterial.uniforms;\n\n\t\tconst pixels = this._sizeLods[ lodIn ] - 1;\n\t\tconst radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 );\n\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\tconst samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES;\n\n\t\tif ( samples > MAX_SAMPLES ) {\n\n\t\t\tconsole.warn( `sigmaRadians, ${\n\t\t\t\tsigmaRadians}, is too large and will clip, as it requested ${\n\t\t\t\tsamples} samples when the maximum is set to ${MAX_SAMPLES}` );\n\n\t\t}\n\n\t\tconst weights = [];\n\t\tlet sum = 0;\n\n\t\tfor ( let i = 0; i < MAX_SAMPLES; ++ i ) {\n\n\t\t\tconst x = i / sigmaPixels;\n\t\t\tconst weight = Math.exp( - x * x / 2 );\n\t\t\tweights.push( weight );\n\n\t\t\tif ( i === 0 ) {\n\n\t\t\t\tsum += weight;\n\n\t\t\t} else if ( i < samples ) {\n\n\t\t\t\tsum += 2 * weight;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let i = 0; i < weights.length; i ++ ) {\n\n\t\t\tweights[ i ] = weights[ i ] / sum;\n\n\t\t}\n\n\t\tblurUniforms[ 'envMap' ].value = targetIn.texture;\n\t\tblurUniforms[ 'samples' ].value = samples;\n\t\tblurUniforms[ 'weights' ].value = weights;\n\t\tblurUniforms[ 'latitudinal' ].value = direction === 'latitudinal';\n\n\t\tif ( poleAxis ) {\n\n\t\t\tblurUniforms[ 'poleAxis' ].value = poleAxis;\n\n\t\t}\n\n\t\tconst { _lodMax } = this;\n\t\tblurUniforms[ 'dTheta' ].value = radiansPerPixel;\n\t\tblurUniforms[ 'mipInt' ].value = _lodMax - lodIn;\n\n\t\tconst outputSize = this._sizeLods[ lodOut ];\n\t\tconst x = 3 * outputSize * ( lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0 );\n\t\tconst y = 4 * ( this._cubeSize - outputSize );\n\n\t\t_setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize );\n\t\trenderer.setRenderTarget( targetOut );\n\t\trenderer.render( blurMesh, _flatCamera );\n\n\t}\n\n}\n\n\n\nfunction _createPlanes( lodMax ) {\n\n\tconst lodPlanes = [];\n\tconst sizeLods = [];\n\tconst sigmas = [];\n\n\tlet lod = lodMax;\n\n\tconst totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;\n\n\tfor ( let i = 0; i < totalLods; i ++ ) {\n\n\t\tconst sizeLod = Math.pow( 2, lod );\n\t\tsizeLods.push( sizeLod );\n\t\tlet sigma = 1.0 / sizeLod;\n\n\t\tif ( i > lodMax - LOD_MIN ) {\n\n\t\t\tsigma = EXTRA_LOD_SIGMA[ i - lodMax + LOD_MIN - 1 ];\n\n\t\t} else if ( i === 0 ) {\n\n\t\t\tsigma = 0;\n\n\t\t}\n\n\t\tsigmas.push( sigma );\n\n\t\tconst texelSize = 1.0 / ( sizeLod - 2 );\n\t\tconst min = - texelSize;\n\t\tconst max = 1 + texelSize;\n\t\tconst uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ];\n\n\t\tconst cubeFaces = 6;\n\t\tconst vertices = 6;\n\t\tconst positionSize = 3;\n\t\tconst uvSize = 2;\n\t\tconst faceIndexSize = 1;\n\n\t\tconst position = new Float32Array( positionSize * vertices * cubeFaces );\n\t\tconst uv = new Float32Array( uvSize * vertices * cubeFaces );\n\t\tconst faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces );\n\n\t\tfor ( let face = 0; face < cubeFaces; face ++ ) {\n\n\t\t\tconst x = ( face % 3 ) * 2 / 3 - 1;\n\t\t\tconst y = face > 2 ? 0 : - 1;\n\t\t\tconst coordinates = [\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y + 1, 0\n\t\t\t];\n\t\t\tposition.set( coordinates, positionSize * vertices * face );\n\t\t\tuv.set( uv1, uvSize * vertices * face );\n\t\t\tconst fill = [ face, face, face, face, face, face ];\n\t\t\tfaceIndex.set( fill, faceIndexSize * vertices * face );\n\n\t\t}\n\n\t\tconst planes = new BufferGeometry();\n\t\tplanes.setAttribute( 'position', new BufferAttribute( position, positionSize ) );\n\t\tplanes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );\n\t\tplanes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );\n\t\tlodPlanes.push( planes );\n\n\t\tif ( lod > LOD_MIN ) {\n\n\t\t\tlod --;\n\n\t\t}\n\n\t}\n\n\treturn { lodPlanes, sizeLods, sigmas };\n\n}\n\nfunction _createRenderTarget( width, height, params ) {\n\n\tconst cubeUVRenderTarget = new WebGLRenderTarget( width, height, params );\n\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\tcubeUVRenderTarget.scissorTest = true;\n\treturn cubeUVRenderTarget;\n\n}\n\nfunction _setViewport( target, x, y, width, height ) {\n\n\ttarget.viewport.set( x, y, width, height );\n\ttarget.scissor.set( x, y, width, height );\n\n}\n\nfunction _getBlurShader( lodMax, width, height ) {\n\n\tconst weights = new Float32Array( MAX_SAMPLES );\n\tconst poleAxis = new Vector3( 0, 1, 0 );\n\tconst shaderMaterial = new ShaderMaterial( {\n\n\t\tname: 'SphericalGaussianBlur',\n\n\t\tdefines: {\n\t\t\t'n': MAX_SAMPLES,\n\t\t\t'CUBEUV_TEXEL_WIDTH': 1.0 / width,\n\t\t\t'CUBEUV_TEXEL_HEIGHT': 1.0 / height,\n\t\t\t'CUBEUV_MAX_MIP': `${lodMax}.0`,\n\t\t},\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'samples': { value: 1 },\n\t\t\t'weights': { value: weights },\n\t\t\t'latitudinal': { value: false },\n\t\t\t'dTheta': { value: 0 },\n\t\t\t'mipInt': { value: 0 },\n\t\t\t'poleAxis': { value: poleAxis }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getEquirectMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'EquirectangularToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCubemapMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'CubemapToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'flipEnvMap': { value: - 1 }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCommonVertexShader() {\n\n\treturn /* glsl */`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`;\n\n}\n\nfunction WebGLCubeUVMaps( renderer ) {\n\n\tlet cubeUVmaps = new WeakMap();\n\n\tlet pmremGenerator = null;\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tconst isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping );\n\t\t\tconst isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping );\n\n\t\t\t// equirect/cube map to cubeUV conversion\n\n\t\t\tif ( isEquirectMap || isCubeMap ) {\n\n\t\t\t\tlet renderTarget = cubeUVmaps.get( texture );\n\n\t\t\t\tconst currentPMREMVersion = renderTarget !== undefined ? renderTarget.texture.pmremVersion : 0;\n\n\t\t\t\tif ( texture.isRenderTargetTexture && texture.pmremVersion !== currentPMREMVersion ) {\n\n\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget );\n\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( renderTarget !== undefined ) {\n\n\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) {\n\n\t\t\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture );\n\t\t\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction isCubeTextureComplete( image ) {\n\n\t\tlet count = 0;\n\t\tconst length = 6;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tif ( image[ i ] !== undefined ) count ++;\n\n\t\t}\n\n\t\treturn count === length;\n\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemapUV = cubeUVmaps.get( texture );\n\n\t\tif ( cubemapUV !== undefined ) {\n\n\t\t\tcubeUVmaps.delete( texture );\n\t\t\tcubemapUV.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubeUVmaps = new WeakMap();\n\n\t\tif ( pmremGenerator !== null ) {\n\n\t\t\tpmremGenerator.dispose();\n\t\t\tpmremGenerator = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLExtensions( gl ) {\n\n\tconst extensions = {};\n\n\tfunction getExtension( name ) {\n\n\t\tif ( extensions[ name ] !== undefined ) {\n\n\t\t\treturn extensions[ name ];\n\n\t\t}\n\n\t\tlet extension;\n\n\t\tswitch ( name ) {\n\n\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\textension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\textension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\textension = gl.getExtension( name );\n\n\t\t}\n\n\t\textensions[ name ] = extension;\n\n\t\treturn extension;\n\n\t}\n\n\treturn {\n\n\t\thas: function ( name ) {\n\n\t\t\treturn getExtension( name ) !== null;\n\n\t\t},\n\n\t\tinit: function () {\n\n\t\t\tgetExtension( 'EXT_color_buffer_float' );\n\t\t\tgetExtension( 'WEBGL_clip_cull_distance' );\n\t\t\tgetExtension( 'OES_texture_float_linear' );\n\t\t\tgetExtension( 'EXT_color_buffer_half_float' );\n\t\t\tgetExtension( 'WEBGL_multisampled_render_to_texture' );\n\t\t\tgetExtension( 'WEBGL_render_shared_exponent' );\n\n\t\t},\n\n\t\tget: function ( name ) {\n\n\t\t\tconst extension = getExtension( name );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );\n\n\t\t\t}\n\n\t\t\treturn extension;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLGeometries( gl, attributes, info, bindingStates ) {\n\n\tconst geometries = {};\n\tconst wireframeAttributes = new WeakMap();\n\n\tfunction onGeometryDispose( event ) {\n\n\t\tconst geometry = event.target;\n\n\t\tif ( geometry.index !== null ) {\n\n\t\t\tattributes.remove( geometry.index );\n\n\t\t}\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tattributes.remove( geometry.attributes[ name ] );\n\n\t\t}\n\n\t\tfor ( const name in geometry.morphAttributes ) {\n\n\t\t\tconst array = geometry.morphAttributes[ name ];\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tattributes.remove( array[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.removeEventListener( 'dispose', onGeometryDispose );\n\n\t\tdelete geometries[ geometry.id ];\n\n\t\tconst attribute = wireframeAttributes.get( geometry );\n\n\t\tif ( attribute ) {\n\n\t\t\tattributes.remove( attribute );\n\t\t\twireframeAttributes.delete( geometry );\n\n\t\t}\n\n\t\tbindingStates.releaseStatesOfGeometry( geometry );\n\n\t\tif ( geometry.isInstancedBufferGeometry === true ) {\n\n\t\t\tdelete geometry._maxInstanceCount;\n\n\t\t}\n\n\t\t//\n\n\t\tinfo.memory.geometries --;\n\n\t}\n\n\tfunction get( object, geometry ) {\n\n\t\tif ( geometries[ geometry.id ] === true ) return geometry;\n\n\t\tgeometry.addEventListener( 'dispose', onGeometryDispose );\n\n\t\tgeometries[ geometry.id ] = true;\n\n\t\tinfo.memory.geometries ++;\n\n\t\treturn geometry;\n\n\t}\n\n\tfunction update( geometry ) {\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\tfor ( const name in geometryAttributes ) {\n\n\t\t\tattributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER );\n\n\t\t}\n\n\t\t// morph targets\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = morphAttributes[ name ];\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tattributes.update( array[ i ], gl.ARRAY_BUFFER );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction updateWireframeAttribute( geometry ) {\n\n\t\tconst indices = [];\n\n\t\tconst geometryIndex = geometry.index;\n\t\tconst geometryPosition = geometry.attributes.position;\n\t\tlet version = 0;\n\n\t\tif ( geometryIndex !== null ) {\n\n\t\t\tconst array = geometryIndex.array;\n\t\t\tversion = geometryIndex.version;\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\tconst a = array[ i + 0 ];\n\t\t\t\tconst b = array[ i + 1 ];\n\t\t\t\tconst c = array[ i + 2 ];\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else if ( geometryPosition !== undefined ) {\n\n\t\t\tconst array = geometryPosition.array;\n\t\t\tversion = geometryPosition.version;\n\n\t\t\tfor ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) {\n\n\t\t\t\tconst a = i + 0;\n\t\t\t\tconst b = i + 1;\n\t\t\t\tconst c = i + 2;\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );\n\t\tattribute.version = version;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates\n\n\t\t//\n\n\t\tconst previousAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( previousAttribute ) attributes.remove( previousAttribute );\n\n\t\t//\n\n\t\twireframeAttributes.set( geometry, attribute );\n\n\t}\n\n\tfunction getWireframeAttribute( geometry ) {\n\n\t\tconst currentAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( currentAttribute ) {\n\n\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\tif ( geometryIndex !== null ) {\n\n\t\t\t\t// if the attribute is obsolete, create a new one\n\n\t\t\t\tif ( currentAttribute.version < geometryIndex.version ) {\n\n\t\t\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t}\n\n\t\treturn wireframeAttributes.get( geometry );\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tupdate: update,\n\n\t\tgetWireframeAttribute: getWireframeAttribute\n\n\t};\n\n}\n\nfunction WebGLIndexedBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tlet type, bytesPerElement;\n\n\tfunction setIndex( value ) {\n\n\t\ttype = value.type;\n\t\tbytesPerElement = value.bytesPerElement;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawElements( mode, count, type, start * bytesPerElement );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawElementsInstanced( mode, count, type, start * bytesPerElement, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\tthis.render( starts[ i ] / bytesPerElement, counts[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawElementsWEBGL( mode, counts, 0, type, starts, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ] / bytesPerElement, counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawElementsInstancedWEBGL( mode, counts, 0, type, starts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ];\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < primcount.length; i ++ ) {\n\n\t\t\t\tinfo.update( elementCount, mode, primcount[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.setIndex = setIndex;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLInfo( gl ) {\n\n\tconst memory = {\n\t\tgeometries: 0,\n\t\ttextures: 0\n\t};\n\n\tconst render = {\n\t\tframe: 0,\n\t\tcalls: 0,\n\t\ttriangles: 0,\n\t\tpoints: 0,\n\t\tlines: 0\n\t};\n\n\tfunction update( count, mode, instanceCount ) {\n\n\t\trender.calls ++;\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase gl.TRIANGLES:\n\t\t\t\trender.triangles += instanceCount * ( count / 3 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINES:\n\t\t\t\trender.lines += instanceCount * ( count / 2 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_STRIP:\n\t\t\t\trender.lines += instanceCount * ( count - 1 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_LOOP:\n\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tcase gl.POINTS:\n\t\t\t\trender.points += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.error( 'THREE.WebGLInfo: Unknown draw mode:', mode );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\trender.calls = 0;\n\t\trender.triangles = 0;\n\t\trender.points = 0;\n\t\trender.lines = 0;\n\n\t}\n\n\treturn {\n\t\tmemory: memory,\n\t\trender: render,\n\t\tprograms: null,\n\t\tautoReset: true,\n\t\treset: reset,\n\t\tupdate: update\n\t};\n\n}\n\nfunction WebGLMorphtargets( gl, capabilities, textures ) {\n\n\tconst morphTextures = new WeakMap();\n\tconst morph = new Vector4();\n\n\tfunction update( object, geometry, program ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\t// instead of using attributes, the WebGL 2 code path encodes morph targets\n\t\t// into an array of data textures. Each layer represents a single morph target.\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet entry = morphTextures.get( geometry );\n\n\t\tif ( entry === undefined || entry.count !== morphTargetsCount ) {\n\n\t\t\tif ( entry !== undefined ) entry.texture.dispose();\n\n\t\t\tconst hasMorphPosition = geometry.morphAttributes.position !== undefined;\n\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\t\t\tconst hasMorphColors = geometry.morphAttributes.color !== undefined;\n\n\t\t\tconst morphTargets = geometry.morphAttributes.position || [];\n\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\t\t\tconst morphColors = geometry.morphAttributes.color || [];\n\n\t\t\tlet vertexDataCount = 0;\n\n\t\t\tif ( hasMorphPosition === true ) vertexDataCount = 1;\n\t\t\tif ( hasMorphNormals === true ) vertexDataCount = 2;\n\t\t\tif ( hasMorphColors === true ) vertexDataCount = 3;\n\n\t\t\tlet width = geometry.attributes.position.count * vertexDataCount;\n\t\t\tlet height = 1;\n\n\t\t\tif ( width > capabilities.maxTextureSize ) {\n\n\t\t\t\theight = Math.ceil( width / capabilities.maxTextureSize );\n\t\t\t\twidth = capabilities.maxTextureSize;\n\n\t\t\t}\n\n\t\t\tconst buffer = new Float32Array( width * height * 4 * morphTargetsCount );\n\n\t\t\tconst texture = new DataArrayTexture( buffer, width, height, morphTargetsCount );\n\t\t\ttexture.type = FloatType;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\t// fill buffer\n\n\t\t\tconst vertexDataStride = vertexDataCount * 4;\n\n\t\t\tfor ( let i = 0; i < morphTargetsCount; i ++ ) {\n\n\t\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\t\tconst morphNormal = morphNormals[ i ];\n\t\t\t\tconst morphColor = morphColors[ i ];\n\n\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\tfor ( let j = 0; j < morphTarget.count; j ++ ) {\n\n\t\t\t\t\tconst stride = j * vertexDataStride;\n\n\t\t\t\t\tif ( hasMorphPosition === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphTarget, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 0 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 1 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 2 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 3 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphNormals === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphNormal, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 4 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 5 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 6 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 7 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphColors === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphColor, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 8 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 9 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 10 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morph.w : 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tentry = {\n\t\t\t\tcount: morphTargetsCount,\n\t\t\t\ttexture: texture,\n\t\t\t\tsize: new Vector2( width, height )\n\t\t\t};\n\n\t\t\tmorphTextures.set( geometry, entry );\n\n\t\t\tfunction disposeTexture() {\n\n\t\t\t\ttexture.dispose();\n\n\t\t\t\tmorphTextures.delete( geometry );\n\n\t\t\t\tgeometry.removeEventListener( 'dispose', disposeTexture );\n\n\t\t\t}\n\n\t\t\tgeometry.addEventListener( 'dispose', disposeTexture );\n\n\t\t}\n\n\t\t//\n\t\tif ( object.isInstancedMesh === true && object.morphTexture !== null ) {\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );\n\n\t\t} else {\n\n\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t\t}\n\n\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );\n\n\t\t}\n\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update\n\n\t};\n\n}\n\nfunction WebGLObjects( gl, geometries, attributes, info ) {\n\n\tlet updateMap = new WeakMap();\n\n\tfunction update( object ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\tconst geometry = object.geometry;\n\t\tconst buffergeometry = geometries.get( object, geometry );\n\n\t\t// Update once per frame\n\n\t\tif ( updateMap.get( buffergeometry ) !== frame ) {\n\n\t\t\tgeometries.update( buffergeometry );\n\n\t\t\tupdateMap.set( buffergeometry, frame );\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh ) {\n\n\t\t\tif ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) {\n\n\t\t\t\tobject.addEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\t\t}\n\n\t\t\tif ( updateMap.get( object ) !== frame ) {\n\n\t\t\t\tattributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );\n\n\t\t\t\tif ( object.instanceColor !== null ) {\n\n\t\t\t\t\tattributes.update( object.instanceColor, gl.ARRAY_BUFFER );\n\n\t\t\t\t}\n\n\t\t\t\tupdateMap.set( object, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\tconst skeleton = object.skeleton;\n\n\t\t\tif ( updateMap.get( skeleton ) !== frame ) {\n\n\t\t\t\tskeleton.update();\n\n\t\t\t\tupdateMap.set( skeleton, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn buffergeometry;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tupdateMap = new WeakMap();\n\n\t}\n\n\tfunction onInstancedMeshDispose( event ) {\n\n\t\tconst instancedMesh = event.target;\n\n\t\tinstancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\tattributes.remove( instancedMesh.instanceMatrix );\n\n\t\tif ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update,\n\t\tdispose: dispose\n\n\t};\n\n}\n\nclass DepthTexture extends Texture {\n\n\tconstructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) {\n\n\t\tformat = format !== undefined ? format : DepthFormat;\n\n\t\tif ( format !== DepthFormat && format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );\n\n\t\t}\n\n\t\tif ( type === undefined && format === DepthFormat ) type = UnsignedIntType;\n\t\tif ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isDepthTexture = true;\n\n\t\tthis.image = { width: width, height: height };\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\n\t\tthis.flipY = false;\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.compareFunction = null;\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.compareFunction = source.compareFunction;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Uniforms of a program.\n * Those form a tree structure with a special top-level container for the root,\n * which you get by calling 'new WebGLUniforms( gl, program )'.\n *\n *\n * Properties of inner nodes including the top-level container:\n *\n * .seq - array of nested uniforms\n * .map - nested uniforms by name\n *\n *\n * Methods of all nodes except the top-level container:\n *\n * .setValue( gl, value, [textures] )\n *\n * \t\tuploads a uniform value(s)\n * \tthe 'textures' parameter is needed for sampler uniforms\n *\n *\n * Static methods of the top-level container (textures factorizations):\n *\n * .upload( gl, seq, values, textures )\n *\n * \t\tsets uniforms in 'seq' to 'values[id].value'\n *\n * .seqWithValue( seq, values ) : filteredSeq\n *\n * \t\tfilters 'seq' entries with corresponding entry in values\n *\n *\n * Methods of the top-level container (textures factorizations):\n *\n * .setValue( gl, name, value, textures )\n *\n * \t\tsets uniform with name 'name' to 'value'\n *\n * .setOptional( gl, obj, prop )\n *\n * \t\tlike .set for an optional property of the object\n *\n */\n\n\nconst emptyTexture = /*@__PURE__*/ new Texture();\n\nconst emptyShadowTexture = /*@__PURE__*/ new DepthTexture( 1, 1 );\nemptyShadowTexture.compareFunction = LessEqualCompare;\n\nconst emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();\nconst empty3dTexture = /*@__PURE__*/ new Data3DTexture();\nconst emptyCubeTexture = /*@__PURE__*/ new CubeTexture();\n\n// --- Utilities ---\n\n// Array Caches (provide typed arrays for temporary by size)\n\nconst arrayCacheF32 = [];\nconst arrayCacheI32 = [];\n\n// Float32Array caches used for uploading Matrix uniforms\n\nconst mat4array = new Float32Array( 16 );\nconst mat3array = new Float32Array( 9 );\nconst mat2array = new Float32Array( 4 );\n\n// Flattening for arrays of vectors and matrices\n\nfunction flatten( array, nBlocks, blockSize ) {\n\n\tconst firstElem = array[ 0 ];\n\n\tif ( firstElem <= 0 || firstElem > 0 ) return array;\n\t// unoptimized: ! isNaN( firstElem )\n\t// see http://jacksondunstan.com/articles/983\n\n\tconst n = nBlocks * blockSize;\n\tlet r = arrayCacheF32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Float32Array( n );\n\t\tarrayCacheF32[ n ] = r;\n\n\t}\n\n\tif ( nBlocks !== 0 ) {\n\n\t\tfirstElem.toArray( r, 0 );\n\n\t\tfor ( let i = 1, offset = 0; i !== nBlocks; ++ i ) {\n\n\t\t\toffset += blockSize;\n\t\t\tarray[ i ].toArray( r, offset );\n\n\t\t}\n\n\t}\n\n\treturn r;\n\n}\n\nfunction arraysEqual( a, b ) {\n\n\tif ( a.length !== b.length ) return false;\n\n\tfor ( let i = 0, l = a.length; i < l; i ++ ) {\n\n\t\tif ( a[ i ] !== b[ i ] ) return false;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction copyArray( a, b ) {\n\n\tfor ( let i = 0, l = b.length; i < l; i ++ ) {\n\n\t\ta[ i ] = b[ i ];\n\n\t}\n\n}\n\n// Texture unit allocation\n\nfunction allocTexUnits( textures, n ) {\n\n\tlet r = arrayCacheI32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Int32Array( n );\n\t\tarrayCacheI32[ n ] = r;\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\tr[ i ] = textures.allocateTextureUnit();\n\n\t}\n\n\treturn r;\n\n}\n\n// --- Setters ---\n\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n\n// Single scalar\n\nfunction setValueV1f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1f( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single float vector (from flat array or THREE.VectorN)\n\nfunction setValueV2f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2f( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3f( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else if ( v.r !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) {\n\n\t\t\tgl.uniform3f( this.addr, v.r, v.g, v.b );\n\n\t\t\tcache[ 0 ] = v.r;\n\t\t\tcache[ 1 ] = v.g;\n\t\t\tcache[ 2 ] = v.b;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4f( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single matrix (from flat array or THREE.MatrixN)\n\nfunction setValueM2( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix2fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat2array.set( elements );\n\n\t\tgl.uniformMatrix2fv( this.addr, false, mat2array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM3( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix3fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat3array.set( elements );\n\n\t\tgl.uniformMatrix3fv( this.addr, false, mat3array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM4( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix4fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat4array.set( elements );\n\n\t\tgl.uniformMatrix4fv( this.addr, false, mat4array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\n// Single integer / boolean\n\nfunction setValueV1i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1i( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single integer / boolean vector (from flat array or THREE.VectorN)\n\nfunction setValueV2i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2i( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3i( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4i( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single unsigned integer\n\nfunction setValueV1ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1ui( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single unsigned integer vector (from flat array or THREE.VectorN)\n\nfunction setValueV2ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2ui( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3ui( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4ui( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n\n// Single texture (2D / Cube)\n\nfunction setValueT1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\tconst emptyTexture2D = ( this.type === gl.SAMPLER_2D_SHADOW ) ? emptyShadowTexture : emptyTexture;\n\n\ttextures.setTexture2D( v || emptyTexture2D, unit );\n\n}\n\nfunction setValueT3D1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture3D( v || empty3dTexture, unit );\n\n}\n\nfunction setValueT6( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTextureCube( v || emptyCubeTexture, unit );\n\n}\n\nfunction setValueT2DArray1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture2DArray( v || emptyArrayTexture, unit );\n\n}\n\n// Helper to pick the right setter for the singular case\n\nfunction getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\t\tcase 0x8dc6: return setValueV2ui; // _VEC2\n\t\tcase 0x8dc7: return setValueV3ui; // _VEC3\n\t\tcase 0x8dc8: return setValueV4ui; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}\n\n\n// Array of scalars\n\nfunction setValueV1fArray( gl, v ) {\n\n\tgl.uniform1fv( this.addr, v );\n\n}\n\n// Array of vectors (from flat array or array of THREE.VectorN)\n\nfunction setValueV2fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 2 );\n\n\tgl.uniform2fv( this.addr, data );\n\n}\n\nfunction setValueV3fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 3 );\n\n\tgl.uniform3fv( this.addr, data );\n\n}\n\nfunction setValueV4fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniform4fv( this.addr, data );\n\n}\n\n// Array of matrices (from flat array or array of THREE.MatrixN)\n\nfunction setValueM2Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniformMatrix2fv( this.addr, false, data );\n\n}\n\nfunction setValueM3Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 9 );\n\n\tgl.uniformMatrix3fv( this.addr, false, data );\n\n}\n\nfunction setValueM4Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 16 );\n\n\tgl.uniformMatrix4fv( this.addr, false, data );\n\n}\n\n// Array of integer / boolean\n\nfunction setValueV1iArray( gl, v ) {\n\n\tgl.uniform1iv( this.addr, v );\n\n}\n\n// Array of integer / boolean vectors (from flat array)\n\nfunction setValueV2iArray( gl, v ) {\n\n\tgl.uniform2iv( this.addr, v );\n\n}\n\nfunction setValueV3iArray( gl, v ) {\n\n\tgl.uniform3iv( this.addr, v );\n\n}\n\nfunction setValueV4iArray( gl, v ) {\n\n\tgl.uniform4iv( this.addr, v );\n\n}\n\n// Array of unsigned integer\n\nfunction setValueV1uiArray( gl, v ) {\n\n\tgl.uniform1uiv( this.addr, v );\n\n}\n\n// Array of unsigned integer vectors (from flat array)\n\nfunction setValueV2uiArray( gl, v ) {\n\n\tgl.uniform2uiv( this.addr, v );\n\n}\n\nfunction setValueV3uiArray( gl, v ) {\n\n\tgl.uniform3uiv( this.addr, v );\n\n}\n\nfunction setValueV4uiArray( gl, v ) {\n\n\tgl.uniform4uiv( this.addr, v );\n\n}\n\n\n// Array of textures (2D / 3D / Cube / 2DArray)\n\nfunction setValueT1Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2D( v[ i ] || emptyTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT3DArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture3D( v[ i ] || empty3dTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT6Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT2DArrayArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2DArray( v[ i ] || emptyArrayTexture, units[ i ] );\n\n\t}\n\n}\n\n\n// Helper to pick the right setter for a pure (bottom-level) array\n\nfunction getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}\n\n// --- Uniform Classes ---\n\nclass SingleUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.setValue = getSingularSetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass PureArrayUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass StructuredUniform {\n\n\tconstructor( id ) {\n\n\t\tthis.id = id;\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}\n\n\tsetValue( gl, value, textures ) {\n\n\t\tconst seq = this.seq;\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tu.setValue( gl, value[ u.id ], textures );\n\n\t\t}\n\n\t}\n\n}\n\n// --- Top-level ---\n\n// Parser - builds up the property tree from the path strings\n\nconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g;\n\n// extracts\n// \t- the identifier (member name or array index)\n// - followed by an optional right bracket (found when array index)\n// - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\n\nfunction addUniform( container, uniformObject ) {\n\n\tcontainer.seq.push( uniformObject );\n\tcontainer.map[ uniformObject.id ] = uniformObject;\n\n}\n\nfunction parseUniform( activeInfo, addr, container ) {\n\n\tconst path = activeInfo.name,\n\t\tpathLength = path.length;\n\n\t// reset RegExp object, because of the early exit of a previous run\n\tRePathPart.lastIndex = 0;\n\n\twhile ( true ) {\n\n\t\tconst match = RePathPart.exec( path ),\n\t\t\tmatchEnd = RePathPart.lastIndex;\n\n\t\tlet id = match[ 1 ];\n\t\tconst idIsIndex = match[ 2 ] === ']',\n\t\t\tsubscript = match[ 3 ];\n\n\t\tif ( idIsIndex ) id = id | 0; // convert to integer\n\n\t\tif ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) {\n\n\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\n\t\t\taddUniform( container, subscript === undefined ?\n\t\t\t\tnew SingleUniform( id, activeInfo, addr ) :\n\t\t\t\tnew PureArrayUniform( id, activeInfo, addr ) );\n\n\t\t\tbreak;\n\n\t\t} else {\n\n\t\t\t// step into inner node / create it in case it doesn't exist\n\n\t\t\tconst map = container.map;\n\t\t\tlet next = map[ id ];\n\n\t\t\tif ( next === undefined ) {\n\n\t\t\t\tnext = new StructuredUniform( id );\n\t\t\t\taddUniform( container, next );\n\n\t\t\t}\n\n\t\t\tcontainer = next;\n\n\t\t}\n\n\t}\n\n}\n\n// Root Container\n\nclass WebGLUniforms {\n\n\tconstructor( gl, program ) {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t\tconst n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );\n\n\t\tfor ( let i = 0; i < n; ++ i ) {\n\n\t\t\tconst info = gl.getActiveUniform( program, i ),\n\t\t\t\taddr = gl.getUniformLocation( program, info.name );\n\n\t\t\tparseUniform( info, addr, this );\n\n\t\t}\n\n\t}\n\n\tsetValue( gl, name, value, textures ) {\n\n\t\tconst u = this.map[ name ];\n\n\t\tif ( u !== undefined ) u.setValue( gl, value, textures );\n\n\t}\n\n\tsetOptional( gl, object, name ) {\n\n\t\tconst v = object[ name ];\n\n\t\tif ( v !== undefined ) this.setValue( gl, name, v );\n\n\t}\n\n\tstatic upload( gl, seq, values, textures ) {\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ],\n\t\t\t\tv = values[ u.id ];\n\n\t\t\tif ( v.needsUpdate !== false ) {\n\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\t\tu.setValue( gl, v.value, textures );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tstatic seqWithValue( seq, values ) {\n\n\t\tconst r = [];\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tif ( u.id in values ) r.push( u );\n\n\t\t}\n\n\t\treturn r;\n\n\t}\n\n}\n\nfunction WebGLShader( gl, type, string ) {\n\n\tconst shader = gl.createShader( type );\n\n\tgl.shaderSource( shader, string );\n\tgl.compileShader( shader );\n\n\treturn shader;\n\n}\n\n// From https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/\nconst COMPLETION_STATUS_KHR = 0x91B1;\n\nlet programIdCount = 0;\n\nfunction handleSource( string, errorLine ) {\n\n\tconst lines = string.split( '\\n' );\n\tconst lines2 = [];\n\n\tconst from = Math.max( errorLine - 6, 0 );\n\tconst to = Math.min( errorLine + 6, lines.length );\n\n\tfor ( let i = from; i < to; i ++ ) {\n\n\t\tconst line = i + 1;\n\t\tlines2.push( `${line === errorLine ? '>' : ' '} ${line}: ${lines[ i ]}` );\n\n\t}\n\n\treturn lines2.join( '\\n' );\n\n}\n\nfunction getEncodingComponents( colorSpace ) {\n\n\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\tconst encodingPrimaries = ColorManagement.getPrimaries( colorSpace );\n\n\tlet gamutMapping;\n\n\tif ( workingPrimaries === encodingPrimaries ) {\n\n\t\tgamutMapping = '';\n\n\t} else if ( workingPrimaries === P3Primaries && encodingPrimaries === Rec709Primaries ) {\n\n\t\tgamutMapping = 'LinearDisplayP3ToLinearSRGB';\n\n\t} else if ( workingPrimaries === Rec709Primaries && encodingPrimaries === P3Primaries ) {\n\n\t\tgamutMapping = 'LinearSRGBToLinearDisplayP3';\n\n\t}\n\n\tswitch ( colorSpace ) {\n\n\t\tcase LinearSRGBColorSpace:\n\t\tcase LinearDisplayP3ColorSpace:\n\t\t\treturn [ gamutMapping, 'LinearTransferOETF' ];\n\n\t\tcase SRGBColorSpace:\n\t\tcase DisplayP3ColorSpace:\n\t\t\treturn [ gamutMapping, 'sRGBTransferOETF' ];\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace );\n\t\t\treturn [ gamutMapping, 'LinearTransferOETF' ];\n\n\t}\n\n}\n\nfunction getShaderErrors( gl, shader, type ) {\n\n\tconst status = gl.getShaderParameter( shader, gl.COMPILE_STATUS );\n\tconst errors = gl.getShaderInfoLog( shader ).trim();\n\n\tif ( status && errors === '' ) return '';\n\n\tconst errorMatches = /ERROR: 0:(\\d+)/.exec( errors );\n\tif ( errorMatches ) {\n\n\t\t// --enable-privileged-webgl-extension\n\t\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\tconst errorLine = parseInt( errorMatches[ 1 ] );\n\t\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + handleSource( gl.getShaderSource( shader ), errorLine );\n\n\t} else {\n\n\t\treturn errors;\n\n\t}\n\n}\n\nfunction getTexelEncodingFunction( functionName, colorSpace ) {\n\n\tconst components = getEncodingComponents( colorSpace );\n\treturn `vec4 ${functionName}( vec4 value ) { return ${components[ 0 ]}( ${components[ 1 ]}( value ) ); }`;\n\n}\n\nfunction getToneMappingFunction( functionName, toneMapping ) {\n\n\tlet toneMappingName;\n\n\tswitch ( toneMapping ) {\n\n\t\tcase LinearToneMapping:\n\t\t\ttoneMappingName = 'Linear';\n\t\t\tbreak;\n\n\t\tcase ReinhardToneMapping:\n\t\t\ttoneMappingName = 'Reinhard';\n\t\t\tbreak;\n\n\t\tcase CineonToneMapping:\n\t\t\ttoneMappingName = 'OptimizedCineon';\n\t\t\tbreak;\n\n\t\tcase ACESFilmicToneMapping:\n\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\tbreak;\n\n\t\tcase AgXToneMapping:\n\t\t\ttoneMappingName = 'AgX';\n\t\t\tbreak;\n\n\t\tcase NeutralToneMapping:\n\t\t\ttoneMappingName = 'Neutral';\n\t\t\tbreak;\n\n\t\tcase CustomToneMapping:\n\t\t\ttoneMappingName = 'Custom';\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );\n\t\t\ttoneMappingName = 'Linear';\n\n\t}\n\n\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\n}\n\nfunction generateVertexExtensions( parameters ) {\n\n\tconst chunks = [\n\t\tparameters.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : '',\n\t\tparameters.extensionMultiDraw ? '#extension GL_ANGLE_multi_draw : require' : '',\n\t];\n\n\treturn chunks.filter( filterEmptyLine ).join( '\\n' );\n\n}\n\nfunction generateDefines( defines ) {\n\n\tconst chunks = [];\n\n\tfor ( const name in defines ) {\n\n\t\tconst value = defines[ name ];\n\n\t\tif ( value === false ) continue;\n\n\t\tchunks.push( '#define ' + name + ' ' + value );\n\n\t}\n\n\treturn chunks.join( '\\n' );\n\n}\n\nfunction fetchAttributeLocations( gl, program ) {\n\n\tconst attributes = {};\n\n\tconst n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES );\n\n\tfor ( let i = 0; i < n; i ++ ) {\n\n\t\tconst info = gl.getActiveAttrib( program, i );\n\t\tconst name = info.name;\n\n\t\tlet locationSize = 1;\n\t\tif ( info.type === gl.FLOAT_MAT2 ) locationSize = 2;\n\t\tif ( info.type === gl.FLOAT_MAT3 ) locationSize = 3;\n\t\tif ( info.type === gl.FLOAT_MAT4 ) locationSize = 4;\n\n\t\t// console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\tattributes[ name ] = {\n\t\t\ttype: info.type,\n\t\t\tlocation: gl.getAttribLocation( program, name ),\n\t\t\tlocationSize: locationSize\n\t\t};\n\n\t}\n\n\treturn attributes;\n\n}\n\nfunction filterEmptyLine( string ) {\n\n\treturn string !== '';\n\n}\n\nfunction replaceLightNums( string, parameters ) {\n\n\tconst numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps;\n\n\treturn string\n\t\t.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )\n\t\t.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )\n\t\t.replace( /NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords )\n\t\t.replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights )\n\t\t.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )\n\t\t.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights )\n\t\t.replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows )\n\t\t.replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows );\n\n}\n\nfunction replaceClippingPlaneNums( string, parameters ) {\n\n\treturn string\n\t\t.replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes )\n\t\t.replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) );\n\n}\n\n// Resolve Includes\n\nconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\nfunction resolveIncludes( string ) {\n\n\treturn string.replace( includePattern, includeReplacer );\n\n}\n\nconst shaderChunkMap = new Map();\n\nfunction includeReplacer( match, include ) {\n\n\tlet string = ShaderChunk[ include ];\n\n\tif ( string === undefined ) {\n\n\t\tconst newInclude = shaderChunkMap.get( include );\n\n\t\tif ( newInclude !== undefined ) {\n\n\t\t\tstring = ShaderChunk[ newInclude ];\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.', include, newInclude );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Can not resolve #include <' + include + '>' );\n\n\t\t}\n\n\t}\n\n\treturn resolveIncludes( string );\n\n}\n\n// Unroll Loops\n\nconst unrollLoopPattern = /#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;\n\nfunction unrollLoops( string ) {\n\n\treturn string.replace( unrollLoopPattern, loopReplacer );\n\n}\n\nfunction loopReplacer( match, start, end, snippet ) {\n\n\tlet string = '';\n\n\tfor ( let i = parseInt( start ); i < parseInt( end ); i ++ ) {\n\n\t\tstring += snippet\n\t\t\t.replace( /\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]' )\n\t\t\t.replace( /UNROLLED_LOOP_INDEX/g, i );\n\n\t}\n\n\treturn string;\n\n}\n\n//\n\nfunction generatePrecision( parameters ) {\n\n\tlet precisionstring = `precision ${parameters.precision} float;\n\tprecision ${parameters.precision} int;\n\tprecision ${parameters.precision} sampler2D;\n\tprecision ${parameters.precision} samplerCube;\n\tprecision ${parameters.precision} sampler3D;\n\tprecision ${parameters.precision} sampler2DArray;\n\tprecision ${parameters.precision} sampler2DShadow;\n\tprecision ${parameters.precision} samplerCubeShadow;\n\tprecision ${parameters.precision} sampler2DArrayShadow;\n\tprecision ${parameters.precision} isampler2D;\n\tprecision ${parameters.precision} isampler3D;\n\tprecision ${parameters.precision} isamplerCube;\n\tprecision ${parameters.precision} isampler2DArray;\n\tprecision ${parameters.precision} usampler2D;\n\tprecision ${parameters.precision} usampler3D;\n\tprecision ${parameters.precision} usamplerCube;\n\tprecision ${parameters.precision} usampler2DArray;\n\t`;\n\n\tif ( parameters.precision === 'highp' ) {\n\n\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\n\t} else if ( parameters.precision === 'mediump' ) {\n\n\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\n\t} else if ( parameters.precision === 'lowp' ) {\n\n\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\n\t}\n\n\treturn precisionstring;\n\n}\n\nfunction generateShadowMapTypeDefine( parameters ) {\n\n\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\tif ( parameters.shadowMapType === PCFShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\n\t} else if ( parameters.shadowMapType === PCFSoftShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\n\t} else if ( parameters.shadowMapType === VSMShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\n\t}\n\n\treturn shadowMapTypeDefine;\n\n}\n\nfunction generateEnvMapTypeDefine( parameters ) {\n\n\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeReflectionMapping:\n\t\t\tcase CubeRefractionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\tbreak;\n\n\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapTypeDefine;\n\n}\n\nfunction generateEnvMapModeDefine( parameters ) {\n\n\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeRefractionMapping:\n\n\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapModeDefine;\n\n}\n\nfunction generateEnvMapBlendingDefine( parameters ) {\n\n\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.combine ) {\n\n\t\t\tcase MultiplyOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\tbreak;\n\n\t\t\tcase MixOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\tbreak;\n\n\t\t\tcase AddOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapBlendingDefine;\n\n}\n\nfunction generateCubeUVSize( parameters ) {\n\n\tconst imageHeight = parameters.envMapCubeUVHeight;\n\n\tif ( imageHeight === null ) return null;\n\n\tconst maxMip = Math.log2( imageHeight ) - 2;\n\n\tconst texelHeight = 1.0 / imageHeight;\n\n\tconst texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) );\n\n\treturn { texelWidth, texelHeight, maxMip };\n\n}\n\nfunction WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {\n\n\t// TODO Send this event to Three.js DevTools\n\t// console.log( 'WebGLProgram', cacheKey );\n\n\tconst gl = renderer.getContext();\n\n\tconst defines = parameters.defines;\n\n\tlet vertexShader = parameters.vertexShader;\n\tlet fragmentShader = parameters.fragmentShader;\n\n\tconst shadowMapTypeDefine = generateShadowMapTypeDefine( parameters );\n\tconst envMapTypeDefine = generateEnvMapTypeDefine( parameters );\n\tconst envMapModeDefine = generateEnvMapModeDefine( parameters );\n\tconst envMapBlendingDefine = generateEnvMapBlendingDefine( parameters );\n\tconst envMapCubeUVSize = generateCubeUVSize( parameters );\n\n\tconst customVertexExtensions = generateVertexExtensions( parameters );\n\n\tconst customDefines = generateDefines( defines );\n\n\tconst program = gl.createProgram();\n\n\tlet prefixVertex, prefixFragment;\n\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\tif ( parameters.isRawShaderMaterial ) {\n\n\t\tprefixVertex = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixVertex.length > 0 ) {\n\n\t\t\tprefixVertex += '\\n';\n\n\t\t}\n\n\t\tprefixFragment = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixFragment.length > 0 ) {\n\n\t\t\tprefixFragment += '\\n';\n\n\t\t}\n\n\t} else {\n\n\t\tprefixVertex = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.extensionClipCullDistance ? '#define USE_CLIP_DISTANCE' : '',\n\t\t\tparameters.batching ? '#define USE_BATCHING' : '',\n\t\t\tparameters.instancing ? '#define USE_INSTANCING' : '',\n\t\t\tparameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',\n\t\t\tparameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\t//\n\n\t\t\tparameters.mapUv ? '#define MAP_UV ' + parameters.mapUv : '',\n\t\t\tparameters.alphaMapUv ? '#define ALPHAMAP_UV ' + parameters.alphaMapUv : '',\n\t\t\tparameters.lightMapUv ? '#define LIGHTMAP_UV ' + parameters.lightMapUv : '',\n\t\t\tparameters.aoMapUv ? '#define AOMAP_UV ' + parameters.aoMapUv : '',\n\t\t\tparameters.emissiveMapUv ? '#define EMISSIVEMAP_UV ' + parameters.emissiveMapUv : '',\n\t\t\tparameters.bumpMapUv ? '#define BUMPMAP_UV ' + parameters.bumpMapUv : '',\n\t\t\tparameters.normalMapUv ? '#define NORMALMAP_UV ' + parameters.normalMapUv : '',\n\t\t\tparameters.displacementMapUv ? '#define DISPLACEMENTMAP_UV ' + parameters.displacementMapUv : '',\n\n\t\t\tparameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',\n\t\t\tparameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',\n\n\t\t\tparameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',\n\n\t\t\tparameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',\n\t\t\tparameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',\n\t\t\tparameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',\n\n\t\t\tparameters.iridescenceMapUv ? '#define IRIDESCENCEMAP_UV ' + parameters.iridescenceMapUv : '',\n\t\t\tparameters.iridescenceThicknessMapUv ? '#define IRIDESCENCE_THICKNESSMAP_UV ' + parameters.iridescenceThicknessMapUv : '',\n\n\t\t\tparameters.sheenColorMapUv ? '#define SHEEN_COLORMAP_UV ' + parameters.sheenColorMapUv : '',\n\t\t\tparameters.sheenRoughnessMapUv ? '#define SHEEN_ROUGHNESSMAP_UV ' + parameters.sheenRoughnessMapUv : '',\n\n\t\t\tparameters.specularMapUv ? '#define SPECULARMAP_UV ' + parameters.specularMapUv : '',\n\t\t\tparameters.specularColorMapUv ? '#define SPECULAR_COLORMAP_UV ' + parameters.specularColorMapUv : '',\n\t\t\tparameters.specularIntensityMapUv ? '#define SPECULAR_INTENSITYMAP_UV ' + parameters.specularIntensityMapUv : '',\n\n\t\t\tparameters.transmissionMapUv ? '#define TRANSMISSIONMAP_UV ' + parameters.transmissionMapUv : '',\n\t\t\tparameters.thicknessMapUv ? '#define THICKNESSMAP_UV ' + parameters.thicknessMapUv : '',\n\n\t\t\t//\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.skinning ? '#define USE_SKINNING' : '',\n\n\t\t\tparameters.morphTargets ? '#define USE_MORPHTARGETS' : '',\n\t\t\tparameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '',\n\t\t\t( parameters.morphColors ) ? '#define USE_MORPHCOLORS' : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_TEXTURE' : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_TEXTURE_STRIDE ' + parameters.morphTextureStride : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '',\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 modelMatrix;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t'#ifdef USE_INSTANCING',\n\n\t\t\t'\tattribute mat4 instanceMatrix;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_COLOR',\n\n\t\t\t'\tattribute vec3 instanceColor;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_MORPH',\n\n\t\t\t'\tuniform sampler2D morphTexture;',\n\n\t\t\t'#endif',\n\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'attribute vec2 uv;',\n\n\t\t\t'#ifdef USE_UV1',\n\n\t\t\t'\tattribute vec2 uv1;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV2',\n\n\t\t\t'\tattribute vec2 uv2;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV3',\n\n\t\t\t'\tattribute vec2 uv3;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_TANGENT',\n\n\t\t\t'\tattribute vec4 tangent;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if defined( USE_COLOR_ALPHA )',\n\n\t\t\t'\tattribute vec4 color;',\n\n\t\t\t'#elif defined( USE_COLOR )',\n\n\t\t\t'\tattribute vec3 color;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )',\n\n\t\t\t'\tattribute vec3 morphTarget0;',\n\t\t\t'\tattribute vec3 morphTarget1;',\n\t\t\t'\tattribute vec3 morphTarget2;',\n\t\t\t'\tattribute vec3 morphTarget3;',\n\n\t\t\t'\t#ifdef USE_MORPHNORMALS',\n\n\t\t\t'\t\tattribute vec3 morphNormal0;',\n\t\t\t'\t\tattribute vec3 morphNormal1;',\n\t\t\t'\t\tattribute vec3 morphNormal2;',\n\t\t\t'\t\tattribute vec3 morphNormal3;',\n\n\t\t\t'\t#else',\n\n\t\t\t'\t\tattribute vec3 morphTarget4;',\n\t\t\t'\t\tattribute vec3 morphTarget5;',\n\t\t\t'\t\tattribute vec3 morphTarget6;',\n\t\t\t'\t\tattribute vec3 morphTarget7;',\n\n\t\t\t'\t#endif',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_SKINNING',\n\n\t\t\t'\tattribute vec4 skinIndex;',\n\t\t\t'\tattribute vec4 skinWeight;',\n\n\t\t\t'#endif',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tprefixFragment = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.alphaToCoverage ? '#define ALPHA_TO_COVERAGE' : '',\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.matcap ? '#define USE_MATCAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapTypeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapBlendingDefine : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_WIDTH ' + envMapCubeUVSize.texelWidth : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_HEIGHT ' + envMapCubeUVSize.texelHeight : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_MAX_MIP ' + envMapCubeUVSize.maxMip + '.0' : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoat ? '#define USE_CLEARCOAT' : '',\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.dispersion ? '#define USE_DISPERSION' : '',\n\n\t\t\tparameters.iridescence ? '#define USE_IRIDESCENCE' : '',\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaTest ? '#define USE_ALPHATEST' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.sheen ? '#define USE_SHEEN' : '',\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.gradientMap ? '#define USE_GRADIENTMAP' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',\n\n\t\t\tparameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '',\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',\n\n\t\t\tparameters.dithering ? '#define DITHERING' : '',\n\t\t\tparameters.opaque ? '#define OPAQUE' : '',\n\n\t\t\tShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tgetTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),\n\n\t\t\tparameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t}\n\n\tvertexShader = resolveIncludes( vertexShader );\n\tvertexShader = replaceLightNums( vertexShader, parameters );\n\tvertexShader = replaceClippingPlaneNums( vertexShader, parameters );\n\n\tfragmentShader = resolveIncludes( fragmentShader );\n\tfragmentShader = replaceLightNums( fragmentShader, parameters );\n\tfragmentShader = replaceClippingPlaneNums( fragmentShader, parameters );\n\n\tvertexShader = unrollLoops( vertexShader );\n\tfragmentShader = unrollLoops( fragmentShader );\n\n\tif ( parameters.isRawShaderMaterial !== true ) {\n\n\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\n\t\tversionString = '#version 300 es\\n';\n\n\t\tprefixVertex = [\n\t\t\tcustomVertexExtensions,\n\t\t\t'#define attribute in',\n\t\t\t'#define varying out',\n\t\t\t'#define texture2D texture'\n\t\t].join( '\\n' ) + '\\n' + prefixVertex;\n\n\t\tprefixFragment = [\n\t\t\t'#define varying in',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor',\n\t\t\t'#define gl_FragDepthEXT gl_FragDepth',\n\t\t\t'#define texture2D texture',\n\t\t\t'#define textureCube texture',\n\t\t\t'#define texture2DProj textureProj',\n\t\t\t'#define texture2DLodEXT textureLod',\n\t\t\t'#define texture2DProjLodEXT textureProjLod',\n\t\t\t'#define textureCubeLodEXT textureLod',\n\t\t\t'#define texture2DGradEXT textureGrad',\n\t\t\t'#define texture2DProjGradEXT textureProjGrad',\n\t\t\t'#define textureCubeGradEXT textureGrad'\n\t\t].join( '\\n' ) + '\\n' + prefixFragment;\n\n\t}\n\n\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader;\n\n\t// console.log( '*VERTEX*', vertexGlsl );\n\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\tconst glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );\n\tconst glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );\n\n\tgl.attachShader( program, glVertexShader );\n\tgl.attachShader( program, glFragmentShader );\n\n\t// Force a particular attribute to index 0.\n\n\tif ( parameters.index0AttributeName !== undefined ) {\n\n\t\tgl.bindAttribLocation( program, 0, parameters.index0AttributeName );\n\n\t} else if ( parameters.morphTargets === true ) {\n\n\t\t// programs with morphTargets displace position out of attribute 0\n\t\tgl.bindAttribLocation( program, 0, 'position' );\n\n\t}\n\n\tgl.linkProgram( program );\n\n\tfunction onFirstUse( self ) {\n\n\t\t// check for link errors\n\t\tif ( renderer.debug.checkShaderErrors ) {\n\n\t\t\tconst programLog = gl.getProgramInfoLog( program ).trim();\n\t\t\tconst vertexLog = gl.getShaderInfoLog( glVertexShader ).trim();\n\t\t\tconst fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim();\n\n\t\t\tlet runnable = true;\n\t\t\tlet haveDiagnostics = true;\n\n\t\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) {\n\n\t\t\t\trunnable = false;\n\n\t\t\t\tif ( typeof renderer.debug.onShaderError === 'function' ) {\n\n\t\t\t\t\trenderer.debug.onShaderError( gl, program, glVertexShader, glFragmentShader );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// default error reporting\n\n\t\t\t\t\tconst vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );\n\t\t\t\t\tconst fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +\n\t\t\t\t\t\t'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\\n\\n' +\n\t\t\t\t\t\t'Material Name: ' + self.name + '\\n' +\n\t\t\t\t\t\t'Material Type: ' + self.type + '\\n\\n' +\n\t\t\t\t\t\t'Program Info Log: ' + programLog + '\\n' +\n\t\t\t\t\t\tvertexErrors + '\\n' +\n\t\t\t\t\t\tfragmentErrors\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t} else if ( programLog !== '' ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram: Program Info Log:', programLog );\n\n\t\t\t} else if ( vertexLog === '' || fragmentLog === '' ) {\n\n\t\t\t\thaveDiagnostics = false;\n\n\t\t\t}\n\n\t\t\tif ( haveDiagnostics ) {\n\n\t\t\t\tself.diagnostics = {\n\n\t\t\t\t\trunnable: runnable,\n\n\t\t\t\t\tprogramLog: programLog,\n\n\t\t\t\t\tvertexShader: {\n\n\t\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\t\tprefix: prefixVertex\n\n\t\t\t\t\t},\n\n\t\t\t\t\tfragmentShader: {\n\n\t\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\t\tprefix: prefixFragment\n\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Clean up\n\n\t\t// Crashes in iOS9 and iOS10. #18402\n\t\t// gl.detachShader( program, glVertexShader );\n\t\t// gl.detachShader( program, glFragmentShader );\n\n\t\tgl.deleteShader( glVertexShader );\n\t\tgl.deleteShader( glFragmentShader );\n\n\t\tcachedUniforms = new WebGLUniforms( gl, program );\n\t\tcachedAttributes = fetchAttributeLocations( gl, program );\n\n\t}\n\n\t// set up caching for uniform locations\n\n\tlet cachedUniforms;\n\n\tthis.getUniforms = function () {\n\n\t\tif ( cachedUniforms === undefined ) {\n\n\t\t\t// Populates cachedUniforms and cachedAttributes\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedUniforms;\n\n\t};\n\n\t// set up caching for attribute locations\n\n\tlet cachedAttributes;\n\n\tthis.getAttributes = function () {\n\n\t\tif ( cachedAttributes === undefined ) {\n\n\t\t\t// Populates cachedAttributes and cachedUniforms\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedAttributes;\n\n\t};\n\n\t// indicate when the program is ready to be used. if the KHR_parallel_shader_compile extension isn't supported,\n\t// flag the program as ready immediately. It may cause a stall when it's first used.\n\n\tlet programReady = ( parameters.rendererExtensionParallelShaderCompile === false );\n\n\tthis.isReady = function () {\n\n\t\tif ( programReady === false ) {\n\n\t\t\tprogramReady = gl.getProgramParameter( program, COMPLETION_STATUS_KHR );\n\n\t\t}\n\n\t\treturn programReady;\n\n\t};\n\n\t// free resource\n\n\tthis.destroy = function () {\n\n\t\tbindingStates.releaseStatesOfProgram( this );\n\n\t\tgl.deleteProgram( program );\n\t\tthis.program = undefined;\n\n\t};\n\n\t//\n\n\tthis.type = parameters.shaderType;\n\tthis.name = parameters.shaderName;\n\tthis.id = programIdCount ++;\n\tthis.cacheKey = cacheKey;\n\tthis.usedTimes = 1;\n\tthis.program = program;\n\tthis.vertexShader = glVertexShader;\n\tthis.fragmentShader = glFragmentShader;\n\n\treturn this;\n\n}\n\nlet _id$1 = 0;\n\nclass WebGLShaderCache {\n\n\tconstructor() {\n\n\t\tthis.shaderCache = new Map();\n\t\tthis.materialCache = new Map();\n\n\t}\n\n\tupdate( material ) {\n\n\t\tconst vertexShader = material.vertexShader;\n\t\tconst fragmentShader = material.fragmentShader;\n\n\t\tconst vertexShaderStage = this._getShaderStage( vertexShader );\n\t\tconst fragmentShaderStage = this._getShaderStage( fragmentShader );\n\n\t\tconst materialShaders = this._getShaderCacheForMaterial( material );\n\n\t\tif ( materialShaders.has( vertexShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( vertexShaderStage );\n\t\t\tvertexShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\tif ( materialShaders.has( fragmentShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( fragmentShaderStage );\n\t\t\tfragmentShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( material ) {\n\n\t\tconst materialShaders = this.materialCache.get( material );\n\n\t\tfor ( const shaderStage of materialShaders ) {\n\n\t\t\tshaderStage.usedTimes --;\n\n\t\t\tif ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage.code );\n\n\t\t}\n\n\t\tthis.materialCache.delete( material );\n\n\t\treturn this;\n\n\t}\n\n\tgetVertexShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.vertexShader ).id;\n\n\t}\n\n\tgetFragmentShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.fragmentShader ).id;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shaderCache.clear();\n\t\tthis.materialCache.clear();\n\n\t}\n\n\t_getShaderCacheForMaterial( material ) {\n\n\t\tconst cache = this.materialCache;\n\t\tlet set = cache.get( material );\n\n\t\tif ( set === undefined ) {\n\n\t\t\tset = new Set();\n\t\t\tcache.set( material, set );\n\n\t\t}\n\n\t\treturn set;\n\n\t}\n\n\t_getShaderStage( code ) {\n\n\t\tconst cache = this.shaderCache;\n\t\tlet stage = cache.get( code );\n\n\t\tif ( stage === undefined ) {\n\n\t\t\tstage = new WebGLShaderStage( code );\n\t\t\tcache.set( code, stage );\n\n\t\t}\n\n\t\treturn stage;\n\n\t}\n\n}\n\nclass WebGLShaderStage {\n\n\tconstructor( code ) {\n\n\t\tthis.id = _id$1 ++;\n\n\t\tthis.code = code;\n\t\tthis.usedTimes = 0;\n\n\t}\n\n}\n\nfunction WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) {\n\n\tconst _programLayers = new Layers();\n\tconst _customShaders = new WebGLShaderCache();\n\tconst _activeChannels = new Set();\n\tconst programs = [];\n\n\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\tconst SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures;\n\n\tlet precision = capabilities.precision;\n\n\tconst shaderIDs = {\n\t\tMeshDepthMaterial: 'depth',\n\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\tMeshNormalMaterial: 'normal',\n\t\tMeshBasicMaterial: 'basic',\n\t\tMeshLambertMaterial: 'lambert',\n\t\tMeshPhongMaterial: 'phong',\n\t\tMeshToonMaterial: 'toon',\n\t\tMeshStandardMaterial: 'physical',\n\t\tMeshPhysicalMaterial: 'physical',\n\t\tMeshMatcapMaterial: 'matcap',\n\t\tLineBasicMaterial: 'basic',\n\t\tLineDashedMaterial: 'dashed',\n\t\tPointsMaterial: 'points',\n\t\tShadowMaterial: 'shadow',\n\t\tSpriteMaterial: 'sprite'\n\t};\n\n\tfunction getChannel( value ) {\n\n\t\t_activeChannels.add( value );\n\n\t\tif ( value === 0 ) return 'uv';\n\n\t\treturn `uv${ value }`;\n\n\t}\n\n\tfunction getParameters( material, lights, shadows, scene, object ) {\n\n\t\tconst fog = scene.fog;\n\t\tconst geometry = object.geometry;\n\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\n\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\tconst envMapCubeUVHeight = ( !! envMap ) && ( envMap.mapping === CubeUVReflectionMapping ) ? envMap.image.height : null;\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\n\t\t// heuristics to create shader parameters according to lights in the scene\n\t\t// (not to blow over maxLights budget)\n\n\t\tif ( material.precision !== null ) {\n\n\t\t\tprecision = capabilities.getMaxPrecision( material.precision );\n\n\t\t\tif ( precision !== material.precision ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet morphTextureStride = 0;\n\n\t\tif ( geometry.morphAttributes.position !== undefined ) morphTextureStride = 1;\n\t\tif ( geometry.morphAttributes.normal !== undefined ) morphTextureStride = 2;\n\t\tif ( geometry.morphAttributes.color !== undefined ) morphTextureStride = 3;\n\n\t\t//\n\n\t\tlet vertexShader, fragmentShader;\n\t\tlet customVertexShaderID, customFragmentShaderID;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\n\t\t\tvertexShader = shader.vertexShader;\n\t\t\tfragmentShader = shader.fragmentShader;\n\n\t\t} else {\n\n\t\t\tvertexShader = material.vertexShader;\n\t\t\tfragmentShader = material.fragmentShader;\n\n\t\t\t_customShaders.update( material );\n\n\t\t\tcustomVertexShaderID = _customShaders.getVertexShaderID( material );\n\t\t\tcustomFragmentShaderID = _customShaders.getFragmentShaderID( material );\n\n\t\t}\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tconst IS_INSTANCEDMESH = object.isInstancedMesh === true;\n\t\tconst IS_BATCHEDMESH = object.isBatchedMesh === true;\n\n\t\tconst HAS_MAP = !! material.map;\n\t\tconst HAS_MATCAP = !! material.matcap;\n\t\tconst HAS_ENVMAP = !! envMap;\n\t\tconst HAS_AOMAP = !! material.aoMap;\n\t\tconst HAS_LIGHTMAP = !! material.lightMap;\n\t\tconst HAS_BUMPMAP = !! material.bumpMap;\n\t\tconst HAS_NORMALMAP = !! material.normalMap;\n\t\tconst HAS_DISPLACEMENTMAP = !! material.displacementMap;\n\t\tconst HAS_EMISSIVEMAP = !! material.emissiveMap;\n\n\t\tconst HAS_METALNESSMAP = !! material.metalnessMap;\n\t\tconst HAS_ROUGHNESSMAP = !! material.roughnessMap;\n\n\t\tconst HAS_ANISOTROPY = material.anisotropy > 0;\n\t\tconst HAS_CLEARCOAT = material.clearcoat > 0;\n\t\tconst HAS_DISPERSION = material.dispersion > 0;\n\t\tconst HAS_IRIDESCENCE = material.iridescence > 0;\n\t\tconst HAS_SHEEN = material.sheen > 0;\n\t\tconst HAS_TRANSMISSION = material.transmission > 0;\n\n\t\tconst HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;\n\n\t\tconst HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;\n\t\tconst HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;\n\t\tconst HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;\n\n\t\tconst HAS_IRIDESCENCEMAP = HAS_IRIDESCENCE && !! material.iridescenceMap;\n\t\tconst HAS_IRIDESCENCE_THICKNESSMAP = HAS_IRIDESCENCE && !! material.iridescenceThicknessMap;\n\n\t\tconst HAS_SHEEN_COLORMAP = HAS_SHEEN && !! material.sheenColorMap;\n\t\tconst HAS_SHEEN_ROUGHNESSMAP = HAS_SHEEN && !! material.sheenRoughnessMap;\n\n\t\tconst HAS_SPECULARMAP = !! material.specularMap;\n\t\tconst HAS_SPECULAR_COLORMAP = !! material.specularColorMap;\n\t\tconst HAS_SPECULAR_INTENSITYMAP = !! material.specularIntensityMap;\n\n\t\tconst HAS_TRANSMISSIONMAP = HAS_TRANSMISSION && !! material.transmissionMap;\n\t\tconst HAS_THICKNESSMAP = HAS_TRANSMISSION && !! material.thicknessMap;\n\n\t\tconst HAS_GRADIENTMAP = !! material.gradientMap;\n\n\t\tconst HAS_ALPHAMAP = !! material.alphaMap;\n\n\t\tconst HAS_ALPHATEST = material.alphaTest > 0;\n\n\t\tconst HAS_ALPHAHASH = !! material.alphaHash;\n\n\t\tconst HAS_EXTENSIONS = !! material.extensions;\n\n\t\tlet toneMapping = NoToneMapping;\n\n\t\tif ( material.toneMapped ) {\n\n\t\t\tif ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\ttoneMapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst parameters = {\n\n\t\t\tshaderID: shaderID,\n\t\t\tshaderType: material.type,\n\t\t\tshaderName: material.name,\n\n\t\t\tvertexShader: vertexShader,\n\t\t\tfragmentShader: fragmentShader,\n\t\t\tdefines: material.defines,\n\n\t\t\tcustomVertexShaderID: customVertexShaderID,\n\t\t\tcustomFragmentShaderID: customFragmentShaderID,\n\n\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\tglslVersion: material.glslVersion,\n\n\t\t\tprecision: precision,\n\n\t\t\tbatching: IS_BATCHEDMESH,\n\t\t\tinstancing: IS_INSTANCEDMESH,\n\t\t\tinstancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,\n\t\t\tinstancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,\n\n\t\t\tsupportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,\n\t\t\toutputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),\n\t\t\talphaToCoverage: !! material.alphaToCoverage,\n\n\t\t\tmap: HAS_MAP,\n\t\t\tmatcap: HAS_MATCAP,\n\t\t\tenvMap: HAS_ENVMAP,\n\t\t\tenvMapMode: HAS_ENVMAP && envMap.mapping,\n\t\t\tenvMapCubeUVHeight: envMapCubeUVHeight,\n\t\t\taoMap: HAS_AOMAP,\n\t\t\tlightMap: HAS_LIGHTMAP,\n\t\t\tbumpMap: HAS_BUMPMAP,\n\t\t\tnormalMap: HAS_NORMALMAP,\n\t\t\tdisplacementMap: SUPPORTS_VERTEX_TEXTURES && HAS_DISPLACEMENTMAP,\n\t\t\temissiveMap: HAS_EMISSIVEMAP,\n\n\t\t\tnormalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,\n\t\t\tnormalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,\n\n\t\t\tmetalnessMap: HAS_METALNESSMAP,\n\t\t\troughnessMap: HAS_ROUGHNESSMAP,\n\n\t\t\tanisotropy: HAS_ANISOTROPY,\n\t\t\tanisotropyMap: HAS_ANISOTROPYMAP,\n\n\t\t\tclearcoat: HAS_CLEARCOAT,\n\t\t\tclearcoatMap: HAS_CLEARCOATMAP,\n\t\t\tclearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,\n\t\t\tclearcoatRoughnessMap: HAS_CLEARCOAT_ROUGHNESSMAP,\n\n\t\t\tdispersion: HAS_DISPERSION,\n\n\t\t\tiridescence: HAS_IRIDESCENCE,\n\t\t\tiridescenceMap: HAS_IRIDESCENCEMAP,\n\t\t\tiridescenceThicknessMap: HAS_IRIDESCENCE_THICKNESSMAP,\n\n\t\t\tsheen: HAS_SHEEN,\n\t\t\tsheenColorMap: HAS_SHEEN_COLORMAP,\n\t\t\tsheenRoughnessMap: HAS_SHEEN_ROUGHNESSMAP,\n\n\t\t\tspecularMap: HAS_SPECULARMAP,\n\t\t\tspecularColorMap: HAS_SPECULAR_COLORMAP,\n\t\t\tspecularIntensityMap: HAS_SPECULAR_INTENSITYMAP,\n\n\t\t\ttransmission: HAS_TRANSMISSION,\n\t\t\ttransmissionMap: HAS_TRANSMISSIONMAP,\n\t\t\tthicknessMap: HAS_THICKNESSMAP,\n\n\t\t\tgradientMap: HAS_GRADIENTMAP,\n\n\t\t\topaque: material.transparent === false && material.blending === NormalBlending && material.alphaToCoverage === false,\n\n\t\t\talphaMap: HAS_ALPHAMAP,\n\t\t\talphaTest: HAS_ALPHATEST,\n\t\t\talphaHash: HAS_ALPHAHASH,\n\n\t\t\tcombine: material.combine,\n\n\t\t\t//\n\n\t\t\tmapUv: HAS_MAP && getChannel( material.map.channel ),\n\t\t\taoMapUv: HAS_AOMAP && getChannel( material.aoMap.channel ),\n\t\t\tlightMapUv: HAS_LIGHTMAP && getChannel( material.lightMap.channel ),\n\t\t\tbumpMapUv: HAS_BUMPMAP && getChannel( material.bumpMap.channel ),\n\t\t\tnormalMapUv: HAS_NORMALMAP && getChannel( material.normalMap.channel ),\n\t\t\tdisplacementMapUv: HAS_DISPLACEMENTMAP && getChannel( material.displacementMap.channel ),\n\t\t\temissiveMapUv: HAS_EMISSIVEMAP && getChannel( material.emissiveMap.channel ),\n\n\t\t\tmetalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),\n\t\t\troughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),\n\n\t\t\tanisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),\n\n\t\t\tclearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),\n\t\t\tclearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),\n\t\t\tclearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),\n\n\t\t\tiridescenceMapUv: HAS_IRIDESCENCEMAP && getChannel( material.iridescenceMap.channel ),\n\t\t\tiridescenceThicknessMapUv: HAS_IRIDESCENCE_THICKNESSMAP && getChannel( material.iridescenceThicknessMap.channel ),\n\n\t\t\tsheenColorMapUv: HAS_SHEEN_COLORMAP && getChannel( material.sheenColorMap.channel ),\n\t\t\tsheenRoughnessMapUv: HAS_SHEEN_ROUGHNESSMAP && getChannel( material.sheenRoughnessMap.channel ),\n\n\t\t\tspecularMapUv: HAS_SPECULARMAP && getChannel( material.specularMap.channel ),\n\t\t\tspecularColorMapUv: HAS_SPECULAR_COLORMAP && getChannel( material.specularColorMap.channel ),\n\t\t\tspecularIntensityMapUv: HAS_SPECULAR_INTENSITYMAP && getChannel( material.specularIntensityMap.channel ),\n\n\t\t\ttransmissionMapUv: HAS_TRANSMISSIONMAP && getChannel( material.transmissionMap.channel ),\n\t\t\tthicknessMapUv: HAS_THICKNESSMAP && getChannel( material.thicknessMap.channel ),\n\n\t\t\talphaMapUv: HAS_ALPHAMAP && getChannel( material.alphaMap.channel ),\n\n\t\t\t//\n\n\t\t\tvertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),\n\t\t\tvertexColors: material.vertexColors,\n\t\t\tvertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,\n\n\t\t\tpointsUvs: object.isPoints === true && !! geometry.attributes.uv && ( HAS_MAP || HAS_ALPHAMAP ),\n\n\t\t\tfog: !! fog,\n\t\t\tuseFog: material.fog === true,\n\t\t\tfogExp2: ( !! fog && fog.isFogExp2 ),\n\n\t\t\tflatShading: material.flatShading === true,\n\n\t\t\tsizeAttenuation: material.sizeAttenuation === true,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\n\t\t\tskinning: object.isSkinnedMesh === true,\n\n\t\t\tmorphTargets: geometry.morphAttributes.position !== undefined,\n\t\t\tmorphNormals: geometry.morphAttributes.normal !== undefined,\n\t\t\tmorphColors: geometry.morphAttributes.color !== undefined,\n\t\t\tmorphTargetsCount: morphTargetsCount,\n\t\t\tmorphTextureStride: morphTextureStride,\n\n\t\t\tnumDirLights: lights.directional.length,\n\t\t\tnumPointLights: lights.point.length,\n\t\t\tnumSpotLights: lights.spot.length,\n\t\t\tnumSpotLightMaps: lights.spotLightMap.length,\n\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\tnumHemiLights: lights.hemi.length,\n\n\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\t\t\tnumSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,\n\n\t\t\tnumLightProbes: lights.numLightProbes,\n\n\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\tnumClipIntersection: clipping.numIntersection,\n\n\t\t\tdithering: material.dithering,\n\n\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\tshadowMapType: renderer.shadowMap.type,\n\n\t\t\ttoneMapping: toneMapping,\n\t\t\tuseLegacyLights: renderer._useLegacyLights,\n\n\t\t\tdecodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.map.colorSpace ) === SRGBTransfer ),\n\n\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\n\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\tflipSided: material.side === BackSide,\n\n\t\t\tuseDepthPacking: material.depthPacking >= 0,\n\t\t\tdepthPacking: material.depthPacking || 0,\n\n\t\t\tindex0AttributeName: material.index0AttributeName,\n\n\t\t\textensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance === true && extensions.has( 'WEBGL_clip_cull_distance' ),\n\t\t\textensionMultiDraw: HAS_EXTENSIONS && material.extensions.multiDraw === true && extensions.has( 'WEBGL_multi_draw' ),\n\n\t\t\trendererExtensionParallelShaderCompile: extensions.has( 'KHR_parallel_shader_compile' ),\n\n\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\n\t\t};\n\n\t\t// the usage of getChannel() determines the active texture channels for this shader\n\n\t\tparameters.vertexUv1s = _activeChannels.has( 1 );\n\t\tparameters.vertexUv2s = _activeChannels.has( 2 );\n\t\tparameters.vertexUv3s = _activeChannels.has( 3 );\n\n\t\t_activeChannels.clear();\n\n\t\treturn parameters;\n\n\t}\n\n\tfunction getProgramCacheKey( parameters ) {\n\n\t\tconst array = [];\n\n\t\tif ( parameters.shaderID ) {\n\n\t\t\tarray.push( parameters.shaderID );\n\n\t\t} else {\n\n\t\t\tarray.push( parameters.customVertexShaderID );\n\t\t\tarray.push( parameters.customFragmentShaderID );\n\n\t\t}\n\n\t\tif ( parameters.defines !== undefined ) {\n\n\t\t\tfor ( const name in parameters.defines ) {\n\n\t\t\t\tarray.push( name );\n\t\t\t\tarray.push( parameters.defines[ name ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parameters.isRawShaderMaterial === false ) {\n\n\t\t\tgetProgramCacheKeyParameters( array, parameters );\n\t\t\tgetProgramCacheKeyBooleans( array, parameters );\n\t\t\tarray.push( renderer.outputColorSpace );\n\n\t\t}\n\n\t\tarray.push( parameters.customProgramCacheKey );\n\n\t\treturn array.join();\n\n\t}\n\n\tfunction getProgramCacheKeyParameters( array, parameters ) {\n\n\t\tarray.push( parameters.precision );\n\t\tarray.push( parameters.outputColorSpace );\n\t\tarray.push( parameters.envMapMode );\n\t\tarray.push( parameters.envMapCubeUVHeight );\n\t\tarray.push( parameters.mapUv );\n\t\tarray.push( parameters.alphaMapUv );\n\t\tarray.push( parameters.lightMapUv );\n\t\tarray.push( parameters.aoMapUv );\n\t\tarray.push( parameters.bumpMapUv );\n\t\tarray.push( parameters.normalMapUv );\n\t\tarray.push( parameters.displacementMapUv );\n\t\tarray.push( parameters.emissiveMapUv );\n\t\tarray.push( parameters.metalnessMapUv );\n\t\tarray.push( parameters.roughnessMapUv );\n\t\tarray.push( parameters.anisotropyMapUv );\n\t\tarray.push( parameters.clearcoatMapUv );\n\t\tarray.push( parameters.clearcoatNormalMapUv );\n\t\tarray.push( parameters.clearcoatRoughnessMapUv );\n\t\tarray.push( parameters.iridescenceMapUv );\n\t\tarray.push( parameters.iridescenceThicknessMapUv );\n\t\tarray.push( parameters.sheenColorMapUv );\n\t\tarray.push( parameters.sheenRoughnessMapUv );\n\t\tarray.push( parameters.specularMapUv );\n\t\tarray.push( parameters.specularColorMapUv );\n\t\tarray.push( parameters.specularIntensityMapUv );\n\t\tarray.push( parameters.transmissionMapUv );\n\t\tarray.push( parameters.thicknessMapUv );\n\t\tarray.push( parameters.combine );\n\t\tarray.push( parameters.fogExp2 );\n\t\tarray.push( parameters.sizeAttenuation );\n\t\tarray.push( parameters.morphTargetsCount );\n\t\tarray.push( parameters.morphAttributeCount );\n\t\tarray.push( parameters.numDirLights );\n\t\tarray.push( parameters.numPointLights );\n\t\tarray.push( parameters.numSpotLights );\n\t\tarray.push( parameters.numSpotLightMaps );\n\t\tarray.push( parameters.numHemiLights );\n\t\tarray.push( parameters.numRectAreaLights );\n\t\tarray.push( parameters.numDirLightShadows );\n\t\tarray.push( parameters.numPointLightShadows );\n\t\tarray.push( parameters.numSpotLightShadows );\n\t\tarray.push( parameters.numSpotLightShadowsWithMaps );\n\t\tarray.push( parameters.numLightProbes );\n\t\tarray.push( parameters.shadowMapType );\n\t\tarray.push( parameters.toneMapping );\n\t\tarray.push( parameters.numClippingPlanes );\n\t\tarray.push( parameters.numClipIntersection );\n\t\tarray.push( parameters.depthPacking );\n\n\t}\n\n\tfunction getProgramCacheKeyBooleans( array, parameters ) {\n\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.supportsVertexTextures )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.instancing )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.instancingColor )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.instancingMorph )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.matcap )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.envMap )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.normalMapObjectSpace )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.normalMapTangentSpace )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.clearcoat )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.iridescence )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.alphaTest )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.vertexColors )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.vertexAlphas )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.vertexUv1s )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.vertexUv2s )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.vertexUv3s )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.vertexTangents )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.anisotropy )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.alphaHash )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.batching )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.dispersion )\n\t\t\t_programLayers.enable( 20 );\n\n\t\tarray.push( _programLayers.mask );\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.fog )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.useFog )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.flatShading )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.logarithmicDepthBuffer )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.skinning )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.morphTargets )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.morphNormals )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.morphColors )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.premultipliedAlpha )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.shadowMapEnabled )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.useLegacyLights )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.doubleSided )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.flipSided )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.useDepthPacking )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.dithering )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.transmission )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.sheen )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.opaque )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.pointsUvs )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.decodeVideoTexture )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.alphaToCoverage )\n\t\t\t_programLayers.enable( 20 );\n\n\t\tarray.push( _programLayers.mask );\n\n\t}\n\n\tfunction getUniforms( material ) {\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\t\tlet uniforms;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\t\t\tuniforms = UniformsUtils.clone( shader.uniforms );\n\n\t\t} else {\n\n\t\t\tuniforms = material.uniforms;\n\n\t\t}\n\n\t\treturn uniforms;\n\n\t}\n\n\tfunction acquireProgram( parameters, cacheKey ) {\n\n\t\tlet program;\n\n\t\t// Check if code has been already compiled\n\t\tfor ( let p = 0, pl = programs.length; p < pl; p ++ ) {\n\n\t\t\tconst preexistingProgram = programs[ p ];\n\n\t\t\tif ( preexistingProgram.cacheKey === cacheKey ) {\n\n\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t++ program.usedTimes;\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( program === undefined ) {\n\n\t\t\tprogram = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );\n\t\t\tprograms.push( program );\n\n\t\t}\n\n\t\treturn program;\n\n\t}\n\n\tfunction releaseProgram( program ) {\n\n\t\tif ( -- program.usedTimes === 0 ) {\n\n\t\t\t// Remove from unordered set\n\t\t\tconst i = programs.indexOf( program );\n\t\t\tprograms[ i ] = programs[ programs.length - 1 ];\n\t\t\tprograms.pop();\n\n\t\t\t// Free WebGL resources\n\t\t\tprogram.destroy();\n\n\t\t}\n\n\t}\n\n\tfunction releaseShaderCache( material ) {\n\n\t\t_customShaders.remove( material );\n\n\t}\n\n\tfunction dispose() {\n\n\t\t_customShaders.dispose();\n\n\t}\n\n\treturn {\n\t\tgetParameters: getParameters,\n\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\tgetUniforms: getUniforms,\n\t\tacquireProgram: acquireProgram,\n\t\treleaseProgram: releaseProgram,\n\t\treleaseShaderCache: releaseShaderCache,\n\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\tprograms: programs,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLProperties() {\n\n\tlet properties = new WeakMap();\n\n\tfunction get( object ) {\n\n\t\tlet map = properties.get( object );\n\n\t\tif ( map === undefined ) {\n\n\t\t\tmap = {};\n\t\t\tproperties.set( object, map );\n\n\t\t}\n\n\t\treturn map;\n\n\t}\n\n\tfunction remove( object ) {\n\n\t\tproperties.delete( object );\n\n\t}\n\n\tfunction update( object, key, value ) {\n\n\t\tproperties.get( object )[ key ] = value;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tproperties = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction painterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.material.id !== b.material.id ) {\n\n\t\treturn a.material.id - b.material.id;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn a.z - b.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\nfunction reversePainterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn b.z - a.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\n\nfunction WebGLRenderList() {\n\n\tconst renderItems = [];\n\tlet renderItemsIndex = 0;\n\n\tconst opaque = [];\n\tconst transmissive = [];\n\tconst transparent = [];\n\n\tfunction init() {\n\n\t\trenderItemsIndex = 0;\n\n\t\topaque.length = 0;\n\t\ttransmissive.length = 0;\n\t\ttransparent.length = 0;\n\n\t}\n\n\tfunction getNextRenderItem( object, geometry, material, groupOrder, z, group ) {\n\n\t\tlet renderItem = renderItems[ renderItemsIndex ];\n\n\t\tif ( renderItem === undefined ) {\n\n\t\t\trenderItem = {\n\t\t\t\tid: object.id,\n\t\t\t\tobject: object,\n\t\t\t\tgeometry: geometry,\n\t\t\t\tmaterial: material,\n\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\tz: z,\n\t\t\t\tgroup: group\n\t\t\t};\n\n\t\t\trenderItems[ renderItemsIndex ] = renderItem;\n\n\t\t} else {\n\n\t\t\trenderItem.id = object.id;\n\t\t\trenderItem.object = object;\n\t\t\trenderItem.geometry = geometry;\n\t\t\trenderItem.material = material;\n\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\trenderItem.z = z;\n\t\t\trenderItem.group = group;\n\n\t\t}\n\n\t\trenderItemsIndex ++;\n\n\t\treturn renderItem;\n\n\t}\n\n\tfunction push( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.push( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.push( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.push( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction unshift( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.unshift( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.unshift( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.unshift( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction sort( customOpaqueSort, customTransparentSort ) {\n\n\t\tif ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable );\n\t\tif ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable );\n\t\tif ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable );\n\n\t}\n\n\tfunction finish() {\n\n\t\t// Clear references from inactive renderItems in the list\n\n\t\tfor ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) {\n\n\t\t\tconst renderItem = renderItems[ i ];\n\n\t\t\tif ( renderItem.id === null ) break;\n\n\t\t\trenderItem.id = null;\n\t\t\trenderItem.object = null;\n\t\t\trenderItem.geometry = null;\n\t\t\trenderItem.material = null;\n\t\t\trenderItem.group = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\topaque: opaque,\n\t\ttransmissive: transmissive,\n\t\ttransparent: transparent,\n\n\t\tinit: init,\n\t\tpush: push,\n\t\tunshift: unshift,\n\t\tfinish: finish,\n\n\t\tsort: sort\n\t};\n\n}\n\nfunction WebGLRenderLists() {\n\n\tlet lists = new WeakMap();\n\n\tfunction get( scene, renderCallDepth ) {\n\n\t\tconst listArray = lists.get( scene );\n\t\tlet list;\n\n\t\tif ( listArray === undefined ) {\n\n\t\t\tlist = new WebGLRenderList();\n\t\t\tlists.set( scene, [ list ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= listArray.length ) {\n\n\t\t\t\tlist = new WebGLRenderList();\n\t\t\t\tlistArray.push( list );\n\n\t\t\t} else {\n\n\t\t\t\tlist = listArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn list;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tlists = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction UniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\nfunction ShadowUniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\n\n\nlet nextVersion = 0;\n\nfunction shadowCastingAndTexturingLightsFirst( lightA, lightB ) {\n\n\treturn ( lightB.castShadow ? 2 : 0 ) - ( lightA.castShadow ? 2 : 0 ) + ( lightB.map ? 1 : 0 ) - ( lightA.map ? 1 : 0 );\n\n}\n\nfunction WebGLLights( extensions ) {\n\n\tconst cache = new UniformsCache();\n\n\tconst shadowCache = ShadowUniformsCache();\n\n\tconst state = {\n\n\t\tversion: 0,\n\n\t\thash: {\n\t\t\tdirectionalLength: - 1,\n\t\t\tpointLength: - 1,\n\t\t\tspotLength: - 1,\n\t\t\trectAreaLength: - 1,\n\t\t\themiLength: - 1,\n\n\t\t\tnumDirectionalShadows: - 1,\n\t\t\tnumPointShadows: - 1,\n\t\t\tnumSpotShadows: - 1,\n\t\t\tnumSpotMaps: - 1,\n\n\t\t\tnumLightProbes: - 1\n\t\t},\n\n\t\tambient: [ 0, 0, 0 ],\n\t\tprobe: [],\n\t\tdirectional: [],\n\t\tdirectionalShadow: [],\n\t\tdirectionalShadowMap: [],\n\t\tdirectionalShadowMatrix: [],\n\t\tspot: [],\n\t\tspotLightMap: [],\n\t\tspotShadow: [],\n\t\tspotShadowMap: [],\n\t\tspotLightMatrix: [],\n\t\trectArea: [],\n\t\trectAreaLTC1: null,\n\t\trectAreaLTC2: null,\n\t\tpoint: [],\n\t\tpointShadow: [],\n\t\tpointShadowMap: [],\n\t\tpointShadowMatrix: [],\n\t\themi: [],\n\t\tnumSpotLightShadowsWithMaps: 0,\n\t\tnumLightProbes: 0\n\n\t};\n\n\tfor ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() );\n\n\tconst vector3 = new Vector3();\n\tconst matrix4 = new Matrix4();\n\tconst matrix42 = new Matrix4();\n\n\tfunction setup( lights, useLegacyLights ) {\n\n\t\tlet r = 0, g = 0, b = 0;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 );\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tlet numDirectionalShadows = 0;\n\t\tlet numPointShadows = 0;\n\t\tlet numSpotShadows = 0;\n\t\tlet numSpotMaps = 0;\n\t\tlet numSpotShadowsWithMaps = 0;\n\n\t\tlet numLightProbes = 0;\n\n\t\t// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]\n\t\tlights.sort( shadowCastingAndTexturingLightsFirst );\n\n\t\t// artist-friendly light intensity scaling factor\n\t\tconst scaleFactor = ( useLegacyLights === true ) ? Math.PI : 1;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tconst color = light.color;\n\t\t\tconst intensity = light.intensity;\n\t\t\tconst distance = light.distance;\n\n\t\t\tconst shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;\n\n\t\t\tif ( light.isAmbientLight ) {\n\n\t\t\t\tr += color.r * intensity * scaleFactor;\n\t\t\t\tg += color.g * intensity * scaleFactor;\n\t\t\t\tb += color.b * intensity * scaleFactor;\n\n\t\t\t} else if ( light.isLightProbe ) {\n\n\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\tstate.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity );\n\n\t\t\t\t}\n\n\t\t\t\tnumLightProbes ++;\n\n\t\t\t} else if ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.directionalShadow[ directionalLength ] = shadowUniforms;\n\t\t\t\t\tstate.directionalShadowMap[ directionalLength ] = shadowMap;\n\t\t\t\t\tstate.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumDirectionalShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.directional[ directionalLength ] = uniforms;\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity * scaleFactor );\n\t\t\t\tuniforms.distance = distance;\n\n\t\t\t\tuniforms.coneCos = Math.cos( light.angle );\n\t\t\t\tuniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tstate.spot[ spotLength ] = uniforms;\n\n\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\tif ( light.map ) {\n\n\t\t\t\t\tstate.spotLightMap[ numSpotMaps ] = light.map;\n\t\t\t\t\tnumSpotMaps ++;\n\n\t\t\t\t\t// make sure the lightMatrix is up to date\n\t\t\t\t\t// TODO : do it if required only\n\t\t\t\t\tshadow.updateMatrices( light );\n\n\t\t\t\t\tif ( light.castShadow ) numSpotShadowsWithMaps ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.spotLightMatrix[ spotLength ] = shadow.matrix;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.spotShadow[ spotLength ] = shadowUniforms;\n\t\t\t\t\tstate.spotShadowMap[ spotLength ] = shadowMap;\n\n\t\t\t\t\tnumSpotShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tstate.rectArea[ rectAreaLength ] = uniforms;\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );\n\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\n\t\t\t\t\tstate.pointShadow[ pointLength ] = shadowUniforms;\n\t\t\t\t\tstate.pointShadowMap[ pointLength ] = shadowMap;\n\t\t\t\t\tstate.pointShadowMatrix[ pointLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumPointShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.point[ pointLength ] = uniforms;\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.skyColor.copy( light.color ).multiplyScalar( intensity * scaleFactor );\n\t\t\t\tuniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity * scaleFactor );\n\n\t\t\t\tstate.hemi[ hemiLength ] = uniforms;\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( rectAreaLength > 0 ) {\n\n\t\t\tif ( extensions.has( 'OES_texture_float_linear' ) === true ) {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\n\t\t\t} else {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.ambient[ 0 ] = r;\n\t\tstate.ambient[ 1 ] = g;\n\t\tstate.ambient[ 2 ] = b;\n\n\t\tconst hash = state.hash;\n\n\t\tif ( hash.directionalLength !== directionalLength ||\n\t\t\thash.pointLength !== pointLength ||\n\t\t\thash.spotLength !== spotLength ||\n\t\t\thash.rectAreaLength !== rectAreaLength ||\n\t\t\thash.hemiLength !== hemiLength ||\n\t\t\thash.numDirectionalShadows !== numDirectionalShadows ||\n\t\t\thash.numPointShadows !== numPointShadows ||\n\t\t\thash.numSpotShadows !== numSpotShadows ||\n\t\t\thash.numSpotMaps !== numSpotMaps ||\n\t\t\thash.numLightProbes !== numLightProbes ) {\n\n\t\t\tstate.directional.length = directionalLength;\n\t\t\tstate.spot.length = spotLength;\n\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\tstate.point.length = pointLength;\n\t\t\tstate.hemi.length = hemiLength;\n\n\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\tstate.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps;\n\t\t\tstate.spotLightMap.length = numSpotMaps;\n\t\t\tstate.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps;\n\t\t\tstate.numLightProbes = numLightProbes;\n\n\t\t\thash.directionalLength = directionalLength;\n\t\t\thash.pointLength = pointLength;\n\t\t\thash.spotLength = spotLength;\n\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\thash.hemiLength = hemiLength;\n\n\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\thash.numPointShadows = numPointShadows;\n\t\t\thash.numSpotShadows = numSpotShadows;\n\t\t\thash.numSpotMaps = numSpotMaps;\n\n\t\t\thash.numLightProbes = numLightProbes;\n\n\t\t\tstate.version = nextVersion ++;\n\n\t\t}\n\n\t}\n\n\tfunction setupView( lights, camera ) {\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tif ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = state.directional[ directionalLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = state.spot[ spotLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = state.rectArea[ rectAreaLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t// extract local rotation of light to derive width/height half vectors\n\t\t\t\tmatrix42.identity();\n\t\t\t\tmatrix4.copy( light.matrixWorld );\n\t\t\t\tmatrix4.premultiply( viewMatrix );\n\t\t\t\tmatrix42.extractRotation( matrix4 );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tuniforms.halfWidth.applyMatrix4( matrix42 );\n\t\t\t\tuniforms.halfHeight.applyMatrix4( matrix42 );\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = state.point[ pointLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = state.hemi[ hemiLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tsetup: setup,\n\t\tsetupView: setupView,\n\t\tstate: state\n\t};\n\n}\n\nfunction WebGLRenderState( extensions ) {\n\n\tconst lights = new WebGLLights( extensions );\n\n\tconst lightsArray = [];\n\tconst shadowsArray = [];\n\n\tfunction init( camera ) {\n\n\t\tstate.camera = camera;\n\n\t\tlightsArray.length = 0;\n\t\tshadowsArray.length = 0;\n\n\t}\n\n\tfunction pushLight( light ) {\n\n\t\tlightsArray.push( light );\n\n\t}\n\n\tfunction pushShadow( shadowLight ) {\n\n\t\tshadowsArray.push( shadowLight );\n\n\t}\n\n\tfunction setupLights( useLegacyLights ) {\n\n\t\tlights.setup( lightsArray, useLegacyLights );\n\n\t}\n\n\tfunction setupLightsView( camera ) {\n\n\t\tlights.setupView( lightsArray, camera );\n\n\t}\n\n\tconst state = {\n\t\tlightsArray: lightsArray,\n\t\tshadowsArray: shadowsArray,\n\n\t\tcamera: null,\n\n\t\tlights: lights,\n\n\t\ttransmissionRenderTarget: {}\n\t};\n\n\treturn {\n\t\tinit: init,\n\t\tstate: state,\n\t\tsetupLights: setupLights,\n\t\tsetupLightsView: setupLightsView,\n\n\t\tpushLight: pushLight,\n\t\tpushShadow: pushShadow\n\t};\n\n}\n\nfunction WebGLRenderStates( extensions ) {\n\n\tlet renderStates = new WeakMap();\n\n\tfunction get( scene, renderCallDepth = 0 ) {\n\n\t\tconst renderStateArray = renderStates.get( scene );\n\t\tlet renderState;\n\n\t\tif ( renderStateArray === undefined ) {\n\n\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\trenderStates.set( scene, [ renderState ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= renderStateArray.length ) {\n\n\t\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\t\trenderStateArray.push( renderState );\n\n\t\t\t} else {\n\n\t\t\t\trenderState = renderStateArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn renderState;\n\n\t}\n\n\tfunction dispose() {\n\n\t\trenderStates = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nclass MeshDepthMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshDepthMaterial = true;\n\n\t\tthis.type = 'MeshDepthMaterial';\n\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshDistanceMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshDistanceMaterial = true;\n\n\t\tthis.type = 'MeshDistanceMaterial';\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\nconst fragment = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\n#include \\nvoid main() {\\n\\tconst float samples = float( VSM_SAMPLES );\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";\n\nfunction WebGLShadowMap( renderer, objects, capabilities ) {\n\n\tlet _frustum = new Frustum();\n\n\tconst _shadowMapSize = new Vector2(),\n\t\t_viewportSize = new Vector2(),\n\n\t\t_viewport = new Vector4(),\n\n\t\t_depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ),\n\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\n\t\t_materialCache = {},\n\n\t\t_maxTextureSize = capabilities.maxTextureSize;\n\n\tconst shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide };\n\n\tconst shadowMaterialVertical = new ShaderMaterial( {\n\t\tdefines: {\n\t\t\tVSM_SAMPLES: 8\n\t\t},\n\t\tuniforms: {\n\t\t\tshadow_pass: { value: null },\n\t\t\tresolution: { value: new Vector2() },\n\t\t\tradius: { value: 4.0 }\n\t\t},\n\n\t\tvertexShader: vertex,\n\t\tfragmentShader: fragment\n\n\t} );\n\n\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\n\tconst fullScreenTri = new BufferGeometry();\n\tfullScreenTri.setAttribute(\n\t\t'position',\n\t\tnew BufferAttribute(\n\t\t\tnew Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ),\n\t\t\t3\n\t\t)\n\t);\n\n\tconst fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical );\n\n\tconst scope = this;\n\n\tthis.enabled = false;\n\n\tthis.autoUpdate = true;\n\tthis.needsUpdate = false;\n\n\tthis.type = PCFShadowMap;\n\tlet _previousType = this.type;\n\n\tthis.render = function ( lights, scene, camera ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tif ( scope.autoUpdate === false && scope.needsUpdate === false ) return;\n\n\t\tif ( lights.length === 0 ) return;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst activeCubeFace = renderer.getActiveCubeFace();\n\t\tconst activeMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst _state = renderer.state;\n\n\t\t// Set GL state for depth map.\n\t\t_state.setBlending( NoBlending );\n\t\t_state.buffers.color.setClear( 1, 1, 1, 1 );\n\t\t_state.buffers.depth.setTest( true );\n\t\t_state.setScissorTest( false );\n\n\t\t// check for shadow map type changes\n\n\t\tconst toVSM = ( _previousType !== VSMShadowMap && this.type === VSMShadowMap );\n\t\tconst fromVSM = ( _previousType === VSMShadowMap && this.type !== VSMShadowMap );\n\n\t\t// render depth map\n\n\t\tfor ( let i = 0, il = lights.length; i < il; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\t\t\tconst shadow = light.shadow;\n\n\t\t\tif ( shadow === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;\n\n\t\t\t_shadowMapSize.copy( shadow.mapSize );\n\n\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t_shadowMapSize.multiply( shadowFrameExtents );\n\n\t\t\t_viewportSize.copy( shadow.mapSize );\n\n\t\t\tif ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\tif ( _shadowMapSize.x > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x );\n\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\n\t\t\t\t}\n\n\t\t\t\tif ( _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y );\n\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( shadow.map === null || toVSM === true || fromVSM === true ) {\n\n\t\t\t\tconst pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};\n\n\t\t\t\tif ( shadow.map !== null ) {\n\n\t\t\t\t\tshadow.map.dispose();\n\n\t\t\t\t}\n\n\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\n\t\t\t\tshadow.camera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\trenderer.setRenderTarget( shadow.map );\n\t\t\trenderer.clear();\n\n\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\tfor ( let vp = 0; vp < viewportCount; vp ++ ) {\n\n\t\t\t\tconst viewport = shadow.getViewport( vp );\n\n\t\t\t\t_viewport.set(\n\t\t\t\t\t_viewportSize.x * viewport.x,\n\t\t\t\t\t_viewportSize.y * viewport.y,\n\t\t\t\t\t_viewportSize.x * viewport.z,\n\t\t\t\t\t_viewportSize.y * viewport.w\n\t\t\t\t);\n\n\t\t\t\t_state.viewport( _viewport );\n\n\t\t\t\tshadow.updateMatrices( light, vp );\n\n\t\t\t\t_frustum = shadow.getFrustum();\n\n\t\t\t\trenderObject( scene, camera, shadow.camera, light, this.type );\n\n\t\t\t}\n\n\t\t\t// do blur pass for VSM\n\n\t\t\tif ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {\n\n\t\t\t\tVSMPass( shadow, camera );\n\n\t\t\t}\n\n\t\t\tshadow.needsUpdate = false;\n\n\t\t}\n\n\t\t_previousType = this.type;\n\n\t\tscope.needsUpdate = false;\n\n\t\trenderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n\n\t};\n\n\tfunction VSMPass( shadow, camera ) {\n\n\t\tconst geometry = objects.update( fullScreenMesh );\n\n\t\tif ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {\n\n\t\t\tshadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples;\n\t\t\tshadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples;\n\n\t\t\tshadowMaterialVertical.needsUpdate = true;\n\t\t\tshadowMaterialHorizontal.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( shadow.mapPass === null ) {\n\n\t\t\tshadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );\n\n\t\t}\n\n\t\t// vertical pass\n\n\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.mapPass );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );\n\n\t\t// horizontal pass\n\n\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.map );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );\n\n\t}\n\n\tfunction getDepthMaterial( object, material, light, type ) {\n\n\t\tlet result = null;\n\n\t\tconst customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\tif ( customMaterial !== undefined ) {\n\n\t\t\tresult = customMaterial;\n\n\t\t} else {\n\n\t\t\tresult = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;\n\n\t\t\tif ( ( renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||\n\t\t\t\t( material.displacementMap && material.displacementScale !== 0 ) ||\n\t\t\t\t( material.alphaMap && material.alphaTest > 0 ) ||\n\t\t\t\t( material.map && material.alphaTest > 0 ) ) {\n\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\n\t\t\t\tconst keyA = result.uuid, keyB = material.uuid;\n\n\t\t\t\tlet materialsForVariant = _materialCache[ keyA ];\n\n\t\t\t\tif ( materialsForVariant === undefined ) {\n\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[ keyA ] = materialsForVariant;\n\n\t\t\t\t}\n\n\t\t\t\tlet cachedMaterial = materialsForVariant[ keyB ];\n\n\t\t\t\tif ( cachedMaterial === undefined ) {\n\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[ keyB ] = cachedMaterial;\n\t\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t\tresult.visible = material.visible;\n\t\tresult.wireframe = material.wireframe;\n\n\t\tif ( type === VSMShadowMap ) {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side;\n\n\t\t} else {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ];\n\n\t\t}\n\n\t\tresult.alphaMap = material.alphaMap;\n\t\tresult.alphaTest = material.alphaTest;\n\t\tresult.map = material.map;\n\n\t\tresult.clipShadows = material.clipShadows;\n\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\tresult.clipIntersection = material.clipIntersection;\n\n\t\tresult.displacementMap = material.displacementMap;\n\t\tresult.displacementScale = material.displacementScale;\n\t\tresult.displacementBias = material.displacementBias;\n\n\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\tresult.linewidth = material.linewidth;\n\n\t\tif ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {\n\n\t\t\tconst materialProperties = renderer.properties.get( result );\n\t\t\tmaterialProperties.light = light;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction renderObject( object, camera, shadowCamera, light, type ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tconst visible = object.layers.test( camera.layers );\n\n\t\tif ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {\n\n\t\t\tif ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) {\n\n\t\t\t\tobject.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );\n\n\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\tfor ( let k = 0, kl = groups.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ k ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, groupMaterial, light, type );\n\n\t\t\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );\n\n\t\t\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, material, light, type );\n\n\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );\n\n\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( children[ i ], camera, shadowCamera, light, type );\n\n\t\t}\n\n\t}\n\n\tfunction onMaterialDispose( event ) {\n\n\t\tconst material = event.target;\n\n\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t// make sure to remove the unique distance/depth materials used for shadow map rendering\n\n\t\tfor ( const id in _materialCache ) {\n\n\t\t\tconst cache = _materialCache[ id ];\n\n\t\t\tconst uuid = event.target.uuid;\n\n\t\t\tif ( uuid in cache ) {\n\n\t\t\t\tconst shadowMaterial = cache[ uuid ];\n\t\t\t\tshadowMaterial.dispose();\n\t\t\t\tdelete cache[ uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction WebGLState( gl ) {\n\n\tfunction ColorBuffer() {\n\n\t\tlet locked = false;\n\n\t\tconst color = new Vector4();\n\t\tlet currentColorMask = null;\n\t\tconst currentColorClear = new Vector4( 0, 0, 0, 0 );\n\n\t\treturn {\n\n\t\t\tsetMask: function ( colorMask ) {\n\n\t\t\t\tif ( currentColorMask !== colorMask && ! locked ) {\n\n\t\t\t\t\tgl.colorMask( colorMask, colorMask, colorMask, colorMask );\n\t\t\t\t\tcurrentColorMask = colorMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( r, g, b, a, premultipliedAlpha ) {\n\n\t\t\t\tif ( premultipliedAlpha === true ) {\n\n\t\t\t\t\tr *= a; g *= a; b *= a;\n\n\t\t\t\t}\n\n\t\t\t\tcolor.set( r, g, b, a );\n\n\t\t\t\tif ( currentColorClear.equals( color ) === false ) {\n\n\t\t\t\t\tgl.clearColor( r, g, b, a );\n\t\t\t\t\tcurrentColorClear.copy( color );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentColorMask = null;\n\t\t\t\tcurrentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction DepthBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentDepthMask = null;\n\t\tlet currentDepthFunc = null;\n\t\tlet currentDepthClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( depthTest ) {\n\n\t\t\t\tif ( depthTest ) {\n\n\t\t\t\t\tenable( gl.DEPTH_TEST );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdisable( gl.DEPTH_TEST );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( depthMask ) {\n\n\t\t\t\tif ( currentDepthMask !== depthMask && ! locked ) {\n\n\t\t\t\t\tgl.depthMask( depthMask );\n\t\t\t\t\tcurrentDepthMask = depthMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( depthFunc ) {\n\n\t\t\t\tif ( currentDepthFunc !== depthFunc ) {\n\n\t\t\t\t\tswitch ( depthFunc ) {\n\n\t\t\t\t\t\tcase NeverDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NEVER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AlwaysDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.ALWAYS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LESS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.EQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GREATER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase NotEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NOTEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( depth ) {\n\n\t\t\t\tif ( currentDepthClear !== depth ) {\n\n\t\t\t\t\tgl.clearDepth( depth );\n\t\t\t\t\tcurrentDepthClear = depth;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentDepthMask = null;\n\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\tcurrentDepthClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction StencilBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentStencilMask = null;\n\t\tlet currentStencilFunc = null;\n\t\tlet currentStencilRef = null;\n\t\tlet currentStencilFuncMask = null;\n\t\tlet currentStencilFail = null;\n\t\tlet currentStencilZFail = null;\n\t\tlet currentStencilZPass = null;\n\t\tlet currentStencilClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( stencilTest ) {\n\n\t\t\t\tif ( ! locked ) {\n\n\t\t\t\t\tif ( stencilTest ) {\n\n\t\t\t\t\t\tenable( gl.STENCIL_TEST );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( gl.STENCIL_TEST );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( stencilMask ) {\n\n\t\t\t\tif ( currentStencilMask !== stencilMask && ! locked ) {\n\n\t\t\t\t\tgl.stencilMask( stencilMask );\n\t\t\t\t\tcurrentStencilMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\t\tif ( currentStencilFunc !== stencilFunc ||\n\t\t\t\t currentStencilRef !== stencilRef ||\n\t\t\t\t currentStencilFuncMask !== stencilMask ) {\n\n\t\t\t\t\tgl.stencilFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetOp: function ( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\t\tif ( currentStencilFail !== stencilFail ||\n\t\t\t\t currentStencilZFail !== stencilZFail ||\n\t\t\t\t currentStencilZPass !== stencilZPass ) {\n\n\t\t\t\t\tgl.stencilOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( stencil ) {\n\n\t\t\t\tif ( currentStencilClear !== stencil ) {\n\n\t\t\t\t\tgl.clearStencil( stencil );\n\t\t\t\t\tcurrentStencilClear = stencil;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentStencilMask = null;\n\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\tcurrentStencilRef = null;\n\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\tcurrentStencilFail = null;\n\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\tcurrentStencilClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t//\n\n\tconst colorBuffer = new ColorBuffer();\n\tconst depthBuffer = new DepthBuffer();\n\tconst stencilBuffer = new StencilBuffer();\n\n\tconst uboBindings = new WeakMap();\n\tconst uboProgramMap = new WeakMap();\n\n\tlet enabledCapabilities = {};\n\n\tlet currentBoundFramebuffers = {};\n\tlet currentDrawbuffers = new WeakMap();\n\tlet defaultDrawbuffers = [];\n\n\tlet currentProgram = null;\n\n\tlet currentBlendingEnabled = false;\n\tlet currentBlending = null;\n\tlet currentBlendEquation = null;\n\tlet currentBlendSrc = null;\n\tlet currentBlendDst = null;\n\tlet currentBlendEquationAlpha = null;\n\tlet currentBlendSrcAlpha = null;\n\tlet currentBlendDstAlpha = null;\n\tlet currentBlendColor = new Color( 0, 0, 0 );\n\tlet currentBlendAlpha = 0;\n\tlet currentPremultipledAlpha = false;\n\n\tlet currentFlipSided = null;\n\tlet currentCullFace = null;\n\n\tlet currentLineWidth = null;\n\n\tlet currentPolygonOffsetFactor = null;\n\tlet currentPolygonOffsetUnits = null;\n\n\tconst maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS );\n\n\tlet lineWidthAvailable = false;\n\tlet version = 0;\n\tconst glVersion = gl.getParameter( gl.VERSION );\n\n\tif ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^WebGL (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 1.0 );\n\n\t} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^OpenGL ES (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 2.0 );\n\n\t}\n\n\tlet currentTextureSlot = null;\n\tlet currentBoundTextures = {};\n\n\tconst scissorParam = gl.getParameter( gl.SCISSOR_BOX );\n\tconst viewportParam = gl.getParameter( gl.VIEWPORT );\n\n\tconst currentScissor = new Vector4().fromArray( scissorParam );\n\tconst currentViewport = new Vector4().fromArray( viewportParam );\n\n\tfunction createTexture( type, target, count, dimensions ) {\n\n\t\tconst data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.\n\t\tconst texture = gl.createTexture();\n\n\t\tgl.bindTexture( type, texture );\n\t\tgl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\t\tgl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tif ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tgl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t} else {\n\n\t\t\t\tgl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tconst emptyTextures = {};\n\temptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );\n\temptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );\n\temptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 );\n\temptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 );\n\n\t// init\n\n\tcolorBuffer.setClear( 0, 0, 0, 1 );\n\tdepthBuffer.setClear( 1 );\n\tstencilBuffer.setClear( 0 );\n\n\tenable( gl.DEPTH_TEST );\n\tdepthBuffer.setFunc( LessEqualDepth );\n\n\tsetFlipSided( false );\n\tsetCullFace( CullFaceBack );\n\tenable( gl.CULL_FACE );\n\n\tsetBlending( NoBlending );\n\n\t//\n\n\tfunction enable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== true ) {\n\n\t\t\tgl.enable( id );\n\t\t\tenabledCapabilities[ id ] = true;\n\n\t\t}\n\n\t}\n\n\tfunction disable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== false ) {\n\n\t\t\tgl.disable( id );\n\t\t\tenabledCapabilities[ id ] = false;\n\n\t\t}\n\n\t}\n\n\tfunction bindFramebuffer( target, framebuffer ) {\n\n\t\tif ( currentBoundFramebuffers[ target ] !== framebuffer ) {\n\n\t\t\tgl.bindFramebuffer( target, framebuffer );\n\n\t\t\tcurrentBoundFramebuffers[ target ] = framebuffer;\n\n\t\t\t// gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER\n\n\t\t\tif ( target === gl.DRAW_FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\tif ( target === gl.FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.DRAW_FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction drawBuffers( renderTarget, framebuffer ) {\n\n\t\tlet drawBuffers = defaultDrawbuffers;\n\n\t\tlet needsUpdate = false;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tdrawBuffers = currentDrawbuffers.get( framebuffer );\n\n\t\t\tif ( drawBuffers === undefined ) {\n\n\t\t\t\tdrawBuffers = [];\n\t\t\t\tcurrentDrawbuffers.set( framebuffer, drawBuffers );\n\n\t\t\t}\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tif ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tdrawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;\n\n\t\t\t\t}\n\n\t\t\t\tdrawBuffers.length = textures.length;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( drawBuffers[ 0 ] !== gl.BACK ) {\n\n\t\t\t\tdrawBuffers[ 0 ] = gl.BACK;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tgl.drawBuffers( drawBuffers );\n\n\t\t}\n\n\t}\n\n\tfunction useProgram( program ) {\n\n\t\tif ( currentProgram !== program ) {\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tcurrentProgram = program;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tconst equationToGL = {\n\t\t[ AddEquation ]: gl.FUNC_ADD,\n\t\t[ SubtractEquation ]: gl.FUNC_SUBTRACT,\n\t\t[ ReverseSubtractEquation ]: gl.FUNC_REVERSE_SUBTRACT\n\t};\n\n\tequationToGL[ MinEquation ] = gl.MIN;\n\tequationToGL[ MaxEquation ] = gl.MAX;\n\n\tconst factorToGL = {\n\t\t[ ZeroFactor ]: gl.ZERO,\n\t\t[ OneFactor ]: gl.ONE,\n\t\t[ SrcColorFactor ]: gl.SRC_COLOR,\n\t\t[ SrcAlphaFactor ]: gl.SRC_ALPHA,\n\t\t[ SrcAlphaSaturateFactor ]: gl.SRC_ALPHA_SATURATE,\n\t\t[ DstColorFactor ]: gl.DST_COLOR,\n\t\t[ DstAlphaFactor ]: gl.DST_ALPHA,\n\t\t[ OneMinusSrcColorFactor ]: gl.ONE_MINUS_SRC_COLOR,\n\t\t[ OneMinusSrcAlphaFactor ]: gl.ONE_MINUS_SRC_ALPHA,\n\t\t[ OneMinusDstColorFactor ]: gl.ONE_MINUS_DST_COLOR,\n\t\t[ OneMinusDstAlphaFactor ]: gl.ONE_MINUS_DST_ALPHA,\n\t\t[ ConstantColorFactor ]: gl.CONSTANT_COLOR,\n\t\t[ OneMinusConstantColorFactor ]: gl.ONE_MINUS_CONSTANT_COLOR,\n\t\t[ ConstantAlphaFactor ]: gl.CONSTANT_ALPHA,\n\t\t[ OneMinusConstantAlphaFactor ]: gl.ONE_MINUS_CONSTANT_ALPHA\n\t};\n\n\tfunction setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, blendColor, blendAlpha, premultipliedAlpha ) {\n\n\t\tif ( blending === NoBlending ) {\n\n\t\t\tif ( currentBlendingEnabled === true ) {\n\n\t\t\t\tdisable( gl.BLEND );\n\t\t\t\tcurrentBlendingEnabled = false;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( currentBlendingEnabled === false ) {\n\n\t\t\tenable( gl.BLEND );\n\t\t\tcurrentBlendingEnabled = true;\n\n\t\t}\n\n\t\tif ( blending !== CustomBlending ) {\n\n\t\t\tif ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) {\n\n\t\t\t\tif ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) {\n\n\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\n\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\n\t\t\t\t}\n\n\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.ONE, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.SRC_ALPHA, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.ZERO, gl.SRC_COLOR );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\tcurrentBlendDst = null;\n\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\tcurrentBlendDstAlpha = null;\n\t\t\t\tcurrentBlendColor.set( 0, 0, 0 );\n\t\t\t\tcurrentBlendAlpha = 0;\n\n\t\t\t\tcurrentBlending = blending;\n\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// custom blending\n\n\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\tif ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {\n\n\t\t\tgl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] );\n\n\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\n\t\t}\n\n\t\tif ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {\n\n\t\t\tgl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] );\n\n\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\tcurrentBlendDst = blendDst;\n\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\n\t\t}\n\n\t\tif ( blendColor.equals( currentBlendColor ) === false || blendAlpha !== currentBlendAlpha ) {\n\n\t\t\tgl.blendColor( blendColor.r, blendColor.g, blendColor.b, blendAlpha );\n\n\t\t\tcurrentBlendColor.copy( blendColor );\n\t\t\tcurrentBlendAlpha = blendAlpha;\n\n\t\t}\n\n\t\tcurrentBlending = blending;\n\t\tcurrentPremultipledAlpha = false;\n\n\t}\n\n\tfunction setMaterial( material, frontFaceCW ) {\n\n\t\tmaterial.side === DoubleSide\n\t\t\t? disable( gl.CULL_FACE )\n\t\t\t: enable( gl.CULL_FACE );\n\n\t\tlet flipSided = ( material.side === BackSide );\n\t\tif ( frontFaceCW ) flipSided = ! flipSided;\n\n\t\tsetFlipSided( flipSided );\n\n\t\t( material.blending === NormalBlending && material.transparent === false )\n\t\t\t? setBlending( NoBlending )\n\t\t\t: setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.blendColor, material.blendAlpha, material.premultipliedAlpha );\n\n\t\tdepthBuffer.setFunc( material.depthFunc );\n\t\tdepthBuffer.setTest( material.depthTest );\n\t\tdepthBuffer.setMask( material.depthWrite );\n\t\tcolorBuffer.setMask( material.colorWrite );\n\n\t\tconst stencilWrite = material.stencilWrite;\n\t\tstencilBuffer.setTest( stencilWrite );\n\t\tif ( stencilWrite ) {\n\n\t\t\tstencilBuffer.setMask( material.stencilWriteMask );\n\t\t\tstencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask );\n\t\t\tstencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass );\n\n\t\t}\n\n\t\tsetPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );\n\n\t\tmaterial.alphaToCoverage === true\n\t\t\t? enable( gl.SAMPLE_ALPHA_TO_COVERAGE )\n\t\t\t: disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t}\n\n\t//\n\n\tfunction setFlipSided( flipSided ) {\n\n\t\tif ( currentFlipSided !== flipSided ) {\n\n\t\t\tif ( flipSided ) {\n\n\t\t\t\tgl.frontFace( gl.CW );\n\n\t\t\t} else {\n\n\t\t\t\tgl.frontFace( gl.CCW );\n\n\t\t\t}\n\n\t\t\tcurrentFlipSided = flipSided;\n\n\t\t}\n\n\t}\n\n\tfunction setCullFace( cullFace ) {\n\n\t\tif ( cullFace !== CullFaceNone ) {\n\n\t\t\tenable( gl.CULL_FACE );\n\n\t\t\tif ( cullFace !== currentCullFace ) {\n\n\t\t\t\tif ( cullFace === CullFaceBack ) {\n\n\t\t\t\t\tgl.cullFace( gl.BACK );\n\n\t\t\t\t} else if ( cullFace === CullFaceFront ) {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT_AND_BACK );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.CULL_FACE );\n\n\t\t}\n\n\t\tcurrentCullFace = cullFace;\n\n\t}\n\n\tfunction setLineWidth( width ) {\n\n\t\tif ( width !== currentLineWidth ) {\n\n\t\t\tif ( lineWidthAvailable ) gl.lineWidth( width );\n\n\t\t\tcurrentLineWidth = width;\n\n\t\t}\n\n\t}\n\n\tfunction setPolygonOffset( polygonOffset, factor, units ) {\n\n\t\tif ( polygonOffset ) {\n\n\t\t\tenable( gl.POLYGON_OFFSET_FILL );\n\n\t\t\tif ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) {\n\n\t\t\t\tgl.polygonOffset( factor, units );\n\n\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\tcurrentPolygonOffsetUnits = units;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.POLYGON_OFFSET_FILL );\n\n\t\t}\n\n\t}\n\n\tfunction setScissorTest( scissorTest ) {\n\n\t\tif ( scissorTest ) {\n\n\t\t\tenable( gl.SCISSOR_TEST );\n\n\t\t} else {\n\n\t\t\tdisable( gl.SCISSOR_TEST );\n\n\t\t}\n\n\t}\n\n\t// texture\n\n\tfunction activeTexture( webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\tgl.activeTexture( webglSlot );\n\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t}\n\n\t}\n\n\tfunction bindTexture( webglType, webglTexture, webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) {\n\n\t\t\tif ( currentTextureSlot === null ) {\n\n\t\t\t\twebglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\t} else {\n\n\t\t\t\twebglSlot = currentTextureSlot;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet boundTexture = currentBoundTextures[ webglSlot ];\n\n\t\tif ( boundTexture === undefined ) {\n\n\t\t\tboundTexture = { type: undefined, texture: undefined };\n\t\t\tcurrentBoundTextures[ webglSlot ] = boundTexture;\n\n\t\t}\n\n\t\tif ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {\n\n\t\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\t\tgl.activeTexture( webglSlot );\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t\t}\n\n\t\t\tgl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );\n\n\t\t\tboundTexture.type = webglType;\n\t\t\tboundTexture.texture = webglTexture;\n\n\t\t}\n\n\t}\n\n\tfunction unbindTexture() {\n\n\t\tconst boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\tif ( boundTexture !== undefined && boundTexture.type !== undefined ) {\n\n\t\t\tgl.bindTexture( boundTexture.type, null );\n\n\t\t\tboundTexture.type = undefined;\n\t\t\tboundTexture.texture = undefined;\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction scissor( scissor ) {\n\n\t\tif ( currentScissor.equals( scissor ) === false ) {\n\n\t\t\tgl.scissor( scissor.x, scissor.y, scissor.z, scissor.w );\n\t\t\tcurrentScissor.copy( scissor );\n\n\t\t}\n\n\t}\n\n\tfunction viewport( viewport ) {\n\n\t\tif ( currentViewport.equals( viewport ) === false ) {\n\n\t\t\tgl.viewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\t\t\tcurrentViewport.copy( viewport );\n\n\t\t}\n\n\t}\n\n\tfunction updateUBOMapping( uniformsGroup, program ) {\n\n\t\tlet mapping = uboProgramMap.get( program );\n\n\t\tif ( mapping === undefined ) {\n\n\t\t\tmapping = new WeakMap();\n\n\t\t\tuboProgramMap.set( program, mapping );\n\n\t\t}\n\n\t\tlet blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( blockIndex === undefined ) {\n\n\t\t\tblockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name );\n\n\t\t\tmapping.set( uniformsGroup, blockIndex );\n\n\t\t}\n\n\t}\n\n\tfunction uniformBlockBinding( uniformsGroup, program ) {\n\n\t\tconst mapping = uboProgramMap.get( program );\n\t\tconst blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( uboBindings.get( program ) !== blockIndex ) {\n\n\t\t\t// bind shader specific block index to global block point\n\t\t\tgl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );\n\n\t\t\tuboBindings.set( program, blockIndex );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction reset() {\n\n\t\t// reset state\n\n\t\tgl.disable( gl.BLEND );\n\t\tgl.disable( gl.CULL_FACE );\n\t\tgl.disable( gl.DEPTH_TEST );\n\t\tgl.disable( gl.POLYGON_OFFSET_FILL );\n\t\tgl.disable( gl.SCISSOR_TEST );\n\t\tgl.disable( gl.STENCIL_TEST );\n\t\tgl.disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\tgl.blendFunc( gl.ONE, gl.ZERO );\n\t\tgl.blendFuncSeparate( gl.ONE, gl.ZERO, gl.ONE, gl.ZERO );\n\t\tgl.blendColor( 0, 0, 0, 0 );\n\n\t\tgl.colorMask( true, true, true, true );\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t\tgl.depthMask( true );\n\t\tgl.depthFunc( gl.LESS );\n\t\tgl.clearDepth( 1 );\n\n\t\tgl.stencilMask( 0xffffffff );\n\t\tgl.stencilFunc( gl.ALWAYS, 0, 0xffffffff );\n\t\tgl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.cullFace( gl.BACK );\n\t\tgl.frontFace( gl.CCW );\n\n\t\tgl.polygonOffset( 0, 0 );\n\n\t\tgl.activeTexture( gl.TEXTURE0 );\n\n\t\tgl.bindFramebuffer( gl.FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.DRAW_FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.READ_FRAMEBUFFER, null );\n\n\t\tgl.useProgram( null );\n\n\t\tgl.lineWidth( 1 );\n\n\t\tgl.scissor( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tgl.viewport( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\t// reset internals\n\n\t\tenabledCapabilities = {};\n\n\t\tcurrentTextureSlot = null;\n\t\tcurrentBoundTextures = {};\n\n\t\tcurrentBoundFramebuffers = {};\n\t\tcurrentDrawbuffers = new WeakMap();\n\t\tdefaultDrawbuffers = [];\n\n\t\tcurrentProgram = null;\n\n\t\tcurrentBlendingEnabled = false;\n\t\tcurrentBlending = null;\n\t\tcurrentBlendEquation = null;\n\t\tcurrentBlendSrc = null;\n\t\tcurrentBlendDst = null;\n\t\tcurrentBlendEquationAlpha = null;\n\t\tcurrentBlendSrcAlpha = null;\n\t\tcurrentBlendDstAlpha = null;\n\t\tcurrentBlendColor = new Color( 0, 0, 0 );\n\t\tcurrentBlendAlpha = 0;\n\t\tcurrentPremultipledAlpha = false;\n\n\t\tcurrentFlipSided = null;\n\t\tcurrentCullFace = null;\n\n\t\tcurrentLineWidth = null;\n\n\t\tcurrentPolygonOffsetFactor = null;\n\t\tcurrentPolygonOffsetUnits = null;\n\n\t\tcurrentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tcurrentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\tcolorBuffer.reset();\n\t\tdepthBuffer.reset();\n\t\tstencilBuffer.reset();\n\n\t}\n\n\treturn {\n\n\t\tbuffers: {\n\t\t\tcolor: colorBuffer,\n\t\t\tdepth: depthBuffer,\n\t\t\tstencil: stencilBuffer\n\t\t},\n\n\t\tenable: enable,\n\t\tdisable: disable,\n\n\t\tbindFramebuffer: bindFramebuffer,\n\t\tdrawBuffers: drawBuffers,\n\n\t\tuseProgram: useProgram,\n\n\t\tsetBlending: setBlending,\n\t\tsetMaterial: setMaterial,\n\n\t\tsetFlipSided: setFlipSided,\n\t\tsetCullFace: setCullFace,\n\n\t\tsetLineWidth: setLineWidth,\n\t\tsetPolygonOffset: setPolygonOffset,\n\n\t\tsetScissorTest: setScissorTest,\n\n\t\tactiveTexture: activeTexture,\n\t\tbindTexture: bindTexture,\n\t\tunbindTexture: unbindTexture,\n\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\tcompressedTexImage3D: compressedTexImage3D,\n\t\ttexImage2D: texImage2D,\n\t\ttexImage3D: texImage3D,\n\n\t\tupdateUBOMapping: updateUBOMapping,\n\t\tuniformBlockBinding: uniformBlockBinding,\n\n\t\ttexStorage2D: texStorage2D,\n\t\ttexStorage3D: texStorage3D,\n\t\ttexSubImage2D: texSubImage2D,\n\t\ttexSubImage3D: texSubImage3D,\n\t\tcompressedTexSubImage2D: compressedTexSubImage2D,\n\t\tcompressedTexSubImage3D: compressedTexSubImage3D,\n\n\t\tscissor: scissor,\n\t\tviewport: viewport,\n\n\t\treset: reset\n\n\t};\n\n}\n\nfunction WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {\n\n\tconst multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;\n\tconst supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );\n\n\tconst _imageDimensions = new Vector2();\n\tconst _videoTextures = new WeakMap();\n\tlet _canvas;\n\n\tconst _sources = new WeakMap(); // maps WebglTexture objects to instances of Source\n\n\t// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\tlet useOffscreenCanvas = false;\n\n\ttry {\n\n\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\t&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;\n\n\t} catch ( err ) {\n\n\t\t// Ignore any errors\n\n\t}\n\n\tfunction createCanvas( width, height ) {\n\n\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\n\t\treturn useOffscreenCanvas ?\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\tnew OffscreenCanvas( width, height ) : createElementNS( 'canvas' );\n\n\t}\n\n\tfunction resizeImage( image, needsNewCanvas, maxSize ) {\n\n\t\tlet scale = 1;\n\n\t\tconst dimensions = getDimensions( image );\n\n\t\t// handle case if texture exceeds max size\n\n\t\tif ( dimensions.width > maxSize || dimensions.height > maxSize ) {\n\n\t\t\tscale = maxSize / Math.max( dimensions.width, dimensions.height );\n\n\t\t}\n\n\t\t// only perform resize if necessary\n\n\t\tif ( scale < 1 ) {\n\n\t\t\t// only perform resize for certain image types\n\n\t\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||\n\t\t\t\t( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {\n\n\t\t\t\tconst width = Math.floor( scale * dimensions.width );\n\t\t\t\tconst height = Math.floor( scale * dimensions.height );\n\n\t\t\t\tif ( _canvas === undefined ) _canvas = createCanvas( width, height );\n\n\t\t\t\t// cube textures can't reuse the same canvas\n\n\t\t\t\tconst canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas;\n\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );\n\n\t\t\t\treturn canvas;\n\n\t\t\t} else {\n\n\t\t\t\tif ( 'data' in image ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );\n\n\t\t\t\t}\n\n\t\t\t\treturn image;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction textureNeedsGenerateMipmaps( texture ) {\n\n\t\treturn texture.generateMipmaps && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\n\t}\n\n\tfunction generateMipmap( target ) {\n\n\t\t_gl.generateMipmap( target );\n\n\t}\n\n\tfunction getInternalFormat( internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false ) {\n\n\t\tif ( internalFormatName !== null ) {\n\n\t\t\tif ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'' );\n\n\t\t}\n\n\t\tlet internalFormat = glFormat;\n\n\t\tif ( glFormat === _gl.RED ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.R32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.R16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RED_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.R8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.R16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.R32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RG16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RG32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGB ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_INT_5_9_9_9_REV ) internalFormat = _gl.RGB9_E5;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGBA ) {\n\n\t\t\tconst transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( transfer === SRGBTransfer ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = _gl.RGBA4;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = _gl.RGB5_A1;\n\n\t\t}\n\n\t\tif ( internalFormat === _gl.R16F || internalFormat === _gl.R32F ||\n\t\t\tinternalFormat === _gl.RG16F || internalFormat === _gl.RG32F ||\n\t\t\tinternalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F ) {\n\n\t\t\textensions.get( 'EXT_color_buffer_float' );\n\n\t\t}\n\n\t\treturn internalFormat;\n\n\t}\n\n\tfunction getMipLevels( texture, image ) {\n\n\t\tif ( textureNeedsGenerateMipmaps( texture ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) {\n\n\t\t\treturn Math.log2( Math.max( image.width, image.height ) ) + 1;\n\n\t\t} else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) {\n\n\t\t\t// user-defined mipmaps\n\n\t\t\treturn texture.mipmaps.length;\n\n\t\t} else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) {\n\n\t\t\treturn image.mipmaps.length;\n\n\t\t} else {\n\n\t\t\t// texture without mipmaps (only base level)\n\n\t\t\treturn 1;\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tdeallocateTexture( texture );\n\n\t\tif ( texture.isVideoTexture ) {\n\n\t\t\t_videoTextures.delete( texture );\n\n\t\t}\n\n\t}\n\n\tfunction onRenderTargetDispose( event ) {\n\n\t\tconst renderTarget = event.target;\n\n\t\trenderTarget.removeEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tdeallocateRenderTarget( renderTarget );\n\n\t}\n\n\t//\n\n\tfunction deallocateTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( textureProperties.__webglInit === undefined ) return;\n\n\t\t// check if it's necessary to remove the WebGLTexture object\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures ) {\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\t\t\twebglTexture.usedTimes --;\n\n\t\t\t// the WebGLTexture object is not used anymore, remove it\n\n\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\tdeleteTexture( texture );\n\n\t\t\t}\n\n\t\t\t// remove the weak map entry if no WebGLTexture uses the source anymore\n\n\t\t\tif ( Object.keys( webglTextures ).length === 0 ) {\n\n\t\t\t\t_sources.delete( source );\n\n\t\t\t}\n\n\t\t}\n\n\t\tproperties.remove( texture );\n\n\t}\n\n\tfunction deleteTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\t\tdelete webglTextures[ textureProperties.__cacheKey ];\n\n\t\tinfo.memory.textures --;\n\n\t}\n\n\tfunction deallocateRenderTarget( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\trenderTarget.depthTexture.dispose();\n\n\t\t}\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) {\n\n\t\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) {\n\n\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );\n\t\t\tif ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer ) {\n\n\t\t\t\tfor ( let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer[ i ] ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer );\n\n\t\t}\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\tif ( attachmentProperties.__webglTexture ) {\n\n\t\t\t\t_gl.deleteTexture( attachmentProperties.__webglTexture );\n\n\t\t\t\tinfo.memory.textures --;\n\n\t\t\t}\n\n\t\t\tproperties.remove( textures[ i ] );\n\n\t\t}\n\n\t\tproperties.remove( renderTarget );\n\n\t}\n\n\t//\n\n\tlet textureUnits = 0;\n\n\tfunction resetTextureUnits() {\n\n\t\ttextureUnits = 0;\n\n\t}\n\n\tfunction allocateTextureUnit() {\n\n\t\tconst textureUnit = textureUnits;\n\n\t\tif ( textureUnit >= capabilities.maxTextures ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );\n\n\t\t}\n\n\t\ttextureUnits += 1;\n\n\t\treturn textureUnit;\n\n\t}\n\n\tfunction getTextureCacheKey( texture ) {\n\n\t\tconst array = [];\n\n\t\tarray.push( texture.wrapS );\n\t\tarray.push( texture.wrapT );\n\t\tarray.push( texture.wrapR || 0 );\n\t\tarray.push( texture.magFilter );\n\t\tarray.push( texture.minFilter );\n\t\tarray.push( texture.anisotropy );\n\t\tarray.push( texture.internalFormat );\n\t\tarray.push( texture.format );\n\t\tarray.push( texture.type );\n\t\tarray.push( texture.generateMipmaps );\n\t\tarray.push( texture.premultiplyAlpha );\n\t\tarray.push( texture.flipY );\n\t\tarray.push( texture.unpackAlignment );\n\t\tarray.push( texture.colorSpace );\n\n\t\treturn array.join();\n\n\t}\n\n\t//\n\n\tfunction setTexture2D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isVideoTexture ) updateVideoTexture( texture );\n\n\t\tif ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tconst image = texture.image;\n\n\t\t\tif ( image === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' );\n\n\t\t\t} else if ( image.complete === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );\n\n\t\t\t} else {\n\n\t\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture2DArray( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture3D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_3D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTextureCube( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadCubeTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tconst wrappingToGL = {\n\t\t[ RepeatWrapping ]: _gl.REPEAT,\n\t\t[ ClampToEdgeWrapping ]: _gl.CLAMP_TO_EDGE,\n\t\t[ MirroredRepeatWrapping ]: _gl.MIRRORED_REPEAT\n\t};\n\n\tconst filterToGL = {\n\t\t[ NearestFilter ]: _gl.NEAREST,\n\t\t[ NearestMipmapNearestFilter ]: _gl.NEAREST_MIPMAP_NEAREST,\n\t\t[ NearestMipmapLinearFilter ]: _gl.NEAREST_MIPMAP_LINEAR,\n\n\t\t[ LinearFilter ]: _gl.LINEAR,\n\t\t[ LinearMipmapNearestFilter ]: _gl.LINEAR_MIPMAP_NEAREST,\n\t\t[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR\n\t};\n\n\tconst compareToGL = {\n\t\t[ NeverCompare ]: _gl.NEVER,\n\t\t[ AlwaysCompare ]: _gl.ALWAYS,\n\t\t[ LessCompare ]: _gl.LESS,\n\t\t[ LessEqualCompare ]: _gl.LEQUAL,\n\t\t[ EqualCompare ]: _gl.EQUAL,\n\t\t[ GreaterEqualCompare ]: _gl.GEQUAL,\n\t\t[ GreaterCompare ]: _gl.GREATER,\n\t\t[ NotEqualCompare ]: _gl.NOTEQUAL\n\t};\n\n\tfunction setTextureParameters( textureType, texture ) {\n\n\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false &&\n\t\t\t( texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter ||\n\t\t\ttexture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter ) ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[ texture.wrapS ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[ texture.wrapT ] );\n\n\t\tif ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[ texture.wrapR ] );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] );\n\n\t\tif ( texture.compareFunction ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );\n\n\t\t}\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tif ( texture.magFilter === NearestFilter ) return;\n\t\t\tif ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;\n\t\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension\n\n\t\t\tif ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {\n\n\t\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\t\t\t\t_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );\n\t\t\t\tproperties.get( texture ).__currentAnisotropy = texture.anisotropy;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction initTexture( textureProperties, texture ) {\n\n\t\tlet forceUpload = false;\n\n\t\tif ( textureProperties.__webglInit === undefined ) {\n\n\t\t\ttextureProperties.__webglInit = true;\n\n\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t}\n\n\t\t// create Source <-> WebGLTextures mapping if necessary\n\n\t\tconst source = texture.source;\n\t\tlet webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures === undefined ) {\n\n\t\t\twebglTextures = {};\n\t\t\t_sources.set( source, webglTextures );\n\n\t\t}\n\n\t\t// check if there is already a WebGLTexture object for the given texture parameters\n\n\t\tconst textureCacheKey = getTextureCacheKey( texture );\n\n\t\tif ( textureCacheKey !== textureProperties.__cacheKey ) {\n\n\t\t\t// if not, create a new instance of WebGLTexture\n\n\t\t\tif ( webglTextures[ textureCacheKey ] === undefined ) {\n\n\t\t\t\t// create new entry\n\n\t\t\t\twebglTextures[ textureCacheKey ] = {\n\t\t\t\t\ttexture: _gl.createTexture(),\n\t\t\t\t\tusedTimes: 0\n\t\t\t\t};\n\n\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t// when a new instance of WebGLTexture was created, a texture upload is required\n\t\t\t\t// even if the image contents are identical\n\n\t\t\t\tforceUpload = true;\n\n\t\t\t}\n\n\t\t\twebglTextures[ textureCacheKey ].usedTimes ++;\n\n\t\t\t// every time the texture cache key changes, it's necessary to check if an instance of\n\t\t\t// WebGLTexture can be deleted in order to avoid a memory leak.\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\n\t\t\tif ( webglTexture !== undefined ) {\n\n\t\t\t\twebglTextures[ textureProperties.__cacheKey ].usedTimes --;\n\n\t\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\t\tdeleteTexture( texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// store references to cache key and WebGLTexture object\n\n\t\t\ttextureProperties.__cacheKey = textureCacheKey;\n\t\t\ttextureProperties.__webglTexture = webglTextures[ textureCacheKey ].texture;\n\n\t\t}\n\n\t\treturn forceUpload;\n\n\t}\n\n\tfunction uploadTexture( textureProperties, texture, slot ) {\n\n\t\tlet textureType = _gl.TEXTURE_2D;\n\n\t\tif ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY;\n\t\tif ( texture.isData3DTexture ) textureType = _gl.TEXTURE_3D;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( textureType, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tlet image = resizeImage( texture.image, false, capabilities.maxTextureSize );\n\t\t\timage = verifyColorSpace( texture, image );\n\n\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\n\t\t\tconst glType = utils.convert( texture.type );\n\t\t\tlet glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );\n\n\t\t\tsetTextureParameters( textureType, texture );\n\n\t\t\tlet mipmap;\n\t\t\tconst mipmaps = texture.mipmaps;\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tconst levels = getMipLevels( texture, image );\n\n\t\t\tif ( texture.isDepthTexture ) {\n\n\t\t\t\t// populate depth texture with dummy data\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t\tif ( texture.type === FloatType ) {\n\n\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\n\t\t\t\t} else if ( texture.type === UnsignedIntType ) {\n\n\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\n\t\t\t\t} else if ( texture.type === UnsignedInt248Type ) {\n\n\t\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, 1, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataTexture ) {\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isCompressedTexture ) {\n\n\t\t\t\tif ( texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data, 0, 0 );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataArrayTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isFramebufferTexture ) {\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tlet width = image.width, height = image.height;\n\n\t\t\t\t\t\tfor ( let i = 0; i < levels; i ++ ) {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t\t\t\t\twidth >>= 1;\n\t\t\t\t\t\t\theight >>= 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// regular Texture (image, video, canvas)\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tconst dimensions = getDimensions( mipmaps[ 0 ] );\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tconst dimensions = getDimensions( image );\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( textureType );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\tfunction uploadCubeTexture( textureProperties, texture, slot ) {\n\n\t\tif ( texture.image.length !== 6 ) return;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tconst isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture );\n\t\t\tconst isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );\n\n\t\t\tconst cubeImage = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( ! isCompressed && ! isDataTexture ) {\n\n\t\t\t\t\tcubeImage[ i ] = resizeImage( texture.image[ i ], true, capabilities.maxCubemapSize );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tcubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] );\n\n\t\t\t}\n\n\t\t\tconst image = cubeImage[ 0 ],\n\t\t\t\tglFormat = utils.convert( texture.format, texture.colorSpace ),\n\t\t\t\tglType = utils.convert( texture.type ),\n\t\t\t\tglInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tlet levels = getMipLevels( texture, image );\n\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tlet mipmaps;\n\n\t\t\tif ( isCompressed ) {\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tmipmaps = cubeImage[ i ].mipmaps;\n\n\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t// TODO: Uniformly handle mipmap definitions\n\t\t\t\t\t// Normal textures and compressed cube textures define base level + mips with their mipmap array\n\t\t\t\t\t// Uncompressed cube textures use their mipmap array only for mips (no base level)\n\n\t\t\t\t\tif ( mipmaps.length > 0 ) levels ++;\n\n\t\t\t\t\tconst dimensions = getDimensions( cubeImage[ 0 ] );\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tif ( isDataTexture ) {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\t\t\t\t\t\t\tconst mipmapImage = mipmap.image[ i ].image;\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\t// We assume images for cube map have the same size.\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\t// Render targets\n\n\t// Setup storage for target texture and bind it to correct framebuffer\n\tfunction setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) {\n\n\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\tconst glType = utils.convert( texture.type );\n\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( ! renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\tconst width = Math.max( 1, renderTarget.width >> level );\n\t\t\tconst height = Math.max( 1, renderTarget.height >> level );\n\n\t\t\tif ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tstate.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0, getRenderTargetSamples( renderTarget ) );\n\n\t\t} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753\n\n\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level );\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\n\t// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\tfunction setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tlet glInternalFormat = _gl.DEPTH_COMPONENT24;\n\n\t\t\tif ( isMultisample || useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\tif ( isMultisample && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height );\n\n\t\t\t} else if ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t} else {\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\tconst texture = textures[ i ];\n\n\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\tif ( isMultisample && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else if ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t}\n\n\t// Setup resources for a Depth Texture for a FBO (needs an extension)\n\tfunction setupDepthTexture( framebuffer, renderTarget ) {\n\n\t\tconst isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget );\n\t\tif ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' );\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\n\t\t\tthrow new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' );\n\n\t\t}\n\n\t\t// upload an empty depth texture with framebuffer size\n\t\tif ( ! properties.get( renderTarget.depthTexture ).__webglTexture ||\n\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\n\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n\t\tconst webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\n\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Unknown depthTexture format' );\n\n\t\t}\n\n\t}\n\n\t// Setup GL resources for a non-texture depth buffer\n\tfunction setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\t// rebind framebuffer with external textures\n\tfunction rebindTextures( renderTarget, colorTexture, depthTexture ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( colorTexture !== undefined ) {\n\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 );\n\n\t\t}\n\n\t\tif ( depthTexture !== undefined ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\t// Set up GL resources for the render target\n\tfunction setupRenderTarget( renderTarget ) {\n\n\t\tconst texture = renderTarget.texture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\tif ( ! isMultipleRenderTargets ) {\n\n\t\t\tif ( textureProperties.__webglTexture === undefined ) {\n\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tinfo.memory.textures ++;\n\n\t\t}\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = [];\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\t\t\tif ( attachmentProperties.__webglTexture === undefined ) {\n\n\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( ( renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = [];\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tconst texture = textures[ i ];\n\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer[ i ] = _gl.createRenderbuffer();\n\n\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, renderTarget.isXRRenderTarget === true );\n\t\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else if ( isMultipleRenderTargets ) {\n\n\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\tconst attachment = textures[ i ];\n\t\t\t\tconst attachmentProperties = properties.get( attachment );\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_2D, attachment );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( attachment ) ) {\n\n\t\t\t\t\tgenerateMipmap( _gl.TEXTURE_2D );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else {\n\n\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\tif ( renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) {\n\n\t\t\t\tglTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( glTextureType, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( glTextureType, texture );\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 );\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( glTextureType );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\tfunction updateRenderTargetMipmap( renderTarget ) {\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst texture = textures[ i ];\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tconst target = renderTarget.isWebGLCubeRenderTarget ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;\n\t\t\t\tconst webglTexture = properties.get( texture ).__webglTexture;\n\n\t\t\t\tstate.bindTexture( target, webglTexture );\n\t\t\t\tgenerateMipmap( target );\n\t\t\t\tstate.unbindTexture();\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tconst invalidationArrayRead = [];\n\tconst invalidationArrayDraw = [];\n\n\tfunction updateMultisampleRenderTarget( renderTarget ) {\n\n\t\tif ( renderTarget.samples > 0 ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\tconst textures = renderTarget.textures;\n\t\t\t\tconst width = renderTarget.width;\n\t\t\t\tconst height = renderTarget.height;\n\t\t\t\tlet mask = _gl.COLOR_BUFFER_BIT;\n\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\t\t\t// If MRT we need to remove FBO attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, null );\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, null, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTarget.resolveDepthBuffer ) {\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT;\n\n\t\t\t\t\t\t// resolving stencil is slow with a D3D backend. disable it for all transmission render targets (see #27799)\n\n\t\t\t\t\t\tif ( renderTarget.stencilBuffer && renderTarget.resolveStencilBuffer ) mask |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST );\n\n\t\t\t\t\tif ( supportsInvalidateFramebuffer === true ) {\n\n\t\t\t\t\t\tinvalidationArrayRead.length = 0;\n\t\t\t\t\t\tinvalidationArrayDraw.length = 0;\n\n\t\t\t\t\t\tinvalidationArrayRead.push( _gl.COLOR_ATTACHMENT0 + i );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false ) {\n\n\t\t\t\t\t\t\tinvalidationArrayRead.push( depthStyle );\n\t\t\t\t\t\t\tinvalidationArrayDraw.push( depthStyle );\n\n\t\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, invalidationArrayDraw );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArrayRead );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t\t// If MRT since pre-blit we removed the FBO we need to reconstruct the attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t} else {\n\n\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false && supportsInvalidateFramebuffer ) {\n\n\t\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\n\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, [ depthStyle ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction getRenderTargetSamples( renderTarget ) {\n\n\t\treturn Math.min( capabilities.maxSamples, renderTarget.samples );\n\n\t}\n\n\tfunction useMultisampledRTT( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\treturn renderTarget.samples > 0 && extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTargetProperties.__useRenderToTexture !== false;\n\n\t}\n\n\tfunction updateVideoTexture( texture ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\t// Check the last frame we updated the VideoTexture\n\n\t\tif ( _videoTextures.get( texture ) !== frame ) {\n\n\t\t\t_videoTextures.set( texture, frame );\n\t\t\ttexture.update();\n\n\t\t}\n\n\t}\n\n\tfunction verifyColorSpace( texture, image ) {\n\n\t\tconst colorSpace = texture.colorSpace;\n\t\tconst format = texture.format;\n\t\tconst type = texture.type;\n\n\t\tif ( texture.isCompressedTexture === true || texture.isVideoTexture === true ) return image;\n\n\t\tif ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {\n\n\t\t\t// sRGB\n\n\t\t\tif ( ColorManagement.getTransfer( colorSpace ) === SRGBTransfer ) {\n\n\t\t\t\t// in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format\n\n\t\t\t\tif ( format !== RGBAFormat || type !== UnsignedByteType ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.WebGLTextures: Unsupported texture color space:', colorSpace );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction getDimensions( image ) {\n\n\t\tif ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {\n\n\t\t\t// if intrinsic data are not available, fallback to width/height\n\n\t\t\t_imageDimensions.width = image.naturalWidth || image.width;\n\t\t\t_imageDimensions.height = image.naturalHeight || image.height;\n\n\t\t} else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {\n\n\t\t\t_imageDimensions.width = image.displayWidth;\n\t\t\t_imageDimensions.height = image.displayHeight;\n\n\t\t} else {\n\n\t\t\t_imageDimensions.width = image.width;\n\t\t\t_imageDimensions.height = image.height;\n\n\t\t}\n\n\t\treturn _imageDimensions;\n\n\t}\n\n\t//\n\n\tthis.allocateTextureUnit = allocateTextureUnit;\n\tthis.resetTextureUnits = resetTextureUnits;\n\n\tthis.setTexture2D = setTexture2D;\n\tthis.setTexture2DArray = setTexture2DArray;\n\tthis.setTexture3D = setTexture3D;\n\tthis.setTextureCube = setTextureCube;\n\tthis.rebindTextures = rebindTextures;\n\tthis.setupRenderTarget = setupRenderTarget;\n\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\tthis.setupDepthRenderbuffer = setupDepthRenderbuffer;\n\tthis.setupFrameBufferTexture = setupFrameBufferTexture;\n\tthis.useMultisampledRTT = useMultisampledRTT;\n\n}\n\nfunction WebGLUtils( gl, extensions ) {\n\n\tfunction convert( p, colorSpace = NoColorSpace ) {\n\n\t\tlet extension;\n\n\t\tconst transfer = ColorManagement.getTransfer( colorSpace );\n\n\t\tif ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedInt5999Type ) return gl.UNSIGNED_INT_5_9_9_9_REV;\n\n\t\tif ( p === ByteType ) return gl.BYTE;\n\t\tif ( p === ShortType ) return gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return gl.INT;\n\t\tif ( p === UnsignedIntType ) return gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return gl.FLOAT;\n\t\tif ( p === HalfFloatType ) return gl.HALF_FLOAT;\n\n\t\tif ( p === AlphaFormat ) return gl.ALPHA;\n\t\tif ( p === RGBFormat ) return gl.RGB;\n\t\tif ( p === RGBAFormat ) return gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL;\n\n\t\t// WebGL2 formats.\n\n\t\tif ( p === RedFormat ) return gl.RED;\n\t\tif ( p === RedIntegerFormat ) return gl.RED_INTEGER;\n\t\tif ( p === RGFormat ) return gl.RG;\n\t\tif ( p === RGIntegerFormat ) return gl.RG_INTEGER;\n\t\tif ( p === RGBAIntegerFormat ) return gl.RGBA_INTEGER;\n\n\t\t// S3TC\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\tif ( transfer === SRGBTransfer ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// PVRTC\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ETC\n\n\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\tif ( p === RGBA_ETC2_EAC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ASTC\n\n\t\tif ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format ||\n\t\t\tp === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format ||\n\t\t\tp === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format ||\n\t\t\tp === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format ||\n\t\t\tp === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_astc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_ASTC_4x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x12_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// BPTC\n\n\t\tif ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_bptc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n\t\t\t\tif ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;\n\t\t\t\tif ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// RGTC\n\n\t\tif ( p === RED_RGTC1_Format || p === SIGNED_RED_RGTC1_Format || p === RED_GREEN_RGTC2_Format || p === SIGNED_RED_GREEN_RGTC2_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_rgtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return extension.COMPRESSED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === SIGNED_RED_RGTC1_Format ) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT;\n\t\t\t\tif ( p === SIGNED_RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( p === UnsignedInt248Type ) return gl.UNSIGNED_INT_24_8;\n\n\t\t// if \"p\" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats)\n\n\t\treturn ( gl[ p ] !== undefined ) ? gl[ p ] : null;\n\n\t}\n\n\treturn { convert: convert };\n\n}\n\nclass ArrayCamera extends PerspectiveCamera {\n\n\tconstructor( array = [] ) {\n\n\t\tsuper();\n\n\t\tthis.isArrayCamera = true;\n\n\t\tthis.cameras = array;\n\n\t}\n\n}\n\nclass Group extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isGroup = true;\n\n\t\tthis.type = 'Group';\n\n\t}\n\n}\n\nconst _moveEvent = { type: 'move' };\n\nclass WebXRController {\n\n\tconstructor() {\n\n\t\tthis._targetRay = null;\n\t\tthis._grip = null;\n\t\tthis._hand = null;\n\n\t}\n\n\tgetHandSpace() {\n\n\t\tif ( this._hand === null ) {\n\n\t\t\tthis._hand = new Group();\n\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\tthis._hand.visible = false;\n\n\t\t\tthis._hand.joints = {};\n\t\t\tthis._hand.inputState = { pinching: false };\n\n\t\t}\n\n\t\treturn this._hand;\n\n\t}\n\n\tgetTargetRaySpace() {\n\n\t\tif ( this._targetRay === null ) {\n\n\t\t\tthis._targetRay = new Group();\n\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\tthis._targetRay.visible = false;\n\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._targetRay;\n\n\t}\n\n\tgetGripSpace() {\n\n\t\tif ( this._grip === null ) {\n\n\t\t\tthis._grip = new Group();\n\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\tthis._grip.visible = false;\n\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\tthis._grip.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._grip;\n\n\t}\n\n\tdispatchEvent( event ) {\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.dispatchEvent( event );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tconnect( inputSource ) {\n\n\t\tif ( inputSource && inputSource.hand ) {\n\n\t\t\tconst hand = this._hand;\n\n\t\t\tif ( hand ) {\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Initialize hand with joints when connected\n\t\t\t\t\tthis._getHandJoint( hand, inputjoint );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.dispatchEvent( { type: 'connected', data: inputSource } );\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect( inputSource ) {\n\n\t\tthis.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.visible = false;\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.visible = false;\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.visible = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tupdate( inputSource, frame, referenceSpace ) {\n\n\t\tlet inputPose = null;\n\t\tlet gripPose = null;\n\t\tlet handPose = null;\n\n\t\tconst targetRay = this._targetRay;\n\t\tconst grip = this._grip;\n\t\tconst hand = this._hand;\n\n\t\tif ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {\n\n\t\t\tif ( hand && inputSource.hand ) {\n\n\t\t\t\thandPose = true;\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\tconst jointPose = frame.getJointPose( inputjoint, referenceSpace );\n\n\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\tconst joint = this._getHandJoint( hand, inputjoint );\n\n\t\t\t\t\tif ( jointPose !== null ) {\n\n\t\t\t\t\t\tjoint.matrix.fromArray( jointPose.transform.matrix );\n\t\t\t\t\t\tjoint.matrix.decompose( joint.position, joint.rotation, joint.scale );\n\t\t\t\t\t\tjoint.matrixWorldNeedsUpdate = true;\n\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tjoint.visible = jointPose !== null;\n\n\t\t\t\t}\n\n\t\t\t\t// Custom events\n\n\t\t\t\t// Check pinchz\n\t\t\t\tconst indexTip = hand.joints[ 'index-finger-tip' ];\n\t\t\t\tconst thumbTip = hand.joints[ 'thumb-tip' ];\n\t\t\t\tconst distance = indexTip.position.distanceTo( thumbTip.position );\n\n\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\tif ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t} else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( grip !== null && inputSource.gripSpace ) {\n\n\t\t\t\t\tgripPose = frame.getPose( inputSource.gripSpace, referenceSpace );\n\n\t\t\t\t\tif ( gripPose !== null ) {\n\n\t\t\t\t\t\tgrip.matrix.fromArray( gripPose.transform.matrix );\n\t\t\t\t\t\tgrip.matrix.decompose( grip.position, grip.rotation, grip.scale );\n\t\t\t\t\t\tgrip.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\t\tif ( gripPose.linearVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\tgrip.linearVelocity.copy( gripPose.linearVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( gripPose.angularVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\tgrip.angularVelocity.copy( gripPose.angularVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( targetRay !== null ) {\n\n\t\t\t\tinputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );\n\n\t\t\t\t// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it\n\t\t\t\tif ( inputPose === null && gripPose !== null ) {\n\n\t\t\t\t\tinputPose = gripPose;\n\n\t\t\t\t}\n\n\t\t\t\tif ( inputPose !== null ) {\n\n\t\t\t\t\ttargetRay.matrix.fromArray( inputPose.transform.matrix );\n\t\t\t\t\ttargetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );\n\t\t\t\t\ttargetRay.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\tif ( inputPose.linearVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\ttargetRay.linearVelocity.copy( inputPose.linearVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( inputPose.angularVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\ttargetRay.angularVelocity.copy( inputPose.angularVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchEvent( _moveEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t}\n\n\t\tif ( targetRay !== null ) {\n\n\t\t\ttargetRay.visible = ( inputPose !== null );\n\n\t\t}\n\n\t\tif ( grip !== null ) {\n\n\t\t\tgrip.visible = ( gripPose !== null );\n\n\t\t}\n\n\t\tif ( hand !== null ) {\n\n\t\t\thand.visible = ( handPose !== null );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// private method\n\n\t_getHandJoint( hand, inputjoint ) {\n\n\t\tif ( hand.joints[ inputjoint.jointName ] === undefined ) {\n\n\t\t\tconst joint = new Group();\n\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\tjoint.visible = false;\n\t\t\thand.joints[ inputjoint.jointName ] = joint;\n\n\t\t\thand.add( joint );\n\n\t\t}\n\n\t\treturn hand.joints[ inputjoint.jointName ];\n\n\t}\n\n}\n\nconst _occlusion_vertex = `\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}`;\n\nconst _occlusion_fragment = `\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}`;\n\nclass WebXRDepthSensing {\n\n\tconstructor() {\n\n\t\tthis.texture = null;\n\t\tthis.mesh = null;\n\n\t\tthis.depthNear = 0;\n\t\tthis.depthFar = 0;\n\n\t}\n\n\tinit( renderer, depthData, renderState ) {\n\n\t\tif ( this.texture === null ) {\n\n\t\t\tconst texture = new Texture();\n\n\t\t\tconst texProps = renderer.properties.get( texture );\n\t\t\ttexProps.__webglTexture = depthData.texture;\n\n\t\t\tif ( ( depthData.depthNear != renderState.depthNear ) || ( depthData.depthFar != renderState.depthFar ) ) {\n\n\t\t\t\tthis.depthNear = depthData.depthNear;\n\t\t\t\tthis.depthFar = depthData.depthFar;\n\n\t\t\t}\n\n\t\t\tthis.texture = texture;\n\n\t\t}\n\n\t}\n\n\trender( renderer, cameraXR ) {\n\n\t\tif ( this.texture !== null ) {\n\n\t\t\tif ( this.mesh === null ) {\n\n\t\t\t\tconst viewport = cameraXR.cameras[ 0 ].viewport;\n\t\t\t\tconst material = new ShaderMaterial( {\n\t\t\t\t\tvertexShader: _occlusion_vertex,\n\t\t\t\t\tfragmentShader: _occlusion_fragment,\n\t\t\t\t\tuniforms: {\n\t\t\t\t\t\tdepthColor: { value: this.texture },\n\t\t\t\t\t\tdepthWidth: { value: viewport.z },\n\t\t\t\t\t\tdepthHeight: { value: viewport.w }\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tthis.mesh = new Mesh( new PlaneGeometry( 20, 20 ), material );\n\n\t\t\t}\n\n\t\t\trenderer.render( this.mesh, cameraXR );\n\n\t\t}\n\n\t}\n\n\treset() {\n\n\t\tthis.texture = null;\n\t\tthis.mesh = null;\n\n\t}\n\n}\n\nclass WebXRManager extends EventDispatcher {\n\n\tconstructor( renderer, gl ) {\n\n\t\tsuper();\n\n\t\tconst scope = this;\n\n\t\tlet session = null;\n\n\t\tlet framebufferScaleFactor = 1.0;\n\n\t\tlet referenceSpace = null;\n\t\tlet referenceSpaceType = 'local-floor';\n\t\t// Set default foveation to maximum.\n\t\tlet foveation = 1.0;\n\t\tlet customReferenceSpace = null;\n\n\t\tlet pose = null;\n\t\tlet glBinding = null;\n\t\tlet glProjLayer = null;\n\t\tlet glBaseLayer = null;\n\t\tlet xrFrame = null;\n\n\t\tconst depthSensing = new WebXRDepthSensing();\n\t\tconst attributes = gl.getContextAttributes();\n\n\t\tlet initialRenderTarget = null;\n\t\tlet newRenderTarget = null;\n\n\t\tconst controllers = [];\n\t\tconst controllerInputSources = [];\n\n\t\tconst currentSize = new Vector2();\n\t\tlet currentPixelRatio = null;\n\n\t\t//\n\n\t\tconst cameraL = new PerspectiveCamera();\n\t\tcameraL.layers.enable( 1 );\n\t\tcameraL.viewport = new Vector4();\n\n\t\tconst cameraR = new PerspectiveCamera();\n\t\tcameraR.layers.enable( 2 );\n\t\tcameraR.viewport = new Vector4();\n\n\t\tconst cameras = [ cameraL, cameraR ];\n\n\t\tconst cameraXR = new ArrayCamera();\n\t\tcameraXR.layers.enable( 1 );\n\t\tcameraXR.layers.enable( 2 );\n\n\t\tlet _currentDepthNear = null;\n\t\tlet _currentDepthFar = null;\n\n\t\t//\n\n\t\tthis.cameraAutoUpdate = true;\n\t\tthis.enabled = false;\n\n\t\tthis.isPresenting = false;\n\n\t\tthis.getController = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getTargetRaySpace();\n\n\t\t};\n\n\t\tthis.getControllerGrip = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getGripSpace();\n\n\t\t};\n\n\t\tthis.getHand = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getHandSpace();\n\n\t\t};\n\n\t\t//\n\n\t\tfunction onSessionEvent( event ) {\n\n\t\t\tconst controllerIndex = controllerInputSources.indexOf( event.inputSource );\n\n\t\t\tif ( controllerIndex === - 1 ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\tif ( controller !== undefined ) {\n\n\t\t\t\tcontroller.update( event.inputSource, event.frame, customReferenceSpace || referenceSpace );\n\t\t\t\tcontroller.dispatchEvent( { type: event.type, data: event.inputSource } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onSessionEnd() {\n\n\t\t\tsession.removeEventListener( 'select', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectstart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeeze', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezestart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezeend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'end', onSessionEnd );\n\t\t\tsession.removeEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\n\t\t\t\tif ( inputSource === null ) continue;\n\n\t\t\t\tcontrollerInputSources[ i ] = null;\n\n\t\t\t\tcontrollers[ i ].disconnect( inputSource );\n\n\t\t\t}\n\n\t\t\t_currentDepthNear = null;\n\t\t\t_currentDepthFar = null;\n\n\t\t\tdepthSensing.reset();\n\n\t\t\t// restore framebuffer/rendering state\n\n\t\t\trenderer.setRenderTarget( initialRenderTarget );\n\n\t\t\tglBaseLayer = null;\n\t\t\tglProjLayer = null;\n\t\t\tglBinding = null;\n\t\t\tsession = null;\n\t\t\tnewRenderTarget = null;\n\n\t\t\t//\n\n\t\t\tanimation.stop();\n\n\t\t\tscope.isPresenting = false;\n\n\t\t\trenderer.setPixelRatio( currentPixelRatio );\n\t\t\trenderer.setSize( currentSize.width, currentSize.height, false );\n\n\t\t\tscope.dispatchEvent( { type: 'sessionend' } );\n\n\t\t}\n\n\t\tthis.setFramebufferScaleFactor = function ( value ) {\n\n\t\t\tframebufferScaleFactor = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setReferenceSpaceType = function ( value ) {\n\n\t\t\treferenceSpaceType = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getReferenceSpace = function () {\n\n\t\t\treturn customReferenceSpace || referenceSpace;\n\n\t\t};\n\n\t\tthis.setReferenceSpace = function ( space ) {\n\n\t\t\tcustomReferenceSpace = space;\n\n\t\t};\n\n\t\tthis.getBaseLayer = function () {\n\n\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\n\t\t};\n\n\t\tthis.getBinding = function () {\n\n\t\t\treturn glBinding;\n\n\t\t};\n\n\t\tthis.getFrame = function () {\n\n\t\t\treturn xrFrame;\n\n\t\t};\n\n\t\tthis.getSession = function () {\n\n\t\t\treturn session;\n\n\t\t};\n\n\t\tthis.setSession = async function ( value ) {\n\n\t\t\tsession = value;\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\tinitialRenderTarget = renderer.getRenderTarget();\n\n\t\t\t\tsession.addEventListener( 'select', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectstart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeeze', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezestart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezeend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'end', onSessionEnd );\n\t\t\t\tsession.addEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\t\tif ( attributes.xrCompatible !== true ) {\n\n\t\t\t\t\tawait gl.makeXRCompatible();\n\n\t\t\t\t}\n\n\t\t\t\tcurrentPixelRatio = renderer.getPixelRatio();\n\t\t\t\trenderer.getSize( currentSize );\n\n\t\t\t\tif ( session.renderState.layers === undefined ) {\n\n\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\tantialias: attributes.antialias,\n\t\t\t\t\t\talpha: true,\n\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBaseLayer = new XRWebGLLayer( session, gl, layerInit );\n\n\t\t\t\t\tsession.updateRenderState( { baseLayer: glBaseLayer } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglBaseLayer.framebufferWidth,\n\t\t\t\t\t\tglBaseLayer.framebufferHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet depthFormat = null;\n\t\t\t\t\tlet depthType = null;\n\t\t\t\t\tlet glDepthFormat = null;\n\n\t\t\t\t\tif ( attributes.depth ) {\n\n\t\t\t\t\t\tglDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\tdepthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;\n\t\t\t\t\t\tdepthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\tcolorFormat: gl.RGBA8,\n\t\t\t\t\t\tdepthFormat: glDepthFormat,\n\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBinding = new XRWebGLBinding( session, gl );\n\n\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer( projectionlayerInit );\n\n\t\t\t\t\tsession.updateRenderState( { layers: [ glProjLayer ] } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glProjLayer.textureWidth, glProjLayer.textureHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglProjLayer.textureWidth,\n\t\t\t\t\t\tglProjLayer.textureHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tdepthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tsamples: attributes.antialias ? 4 : 0,\n\t\t\t\t\t\t\tresolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false )\n\t\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tnewRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278\n\n\t\t\t\tthis.setFoveation( foveation );\n\n\t\t\t\tcustomReferenceSpace = null;\n\t\t\t\treferenceSpace = await session.requestReferenceSpace( referenceSpaceType );\n\n\t\t\t\tanimation.setContext( session );\n\t\t\t\tanimation.start();\n\n\t\t\t\tscope.isPresenting = true;\n\n\t\t\t\tscope.dispatchEvent( { type: 'sessionstart' } );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getEnvironmentBlendMode = function () {\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\treturn session.environmentBlendMode;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction onInputSourcesChange( event ) {\n\n\t\t\t// Notify disconnected\n\n\t\t\tfor ( let i = 0; i < event.removed.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.removed[ i ];\n\t\t\t\tconst index = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( index >= 0 ) {\n\n\t\t\t\t\tcontrollerInputSources[ index ] = null;\n\t\t\t\t\tcontrollers[ index ].disconnect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Notify connected\n\n\t\t\tfor ( let i = 0; i < event.added.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.added[ i ];\n\n\t\t\t\tlet controllerIndex = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( controllerIndex === - 1 ) {\n\n\t\t\t\t\t// Assign input source a controller that currently has no input source\n\n\t\t\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\t\t\tif ( i >= controllerInputSources.length ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources.push( inputSource );\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t} else if ( controllerInputSources[ i ] === null ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources[ i ] = inputSource;\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// If all controllers do currently receive input we ignore new ones\n\n\t\t\t\t\tif ( controllerIndex === - 1 ) break;\n\n\t\t\t\t}\n\n\t\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\t\tif ( controller ) {\n\n\t\t\t\t\tcontroller.connect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst cameraLPos = new Vector3();\n\t\tconst cameraRPos = new Vector3();\n\n\t\t/**\n\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t * the cameras' projection and world matrices have already been set.\n\t\t * And that near and far planes are identical for both cameras.\n\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t */\n\t\tfunction setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t// although must now be relative to the new union camera.\n\t\t\tconst near2 = near + zOffset;\n\t\t\tconst far2 = far + zOffset;\n\t\t\tconst left2 = left - xOffset;\n\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\n\t\t}\n\n\t\tfunction updateCamera( camera, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrixWorld.copy( camera.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );\n\n\t\t\t}\n\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t}\n\n\t\tthis.updateCamera = function ( camera ) {\n\n\t\t\tif ( session === null ) return;\n\n\t\t\tif ( depthSensing.texture !== null ) {\n\n\t\t\t\tcamera.near = depthSensing.depthNear;\n\t\t\t\tcamera.far = depthSensing.depthFar;\n\n\t\t\t}\n\n\t\t\tcameraXR.near = cameraR.near = cameraL.near = camera.near;\n\t\t\tcameraXR.far = cameraR.far = cameraL.far = camera.far;\n\n\t\t\tif ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {\n\n\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\n\t\t\t\tsession.updateRenderState( {\n\t\t\t\t\tdepthNear: cameraXR.near,\n\t\t\t\t\tdepthFar: cameraXR.far\n\t\t\t\t} );\n\n\t\t\t\t_currentDepthNear = cameraXR.near;\n\t\t\t\t_currentDepthFar = cameraXR.far;\n\n\t\t\t\tcameraL.near = _currentDepthNear;\n\t\t\t\tcameraL.far = _currentDepthFar;\n\t\t\t\tcameraR.near = _currentDepthNear;\n\t\t\t\tcameraR.far = _currentDepthFar;\n\n\t\t\t\tcameraL.updateProjectionMatrix();\n\t\t\t\tcameraR.updateProjectionMatrix();\n\t\t\t\tcamera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\tconst parent = camera.parent;\n\t\t\tconst cameras = cameraXR.cameras;\n\n\t\t\tupdateCamera( cameraXR, parent );\n\n\t\t\tfor ( let i = 0; i < cameras.length; i ++ ) {\n\n\t\t\t\tupdateCamera( cameras[ i ], parent );\n\n\t\t\t}\n\n\t\t\t// update projection matrix for proper view frustum culling\n\n\t\t\tif ( cameras.length === 2 ) {\n\n\t\t\t\tsetProjectionFromUnion( cameraXR, cameraL, cameraR );\n\n\t\t\t} else {\n\n\t\t\t\t// assume single camera setup (AR)\n\n\t\t\t\tcameraXR.projectionMatrix.copy( cameraL.projectionMatrix );\n\n\t\t\t}\n\n\t\t\t// update user camera and its children\n\n\t\t\tupdateUserCamera( camera, cameraXR, parent );\n\n\t\t};\n\n\t\tfunction updateUserCamera( camera, cameraXR, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrix.copy( cameraXR.matrixWorld );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrix.copy( parent.matrixWorld );\n\t\t\t\tcamera.matrix.invert();\n\t\t\t\tcamera.matrix.multiply( cameraXR.matrixWorld );\n\n\t\t\t}\n\n\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.updateMatrixWorld( true );\n\n\t\t\tcamera.projectionMatrix.copy( cameraXR.projectionMatrix );\n\t\t\tcamera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );\n\n\t\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\t\tcamera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );\n\t\t\t\tcamera.zoom = 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.getCamera = function () {\n\n\t\t\treturn cameraXR;\n\n\t\t};\n\n\t\tthis.getFoveation = function () {\n\n\t\t\tif ( glProjLayer === null && glBaseLayer === null ) {\n\n\t\t\t\treturn undefined;\n\n\t\t\t}\n\n\t\t\treturn foveation;\n\n\t\t};\n\n\t\tthis.setFoveation = function ( value ) {\n\n\t\t\t// 0 = no foveation = full resolution\n\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\n\t\t\tfoveation = value;\n\n\t\t\tif ( glProjLayer !== null ) {\n\n\t\t\t\tglProjLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t\tif ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) {\n\n\t\t\t\tglBaseLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.hasDepthSensing = function () {\n\n\t\t\treturn depthSensing.texture !== null;\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time, frame ) {\n\n\t\t\tpose = frame.getViewerPose( customReferenceSpace || referenceSpace );\n\t\t\txrFrame = frame;\n\n\t\t\tif ( pose !== null ) {\n\n\t\t\t\tconst views = pose.views;\n\n\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\trenderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer );\n\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t\tlet cameraXRNeedsUpdate = false;\n\n\t\t\t\t// check if it's necessary to rebuild cameraXR's camera list\n\n\t\t\t\tif ( views.length !== cameraXR.cameras.length ) {\n\n\t\t\t\t\tcameraXR.cameras.length = 0;\n\t\t\t\t\tcameraXRNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < views.length; i ++ ) {\n\n\t\t\t\t\tconst view = views[ i ];\n\n\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\t\tviewport = glBaseLayer.getViewport( view );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage( glProjLayer, view );\n\t\t\t\t\t\tviewport = glSubImage.viewport;\n\n\t\t\t\t\t\t// For side-by-side projection, we only produce a single texture for both eyes.\n\t\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\t\trenderer.setRenderTargetTextures(\n\t\t\t\t\t\t\t\tnewRenderTarget,\n\t\t\t\t\t\t\t\tglSubImage.colorTexture,\n\t\t\t\t\t\t\t\tglProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture );\n\n\t\t\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet camera = cameras[ i ];\n\n\t\t\t\t\tif ( camera === undefined ) {\n\n\t\t\t\t\t\tcamera = new PerspectiveCamera();\n\t\t\t\t\t\tcamera.layers.enable( i );\n\t\t\t\t\t\tcamera.viewport = new Vector4();\n\t\t\t\t\t\tcameras[ i ] = camera;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcamera.matrix.fromArray( view.transform.matrix );\n\t\t\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\t\t\tcamera.projectionMatrix.fromArray( view.projectionMatrix );\n\t\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\t\t\t\t\tcamera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );\n\n\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\tcameraXR.matrix.copy( camera.matrix );\n\t\t\t\t\t\tcameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( cameraXRNeedsUpdate === true ) {\n\n\t\t\t\t\t\tcameraXR.cameras.push( camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tconst enabledFeatures = session.enabledFeatures;\n\n\t\t\t\tif ( enabledFeatures && enabledFeatures.includes( 'depth-sensing' ) ) {\n\n\t\t\t\t\tconst depthData = glBinding.getDepthInformation( views[ 0 ] );\n\n\t\t\t\t\tif ( depthData && depthData.isValid && depthData.texture ) {\n\n\t\t\t\t\t\tdepthSensing.init( renderer, depthData, session.renderState );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\t\t\t\tconst controller = controllers[ i ];\n\n\t\t\t\tif ( inputSource !== null && controller !== undefined ) {\n\n\t\t\t\t\tcontroller.update( inputSource, frame, customReferenceSpace || referenceSpace );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdepthSensing.render( renderer, cameraXR );\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );\n\n\t\t\tif ( frame.detectedPlanes ) {\n\n\t\t\t\tscope.dispatchEvent( { type: 'planesdetected', data: frame } );\n\n\t\t\t}\n\n\t\t\txrFrame = null;\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\n\t\t};\n\n\t\tthis.dispose = function () {};\n\n\t}\n\n}\n\nconst _e1 = /*@__PURE__*/ new Euler();\nconst _m1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLMaterials( renderer, properties ) {\n\n\tfunction refreshTransformUniform( map, uniform ) {\n\n\t\tif ( map.matrixAutoUpdate === true ) {\n\n\t\t\tmap.updateMatrix();\n\n\t\t}\n\n\t\tuniform.value.copy( map.matrix );\n\n\t}\n\n\tfunction refreshFogUniforms( uniforms, fog ) {\n\n\t\tfog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) );\n\n\t\tif ( fog.isFog ) {\n\n\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\tuniforms.fogFar.value = fog.far;\n\n\t\t} else if ( fog.isFogExp2 ) {\n\n\t\t\tuniforms.fogDensity.value = fog.density;\n\n\t\t}\n\n\t}\n\n\tfunction refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) {\n\n\t\tif ( material.isMeshBasicMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshLambertMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshToonMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsToon( uniforms, material );\n\n\t\t} else if ( material.isMeshPhongMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsPhong( uniforms, material );\n\n\t\t} else if ( material.isMeshStandardMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsStandard( uniforms, material );\n\n\t\t\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\t\t\trefreshUniformsPhysical( uniforms, material, transmissionRenderTarget );\n\n\t\t\t}\n\n\t\t} else if ( material.isMeshMatcapMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsMatcap( uniforms, material );\n\n\t\t} else if ( material.isMeshDepthMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshDistanceMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsDistance( uniforms, material );\n\n\t\t} else if ( material.isMeshNormalMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isLineBasicMaterial ) {\n\n\t\t\trefreshUniformsLine( uniforms, material );\n\n\t\t\tif ( material.isLineDashedMaterial ) {\n\n\t\t\t\trefreshUniformsDash( uniforms, material );\n\n\t\t\t}\n\n\t\t} else if ( material.isPointsMaterial ) {\n\n\t\t\trefreshUniformsPoints( uniforms, material, pixelRatio, height );\n\n\t\t} else if ( material.isSpriteMaterial ) {\n\n\t\t\trefreshUniformsSprites( uniforms, material );\n\n\t\t} else if ( material.isShadowMaterial ) {\n\n\t\t\tuniforms.color.value.copy( material.color );\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t} else if ( material.isShaderMaterial ) {\n\n\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsCommon( uniforms, material ) {\n\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.color ) {\n\n\t\t\tuniforms.diffuse.value.copy( material.color );\n\n\t\t}\n\n\t\tif ( material.emissive ) {\n\n\t\t\tuniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );\n\n\t\t}\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\n\t\t\trefreshTransformUniform( material.bumpMap, uniforms.bumpMapTransform );\n\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.bumpScale.value *= - 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\n\t\t\trefreshTransformUniform( material.normalMap, uniforms.normalMapTransform );\n\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.normalScale.value.negate();\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\n\t\t\trefreshTransformUniform( material.displacementMap, uniforms.displacementMapTransform );\n\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\trefreshTransformUniform( material.emissiveMap, uniforms.emissiveMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularMap ) {\n\n\t\t\tuniforms.specularMap.value = material.specularMap;\n\n\t\t\trefreshTransformUniform( material.specularMap, uniforms.specularMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tconst envMap = materialProperties.envMap;\n\t\tconst envMapRotation = materialProperties.envMapRotation;\n\n\t\tif ( envMap ) {\n\n\t\t\tuniforms.envMap.value = envMap;\n\n\t\t\t_e1.copy( envMapRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;\n\n\t\t\tif ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1.y *= - 1;\n\t\t\t\t_e1.z *= - 1;\n\n\t\t\t}\n\n\t\t\tuniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );\n\n\t\t\tuniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\tuniforms.ior.value = material.ior;\n\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t}\n\n\t\tif ( material.lightMap ) {\n\n\t\t\tuniforms.lightMap.value = material.lightMap;\n\n\t\t\t// artist-friendly light intensity scaling factor\n\t\t\tconst scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1;\n\n\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor;\n\n\t\t\trefreshTransformUniform( material.lightMap, uniforms.lightMapTransform );\n\n\t\t}\n\n\t\tif ( material.aoMap ) {\n\n\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\n\t\t\trefreshTransformUniform( material.aoMap, uniforms.aoMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsLine( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDash( uniforms, material ) {\n\n\t\tuniforms.dashSize.value = material.dashSize;\n\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\tuniforms.scale.value = material.scale;\n\n\t}\n\n\tfunction refreshUniformsPoints( uniforms, material, pixelRatio, height ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.size.value = material.size * pixelRatio;\n\t\tuniforms.scale.value = height * 0.5;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.uvTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsSprites( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.rotation.value = material.rotation;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhong( uniforms, material ) {\n\n\t\tuniforms.specular.value.copy( material.specular );\n\t\tuniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )\n\n\t}\n\n\tfunction refreshUniformsToon( uniforms, material ) {\n\n\t\tif ( material.gradientMap ) {\n\n\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsStandard( uniforms, material ) {\n\n\t\tuniforms.metalness.value = material.metalness;\n\n\t\tif ( material.metalnessMap ) {\n\n\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\n\t\t\trefreshTransformUniform( material.metalnessMap, uniforms.metalnessMapTransform );\n\n\t\t}\n\n\t\tuniforms.roughness.value = material.roughness;\n\n\t\tif ( material.roughnessMap ) {\n\n\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\n\t\t\trefreshTransformUniform( material.roughnessMap, uniforms.roughnessMapTransform );\n\n\t\t}\n\n\t\tif ( material.envMap ) {\n\n\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\n\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) {\n\n\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\tif ( material.sheen > 0 ) {\n\n\t\t\tuniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen );\n\n\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\n\t\t\tif ( material.sheenColorMap ) {\n\n\t\t\t\tuniforms.sheenColorMap.value = material.sheenColorMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenColorMap, uniforms.sheenColorMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.sheenRoughnessMap ) {\n\n\t\t\t\tuniforms.sheenRoughnessMap.value = material.sheenRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenRoughnessMap, uniforms.sheenRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.clearcoat > 0 ) {\n\n\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\tif ( material.clearcoatMap ) {\n\n\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatMap, uniforms.clearcoatMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatRoughnessMap ) {\n\n\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatRoughnessMap, uniforms.clearcoatRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatNormalMap ) {\n\n\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatNormalMap, uniforms.clearcoatNormalMapTransform );\n\n\t\t\t\tuniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale );\n\n\t\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.dispersion > 0 ) {\n\n\t\t\tuniforms.dispersion.value = material.dispersion;\n\n\t\t}\n\n\t\tif ( material.iridescence > 0 ) {\n\n\t\t\tuniforms.iridescence.value = material.iridescence;\n\t\t\tuniforms.iridescenceIOR.value = material.iridescenceIOR;\n\t\t\tuniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[ 0 ];\n\t\t\tuniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[ 1 ];\n\n\t\t\tif ( material.iridescenceMap ) {\n\n\t\t\t\tuniforms.iridescenceMap.value = material.iridescenceMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceMap, uniforms.iridescenceMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.iridescenceThicknessMap ) {\n\n\t\t\t\tuniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceThicknessMap, uniforms.iridescenceThicknessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.transmission > 0 ) {\n\n\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\tuniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height );\n\n\t\t\tif ( material.transmissionMap ) {\n\n\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\n\t\t\t\trefreshTransformUniform( material.transmissionMap, uniforms.transmissionMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\tif ( material.thicknessMap ) {\n\n\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.thicknessMap, uniforms.thicknessMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\tuniforms.attenuationColor.value.copy( material.attenuationColor );\n\n\t\t}\n\n\t\tif ( material.anisotropy > 0 ) {\n\n\t\t\tuniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );\n\n\t\t\tif ( material.anisotropyMap ) {\n\n\t\t\t\tuniforms.anisotropyMap.value = material.anisotropyMap;\n\n\t\t\t\trefreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\tuniforms.specularColor.value.copy( material.specularColor );\n\n\t\tif ( material.specularColorMap ) {\n\n\t\t\tuniforms.specularColorMap.value = material.specularColorMap;\n\n\t\t\trefreshTransformUniform( material.specularColorMap, uniforms.specularColorMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularIntensityMap ) {\n\n\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\n\t\t\trefreshTransformUniform( material.specularIntensityMap, uniforms.specularIntensityMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsMatcap( uniforms, material ) {\n\n\t\tif ( material.matcap ) {\n\n\t\t\tuniforms.matcap.value = material.matcap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDistance( uniforms, material ) {\n\n\t\tconst light = properties.get( material ).light;\n\n\t\tuniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );\n\t\tuniforms.nearDistance.value = light.shadow.camera.near;\n\t\tuniforms.farDistance.value = light.shadow.camera.far;\n\n\t}\n\n\treturn {\n\t\trefreshFogUniforms: refreshFogUniforms,\n\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t};\n\n}\n\nfunction WebGLUniformsGroups( gl, info, capabilities, state ) {\n\n\tlet buffers = {};\n\tlet updateList = {};\n\tlet allocatedBindingPoints = [];\n\n\tconst maxBindingPoints = gl.getParameter( gl.MAX_UNIFORM_BUFFER_BINDINGS ); // binding points are global whereas block indices are per shader program\n\n\tfunction bind( uniformsGroup, program ) {\n\n\t\tconst webglProgram = program.program;\n\t\tstate.uniformBlockBinding( uniformsGroup, webglProgram );\n\n\t}\n\n\tfunction update( uniformsGroup, program ) {\n\n\t\tlet buffer = buffers[ uniformsGroup.id ];\n\n\t\tif ( buffer === undefined ) {\n\n\t\t\tprepareUniformsGroup( uniformsGroup );\n\n\t\t\tbuffer = createBuffer( uniformsGroup );\n\t\t\tbuffers[ uniformsGroup.id ] = buffer;\n\n\t\t\tuniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\t}\n\n\t\t// ensure to update the binding points/block indices mapping for this program\n\n\t\tconst webglProgram = program.program;\n\t\tstate.updateUBOMapping( uniformsGroup, webglProgram );\n\n\t\t// update UBO once per frame\n\n\t\tconst frame = info.render.frame;\n\n\t\tif ( updateList[ uniformsGroup.id ] !== frame ) {\n\n\t\t\tupdateBufferData( uniformsGroup );\n\n\t\t\tupdateList[ uniformsGroup.id ] = frame;\n\n\t\t}\n\n\t}\n\n\tfunction createBuffer( uniformsGroup ) {\n\n\t\t// the setup of an UBO is independent of a particular shader program but global\n\n\t\tconst bindingPointIndex = allocateBindingPointIndex();\n\t\tuniformsGroup.__bindingPointIndex = bindingPointIndex;\n\n\t\tconst buffer = gl.createBuffer();\n\t\tconst size = uniformsGroup.__size;\n\t\tconst usage = uniformsGroup.usage;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\t\tgl.bufferData( gl.UNIFORM_BUFFER, size, usage );\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\t\tgl.bindBufferBase( gl.UNIFORM_BUFFER, bindingPointIndex, buffer );\n\n\t\treturn buffer;\n\n\t}\n\n\tfunction allocateBindingPointIndex() {\n\n\t\tfor ( let i = 0; i < maxBindingPoints; i ++ ) {\n\n\t\t\tif ( allocatedBindingPoints.indexOf( i ) === - 1 ) {\n\n\t\t\t\tallocatedBindingPoints.push( i );\n\t\t\t\treturn i;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconsole.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );\n\n\t\treturn 0;\n\n\t}\n\n\tfunction updateBufferData( uniformsGroup ) {\n\n\t\tconst buffer = buffers[ uniformsGroup.id ];\n\t\tconst uniforms = uniformsGroup.uniforms;\n\t\tconst cache = uniformsGroup.__cache;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\n\t\tfor ( let i = 0, il = uniforms.length; i < il; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tif ( hasUniformChanged( uniform, i, j, cache ) === true ) {\n\n\t\t\t\t\tconst offset = uniform.__offset;\n\n\t\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\t\tlet arrayOffset = 0;\n\n\t\t\t\t\tfor ( let k = 0; k < values.length; k ++ ) {\n\n\t\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\t\t// TODO add integer and struct support\n\t\t\t\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value;\n\t\t\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset + arrayOffset, uniform.__data );\n\n\t\t\t\t\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t\t\t\t\t// manually converting 3x3 to 3x4\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value.elements[ 0 ];\n\t\t\t\t\t\t\tuniform.__data[ 1 ] = value.elements[ 1 ];\n\t\t\t\t\t\t\tuniform.__data[ 2 ] = value.elements[ 2 ];\n\t\t\t\t\t\t\tuniform.__data[ 3 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 4 ] = value.elements[ 3 ];\n\t\t\t\t\t\t\tuniform.__data[ 5 ] = value.elements[ 4 ];\n\t\t\t\t\t\t\tuniform.__data[ 6 ] = value.elements[ 5 ];\n\t\t\t\t\t\t\tuniform.__data[ 7 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 8 ] = value.elements[ 6 ];\n\t\t\t\t\t\t\tuniform.__data[ 9 ] = value.elements[ 7 ];\n\t\t\t\t\t\t\tuniform.__data[ 10 ] = value.elements[ 8 ];\n\t\t\t\t\t\t\tuniform.__data[ 11 ] = 0;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvalue.toArray( uniform.__data, arrayOffset );\n\n\t\t\t\t\t\t\tarrayOffset += info.storage / Float32Array.BYTES_PER_ELEMENT;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset, uniform.__data );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\n\t}\n\n\tfunction hasUniformChanged( uniform, index, indexArray, cache ) {\n\n\t\tconst value = uniform.value;\n\t\tconst indexString = index + '_' + indexArray;\n\n\t\tif ( cache[ indexString ] === undefined ) {\n\n\t\t\t// cache entry does not exist so far\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tcache[ indexString ] = value;\n\n\t\t\t} else {\n\n\t\t\t\tcache[ indexString ] = value.clone();\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\tconst cachedObject = cache[ indexString ];\n\n\t\t\t// compare current value with cached entry\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tif ( cachedObject !== value ) {\n\n\t\t\t\t\tcache[ indexString ] = value;\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( cachedObject.equals( value ) === false ) {\n\n\t\t\t\t\tcachedObject.copy( value );\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction prepareUniformsGroup( uniformsGroup ) {\n\n\t\t// determine total buffer size according to the STD140 layout\n\t\t// Hint: STD140 is the only supported layout in WebGL 2\n\n\t\tconst uniforms = uniformsGroup.uniforms;\n\n\t\tlet offset = 0; // global buffer offset in bytes\n\t\tconst chunkSize = 16; // size of a chunk in bytes\n\n\t\tfor ( let i = 0, l = uniforms.length; i < l; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\tfor ( let k = 0, kl = values.length; k < kl; k ++ ) {\n\n\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\t// Calculate the chunk offset\n\t\t\t\t\tconst chunkOffsetUniform = offset % chunkSize;\n\n\t\t\t\t\t// Check for chunk overflow\n\t\t\t\t\tif ( chunkOffsetUniform !== 0 && ( chunkSize - chunkOffsetUniform ) < info.boundary ) {\n\n\t\t\t\t\t\t// Add padding and adjust offset\n\t\t\t\t\t\toffset += ( chunkSize - chunkOffsetUniform );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following two properties will be used for partial buffer updates\n\n\t\t\t\t\tuniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );\n\t\t\t\t\tuniform.__offset = offset;\n\n\n\t\t\t\t\t// Update the global offset\n\t\t\t\t\toffset += info.storage;\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ensure correct final padding\n\n\t\tconst chunkOffset = offset % chunkSize;\n\n\t\tif ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset );\n\n\t\t//\n\n\t\tuniformsGroup.__size = offset;\n\t\tuniformsGroup.__cache = {};\n\n\t\treturn this;\n\n\t}\n\n\tfunction getUniformSize( value ) {\n\n\t\tconst info = {\n\t\t\tboundary: 0, // bytes\n\t\t\tstorage: 0 // bytes\n\t\t};\n\n\t\t// determine sizes according to STD140\n\n\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t// float/int/bool\n\n\t\t\tinfo.boundary = 4;\n\t\t\tinfo.storage = 4;\n\n\t\t} else if ( value.isVector2 ) {\n\n\t\t\t// vec2\n\n\t\t\tinfo.boundary = 8;\n\t\t\tinfo.storage = 8;\n\n\t\t} else if ( value.isVector3 || value.isColor ) {\n\n\t\t\t// vec3\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes\n\n\t\t} else if ( value.isVector4 ) {\n\n\t\t\t// vec4\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 16;\n\n\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t// mat3 (in STD140 a 3x3 matrix is represented as 3x4)\n\n\t\t\tinfo.boundary = 48;\n\t\t\tinfo.storage = 48;\n\n\t\t} else if ( value.isMatrix4 ) {\n\n\t\t\t// mat4\n\n\t\t\tinfo.boundary = 64;\n\t\t\tinfo.storage = 64;\n\n\t\t} else if ( value.isTexture ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );\n\n\t\t}\n\n\t\treturn info;\n\n\t}\n\n\tfunction onUniformsGroupsDispose( event ) {\n\n\t\tconst uniformsGroup = event.target;\n\n\t\tuniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\tconst index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex );\n\t\tallocatedBindingPoints.splice( index, 1 );\n\n\t\tgl.deleteBuffer( buffers[ uniformsGroup.id ] );\n\n\t\tdelete buffers[ uniformsGroup.id ];\n\t\tdelete updateList[ uniformsGroup.id ];\n\n\t}\n\n\tfunction dispose() {\n\n\t\tfor ( const id in buffers ) {\n\n\t\t\tgl.deleteBuffer( buffers[ id ] );\n\n\t\t}\n\n\t\tallocatedBindingPoints = [];\n\t\tbuffers = {};\n\t\tupdateList = {};\n\n\t}\n\n\treturn {\n\n\t\tbind: bind,\n\t\tupdate: update,\n\n\t\tdispose: dispose\n\n\t};\n\n}\n\nclass WebGLRenderer {\n\n\tconstructor( parameters = {} ) {\n\n\t\tconst {\n\t\t\tcanvas = createCanvasElement(),\n\t\t\tcontext = null,\n\t\t\tdepth = true,\n\t\t\tstencil = false,\n\t\t\talpha = false,\n\t\t\tantialias = false,\n\t\t\tpremultipliedAlpha = true,\n\t\t\tpreserveDrawingBuffer = false,\n\t\t\tpowerPreference = 'default',\n\t\t\tfailIfMajorPerformanceCaveat = false,\n\t\t} = parameters;\n\n\t\tthis.isWebGLRenderer = true;\n\n\t\tlet _alpha;\n\n\t\tif ( context !== null ) {\n\n\t\t\tif ( typeof WebGLRenderingContext !== 'undefined' && context instanceof WebGLRenderingContext ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLRenderer: WebGL 1 is not supported since r163.' );\n\n\t\t\t}\n\n\t\t\t_alpha = context.getContextAttributes().alpha;\n\n\t\t} else {\n\n\t\t\t_alpha = alpha;\n\n\t\t}\n\n\t\tconst uintClearColor = new Uint32Array( 4 );\n\t\tconst intClearColor = new Int32Array( 4 );\n\n\t\tlet currentRenderList = null;\n\t\tlet currentRenderState = null;\n\n\t\t// render() can be called from within a callback triggered by another render.\n\t\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\t\tconst renderListStack = [];\n\t\tconst renderStateStack = [];\n\n\t\t// public properties\n\n\t\tthis.domElement = canvas;\n\n\t\t// Debug configuration container\n\t\tthis.debug = {\n\n\t\t\t/**\n\t\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tcheckShaderErrors: true,\n\t\t\t/**\n\t\t\t * Callback for custom error reporting.\n\t\t\t * @type {?Function}\n\t\t\t */\n\t\t\tonShaderError: null\n\t\t};\n\n\t\t// clearing\n\n\t\tthis.autoClear = true;\n\t\tthis.autoClearColor = true;\n\t\tthis.autoClearDepth = true;\n\t\tthis.autoClearStencil = true;\n\n\t\t// scene graph\n\n\t\tthis.sortObjects = true;\n\n\t\t// user-defined clipping\n\n\t\tthis.clippingPlanes = [];\n\t\tthis.localClippingEnabled = false;\n\n\t\t// physically based shading\n\n\t\tthis._outputColorSpace = SRGBColorSpace;\n\n\t\t// physical lights\n\n\t\tthis._useLegacyLights = false;\n\n\t\t// tone mapping\n\n\t\tthis.toneMapping = NoToneMapping;\n\t\tthis.toneMappingExposure = 1.0;\n\n\t\t// internal properties\n\n\t\tconst _this = this;\n\n\t\tlet _isContextLost = false;\n\n\t\t// internal state cache\n\n\t\tlet _currentActiveCubeFace = 0;\n\t\tlet _currentActiveMipmapLevel = 0;\n\t\tlet _currentRenderTarget = null;\n\t\tlet _currentMaterialId = - 1;\n\n\t\tlet _currentCamera = null;\n\n\t\tconst _currentViewport = new Vector4();\n\t\tconst _currentScissor = new Vector4();\n\t\tlet _currentScissorTest = null;\n\n\t\tconst _currentClearColor = new Color( 0x000000 );\n\t\tlet _currentClearAlpha = 0;\n\n\t\t//\n\n\t\tlet _width = canvas.width;\n\t\tlet _height = canvas.height;\n\n\t\tlet _pixelRatio = 1;\n\t\tlet _opaqueSort = null;\n\t\tlet _transparentSort = null;\n\n\t\tconst _viewport = new Vector4( 0, 0, _width, _height );\n\t\tconst _scissor = new Vector4( 0, 0, _width, _height );\n\t\tlet _scissorTest = false;\n\n\t\t// frustum\n\n\t\tconst _frustum = new Frustum();\n\n\t\t// clipping\n\n\t\tlet _clippingEnabled = false;\n\t\tlet _localClippingEnabled = false;\n\n\t\t// camera matrices cache\n\n\t\tconst _projScreenMatrix = new Matrix4();\n\n\t\tconst _vector3 = new Vector3();\n\n\t\tconst _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };\n\n\t\tfunction getTargetPixelRatio() {\n\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\n\t\t}\n\n\t\t// initialize\n\n\t\tlet _gl = context;\n\n\t\tfunction getContext( contextName, contextAttributes ) {\n\n\t\t\treturn canvas.getContext( contextName, contextAttributes );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tconst contextAttributes = {\n\t\t\t\talpha: true,\n\t\t\t\tdepth,\n\t\t\t\tstencil,\n\t\t\t\tantialias,\n\t\t\t\tpremultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer,\n\t\t\t\tpowerPreference,\n\t\t\t\tfailIfMajorPerformanceCaveat,\n\t\t\t};\n\n\t\t\t// OffscreenCanvas does not have setAttribute, see #22811\n\t\t\tif ( 'setAttribute' in canvas ) canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );\n\n\t\t\t// event listeners must be registered before WebGL context is created, see #12753\n\t\t\tcanvas.addEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.addEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.addEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\tif ( _gl === null ) {\n\n\t\t\t\tconst contextName = 'webgl2';\n\n\t\t\t\t_gl = getContext( contextName, contextAttributes );\n\n\t\t\t\tif ( _gl === null ) {\n\n\t\t\t\t\tif ( getContext( contextName ) ) {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context with your selected attributes.' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: ' + error.message );\n\t\t\tthrow error;\n\n\t\t}\n\n\t\tlet extensions, capabilities, state, info;\n\t\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\t\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\n\t\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\n\t\tlet utils, bindingStates, uniformsGroups;\n\n\t\tfunction initGLContext() {\n\n\t\t\textensions = new WebGLExtensions( _gl );\n\t\t\textensions.init();\n\n\t\t\tutils = new WebGLUtils( _gl, extensions );\n\n\t\t\tcapabilities = new WebGLCapabilities( _gl, extensions, parameters, utils );\n\n\t\t\tstate = new WebGLState( _gl );\n\n\t\t\tinfo = new WebGLInfo( _gl );\n\t\t\tproperties = new WebGLProperties();\n\t\t\ttextures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );\n\t\t\tcubemaps = new WebGLCubeMaps( _this );\n\t\t\tcubeuvmaps = new WebGLCubeUVMaps( _this );\n\t\t\tattributes = new WebGLAttributes( _gl );\n\t\t\tbindingStates = new WebGLBindingStates( _gl, attributes );\n\t\t\tgeometries = new WebGLGeometries( _gl, attributes, info, bindingStates );\n\t\t\tobjects = new WebGLObjects( _gl, geometries, attributes, info );\n\t\t\tmorphtargets = new WebGLMorphtargets( _gl, capabilities, textures );\n\t\t\tclipping = new WebGLClipping( properties );\n\t\t\tprogramCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping );\n\t\t\tmaterials = new WebGLMaterials( _this, properties );\n\t\t\trenderLists = new WebGLRenderLists();\n\t\t\trenderStates = new WebGLRenderStates( extensions );\n\t\t\tbackground = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );\n\t\t\tshadowMap = new WebGLShadowMap( _this, objects, capabilities );\n\t\t\tuniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );\n\n\t\t\tbufferRenderer = new WebGLBufferRenderer( _gl, extensions, info );\n\t\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info );\n\n\t\t\tinfo.programs = programCache.programs;\n\n\t\t\t_this.capabilities = capabilities;\n\t\t\t_this.extensions = extensions;\n\t\t\t_this.properties = properties;\n\t\t\t_this.renderLists = renderLists;\n\t\t\t_this.shadowMap = shadowMap;\n\t\t\t_this.state = state;\n\t\t\t_this.info = info;\n\n\t\t}\n\n\t\tinitGLContext();\n\n\t\t// xr\n\n\t\tconst xr = new WebXRManager( _this, _gl );\n\n\t\tthis.xr = xr;\n\n\t\t// API\n\n\t\tthis.getContext = function () {\n\n\t\t\treturn _gl;\n\n\t\t};\n\n\t\tthis.getContextAttributes = function () {\n\n\t\t\treturn _gl.getContextAttributes();\n\n\t\t};\n\n\t\tthis.forceContextLoss = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.loseContext();\n\n\t\t};\n\n\t\tthis.forceContextRestore = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.restoreContext();\n\n\t\t};\n\n\t\tthis.getPixelRatio = function () {\n\n\t\t\treturn _pixelRatio;\n\n\t\t};\n\n\t\tthis.setPixelRatio = function ( value ) {\n\n\t\t\tif ( value === undefined ) return;\n\n\t\t\t_pixelRatio = value;\n\n\t\t\tthis.setSize( _width, _height, false );\n\n\t\t};\n\n\t\tthis.getSize = function ( target ) {\n\n\t\t\treturn target.set( _width, _height );\n\n\t\t};\n\n\t\tthis.setSize = function ( width, height, updateStyle = true ) {\n\n\t\t\tif ( xr.isPresenting ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\tcanvas.width = Math.floor( width * _pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * _pixelRatio );\n\n\t\t\tif ( updateStyle === true ) {\n\n\t\t\t\tcanvas.style.width = width + 'px';\n\t\t\t\tcanvas.style.height = height + 'px';\n\n\t\t\t}\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\tthis.getDrawingBufferSize = function ( target ) {\n\n\t\t\treturn target.set( _width * _pixelRatio, _height * _pixelRatio ).floor();\n\n\t\t};\n\n\t\tthis.setDrawingBufferSize = function ( width, height, pixelRatio ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_pixelRatio = pixelRatio;\n\n\t\t\tcanvas.width = Math.floor( width * pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * pixelRatio );\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\tthis.getCurrentViewport = function ( target ) {\n\n\t\t\treturn target.copy( _currentViewport );\n\n\t\t};\n\n\t\tthis.getViewport = function ( target ) {\n\n\t\t\treturn target.copy( _viewport );\n\n\t\t};\n\n\t\tthis.setViewport = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_viewport.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_viewport.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\tthis.getScissor = function ( target ) {\n\n\t\t\treturn target.copy( _scissor );\n\n\t\t};\n\n\t\tthis.setScissor = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_scissor.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_scissor.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\tthis.getScissorTest = function () {\n\n\t\t\treturn _scissorTest;\n\n\t\t};\n\n\t\tthis.setScissorTest = function ( boolean ) {\n\n\t\t\tstate.setScissorTest( _scissorTest = boolean );\n\n\t\t};\n\n\t\tthis.setOpaqueSort = function ( method ) {\n\n\t\t\t_opaqueSort = method;\n\n\t\t};\n\n\t\tthis.setTransparentSort = function ( method ) {\n\n\t\t\t_transparentSort = method;\n\n\t\t};\n\n\t\t// Clearing\n\n\t\tthis.getClearColor = function ( target ) {\n\n\t\t\treturn target.copy( background.getClearColor() );\n\n\t\t};\n\n\t\tthis.setClearColor = function () {\n\n\t\t\tbackground.setClearColor.apply( background, arguments );\n\n\t\t};\n\n\t\tthis.getClearAlpha = function () {\n\n\t\t\treturn background.getClearAlpha();\n\n\t\t};\n\n\t\tthis.setClearAlpha = function () {\n\n\t\t\tbackground.setClearAlpha.apply( background, arguments );\n\n\t\t};\n\n\t\tthis.clear = function ( color = true, depth = true, stencil = true ) {\n\n\t\t\tlet bits = 0;\n\n\t\t\tif ( color ) {\n\n\t\t\t\t// check if we're trying to clear an integer target\n\t\t\t\tlet isIntegerFormat = false;\n\t\t\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t\t\tconst targetFormat = _currentRenderTarget.texture.format;\n\t\t\t\t\tisIntegerFormat = targetFormat === RGBAIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RGIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RedIntegerFormat;\n\n\t\t\t\t}\n\n\t\t\t\t// use the appropriate clear functions to clear the target if it's a signed\n\t\t\t\t// or unsigned integer target\n\t\t\t\tif ( isIntegerFormat ) {\n\n\t\t\t\t\tconst targetType = _currentRenderTarget.texture.type;\n\t\t\t\t\tconst isUnsignedType = targetType === UnsignedByteType ||\n\t\t\t\t\t\ttargetType === UnsignedIntType ||\n\t\t\t\t\t\ttargetType === UnsignedShortType ||\n\t\t\t\t\t\ttargetType === UnsignedInt248Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort4444Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort5551Type;\n\n\t\t\t\t\tconst clearColor = background.getClearColor();\n\t\t\t\t\tconst a = background.getClearAlpha();\n\t\t\t\t\tconst r = clearColor.r;\n\t\t\t\t\tconst g = clearColor.g;\n\t\t\t\t\tconst b = clearColor.b;\n\n\t\t\t\t\tif ( isUnsignedType ) {\n\n\t\t\t\t\t\tuintClearColor[ 0 ] = r;\n\t\t\t\t\t\tuintClearColor[ 1 ] = g;\n\t\t\t\t\t\tuintClearColor[ 2 ] = b;\n\t\t\t\t\t\tuintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tintClearColor[ 0 ] = r;\n\t\t\t\t\t\tintClearColor[ 1 ] = g;\n\t\t\t\t\t\tintClearColor[ 2 ] = b;\n\t\t\t\t\t\tintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbits |= _gl.COLOR_BUFFER_BIT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;\n\t\t\tif ( stencil ) {\n\n\t\t\t\tbits |= _gl.STENCIL_BUFFER_BIT;\n\t\t\t\tthis.state.buffers.stencil.setMask( 0xffffffff );\n\n\t\t\t}\n\n\t\t\t_gl.clear( bits );\n\n\t\t};\n\n\t\tthis.clearColor = function () {\n\n\t\t\tthis.clear( true, false, false );\n\n\t\t};\n\n\t\tthis.clearDepth = function () {\n\n\t\t\tthis.clear( false, true, false );\n\n\t\t};\n\n\t\tthis.clearStencil = function () {\n\n\t\t\tthis.clear( false, false, true );\n\n\t\t};\n\n\t\t//\n\n\t\tthis.dispose = function () {\n\n\t\t\tcanvas.removeEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\trenderLists.dispose();\n\t\t\trenderStates.dispose();\n\t\t\tproperties.dispose();\n\t\t\tcubemaps.dispose();\n\t\t\tcubeuvmaps.dispose();\n\t\t\tobjects.dispose();\n\t\t\tbindingStates.dispose();\n\t\t\tuniformsGroups.dispose();\n\t\t\tprogramCache.dispose();\n\n\t\t\txr.dispose();\n\n\t\t\txr.removeEventListener( 'sessionstart', onXRSessionStart );\n\t\t\txr.removeEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t\tanimation.stop();\n\n\t\t};\n\n\t\t// Events\n\n\t\tfunction onContextLost( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Lost.' );\n\n\t\t\t_isContextLost = true;\n\n\t\t}\n\n\t\tfunction onContextRestore( /* event */ ) {\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Restored.' );\n\n\t\t\t_isContextLost = false;\n\n\t\t\tconst infoAutoReset = info.autoReset;\n\t\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\t\tconst shadowMapType = shadowMap.type;\n\n\t\t\tinitGLContext();\n\n\t\t\tinfo.autoReset = infoAutoReset;\n\t\t\tshadowMap.enabled = shadowMapEnabled;\n\t\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\t\tshadowMap.type = shadowMapType;\n\n\t\t}\n\n\t\tfunction onContextCreationError( event ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );\n\n\t\t}\n\n\t\tfunction onMaterialDispose( event ) {\n\n\t\t\tconst material = event.target;\n\n\t\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t\tdeallocateMaterial( material );\n\n\t\t}\n\n\t\t// Buffer deallocation\n\n\t\tfunction deallocateMaterial( material ) {\n\n\t\t\treleaseMaterialProgramReferences( material );\n\n\t\t\tproperties.remove( material );\n\n\t\t}\n\n\n\t\tfunction releaseMaterialProgramReferences( material ) {\n\n\t\t\tconst programs = properties.get( material ).programs;\n\n\t\t\tif ( programs !== undefined ) {\n\n\t\t\t\tprograms.forEach( function ( program ) {\n\n\t\t\t\t\tprogramCache.releaseProgram( program );\n\n\t\t\t\t} );\n\n\t\t\t\tif ( material.isShaderMaterial ) {\n\n\t\t\t\t\tprogramCache.releaseShaderCache( material );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Buffer rendering\n\n\t\tthis.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) {\n\n\t\t\tif ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\t\tconst frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );\n\n\t\t\tconst program = setProgram( camera, scene, geometry, material, object );\n\n\t\t\tstate.setMaterial( material, frontFaceCW );\n\n\t\t\t//\n\n\t\t\tlet index = geometry.index;\n\t\t\tlet rangeFactor = 1;\n\n\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\tindex = geometries.getWireframeAttribute( geometry );\n\n\t\t\t\tif ( index === undefined ) return;\n\n\t\t\t\trangeFactor = 2;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tconst drawRange = geometry.drawRange;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet drawStart = drawRange.start * rangeFactor;\n\t\t\tlet drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;\n\n\t\t\tif ( group !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, group.start * rangeFactor );\n\t\t\t\tdrawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );\n\n\t\t\t}\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, index.count );\n\n\t\t\t} else if ( position !== undefined && position !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, position.count );\n\n\t\t\t}\n\n\t\t\tconst drawCount = drawEnd - drawStart;\n\n\t\t\tif ( drawCount < 0 || drawCount === Infinity ) return;\n\n\t\t\t//\n\n\t\t\tbindingStates.setup( object, material, program, geometry, index );\n\n\t\t\tlet attribute;\n\t\t\tlet renderer = bufferRenderer;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tattribute = attributes.get( index );\n\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex( attribute );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\t\tstate.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() );\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isLine ) {\n\n\t\t\t\tlet lineWidth = material.linewidth;\n\n\t\t\t\tif ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth( lineWidth * getTargetPixelRatio() );\n\n\t\t\t\tif ( object.isLineSegments ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else if ( object.isLineLoop ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_LOOP );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_STRIP );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isPoints ) {\n\n\t\t\t\trenderer.setMode( _gl.POINTS );\n\n\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tif ( object._multiDrawInstances !== null ) {\n\n\t\t\t\t\trenderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.renderMultiDraw( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isInstancedMesh ) {\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, object.count );\n\n\t\t\t} else if ( geometry.isInstancedBufferGeometry ) {\n\n\t\t\t\tconst maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;\n\t\t\t\tconst instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, instanceCount );\n\n\t\t\t} else {\n\n\t\t\t\trenderer.render( drawStart, drawCount );\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Compile\n\n\t\tfunction prepareMaterial( material, scene, object ) {\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.compile = function ( scene, camera, targetScene = null ) {\n\n\t\t\tif ( targetScene === null ) targetScene = scene;\n\n\t\t\tcurrentRenderState = renderStates.get( targetScene );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t// gather lights from both the target scene and the new object that will be added to the scene.\n\n\t\t\ttargetScene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tif ( scene !== targetScene ) {\n\n\t\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tcurrentRenderState.setupLights( _this._useLegacyLights );\n\n\t\t\t// Only initialize materials in the new scene, not the targetScene.\n\n\t\t\tconst materials = new Set();\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( material ) {\n\n\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\tfor ( let i = 0; i < material.length; i ++ ) {\n\n\t\t\t\t\t\t\tconst material2 = material[ i ];\n\n\t\t\t\t\t\t\tprepareMaterial( material2, targetScene, object );\n\t\t\t\t\t\t\tmaterials.add( material2 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tprepareMaterial( material, targetScene, object );\n\t\t\t\t\t\tmaterials.add( material );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\trenderStateStack.pop();\n\t\t\tcurrentRenderState = null;\n\n\t\t\treturn materials;\n\n\t\t};\n\n\t\t// compileAsync\n\n\t\tthis.compileAsync = function ( scene, camera, targetScene = null ) {\n\n\t\t\tconst materials = this.compile( scene, camera, targetScene );\n\n\t\t\t// Wait for all the materials in the new object to indicate that they're\n\t\t\t// ready to be used before resolving the promise.\n\n\t\t\treturn new Promise( ( resolve ) => {\n\n\t\t\t\tfunction checkMaterialsReady() {\n\n\t\t\t\t\tmaterials.forEach( function ( material ) {\n\n\t\t\t\t\t\tconst materialProperties = properties.get( material );\n\t\t\t\t\t\tconst program = materialProperties.currentProgram;\n\n\t\t\t\t\t\tif ( program.isReady() ) {\n\n\t\t\t\t\t\t\t// remove any programs that report they're ready to use from the list\n\t\t\t\t\t\t\tmaterials.delete( material );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\t// once the list of compiling materials is empty, call the callback\n\n\t\t\t\t\tif ( materials.size === 0 ) {\n\n\t\t\t\t\t\tresolve( scene );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// if some materials are still not ready, wait a bit and check again\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( extensions.get( 'KHR_parallel_shader_compile' ) !== null ) {\n\n\t\t\t\t\t// If we can check the compilation status of the materials without\n\t\t\t\t\t// blocking then do so right away.\n\n\t\t\t\t\tcheckMaterialsReady();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Otherwise start by waiting a bit to give the materials we just\n\t\t\t\t\t// initialized a chance to finish.\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time ) {\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time );\n\n\t\t}\n\n\t\tfunction onXRSessionStart() {\n\n\t\t\tanimation.stop();\n\n\t\t}\n\n\t\tfunction onXRSessionEnd() {\n\n\t\t\tanimation.start();\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tif ( typeof self !== 'undefined' ) animation.setContext( self );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\t\t\txr.setAnimationLoop( callback );\n\n\t\t\t( callback === null ) ? animation.stop() : animation.start();\n\n\t\t};\n\n\t\txr.addEventListener( 'sessionstart', onXRSessionStart );\n\t\txr.addEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t// Rendering\n\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( camera !== undefined && camera.isCamera !== true ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( _isContextLost === true ) return;\n\n\t\t\t// update scene graph\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t\t// update camera matrices and frustum\n\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\t\tif ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );\n\n\t\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\n\t\t\t}\n\n\t\t\t//\n\t\t\tif ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget );\n\n\t\t\tcurrentRenderState = renderStates.get( scene, renderStateStack.length );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\t\t_frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );\n\n\t\t\tcurrentRenderList = renderLists.get( scene, renderListStack.length );\n\t\t\tcurrentRenderList.init();\n\n\t\t\trenderListStack.push( currentRenderList );\n\n\t\t\tprojectObject( scene, camera, 0, _this.sortObjects );\n\n\t\t\tcurrentRenderList.finish();\n\n\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\tcurrentRenderList.sort( _opaqueSort, _transparentSort );\n\n\t\t\t}\n\n\t\t\tconst renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false;\n\t\t\tif ( renderBackground ) {\n\n\t\t\t\tbackground.addToRenderList( currentRenderList, scene );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tthis.info.render.frame ++;\n\n\t\t\tif ( _clippingEnabled === true ) clipping.beginShadows();\n\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tshadowMap.render( shadowsArray, scene, camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.endShadows();\n\n\t\t\t//\n\n\t\t\tif ( this.info.autoReset === true ) this.info.reset();\n\n\t\t\t// render scene\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\n\t\t\tcurrentRenderState.setupLights( _this._useLegacyLights );\n\n\t\t\tif ( camera.isArrayCamera ) {\n\n\t\t\t\tconst cameras = camera.cameras;\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) {\n\n\t\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\t\trenderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderBackground ) background.render( scene );\n\n\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\trenderScene( currentRenderList, scene, camera2, camera2.viewport );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera );\n\n\t\t\t\tif ( renderBackground ) background.render( scene );\n\n\t\t\t\trenderScene( currentRenderList, scene, camera );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\n\t\t\t\ttextures.updateMultisampleRenderTarget( _currentRenderTarget );\n\n\t\t\t\t// Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\t\ttextures.updateRenderTargetMipmap( _currentRenderTarget );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera );\n\n\t\t\t// _gl.finish();\n\n\t\t\tbindingStates.resetDefaultState();\n\t\t\t_currentMaterialId = - 1;\n\t\t\t_currentCamera = null;\n\n\t\t\trenderStateStack.pop();\n\n\t\t\tif ( renderStateStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderState = renderStateStack[ renderStateStack.length - 1 ];\n\n\t\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, currentRenderState.state.camera );\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderState = null;\n\n\t\t\t}\n\n\t\t\trenderListStack.pop();\n\n\t\t\tif ( renderListStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderList = renderListStack[ renderListStack.length - 1 ];\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderList = null;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction projectObject( object, camera, groupOrder, sortObjects ) {\n\n\t\t\tif ( object.visible === false ) return;\n\n\t\t\tconst visible = object.layers.test( camera.layers );\n\n\t\t\tif ( visible ) {\n\n\t\t\t\tif ( object.isGroup ) {\n\n\t\t\t\t\tgroupOrder = object.renderOrder;\n\n\t\t\t\t} else if ( object.isLOD ) {\n\n\t\t\t\t\tif ( object.autoUpdate === true ) object.update( camera );\n\n\t\t\t\t} else if ( object.isLight ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isMesh || object.isLine || object.isPoints ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\t\t\t\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector3.copy( object.boundingSphere.center );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector3.copy( geometry.boundingSphere.center );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_vector3\n\t\t\t\t\t\t\t\t.applyMatrix4( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tprojectObject( children[ i ], camera, groupOrder, sortObjects );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderScene( currentRenderList, scene, camera, viewport ) {\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\t\tconst transparentObjects = currentRenderList.transparent;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\tif ( viewport ) state.viewport( _currentViewport.copy( viewport ) );\n\n\t\t\tif ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera );\n\t\t\tif ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera );\n\t\t\tif ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera );\n\n\t\t\t// Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.buffers.depth.setTest( true );\n\t\t\tstate.buffers.depth.setMask( true );\n\t\t\tstate.buffers.color.setMask( true );\n\n\t\t\tstate.setPolygonOffset( false );\n\n\t\t}\n\n\t\tfunction renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tif ( overrideMaterial !== null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( currentRenderState.state.transmissionRenderTarget[ camera.id ] === undefined ) {\n\n\t\t\t\tcurrentRenderState.state.transmissionRenderTarget[ camera.id ] = new WebGLRenderTarget( 1, 1, {\n\t\t\t\t\tgenerateMipmaps: true,\n\t\t\t\t\ttype: ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) ) ? HalfFloatType : UnsignedByteType,\n\t\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\t\tsamples: 4,\n\t\t\t\t\tstencilBuffer: stencil,\n\t\t\t\t\tresolveDepthBuffer: false,\n\t\t\t\t\tresolveStencilBuffer: false\n\t\t\t\t} );\n\n\t\t\t\t// debug\n\n\t\t\t\t/*\n\t\t\t\tconst geometry = new PlaneGeometry();\n\t\t\t\tconst material = new MeshBasicMaterial( { map: _transmissionRenderTarget.texture } );\n\n\t\t\t\tconst mesh = new Mesh( geometry, material );\n\t\t\t\tscene.add( mesh );\n\t\t\t\t*/\n\n\t\t\t}\n\n\t\t\tconst transmissionRenderTarget = currentRenderState.state.transmissionRenderTarget[ camera.id ];\n\n\t\t\tconst activeViewport = camera.viewport || _currentViewport;\n\t\t\ttransmissionRenderTarget.setSize( activeViewport.z, activeViewport.w );\n\n\t\t\t//\n\n\t\t\tconst currentRenderTarget = _this.getRenderTarget();\n\t\t\t_this.setRenderTarget( transmissionRenderTarget );\n\n\t\t\t_this.getClearColor( _currentClearColor );\n\t\t\t_currentClearAlpha = _this.getClearAlpha();\n\t\t\tif ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );\n\n\t\t\t_this.clear();\n\n\t\t\t// Turn off the features which can affect the frag color for opaque objects pass.\n\t\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\t\t\tconst currentToneMapping = _this.toneMapping;\n\t\t\t_this.toneMapping = NoToneMapping;\n\n\t\t\t// Remove viewport from camera to avoid nested render calls resetting viewport to it (e.g Reflector).\n\t\t\t// Transmission render pass requires viewport to match the transmissionRenderTarget.\n\t\t\tconst currentCameraViewport = camera.viewport;\n\t\t\tif ( camera.viewport !== undefined ) camera.viewport = undefined;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\trenderObjects( opaqueObjects, scene, camera );\n\n\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\tif ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === false ) { // see #28131\n\n\t\t\t\tlet renderTargetNeedsUpdate = false;\n\n\t\t\t\tfor ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst renderItem = transmissiveObjects[ i ];\n\n\t\t\t\t\tconst object = renderItem.object;\n\t\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\t\tconst material = renderItem.material;\n\t\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\t\tif ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tconst currentSide = material.side;\n\n\t\t\t\t\t\tmaterial.side = BackSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t\t\tmaterial.side = currentSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderTargetNeedsUpdate = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetNeedsUpdate === true ) {\n\n\t\t\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_this.setRenderTarget( currentRenderTarget );\n\n\t\t\t_this.setClearColor( _currentClearColor, _currentClearAlpha );\n\n\t\t\tif ( currentCameraViewport !== undefined ) camera.viewport = currentCameraViewport;\n\n\t\t\t_this.toneMapping = currentToneMapping;\n\n\t\t}\n\n\t\tfunction renderObjects( renderList, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tfor ( let i = 0, l = renderList.length; i < l; i ++ ) {\n\n\t\t\t\tconst renderItem = renderList[ i ];\n\n\t\t\t\tconst object = renderItem.object;\n\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\tconst material = overrideMaterial === null ? renderItem.material : overrideMaterial;\n\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\tif ( object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera, geometry, material, group ) {\n\n\t\t\tobject.onBeforeRender( _this, scene, camera, geometry, material, group );\n\n\t\t\tobject.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\t\tobject.normalMatrix.getNormalMatrix( object.modelViewMatrix );\n\n\t\t\tmaterial.onBeforeRender( _this, scene, camera, geometry, object, group );\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t}\n\n\t\t\tobject.onAfterRender( _this, scene, camera, geometry, material, group );\n\n\t\t}\n\n\t\tfunction getProgram( material, scene, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tconst lights = currentRenderState.state.lights;\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tconst lightsStateVersion = lights.state.version;\n\n\t\t\tconst parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object );\n\t\t\tconst programCacheKey = programCache.getProgramCacheKey( parameters );\n\n\t\t\tlet programs = materialProperties.programs;\n\n\t\t\t// always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tmaterialProperties.fog = scene.fog;\n\t\t\tmaterialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );\n\t\t\tmaterialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;\n\n\t\t\tif ( programs === undefined ) {\n\n\t\t\t\t// new material\n\n\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\tprograms = new Map();\n\t\t\t\tmaterialProperties.programs = programs;\n\n\t\t\t}\n\n\t\t\tlet program = programs.get( programCacheKey );\n\n\t\t\tif ( program !== undefined ) {\n\n\t\t\t\t// early out if program and light state is identical\n\n\t\t\t\tif ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) {\n\n\t\t\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t\t\treturn program;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tparameters.uniforms = programCache.getUniforms( material );\n\n\t\t\t\tmaterial.onBuild( object, parameters, _this );\n\n\t\t\t\tmaterial.onBeforeCompile( parameters, _this );\n\n\t\t\t\tprogram = programCache.acquireProgram( parameters, programCacheKey );\n\t\t\t\tprograms.set( programCacheKey, program );\n\n\t\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\n\t\t\t}\n\n\t\t\tconst uniforms = materialProperties.uniforms;\n\n\t\t\tif ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) {\n\n\t\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\n\t\t\t}\n\n\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t// store the light setup it was created for\n\n\t\t\tmaterialProperties.needsLights = materialNeedsLights( material );\n\t\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t// wire up the material to this renderer's lighting state\n\n\t\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\n\t\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\t\tuniforms.spotLightMatrix.value = lights.state.spotLightMatrix;\n\t\t\t\tuniforms.spotLightMap.value = lights.state.spotLightMap;\n\t\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;\n\t\t\t\t// TODO (abelnation): add area lights shadow info to uniforms\n\n\t\t\t}\n\n\t\t\tmaterialProperties.currentProgram = program;\n\t\t\tmaterialProperties.uniformsList = null;\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\tfunction getUniformList( materialProperties ) {\n\n\t\t\tif ( materialProperties.uniformsList === null ) {\n\n\t\t\t\tconst progUniforms = materialProperties.currentProgram.getUniforms();\n\t\t\t\tmaterialProperties.uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, materialProperties.uniforms );\n\n\t\t\t}\n\n\t\t\treturn materialProperties.uniformsList;\n\n\t\t}\n\n\t\tfunction updateCommonMaterialProperties( material, parameters ) {\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tmaterialProperties.outputColorSpace = parameters.outputColorSpace;\n\t\t\tmaterialProperties.batching = parameters.batching;\n\t\t\tmaterialProperties.instancing = parameters.instancing;\n\t\t\tmaterialProperties.instancingColor = parameters.instancingColor;\n\t\t\tmaterialProperties.instancingMorph = parameters.instancingMorph;\n\t\t\tmaterialProperties.skinning = parameters.skinning;\n\t\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\t\tmaterialProperties.morphColors = parameters.morphColors;\n\t\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\t\tmaterialProperties.toneMapping = parameters.toneMapping;\n\n\t\t}\n\n\t\tfunction setProgram( camera, scene, geometry, material, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\ttextures.resetTextureUnits();\n\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );\n\t\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\t\tconst vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\t\tconst vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );\n\t\t\tconst morphTargets = !! geometry.morphAttributes.position;\n\t\t\tconst morphNormals = !! geometry.morphAttributes.normal;\n\t\t\tconst morphColors = !! geometry.morphAttributes.color;\n\n\t\t\tlet toneMapping = NoToneMapping;\n\n\t\t\tif ( material.toneMapped ) {\n\n\t\t\t\tif ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\t\ttoneMapping = _this.toneMapping;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\t\tconst materialProperties = properties.get( material );\n\t\t\tconst lights = currentRenderState.state.lights;\n\n\t\t\tif ( _clippingEnabled === true ) {\n\n\t\t\t\tif ( _localClippingEnabled === true || camera !== _currentCamera ) {\n\n\t\t\t\t\tconst useCache =\n\t\t\t\t\t\tcamera === _currentCamera &&\n\t\t\t\t\t\tmaterial.id === _currentMaterialId;\n\n\t\t\t\t\t// we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\t\t\t\t\tclipping.setState( material, camera, useCache );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet needsProgramChange = false;\n\n\t\t\tif ( material.version === materialProperties.__version ) {\n\n\t\t\t\tif ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.outputColorSpace !== colorSpace ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batching === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isBatchedMesh && materialProperties.batching === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancing === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isSkinnedMesh && materialProperties.skinning === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.envMap !== envMap ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( material.fog === true && materialProperties.fog !== fog ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.numClippingPlanes !== undefined &&\n\t\t\t\t\t( materialProperties.numClippingPlanes !== clipping.numPlanes ||\n\t\t\t\t\tmaterialProperties.numIntersection !== clipping.numIntersection ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexAlphas !== vertexAlphas ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexTangents !== vertexTangents ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargets !== morphTargets ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphNormals !== morphNormals ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphColors !== morphColors ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.toneMapping !== toneMapping ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargetsCount !== morphTargetsCount ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tneedsProgramChange = true;\n\t\t\t\tmaterialProperties.__version = material.version;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet program = materialProperties.currentProgram;\n\n\t\t\tif ( needsProgramChange === true ) {\n\n\t\t\t\tprogram = getProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t\tlet refreshProgram = false;\n\t\t\tlet refreshMaterial = false;\n\t\t\tlet refreshLights = false;\n\n\t\t\tconst p_uniforms = program.getUniforms(),\n\t\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\t\tif ( state.useProgram( program.program ) ) {\n\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\n\t\t\t}\n\n\t\t\tif ( material.id !== _currentMaterialId ) {\n\n\t\t\t\t_currentMaterialId = material.id;\n\n\t\t\t\trefreshMaterial = true;\n\n\t\t\t}\n\n\t\t\tif ( refreshProgram || _currentCamera !== camera ) {\n\n\t\t\t\t// common camera uniforms\n\n\t\t\t\tp_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );\n\t\t\t\tp_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );\n\n\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\tif ( uCamPos !== undefined ) {\n\n\t\t\t\t\tuCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( capabilities.logarithmicDepthBuffer ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'logDepthBufFC',\n\t\t\t\t\t\t2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );\n\n\t\t\t\t}\n\n\t\t\t\t// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067\n\n\t\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\t\tmaterial.isMeshLambertMaterial ||\n\t\t\t\t\tmaterial.isMeshBasicMaterial ||\n\t\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\t\tmaterial.isShaderMaterial ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true );\n\n\t\t\t\t}\n\n\t\t\t\tif ( _currentCamera !== camera ) {\n\n\t\t\t\t\t_currentCamera = camera;\n\n\t\t\t\t\t// lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true;\t\t// set to true on material change\n\t\t\t\t\trefreshLights = true;\t\t// remains set until update done\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// skinning and morph target uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrix' );\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );\n\n\t\t\t\tconst skeleton = object.skeleton;\n\n\t\t\t\tif ( skeleton ) {\n\n\t\t\t\t\tif ( skeleton.boneTexture === null ) skeleton.computeBoneTexture();\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingTexture' );\n\t\t\t\tp_uniforms.setValue( _gl, 'batchingTexture', object._matricesTexture, textures );\n\n\t\t\t}\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\t\tif ( morphAttributes.position !== undefined || morphAttributes.normal !== undefined || ( morphAttributes.color !== undefined ) ) {\n\n\t\t\t\tmorphtargets.update( object, geometry, program );\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {\n\n\t\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\t\tp_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow );\n\n\t\t\t}\n\n\t\t\t// https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512\n\n\t\t\tif ( material.isMeshGouraudMaterial && material.envMap !== null ) {\n\n\t\t\t\tm_uniforms.envMap.value = envMap;\n\n\t\t\t\tm_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\t}\n\n\t\t\tif ( material.isMeshStandardMaterial && material.envMap === null && scene.environment !== null ) {\n\n\t\t\t\tm_uniforms.envMapIntensity.value = scene.environmentIntensity;\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );\n\n\t\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t\t// the current material requires lighting info\n\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate( m_uniforms, refreshLights );\n\n\t\t\t\t}\n\n\t\t\t\t// refresh uniforms common to several materials\n\n\t\t\t\tif ( fog && material.fog === true ) {\n\n\t\t\t\t\tmaterials.refreshFogUniforms( m_uniforms, fog );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[ camera.id ] );\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\n\t\t\t}\n\n\t\t\tif ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) {\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\t\t\t\tmaterial.uniformsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( material.isSpriteMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'center', object.center );\n\n\t\t\t}\n\n\t\t\t// common matrices\n\n\t\t\tp_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );\n\n\t\t\t// UBOs\n\n\t\t\tif ( material.isShaderMaterial || material.isRawShaderMaterial ) {\n\n\t\t\t\tconst groups = material.uniformsGroups;\n\n\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\t\tuniformsGroups.update( group, program );\n\t\t\t\t\tuniformsGroups.bind( group, program );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\t// If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\t\tfunction markUniformsLightsNeedsUpdate( uniforms, value ) {\n\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\t\tuniforms.lightProbe.needsUpdate = value;\n\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\n\t\t}\n\n\t\tfunction materialNeedsLights( material ) {\n\n\t\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial || material.isShadowMaterial ||\n\t\t\t\t( material.isShaderMaterial && material.lights === true );\n\n\t\t}\n\n\t\tthis.getActiveCubeFace = function () {\n\n\t\t\treturn _currentActiveCubeFace;\n\n\t\t};\n\n\t\tthis.getActiveMipmapLevel = function () {\n\n\t\t\treturn _currentActiveMipmapLevel;\n\n\t\t};\n\n\t\tthis.getRenderTarget = function () {\n\n\t\t\treturn _currentRenderTarget;\n\n\t\t};\n\n\t\tthis.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) {\n\n\t\t\tproperties.get( renderTarget.texture ).__webglTexture = colorTexture;\n\t\t\tproperties.get( renderTarget.depthTexture ).__webglTexture = depthTexture;\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\trenderTargetProperties.__hasExternalTextures = true;\n\n\t\t\trenderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;\n\n\t\t\tif ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\t\t// The multisample_render_to_texture extension doesn't work properly if there\n\t\t\t\t// are midframe flushes and an external depth buffer. Disable use of the extension.\n\t\t\t\tif ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' );\n\t\t\t\t\trenderTargetProperties.__useRenderToTexture = false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\trenderTargetProperties.__webglFramebuffer = defaultFramebuffer;\n\t\t\trenderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;\n\n\t\t};\n\n\t\tthis.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {\n\n\t\t\t_currentRenderTarget = renderTarget;\n\t\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\n\t\t\tlet useDefaultFramebuffer = true;\n\t\t\tlet framebuffer = null;\n\t\t\tlet isCube = false;\n\t\t\tlet isRenderTarget3D = false;\n\n\t\t\tif ( renderTarget ) {\n\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\t\tif ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) {\n\n\t\t\t\t\t// We need to make sure to rebind the framebuffer.\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\t\t\t\t\tuseDefaultFramebuffer = false;\n\n\t\t\t\t} else if ( renderTargetProperties.__webglFramebuffer === undefined ) {\n\n\t\t\t\t\ttextures.setupRenderTarget( renderTarget );\n\n\t\t\t\t} else if ( renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\t\t\t// Color and depth texture must be rebound in order for the swapchain to update.\n\t\t\t\t\ttextures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture );\n\n\t\t\t\t}\n\n\t\t\t\tconst texture = renderTarget.texture;\n\n\t\t\t\tif ( texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tisRenderTarget3D = true;\n\n\t\t\t\t}\n\n\t\t\t\tconst __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tisCube = true;\n\n\t\t\t\t} else if ( ( renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\tframebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_currentViewport.copy( renderTarget.viewport );\n\t\t\t\t_currentScissor.copy( renderTarget.scissor );\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\n\t\t\t} else {\n\n\t\t\t\t_currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissorTest = _scissorTest;\n\n\t\t\t}\n\n\t\t\tconst framebufferBound = state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\tif ( framebufferBound && useDefaultFramebuffer ) {\n\n\t\t\t\tstate.drawBuffers( renderTarget, framebuffer );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport );\n\t\t\tstate.scissor( _currentScissor );\n\t\t\tstate.setScissorTest( _currentScissorTest );\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel );\n\n\t\t\t} else if ( isRenderTarget3D ) {\n\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\tconst layer = activeCubeFace || 0;\n\t\t\t\t_gl.framebufferTextureLayer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer );\n\n\t\t\t}\n\n\t\t\t_currentMaterialId = - 1; // reset current material to ensure correct uniform bindings\n\n\t\t};\n\n\t\tthis.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) {\n\n\t\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t\t}\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\ttry {\n\n\t\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif ( ! capabilities.textureFormatReadable( textureFormat ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! capabilities.textureTypeReadable( textureType ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\n\t\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\t// restore framebuffer of current render target if necessary\n\n\t\t\t\t\tconst framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.copyFramebufferToTexture = function ( position, texture, level = 0 ) {\n\n\t\t\tconst levelScale = Math.pow( 2, - level );\n\t\t\tconst width = Math.floor( texture.image.width * levelScale );\n\t\t\tconst height = Math.floor( texture.image.height * levelScale );\n\n\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t_gl.copyTexSubImage2D( _gl.TEXTURE_2D, level, 0, 0, position.x, position.y, width, height );\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) {\n\n\t\t\tconst width = srcTexture.image.width;\n\t\t\tconst height = srcTexture.image.height;\n\t\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\t\tconst glType = utils.convert( dstTexture.type );\n\n\t\t\ttextures.setTexture2D( dstTexture, 0 );\n\n\t\t\t// As another texture upload may have changed pixelStorei\n\t\t\t// parameters, make sure they are correct for the dstTexture\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );\n\n\t\t\tif ( srcTexture.isDataTexture ) {\n\n\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );\n\n\t\t\t} else {\n\n\t\t\t\tif ( srcTexture.isCompressedTexture ) {\n\n\t\t\t\t\t_gl.compressedTexSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, srcTexture.mipmaps[ 0 ].width, srcTexture.mipmaps[ 0 ].height, glFormat, srcTexture.mipmaps[ 0 ].data );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, glFormat, glType, srcTexture.image );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Generate mipmaps only when copying level 0\n\t\t\tif ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) {\n\n\t\t\tconst width = sourceBox.max.x - sourceBox.min.x;\n\t\t\tconst height = sourceBox.max.y - sourceBox.min.y;\n\t\t\tconst depth = sourceBox.max.z - sourceBox.min.z;\n\t\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\t\tconst glType = utils.convert( dstTexture.type );\n\t\t\tlet glTarget;\n\n\t\t\tif ( dstTexture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_3D;\n\n\t\t\t} else if ( dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );\n\n\t\t\tconst unpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH );\n\t\t\tconst unpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT );\n\t\t\tconst unpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );\n\t\t\tconst unpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );\n\t\t\tconst unpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );\n\n\t\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, sourceBox.min.x );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, sourceBox.min.y );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, sourceBox.min.z );\n\n\t\t\tif ( srcTexture.isDataTexture || srcTexture.isData3DTexture ) {\n\n\t\t\t\t_gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data );\n\n\t\t\t} else {\n\n\t\t\t\tif ( dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\t\t_gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, unpackRowLen );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, unpackSkipPixels );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, unpackSkipRows );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, unpackSkipImages );\n\n\t\t\t// Generate mipmaps only when copying level 0\n\t\t\tif ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( glTarget );\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.initTexture = function ( texture ) {\n\n\t\t\tif ( texture.isCubeTexture ) {\n\n\t\t\t\ttextures.setTextureCube( texture, 0 );\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( texture, 0 );\n\n\t\t\t} else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( texture, 0 );\n\n\t\t\t} else {\n\n\t\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.resetState = function () {\n\n\t\t\t_currentActiveCubeFace = 0;\n\t\t\t_currentActiveMipmapLevel = 0;\n\t\t\t_currentRenderTarget = null;\n\n\t\t\tstate.reset();\n\t\t\tbindingStates.reset();\n\n\t\t};\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tget coordinateSystem() {\n\n\t\treturn WebGLCoordinateSystem;\n\n\t}\n\n\tget outputColorSpace() {\n\n\t\treturn this._outputColorSpace;\n\n\t}\n\n\tset outputColorSpace( colorSpace ) {\n\n\t\tthis._outputColorSpace = colorSpace;\n\n\t\tconst gl = this.getContext();\n\t\tgl.drawingBufferColorSpace = colorSpace === DisplayP3ColorSpace ? 'display-p3' : 'srgb';\n\t\tgl.unpackColorSpace = ColorManagement.workingColorSpace === LinearDisplayP3ColorSpace ? 'display-p3' : 'srgb';\n\n\t}\n\n\tget useLegacyLights() { // @deprecated, r155\n\n\t\tconsole.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );\n\t\treturn this._useLegacyLights;\n\n\t}\n\n\tset useLegacyLights( value ) { // @deprecated, r155\n\n\t\tconsole.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );\n\t\tthis._useLegacyLights = value;\n\n\t}\n\n}\n\nclass FogExp2 {\n\n\tconstructor( color, density = 0.00025 ) {\n\n\t\tthis.isFogExp2 = true;\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\t\tthis.density = density;\n\n\t}\n\n\tclone() {\n\n\t\treturn new FogExp2( this.color, this.density );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t}\n\n}\n\nclass Fog {\n\n\tconstructor( color, near = 1, far = 1000 ) {\n\n\t\tthis.isFog = true;\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Fog( this.color, this.near, this.far );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t}\n\n}\n\nclass Scene extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isScene = true;\n\n\t\tthis.type = 'Scene';\n\n\t\tthis.background = null;\n\t\tthis.environment = null;\n\t\tthis.fog = null;\n\n\t\tthis.backgroundBlurriness = 0;\n\t\tthis.backgroundIntensity = 1;\n\t\tthis.backgroundRotation = new Euler();\n\n\t\tthis.environmentIntensity = 1;\n\t\tthis.environmentRotation = new Euler();\n\n\t\tthis.overrideMaterial = null;\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.environment !== null ) this.environment = source.environment.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\n\t\tthis.backgroundBlurriness = source.backgroundBlurriness;\n\t\tthis.backgroundIntensity = source.backgroundIntensity;\n\t\tthis.backgroundRotation.copy( source.backgroundRotation );\n\n\t\tthis.environmentIntensity = source.environmentIntensity;\n\t\tthis.environmentRotation.copy( source.environmentRotation );\n\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\tif ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;\n\t\tif ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;\n\t\tdata.object.backgroundRotation = this.backgroundRotation.toArray();\n\n\t\tif ( this.environmentIntensity !== 1 ) data.object.environmentIntensity = this.environmentIntensity;\n\t\tdata.object.environmentRotation = this.environmentRotation.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass InterleavedBuffer {\n\n\tconstructor( array, stride ) {\n\n\t\tthis.isInterleavedBuffer = true;\n\n\t\tthis.array = array;\n\t\tthis.stride = stride;\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis._updateRange = { offset: 0, count: - 1 };\n\t\tthis.updateRanges = [];\n\n\t\tthis.version = 0;\n\n\t\tthis.uuid = generateUUID();\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tget updateRange() {\n\n\t\twarnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159\n\t\treturn this._updateRange;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.count = source.count;\n\t\tthis.stride = source.stride;\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.stride;\n\t\tindex2 *= attribute.stride;\n\n\t\tfor ( let i = 0, l = this.stride; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;\n\n\t\t}\n\n\t\tconst array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );\n\n\t\tconst ib = new this.constructor( array, this.stride );\n\t\tib.setUsage( this.usage );\n\n\t\treturn ib;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\t// generate UUID for array buffer if necessary\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );\n\n\t\t}\n\n\t\t//\n\n\t\treturn {\n\t\t\tuuid: this.uuid,\n\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tstride: this.stride\n\t\t};\n\n\t}\n\n}\n\nconst _vector$6 = /*@__PURE__*/ new Vector3();\n\nclass InterleavedBufferAttribute {\n\n\tconstructor( interleavedBuffer, itemSize, offset, normalized = false ) {\n\n\t\tthis.isInterleavedBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.data = interleavedBuffer;\n\t\tthis.itemSize = itemSize;\n\t\tthis.offset = offset;\n\n\t\tthis.normalized = normalized;\n\n\t}\n\n\tget count() {\n\n\t\treturn this.data.count;\n\n\t}\n\n\tget array() {\n\n\t\treturn this.data.array;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tthis.data.needsUpdate = value;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.data.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.data.stride + this.offset + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = this.data.array[ index * this.data.stride + this.offset ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\t\tthis.data.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized );\n\n\t\t} else {\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.clone( data );\n\n\t\t\t}\n\n\t\t\treturn new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized );\n\n\t\t}\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// de-interleave data and save it as an ordinary buffer attribute for now\n\n\t\t\treturn {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: array,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t} else {\n\n\t\t\t// save as true interleaved attribute\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data );\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\tdata: this.data.uuid,\n\t\t\t\toffset: this.offset,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t}\n\n\t}\n\n}\n\nclass SpriteMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isSpriteMaterial = true;\n\n\t\tthis.type = 'SpriteMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.rotation = 0;\n\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.transparent = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _geometry;\n\nconst _intersectPoint = /*@__PURE__*/ new Vector3();\nconst _worldScale = /*@__PURE__*/ new Vector3();\nconst _mvPosition = /*@__PURE__*/ new Vector3();\n\nconst _alignedPosition = /*@__PURE__*/ new Vector2();\nconst _rotatedPosition = /*@__PURE__*/ new Vector2();\nconst _viewWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _uvA = /*@__PURE__*/ new Vector2();\nconst _uvB = /*@__PURE__*/ new Vector2();\nconst _uvC = /*@__PURE__*/ new Vector2();\n\nclass Sprite extends Object3D {\n\n\tconstructor( material = new SpriteMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isSprite = true;\n\n\t\tthis.type = 'Sprite';\n\n\t\tif ( _geometry === undefined ) {\n\n\t\t\t_geometry = new BufferGeometry();\n\n\t\t\tconst float32Array = new Float32Array( [\n\t\t\t\t- 0.5, - 0.5, 0, 0, 0,\n\t\t\t\t0.5, - 0.5, 0, 1, 0,\n\t\t\t\t0.5, 0.5, 0, 1, 1,\n\t\t\t\t- 0.5, 0.5, 0, 0, 1\n\t\t\t] );\n\n\t\t\tconst interleavedBuffer = new InterleavedBuffer( float32Array, 5 );\n\n\t\t\t_geometry.setIndex( [ 0, 1, 2,\t0, 2, 3 ] );\n\t\t\t_geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );\n\t\t\t_geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );\n\n\t\t}\n\n\t\tthis.geometry = _geometry;\n\t\tthis.material = material;\n\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tif ( raycaster.camera === null ) {\n\n\t\t\tconsole.error( 'THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.' );\n\n\t\t}\n\n\t\t_worldScale.setFromMatrixScale( this.matrixWorld );\n\n\t\t_viewWorldMatrix.copy( raycaster.camera.matrixWorld );\n\t\tthis.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );\n\n\t\t_mvPosition.setFromMatrixPosition( this.modelViewMatrix );\n\n\t\tif ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {\n\n\t\t\t_worldScale.multiplyScalar( - _mvPosition.z );\n\n\t\t}\n\n\t\tconst rotation = this.material.rotation;\n\t\tlet sin, cos;\n\n\t\tif ( rotation !== 0 ) {\n\n\t\t\tcos = Math.cos( rotation );\n\t\t\tsin = Math.sin( rotation );\n\n\t\t}\n\n\t\tconst center = this.center;\n\n\t\ttransformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\n\t\t_uvA.set( 0, 0 );\n\t\t_uvB.set( 1, 0 );\n\t\t_uvC.set( 1, 1 );\n\n\t\t// check first triangle\n\t\tlet intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint );\n\n\t\tif ( intersect === null ) {\n\n\t\t\t// check second triangle\n\t\t\ttransformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\t\t_uvB.set( 0, 1 );\n\n\t\t\tintersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint );\n\t\t\tif ( intersect === null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( _intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectPoint.clone(),\n\t\t\tuv: Triangle.getInterpolation( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ),\n\t\t\tface: null,\n\t\t\tobject: this\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.center !== undefined ) this.center.copy( source.center );\n\n\t\tthis.material = source.material;\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {\n\n\t// compute position in camera space\n\t_alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale );\n\n\t// to check if rotation is not zero\n\tif ( sin !== undefined ) {\n\n\t\t_rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y );\n\t\t_rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y );\n\n\t} else {\n\n\t\t_rotatedPosition.copy( _alignedPosition );\n\n\t}\n\n\n\tvertexPosition.copy( mvPosition );\n\tvertexPosition.x += _rotatedPosition.x;\n\tvertexPosition.y += _rotatedPosition.y;\n\n\t// transform to world space\n\tvertexPosition.applyMatrix4( _viewWorldMatrix );\n\n}\n\nconst _v1$2 = /*@__PURE__*/ new Vector3();\nconst _v2$1 = /*@__PURE__*/ new Vector3();\n\nclass LOD extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis._currentLevel = 0;\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tisLOD: {\n\t\t\t\tvalue: true,\n\t\t\t}\n\t\t} );\n\n\t\tthis.autoUpdate = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tconst levels = source.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tthis.addLevel( level.object.clone(), level.distance, level.hysteresis );\n\n\t\t}\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\taddLevel( object, distance = 0, hysteresis = 0 ) {\n\n\t\tdistance = Math.abs( distance );\n\n\t\tconst levels = this.levels;\n\n\t\tlet l;\n\n\t\tfor ( l = 0; l < levels.length; l ++ ) {\n\n\t\t\tif ( distance < levels[ l ].distance ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlevels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } );\n\n\t\tthis.add( object );\n\n\t\treturn this;\n\n\t}\n\n\tgetCurrentLevel() {\n\n\t\treturn this._currentLevel;\n\n\t}\n\n\n\n\tgetObjectForDistance( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance < levelDistance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo( _v1$2 );\n\n\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t}\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 1 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t_v2$1.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom;\n\n\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance >= levelDistance ) {\n\n\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._currentLevel = i - 1;\n\n\t\t\tfor ( ; i < l; i ++ ) {\n\n\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.autoUpdate === false ) data.object.autoUpdate = false;\n\n\t\tdata.object.levels = [];\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tdata.object.levels.push( {\n\t\t\t\tobject: level.object.uuid,\n\t\t\t\tdistance: level.distance,\n\t\t\t\thysteresis: level.hysteresis\n\t\t\t} );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _basePosition = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\n\nconst _vector3 = /*@__PURE__*/ new Vector3();\nconst _matrix4 = /*@__PURE__*/ new Matrix4();\nconst _vertex = /*@__PURE__*/ new Vector3();\n\nconst _sphere$4 = /*@__PURE__*/ new Sphere();\nconst _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _ray$2 = /*@__PURE__*/ new Ray();\n\nclass SkinnedMesh extends Mesh {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isSkinnedMesh = true;\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\tthis.bindMode = AttachedBindMode;\n\t\tthis.bindMatrix = new Matrix4();\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingBox.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingSphere.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.bindMode = source.bindMode;\n\t\tthis.bindMatrix.copy( source.bindMatrix );\n\t\tthis.bindMatrixInverse.copy( source.bindMatrixInverse );\n\n\t\tthis.skeleton = source.skeleton;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$4.copy( this.boundingSphere );\n\t\t_sphere$4.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;\n\n\t\t// convert ray to local space of skinned mesh\n\n\t\t_inverseMatrix$2.copy( matrixWorld ).invert();\n\t\t_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tif ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$2 );\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tsuper.getVertexPosition( index, target );\n\n\t\tthis.applyBoneTransform( index, target );\n\n\t\treturn target;\n\n\t}\n\n\tbind( skeleton, bindMatrix ) {\n\n\t\tthis.skeleton = skeleton;\n\n\t\tif ( bindMatrix === undefined ) {\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t}\n\n\t\tthis.bindMatrix.copy( bindMatrix );\n\t\tthis.bindMatrixInverse.copy( bindMatrix ).invert();\n\n\t}\n\n\tpose() {\n\n\t\tthis.skeleton.pose();\n\n\t}\n\n\tnormalizeSkinWeights() {\n\n\t\tconst vector = new Vector4();\n\n\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\tfor ( let i = 0, l = skinWeight.count; i < l; i ++ ) {\n\n\t\t\tvector.fromBufferAttribute( skinWeight, i );\n\n\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\tvector.multiplyScalar( scale );\n\n\t\t\t} else {\n\n\t\t\t\tvector.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t}\n\n\t\t\tskinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w );\n\n\t\t}\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.bindMode === AttachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.matrixWorld ).invert();\n\n\t\t} else if ( this.bindMode === DetachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.bindMatrix ).invert();\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );\n\n\t\t}\n\n\t}\n\n\tapplyBoneTransform( index, vector ) {\n\n\t\tconst skeleton = this.skeleton;\n\t\tconst geometry = this.geometry;\n\n\t\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t\t_basePosition.copy( vector ).applyMatrix4( this.bindMatrix );\n\n\t\tvector.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\t\tif ( weight !== 0 ) {\n\n\t\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\n\t\t\t\t_matrix4.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] );\n\n\t\t\t\tvector.addScaledVector( _vector3.copy( _basePosition ).applyMatrix4( _matrix4 ), weight );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn vector.applyMatrix4( this.bindMatrixInverse );\n\n\t}\n\n}\n\nclass Bone extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isBone = true;\n\n\t\tthis.type = 'Bone';\n\n\t}\n\n}\n\nclass DataTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isDataTexture = true;\n\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nconst _offsetMatrix = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix$1 = /*@__PURE__*/ new Matrix4();\n\nclass Skeleton {\n\n\tconstructor( bones = [], boneInverses = [] ) {\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.bones = bones.slice( 0 );\n\t\tthis.boneInverses = boneInverses;\n\t\tthis.boneMatrices = null;\n\n\t\tthis.boneTexture = null;\n\n\t\tthis.init();\n\n\t}\n\n\tinit() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tthis.boneMatrices = new Float32Array( bones.length * 16 );\n\n\t\t// calculate inverse bone matrices if necessary\n\n\t\tif ( boneInverses.length === 0 ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\t// handle special case\n\n\t\t\tif ( bones.length !== boneInverses.length ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcalculateInverses() {\n\n\t\tthis.boneInverses.length = 0;\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst inverse = new Matrix4();\n\n\t\t\tif ( this.bones[ i ] ) {\n\n\t\t\t\tinverse.copy( this.bones[ i ].matrixWorld ).invert();\n\n\t\t\t}\n\n\t\t\tthis.boneInverses.push( inverse );\n\n\t\t}\n\n\t}\n\n\tpose() {\n\n\t\t// recover the bind-time world matrices\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tbone.matrixWorld.copy( this.boneInverses[ i ] ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute the local matrices, positions, rotations and scales\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\t\tconst boneMatrices = this.boneMatrices;\n\t\tconst boneTexture = this.boneTexture;\n\n\t\t// flatten bone matrices to array\n\n\t\tfor ( let i = 0, il = bones.length; i < il; i ++ ) {\n\n\t\t\t// compute the offset between the current and the original transform\n\n\t\t\tconst matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix$1;\n\n\t\t\t_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );\n\t\t\t_offsetMatrix.toArray( boneMatrices, i * 16 );\n\n\t\t}\n\n\t\tif ( boneTexture !== null ) {\n\n\t\t\tboneTexture.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new Skeleton( this.bones, this.boneInverses );\n\n\t}\n\n\tcomputeBoneTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n\t\t// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n\t\t// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n\t\t// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tboneMatrices.set( this.boneMatrices ); // copy current values\n\n\t\tconst boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType );\n\t\tboneTexture.needsUpdate = true;\n\n\t\tthis.boneMatrices = boneMatrices;\n\t\tthis.boneTexture = boneTexture;\n\n\t\treturn this;\n\n\t}\n\n\tgetBoneByName( name ) {\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone.name === name ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tdispose( ) {\n\n\t\tif ( this.boneTexture !== null ) {\n\n\t\t\tthis.boneTexture.dispose();\n\n\t\t\tthis.boneTexture = null;\n\n\t\t}\n\n\t}\n\n\tfromJSON( json, bones ) {\n\n\t\tthis.uuid = json.uuid;\n\n\t\tfor ( let i = 0, l = json.bones.length; i < l; i ++ ) {\n\n\t\t\tconst uuid = json.bones[ i ];\n\t\t\tlet bone = bones[ uuid ];\n\n\t\t\tif ( bone === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );\n\t\t\t\tbone = new Bone();\n\n\t\t\t}\n\n\t\t\tthis.bones.push( bone );\n\t\t\tthis.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) );\n\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Skeleton',\n\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t},\n\t\t\tbones: [],\n\t\t\tboneInverses: []\n\t\t};\n\n\t\tdata.uuid = this.uuid;\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tfor ( let i = 0, l = bones.length; i < l; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\t\t\tdata.bones.push( bone.uuid );\n\n\t\t\tconst boneInverse = boneInverses[ i ];\n\t\t\tdata.boneInverses.push( boneInverse.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass InstancedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, itemSize, normalized );\n\n\t\tthis.isInstancedBufferAttribute = true;\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\n\t\tdata.isInstancedBufferAttribute = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _instanceLocalMatrix = /*@__PURE__*/ new Matrix4();\nconst _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _instanceIntersects = [];\n\nconst _box3 = /*@__PURE__*/ new Box3();\nconst _identity = /*@__PURE__*/ new Matrix4();\nconst _mesh$1 = /*@__PURE__*/ new Mesh();\nconst _sphere$3 = /*@__PURE__*/ new Sphere();\n\nclass InstancedMesh extends Mesh {\n\n\tconstructor( geometry, material, count ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isInstancedMesh = true;\n\n\t\tthis.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );\n\t\tthis.instanceColor = null;\n\t\tthis.morphTexture = null;\n\n\t\tthis.count = count;\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.setMatrixAt( i, _identity );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\tgeometry.computeBoundingBox();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_box3.copy( geometry.boundingBox ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingBox.union( _box3 );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tif ( geometry.boundingSphere === null ) {\n\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingSphere.union( _sphere$3 );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.instanceMatrix.copy( source.instanceMatrix );\n\n\t\tif ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();\n\t\tif ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();\n\n\t\tthis.count = source.count;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\tgetColorAt( index, color ) {\n\n\t\tcolor.fromArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tgetMatrixAt( index, matrix ) {\n\n\t\tmatrix.fromArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\tgetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tconst len = objectInfluences.length + 1; // All influences + the baseInfluenceSum\n\n\t\tconst dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tobjectInfluences[ i ] = array[ dataIndex + i ];\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst raycastTimes = this.count;\n\n\t\t_mesh$1.geometry = this.geometry;\n\t\t_mesh$1.material = this.material;\n\n\t\tif ( _mesh$1.material === undefined ) return;\n\n\t\t// test with bounding sphere first\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$3.copy( this.boundingSphere );\n\t\t_sphere$3.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;\n\n\t\t// now test each instance\n\n\t\tfor ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {\n\n\t\t\t// calculate the world matrix for each instance\n\n\t\t\tthis.getMatrixAt( instanceId, _instanceLocalMatrix );\n\n\t\t\t_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );\n\n\t\t\t// the mesh represents this single instance\n\n\t\t\t_mesh$1.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t_mesh$1.raycast( raycaster, _instanceIntersects );\n\n\t\t\t// process the result of raycast\n\n\t\t\tfor ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {\n\n\t\t\t\tconst intersect = _instanceIntersects[ i ];\n\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_instanceIntersects.length = 0;\n\n\t\t}\n\n\t}\n\n\tsetColorAt( index, color ) {\n\n\t\tif ( this.instanceColor === null ) {\n\n\t\t\tthis.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ), 3 );\n\n\t\t}\n\n\t\tcolor.toArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tsetMatrixAt( index, matrix ) {\n\n\t\tmatrix.toArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\tsetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst len = objectInfluences.length + 1; // morphBaseInfluence + all influences\n\n\t\tif ( this.morphTexture === null ) {\n\n\t\t\tthis.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );\n\n\t\t}\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tlet morphInfluencesSum = 0;\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t}\n\n\t\tconst morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\tconst dataIndex = len * index;\n\n\t\tarray[ dataIndex ] = morphBaseInfluence;\n\n\t\tarray.set( objectInfluences, dataIndex + 1 );\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\tif ( this.morphTexture !== null ) {\n\n\t\t\tthis.morphTexture.dispose();\n\t\t\tthis.morphTexture = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction sortOpaque( a, b ) {\n\n\treturn a.z - b.z;\n\n}\n\nfunction sortTransparent( a, b ) {\n\n\treturn b.z - a.z;\n\n}\n\nclass MultiDrawRenderList {\n\n\tconstructor() {\n\n\t\tthis.index = 0;\n\t\tthis.pool = [];\n\t\tthis.list = [];\n\n\t}\n\n\tpush( drawRange, z ) {\n\n\t\tconst pool = this.pool;\n\t\tconst list = this.list;\n\t\tif ( this.index >= pool.length ) {\n\n\t\t\tpool.push( {\n\n\t\t\t\tstart: - 1,\n\t\t\t\tcount: - 1,\n\t\t\t\tz: - 1,\n\n\t\t\t} );\n\n\t\t}\n\n\t\tconst item = pool[ this.index ];\n\t\tlist.push( item );\n\t\tthis.index ++;\n\n\t\titem.start = drawRange.start;\n\t\titem.count = drawRange.count;\n\t\titem.z = z;\n\n\t}\n\n\treset() {\n\n\t\tthis.list.length = 0;\n\t\tthis.index = 0;\n\n\t}\n\n}\n\nconst ID_ATTR_NAME = 'batchId';\nconst _matrix$1 = /*@__PURE__*/ new Matrix4();\nconst _invMatrixWorld = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix = /*@__PURE__*/ new Matrix4();\nconst _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _frustum = /*@__PURE__*/ new Frustum();\nconst _box$1 = /*@__PURE__*/ new Box3();\nconst _sphere$2 = /*@__PURE__*/ new Sphere();\nconst _vector$5 = /*@__PURE__*/ new Vector3();\nconst _renderList = /*@__PURE__*/ new MultiDrawRenderList();\nconst _mesh = /*@__PURE__*/ new Mesh();\nconst _batchIntersects = [];\n\n// @TODO: SkinnedMesh support?\n// @TODO: geometry.groups support?\n// @TODO: geometry.drawRange support?\n// @TODO: geometry.morphAttributes support?\n// @TODO: Support uniform parameter per geometry\n// @TODO: Add an \"optimize\" function to pack geometry and remove data gaps\n\n// copies data from attribute \"src\" into \"target\" starting at \"targetOffset\"\nfunction copyAttributeData( src, target, targetOffset = 0 ) {\n\n\tconst itemSize = target.itemSize;\n\tif ( src.isInterleavedBufferAttribute || src.array.constructor !== target.array.constructor ) {\n\n\t\t// use the component getters and setters if the array data cannot\n\t\t// be copied directly\n\t\tconst vertexCount = src.count;\n\t\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\ttarget.setComponent( i + targetOffset, c, src.getComponent( i, c ) );\n\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\n\t\t// faster copy approach using typed array set function\n\t\ttarget.array.set( src.array, targetOffset * itemSize );\n\n\t}\n\n\ttarget.needsUpdate = true;\n\n}\n\nclass BatchedMesh extends Mesh {\n\n\tget maxGeometryCount() {\n\n\t\treturn this._maxGeometryCount;\n\n\t}\n\n\tconstructor( maxGeometryCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material ) {\n\n\t\tsuper( new BufferGeometry(), material );\n\n\t\tthis.isBatchedMesh = true;\n\t\tthis.perObjectFrustumCulled = true;\n\t\tthis.sortObjects = true;\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\t\tthis.customSort = null;\n\n\t\tthis._drawRanges = [];\n\t\tthis._reservedRanges = [];\n\n\t\tthis._visibility = [];\n\t\tthis._active = [];\n\t\tthis._bounds = [];\n\n\t\tthis._maxGeometryCount = maxGeometryCount;\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\tthis._geometryInitialized = false;\n\t\tthis._geometryCount = 0;\n\t\tthis._multiDrawCounts = new Int32Array( maxGeometryCount );\n\t\tthis._multiDrawStarts = new Int32Array( maxGeometryCount );\n\t\tthis._multiDrawCount = 0;\n\t\tthis._multiDrawInstances = null;\n\t\tthis._visibilityChanged = true;\n\n\t\t// Local matrix per geometry by using data texture\n\t\tthis._matricesTexture = null;\n\n\t\tthis._initMatricesTexture();\n\n\t}\n\n\t_initMatricesTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t// with 8x8 pixel texture max 16 matrices * 4 pixels = (8 * 8)\n\t\t// 16x16 pixel texture max 64 matrices * 4 pixels = (16 * 16)\n\t\t// 32x32 pixel texture max 256 matrices * 4 pixels = (32 * 32)\n\t\t// 64x64 pixel texture max 1024 matrices * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this._maxGeometryCount * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst matricesArray = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tconst matricesTexture = new DataTexture( matricesArray, size, size, RGBAFormat, FloatType );\n\n\t\tthis._matricesTexture = matricesTexture;\n\n\t}\n\n\t_initializeGeometry( reference ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst maxVertexCount = this._maxVertexCount;\n\t\tconst maxGeometryCount = this._maxGeometryCount;\n\t\tconst maxIndexCount = this._maxIndexCount;\n\t\tif ( this._geometryInitialized === false ) {\n\n\t\t\tfor ( const attributeName in reference.attributes ) {\n\n\t\t\t\tconst srcAttribute = reference.getAttribute( attributeName );\n\t\t\t\tconst { array, itemSize, normalized } = srcAttribute;\n\n\t\t\t\tconst dstArray = new array.constructor( maxVertexCount * itemSize );\n\t\t\t\tconst dstAttribute = new BufferAttribute( dstArray, itemSize, normalized );\n\n\t\t\t\tgeometry.setAttribute( attributeName, dstAttribute );\n\n\t\t\t}\n\n\t\t\tif ( reference.getIndex() !== null ) {\n\n\t\t\t\tconst indexArray = maxVertexCount > 65536\n\t\t\t\t\t? new Uint32Array( maxIndexCount )\n\t\t\t\t\t: new Uint16Array( maxIndexCount );\n\n\t\t\t\tgeometry.setIndex( new BufferAttribute( indexArray, 1 ) );\n\n\t\t\t}\n\n\t\t\tconst idArray = maxGeometryCount > 65536\n\t\t\t\t? new Uint32Array( maxVertexCount )\n\t\t\t\t: new Uint16Array( maxVertexCount );\n\t\t\tgeometry.setAttribute( ID_ATTR_NAME, new BufferAttribute( idArray, 1 ) );\n\n\t\t\tthis._geometryInitialized = true;\n\n\t\t}\n\n\t}\n\n\t// Make sure the geometry is compatible with the existing combined geometry attributes\n\t_validateGeometry( geometry ) {\n\n\t\t// check that the geometry doesn't have a version of our reserved id attribute\n\t\tif ( geometry.getAttribute( ID_ATTR_NAME ) ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Geometry cannot use attribute \"${ ID_ATTR_NAME }\"` );\n\n\t\t}\n\n\t\t// check to ensure the geometries are using consistent attributes and indices\n\t\tconst batchGeometry = this.geometry;\n\t\tif ( Boolean( geometry.getIndex() ) !== Boolean( batchGeometry.getIndex() ) ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: All geometries must consistently have \"index\".' );\n\n\t\t}\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\tif ( attributeName === ID_ATTR_NAME ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( ! geometry.hasAttribute( attributeName ) ) {\n\n\t\t\t\tthrow new Error( `BatchedMesh: Added geometry missing \"${ attributeName }\". All geometries must have consistent attributes.` );\n\n\t\t\t}\n\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tif ( srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized ) {\n\n\t\t\t\tthrow new Error( 'BatchedMesh: All attributes must have a consistent itemSize and normalized value.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tsetCustomSort( func ) {\n\n\t\tthis.customSort = func;\n\t\treturn this;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst geometryCount = this._geometryCount;\n\t\tconst boundingBox = this.boundingBox;\n\t\tconst active = this._active;\n\n\t\tboundingBox.makeEmpty();\n\t\tfor ( let i = 0; i < geometryCount; i ++ ) {\n\n\t\t\tif ( active[ i ] === false ) continue;\n\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingBox.union( _box$1 );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst geometryCount = this._geometryCount;\n\t\tconst boundingSphere = this.boundingSphere;\n\t\tconst active = this._active;\n\n\t\tboundingSphere.makeEmpty();\n\t\tfor ( let i = 0; i < geometryCount; i ++ ) {\n\n\t\t\tif ( active[ i ] === false ) continue;\n\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingSphere.union( _sphere$2 );\n\n\t\t}\n\n\t}\n\n\taddGeometry( geometry, vertexCount = - 1, indexCount = - 1 ) {\n\n\t\tthis._initializeGeometry( geometry );\n\n\t\tthis._validateGeometry( geometry );\n\n\t\t// ensure we're not over geometry\n\t\tif ( this._geometryCount >= this._maxGeometryCount ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Maximum geometry count reached.' );\n\n\t\t}\n\n\t\t// get the necessary range fo the geometry\n\t\tconst reservedRange = {\n\t\t\tvertexStart: - 1,\n\t\t\tvertexCount: - 1,\n\t\t\tindexStart: - 1,\n\t\t\tindexCount: - 1,\n\t\t};\n\n\t\tlet lastRange = null;\n\t\tconst reservedRanges = this._reservedRanges;\n\t\tconst drawRanges = this._drawRanges;\n\t\tconst bounds = this._bounds;\n\t\tif ( this._geometryCount !== 0 ) {\n\n\t\t\tlastRange = reservedRanges[ reservedRanges.length - 1 ];\n\n\t\t}\n\n\t\tif ( vertexCount === - 1 ) {\n\n\t\t\treservedRange.vertexCount = geometry.getAttribute( 'position' ).count;\n\n\t\t} else {\n\n\t\t\treservedRange.vertexCount = vertexCount;\n\n\t\t}\n\n\t\tif ( lastRange === null ) {\n\n\t\t\treservedRange.vertexStart = 0;\n\n\t\t} else {\n\n\t\t\treservedRange.vertexStart = lastRange.vertexStart + lastRange.vertexCount;\n\n\t\t}\n\n\t\tconst index = geometry.getIndex();\n\t\tconst hasIndex = index !== null;\n\t\tif ( hasIndex ) {\n\n\t\t\tif ( indexCount\t=== - 1 ) {\n\n\t\t\t\treservedRange.indexCount = index.count;\n\n\t\t\t} else {\n\n\t\t\t\treservedRange.indexCount = indexCount;\n\n\t\t\t}\n\n\t\t\tif ( lastRange === null ) {\n\n\t\t\t\treservedRange.indexStart = 0;\n\n\t\t\t} else {\n\n\t\t\t\treservedRange.indexStart = lastRange.indexStart + lastRange.indexCount;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (\n\t\t\treservedRange.indexStart !== - 1 &&\n\t\t\treservedRange.indexStart + reservedRange.indexCount > this._maxIndexCount ||\n\t\t\treservedRange.vertexStart + reservedRange.vertexCount > this._maxVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Reserved space request exceeds the maximum buffer size.' );\n\n\t\t}\n\n\t\tconst visibility = this._visibility;\n\t\tconst active = this._active;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\n\t\t// push new visibility states\n\t\tvisibility.push( true );\n\t\tactive.push( true );\n\n\t\t// update id\n\t\tconst geometryId = this._geometryCount;\n\t\tthis._geometryCount ++;\n\n\t\t// initialize matrix information\n\t\t_identityMatrix.toArray( matricesArray, geometryId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\t// add the reserved range and draw range objects\n\t\treservedRanges.push( reservedRange );\n\t\tdrawRanges.push( {\n\t\t\tstart: hasIndex ? reservedRange.indexStart : reservedRange.vertexStart,\n\t\t\tcount: - 1\n\t\t} );\n\t\tbounds.push( {\n\t\t\tboxInitialized: false,\n\t\t\tbox: new Box3(),\n\n\t\t\tsphereInitialized: false,\n\t\t\tsphere: new Sphere()\n\t\t} );\n\n\t\t// set the id for the geometry\n\t\tconst idAttribute = this.geometry.getAttribute( ID_ATTR_NAME );\n\t\tfor ( let i = 0; i < reservedRange.vertexCount; i ++ ) {\n\n\t\t\tidAttribute.setX( reservedRange.vertexStart + i, geometryId );\n\n\t\t}\n\n\t\tidAttribute.needsUpdate = true;\n\n\t\t// update the geometry\n\t\tthis.setGeometryAt( geometryId, geometry );\n\n\t\treturn geometryId;\n\n\t}\n\n\tsetGeometryAt( id, geometry ) {\n\n\t\tif ( id >= this._geometryCount ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Maximum geometry count reached.' );\n\n\t\t}\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst batchGeometry = this.geometry;\n\t\tconst hasIndex = batchGeometry.getIndex() !== null;\n\t\tconst dstIndex = batchGeometry.getIndex();\n\t\tconst srcIndex = geometry.getIndex();\n\t\tconst reservedRange = this._reservedRanges[ id ];\n\t\tif (\n\t\t\thasIndex &&\n\t\t\tsrcIndex.count > reservedRange.indexCount ||\n\t\t\tgeometry.attributes.position.count > reservedRange.vertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Reserved space not large enough for provided geometry.' );\n\n\t\t}\n\n\t\t// copy geometry over\n\t\tconst vertexStart = reservedRange.vertexStart;\n\t\tconst vertexCount = reservedRange.vertexCount;\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\tif ( attributeName === ID_ATTR_NAME ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// copy attribute data\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tcopyAttributeData( srcAttribute, dstAttribute, vertexStart );\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tconst itemSize = srcAttribute.itemSize;\n\t\t\tfor ( let i = srcAttribute.count, l = vertexCount; i < l; i ++ ) {\n\n\t\t\t\tconst index = vertexStart + i;\n\t\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\t\tdstAttribute.setComponent( index, c, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdstAttribute.needsUpdate = true;\n\t\t\tdstAttribute.addUpdateRange( vertexStart * itemSize, vertexCount * itemSize );\n\n\t\t}\n\n\t\t// copy index\n\t\tif ( hasIndex ) {\n\n\t\t\tconst indexStart = reservedRange.indexStart;\n\n\t\t\t// copy index data over\n\t\t\tfor ( let i = 0; i < srcIndex.count; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart + srcIndex.getX( i ) );\n\n\t\t\t}\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tfor ( let i = srcIndex.count, l = reservedRange.indexCount; i < l; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart );\n\n\t\t\t}\n\n\t\t\tdstIndex.needsUpdate = true;\n\t\t\tdstIndex.addUpdateRange( indexStart, reservedRange.indexCount );\n\n\t\t}\n\n\t\t// store the bounding boxes\n\t\tconst bound = this._bounds[ id ];\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tbound.box.copy( geometry.boundingBox );\n\t\t\tbound.boxInitialized = true;\n\n\t\t} else {\n\n\t\t\tbound.boxInitialized = false;\n\n\t\t}\n\n\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\tbound.sphere.copy( geometry.boundingSphere );\n\t\t\tbound.sphereInitialized = true;\n\n\t\t} else {\n\n\t\t\tbound.sphereInitialized = false;\n\n\t\t}\n\n\t\t// set drawRange count\n\t\tconst drawRange = this._drawRanges[ id ];\n\t\tconst posAttr = geometry.getAttribute( 'position' );\n\t\tdrawRange.count = hasIndex ? srcIndex.count : posAttr.count;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn id;\n\n\t}\n\n\tdeleteGeometry( geometryId ) {\n\n\t\t// Note: User needs to call optimize() afterward to pack the data.\n\n\t\tconst active = this._active;\n\t\tif ( geometryId >= active.length || active[ geometryId ] === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tactive[ geometryId ] = false;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetInstanceCountAt( id ) {\n\n\t\tif ( this._multiDrawInstances === null ) return null;\n\n\t\treturn this._multiDrawInstances[ id ];\n\n\t}\n\n\tsetInstanceCountAt( id, instanceCount ) {\n\n\t\tif ( this._multiDrawInstances === null ) {\n\n\t\t\tthis._multiDrawInstances = new Int32Array( this._maxGeometryCount ).fill( 1 );\n\n\t\t}\n\n\t\tthis._multiDrawInstances[ id ] = instanceCount;\n\n\t\treturn id;\n\n\t}\n\n\t// get bounding box and compute it if it doesn't exist\n\tgetBoundingBoxAt( id, target ) {\n\n\t\tconst active = this._active;\n\t\tif ( active[ id ] === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding box\n\t\tconst bound = this._bounds[ id ];\n\t\tconst box = bound.box;\n\t\tconst geometry = this.geometry;\n\t\tif ( bound.boxInitialized === false ) {\n\n\t\t\tbox.makeEmpty();\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tconst drawRange = this._drawRanges[ id ];\n\t\t\tfor ( let i = drawRange.start, l = drawRange.start + drawRange.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\tbox.expandByPoint( _vector$5.fromBufferAttribute( position, iv ) );\n\n\t\t\t}\n\n\t\t\tbound.boxInitialized = true;\n\n\t\t}\n\n\t\ttarget.copy( box );\n\t\treturn target;\n\n\t}\n\n\t// get bounding sphere and compute it if it doesn't exist\n\tgetBoundingSphereAt( id, target ) {\n\n\t\tconst active = this._active;\n\t\tif ( active[ id ] === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding sphere\n\t\tconst bound = this._bounds[ id ];\n\t\tconst sphere = bound.sphere;\n\t\tconst geometry = this.geometry;\n\t\tif ( bound.sphereInitialized === false ) {\n\n\t\t\tsphere.makeEmpty();\n\n\t\t\tthis.getBoundingBoxAt( id, _box$1 );\n\t\t\t_box$1.getCenter( sphere.center );\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tconst drawRange = this._drawRanges[ id ];\n\n\t\t\tlet maxRadiusSq = 0;\n\t\t\tfor ( let i = drawRange.start, l = drawRange.start + drawRange.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\t_vector$5.fromBufferAttribute( position, iv );\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, sphere.center.distanceToSquared( _vector$5 ) );\n\n\t\t\t}\n\n\t\t\tsphere.radius = Math.sqrt( maxRadiusSq );\n\t\t\tbound.sphereInitialized = true;\n\n\t\t}\n\n\t\ttarget.copy( sphere );\n\t\treturn target;\n\n\t}\n\n\tsetMatrixAt( geometryId, matrix ) {\n\n\t\t// @TODO: Map geometryId to index of the arrays because\n\t\t// optimize() can make geometryId mismatch the index\n\n\t\tconst active = this._active;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tconst geometryCount = this._geometryCount;\n\t\tif ( geometryId >= geometryCount || active[ geometryId ] === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tmatrix.toArray( matricesArray, geometryId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetMatrixAt( geometryId, matrix ) {\n\n\t\tconst active = this._active;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tconst geometryCount = this._geometryCount;\n\t\tif ( geometryId >= geometryCount || active[ geometryId ] === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn matrix.fromArray( matricesArray, geometryId * 16 );\n\n\t}\n\n\tsetVisibleAt( geometryId, value ) {\n\n\t\tconst visibility = this._visibility;\n\t\tconst active = this._active;\n\t\tconst geometryCount = this._geometryCount;\n\n\t\t// if the geometry is out of range, not active, or visibility state\n\t\t// does not change then return early\n\t\tif (\n\t\t\tgeometryId >= geometryCount ||\n\t\t\tactive[ geometryId ] === false ||\n\t\t\tvisibility[ geometryId ] === value\n\t\t) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tvisibility[ geometryId ] = value;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetVisibleAt( geometryId ) {\n\n\t\tconst visibility = this._visibility;\n\t\tconst active = this._active;\n\t\tconst geometryCount = this._geometryCount;\n\n\t\t// return early if the geometry is out of range or not active\n\t\tif ( geometryId >= geometryCount || active[ geometryId ] === false ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn visibility[ geometryId ];\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst visibility = this._visibility;\n\t\tconst active = this._active;\n\t\tconst drawRanges = this._drawRanges;\n\t\tconst geometryCount = this._geometryCount;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst batchGeometry = this.geometry;\n\n\t\t// iterate over each geometry\n\t\t_mesh.material = this.material;\n\t\t_mesh.geometry.index = batchGeometry.index;\n\t\t_mesh.geometry.attributes = batchGeometry.attributes;\n\t\tif ( _mesh.geometry.boundingBox === null ) {\n\n\t\t\t_mesh.geometry.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( _mesh.geometry.boundingSphere === null ) {\n\n\t\t\t_mesh.geometry.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tfor ( let i = 0; i < geometryCount; i ++ ) {\n\n\t\t\tif ( ! visibility[ i ] || ! active[ i ] ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst drawRange = drawRanges[ i ];\n\t\t\t_mesh.geometry.setDrawRange( drawRange.start, drawRange.count );\n\n\t\t\t// ge the intersects\n\t\t\tthis.getMatrixAt( i, _mesh.matrixWorld ).premultiply( matrixWorld );\n\t\t\tthis.getBoundingBoxAt( i, _mesh.geometry.boundingBox );\n\t\t\tthis.getBoundingSphereAt( i, _mesh.geometry.boundingSphere );\n\t\t\t_mesh.raycast( raycaster, _batchIntersects );\n\n\t\t\t// add batch id to the intersects\n\t\t\tfor ( let j = 0, l = _batchIntersects.length; j < l; j ++ ) {\n\n\t\t\t\tconst intersect = _batchIntersects[ j ];\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersect.batchId = i;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_batchIntersects.length = 0;\n\n\t\t}\n\n\t\t_mesh.material = null;\n\t\t_mesh.geometry.index = null;\n\t\t_mesh.geometry.attributes = {};\n\t\t_mesh.geometry.setDrawRange( 0, Infinity );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.geometry = source.geometry.clone();\n\t\tthis.perObjectFrustumCulled = source.perObjectFrustumCulled;\n\t\tthis.sortObjects = source.sortObjects;\n\t\tthis.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;\n\t\tthis.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;\n\n\t\tthis._drawRanges = source._drawRanges.map( range => ( { ...range } ) );\n\t\tthis._reservedRanges = source._reservedRanges.map( range => ( { ...range } ) );\n\n\t\tthis._visibility = source._visibility.slice();\n\t\tthis._active = source._active.slice();\n\t\tthis._bounds = source._bounds.map( bound => ( {\n\t\t\tboxInitialized: bound.boxInitialized,\n\t\t\tbox: bound.box.clone(),\n\n\t\t\tsphereInitialized: bound.sphereInitialized,\n\t\t\tsphere: bound.sphere.clone()\n\t\t} ) );\n\n\t\tthis._maxGeometryCount = source._maxGeometryCount;\n\t\tthis._maxVertexCount = source._maxVertexCount;\n\t\tthis._maxIndexCount = source._maxIndexCount;\n\n\t\tthis._geometryInitialized = source._geometryInitialized;\n\t\tthis._geometryCount = source._geometryCount;\n\t\tthis._multiDrawCounts = source._multiDrawCounts.slice();\n\t\tthis._multiDrawStarts = source._multiDrawStarts.slice();\n\n\t\tthis._matricesTexture = source._matricesTexture.clone();\n\t\tthis._matricesTexture.image.data = this._matricesTexture.image.slice();\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\t// Assuming the geometry is not shared with other meshes\n\t\tthis.geometry.dispose();\n\n\t\tthis._matricesTexture.dispose();\n\t\tthis._matricesTexture = null;\n\t\treturn this;\n\n\t}\n\n\tonBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {\n\n\t\t// if visibility has not changed and frustum culling and object sorting is not required\n\t\t// then skip iterating over all items\n\t\tif ( ! this._visibilityChanged && ! this.perObjectFrustumCulled && ! this.sortObjects ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// the indexed version of the multi draw function requires specifying the start\n\t\t// offset in bytes.\n\t\tconst index = geometry.getIndex();\n\t\tconst bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;\n\n\t\tconst active = this._active;\n\t\tconst visibility = this._visibility;\n\t\tconst multiDrawStarts = this._multiDrawStarts;\n\t\tconst multiDrawCounts = this._multiDrawCounts;\n\t\tconst drawRanges = this._drawRanges;\n\t\tconst perObjectFrustumCulled = this.perObjectFrustumCulled;\n\n\t\t// prepare the frustum in the local frame\n\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t_projScreenMatrix$2\n\t\t\t\t.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )\n\t\t\t\t.multiply( this.matrixWorld );\n\t\t\t_frustum.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\trenderer.coordinateSystem\n\t\t\t);\n\n\t\t}\n\n\t\tlet count = 0;\n\t\tif ( this.sortObjects ) {\n\n\t\t\t// get the camera position in the local frame\n\t\t\t_invMatrixWorld.copy( this.matrixWorld ).invert();\n\t\t\t_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _invMatrixWorld );\n\n\t\t\tfor ( let i = 0, l = visibility.length; i < l; i ++ ) {\n\n\t\t\t\tif ( visibility[ i ] && active[ i ] ) {\n\n\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\tthis.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\tculled = ! _frustum.intersectsSphere( _sphere$2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\t// get the distance from camera used for sorting\n\t\t\t\t\t\tconst z = _vector$5.distanceTo( _sphere$2.center );\n\t\t\t\t\t\t_renderList.push( drawRanges[ i ], z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Sort the draw ranges and prep for rendering\n\t\t\tconst list = _renderList.list;\n\t\t\tconst customSort = this.customSort;\n\t\t\tif ( customSort === null ) {\n\n\t\t\t\tlist.sort( material.transparent ? sortTransparent : sortOpaque );\n\n\t\t\t} else {\n\n\t\t\t\tcustomSort.call( this, list, camera );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = list.length; i < l; i ++ ) {\n\n\t\t\t\tconst item = list[ i ];\n\t\t\t\tmultiDrawStarts[ count ] = item.start * bytesPerElement;\n\t\t\t\tmultiDrawCounts[ count ] = item.count;\n\t\t\t\tcount ++;\n\n\t\t\t}\n\n\t\t\t_renderList.reset();\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0, l = visibility.length; i < l; i ++ ) {\n\n\t\t\t\tif ( visibility[ i ] && active[ i ] ) {\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\t\tthis.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\t\t\t\tculled = ! _frustum.intersectsSphere( _sphere$2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\tconst range = drawRanges[ i ];\n\t\t\t\t\t\tmultiDrawStarts[ count ] = range.start * bytesPerElement;\n\t\t\t\t\t\tmultiDrawCounts[ count ] = range.count;\n\t\t\t\t\t\tcount ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._multiDrawCount = count;\n\t\tthis._visibilityChanged = false;\n\n\t}\n\n\tonBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {\n\n\t\tthis.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );\n\n\t}\n\n}\n\nclass LineBasicMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isLineBasicMaterial = true;\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.linewidth = 1;\n\t\tthis.linecap = 'round';\n\t\tthis.linejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vStart = /*@__PURE__*/ new Vector3();\nconst _vEnd = /*@__PURE__*/ new Vector3();\n\nconst _inverseMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _ray$1 = /*@__PURE__*/ new Ray();\nconst _sphere$1 = /*@__PURE__*/ new Sphere();\n\nconst _intersectPointOnRay = /*@__PURE__*/ new Vector3();\nconst _intersectPointOnSegment = /*@__PURE__*/ new Vector3();\n\nclass Line extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isLine = true;\n\n\t\tthis.type = 'Line';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\tfor ( let i = 1, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t_vStart.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t_vEnd.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i ] += _vStart.distanceTo( _vEnd );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$1.copy( geometry.boundingSphere );\n\t\t_sphere$1.applyMatrix4( matrixWorld );\n\t\t_sphere$1.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$1.copy( matrixWorld ).invert();\n\t\t_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst a = index.getX( i );\n\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst a = index.getX( end - 1 );\n\t\t\t\tconst b = index.getX( start );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, i, i + 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, end - 1, start );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, raycaster, ray, thresholdSq, a, b ) {\n\n\tconst positionAttribute = object.geometry.attributes.position;\n\n\t_vStart.fromBufferAttribute( positionAttribute, a );\n\t_vEnd.fromBufferAttribute( positionAttribute, b );\n\n\tconst distSq = ray.distanceSqToSegment( _vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment );\n\n\tif ( distSq > thresholdSq ) return;\n\n\t_intersectPointOnRay.applyMatrix4( object.matrixWorld ); // Move back to world space for distance calculation\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectPointOnRay );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\treturn {\n\n\t\tdistance: distance,\n\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t// point: raycaster.ray.at( distance ),\n\t\tpoint: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),\n\t\tindex: a,\n\t\tface: null,\n\t\tfaceIndex: null,\n\t\tobject: object\n\n\t};\n\n}\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\nclass LineSegments extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isLineSegments = true;\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [];\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) {\n\n\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineLoop extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isLineLoop = true;\n\n\t\tthis.type = 'LineLoop';\n\n\t}\n\n}\n\nclass PointsMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isPointsMaterial = true;\n\n\t\tthis.type = 'PointsMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.size = 1;\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _position$2 = /*@__PURE__*/ new Vector3();\n\nclass Points extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isPoints = true;\n\n\t\tthis.type = 'Points';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Points.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, il = end; i < il; i ++ ) {\n\n\t\t\t\tconst a = index.getX( i );\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, a );\n\n\t\t\t\ttestPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end; i < l; i ++ ) {\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\ttestPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {\n\n\tconst rayPointDistanceSq = _ray.distanceSqToPoint( point );\n\n\tif ( rayPointDistanceSq < localThresholdSq ) {\n\n\t\tconst intersectPoint = new Vector3();\n\n\t\t_ray.closestPointToPoint( point, intersectPoint );\n\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\tpoint: intersectPoint,\n\t\t\tindex: index,\n\t\t\tface: null,\n\t\t\tobject: object\n\n\t\t} );\n\n\t}\n\n}\n\nclass VideoTexture extends Texture {\n\n\tconstructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isVideoTexture = true;\n\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearFilter;\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tconst scope = this;\n\n\t\tfunction updateVideo() {\n\n\t\t\tscope.needsUpdate = true;\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t\tif ( 'requestVideoFrameCallback' in video ) {\n\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.image ).copy( this );\n\n\t}\n\n\tupdate() {\n\n\t\tconst video = this.image;\n\t\tconst hasVideoFrameCallback = 'requestVideoFrameCallback' in video;\n\n\t\tif ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) {\n\n\t\t\tthis.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n}\n\nclass FramebufferTexture extends Texture {\n\n\tconstructor( width, height ) {\n\n\t\tsuper( { width, height } );\n\n\t\tthis.isFramebufferTexture = true;\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\nclass CompressedTexture extends Texture {\n\n\tconstructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isCompressedTexture = true;\n\n\t\tthis.image = { width: width, height: height };\n\t\tthis.mipmaps = mipmaps;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\tthis.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n}\n\nclass CompressedArrayTexture extends CompressedTexture {\n\n\tconstructor( mipmaps, width, height, depth, format, type ) {\n\n\t\tsuper( mipmaps, width, height, format, type );\n\n\t\tthis.isCompressedArrayTexture = true;\n\t\tthis.image.depth = depth;\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t}\n\n}\n\nclass CompressedCubeTexture extends CompressedTexture {\n\n\tconstructor( images, format, type ) {\n\n\t\tsuper( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping );\n\n\t\tthis.isCompressedCubeTexture = true;\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.image = images;\n\n\t}\n\n}\n\nclass CanvasTexture extends Texture {\n\n\tconstructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isCanvasTexture = true;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * Extensible curve object.\n *\n * Some common of curve methods:\n * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n * .getPoints(), .getSpacedPoints()\n * .getLength()\n * .updateArcLengths()\n *\n * This following curves inherit from THREE.Curve:\n *\n * -- 2D curves --\n * THREE.ArcCurve\n * THREE.CubicBezierCurve\n * THREE.EllipseCurve\n * THREE.LineCurve\n * THREE.QuadraticBezierCurve\n * THREE.SplineCurve\n *\n * -- 3D curves --\n * THREE.CatmullRomCurve3\n * THREE.CubicBezierCurve3\n * THREE.LineCurve3\n * THREE.QuadraticBezierCurve3\n *\n * A series of curves can be represented as a THREE.CurvePath.\n *\n **/\n\nclass Curve {\n\n\tconstructor() {\n\n\t\tthis.type = 'Curve';\n\n\t\tthis.arcLengthDivisions = 200;\n\n\t}\n\n\t// Virtual base class method to overwrite and implement in subclasses\n\t//\t- t [0 .. 1]\n\n\tgetPoint( /* t, optionalTarget */ ) {\n\n\t\tconsole.warn( 'THREE.Curve: .getPoint() not implemented.' );\n\t\treturn null;\n\n\t}\n\n\t// Get point at relative position in curve according to arc length\n\t// - u [0 .. 1]\n\n\tgetPointAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getPoint( t, optionalTarget );\n\n\t}\n\n\t// Get sequence of points using getPoint( t )\n\n\tgetPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get sequence of points using getPointAt( u )\n\n\tgetSpacedPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get total curve arc length\n\n\tgetLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}\n\n\t// Get list of cumulative segment lengths\n\n\tgetLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}\n\n\tupdateArcLengths() {\n\n\t\tthis.needsUpdate = true;\n\t\tthis.getLengths();\n\n\t}\n\n\t// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\tgetUtoTmapping( u, distance ) {\n\n\t\tconst arcLengths = this.getLengths();\n\n\t\tlet i = 0;\n\t\tconst il = arcLengths.length;\n\n\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\tif ( distance ) {\n\n\t\t\ttargetArcLength = distance;\n\n\t\t} else {\n\n\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t}\n\n\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\tlet low = 0, high = il - 1, comparison;\n\n\t\twhile ( low <= high ) {\n\n\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\tif ( comparison < 0 ) {\n\n\t\t\t\tlow = i + 1;\n\n\t\t\t} else if ( comparison > 0 ) {\n\n\t\t\t\thigh = i - 1;\n\n\t\t\t} else {\n\n\t\t\t\thigh = i;\n\t\t\t\tbreak;\n\n\t\t\t\t// DONE\n\n\t\t\t}\n\n\t\t}\n\n\t\ti = high;\n\n\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\treturn i / ( il - 1 );\n\n\t\t}\n\n\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\tconst lengthBefore = arcLengths[ i ];\n\t\tconst lengthAfter = arcLengths[ i + 1 ];\n\n\t\tconst segmentLength = lengthAfter - lengthBefore;\n\n\t\t// determine where we are between the 'before' and 'after' points\n\n\t\tconst segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t// add that fractional amount to t\n\n\t\tconst t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\treturn t;\n\n\t}\n\n\t// Returns a unit vector tangent at t\n\t// In case any sub curve does not implement its tangent derivation,\n\t// 2 points a small delta apart will be used to find its gradient\n\t// which seems to give a reasonable approximation\n\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst delta = 0.0001;\n\t\tlet t1 = t - delta;\n\t\tlet t2 = t + delta;\n\n\t\t// Capping in case of danger\n\n\t\tif ( t1 < 0 ) t1 = 0;\n\t\tif ( t2 > 1 ) t2 = 1;\n\n\t\tconst pt1 = this.getPoint( t1 );\n\t\tconst pt2 = this.getPoint( t2 );\n\n\t\tconst tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() );\n\n\t\ttangent.copy( pt2 ).sub( pt1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getTangent( t, optionalTarget );\n\n\t}\n\n\tcomputeFrenetFrames( segments, closed ) {\n\n\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\tconst normal = new Vector3();\n\n\t\tconst tangents = [];\n\t\tconst normals = [];\n\t\tconst binormals = [];\n\n\t\tconst vec = new Vector3();\n\t\tconst mat = new Matrix4();\n\n\t\t// compute the tangent vectors for each segment on the curve\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst u = i / segments;\n\n\t\t\ttangents[ i ] = this.getTangentAt( u, new Vector3() );\n\n\t\t}\n\n\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t// and in the direction of the minimum tangent xyz component\n\n\t\tnormals[ 0 ] = new Vector3();\n\t\tbinormals[ 0 ] = new Vector3();\n\t\tlet min = Number.MAX_VALUE;\n\t\tconst tx = Math.abs( tangents[ 0 ].x );\n\t\tconst ty = Math.abs( tangents[ 0 ].y );\n\t\tconst tz = Math.abs( tangents[ 0 ].z );\n\n\t\tif ( tx <= min ) {\n\n\t\t\tmin = tx;\n\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t}\n\n\t\tif ( ty <= min ) {\n\n\t\t\tmin = ty;\n\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t}\n\n\t\tif ( tz <= min ) {\n\n\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t}\n\n\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\tif ( vec.length() > Number.EPSILON ) {\n\n\t\t\t\tvec.normalize();\n\n\t\t\t\tconst theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t}\n\n\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t}\n\n\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\tif ( closed === true ) {\n\n\t\t\tlet theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) );\n\t\t\ttheta /= segments;\n\n\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) {\n\n\t\t\t\ttheta = - theta;\n\n\t\t\t}\n\n\t\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\t\t// twist a little...\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttangents: tangents,\n\t\t\tnormals: normals,\n\t\t\tbinormals: binormals\n\t\t};\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Curve',\n\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t}\n\t\t};\n\n\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\tdata.type = this.type;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass EllipseCurve extends Curve {\n\n\tconstructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.isEllipseCurve = true;\n\n\t\tthis.type = 'EllipseCurve';\n\n\t\tthis.aX = aX;\n\t\tthis.aY = aY;\n\n\t\tthis.xRadius = xRadius;\n\t\tthis.yRadius = yRadius;\n\n\t\tthis.aStartAngle = aStartAngle;\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\tthis.aClockwise = aClockwise;\n\n\t\tthis.aRotation = aRotation;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst twoPi = Math.PI * 2;\n\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tconst samePoints = Math.abs( deltaAngle ) < Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle < 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle > twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle < Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true && ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\tlet x = this.aX + this.xRadius * Math.cos( angle );\n\t\tlet y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tconst cos = Math.cos( this.aRotation );\n\t\t\tconst sin = Math.sin( this.aRotation );\n\n\t\t\tconst tx = x - this.aX;\n\t\t\tconst ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn point.set( x, y );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.aX = source.aX;\n\t\tthis.aY = source.aY;\n\n\t\tthis.xRadius = source.xRadius;\n\t\tthis.yRadius = source.yRadius;\n\n\t\tthis.aStartAngle = source.aStartAngle;\n\t\tthis.aEndAngle = source.aEndAngle;\n\n\t\tthis.aClockwise = source.aClockwise;\n\n\t\tthis.aRotation = source.aRotation;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.aX = this.aX;\n\t\tdata.aY = this.aY;\n\n\t\tdata.xRadius = this.xRadius;\n\t\tdata.yRadius = this.yRadius;\n\n\t\tdata.aStartAngle = this.aStartAngle;\n\t\tdata.aEndAngle = this.aEndAngle;\n\n\t\tdata.aClockwise = this.aClockwise;\n\n\t\tdata.aRotation = this.aRotation;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.aX = json.aX;\n\t\tthis.aY = json.aY;\n\n\t\tthis.xRadius = json.xRadius;\n\t\tthis.yRadius = json.yRadius;\n\n\t\tthis.aStartAngle = json.aStartAngle;\n\t\tthis.aEndAngle = json.aEndAngle;\n\n\t\tthis.aClockwise = json.aClockwise;\n\n\t\tthis.aRotation = json.aRotation;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass ArcCurve extends EllipseCurve {\n\n\tconstructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tsuper( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\tthis.isArcCurve = true;\n\n\t\tthis.type = 'ArcCurve';\n\n\t}\n\n}\n\n/**\n * Centripetal CatmullRom Curve - which is useful for avoiding\n * cusps and self-intersections in non-uniform catmull rom curves.\n * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n *\n * curve.type accepts centripetal(default), chordal and catmullrom\n * curve.tension is used for catmullrom which defaults to 0.5\n */\n\n\n/*\nBased on an optimized c++ solution in\n - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n - http://ideone.com/NoEbVM\n\nThis CubicPoly class could be used for reusing some variables and calculations,\nbut for three.js curve use, it could be possible inlined and flatten into a single function call\nwhich can be placed in CurveUtils.\n*/\n\nfunction CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}\n\n//\n\nconst tmp = /*@__PURE__*/ new Vector3();\nconst px = /*@__PURE__*/ new CubicPoly();\nconst py = /*@__PURE__*/ new CubicPoly();\nconst pz = /*@__PURE__*/ new CubicPoly();\n\nclass CatmullRomCurve3 extends Curve {\n\n\tconstructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) {\n\n\t\tsuper();\n\n\t\tthis.isCatmullRomCurve3 = true;\n\n\t\tthis.type = 'CatmullRomCurve3';\n\n\t\tthis.points = points;\n\t\tthis.closed = closed;\n\t\tthis.curveType = curveType;\n\t\tthis.tension = tension;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst l = points.length;\n\n\t\tconst p = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\tlet intPoint = Math.floor( p );\n\t\tlet weight = p - intPoint;\n\n\t\tif ( this.closed ) {\n\n\t\t\tintPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l;\n\n\t\t} else if ( weight === 0 && intPoint === l - 1 ) {\n\n\t\t\tintPoint = l - 2;\n\t\t\tweight = 1;\n\n\t\t}\n\n\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\tif ( this.closed || intPoint > 0 ) {\n\n\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate first point\n\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\tp0 = tmp;\n\n\t\t}\n\n\t\tconst p1 = points[ intPoint % l ];\n\t\tconst p2 = points[ ( intPoint + 1 ) % l ];\n\n\t\tif ( this.closed || intPoint + 2 < l ) {\n\n\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate last point\n\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\tp3 = tmp;\n\n\t\t}\n\n\t\tif ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) {\n\n\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\tlet dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\tlet dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\tlet dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t// safety check for repeated points\n\t\t\tif ( dt1 < 1e-4 ) dt1 = 1.0;\n\t\t\tif ( dt0 < 1e-4 ) dt0 = dt1;\n\t\t\tif ( dt2 < 1e-4 ) dt2 = dt1;\n\n\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t} else if ( this.curveType === 'catmullrom' ) {\n\n\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );\n\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );\n\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );\n\n\t\t}\n\n\t\tpoint.set(\n\t\t\tpx.calc( weight ),\n\t\t\tpy.calc( weight ),\n\t\t\tpz.calc( weight )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\tthis.closed = source.closed;\n\t\tthis.curveType = source.curveType;\n\t\tthis.tension = source.tension;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\tdata.closed = this.closed;\n\t\tdata.curveType = this.curveType;\n\t\tdata.tension = this.tension;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector3().fromArray( point ) );\n\n\t\t}\n\n\t\tthis.closed = json.closed;\n\t\tthis.curveType = json.curveType;\n\t\tthis.tension = json.tension;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Bezier Curves formulas obtained from\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n */\n\nfunction CatmullRom( t, p0, p1, p2, p3 ) {\n\n\tconst v0 = ( p2 - p0 ) * 0.5;\n\tconst v1 = ( p3 - p1 ) * 0.5;\n\tconst t2 = t * t;\n\tconst t3 = t * t2;\n\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n}\n\n//\n\nfunction QuadraticBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * p;\n\n}\n\nfunction QuadraticBezierP1( t, p ) {\n\n\treturn 2 * ( 1 - t ) * t * p;\n\n}\n\nfunction QuadraticBezierP2( t, p ) {\n\n\treturn t * t * p;\n\n}\n\nfunction QuadraticBezier( t, p0, p1, p2 ) {\n\n\treturn QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) +\n\t\tQuadraticBezierP2( t, p2 );\n\n}\n\n//\n\nfunction CubicBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * k * p;\n\n}\n\nfunction CubicBezierP1( t, p ) {\n\n\tconst k = 1 - t;\n\treturn 3 * k * k * t * p;\n\n}\n\nfunction CubicBezierP2( t, p ) {\n\n\treturn 3 * ( 1 - t ) * t * t * p;\n\n}\n\nfunction CubicBezierP3( t, p ) {\n\n\treturn t * t * t * p;\n\n}\n\nfunction CubicBezier( t, p0, p1, p2, p3 ) {\n\n\treturn CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) +\n\t\tCubicBezierP3( t, p3 );\n\n}\n\nclass CubicBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isCubicBezierCurve = true;\n\n\t\tthis.type = 'CubicBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass CubicBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isCubicBezierCurve3 = true;\n\n\t\tthis.type = 'CubicBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y ),\n\t\t\tCubicBezier( t, v0.z, v1.z, v2.z, v3.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineCurve extends Curve {\n\n\tconstructor( v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isLineCurve = true;\n\n\t\tthis.type = 'LineCurve';\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector2() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineCurve3 extends Curve {\n\n\tconstructor( v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isLineCurve3 = true;\n\n\t\tthis.type = 'LineCurve3';\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector3() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass QuadraticBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isQuadraticBezierCurve = true;\n\n\t\tthis.type = 'QuadraticBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass QuadraticBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isQuadraticBezierCurve3 = true;\n\n\t\tthis.type = 'QuadraticBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y ),\n\t\t\tQuadraticBezier( t, v0.z, v1.z, v2.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass SplineCurve extends Curve {\n\n\tconstructor( points = [] ) {\n\n\t\tsuper();\n\n\t\tthis.isSplineCurve = true;\n\n\t\tthis.type = 'SplineCurve';\n\n\t\tthis.points = points;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst p = ( points.length - 1 ) * t;\n\n\t\tconst intPoint = Math.floor( p );\n\t\tconst weight = p - intPoint;\n\n\t\tconst p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tconst p1 = points[ intPoint ];\n\t\tconst p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tconst p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tpoint.set(\n\t\t\tCatmullRom( weight, p0.x, p1.x, p2.x, p3.x ),\n\t\t\tCatmullRom( weight, p0.y, p1.y, p2.y, p3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector2().fromArray( point ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nvar Curves = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tArcCurve: ArcCurve,\n\tCatmullRomCurve3: CatmullRomCurve3,\n\tCubicBezierCurve: CubicBezierCurve,\n\tCubicBezierCurve3: CubicBezierCurve3,\n\tEllipseCurve: EllipseCurve,\n\tLineCurve: LineCurve,\n\tLineCurve3: LineCurve3,\n\tQuadraticBezierCurve: QuadraticBezierCurve,\n\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\tSplineCurve: SplineCurve\n});\n\n/**************************************************************\n *\tCurved Path - a curve path is simply a array of connected\n * curves, but retains the api of a curve\n **************************************************************/\n\nclass CurvePath extends Curve {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'CurvePath';\n\n\t\tthis.curves = [];\n\t\tthis.autoClose = false; // Automatically closes the path\n\n\t}\n\n\tadd( curve ) {\n\n\t\tthis.curves.push( curve );\n\n\t}\n\n\tclosePath() {\n\n\t\t// Add a line curve if start and end of lines are not connected\n\t\tconst startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\tconst endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\tconst lineType = ( startPoint.isVector2 === true ) ? 'LineCurve' : 'LineCurve3';\n\t\t\tthis.curves.push( new Curves[ lineType ]( endPoint, startPoint ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// To get accurate point with reference to\n\t// entire path distance at time t,\n\t// following has to be done:\n\n\t// 1. Length of each sub path have to be known\n\t// 2. Locate and identify type of curve\n\t// 3. Get t for the curve\n\t// 4. Return curve.getPointAt(t')\n\n\tgetPoint( t, optionalTarget ) {\n\n\t\tconst d = t * this.getLength();\n\t\tconst curveLengths = this.getCurveLengths();\n\t\tlet i = 0;\n\n\t\t// To think about boundaries points.\n\n\t\twhile ( i < curveLengths.length ) {\n\n\t\t\tif ( curveLengths[ i ] >= d ) {\n\n\t\t\t\tconst diff = curveLengths[ i ] - d;\n\t\t\t\tconst curve = this.curves[ i ];\n\n\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\treturn curve.getPointAt( u, optionalTarget );\n\n\t\t\t}\n\n\t\t\ti ++;\n\n\t\t}\n\n\t\treturn null;\n\n\t\t// loop where sum != 0, sum > d , sum+1 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = source.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = source.curves[ i ];\n\n\t\t\tthis.curves.push( curve.clone() );\n\n\t\t}\n\n\t\tthis.autoClose = source.autoClose;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.autoClose = this.autoClose;\n\t\tdata.curves = [];\n\n\t\tfor ( let i = 0, l = this.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = this.curves[ i ];\n\t\t\tdata.curves.push( curve.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.autoClose = json.autoClose;\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = json.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = json.curves[ i ];\n\t\t\tthis.curves.push( new Curves[ curve.type ]().fromJSON( curve ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Path extends CurvePath {\n\n\tconstructor( points ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Path';\n\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.setFromPoints( points );\n\n\t\t}\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.moveTo( points[ 0 ].x, points[ 0 ].y );\n\n\t\tfor ( let i = 1, l = points.length; i < l; i ++ ) {\n\n\t\t\tthis.lineTo( points[ i ].x, points[ i ].y );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tconst curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tconst curve = new QuadraticBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tconst curve = new CubicBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts /*Array of Vector*/ ) {\n\n\t\tconst npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\tconst curve = new SplineCurve( npts );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\treturn this;\n\n\t}\n\n\tarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tabsarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\treturn this;\n\n\t}\n\n\tabsellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\tif ( this.curves.length > 0 ) {\n\n\t\t\t// if a previous curve is present, attempt to join\n\t\t\tconst firstPoint = curve.getPoint( 0 );\n\n\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.curves.push( curve );\n\n\t\tconst lastPoint = curve.getPoint( 1 );\n\t\tthis.currentPoint.copy( lastPoint );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.currentPoint.copy( source.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.currentPoint = this.currentPoint.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.currentPoint.fromArray( json.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LatheGeometry extends BufferGeometry {\n\n\tconstructor( points = [ new Vector2( 0, - 0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments );\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\tphiLength = clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst uvs = [];\n\t\tconst initNormals = [];\n\t\tconst normals = [];\n\n\t\t// helper variables\n\n\t\tconst inverseSegments = 1.0 / segments;\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tconst normal = new Vector3();\n\t\tconst curNormal = new Vector3();\n\t\tconst prevNormal = new Vector3();\n\t\tlet dx = 0;\n\t\tlet dy = 0;\n\n\t\t// pre-compute normals for initial \"meridian\"\n\n\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\tswitch ( j ) {\n\n\t\t\t\tcase 0:\t\t\t\t// special handling for 1st vertex on path\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tprevNormal.copy( normal );\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ( points.length - 1 ):\t// special handling for last Vertex on path\n\n\t\t\t\t\tinitNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\t\t\t// default handling for all vertices in between\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tcurNormal.copy( normal );\n\n\t\t\t\t\tnormal.x += prevNormal.x;\n\t\t\t\t\tnormal.y += prevNormal.y;\n\t\t\t\t\tnormal.z += prevNormal.z;\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tprevNormal.copy( curNormal );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate vertices, uvs and normals\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tconst sin = Math.sin( phi );\n\t\t\tconst cos = Math.cos( phi );\n\n\t\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// normal\n\n\t\t\t\tconst x = initNormals[ 3 * j + 0 ] * sin;\n\t\t\t\tconst y = initNormals[ 3 * j + 1 ];\n\t\t\t\tconst z = initNormals[ 3 * j + 0 ] * cos;\n\n\t\t\t\tnormals.push( x, y, z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 0; i < segments; i ++ ) {\n\n\t\t\tfor ( let j = 0; j < ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tconst base = j + i * points.length;\n\n\t\t\t\tconst a = base;\n\t\t\t\tconst b = base + points.length;\n\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\tconst d = base + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( c, d, b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );\n\n\t}\n\n}\n\nclass CapsuleGeometry extends LatheGeometry {\n\n\tconstructor( radius = 1, length = 1, capSegments = 4, radialSegments = 8 ) {\n\n\t\tconst path = new Path();\n\t\tpath.absarc( 0, - length / 2, radius, Math.PI * 1.5, 0 );\n\t\tpath.absarc( 0, length / 2, radius, 0, Math.PI * 0.5 );\n\n\t\tsuper( path.getPoints( capSegments ), radialSegments );\n\n\t\tthis.type = 'CapsuleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tlength: length,\n\t\t\tcapSegments: capSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CapsuleGeometry( data.radius, data.length, data.capSegments, data.radialSegments );\n\n\t}\n\n}\n\nclass CircleGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tsegments = Math.max( 3, segments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// center point\n\n\t\tvertices.push( 0, 0, 0 );\n\t\tnormals.push( 0, 0, 1 );\n\t\tuvs.push( 0.5, 0.5 );\n\n\t\tfor ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) {\n\n\t\t\tconst segment = thetaStart + s / segments * thetaLength;\n\n\t\t\t// vertex\n\n\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t// normal\n\n\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t// uvs\n\n\t\t\tuv.x = ( vertices[ i ] / radius + 1 ) / 2;\n\t\t\tuv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass CylinderGeometry extends BufferGeometry {\n\n\tconstructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CylinderGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tconst scope = this;\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet index = 0;\n\t\tconst indexArray = [];\n\t\tconst halfHeight = height / 2;\n\t\tlet groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) generateCap( true );\n\t\t\tif ( radiusBottom > 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction generateTorso() {\n\n\t\t\tconst normal = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tconst slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\t\tconst indexRow = [];\n\n\t\t\t\tconst v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\n\t\t\t\tconst radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\t\tconst u = x / radialSegments;\n\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\n\t\t\t\t\tuvs.push( u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\n\t\t\t\t\tindexRow.push( index ++ );\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tfor ( let y = 0; y < heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\n\t\t\t\t\tconst a = indexArray[ y ][ x ];\n\t\t\t\t\tconst b = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tconst c = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tconst d = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// update group counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\t// save the index of the first center vertex\n\t\t\tconst centerIndexStart = index;\n\n\t\t\tconst uv = new Vector2();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tconst sign = ( top === true ) ? 1 : - 1;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( let x = 1; x <= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertices.push( 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( 0.5, 0.5 );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tconst centerIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\tconst u = x / radialSegments;\n\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\n\t\t\t\t\tindices.push( i, i + 1, c );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\n\t\t\t\t\tindices.push( i + 1, i, c );\n\n\t\t\t\t}\n\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ConeGeometry extends CylinderGeometry {\n\n\tconstructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass PolyhedronGeometry extends BufferGeometry {\n\n\tconstructor( vertices = [], indices = [], radius = 1, detail = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\t// default buffer data\n\n\t\tconst vertexBuffer = [];\n\t\tconst uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tapplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );\n\n\t\tif ( detail === 0 ) {\n\n\t\t\tthis.computeVertexNormals(); // flat normals\n\n\t\t} else {\n\n\t\t\tthis.normalizeNormals(); // smooth normals\n\n\t\t}\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivision with the given detail value\n\n\t\t\tfor ( let i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tconst cols = detail + 1;\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tconst v = [];\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( let i = 0; i <= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tconst aj = a.clone().lerp( c, i / cols );\n\t\t\t\tconst bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tconst rows = cols - i;\n\n\t\t\t\tfor ( let j = 0; j <= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 && i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( let i = 0; i < cols; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tconst k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction applyRadius( radius ) {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tconst u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tconst v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( let i = 0; i < uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tconst x0 = uvBuffer[ i + 0 ];\n\t\t\t\tconst x1 = uvBuffer[ i + 2 ];\n\t\t\t\tconst x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tconst max = Math.max( x0, x1, x2 );\n\t\t\t\tconst min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max > 0.9 && min < 0.1 ) {\n\n\t\t\t\t\tif ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tconst stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\tconst centroid = new Vector3();\n\n\t\t\tconst uvA = new Vector2();\n\t\t\tconst uvB = new Vector2();\n\t\t\tconst uvC = new Vector2();\n\n\t\t\tfor ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tconst azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details );\n\n\t}\n\n}\n\nclass DodecahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tconst r = 1 / t;\n\n\t\tconst vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t- 1, - 1, - 1,\t- 1, - 1, 1,\n\t\t\t- 1, 1, - 1, - 1, 1, 1,\n\t\t\t1, - 1, - 1, 1, - 1, 1,\n\t\t\t1, 1, - 1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t0, - r, - t, 0, - r, t,\n\t\t\t0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\tr, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tconst indices = [\n\t\t\t3, 11, 7, \t3, 7, 15, \t3, 15, 13,\n\t\t\t7, 19, 17, \t7, 17, 6, \t7, 6, 15,\n\t\t\t17, 4, 8, \t17, 8, 10, \t17, 10, 6,\n\t\t\t8, 0, 16, \t8, 16, 2, \t8, 2, 10,\n\t\t\t0, 12, 1, \t0, 1, 18, \t0, 18, 16,\n\t\t\t6, 10, 2, \t6, 2, 13, \t6, 13, 15,\n\t\t\t2, 16, 18, \t2, 18, 3, \t2, 3, 13,\n\t\t\t18, 1, 9, \t18, 9, 11, \t18, 11, 3,\n\t\t\t4, 14, 12, \t4, 12, 0, \t4, 0, 8,\n\t\t\t11, 9, 5, \t11, 5, 19, \t11, 19, 7,\n\t\t\t19, 5, 14, \t19, 14, 4, \t19, 4, 17,\n\t\t\t1, 12, 14, \t1, 14, 5, \t1, 5, 9\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new DodecahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1$1 = /*@__PURE__*/ new Vector3();\nconst _normal = /*@__PURE__*/ new Vector3();\nconst _triangle = /*@__PURE__*/ new Triangle();\n\nclass EdgesGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null, thresholdAngle = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'EdgesGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry,\n\t\t\tthresholdAngle: thresholdAngle\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\tconst precisionPoints = 4;\n\t\t\tconst precision = Math.pow( 10, precisionPoints );\n\t\t\tconst thresholdDot = Math.cos( DEG2RAD * thresholdAngle );\n\n\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\tconst positionAttr = geometry.getAttribute( 'position' );\n\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\n\t\t\tconst indexArr = [ 0, 0, 0 ];\n\t\t\tconst vertKeys = [ 'a', 'b', 'c' ];\n\t\t\tconst hashes = new Array( 3 );\n\n\t\t\tconst edgeData = {};\n\t\t\tconst vertices = [];\n\t\t\tfor ( let i = 0; i < indexCount; i += 3 ) {\n\n\t\t\t\tif ( indexAttr ) {\n\n\t\t\t\t\tindexArr[ 0 ] = indexAttr.getX( i );\n\t\t\t\t\tindexArr[ 1 ] = indexAttr.getX( i + 1 );\n\t\t\t\t\tindexArr[ 2 ] = indexAttr.getX( i + 2 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArr[ 0 ] = i;\n\t\t\t\t\tindexArr[ 1 ] = i + 1;\n\t\t\t\t\tindexArr[ 2 ] = i + 2;\n\n\t\t\t\t}\n\n\t\t\t\tconst { a, b, c } = _triangle;\n\t\t\t\ta.fromBufferAttribute( positionAttr, indexArr[ 0 ] );\n\t\t\t\tb.fromBufferAttribute( positionAttr, indexArr[ 1 ] );\n\t\t\t\tc.fromBufferAttribute( positionAttr, indexArr[ 2 ] );\n\t\t\t\t_triangle.getNormal( _normal );\n\n\t\t\t\t// create hashes for the edge from the vertices\n\t\t\t\thashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;\n\t\t\t\thashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;\n\t\t\t\thashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;\n\n\t\t\t\t// skip degenerate triangles\n\t\t\t\tif ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t// iterate over every edge\n\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\tconst jNext = ( j + 1 ) % 3;\n\t\t\t\t\tconst vecHash0 = hashes[ j ];\n\t\t\t\t\tconst vecHash1 = hashes[ jNext ];\n\t\t\t\t\tconst v0 = _triangle[ vertKeys[ j ] ];\n\t\t\t\t\tconst v1 = _triangle[ vertKeys[ jNext ] ];\n\n\t\t\t\t\tconst hash = `${ vecHash0 }_${ vecHash1 }`;\n\t\t\t\t\tconst reverseHash = `${ vecHash1 }_${ vecHash0 }`;\n\n\t\t\t\t\tif ( reverseHash in edgeData && edgeData[ reverseHash ] ) {\n\n\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\tif ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {\n\n\t\t\t\t\t\t\tvertices.push( v0.x, v0.y, v0.z );\n\t\t\t\t\t\t\tvertices.push( v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tedgeData[ reverseHash ] = null;\n\n\t\t\t\t\t} else if ( ! ( hash in edgeData ) ) {\n\n\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\tedgeData[ hash ] = {\n\n\t\t\t\t\t\t\tindex0: indexArr[ j ],\n\t\t\t\t\t\t\tindex1: indexArr[ jNext ],\n\t\t\t\t\t\t\tnormal: _normal.clone(),\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// iterate over all remaining, unmatched edges and add them to the vertex array\n\t\t\tfor ( const key in edgeData ) {\n\n\t\t\t\tif ( edgeData[ key ] ) {\n\n\t\t\t\t\tconst { index0, index1 } = edgeData[ key ];\n\t\t\t\t\t_v0.fromBufferAttribute( positionAttr, index0 );\n\t\t\t\t\t_v1$1.fromBufferAttribute( positionAttr, index1 );\n\n\t\t\t\t\tvertices.push( _v0.x, _v0.y, _v0.z );\n\t\t\t\t\tvertices.push( _v1$1.x, _v1$1.y, _v1$1.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Shape extends Path {\n\n\tconstructor( points ) {\n\n\t\tsuper( points );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.type = 'Shape';\n\n\t\tthis.holes = [];\n\n\t}\n\n\tgetPointsHoles( divisions ) {\n\n\t\tconst holesPts = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t}\n\n\t\treturn holesPts;\n\n\t}\n\n\t// get points of shape and holes (keypoints based on segments parameter)\n\n\textractPoints( divisions ) {\n\n\t\treturn {\n\n\t\t\tshape: this.getPoints( divisions ),\n\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t};\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = source.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = source.holes[ i ];\n\n\t\t\tthis.holes.push( hole.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.holes = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = this.holes[ i ];\n\t\t\tdata.holes.push( hole.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.uuid = json.uuid;\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = json.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = json.holes[ i ];\n\t\t\tthis.holes.push( new Path().fromJSON( hole ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Port from https://github.com/mapbox/earcut (v2.2.4)\n */\n\nconst Earcut = {\n\n\ttriangulate: function ( data, holeIndices, dim = 2 ) {\n\n\t\tconst hasHoles = holeIndices && holeIndices.length;\n\t\tconst outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length;\n\t\tlet outerNode = linkedList( data, 0, outerLen, dim, true );\n\t\tconst triangles = [];\n\n\t\tif ( ! outerNode || outerNode.next === outerNode.prev ) return triangles;\n\n\t\tlet minX, minY, maxX, maxY, x, y, invSize;\n\n\t\tif ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim );\n\n\t\t// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n\t\tif ( data.length > 80 * dim ) {\n\n\t\t\tminX = maxX = data[ 0 ];\n\t\t\tminY = maxY = data[ 1 ];\n\n\t\t\tfor ( let i = dim; i < outerLen; i += dim ) {\n\n\t\t\t\tx = data[ i ];\n\t\t\t\ty = data[ i + 1 ];\n\t\t\t\tif ( x < minX ) minX = x;\n\t\t\t\tif ( y < minY ) minY = y;\n\t\t\t\tif ( x > maxX ) maxX = x;\n\t\t\t\tif ( y > maxY ) maxY = y;\n\n\t\t\t}\n\n\t\t\t// minX, minY and invSize are later used to transform coords into integers for z-order calculation\n\t\t\tinvSize = Math.max( maxX - minX, maxY - minY );\n\t\t\tinvSize = invSize !== 0 ? 32767 / invSize : 0;\n\n\t\t}\n\n\t\tearcutLinked( outerNode, triangles, dim, minX, minY, invSize, 0 );\n\n\t\treturn triangles;\n\n\t}\n\n};\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList( data, start, end, dim, clockwise ) {\n\n\tlet i, last;\n\n\tif ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) {\n\n\t\tfor ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t} else {\n\n\t\tfor ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t}\n\n\tif ( last && equals( last, last.next ) ) {\n\n\t\tremoveNode( last );\n\t\tlast = last.next;\n\n\t}\n\n\treturn last;\n\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints( start, end ) {\n\n\tif ( ! start ) return start;\n\tif ( ! end ) end = start;\n\n\tlet p = start,\n\t\tagain;\n\tdo {\n\n\t\tagain = false;\n\n\t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n\t\t\tremoveNode( p );\n\t\t\tp = end = p.prev;\n\t\t\tif ( p === p.next ) break;\n\t\t\tagain = true;\n\n\t\t} else {\n\n\t\t\tp = p.next;\n\n\t\t}\n\n\t} while ( again || p !== end );\n\n\treturn end;\n\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {\n\n\tif ( ! ear ) return;\n\n\t// interlink polygon nodes in z-order\n\tif ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize );\n\n\tlet stop = ear,\n\t\tprev, next;\n\n\t// iterate through ears, slicing them one by one\n\twhile ( ear.prev !== ear.next ) {\n\n\t\tprev = ear.prev;\n\t\tnext = ear.next;\n\n\t\tif ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) {\n\n\t\t\t// cut off the triangle\n\t\t\ttriangles.push( prev.i / dim | 0 );\n\t\t\ttriangles.push( ear.i / dim | 0 );\n\t\t\ttriangles.push( next.i / dim | 0 );\n\n\t\t\tremoveNode( ear );\n\n\t\t\t// skipping the next vertex leads to less sliver triangles\n\t\t\tear = next.next;\n\t\t\tstop = next.next;\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tear = next;\n\n\t\t// if we looped through the whole remaining polygon and can't find any more ears\n\t\tif ( ear === stop ) {\n\n\t\t\t// try filtering points and slicing again\n\t\t\tif ( ! pass ) {\n\n\t\t\t\tearcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 );\n\n\t\t\t\t// if this didn't work, try curing all small self-intersections locally\n\n\t\t\t} else if ( pass === 1 ) {\n\n\t\t\t\tear = cureLocalIntersections( filterPoints( ear ), triangles, dim );\n\t\t\t\tearcutLinked( ear, triangles, dim, minX, minY, invSize, 2 );\n\n\t\t\t\t// as a last resort, try splitting the remaining polygon into two\n\n\t\t\t} else if ( pass === 2 ) {\n\n\t\t\t\tsplitEarcut( ear, triangles, dim, minX, minY, invSize );\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar( ear ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\t// now make sure we don't have other points inside the potential ear\n\tconst ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n\t// triangle bbox; min & max are calculated like this for speed\n\tconst x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),\n\t\ty0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),\n\t\tx1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),\n\t\ty1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );\n\n\tlet p = c.next;\n\twhile ( p !== a ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) &&\n\t\t\tarea( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.next;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction isEarHashed( ear, minX, minY, invSize ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\tconst ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n\t// triangle bbox; min & max are calculated like this for speed\n\tconst x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),\n\t\ty0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),\n\t\tx1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),\n\t\ty1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );\n\n\t// z-order range for the current triangle bbox;\n\tconst minZ = zOrder( x0, y0, minX, minY, invSize ),\n\t\tmaxZ = zOrder( x1, y1, minX, minY, invSize );\n\n\tlet p = ear.prevZ,\n\t\tn = ear.nextZ;\n\n\t// look for points inside the triangle in both directions\n\twhile ( p && p.z >= minZ && n && n.z <= maxZ ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t\tif ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\t// look for remaining points in decreasing z-order\n\twhile ( p && p.z >= minZ ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t}\n\n\t// look for remaining points in increasing z-order\n\twhile ( n && n.z <= maxZ ) {\n\n\t\tif ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\treturn true;\n\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections( start, triangles, dim ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tconst a = p.prev,\n\t\t\tb = p.next.next;\n\n\t\tif ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) {\n\n\t\t\ttriangles.push( a.i / dim | 0 );\n\t\t\ttriangles.push( p.i / dim | 0 );\n\t\t\ttriangles.push( b.i / dim | 0 );\n\n\t\t\t// remove two nodes involved\n\t\t\tremoveNode( p );\n\t\t\tremoveNode( p.next );\n\n\t\t\tp = start = b;\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn filterPoints( p );\n\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut( start, triangles, dim, minX, minY, invSize ) {\n\n\t// look for a valid diagonal that divides the polygon into two\n\tlet a = start;\n\tdo {\n\n\t\tlet b = a.next.next;\n\t\twhile ( b !== a.prev ) {\n\n\t\t\tif ( a.i !== b.i && isValidDiagonal( a, b ) ) {\n\n\t\t\t\t// split the polygon in two by the diagonal\n\t\t\t\tlet c = splitPolygon( a, b );\n\n\t\t\t\t// filter colinear points around the cuts\n\t\t\t\ta = filterPoints( a, a.next );\n\t\t\t\tc = filterPoints( c, c.next );\n\n\t\t\t\t// run earcut on each half\n\t\t\t\tearcutLinked( a, triangles, dim, minX, minY, invSize, 0 );\n\t\t\t\tearcutLinked( c, triangles, dim, minX, minY, invSize, 0 );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tb = b.next;\n\n\t\t}\n\n\t\ta = a.next;\n\n\t} while ( a !== start );\n\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles( data, holeIndices, outerNode, dim ) {\n\n\tconst queue = [];\n\tlet i, len, start, end, list;\n\n\tfor ( i = 0, len = holeIndices.length; i < len; i ++ ) {\n\n\t\tstart = holeIndices[ i ] * dim;\n\t\tend = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length;\n\t\tlist = linkedList( data, start, end, dim, false );\n\t\tif ( list === list.next ) list.steiner = true;\n\t\tqueue.push( getLeftmost( list ) );\n\n\t}\n\n\tqueue.sort( compareX );\n\n\t// process holes from left to right\n\tfor ( i = 0; i < queue.length; i ++ ) {\n\n\t\touterNode = eliminateHole( queue[ i ], outerNode );\n\n\t}\n\n\treturn outerNode;\n\n}\n\nfunction compareX( a, b ) {\n\n\treturn a.x - b.x;\n\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole( hole, outerNode ) {\n\n\tconst bridge = findHoleBridge( hole, outerNode );\n\tif ( ! bridge ) {\n\n\t\treturn outerNode;\n\n\t}\n\n\tconst bridgeReverse = splitPolygon( bridge, hole );\n\n\t// filter collinear points around the cuts\n\tfilterPoints( bridgeReverse, bridgeReverse.next );\n\treturn filterPoints( bridge, bridge.next );\n\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge( hole, outerNode ) {\n\n\tlet p = outerNode,\n\t\tqx = - Infinity,\n\t\tm;\n\n\tconst hx = hole.x, hy = hole.y;\n\n\t// find a segment intersected by a ray from the hole's leftmost point to the left;\n\t// segment's endpoint with lesser x will be potential connection point\n\tdo {\n\n\t\tif ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) {\n\n\t\t\tconst x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y );\n\t\t\tif ( x <= hx && x > qx ) {\n\n\t\t\t\tqx = x;\n\t\t\t\tm = p.x < p.next.x ? p : p.next;\n\t\t\t\tif ( x === hx ) return m; // hole touches outer segment; pick leftmost endpoint\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== outerNode );\n\n\tif ( ! m ) return null;\n\n\t// look for points inside the triangle of hole point, segment intersection and endpoint;\n\t// if there are no points found, we have a valid connection;\n\t// otherwise choose the point of the minimum angle with the ray as connection point\n\n\tconst stop = m,\n\t\tmx = m.x,\n\t\tmy = m.y;\n\tlet tanMin = Infinity, tan;\n\n\tp = m;\n\n\tdo {\n\n\t\tif ( hx >= p.x && p.x >= mx && hx !== p.x &&\n\t\t\t\tpointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) {\n\n\t\t\ttan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential\n\n\t\t\tif ( locallyInside( p, hole ) && ( tan < tanMin || ( tan === tanMin && ( p.x > m.x || ( p.x === m.x && sectorContainsSector( m, p ) ) ) ) ) ) {\n\n\t\t\t\tm = p;\n\t\t\t\ttanMin = tan;\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== stop );\n\n\treturn m;\n\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve( start, minX, minY, invSize ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tif ( p.z === 0 ) p.z = zOrder( p.x, p.y, minX, minY, invSize );\n\t\tp.prevZ = p.prev;\n\t\tp.nextZ = p.next;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\tp.prevZ.nextZ = null;\n\tp.prevZ = null;\n\n\tsortLinked( p );\n\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked( list ) {\n\n\tlet i, p, q, e, tail, numMerges, pSize, qSize,\n\t\tinSize = 1;\n\n\tdo {\n\n\t\tp = list;\n\t\tlist = null;\n\t\ttail = null;\n\t\tnumMerges = 0;\n\n\t\twhile ( p ) {\n\n\t\t\tnumMerges ++;\n\t\t\tq = p;\n\t\t\tpSize = 0;\n\t\t\tfor ( i = 0; i < inSize; i ++ ) {\n\n\t\t\t\tpSize ++;\n\t\t\t\tq = q.nextZ;\n\t\t\t\tif ( ! q ) break;\n\n\t\t\t}\n\n\t\t\tqSize = inSize;\n\n\t\t\twhile ( pSize > 0 || ( qSize > 0 && q ) ) {\n\n\t\t\t\tif ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) {\n\n\t\t\t\t\te = p;\n\t\t\t\t\tp = p.nextZ;\n\t\t\t\t\tpSize --;\n\n\t\t\t\t} else {\n\n\t\t\t\t\te = q;\n\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\tqSize --;\n\n\t\t\t\t}\n\n\t\t\t\tif ( tail ) tail.nextZ = e;\n\t\t\t\telse list = e;\n\n\t\t\t\te.prevZ = tail;\n\t\t\t\ttail = e;\n\n\t\t\t}\n\n\t\t\tp = q;\n\n\t\t}\n\n\t\ttail.nextZ = null;\n\t\tinSize *= 2;\n\n\t} while ( numMerges > 1 );\n\n\treturn list;\n\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\tx = ( x - minX ) * invSize | 0;\n\ty = ( y - minY ) * invSize | 0;\n\n\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\treturn x | ( y << 1 );\n\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost( start ) {\n\n\tlet p = start,\n\t\tleftmost = start;\n\tdo {\n\n\t\tif ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn leftmost;\n\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) >= ( ax - px ) * ( cy - py ) &&\n ( ax - px ) * ( by - py ) >= ( bx - px ) * ( ay - py ) &&\n ( bx - px ) * ( cy - py ) >= ( cx - px ) * ( by - py );\n\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal( a, b ) {\n\n\treturn a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges\n ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible\n ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors\n equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case\n\n}\n\n// signed area of a triangle\nfunction area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}\n\n// check if two points are equal\nfunction equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}\n\n// check if two segments intersect\nfunction intersects( p1, q1, p2, q2 ) {\n\n\tconst o1 = sign( area( p1, q1, p2 ) );\n\tconst o2 = sign( area( p1, q1, q2 ) );\n\tconst o3 = sign( area( p2, q2, p1 ) );\n\tconst o4 = sign( area( p2, q2, q1 ) );\n\n\tif ( o1 !== o2 && o3 !== o4 ) return true; // general case\n\n\tif ( o1 === 0 && onSegment( p1, p2, q1 ) ) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n\tif ( o2 === 0 && onSegment( p1, q2, q1 ) ) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n\tif ( o3 === 0 && onSegment( p2, p1, q2 ) ) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n\tif ( o4 === 0 && onSegment( p2, q1, q2 ) ) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n\treturn false;\n\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}\n\nfunction sign( num ) {\n\n\treturn num > 0 ? 1 : num < 0 ? - 1 : 0;\n\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon( a, b ) {\n\n\tlet p = a;\n\tdo {\n\n\t\tif ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n\t\t\tintersects( p, p.next, a, b ) ) return true;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn false;\n\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside( a, b ) {\n\n\treturn area( a.prev, a, a.next ) < 0 ?\n\t\tarea( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 :\n\t\tarea( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0;\n\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon( a, b ) {\n\n\tconst a2 = new Node( a.i, a.x, a.y ),\n\t\tb2 = new Node( b.i, b.x, b.y ),\n\t\tan = a.next,\n\t\tbp = b.prev;\n\n\ta.next = b;\n\tb.prev = a;\n\n\ta2.next = an;\n\tan.prev = a2;\n\n\tb2.next = a2;\n\ta2.prev = b2;\n\n\tbp.next = b2;\n\tb2.prev = bp;\n\n\treturn b2;\n\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode( i, x, y, last ) {\n\n\tconst p = new Node( i, x, y );\n\n\tif ( ! last ) {\n\n\t\tp.prev = p;\n\t\tp.next = p;\n\n\t} else {\n\n\t\tp.next = last.next;\n\t\tp.prev = last;\n\t\tlast.next.prev = p;\n\t\tlast.next = p;\n\n\t}\n\n\treturn p;\n\n}\n\nfunction removeNode( p ) {\n\n\tp.next.prev = p.prev;\n\tp.prev.next = p.next;\n\n\tif ( p.prevZ ) p.prevZ.nextZ = p.nextZ;\n\tif ( p.nextZ ) p.nextZ.prevZ = p.prevZ;\n\n}\n\nfunction Node( i, x, y ) {\n\n\t// vertex index in coordinates array\n\tthis.i = i;\n\n\t// vertex coordinates\n\tthis.x = x;\n\tthis.y = y;\n\n\t// previous and next vertex nodes in a polygon ring\n\tthis.prev = null;\n\tthis.next = null;\n\n\t// z-order curve value\n\tthis.z = 0;\n\n\t// previous and next nodes in z-order\n\tthis.prevZ = null;\n\tthis.nextZ = null;\n\n\t// indicates whether this is a steiner point\n\tthis.steiner = false;\n\n}\n\nfunction signedArea( data, start, end, dim ) {\n\n\tlet sum = 0;\n\tfor ( let i = start, j = end - dim; i < end; i += dim ) {\n\n\t\tsum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] );\n\t\tj = i;\n\n\t}\n\n\treturn sum;\n\n}\n\nclass ShapeUtils {\n\n\t// calculate area of the contour polygon\n\n\tstatic area( contour ) {\n\n\t\tconst n = contour.length;\n\t\tlet a = 0.0;\n\n\t\tfor ( let p = n - 1, q = 0; q < n; p = q ++ ) {\n\n\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t}\n\n\t\treturn a * 0.5;\n\n\t}\n\n\tstatic isClockWise( pts ) {\n\n\t\treturn ShapeUtils.area( pts ) < 0;\n\n\t}\n\n\tstatic triangulateShape( contour, holes ) {\n\n\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\t\tconst holeIndices = []; // array of hole indices\n\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\tremoveDupEndPts( contour );\n\t\taddContour( vertices, contour );\n\n\t\t//\n\n\t\tlet holeIndex = contour.length;\n\n\t\tholes.forEach( removeDupEndPts );\n\n\t\tfor ( let i = 0; i < holes.length; i ++ ) {\n\n\t\t\tholeIndices.push( holeIndex );\n\t\t\tholeIndex += holes[ i ].length;\n\t\t\taddContour( vertices, holes[ i ] );\n\n\t\t}\n\n\t\t//\n\n\t\tconst triangles = Earcut.triangulate( vertices, holeIndices );\n\n\t\t//\n\n\t\tfor ( let i = 0; i < triangles.length; i += 3 ) {\n\n\t\t\tfaces.push( triangles.slice( i, i + 3 ) );\n\n\t\t}\n\n\t\treturn faces;\n\n\t}\n\n}\n\nfunction removeDupEndPts( points ) {\n\n\tconst l = points.length;\n\n\tif ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\tpoints.pop();\n\n\t}\n\n}\n\nfunction addContour( vertices, contour ) {\n\n\tfor ( let i = 0; i < contour.length; i ++ ) {\n\n\t\tvertices.push( contour[ i ].x );\n\t\tvertices.push( contour[ i ].y );\n\n\t}\n\n}\n\n/**\n * Creates extruded geometry from a path shape.\n *\n * parameters = {\n *\n * curveSegments: , // number of points on the curves\n * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n * depth: , // Depth to extrude the shape\n *\n * bevelEnabled: , // turn on bevel\n * bevelThickness: , // how deep into the original shape bevel goes\n * bevelSize: , // how far from shape outline (including bevelOffset) is bevel\n * bevelOffset: , // how far from shape outline does bevel start\n * bevelSegments: , // number of bevel layers\n *\n * extrudePath: // curve to extrude shape along\n *\n * UVGenerator: // object that provides UV generator functions\n *\n * }\n */\n\n\nclass ExtrudeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\toptions: options\n\t\t};\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tconst scope = this;\n\n\t\tconst verticesArray = [];\n\t\tconst uvArray = [];\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\t\t\taddShape( shape );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );\n\n\t\tthis.computeVertexNormals();\n\n\t\t// functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst placeholder = [];\n\n\t\t\t// options\n\n\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\tconst depth = options.depth !== undefined ? options.depth : 1;\n\n\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\t\tconst extrudePath = options.extrudePath;\n\n\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;\n\n\t\t\t//\n\n\t\t\tlet extrudePts, extrudeByPath = false;\n\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\tif ( extrudePath ) {\n\n\t\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\t\textrudeByPath = true;\n\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t\t// SETUP TNB variables\n\n\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\tsplineTube = extrudePath.computeFrenetFrames( steps, false );\n\n\t\t\t\t// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\tbinormal = new Vector3();\n\t\t\t\tnormal = new Vector3();\n\t\t\t\tposition2 = new Vector3();\n\n\t\t\t}\n\n\t\t\t// Safeguards if bevels are not enabled\n\n\t\t\tif ( ! bevelEnabled ) {\n\n\t\t\t\tbevelSegments = 0;\n\t\t\t\tbevelThickness = 0;\n\t\t\t\tbevelSize = 0;\n\t\t\t\tbevelOffset = 0;\n\n\t\t\t}\n\n\t\t\t// Variables initialization\n\n\t\t\tconst shapePoints = shape.extractPoints( curveSegments );\n\n\t\t\tlet vertices = shapePoints.shape;\n\t\t\tconst holes = shapePoints.holes;\n\n\t\t\tconst reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\t\tif ( reverse ) {\n\n\t\t\t\tvertices = vertices.reverse();\n\n\t\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( vertices, holes );\n\n\t\t\t/* Vertices */\n\n\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\tvertices = vertices.concat( ahole );\n\n\t\t\t}\n\n\n\t\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\t\tif ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );\n\n\t\t\t\treturn pt.clone().addScaledVector( vec, size );\n\n\t\t\t}\n\n\t\t\tconst vlen = vertices.length, flen = faces.length;\n\n\n\t\t\t// Find directions for point movement\n\n\n\t\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t// shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t//\n\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t// adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\n\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\n\t\t\t\tconst v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t\t// check for collinear edges\n\t\t\t\tconst collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\tif ( Math.abs( collinear0 ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not collinear\n\n\t\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\t\tconst v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\t\tconst v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\t\tconst ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\t\tconst ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\t\tconst ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\t\tconst ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\t\tconst sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t// but prevent crazy spikes\n\t\t\t\t\tconst v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\t\tif ( v_trans_lensq <= 2 ) {\n\n\t\t\t\t\t\treturn new Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\tif ( v_prev_x > Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x > Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( v_prev_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tif ( v_next_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t\t}\n\n\n\t\t\tconst contourMovements = [];\n\n\t\t\tfor ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t\t}\n\n\t\t\tconst holesMovements = [];\n\t\t\tlet oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\toneHoleMovements = [];\n\n\t\t\t\tfor ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t\t}\n\n\t\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t\t}\n\n\n\t\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\t\tfor ( let b = 0; b < bevelSegments; b ++ ) {\n\n\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst bs = bevelSize + bevelOffset;\n\n\t\t\t// Back facing vertices\n\n\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Add stepped vertices...\n\t\t\t// Including front facing vertices\n\n\t\t\tfor ( let s = 1; s <= steps; s ++ ) {\n\n\t\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, depth / steps * s );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// Add bevel segments planes\n\n\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\t\t\tfor ( let b = bevelSegments - 1; b >= 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/* Faces */\n\n\t\t\t// Top and bottom faces\n\n\t\t\tbuildLidFaces();\n\n\t\t\t// Sides faces\n\n\t\t\tbuildSideFaces();\n\n\n\t\t\t///// Internal functions\n\n\t\t\tfunction buildLidFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\t\tlet layer = 0; // steps + 1\n\t\t\t\t\tlet offset = vlen * layer;\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 0 );\n\n\t\t\t}\n\n\t\t\t// Create faces for the z-sides of the shape\n\n\t\t\tfunction buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}\n\n\t\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\t\tlet i = contour.length;\n\n\t\t\t\twhile ( -- i >= 0 ) {\n\n\t\t\t\t\tconst j = i;\n\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\tfor ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {\n\n\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\tconst slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction v( x, y, z ) {\n\n\t\t\t\tplaceholder.push( x );\n\t\t\t\tplaceholder.push( y );\n\t\t\t\tplaceholder.push( z );\n\n\t\t\t}\n\n\n\t\t\tfunction f3( a, b, c ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\n\t\t\t}\n\n\t\t\tfunction f4( a, b, c, d ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( d );\n\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\t\t\t\taddVertex( d );\n\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t}\n\n\t\t\tfunction addVertex( index ) {\n\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 0 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 1 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 2 ] );\n\n\t\t\t}\n\n\n\t\t\tfunction addUV( vector2 ) {\n\n\t\t\t\tuvArray.push( vector2.x );\n\t\t\t\tuvArray.push( vector2.y );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\t\tconst options = this.parameters.options;\n\n\t\treturn toJSON$1( shapes, options, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\tconst extrudePath = data.options.extrudePath;\n\n\t\tif ( extrudePath !== undefined ) {\n\n\t\t\tdata.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath );\n\n\t\t}\n\n\t\treturn new ExtrudeGeometry( geometryShapes, data.options );\n\n\t}\n\n}\n\nconst WorldUVGenerator = {\n\n\tgenerateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\n\t\treturn [\n\t\t\tnew Vector2( a_x, a_y ),\n\t\t\tnew Vector2( b_x, b_y ),\n\t\t\tnew Vector2( c_x, c_y )\n\t\t];\n\n\t},\n\n\tgenerateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst a_z = vertices[ indexA * 3 + 2 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst b_z = vertices[ indexB * 3 + 2 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\t\tconst c_z = vertices[ indexC * 3 + 2 ];\n\t\tconst d_x = vertices[ indexD * 3 ];\n\t\tconst d_y = vertices[ indexD * 3 + 1 ];\n\t\tconst d_z = vertices[ indexD * 3 + 2 ];\n\n\t\tif ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_x, 1 - a_z ),\n\t\t\t\tnew Vector2( b_x, 1 - b_z ),\n\t\t\t\tnew Vector2( c_x, 1 - c_z ),\n\t\t\t\tnew Vector2( d_x, 1 - d_z )\n\t\t\t];\n\n\t\t} else {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_y, 1 - a_z ),\n\t\t\t\tnew Vector2( b_y, 1 - b_z ),\n\t\t\t\tnew Vector2( c_y, 1 - c_z ),\n\t\t\t\tnew Vector2( d_y, 1 - d_z )\n\t\t\t];\n\n\t\t}\n\n\t}\n\n};\n\nfunction toJSON$1( shapes, options, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\tdata.options = Object.assign( {}, options );\n\n\tif ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON();\n\n\treturn data;\n\n}\n\nclass IcosahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tconst vertices = [\n\t\t\t- 1, t, 0, \t1, t, 0, \t- 1, - t, 0, \t1, - t, 0,\n\t\t\t0, - 1, t, \t0, 1, t,\t0, - 1, - t, \t0, 1, - t,\n\t\t\tt, 0, - 1, \tt, 0, 1, \t- t, 0, - 1, \t- t, 0, 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 11, 5, \t0, 5, 1, \t0, 1, 7, \t0, 7, 10, \t0, 10, 11,\n\t\t\t1, 5, 9, \t5, 11, 4,\t11, 10, 2,\t10, 7, 6,\t7, 1, 8,\n\t\t\t3, 9, 4, \t3, 4, 2,\t3, 2, 6,\t3, 6, 8,\t3, 8, 9,\n\t\t\t4, 9, 5, \t2, 4, 11,\t6, 2, 10,\t8, 6, 7,\t9, 8, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new IcosahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass OctahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 0, 0, \t- 1, 0, 0,\t0, 1, 0,\n\t\t\t0, - 1, 0, \t0, 0, 1,\t0, 0, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 2, 4,\t0, 4, 3,\t0, 3, 5,\n\t\t\t0, 5, 2,\t1, 2, 5,\t1, 5, 3,\n\t\t\t1, 3, 4,\t1, 4, 2\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new OctahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass RingGeometry extends BufferGeometry {\n\n\tconstructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'RingGeometry';\n\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthetaSegments = Math.max( 3, thetaSegments );\n\t\tphiSegments = Math.max( 1, phiSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// some helper variables\n\n\t\tlet radius = innerRadius;\n\t\tconst radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= phiSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= thetaSegments; i ++ ) {\n\n\t\t\t\t// values are generate from the inside of the ring to the outside\n\n\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let j = 0; j < phiSegments; j ++ ) {\n\n\t\t\tconst thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( let i = 0; i < thetaSegments; i ++ ) {\n\n\t\t\t\tconst segment = i + thetaSegmentLevel;\n\n\t\t\t\tconst a = segment;\n\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\tconst d = segment + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ShapeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShapeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\tcurveSegments: curveSegments\n\t\t};\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet groupStart = 0;\n\t\tlet groupCount = 0;\n\n\t\t// allow single and array values for \"shapes\" parameter\n\n\t\tif ( Array.isArray( shapes ) === false ) {\n\n\t\t\taddShape( shapes );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0; i < shapes.length; i ++ ) {\n\n\t\t\t\taddShape( shapes[ i ] );\n\n\t\t\t\tthis.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t\tgroupCount = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\n\t\t// helper functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\tconst points = shape.extractPoints( curveSegments );\n\n\t\t\tlet shapeVertices = points.shape;\n\t\t\tconst shapeHoles = points.holes;\n\n\t\t\t// check direction of vertices\n\n\t\t\tif ( ShapeUtils.isClockWise( shapeVertices ) === false ) {\n\n\t\t\t\tshapeVertices = shapeVertices.reverse();\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( shapeHole ) === true ) {\n\n\t\t\t\t\tshapeHoles[ i ] = shapeHole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );\n\n\t\t\t// join vertices of inner and outer paths to a single array\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\t\t\t\tshapeVertices = shapeVertices.concat( shapeHole );\n\n\t\t\t}\n\n\t\t\t// vertices, normals, uvs\n\n\t\t\tfor ( let i = 0, l = shapeVertices.length; i < l; i ++ ) {\n\n\t\t\t\tconst vertex = shapeVertices[ i ];\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, 0 );\n\t\t\t\tnormals.push( 0, 0, 1 );\n\t\t\t\tuvs.push( vertex.x, vertex.y ); // world uvs\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tconst face = faces[ i ];\n\n\t\t\t\tconst a = face[ 0 ] + indexOffset;\n\t\t\t\tconst b = face[ 1 ] + indexOffset;\n\t\t\t\tconst c = face[ 2 ] + indexOffset;\n\n\t\t\t\tindices.push( a, b, c );\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\n\t\treturn toJSON( shapes, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\treturn new ShapeGeometry( geometryShapes, data.curveSegments );\n\n\t}\n\n}\n\nfunction toJSON( shapes, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\treturn data;\n\n}\n\nclass SphereGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 && thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments && thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = - 0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass TetrahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 1, 1, \t- 1, - 1, 1, \t- 1, 1, - 1, \t1, - 1, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t2, 1, 0, \t0, 3, 2,\t1, 3, 0,\t2, 3, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TetrahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass TorusGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\ttubularSegments = Math.floor( tubularSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst center = new Vector3();\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tconst b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tconst c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tconst d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );\n\n\t}\n\n}\n\nclass TorusKnotGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\ttubularSegments = Math.floor( tubularSegments );\n\t\tradialSegments = Math.floor( radialSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\tconst P1 = new Vector3();\n\t\tconst P2 = new Vector3();\n\n\t\tconst B = new Vector3();\n\t\tconst T = new Vector3();\n\t\tconst N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let i = 0; i <= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segment\n\n\t\t\tconst u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( let j = 0; j <= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\tconst cx = - tube * Math.cos( v );\n\t\t\t\tconst cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectors, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );\n\n\t}\n\n}\n\nclass TubeGeometry extends BufferGeometry {\n\n\tconstructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TubeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tconst frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tlet P = new Vector3();\n\n\t\t// buffer\n\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\t\tconst indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( let i = 0; i < tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tP = path.getPointAt( i / tubularSegments, P );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tconst N = frames.normals[ i ];\n\t\t\tconst B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tconst sin = Math.sin( v );\n\t\t\t\tconst cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.path = this.parameters.path.toJSON();\n\n\t\treturn data;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\treturn new TubeGeometry(\n\t\t\tnew Curves[ data.path.type ]().fromJSON( data.path ),\n\t\t\tdata.tubularSegments,\n\t\t\tdata.radius,\n\t\t\tdata.radialSegments,\n\t\t\tdata.closed\n\t\t);\n\n\t}\n\n}\n\nclass WireframeGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'WireframeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\t// buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst edges = new Set();\n\n\t\t\t// helper variables\n\n\t\t\tconst start = new Vector3();\n\t\t\tconst end = new Vector3();\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst indices = geometry.index;\n\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgroups = [ { start: 0, count: indices.count, materialIndex: 0 } ];\n\n\t\t\t\t}\n\n\t\t\t\t// create a data structure that contains all edges without duplicates\n\n\t\t\t\tfor ( let o = 0, ol = groups.length; o < ol; ++ o ) {\n\n\t\t\t\t\tconst group = groups[ o ];\n\n\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\tfor ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) {\n\n\t\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\tconst index1 = indices.getX( i + j );\n\t\t\t\t\t\t\tconst index2 = indices.getX( i + ( j + 1 ) % 3 );\n\n\t\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\tfor ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {\n\n\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\n\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\tconst index2 = 3 * i + ( ( j + 1 ) % 3 );\n\n\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// build geometry\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction isUniqueEdge( start, end, edges ) {\n\n\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\tif ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) {\n\n\t\treturn false;\n\n\t} else {\n\n\t\tedges.add( hash1 );\n\t\tedges.add( hash2 );\n\t\treturn true;\n\n\t}\n\n}\n\nvar Geometries = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tBoxGeometry: BoxGeometry,\n\tCapsuleGeometry: CapsuleGeometry,\n\tCircleGeometry: CircleGeometry,\n\tConeGeometry: ConeGeometry,\n\tCylinderGeometry: CylinderGeometry,\n\tDodecahedronGeometry: DodecahedronGeometry,\n\tEdgesGeometry: EdgesGeometry,\n\tExtrudeGeometry: ExtrudeGeometry,\n\tIcosahedronGeometry: IcosahedronGeometry,\n\tLatheGeometry: LatheGeometry,\n\tOctahedronGeometry: OctahedronGeometry,\n\tPlaneGeometry: PlaneGeometry,\n\tPolyhedronGeometry: PolyhedronGeometry,\n\tRingGeometry: RingGeometry,\n\tShapeGeometry: ShapeGeometry,\n\tSphereGeometry: SphereGeometry,\n\tTetrahedronGeometry: TetrahedronGeometry,\n\tTorusGeometry: TorusGeometry,\n\tTorusKnotGeometry: TorusKnotGeometry,\n\tTubeGeometry: TubeGeometry,\n\tWireframeGeometry: WireframeGeometry\n});\n\nclass ShadowMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isShadowMaterial = true;\n\n\t\tthis.type = 'ShadowMaterial';\n\n\t\tthis.color = new Color( 0x000000 );\n\t\tthis.transparent = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass RawShaderMaterial extends ShaderMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper( parameters );\n\n\t\tthis.isRawShaderMaterial = true;\n\n\t\tthis.type = 'RawShaderMaterial';\n\n\t}\n\n}\n\nclass MeshStandardMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshStandardMaterial = true;\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.type = 'MeshStandardMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.roughness = 1.0;\n\t\tthis.metalness = 0.0;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.roughnessMap = null;\n\n\t\tthis.metalnessMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.envMapIntensity = 1.0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshPhysicalMaterial = true;\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.type = 'MeshPhysicalMaterial';\n\n\t\tthis.anisotropyRotation = 0;\n\t\tthis.anisotropyMap = null;\n\n\t\tthis.clearcoatMap = null;\n\t\tthis.clearcoatRoughness = 0.0;\n\t\tthis.clearcoatRoughnessMap = null;\n\t\tthis.clearcoatNormalScale = new Vector2( 1, 1 );\n\t\tthis.clearcoatNormalMap = null;\n\n\t\tthis.ior = 1.5;\n\n\t\tObject.defineProperty( this, 'reflectivity', {\n\t\t\tget: function () {\n\n\t\t\t\treturn ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );\n\n\t\t\t},\n\t\t\tset: function ( reflectivity ) {\n\n\t\t\t\tthis.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );\n\n\t\t\t}\n\t\t} );\n\n\t\tthis.iridescenceMap = null;\n\t\tthis.iridescenceIOR = 1.3;\n\t\tthis.iridescenceThicknessRange = [ 100, 400 ];\n\t\tthis.iridescenceThicknessMap = null;\n\n\t\tthis.sheenColor = new Color( 0x000000 );\n\t\tthis.sheenColorMap = null;\n\t\tthis.sheenRoughness = 1.0;\n\t\tthis.sheenRoughnessMap = null;\n\n\t\tthis.transmissionMap = null;\n\n\t\tthis.thickness = 0;\n\t\tthis.thicknessMap = null;\n\t\tthis.attenuationDistance = Infinity;\n\t\tthis.attenuationColor = new Color( 1, 1, 1 );\n\n\t\tthis.specularIntensity = 1.0;\n\t\tthis.specularIntensityMap = null;\n\t\tthis.specularColor = new Color( 1, 1, 1 );\n\t\tthis.specularColorMap = null;\n\n\t\tthis._anisotropy = 0;\n\t\tthis._clearcoat = 0;\n\t\tthis._dispersion = 0;\n\t\tthis._iridescence = 0;\n\t\tthis._sheen = 0.0;\n\t\tthis._transmission = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tget anisotropy() {\n\n\t\treturn this._anisotropy;\n\n\t}\n\n\tset anisotropy( value ) {\n\n\t\tif ( this._anisotropy > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._anisotropy = value;\n\n\t}\n\n\tget clearcoat() {\n\n\t\treturn this._clearcoat;\n\n\t}\n\n\tset clearcoat( value ) {\n\n\t\tif ( this._clearcoat > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._clearcoat = value;\n\n\t}\n\n\tget iridescence() {\n\n\t\treturn this._iridescence;\n\n\t}\n\n\tset iridescence( value ) {\n\n\t\tif ( this._iridescence > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._iridescence = value;\n\n\t}\n\n\tget dispersion() {\n\n\t\treturn this._dispersion;\n\n\t}\n\n\tset dispersion( value ) {\n\n\t\tif ( this._dispersion > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._dispersion = value;\n\n\t}\n\n\tget sheen() {\n\n\t\treturn this._sheen;\n\n\t}\n\n\tset sheen( value ) {\n\n\t\tif ( this._sheen > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._sheen = value;\n\n\t}\n\n\tget transmission() {\n\n\t\treturn this._transmission;\n\n\t}\n\n\tset transmission( value ) {\n\n\t\tif ( this._transmission > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._transmission = value;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.anisotropy = source.anisotropy;\n\t\tthis.anisotropyRotation = source.anisotropyRotation;\n\t\tthis.anisotropyMap = source.anisotropyMap;\n\n\t\tthis.clearcoat = source.clearcoat;\n\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\tthis.clearcoatNormalScale.copy( source.clearcoatNormalScale );\n\n\t\tthis.dispersion = source.dispersion;\n\t\tthis.ior = source.ior;\n\n\t\tthis.iridescence = source.iridescence;\n\t\tthis.iridescenceMap = source.iridescenceMap;\n\t\tthis.iridescenceIOR = source.iridescenceIOR;\n\t\tthis.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];\n\t\tthis.iridescenceThicknessMap = source.iridescenceThicknessMap;\n\n\t\tthis.sheen = source.sheen;\n\t\tthis.sheenColor.copy( source.sheenColor );\n\t\tthis.sheenColorMap = source.sheenColorMap;\n\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\tthis.sheenRoughnessMap = source.sheenRoughnessMap;\n\n\t\tthis.transmission = source.transmission;\n\t\tthis.transmissionMap = source.transmissionMap;\n\n\t\tthis.thickness = source.thickness;\n\t\tthis.thicknessMap = source.thicknessMap;\n\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\tthis.attenuationColor.copy( source.attenuationColor );\n\n\t\tthis.specularIntensity = source.specularIntensity;\n\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\tthis.specularColor.copy( source.specularColor );\n\t\tthis.specularColorMap = source.specularColorMap;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshPhongMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshPhongMaterial = true;\n\n\t\tthis.type = 'MeshPhongMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.specular = new Color( 0x111111 );\n\t\tthis.shininess = 30;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshToonMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshToonMaterial = true;\n\n\t\tthis.defines = { 'TOON': '' };\n\n\t\tthis.type = 'MeshToonMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\t\tthis.gradientMap = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\t\tthis.gradientMap = source.gradientMap;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshNormalMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshNormalMaterial = true;\n\n\t\tthis.type = 'MeshNormalMaterial';\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshLambertMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshLambertMaterial = true;\n\n\t\tthis.type = 'MeshLambertMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshMatcapMaterial extends Material {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshMatcapMaterial = true;\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.type = 'MeshMatcapMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.matcap = null;\n\n\t\tthis.map = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.matcap = source.matcap;\n\n\t\tthis.map = source.map;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineDashedMaterial extends LineBasicMaterial {\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isLineDashedMaterial = true;\n\n\t\tthis.type = 'LineDashedMaterial';\n\n\t\tthis.scale = 1;\n\t\tthis.dashSize = 3;\n\t\tthis.gapSize = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// converts an array to a specific type\nfunction convertArray( array, type, forceClone ) {\n\n\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t! forceClone && array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototype.slice.call( array ); // create Array\n\n}\n\nfunction isTypedArray( object ) {\n\n\treturn ArrayBuffer.isView( object ) &&\n\t\t! ( object instanceof DataView );\n\n}\n\n// returns an array by which times and values can be sorted\nfunction getKeyframeOrder( times ) {\n\n\tfunction compareTime( i, j ) {\n\n\t\treturn times[ i ] - times[ j ];\n\n\t}\n\n\tconst n = times.length;\n\tconst result = new Array( n );\n\tfor ( let i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\tresult.sort( compareTime );\n\n\treturn result;\n\n}\n\n// uses the array previously returned by 'getKeyframeOrder' to sort data\nfunction sortedArray( values, stride, order ) {\n\n\tconst nValues = values.length;\n\tconst result = new values.constructor( nValues );\n\n\tfor ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\tconst srcOffset = order[ i ] * stride;\n\n\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t}\n\n\t}\n\n\treturn result;\n\n}\n\n// function for parsing AOS keyframe formats\nfunction flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\tlet i = 1, key = jsonKeys[ 0 ];\n\n\twhile ( key !== undefined && key[ valuePropertyName ] === undefined ) {\n\n\t\tkey = jsonKeys[ i ++ ];\n\n\t}\n\n\tif ( key === undefined ) return; // no data\n\n\tlet value = key[ valuePropertyName ];\n\tif ( value === undefined ) return; // no data\n\n\tif ( Array.isArray( value ) ) {\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push.apply( values, value ); // push all elements\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else if ( value.toArray !== undefined ) {\n\n\t\t// ...assume THREE.Math-ish\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else {\n\n\t\t// otherwise push as-is\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( value );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t}\n\n}\n\nfunction subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\tconst clip = sourceClip.clone();\n\n\tclip.name = name;\n\n\tconst tracks = [];\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tconst track = clip.tracks[ i ];\n\t\tconst valueSize = track.getValueSize();\n\n\t\tconst times = [];\n\t\tconst values = [];\n\n\t\tfor ( let j = 0; j < track.times.length; ++ j ) {\n\n\t\t\tconst frame = track.times[ j ] * fps;\n\n\t\t\tif ( frame < startFrame || frame >= endFrame ) continue;\n\n\t\t\ttimes.push( track.times[ j ] );\n\n\t\t\tfor ( let k = 0; k < valueSize; ++ k ) {\n\n\t\t\t\tvalues.push( track.values[ j * valueSize + k ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( times.length === 0 ) continue;\n\n\t\ttrack.times = convertArray( times, track.times.constructor );\n\t\ttrack.values = convertArray( values, track.values.constructor );\n\n\t\ttracks.push( track );\n\n\t}\n\n\tclip.tracks = tracks;\n\n\t// find minimum .times value across all tracks in the trimmed clip\n\n\tlet minStartTime = Infinity;\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tif ( minStartTime > clip.tracks[ i ].times[ 0 ] ) {\n\n\t\t\tminStartTime = clip.tracks[ i ].times[ 0 ];\n\n\t\t}\n\n\t}\n\n\t// shift all tracks such that clip begins at t=0\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tclip.tracks[ i ].shift( - 1 * minStartTime );\n\n\t}\n\n\tclip.resetDuration();\n\n\treturn clip;\n\n}\n\nfunction makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\tif ( fps <= 0 ) fps = 30;\n\n\tconst numTracks = referenceClip.tracks.length;\n\tconst referenceTime = referenceFrame / fps;\n\n\t// Make each track's values relative to the values at the reference frame\n\tfor ( let i = 0; i < numTracks; ++ i ) {\n\n\t\tconst referenceTrack = referenceClip.tracks[ i ];\n\t\tconst referenceTrackType = referenceTrack.ValueTypeName;\n\n\t\t// Skip this track if it's non-numeric\n\t\tif ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue;\n\n\t\t// Find the track in the target clip whose name and type matches the reference track\n\t\tconst targetTrack = targetClip.tracks.find( function ( track ) {\n\n\t\t\treturn track.name === referenceTrack.name\n\t\t\t\t&& track.ValueTypeName === referenceTrackType;\n\n\t\t} );\n\n\t\tif ( targetTrack === undefined ) continue;\n\n\t\tlet referenceOffset = 0;\n\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\tif ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\treferenceOffset = referenceValueSize / 3;\n\n\t\t}\n\n\t\tlet targetOffset = 0;\n\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\tif ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\ttargetOffset = targetValueSize / 3;\n\n\t\t}\n\n\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\tlet referenceValue;\n\n\t\t// Find the value to subtract out of the track\n\t\tif ( referenceTime <= referenceTrack.times[ 0 ] ) {\n\n\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) {\n\n\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else {\n\n\t\t\t// Interpolate to the reference value\n\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\tinterpolant.evaluate( referenceTime );\n\t\t\treferenceValue = interpolant.resultBuffer.slice( startIndex, endIndex );\n\n\t\t}\n\n\t\t// Conjugate the quaternion\n\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\tconst referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate();\n\t\t\treferenceQuat.toArray( referenceValue );\n\n\t\t}\n\n\t\t// Subtract the reference value from all of the track values\n\n\t\tconst numTimes = targetTrack.times.length;\n\t\tfor ( let j = 0; j < numTimes; ++ j ) {\n\n\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\tQuaternion.multiplyQuaternionsFlat(\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart,\n\t\t\t\t\treferenceValue,\n\t\t\t\t\t0,\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2;\n\n\t\t\t\t// Subtract each value for all other numeric track types\n\t\t\t\tfor ( let k = 0; k < valueEnd; ++ k ) {\n\n\t\t\t\t\ttargetTrack.values[ valueStart + k ] -= referenceValue[ k ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\n\treturn targetClip;\n\n}\n\nconst AnimationUtils = {\n\tconvertArray: convertArray,\n\tisTypedArray: isTypedArray,\n\tgetKeyframeOrder: getKeyframeOrder,\n\tsortedArray: sortedArray,\n\tflattenJSON: flattenJSON,\n\tsubclip: subclip,\n\tmakeClipAdditive: makeClipAdditive\n};\n\n/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References:\n *\n * \t\thttp://www.oodesign.com/template-method-pattern.html\n *\n */\n\nclass Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\n\t\tthis.resultBuffer = resultBuffer !== undefined ?\n\t\t\tresultBuffer : new sampleValues.constructor( sampleSize );\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\n\t}\n\n\tevaluate( t ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\tt1 = pp[ i1 ],\n\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\tvalidate_interval: {\n\n\t\t\tseek: {\n\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if ( ! ( t < t1 ) ) {\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 + 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\tif ( t < t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\tif ( t < t1 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\t\t\t\t\tif ( ! ( t >= t0 ) ) {\n\n\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\tconst t1global = pp[ 1 ];\n\n\t\t\t\t\t\tif ( t < t1global ) {\n\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 - 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\tif ( t >= t0 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t} // linear scan\n\n\t\t\t\t// binary search\n\n\t\t\t\twhile ( i1 < right ) {\n\n\t\t\t\t\tconst mid = ( i1 + right ) >>> 1;\n\n\t\t\t\t\tif ( t < pp[ mid ] ) {\n\n\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t// check boundary cases, again\n\n\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t}\n\n\t\t\t} // seek\n\n\t\t\tthis._cachedIndex = i1;\n\n\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t} // validate_interval\n\n\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t}\n\n\tgetSettings_() {\n\n\t\treturn this.settings || this.DefaultSettings_;\n\n\t}\n\n\tcopySampleValue_( index ) {\n\n\t\t// copies a sample value to the result buffer\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = index * stride;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t// Template methods for derived classes:\n\n\tinterpolate_( /* i1, t0, t, t1 */ ) {\n\n\t\tthrow new Error( 'call to abstract method' );\n\t\t// implementations shall return this.resultBuffer\n\n\t}\n\n\tintervalChanged_( /* i1, t0, t1 */ ) {\n\n\t\t// empty\n\n\t}\n\n}\n\n/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n */\n\nclass CubicInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = - 0;\n\t\tthis._offsetPrev = - 0;\n\t\tthis._weightNext = - 0;\n\t\tthis._offsetNext = - 0;\n\n\t\tthis.DefaultSettings_ = {\n\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\n\t\t};\n\n\t}\n\n\tintervalChanged_( i1, t0, t1 ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet iPrev = i1 - 2,\n\t\t\tiNext = i1 + 1,\n\n\t\t\ttPrev = pp[ iPrev ],\n\t\t\ttNext = pp[ iNext ];\n\n\t\tif ( tPrev === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = t1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tNext === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\tiNext = i1;\n\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiNext = 1;\n\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\ttNext = t0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst halfDt = ( t1 - t0 ) * 0.5,\n\t\t\tstride = this.valueSize;\n\n\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\tthis._offsetPrev = iPrev * stride;\n\t\tthis._offsetNext = iNext * stride;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tpp = p * p,\n\t\t\tppp = pp * p;\n\n\t\t// evaluate polynomials\n\n\t\tconst sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\tconst s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1;\n\t\tconst s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\tconst sN = wN * ppp - wN * pp;\n\n\t\t// combine data linearly\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\nclass LinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\toffset1 = i1 * stride,\n\t\t\toffset0 = offset1 - stride,\n\n\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tweight0 = 1 - weight1;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n *\n * Interpolant that evaluates to the sample value at the position preceding\n * the parameter.\n */\n\nclass DiscreteInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1 /*, t0, t, t1 */ ) {\n\n\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t}\n\n}\n\nclass KeyframeTrack {\n\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tif ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );\n\t\tif ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );\n\n\t\tthis.name = name;\n\n\t\tthis.times = convertArray( times, this.TimeBufferType );\n\t\tthis.values = convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t}\n\n\t// Serialization (in static context, because of constructor invocation\n\t// and automatic invocation of .toJSON):\n\n\tstatic toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': convertArray( track.times, Array ),\n\t\t\t\t'values': convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}\n\n\tInterpolantFactoryMethodDiscrete( result ) {\n\n\t\treturn new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new LinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodSmooth( result ) {\n\n\t\treturn new CubicInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tsetInterpolation( interpolation ) {\n\n\t\tlet factoryMethod;\n\n\t\tswitch ( interpolation ) {\n\n\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateLinear:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateSmooth:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( factoryMethod === undefined ) {\n\n\t\t\tconst message = 'unsupported interpolation for ' +\n\t\t\t\tthis.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconsole.warn( 'THREE.KeyframeTrack:', message );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.createInterpolant = factoryMethod;\n\n\t\treturn this;\n\n\t}\n\n\tgetInterpolation() {\n\n\t\tswitch ( this.createInterpolant ) {\n\n\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\treturn InterpolateLinear;\n\n\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\treturn InterpolateSmooth;\n\n\t\t}\n\n\t}\n\n\tgetValueSize() {\n\n\t\treturn this.values.length / this.times.length;\n\n\t}\n\n\t// move all keyframes either forwards or backwards in time\n\tshift( timeOffset ) {\n\n\t\tif ( timeOffset !== 0.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\tscale( timeScale ) {\n\n\t\tif ( timeScale !== 1.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\ttrim( startTime, endTime ) {\n\n\t\tconst times = this.times,\n\t\t\tnKeys = times.length;\n\n\t\tlet from = 0,\n\t\t\tto = nKeys - 1;\n\n\t\twhile ( from !== nKeys && times[ from ] < startTime ) {\n\n\t\t\t++ from;\n\n\t\t}\n\n\t\twhile ( to !== - 1 && times[ to ] > endTime ) {\n\n\t\t\t-- to;\n\n\t\t}\n\n\t\t++ to; // inclusive -> exclusive bound\n\n\t\tif ( from !== 0 || to !== nKeys ) {\n\n\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\tif ( from >= to ) {\n\n\t\t\t\tto = Math.max( to, 1 );\n\t\t\t\tfrom = to - 1;\n\n\t\t\t}\n\n\t\t\tconst stride = this.getValueSize();\n\t\t\tthis.times = times.slice( from, to );\n\t\t\tthis.values = this.values.slice( from * stride, to * stride );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tconst valueSize = this.getValueSize();\n\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tconst times = this.times,\n\t\t\tvalues = this.values,\n\n\t\t\tnKeys = times.length;\n\n\t\tif ( nKeys === 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Track is empty.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tlet prevTime = null;\n\n\t\tfor ( let i = 0; i !== nKeys; i ++ ) {\n\n\t\t\tconst currTime = times[ i ];\n\n\t\t\tif ( typeof currTime === 'number' && isNaN( currTime ) ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( prevTime !== null && prevTime > currTime ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tprevTime = currTime;\n\n\t\t}\n\n\t\tif ( values !== undefined ) {\n\n\t\t\tif ( isTypedArray( values ) ) {\n\n\t\t\t\tfor ( let i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\tconst value = values[ i ];\n\n\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t// removes equivalent sequential keys as common in morph target sequences\n\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\toptimize() {\n\n\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\tconst times = this.times.slice(),\n\t\t\tvalues = this.values.slice(),\n\t\t\tstride = this.getValueSize(),\n\n\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\tlastIndex = times.length - 1;\n\n\t\tlet writeIndex = 1;\n\n\t\tfor ( let i = 1; i < lastIndex; ++ i ) {\n\n\t\t\tlet keep = false;\n\n\t\t\tconst time = times[ i ];\n\t\t\tconst timeNext = times[ i + 1 ];\n\n\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\tif ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) {\n\n\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tconst value = values[ offset + j ];\n\n\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tkeep = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// in-place compaction\n\n\t\t\tif ( keep ) {\n\n\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// flush last keyframe (compaction looks ahead)\n\n\t\tif ( lastIndex > 0 ) {\n\n\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\tfor ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t}\n\n\t\t\t++ writeIndex;\n\n\t\t}\n\n\t\tif ( writeIndex !== times.length ) {\n\n\t\t\tthis.times = times.slice( 0, writeIndex );\n\t\t\tthis.values = values.slice( 0, writeIndex * stride );\n\n\t\t} else {\n\n\t\t\tthis.times = times;\n\t\t\tthis.values = values;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst times = this.times.slice();\n\t\tconst values = this.values.slice();\n\n\t\tconst TypedKeyframeTrack = this.constructor;\n\t\tconst track = new TypedKeyframeTrack( this.name, times, values );\n\n\t\t// Interpolant argument to constructor is not saved, so copy the factory method directly.\n\t\ttrack.createInterpolant = this.createInterpolant;\n\n\t\treturn track;\n\n\t}\n\n}\n\nKeyframeTrack.prototype.TimeBufferType = Float32Array;\nKeyframeTrack.prototype.ValueBufferType = Float32Array;\nKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n/**\n * A Track of Boolean keyframe values.\n */\nclass BooleanKeyframeTrack extends KeyframeTrack {}\n\nBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\nBooleanKeyframeTrack.prototype.ValueBufferType = Array;\nBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of keyframe values that represent color.\n */\nclass ColorKeyframeTrack extends KeyframeTrack {}\n\nColorKeyframeTrack.prototype.ValueTypeName = 'color';\n\n/**\n * A Track of numeric keyframe values.\n */\nclass NumberKeyframeTrack extends KeyframeTrack {}\n\nNumberKeyframeTrack.prototype.ValueTypeName = 'number';\n\n/**\n * Spherical linear unit quaternion interpolant.\n */\n\nclass QuaternionLinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\tlet offset = i1 * stride;\n\n\t\tfor ( let end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\tQuaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A Track of quaternion keyframe values.\n */\nclass QuaternionKeyframeTrack extends KeyframeTrack {\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n}\n\nQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';\n// ValueBufferType is inherited\nQuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\nQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track that interpolates Strings\n */\nclass StringKeyframeTrack extends KeyframeTrack {}\n\nStringKeyframeTrack.prototype.ValueTypeName = 'string';\nStringKeyframeTrack.prototype.ValueBufferType = Array;\nStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of vectored keyframe values.\n */\nclass VectorKeyframeTrack extends KeyframeTrack {}\n\nVectorKeyframeTrack.prototype.ValueTypeName = 'vector';\n\nclass AnimationClip {\n\n\tconstructor( name = '', duration = - 1, tracks = [], blendMode = NormalAnimationBlendMode ) {\n\n\t\tthis.name = name;\n\t\tthis.tracks = tracks;\n\t\tthis.duration = duration;\n\t\tthis.blendMode = blendMode;\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration < 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t}\n\n\n\tstatic parse( json ) {\n\n\t\tconst tracks = [],\n\t\t\tjsonTracks = json.tracks,\n\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\tfor ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t}\n\n\t\tconst clip = new this( json.name, json.duration, tracks, json.blendMode );\n\t\tclip.uuid = json.uuid;\n\n\t\treturn clip;\n\n\t}\n\n\tstatic toJSON( clip ) {\n\n\t\tconst tracks = [],\n\t\t\tclipTracks = clip.tracks;\n\n\t\tconst json = {\n\n\t\t\t'name': clip.name,\n\t\t\t'duration': clip.duration,\n\t\t\t'tracks': tracks,\n\t\t\t'uuid': clip.uuid,\n\t\t\t'blendMode': clip.blendMode\n\n\t\t};\n\n\t\tfor ( let i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t}\n\n\t\treturn json;\n\n\t}\n\n\tstatic CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) {\n\n\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < numMorphTargets; i ++ ) {\n\n\t\t\tlet times = [];\n\t\t\tlet values = [];\n\n\t\t\ttimes.push(\n\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\ti,\n\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\tconst order = getKeyframeOrder( times );\n\t\t\ttimes = sortedArray( times, 1, order );\n\t\t\tvalues = sortedArray( values, 1, order );\n\n\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t// last frame as well for perfect loop.\n\t\t\tif ( ! noLoop && times[ 0 ] === 0 ) {\n\n\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t}\n\n\t\t\ttracks.push(\n\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\ttimes, values\n\t\t\t\t).scale( 1.0 / fps ) );\n\n\t\t}\n\n\t\treturn new this( name, - 1, tracks );\n\n\t}\n\n\tstatic findByName( objectOrClipArray, name ) {\n\n\t\tlet clipArray = objectOrClipArray;\n\n\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\tconst o = objectOrClipArray;\n\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < clipArray.length; i ++ ) {\n\n\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\treturn clipArray[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\tstatic CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) {\n\n\t\tconst animationToMorphTargets = {};\n\n\t\t// tested with https://regex101.com/ on trick sequences\n\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t// sort morph target names into animation groups based\n\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\tfor ( let i = 0, il = morphTargets.length; i < il; i ++ ) {\n\n\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\tconst parts = morphTarget.name.match( pattern );\n\n\t\t\tif ( parts && parts.length > 1 ) {\n\n\t\t\t\tconst name = parts[ 1 ];\n\n\t\t\t\tlet animationMorphTargets = animationToMorphTargets[ name ];\n\n\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t}\n\n\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst clips = [];\n\n\t\tfor ( const name in animationToMorphTargets ) {\n\n\t\t\tclips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t}\n\n\t\treturn clips;\n\n\t}\n\n\t// parse the animation.hierarchy format\n\tstatic parseAnimation( animation, bones ) {\n\n\t\tif ( ! animation ) {\n\n\t\t\tconsole.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t// only return track if there are actually keys.\n\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tflattenJSON( animationKeys, times, values, propertyName );\n\n\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tconst tracks = [];\n\n\t\tconst clipName = animation.name || 'default';\n\t\tconst fps = animation.fps || 30;\n\t\tconst blendMode = animation.blendMode;\n\n\t\t// automatic length determination in AnimationClip.\n\t\tlet duration = animation.length || - 1;\n\n\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\tfor ( let h = 0; h < hierarchyTracks.length; h ++ ) {\n\n\t\t\tconst animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t// skip empty tracks\n\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t// process morph targets\n\t\t\tif ( animationKeys[ 0 ].morphTargets ) {\n\n\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\tconst morphTargetNames = {};\n\n\t\t\t\tlet k;\n\n\t\t\t\tfor ( k = 0; k < animationKeys.length; k ++ ) {\n\n\t\t\t\t\tif ( animationKeys[ k ].morphTargets ) {\n\n\t\t\t\t\t\tfor ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t// the morphTarget is named.\n\t\t\t\tfor ( const morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\n\t\t\t\t\tfor ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\tconst animationKey = animationKeys[ k ];\n\n\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t}\n\n\t\t\t\tduration = morphTargetNames.length * fps;\n\n\t\t\t} else {\n\n\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\tconst boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tracks.length === 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst clip = new this( clipName, duration, tracks, blendMode );\n\n\t\treturn clip;\n\n\t}\n\n\tresetDuration() {\n\n\t\tconst tracks = this.tracks;\n\t\tlet duration = 0;\n\n\t\tfor ( let i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\tconst track = this.tracks[ i ];\n\n\t\t\tduration = Math.max( duration, track.times[ track.times.length - 1 ] );\n\n\t\t}\n\n\t\tthis.duration = duration;\n\n\t\treturn this;\n\n\t}\n\n\ttrim() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tvalid = valid && this.tracks[ i ].validate();\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\toptimize() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].optimize();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\ttracks.push( this.tracks[ i ].clone() );\n\n\t\t}\n\n\t\treturn new this.constructor( this.name, this.duration, tracks, this.blendMode );\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.constructor.toJSON( this );\n\n\t}\n\n}\n\nfunction getTrackTypeForValueTypeName( typeName ) {\n\n\tswitch ( typeName.toLowerCase() ) {\n\n\t\tcase 'scalar':\n\t\tcase 'double':\n\t\tcase 'float':\n\t\tcase 'number':\n\t\tcase 'integer':\n\n\t\t\treturn NumberKeyframeTrack;\n\n\t\tcase 'vector':\n\t\tcase 'vector2':\n\t\tcase 'vector3':\n\t\tcase 'vector4':\n\n\t\t\treturn VectorKeyframeTrack;\n\n\t\tcase 'color':\n\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tflattenJSON( json.keys, times, values, 'value' );\n\n\t\tjson.times = times;\n\t\tjson.values = values;\n\n\t}\n\n\t// derived classes can define a static parse method\n\tif ( trackType.parse !== undefined ) {\n\n\t\treturn trackType.parse( json );\n\n\t} else {\n\n\t\t// by default, we assume a constructor compatible with the base\n\t\treturn new trackType( json.name, json.times, json.values, json.interpolation );\n\n\t}\n\n}\n\nconst Cache = {\n\n\tenabled: false,\n\n\tfiles: {},\n\n\tadd: function ( key, file ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\tthis.files[ key ] = file;\n\n\t},\n\n\tget: function ( key ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\treturn this.files[ key ];\n\n\t},\n\n\tremove: function ( key ) {\n\n\t\tdelete this.files[ key ];\n\n\t},\n\n\tclear: function () {\n\n\t\tthis.files = {};\n\n\t}\n\n};\n\nclass LoadingManager {\n\n\tconstructor( onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet isLoading = false;\n\t\tlet itemsLoaded = 0;\n\t\tlet itemsTotal = 0;\n\t\tlet urlModifier = undefined;\n\t\tconst handlers = [];\n\n\t\t// Refer to #5689 for the reason why we don't set .onStart\n\t\t// in the constructor\n\n\t\tthis.onStart = undefined;\n\t\tthis.onLoad = onLoad;\n\t\tthis.onProgress = onProgress;\n\t\tthis.onError = onError;\n\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.resolveURL = function ( url ) {\n\n\t\t\tif ( urlModifier ) {\n\n\t\t\t\treturn urlModifier( url );\n\n\t\t\t}\n\n\t\t\treturn url;\n\n\t\t};\n\n\t\tthis.setURLModifier = function ( transform ) {\n\n\t\t\turlModifier = transform;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.addHandler = function ( regex, loader ) {\n\n\t\t\thandlers.push( regex, loader );\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.removeHandler = function ( regex ) {\n\n\t\t\tconst index = handlers.indexOf( regex );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\thandlers.splice( index, 2 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.getHandler = function ( file ) {\n\n\t\t\tfor ( let i = 0, l = handlers.length; i < l; i += 2 ) {\n\n\t\t\t\tconst regex = handlers[ i ];\n\t\t\t\tconst loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.global ) regex.lastIndex = 0; // see #17920\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t};\n\n\t}\n\n}\n\nconst DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();\n\nclass Loader {\n\n\tconstructor( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\tthis.crossOrigin = 'anonymous';\n\t\tthis.withCredentials = false;\n\t\tthis.path = '';\n\t\tthis.resourcePath = '';\n\t\tthis.requestHeader = {};\n\n\t}\n\n\tload( /* url, onLoad, onProgress, onError */ ) {}\n\n\tloadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.load( url, resolve, onProgress, reject );\n\n\t\t} );\n\n\t}\n\n\tparse( /* data */ ) {}\n\n\tsetCrossOrigin( crossOrigin ) {\n\n\t\tthis.crossOrigin = crossOrigin;\n\t\treturn this;\n\n\t}\n\n\tsetWithCredentials( value ) {\n\n\t\tthis.withCredentials = value;\n\t\treturn this;\n\n\t}\n\n\tsetPath( path ) {\n\n\t\tthis.path = path;\n\t\treturn this;\n\n\t}\n\n\tsetResourcePath( resourcePath ) {\n\n\t\tthis.resourcePath = resourcePath;\n\t\treturn this;\n\n\t}\n\n\tsetRequestHeader( requestHeader ) {\n\n\t\tthis.requestHeader = requestHeader;\n\t\treturn this;\n\n\t}\n\n}\n\nLoader.DEFAULT_MATERIAL_NAME = '__DEFAULT';\n\nconst loading = {};\n\nclass HttpError extends Error {\n\n\tconstructor( message, response ) {\n\n\t\tsuper( message );\n\t\tthis.response = response;\n\n\t}\n\n}\n\nclass FileLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tsetTimeout( () => {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\t// Check if request is duplicate\n\n\t\tif ( loading[ url ] !== undefined ) {\n\n\t\t\tloading[ url ].push( {\n\n\t\t\t\tonLoad: onLoad,\n\t\t\t\tonProgress: onProgress,\n\t\t\t\tonError: onError\n\n\t\t\t} );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Initialise array for duplicate requests\n\t\tloading[ url ] = [];\n\n\t\tloading[ url ].push( {\n\t\t\tonLoad: onLoad,\n\t\t\tonProgress: onProgress,\n\t\t\tonError: onError,\n\t\t} );\n\n\t\t// create request\n\t\tconst req = new Request( url, {\n\t\t\theaders: new Headers( this.requestHeader ),\n\t\t\tcredentials: this.withCredentials ? 'include' : 'same-origin',\n\t\t\t// An abort controller could be added within a future PR\n\t\t} );\n\n\t\t// record states ( avoid data race )\n\t\tconst mimeType = this.mimeType;\n\t\tconst responseType = this.responseType;\n\n\t\t// start the fetch\n\t\tfetch( req )\n\t\t\t.then( response => {\n\n\t\t\t\tif ( response.status === 200 || response.status === 0 ) {\n\n\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\tif ( response.status === 0 ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.FileLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Workaround: Checking if response.body === undefined for Alipay browser #23548\n\n\t\t\t\t\tif ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) {\n\n\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t// Nginx needs X-File-Size check\n\t\t\t\t\t// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content\n\t\t\t\t\tconst contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );\n\t\t\t\t\tconst total = contentLength ? parseInt( contentLength ) : 0;\n\t\t\t\t\tconst lengthComputable = total !== 0;\n\t\t\t\t\tlet loaded = 0;\n\n\t\t\t\t\t// periodically read data into the new stream tracking while download progress\n\t\t\t\t\tconst stream = new ReadableStream( {\n\t\t\t\t\t\tstart( controller ) {\n\n\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\tfunction readData() {\n\n\t\t\t\t\t\t\t\treader.read().then( ( { done, value } ) => {\n\n\t\t\t\t\t\t\t\t\tif ( done ) {\n\n\t\t\t\t\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tloaded += value.byteLength;\n\n\t\t\t\t\t\t\t\t\t\tconst event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );\n\t\t\t\t\t\t\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\t\t\t\t\t\t\tif ( callback.onProgress ) callback.onProgress( event );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue( value );\n\t\t\t\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn new Response( stream );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new HttpError( `fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}`, response );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( response => {\n\n\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\tcase 'arraybuffer':\n\n\t\t\t\t\t\treturn response.arrayBuffer();\n\n\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\treturn response.blob();\n\n\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\treturn response.text()\n\t\t\t\t\t\t\t.then( text => {\n\n\t\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\t\treturn parser.parseFromString( text, mimeType );\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\treturn response.json();\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( mimeType === undefined ) {\n\n\t\t\t\t\t\t\treturn response.text();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// sniff encoding\n\t\t\t\t\t\t\tconst re = /charset=\"?([^;\"\\s]*)\"?/i;\n\t\t\t\t\t\t\tconst exec = re.exec( mimeType );\n\t\t\t\t\t\t\tconst label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined;\n\t\t\t\t\t\t\tconst decoder = new TextDecoder( label );\n\t\t\t\t\t\t\treturn response.arrayBuffer().then( ab => decoder.decode( ab ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( data => {\n\n\t\t\t\t// Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t// error response bodies as proper responses to requests.\n\t\t\t\tCache.add( url, data );\n\n\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onLoad ) callback.onLoad( data );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.catch( err => {\n\n\t\t\t\t// Abort errors and other errors are handled the same\n\n\t\t\t\tconst callbacks = loading[ url ];\n\n\t\t\t\tif ( callbacks === undefined ) {\n\n\t\t\t\t\t// When onLoad was called and url was deleted in `loading`\n\t\t\t\t\tthis.manager.itemError( url );\n\t\t\t\t\tthrow err;\n\n\t\t\t\t}\n\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onError ) callback.onError( err );\n\n\t\t\t\t}\n\n\t\t\t\tthis.manager.itemError( url );\n\n\t\t\t} )\n\t\t\t.finally( () => {\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\tthis.manager.itemStart( url );\n\n\t}\n\n\tsetResponseType( value ) {\n\n\t\tthis.responseType = value;\n\t\treturn this;\n\n\t}\n\n\tsetMimeType( value ) {\n\n\t\tthis.mimeType = value;\n\t\treturn this;\n\n\t}\n\n}\n\nclass AnimationLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst animations = [];\n\n\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\tconst clip = AnimationClip.parse( json[ i ] );\n\n\t\t\tanimations.push( clip );\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to block based textures loader (dds, pvr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass CompressedTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst images = [];\n\n\t\tconst texture = new CompressedTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\timages[ i ] = {\n\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t};\n\n\t\t\t\tloaded += 1;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter;\n\n\t\t\t\t\ttexture.image = images;\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tif ( Array.isArray( url ) ) {\n\n\t\t\tfor ( let i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\tfor ( let f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps: [] };\n\n\t\t\t\t\t\tfor ( let i = 0; i < texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.image = images;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass ImageLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst image = createElementNS( 'img' );\n\n\t\tfunction onImageLoad() {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tCache.add( url, this );\n\n\t\t\tif ( onLoad ) onLoad( this );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction onImageError( event ) {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onError ) onError( event );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction removeEventListeners() {\n\n\t\t\timage.removeEventListener( 'load', onImageLoad, false );\n\t\t\timage.removeEventListener( 'error', onImageError, false );\n\n\t\t}\n\n\t\timage.addEventListener( 'load', onImageLoad, false );\n\t\timage.addEventListener( 'error', onImageError, false );\n\n\t\tif ( url.slice( 0, 5 ) !== 'data:' ) {\n\n\t\t\tif ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;\n\n\t\t}\n\n\t\tscope.manager.itemStart( url );\n\n\t\timage.src = url;\n\n\t\treturn image;\n\n\t}\n\n}\n\nclass CubeTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( urls, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new CubeTexture();\n\t\ttexture.colorSpace = SRGBColorSpace;\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\tloaded ++;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, undefined, onError );\n\n\t\t}\n\n\t\tfor ( let i = 0; i < urls.length; ++ i ) {\n\n\t\t\tloadTexture( i );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass DataTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst texture = new DataTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setPath( this.path );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\tlet texData;\n\n\t\t\ttry {\n\n\t\t\t\ttexData = scope.parse( buffer );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) {\n\n\t\t\t\t\tonError( error );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texData.image !== undefined ) {\n\n\t\t\t\ttexture.image = texData.image;\n\n\t\t\t} else if ( texData.data !== undefined ) {\n\n\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t}\n\n\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\n\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\tif ( texData.colorSpace !== undefined ) {\n\n\t\t\t\ttexture.colorSpace = texData.colorSpace;\n\n\t\t\t}\n\n\t\t\tif ( texData.flipY !== undefined ) {\n\n\t\t\t\ttexture.flipY = texData.flipY;\n\n\t\t\t}\n\n\t\t\tif ( texData.format !== undefined ) {\n\n\t\t\t\ttexture.format = texData.format;\n\n\t\t\t}\n\n\t\t\tif ( texData.type !== undefined ) {\n\n\t\t\t\ttexture.type = texData.type;\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmaps !== undefined ) {\n\n\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmapCount === 1 ) {\n\n\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t}\n\n\t\t\tif ( texData.generateMipmaps !== undefined ) {\n\n\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}, onProgress, onError );\n\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass TextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new Texture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tloader.load( url, function ( image ) {\n\n\t\t\ttexture.image = image;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\tonLoad( texture );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass Light extends Object3D {\n\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.isLight = true;\n\n\t\tthis.type = 'Light';\n\n\t\tthis.color = new Color( color );\n\t\tthis.intensity = intensity;\n\n\t}\n\n\tdispose() {\n\n\t\t// Empty here in base class; some subclasses override.\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.intensity = source.intensity;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.color = this.color.getHex();\n\t\tdata.object.intensity = this.intensity;\n\n\t\tif ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();\n\n\t\tif ( this.distance !== undefined ) data.object.distance = this.distance;\n\t\tif ( this.angle !== undefined ) data.object.angle = this.angle;\n\t\tif ( this.decay !== undefined ) data.object.decay = this.decay;\n\t\tif ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;\n\n\t\tif ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass HemisphereLight extends Light {\n\n\tconstructor( skyColor, groundColor, intensity ) {\n\n\t\tsuper( skyColor, intensity );\n\n\t\tthis.isHemisphereLight = true;\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.groundColor.copy( source.groundColor );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld$1 = /*@__PURE__*/ new Vector3();\nconst _lookTarget$1 = /*@__PURE__*/ new Vector3();\n\nclass LightShadow {\n\n\tconstructor( camera ) {\n\n\t\tthis.camera = camera;\n\n\t\tthis.bias = 0;\n\t\tthis.normalBias = 0;\n\t\tthis.radius = 1;\n\t\tthis.blurSamples = 8;\n\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\tthis.map = null;\n\t\tthis.mapPass = null;\n\t\tthis.matrix = new Matrix4();\n\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld$1 );\n\n\t\t_lookTarget$1.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget$1 );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );\n\n\t\tshadowMatrix.set(\n\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t);\n\n\t\tshadowMatrix.multiply( _projScreenMatrix$1 );\n\n\t}\n\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\nclass SpotLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t\tthis.isSpotLightShadow = true;\n\n\t\tthis.focus = 1;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst camera = this.camera;\n\n\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\tconst aspect = this.mapSize.width / this.mapSize.height;\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\tcamera.fov = fov;\n\t\t\tcamera.aspect = aspect;\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\tsuper.updateMatrices( light );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.focus = source.focus;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass SpotLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isSpotLight = true;\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.distance = distance;\n\t\tthis.angle = angle;\n\t\tthis.penumbra = penumbra;\n\t\tthis.decay = decay;\n\n\t\tthis.map = null;\n\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\treturn this.intensity * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / Math.PI;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.angle = source.angle;\n\t\tthis.penumbra = source.penumbra;\n\t\tthis.decay = source.decay;\n\n\t\tthis.target = source.target.clone();\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\nclass PointLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\tthis.isPointLightShadow = true;\n\n\t\tthis._frameExtents = new Vector2( 4, 2 );\n\n\t\tthis._viewportCount = 6;\n\n\t\tthis._viewports = [\n\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t// xzXZ\n\t\t\t// y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\n\t\t\t// positive X\n\t\t\tnew Vector4( 2, 1, 1, 1 ),\n\t\t\t// negative X\n\t\t\tnew Vector4( 0, 1, 1, 1 ),\n\t\t\t// positive Z\n\t\t\tnew Vector4( 3, 1, 1, 1 ),\n\t\t\t// negative Z\n\t\t\tnew Vector4( 1, 1, 1, 1 ),\n\t\t\t// positive Y\n\t\t\tnew Vector4( 3, 0, 1, 1 ),\n\t\t\t// negative Y\n\t\t\tnew Vector4( 1, 0, 1, 1 )\n\t\t];\n\n\t\tthis._cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 )\n\t\t];\n\n\t\tthis._cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, - 1 )\n\t\t];\n\n\t}\n\n\tupdateMatrices( light, viewportIndex = 0 ) {\n\n\t\tconst camera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( far !== camera.far ) {\n\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tcamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.copy( camera.position );\n\t\t_lookTarget.add( this._cubeDirections[ viewportIndex ] );\n\t\tcamera.up.copy( this._cubeUps[ viewportIndex ] );\n\t\tcamera.lookAt( _lookTarget );\n\t\tcamera.updateMatrixWorld();\n\n\t\tshadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t}\n\n}\n\nclass PointLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isPointLight = true;\n\n\t\tthis.type = 'PointLight';\n\n\t\tthis.distance = distance;\n\t\tthis.decay = decay;\n\n\t\tthis.shadow = new PointLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\treturn this.intensity * 4 * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( 4 * Math.PI );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.decay = source.decay;\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass DirectionalLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );\n\n\t\tthis.isDirectionalLightShadow = true;\n\n\t}\n\n}\n\nclass DirectionalLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isDirectionalLight = true;\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.target = source.target.clone();\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass AmbientLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isAmbientLight = true;\n\n\t\tthis.type = 'AmbientLight';\n\n\t}\n\n}\n\nclass RectAreaLight extends Light {\n\n\tconstructor( color, intensity, width = 10, height = 10 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isRectAreaLight = true;\n\n\t\tthis.type = 'RectAreaLight';\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\treturn this.intensity * this.width * this.height * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( this.width * this.height * Math.PI );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.width = this.width;\n\t\tdata.object.height = this.height;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Primary reference:\n * https://graphics.stanford.edu/papers/envmap/envmap.pdf\n *\n * Secondary reference:\n * https://www.ppsloan.org/publications/StupidSH36.pdf\n */\n\n// 3-band SH defined by 9 coefficients\n\nclass SphericalHarmonics3 {\n\n\tconstructor() {\n\n\t\tthis.isSphericalHarmonics3 = true;\n\n\t\tthis.coefficients = [];\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients.push( new Vector3() );\n\n\t\t}\n\n\t}\n\n\tset( coefficients ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].copy( coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tzero() {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// get the radiance in the direction of the normal\n\t// target is a Vector3\n\tgetAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 );\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 0.488603 * y );\n\t\ttarget.addScaledVector( coeff[ 2 ], 0.488603 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 0.488603 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) );\n\t\ttarget.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) );\n\t\ttarget.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) );\n\n\t\treturn target;\n\n\t}\n\n\t// get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n\t// target is a Vector3\n\t// https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\tgetIrradianceAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603\n\t\ttarget.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548\n\t\ttarget.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3\n\t\ttarget.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274\n\n\t\treturn target;\n\n\t}\n\n\tadd( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].add( sh.coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\taddScaledSH( sh, s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tscale( s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].multiplyScalar( s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tlerp( sh, alpha ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].lerp( sh.coefficients[ i ], alpha );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tequals( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcopy( sh ) {\n\n\t\treturn this.set( sh.coefficients );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].fromArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].toArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn array;\n\n\t}\n\n\t// evaluate the basis functions\n\t// shBasis is an Array[ 9 ]\n\tstatic getBasisAt( normal, shBasis ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\t// band 0\n\t\tshBasis[ 0 ] = 0.282095;\n\n\t\t// band 1\n\t\tshBasis[ 1 ] = 0.488603 * y;\n\t\tshBasis[ 2 ] = 0.488603 * z;\n\t\tshBasis[ 3 ] = 0.488603 * x;\n\n\t\t// band 2\n\t\tshBasis[ 4 ] = 1.092548 * x * y;\n\t\tshBasis[ 5 ] = 1.092548 * y * z;\n\t\tshBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 );\n\t\tshBasis[ 7 ] = 1.092548 * x * z;\n\t\tshBasis[ 8 ] = 0.546274 * ( x * x - y * y );\n\n\t}\n\n}\n\nclass LightProbe extends Light {\n\n\tconstructor( sh = new SphericalHarmonics3(), intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\tthis.isLightProbe = true;\n\n\t\tthis.sh = sh;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sh.copy( source.sh );\n\n\t\treturn this;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\t\tthis.sh.fromArray( json.sh );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.sh = this.sh.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass MaterialLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\t\tthis.textures = {};\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst textures = this.textures;\n\n\t\tfunction getTexture( name ) {\n\n\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.MaterialLoader: Undefined texture', name );\n\n\t\t\t}\n\n\t\t\treturn textures[ name ];\n\n\t\t}\n\n\t\tconst material = MaterialLoader.createMaterialFromType( json.type );\n\n\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\tif ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color );\n\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\tif ( json.sheen !== undefined ) material.sheen = json.sheen;\n\t\tif ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor );\n\t\tif ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness;\n\t\tif ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\tif ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular );\n\t\tif ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity;\n\t\tif ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor );\n\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\tif ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;\n\t\tif ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\tif ( json.dispersion !== undefined ) material.dispersion = json.dispersion;\n\t\tif ( json.iridescence !== undefined ) material.iridescence = json.iridescence;\n\t\tif ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR;\n\t\tif ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange;\n\t\tif ( json.transmission !== undefined ) material.transmission = json.transmission;\n\t\tif ( json.thickness !== undefined ) material.thickness = json.thickness;\n\t\tif ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;\n\t\tif ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );\n\t\tif ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;\n\t\tif ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;\n\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\tif ( json.flatShading !== undefined ) material.flatShading = json.flatShading;\n\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\tif ( json.combine !== undefined ) material.combine = json.combine;\n\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\tif ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide;\n\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\tif ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;\n\t\tif ( json.depthFunc !== undefined ) material.depthFunc = json.depthFunc;\n\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\t\tif ( json.blendSrc !== undefined ) material.blendSrc = json.blendSrc;\n\t\tif ( json.blendDst !== undefined ) material.blendDst = json.blendDst;\n\t\tif ( json.blendEquation !== undefined ) material.blendEquation = json.blendEquation;\n\t\tif ( json.blendSrcAlpha !== undefined ) material.blendSrcAlpha = json.blendSrcAlpha;\n\t\tif ( json.blendDstAlpha !== undefined ) material.blendDstAlpha = json.blendDstAlpha;\n\t\tif ( json.blendEquationAlpha !== undefined ) material.blendEquationAlpha = json.blendEquationAlpha;\n\t\tif ( json.blendColor !== undefined && material.blendColor !== undefined ) material.blendColor.setHex( json.blendColor );\n\t\tif ( json.blendAlpha !== undefined ) material.blendAlpha = json.blendAlpha;\n\t\tif ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;\n\t\tif ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc;\n\t\tif ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef;\n\t\tif ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask;\n\t\tif ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail;\n\t\tif ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail;\n\t\tif ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass;\n\t\tif ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;\n\n\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\n\t\tif ( json.rotation !== undefined ) material.rotation = json.rotation;\n\n\t\tif ( json.linewidth !== undefined ) material.linewidth = json.linewidth;\n\t\tif ( json.dashSize !== undefined ) material.dashSize = json.dashSize;\n\t\tif ( json.gapSize !== undefined ) material.gapSize = json.gapSize;\n\t\tif ( json.scale !== undefined ) material.scale = json.scale;\n\n\t\tif ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset;\n\t\tif ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\tif ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\n\t\tif ( json.dithering !== undefined ) material.dithering = json.dithering;\n\n\t\tif ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage;\n\t\tif ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\tif ( json.forceSinglePass !== undefined ) material.forceSinglePass = json.forceSinglePass;\n\n\t\tif ( json.visible !== undefined ) material.visible = json.visible;\n\n\t\tif ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped;\n\n\t\tif ( json.userData !== undefined ) material.userData = json.userData;\n\n\t\tif ( json.vertexColors !== undefined ) {\n\n\t\t\tif ( typeof json.vertexColors === 'number' ) {\n\n\t\t\t\tmaterial.vertexColors = ( json.vertexColors > 0 ) ? true : false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Shader Material\n\n\t\tif ( json.uniforms !== undefined ) {\n\n\t\t\tfor ( const name in json.uniforms ) {\n\n\t\t\t\tconst uniform = json.uniforms[ name ];\n\n\t\t\t\tmaterial.uniforms[ name ] = {};\n\n\t\t\t\tswitch ( uniform.type ) {\n\n\t\t\t\t\tcase 't':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = getTexture( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Color().setHex( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector2().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = uniform.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.defines !== undefined ) material.defines = json.defines;\n\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\t\tif ( json.glslVersion !== undefined ) material.glslVersion = json.glslVersion;\n\n\t\tif ( json.extensions !== undefined ) {\n\n\t\t\tfor ( const key in json.extensions ) {\n\n\t\t\t\tmaterial.extensions[ key ] = json.extensions[ key ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.lights !== undefined ) material.lights = json.lights;\n\t\tif ( json.clipping !== undefined ) material.clipping = json.clipping;\n\n\t\t// for PointsMaterial\n\n\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t// maps\n\n\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\t\tif ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );\n\n\t\tif ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );\n\n\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\tif ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;\n\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\tlet normalScale = json.normalScale;\n\n\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t}\n\n\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t}\n\n\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\t\tif ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap );\n\t\tif ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );\n\n\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\t\tif ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );\n\t\tif ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;\n\n\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\t\tif ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio;\n\n\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\tif ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );\n\n\t\tif ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap );\n\t\tif ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap );\n\t\tif ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );\n\t\tif ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );\n\n\t\tif ( json.iridescenceMap !== undefined ) material.iridescenceMap = getTexture( json.iridescenceMap );\n\t\tif ( json.iridescenceThicknessMap !== undefined ) material.iridescenceThicknessMap = getTexture( json.iridescenceThicknessMap );\n\n\t\tif ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );\n\t\tif ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );\n\n\t\tif ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );\n\n\t\tif ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );\n\t\tif ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );\n\n\t\treturn material;\n\n\t}\n\n\tsetTextures( value ) {\n\n\t\tthis.textures = value;\n\t\treturn this;\n\n\t}\n\n\tstatic createMaterialFromType( type ) {\n\n\t\tconst materialLib = {\n\t\t\tShadowMaterial,\n\t\t\tSpriteMaterial,\n\t\t\tRawShaderMaterial,\n\t\t\tShaderMaterial,\n\t\t\tPointsMaterial,\n\t\t\tMeshPhysicalMaterial,\n\t\t\tMeshStandardMaterial,\n\t\t\tMeshPhongMaterial,\n\t\t\tMeshToonMaterial,\n\t\t\tMeshNormalMaterial,\n\t\t\tMeshLambertMaterial,\n\t\t\tMeshDepthMaterial,\n\t\t\tMeshDistanceMaterial,\n\t\t\tMeshBasicMaterial,\n\t\t\tMeshMatcapMaterial,\n\t\t\tLineDashedMaterial,\n\t\t\tLineBasicMaterial,\n\t\t\tMaterial\n\t\t};\n\n\t\treturn new materialLib[ type ]();\n\n\t}\n\n}\n\nclass LoaderUtils {\n\n\tstatic decodeText( array ) {\n\n\t\tif ( typeof TextDecoder !== 'undefined' ) {\n\n\t\t\treturn new TextDecoder().decode( array );\n\n\t\t}\n\n\t\t// Avoid the String.fromCharCode.apply(null, array) shortcut, which\n\t\t// throws a \"maximum call stack size exceeded\" error for large arrays.\n\n\t\tlet s = '';\n\n\t\tfor ( let i = 0, il = array.length; i < il; i ++ ) {\n\n\t\t\t// Implicitly assumes little-endian.\n\t\t\ts += String.fromCharCode( array[ i ] );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\t// merges multi-byte utf-8 characters.\n\n\t\t\treturn decodeURIComponent( escape( s ) );\n\n\t\t} catch ( e ) { // see #16358\n\n\t\t\treturn s;\n\n\t\t}\n\n\t}\n\n\tstatic extractUrlBase( url ) {\n\n\t\tconst index = url.lastIndexOf( '/' );\n\n\t\tif ( index === - 1 ) return './';\n\n\t\treturn url.slice( 0, index + 1 );\n\n\t}\n\n\tstatic resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return '';\n\n\t\t// Host Relative URL\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t}\n\n\t\t// Absolute URL http://,https://,//\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url;\n\n\t\t// Data URI\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url;\n\n\t\t// Blob URL\n\t\tif ( /^blob:.*$/i.test( url ) ) return url;\n\n\t\t// Relative URL\n\t\treturn path + url;\n\n\t}\n\n}\n\nclass InstancedBufferGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isInstancedBufferGeometry = true;\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\t\tthis.instanceCount = Infinity;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceCount = source.instanceCount;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.instanceCount = this.instanceCount;\n\n\t\tdata.isInstancedBufferGeometry = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass BufferGeometryLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst interleavedBufferMap = {};\n\t\tconst arrayBufferMap = {};\n\n\t\tfunction getInterleavedBuffer( json, uuid ) {\n\n\t\t\tif ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ];\n\n\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\tconst interleavedBuffer = interleavedBuffers[ uuid ];\n\n\t\t\tconst buffer = getArrayBuffer( json, interleavedBuffer.buffer );\n\n\t\t\tconst array = getTypedArray( interleavedBuffer.type, buffer );\n\t\t\tconst ib = new InterleavedBuffer( array, interleavedBuffer.stride );\n\t\t\tib.uuid = interleavedBuffer.uuid;\n\n\t\t\tinterleavedBufferMap[ uuid ] = ib;\n\n\t\t\treturn ib;\n\n\t\t}\n\n\t\tfunction getArrayBuffer( json, uuid ) {\n\n\t\t\tif ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ];\n\n\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\tconst arrayBuffer = arrayBuffers[ uuid ];\n\n\t\t\tconst ab = new Uint32Array( arrayBuffer ).buffer;\n\n\t\t\tarrayBufferMap[ uuid ] = ab;\n\n\t\t\treturn ab;\n\n\t\t}\n\n\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\n\t\tconst index = json.data.index;\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst typedArray = getTypedArray( index.type, index.array );\n\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t}\n\n\t\tconst attributes = json.data.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\t\t\tlet bufferAttribute;\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t} else {\n\n\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\tbufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t}\n\n\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\tif ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );\n\n\t\t\tgeometry.setAttribute( key, bufferAttribute );\n\n\t\t}\n\n\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\tif ( morphAttributes ) {\n\n\t\t\tfor ( const key in morphAttributes ) {\n\n\t\t\t\tconst attributeArray = morphAttributes[ key ];\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attribute = attributeArray[ i ];\n\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\t\t\tbufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\t\t\tarray.push( bufferAttribute );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.morphAttributes[ key ] = array;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\tgeometry.morphTargetsRelative = true;\n\n\t\t}\n\n\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\tif ( groups !== undefined ) {\n\n\t\t\tfor ( let i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\tconst center = new Vector3();\n\n\t\t\tif ( boundingSphere.center !== undefined ) {\n\n\t\t\t\tcenter.fromArray( boundingSphere.center );\n\n\t\t\t}\n\n\t\t\tgeometry.boundingSphere = new Sphere( center, boundingSphere.radius );\n\n\t\t}\n\n\t\tif ( json.name ) geometry.name = json.name;\n\t\tif ( json.userData ) geometry.userData = json.userData;\n\n\t\treturn geometry;\n\n\t}\n\n}\n\nclass ObjectLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tlet json = null;\n\n\t\t\ttry {\n\n\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( error );\n\n\t\t\t\tconsole.error( 'THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\\'t load ' + url ) );\n\n\t\t\t\tconsole.error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tscope.parse( json, onLoad );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tasync loadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tconst text = await loader.loadAsync( url, onProgress );\n\n\t\tconst json = JSON.parse( text );\n\n\t\tconst metadata = json.metadata;\n\n\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\tthrow new Error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\n\t\t}\n\n\t\treturn await scope.parseAsync( json );\n\n\t}\n\n\tparse( json, onLoad ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = this.parseImages( json.images, function () {\n\n\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t} );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\n\t\t//\n\n\t\tif ( onLoad !== undefined ) {\n\n\t\t\tlet hasImages = false;\n\n\t\t\tfor ( const uuid in images ) {\n\n\t\t\t\tif ( images[ uuid ].data instanceof HTMLImageElement ) {\n\n\t\t\t\t\thasImages = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hasImages === false ) onLoad( object );\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tasync parseAsync( json ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = await this.parseImagesAsync( json.images );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\n\t\treturn object;\n\n\t}\n\n\tparseShapes( json ) {\n\n\t\tconst shapes = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst shape = new Shape().fromJSON( json[ i ] );\n\n\t\t\t\tshapes[ shape.uuid ] = shape;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n\tparseSkeletons( json, object ) {\n\n\t\tconst skeletons = {};\n\t\tconst bones = {};\n\n\t\t// generate bone lookup table\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isBone ) bones[ child.uuid ] = child;\n\n\t\t} );\n\n\t\t// create skeletons\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst skeleton = new Skeleton().fromJSON( json[ i ], bones );\n\n\t\t\t\tskeletons[ skeleton.uuid ] = skeleton;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn skeletons;\n\n\t}\n\n\tparseGeometries( json, shapes ) {\n\n\t\tconst geometries = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tlet geometry;\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\tcase 'InstancedBufferGeometry':\n\n\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( data.type in Geometries ) {\n\n\t\t\t\t\t\t\tgeometry = Geometries[ data.type ].fromJSON( data, shapes );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( `THREE.ObjectLoader: Unsupported geometry type \"${ data.type }\"` );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\t\t\t\tif ( data.userData !== undefined ) geometry.userData = data.userData;\n\n\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn geometries;\n\n\t}\n\n\tparseMaterials( json, textures ) {\n\n\t\tconst cache = {}; // MultiMaterial\n\t\tconst materials = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst loader = new MaterialLoader();\n\t\t\tloader.setTextures( textures );\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( cache[ data.uuid ] === undefined ) {\n\n\t\t\t\t\tcache[ data.uuid ] = loader.parse( data );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials[ data.uuid ] = cache[ data.uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materials;\n\n\t}\n\n\tparseAnimations( json ) {\n\n\t\tconst animations = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tconst clip = AnimationClip.parse( data );\n\n\t\t\t\tanimations[ clip.uuid ] = clip;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n\tparseImages( json, onLoad ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tfunction loadImage( url ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn loader.load( url, function () {\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, undefined, function () {\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfunction deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn loadImage( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tconst manager = new LoadingManager( onLoad );\n\n\t\t\tloader = new ImageLoader( manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tasync parseImagesAsync( json ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tasync function deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn await loader.loadAsync( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tloader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = await deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tparseTextures( json, images ) {\n\n\t\tfunction parseConstant( value, type ) {\n\n\t\t\tif ( typeof value === 'number' ) return value;\n\n\t\t\tconsole.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\treturn type[ value ];\n\n\t\t}\n\n\t\tconst textures = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t}\n\n\t\t\t\tconst source = images[ data.image ];\n\t\t\t\tconst image = source.data;\n\n\t\t\t\tlet texture;\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\ttexture = new CubeTexture();\n\n\t\t\t\t\tif ( image.length === 6 ) texture.needsUpdate = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( image && image.data ) {\n\n\t\t\t\t\t\ttexture = new DataTexture();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture = new Texture();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( image ) texture.needsUpdate = true; // textures can have undefined image data\n\n\t\t\t\t}\n\n\t\t\t\ttexture.source = source;\n\n\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );\n\t\t\t\tif ( data.channel !== undefined ) texture.channel = data.channel;\n\n\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\tif ( data.center !== undefined ) texture.center.fromArray( data.center );\n\t\t\t\tif ( data.rotation !== undefined ) texture.rotation = data.rotation;\n\n\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );\n\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.format !== undefined ) texture.format = data.format;\n\t\t\t\tif ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;\n\t\t\t\tif ( data.type !== undefined ) texture.type = data.type;\n\t\t\t\tif ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;\n\n\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\tif ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;\n\t\t\t\tif ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\tif ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\tif ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;\n\n\t\t\t\tif ( data.userData !== undefined ) texture.userData = data.userData;\n\n\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textures;\n\n\t}\n\n\tparseObject( data, geometries, materials, textures, animations ) {\n\n\t\tlet object;\n\n\t\tfunction getGeometry( name ) {\n\n\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined geometry', name );\n\n\t\t\t}\n\n\t\t\treturn geometries[ name ];\n\n\t\t}\n\n\t\tfunction getMaterial( name ) {\n\n\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, l = name.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst uuid = name[ i ];\n\n\t\t\t\t\tif ( materials[ uuid ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tarray.push( materials[ uuid ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t}\n\n\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', name );\n\n\t\t\t}\n\n\t\t\treturn materials[ name ];\n\n\t\t}\n\n\t\tfunction getTexture( uuid ) {\n\n\t\t\tif ( textures[ uuid ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined texture', uuid );\n\n\t\t\t}\n\n\t\t\treturn textures[ uuid ];\n\n\t\t}\n\n\t\tlet geometry, material;\n\n\t\tswitch ( data.type ) {\n\n\t\t\tcase 'Scene':\n\n\t\t\t\tobject = new Scene();\n\n\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tobject.background = getTexture( data.background );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.environment !== undefined ) {\n\n\t\t\t\t\tobject.environment = getTexture( data.environment );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( data.fog.name !== '' ) {\n\n\t\t\t\t\t\tobject.fog.name = data.fog.name;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;\n\t\t\t\tif ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;\n\t\t\t\tif ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );\n\n\t\t\t\tif ( data.environmentIntensity !== undefined ) object.environmentIntensity = data.environmentIntensity;\n\t\t\t\tif ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'AmbientLight':\n\n\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'DirectionalLight':\n\n\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointLight':\n\n\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'RectAreaLight':\n\n\t\t\t\tobject = new RectAreaLight( data.color, data.intensity, data.width, data.height );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SpotLight':\n\n\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'HemisphereLight':\n\n\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LightProbe':\n\n\t\t\t\tobject = new LightProbe().fromJSON( data );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SkinnedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t \tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\tif ( data.bindMode !== undefined ) object.bindMode = data.bindMode;\n\t\t\t\tif ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix );\n\t\t\t\tif ( data.skeleton !== undefined ) object.skeleton = data.skeleton;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Mesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'InstancedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\t\t\t\tconst count = data.count;\n\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\tconst instanceColor = data.instanceColor;\n\n\t\t\t\tobject = new InstancedMesh( geometry, material, count );\n\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 );\n\t\t\t\tif ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'BatchedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new BatchedMesh( data.maxGeometryCount, data.maxVertexCount, data.maxIndexCount, material );\n\t\t\t\tobject.geometry = geometry;\n\t\t\t\tobject.perObjectFrustumCulled = data.perObjectFrustumCulled;\n\t\t\t\tobject.sortObjects = data.sortObjects;\n\n\t\t\t\tobject._drawRanges = data.drawRanges;\n\t\t\t\tobject._reservedRanges = data.reservedRanges;\n\n\t\t\t\tobject._visibility = data.visibility;\n\t\t\t\tobject._active = data.active;\n\t\t\t\tobject._bounds = data.bounds.map( bound => {\n\n\t\t\t\t\tconst box = new Box3();\n\t\t\t\t\tbox.min.fromArray( bound.boxMin );\n\t\t\t\t\tbox.max.fromArray( bound.boxMax );\n\n\t\t\t\t\tconst sphere = new Sphere();\n\t\t\t\t\tsphere.radius = bound.sphereRadius;\n\t\t\t\t\tsphere.center.fromArray( bound.sphereCenter );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tboxInitialized: bound.boxInitialized,\n\t\t\t\t\t\tbox: box,\n\n\t\t\t\t\t\tsphereInitialized: bound.sphereInitialized,\n\t\t\t\t\t\tsphere: sphere\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\n\t\t\t\tobject._maxGeometryCount = data.maxGeometryCount;\n\t\t\t\tobject._maxVertexCount = data.maxVertexCount;\n\t\t\t\tobject._maxIndexCount = data.maxIndexCount;\n\n\t\t\t\tobject._geometryInitialized = data.geometryInitialized;\n\t\t\t\tobject._geometryCount = data.geometryCount;\n\n\t\t\t\tobject._matricesTexture = getTexture( data.matricesTexture.uuid );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LOD':\n\n\t\t\t\tobject = new LOD();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Line':\n\n\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineLoop':\n\n\t\t\t\tobject = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineSegments':\n\n\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointCloud':\n\t\t\tcase 'Points':\n\n\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Sprite':\n\n\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Group':\n\n\t\t\t\tobject = new Group();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Bone':\n\n\t\t\t\tobject = new Bone();\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tobject = new Object3D();\n\n\t\t}\n\n\t\tobject.uuid = data.uuid;\n\n\t\tif ( data.name !== undefined ) object.name = data.name;\n\n\t\tif ( data.matrix !== undefined ) {\n\n\t\t\tobject.matrix.fromArray( data.matrix );\n\n\t\t\tif ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\tif ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t} else {\n\n\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t}\n\n\t\tif ( data.up !== undefined ) object.up.fromArray( data.up );\n\n\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\tif ( data.shadow ) {\n\n\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\tif ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t}\n\n\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\tif ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled;\n\t\tif ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder;\n\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\t\tif ( data.layers !== undefined ) object.layers.mask = data.layers;\n\n\t\tif ( data.children !== undefined ) {\n\n\t\t\tconst children = data.children;\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tobject.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.animations !== undefined ) {\n\n\t\t\tconst objectAnimations = data.animations;\n\n\t\t\tfor ( let i = 0; i < objectAnimations.length; i ++ ) {\n\n\t\t\t\tconst uuid = objectAnimations[ i ];\n\n\t\t\t\tobject.animations.push( animations[ uuid ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.type === 'LOD' ) {\n\n\t\t\tif ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate;\n\n\t\t\tconst levels = data.levels;\n\n\t\t\tfor ( let l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\tconst level = levels[ l ];\n\t\t\t\tconst child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\tobject.addLevel( child, level.distance, level.hysteresis );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tbindSkeletons( object, skeletons ) {\n\n\t\tif ( Object.keys( skeletons ).length === 0 ) return;\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isSkinnedMesh === true && child.skeleton !== undefined ) {\n\n\t\t\t\tconst skeleton = skeletons[ child.skeleton ];\n\n\t\t\t\tif ( skeleton === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.bind( skeleton, child.bindMatrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n}\n\nconst TEXTURE_MAPPING = {\n\tUVMapping: UVMapping,\n\tCubeReflectionMapping: CubeReflectionMapping,\n\tCubeRefractionMapping: CubeRefractionMapping,\n\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\tCubeUVReflectionMapping: CubeUVReflectionMapping\n};\n\nconst TEXTURE_WRAPPING = {\n\tRepeatWrapping: RepeatWrapping,\n\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\tMirroredRepeatWrapping: MirroredRepeatWrapping\n};\n\nconst TEXTURE_FILTER = {\n\tNearestFilter: NearestFilter,\n\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\tLinearFilter: LinearFilter,\n\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n};\n\nclass ImageBitmapLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\tthis.isImageBitmapLoader = true;\n\n\t\tif ( typeof createImageBitmap === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );\n\n\t\t}\n\n\t\tif ( typeof fetch === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );\n\n\t\t}\n\n\t\tthis.options = { premultiplyAlpha: 'none' };\n\n\t}\n\n\tsetOptions( options ) {\n\n\t\tthis.options = options;\n\n\t\treturn this;\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\t// If cached is a promise, wait for it to resolve\n\t\t\tif ( cached.then ) {\n\n\t\t\t\tcached.then( imageBitmap => {\n\n\t\t\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t} ).catch( e => {\n\n\t\t\t\t\tif ( onError ) onError( e );\n\n\t\t\t\t} );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// If cached is not a promise (i.e., it's already an imageBitmap)\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst fetchOptions = {};\n\t\tfetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';\n\t\tfetchOptions.headers = this.requestHeader;\n\n\t\tconst promise = fetch( url, fetchOptions ).then( function ( res ) {\n\n\t\t\treturn res.blob();\n\n\t\t} ).then( function ( blob ) {\n\n\t\t\treturn createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );\n\n\t\t} ).then( function ( imageBitmap ) {\n\n\t\t\tCache.add( url, imageBitmap );\n\n\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t\treturn imageBitmap;\n\n\t\t} ).catch( function ( e ) {\n\n\t\t\tif ( onError ) onError( e );\n\n\t\t\tCache.remove( url );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} );\n\n\t\tCache.add( url, promise );\n\t\tscope.manager.itemStart( url );\n\n\t}\n\n}\n\nlet _context;\n\nclass AudioContext {\n\n\tstatic getContext() {\n\n\t\tif ( _context === undefined ) {\n\n\t\t\t_context = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn _context;\n\n\t}\n\n\tstatic setContext( value ) {\n\n\t\t_context = value;\n\n\t}\n\n}\n\nclass AudioLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\tconst bufferCopy = buffer.slice( 0 );\n\n\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\tcontext.decodeAudioData( bufferCopy, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} ).catch( handleError );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\thandleError( e );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\tfunction handleError( e ) {\n\n\t\t\tif ( onError ) {\n\n\t\t\t\tonError( e );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( e );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemError( url );\n\n\t\t}\n\n\t}\n\n}\n\nconst _eyeRight = /*@__PURE__*/ new Matrix4();\nconst _eyeLeft = /*@__PURE__*/ new Matrix4();\nconst _projectionMatrix = /*@__PURE__*/ new Matrix4();\n\nclass StereoCamera {\n\n\tconstructor() {\n\n\t\tthis.type = 'StereoCamera';\n\n\t\tthis.aspect = 1;\n\n\t\tthis.eyeSep = 0.064;\n\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t\tthis._cache = {\n\t\t\tfocus: null,\n\t\t\tfov: null,\n\t\t\taspect: null,\n\t\t\tnear: null,\n\t\t\tfar: null,\n\t\t\tzoom: null,\n\t\t\teyeSep: null\n\t\t};\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst cache = this._cache;\n\n\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov ||\n\t\t\tcache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near ||\n\t\t\tcache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tcache.focus = camera.focus;\n\t\t\tcache.fov = camera.fov;\n\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\tcache.near = camera.near;\n\t\t\tcache.far = camera.far;\n\t\t\tcache.zoom = camera.zoom;\n\t\t\tcache.eyeSep = this.eyeSep;\n\n\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t_projectionMatrix.copy( camera.projectionMatrix );\n\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\tconst ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;\n\t\t\tlet xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\t_eyeLeft.elements[ 12 ] = - eyeSepHalf;\n\t\t\t_eyeRight.elements[ 12 ] = eyeSepHalf;\n\n\t\t\t// for left eye\n\n\t\t\txmin = - ymax * cache.aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraL.projectionMatrix.copy( _projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = - ymax * cache.aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraR.projectionMatrix.copy( _projectionMatrix );\n\n\t\t}\n\n\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );\n\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );\n\n\t}\n\n}\n\nclass Clock {\n\n\tconstructor( autoStart = true ) {\n\n\t\tthis.autoStart = autoStart;\n\n\t\tthis.startTime = 0;\n\t\tthis.oldTime = 0;\n\t\tthis.elapsedTime = 0;\n\n\t\tthis.running = false;\n\n\t}\n\n\tstart() {\n\n\t\tthis.startTime = now();\n\n\t\tthis.oldTime = this.startTime;\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = true;\n\n\t}\n\n\tstop() {\n\n\t\tthis.getElapsedTime();\n\t\tthis.running = false;\n\t\tthis.autoStart = false;\n\n\t}\n\n\tgetElapsedTime() {\n\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\n\t}\n\n\tgetDelta() {\n\n\t\tlet diff = 0;\n\n\t\tif ( this.autoStart && ! this.running ) {\n\n\t\t\tthis.start();\n\t\t\treturn 0;\n\n\t\t}\n\n\t\tif ( this.running ) {\n\n\t\t\tconst newTime = now();\n\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\n\t\t\tthis.elapsedTime += diff;\n\n\t\t}\n\n\t\treturn diff;\n\n\t}\n\n}\n\nfunction now() {\n\n\treturn ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732\n\n}\n\nconst _position$1 = /*@__PURE__*/ new Vector3();\nconst _quaternion$1 = /*@__PURE__*/ new Quaternion();\nconst _scale$1 = /*@__PURE__*/ new Vector3();\nconst _orientation$1 = /*@__PURE__*/ new Vector3();\n\nclass AudioListener extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'AudioListener';\n\n\t\tthis.context = AudioContext.getContext();\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\tthis.filter = null;\n\n\t\tthis.timeDelta = 0;\n\n\t\t// private\n\n\t\tthis._clock = new Clock();\n\n\t}\n\n\tgetInput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tremoveFilter() {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\tthis.gain.connect( this.context.destination );\n\t\t\tthis.filter = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.filter;\n\n\t}\n\n\tsetFilter( value ) {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t} else {\n\n\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t}\n\n\t\tthis.filter = value;\n\t\tthis.gain.connect( this.filter );\n\t\tthis.filter.connect( this.context.destination );\n\n\t\treturn this;\n\n\t}\n\n\tgetMasterVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetMasterVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tconst listener = this.context.listener;\n\t\tconst up = this.up;\n\n\t\tthis.timeDelta = this._clock.getDelta();\n\n\t\tthis.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 );\n\n\t\t_orientation$1.set( 0, 0, - 1 ).applyQuaternion( _quaternion$1 );\n\n\t\tif ( listener.positionX ) {\n\n\t\t\t// code path for Chrome (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\n\t\t\tlistener.positionX.linearRampToValueAtTime( _position$1.x, endTime );\n\t\t\tlistener.positionY.linearRampToValueAtTime( _position$1.y, endTime );\n\t\t\tlistener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );\n\t\t\tlistener.forwardX.linearRampToValueAtTime( _orientation$1.x, endTime );\n\t\t\tlistener.forwardY.linearRampToValueAtTime( _orientation$1.y, endTime );\n\t\t\tlistener.forwardZ.linearRampToValueAtTime( _orientation$1.z, endTime );\n\t\t\tlistener.upX.linearRampToValueAtTime( up.x, endTime );\n\t\t\tlistener.upY.linearRampToValueAtTime( up.y, endTime );\n\t\t\tlistener.upZ.linearRampToValueAtTime( up.z, endTime );\n\n\t\t} else {\n\n\t\t\tlistener.setPosition( _position$1.x, _position$1.y, _position$1.z );\n\t\t\tlistener.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass Audio extends Object3D {\n\n\tconstructor( listener ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Audio';\n\n\t\tthis.listener = listener;\n\t\tthis.context = listener.context;\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\tthis.autoplay = false;\n\n\t\tthis.buffer = null;\n\t\tthis.detune = 0;\n\t\tthis.loop = false;\n\t\tthis.loopStart = 0;\n\t\tthis.loopEnd = 0;\n\t\tthis.offset = 0;\n\t\tthis.duration = undefined;\n\t\tthis.playbackRate = 1;\n\t\tthis.isPlaying = false;\n\t\tthis.hasPlaybackControl = true;\n\t\tthis.source = null;\n\t\tthis.sourceType = 'empty';\n\n\t\tthis._startedAt = 0;\n\t\tthis._progress = 0;\n\t\tthis._connected = false;\n\n\t\tthis.filters = [];\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tsetNodeSource( audioNode ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'audioNode';\n\t\tthis.source = audioNode;\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaElementSource( mediaElement ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaNode';\n\t\tthis.source = this.context.createMediaElementSource( mediaElement );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaStreamSource( mediaStream ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaStreamNode';\n\t\tthis.source = this.context.createMediaStreamSource( mediaStream );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetBuffer( audioBuffer ) {\n\n\t\tthis.buffer = audioBuffer;\n\t\tthis.sourceType = 'buffer';\n\n\t\tif ( this.autoplay ) this.play();\n\n\t\treturn this;\n\n\t}\n\n\tplay( delay = 0 ) {\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: Audio is already playing.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._startedAt = this.context.currentTime + delay;\n\n\t\tconst source = this.context.createBufferSource();\n\t\tsource.buffer = this.buffer;\n\t\tsource.loop = this.loop;\n\t\tsource.loopStart = this.loopStart;\n\t\tsource.loopEnd = this.loopEnd;\n\t\tsource.onended = this.onEnded.bind( this );\n\t\tsource.start( this._startedAt, this._progress + this.offset, this.duration );\n\n\t\tthis.isPlaying = true;\n\n\t\tthis.source = source;\n\n\t\tthis.setDetune( this.detune );\n\t\tthis.setPlaybackRate( this.playbackRate );\n\n\t\treturn this.connect();\n\n\t}\n\n\tpause() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\t// update current progress\n\n\t\t\tthis._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;\n\n\t\t\tif ( this.loop === true ) {\n\n\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\n\t\t\t\tthis._progress = this._progress % ( this.duration || this.buffer.duration );\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t\tthis.isPlaying = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tstop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._progress = 0;\n\n\t\tif ( this.source !== null ) {\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t}\n\n\t\tthis.isPlaying = false;\n\n\t\treturn this;\n\n\t}\n\n\tconnect() {\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = true;\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect() {\n\n\t\tif ( this._connected === false ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = false;\n\n\t\treturn this;\n\n\t}\n\n\tgetFilters() {\n\n\t\treturn this.filters;\n\n\t}\n\n\tsetFilters( value ) {\n\n\t\tif ( ! value ) value = [];\n\n\t\tif ( this._connected === true ) {\n\n\t\t\tthis.disconnect();\n\t\t\tthis.filters = value.slice();\n\t\t\tthis.connect();\n\n\t\t} else {\n\n\t\t\tthis.filters = value.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetDetune( value ) {\n\n\t\tthis.detune = value;\n\n\t\tif ( this.isPlaying === true && this.source.detune !== undefined ) {\n\n\t\t\tthis.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetDetune() {\n\n\t\treturn this.detune;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.getFilters()[ 0 ];\n\n\t}\n\n\tsetFilter( filter ) {\n\n\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t}\n\n\tsetPlaybackRate( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.playbackRate = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetPlaybackRate() {\n\n\t\treturn this.playbackRate;\n\n\t}\n\n\tonEnded() {\n\n\t\tthis.isPlaying = false;\n\n\t}\n\n\tgetLoop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn this.loop;\n\n\t}\n\n\tsetLoop( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.loop = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.loop = this.loop;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopStart( value ) {\n\n\t\tthis.loopStart = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopEnd( value ) {\n\n\t\tthis.loopEnd = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _position = /*@__PURE__*/ new Vector3();\nconst _quaternion = /*@__PURE__*/ new Quaternion();\nconst _scale = /*@__PURE__*/ new Vector3();\nconst _orientation = /*@__PURE__*/ new Vector3();\n\nclass PositionalAudio extends Audio {\n\n\tconstructor( listener ) {\n\n\t\tsuper( listener );\n\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.panningModel = 'HRTF';\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tconnect() {\n\n\t\tsuper.connect();\n\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tdisconnect() {\n\n\t\tsuper.disconnect();\n\n\t\tthis.panner.disconnect( this.gain );\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.panner;\n\n\t}\n\n\tgetRefDistance() {\n\n\t\treturn this.panner.refDistance;\n\n\t}\n\n\tsetRefDistance( value ) {\n\n\t\tthis.panner.refDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetRolloffFactor() {\n\n\t\treturn this.panner.rolloffFactor;\n\n\t}\n\n\tsetRolloffFactor( value ) {\n\n\t\tthis.panner.rolloffFactor = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetDistanceModel() {\n\n\t\treturn this.panner.distanceModel;\n\n\t}\n\n\tsetDistanceModel( value ) {\n\n\t\tthis.panner.distanceModel = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxDistance() {\n\n\t\treturn this.panner.maxDistance;\n\n\t}\n\n\tsetMaxDistance( value ) {\n\n\t\tthis.panner.maxDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {\n\n\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\tthis.panner.coneOuterGain = coneOuterGain;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.hasPlaybackControl === true && this.isPlaying === false ) return;\n\n\t\tthis.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t_orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion );\n\n\t\tconst panner = this.panner;\n\n\t\tif ( panner.positionX ) {\n\n\t\t\t// code path for Chrome and Firefox (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\n\t\t\tpanner.positionX.linearRampToValueAtTime( _position.x, endTime );\n\t\t\tpanner.positionY.linearRampToValueAtTime( _position.y, endTime );\n\t\t\tpanner.positionZ.linearRampToValueAtTime( _position.z, endTime );\n\t\t\tpanner.orientationX.linearRampToValueAtTime( _orientation.x, endTime );\n\t\t\tpanner.orientationY.linearRampToValueAtTime( _orientation.y, endTime );\n\t\t\tpanner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime );\n\n\t\t} else {\n\n\t\t\tpanner.setPosition( _position.x, _position.y, _position.z );\n\t\t\tpanner.setOrientation( _orientation.x, _orientation.y, _orientation.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass AudioAnalyser {\n\n\tconstructor( audio, fftSize = 2048 ) {\n\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize;\n\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\n\tgetFrequencyData() {\n\n\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\treturn this.data;\n\n\t}\n\n\tgetAverageFrequency() {\n\n\t\tlet value = 0;\n\t\tconst data = this.getFrequencyData();\n\n\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\tvalue += data[ i ];\n\n\t\t}\n\n\t\treturn value / data.length;\n\n\t}\n\n}\n\nclass PropertyMixer {\n\n\tconstructor( binding, typeName, valueSize ) {\n\n\t\tthis.binding = binding;\n\t\tthis.valueSize = valueSize;\n\n\t\tlet mixFunction,\n\t\t\tmixFunctionAdditive,\n\t\t\tsetIdentity;\n\n\t\t// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\t\t//\n\t\t// 'add' is used for additive cumulative results\n\t\t//\n\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t// to store intermediate quaternion multiplication results\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\n\t\t\t\tmixFunction = this._slerp;\n\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 6 );\n\t\t\t\tthis._workIndex = 5;\n\t\t\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\t\t\t\tmixFunction = this._select;\n\n\t\t\t\t// Use the regular mix function and for additive on these types,\n\t\t\t\t// additive is not relevant for non-numeric types\n\t\t\t\tmixFunctionAdditive = this._select;\n\n\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\n\t\t\t\tthis.buffer = new Array( valueSize * 5 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tmixFunction = this._lerp;\n\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 5 );\n\n\t\t}\n\n\t\tthis._mixBufferRegion = mixFunction;\n\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\tthis._setIdentity = setIdentity;\n\t\tthis._origIndex = 3;\n\t\tthis._addIndex = 4;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tthis.useCount = 0;\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'accu'\n\taccumulate( accuIndex, weight ) {\n\n\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t// the weight and shouldn't have made the call in the first place\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = accuIndex * stride + stride;\n\n\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\tif ( currentWeight === 0 ) {\n\n\t\t\t// accuN := incoming * weight\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t}\n\n\t\t\tcurrentWeight = weight;\n\n\t\t} else {\n\n\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\tcurrentWeight += weight;\n\t\t\tconst mix = weight / currentWeight;\n\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t}\n\n\t\tthis.cumulativeWeight = currentWeight;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'add'\n\taccumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}\n\n\t// apply the state of 'accu' to the binding when accus differ\n\tapply( accuIndex ) {\n\n\t\tconst stride = this.valueSize,\n\t\t\tbuffer = this.buffer,\n\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\tweight = this.cumulativeWeight,\n\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\n\t\t\tbinding = this.binding;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tif ( weight < 1 ) {\n\n\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\tthis._mixBufferRegion(\n\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t}\n\n\t\tif ( weightAdditive > 0 ) {\n\n\t\t\t// accuN := accuN + additive accuN\n\n\t\t\tthis._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride );\n\n\t\t}\n\n\t\tfor ( let i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t// value has changed -> update scene graph\n\n\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remember the state of the bound property and copy it to both accus\n\tsaveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}\n\n\t// apply the state previously taken via 'saveOriginalState' to the binding\n\trestoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}\n\n\t_setAdditiveIdentityNumeric() {\n\n\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\tfor ( let i = startIndex; i < endIndex; i ++ ) {\n\n\t\t\tthis.buffer[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\t_setAdditiveIdentityQuaternion() {\n\n\t\tthis._setAdditiveIdentityNumeric();\n\t\tthis.buffer[ this._addIndex * this.valueSize + 3 ] = 1;\n\n\t}\n\n\t_setAdditiveIdentityOther() {\n\n\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\tfor ( let i = 0; i < this.valueSize; i ++ ) {\n\n\t\t\tthis.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];\n\n\t\t}\n\n\t}\n\n\n\t// mix functions\n\n\t_select( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tif ( t >= 0.5 ) {\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_slerp( buffer, dstOffset, srcOffset, t ) {\n\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t );\n\n\t}\n\n\t_slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst workOffset = this._workIndex * stride;\n\n\t\t// Store result in intermediate buffer offset\n\t\tQuaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset );\n\n\t\t// Slerp to the intermediate result\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t );\n\n\t}\n\n\t_lerp( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst s = 1 - t;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n\t_lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n}\n\n// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\nconst _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' );\n\n// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\nconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\\\.', '' ) + ']';\n\n// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe = /*@__PURE__*/ /((?:WC+[\\/:])*)/.source.replace( 'WC', _wordChar );\n\n// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe = /*@__PURE__*/ /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );\n\n// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe = /*@__PURE__*/ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace( 'WC', _wordChar );\n\n// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe = /*@__PURE__*/ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace( 'WC', _wordChar );\n\nconst _trackRe = new RegExp( ''\n\t+ '^'\n\t+ _directoryRe\n\t+ _nodeRe\n\t+ _objectRe\n\t+ _propertyRe\n\t+ '$'\n);\n\nconst _supportedObjectNames = [ 'material', 'materials', 'bones', 'map' ];\n\nclass Composite {\n\n\tconstructor( targetGroup, path, optionalParsedPath ) {\n\n\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t}\n\n\tgetValue( array, offset ) {\n\n\t\tthis.bind(); // bind all binding\n\n\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t// and only call .getValue on the first\n\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t}\n\n\tsetValue( array, offset ) {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t}\n\n\t}\n\n\tbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].bind();\n\n\t\t}\n\n\t}\n\n\tunbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].unbind();\n\n\t\t}\n\n\t}\n\n}\n\n// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\nclass PropertyBinding {\n\n\tconstructor( rootNode, path, parsedPath ) {\n\n\t\tthis.path = path;\n\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );\n\n\t\tthis.rootNode = rootNode;\n\n\t\t// initial state of these methods that calls 'bind'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n\n\tstatic create( root, path, parsedPath ) {\n\n\t\tif ( ! ( root && root.isAnimationObjectGroup ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name Node name to be sanitized.\n\t * @return {string}\n\t */\n\tstatic sanitizeNodeName( name ) {\n\n\t\treturn name.replace( /\\s/g, '_' ).replace( _reservedRe, '' );\n\n\t}\n\n\tstatic parseTrackName( trackName ) {\n\n\t\tconst matches = _trackRe.exec( trackName );\n\n\t\tif ( matches === null ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );\n\n\t\t}\n\n\t\tconst results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ],\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ], // required\n\t\t\tpropertyIndex: matches[ 6 ]\n\t\t};\n\n\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' );\n\n\t\tif ( lastDot !== undefined && lastDot !== - 1 ) {\n\n\t\t\tconst objectName = results.nodeName.substring( lastDot + 1 );\n\n\t\t\t// Object names must be checked against an allowlist. Otherwise, there\n\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t// include '.' characters).\n\t\t\tif ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) {\n\n\t\t\t\tresults.nodeName = results.nodeName.substring( 0, lastDot );\n\t\t\t\tresults.objectName = objectName;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t}\n\n\tstatic findNode( root, nodeName ) {\n\n\t\tif ( nodeName === undefined || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tconst bone = root.skeleton.getBoneByName( nodeName );\n\n\t\t\tif ( bone !== undefined ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tconst searchNodeSubtree = function ( children ) {\n\n\t\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\t\tconst childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tconst subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// these are used to \"bind\" a nonexistent property\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\n\t// Getters\n\n\t_getValue_direct( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.targetObject[ this.propertyName ];\n\n\t}\n\n\t_getValue_array( buffer, offset ) {\n\n\t\tconst source = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t}\n\n\t}\n\n\t_getValue_arrayElement( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t}\n\n\t_getValue_toArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t}\n\n\t// Direct\n\n\t_setValue_direct( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// EntireArray\n\n\t_setValue_array( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t}\n\n\t_setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// ArrayElement\n\n\t_setValue_arrayElement( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// HasToFromArray\n\n\t_setValue_fromArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t}\n\n\t_setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t_getValue_unbound( targetArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.getValue( targetArray, offset );\n\n\t}\n\n\t_setValue_unbound( sourceArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.setValue( sourceArray, offset );\n\n\t}\n\n\t// create getter / setter pair for a property in the scene graph\n\tbind() {\n\n\t\tlet targetObject = this.node;\n\t\tconst parsedPath = this.parsedPath;\n\n\t\tconst objectName = parsedPath.objectName;\n\t\tconst propertyName = parsedPath.propertyName;\n\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\tif ( ! targetObject ) {\n\n\t\t\ttargetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName );\n\n\t\t\tthis.node = targetObject;\n\n\t\t}\n\n\t\t// set fail state so we can just 'return' on error\n\t\tthis.getValue = this._getValue_unavailable;\n\t\tthis.setValue = this._setValue_unavailable;\n\n\t\t// ensure there is a value node\n\t\tif ( ! targetObject ) {\n\n\t\t\tconsole.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( objectName ) {\n\n\t\t\tlet objectIndex = parsedPath.objectIndex;\n\n\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\tswitch ( objectName ) {\n\n\t\t\t\tcase 'materials':\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bones':\n\n\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tfor ( let i = 0; i < targetObject.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map':\n\n\t\t\t\t\tif ( 'map' in targetObject ) {\n\n\t\t\t\t\t\ttargetObject = targetObject.map;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.map ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.map;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t}\n\n\n\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// resolve property\n\t\tconst nodeProperty = targetObject[ propertyName ];\n\n\t\tif ( nodeProperty === undefined ) {\n\n\t\t\tconst nodeName = parsedPath.nodeName;\n\n\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +\n\t\t\t\t'.' + propertyName + ' but it wasn\\'t found.', targetObject );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// determine versioning scheme\n\t\tlet versioning = this.Versioning.None;\n\n\t\tthis.targetObject = targetObject;\n\n\t\tif ( targetObject.needsUpdate !== undefined ) { // material\n\n\t\t\tversioning = this.Versioning.NeedsUpdate;\n\n\t\t} else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform\n\n\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\n\t\t}\n\n\t\t// determine how the property gets bound\n\t\tlet bindingType = this.BindingType.Direct;\n\n\t\tif ( propertyIndex !== undefined ) {\n\n\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\tif ( propertyName === 'morphTargetInfluences' ) {\n\n\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! targetObject.geometry.morphAttributes ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) {\n\n\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[ propertyIndex ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t} else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) {\n\n\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else if ( Array.isArray( nodeProperty ) ) {\n\n\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else {\n\n\t\t\tthis.propertyName = propertyName;\n\n\t\t}\n\n\t\t// select getter / setter\n\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t}\n\n\tunbind() {\n\n\t\tthis.node = null;\n\n\t\t// back to the prototype version of getValue / setValue\n\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n}\n\nPropertyBinding.Composite = Composite;\n\nPropertyBinding.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n};\n\nPropertyBinding.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n};\n\nPropertyBinding.prototype.GetterByBindingType = [\n\n\tPropertyBinding.prototype._getValue_direct,\n\tPropertyBinding.prototype._getValue_array,\n\tPropertyBinding.prototype._getValue_arrayElement,\n\tPropertyBinding.prototype._getValue_toArray,\n\n];\n\nPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [\n\n\t[\n\t\t// Direct\n\t\tPropertyBinding.prototype._setValue_direct,\n\t\tPropertyBinding.prototype._setValue_direct_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// EntireArray\n\n\t\tPropertyBinding.prototype._setValue_array,\n\t\tPropertyBinding.prototype._setValue_array_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// ArrayElement\n\t\tPropertyBinding.prototype._setValue_arrayElement,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// HasToFromArray\n\t\tPropertyBinding.prototype._setValue_fromArray,\n\t\tPropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,\n\n\t]\n\n];\n\n/**\n *\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n *\n * - Instead pass this object as 'root'.\n *\n * - You can also add and remove objects later when the mixer\n * is running.\n *\n * Note:\n *\n * Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done\n * on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the\n * all objects in the group.\n *\n * - A single property can either be controlled through a\n * target group or directly, but not both.\n */\n\nclass AnimationObjectGroup {\n\n\tconstructor() {\n\n\t\tthis.isAnimationObjectGroup = true;\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tconst indices = {};\n\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = []; // inside: string\n\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._objects.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tget bindingsPerObject() {\n\n\t\t\t\treturn scope._bindings.length;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tadd() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tpaths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet knownObject = undefined,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid;\n\t\t\tlet index = indicesByUUID[ uuid ];\n\n\t\t\tif ( index === undefined ) {\n\n\t\t\t\t// unknown object -> add it to the ACTIVE region\n\n\t\t\t\tindex = nObjects ++;\n\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\tobjects.push( object );\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tbindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t}\n\n\t\t\t} else if ( index < nCachedObjects ) {\n\n\t\t\t\tknownObject = objects[ index ];\n\n\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ];\n\n\t\t\t\t\tlet binding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\tbinding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t} else if ( objects[ index ] !== knownObject ) {\n\n\t\t\t\tconsole.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +\n\t\t\t\t\t'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );\n\n\t\t\t} // else the object is already where we want it to be\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\tremove() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined && index >= nCachedObjects ) {\n\n\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\tconst lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// remove & forget\n\tuncache() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\tnObjects = objects.length;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index < nCachedObjects ) {\n\n\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\tconst lastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\tif ( lastIndex > 0 ) {\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} // cached or active\n\n\t\t\t} // if object is known\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\tsubscribe_( path, parsedPath ) {\n\n\t\t// returns an array of bindings for the given path that is changed\n\t\t// according to the contained objects in the group\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\tlet index = indicesByPath[ path ];\n\t\tconst bindings = this._bindings;\n\n\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\tconst paths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tobjects = this._objects,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\tindex = bindings.length;\n\n\t\tindicesByPath[ path ] = index;\n\n\t\tpaths.push( path );\n\t\tparsedPaths.push( parsedPath );\n\t\tbindings.push( bindingsForPath );\n\n\t\tfor ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) {\n\n\t\t\tconst object = objects[ i ];\n\t\t\tbindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath );\n\n\t\t}\n\n\t\treturn bindingsForPath;\n\n\t}\n\n\tunsubscribe_( path ) {\n\n\t\t// tells the group to forget about a property path and no longer\n\t\t// update the array previously obtained with 'subscribe_'\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\tindex = indicesByPath[ path ];\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\tbindings[ index ] = lastBindings;\n\t\t\tbindings.pop();\n\n\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\tparsedPaths.pop();\n\n\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\tpaths.pop();\n\n\t\t}\n\n\t}\n\n}\n\nclass AnimationAction {\n\n\tconstructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot;\n\t\tthis.blendMode = blendMode;\n\n\t\tconst tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tconst interpolantSettings = {\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants; // bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null; // for the memory manager\n\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = - 1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t// scaled local time of the action\n\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\t\tthis.time = 0;\n\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\tthis.repetitions = Infinity; // no. of repetitions when looping\n\n\t\tthis.paused = false; // true -> zero effective time scale\n\t\tthis.enabled = true; // false -> zero effective weight\n\n\t\tthis.clampWhenFinished = false;// keep feeding the last frame?\n\n\t\tthis.zeroSlopeAtStart = true;// for smooth interpolation w/o separate\n\t\tthis.zeroSlopeAtEnd = true;// clips for start, loop and end\n\n\t}\n\n\t// State & Scheduling\n\n\tplay() {\n\n\t\tthis._mixer._activateAction( this );\n\n\t\treturn this;\n\n\t}\n\n\tstop() {\n\n\t\tthis._mixer._deactivateAction( this );\n\n\t\treturn this.reset();\n\n\t}\n\n\treset() {\n\n\t\tthis.paused = false;\n\t\tthis.enabled = true;\n\n\t\tthis.time = 0; // restart clip\n\t\tthis._loopCount = - 1;// forget previous loops\n\t\tthis._startTime = null;// forget scheduling\n\n\t\treturn this.stopFading().stopWarping();\n\n\t}\n\n\tisRunning() {\n\n\t\treturn this.enabled && ! this.paused && this.timeScale !== 0 &&\n\t\t\tthis._startTime === null && this._mixer._isActiveAction( this );\n\n\t}\n\n\t// return true when play has been called\n\tisScheduled() {\n\n\t\treturn this._mixer._isActiveAction( this );\n\n\t}\n\n\tstartAt( time ) {\n\n\t\tthis._startTime = time;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoop( mode, repetitions ) {\n\n\t\tthis.loop = mode;\n\t\tthis.repetitions = repetitions;\n\n\t\treturn this;\n\n\t}\n\n\t// Weight\n\n\t// set the weight stopping any scheduled fading\n\t// although .enabled = false yields an effective weight of zero, this\n\t// method does *not* change .enabled, because it would be confusing\n\tsetEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}\n\n\t// return the weight considering fading and .enabled\n\tgetEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}\n\n\tfadeIn( duration ) {\n\n\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t}\n\n\tfadeOut( duration ) {\n\n\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t}\n\n\tcrossFadeFrom( fadeOutAction, duration, warp ) {\n\n\t\tfadeOutAction.fadeOut( duration );\n\t\tthis.fadeIn( duration );\n\n\t\tif ( warp ) {\n\n\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcrossFadeTo( fadeInAction, duration, warp ) {\n\n\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t}\n\n\tstopFading() {\n\n\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\tif ( weightInterpolant !== null ) {\n\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Time Scale Control\n\n\t// set the time scale stopping any scheduled warping\n\t// although .paused = true yields an effective time scale of zero, this\n\t// method does *not* change .paused, because it would be confusing\n\tsetEffectiveTimeScale( timeScale ) {\n\n\t\tthis.timeScale = timeScale;\n\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t// return the time scale considering warping and .paused\n\tgetEffectiveTimeScale() {\n\n\t\treturn this._effectiveTimeScale;\n\n\t}\n\n\tsetDuration( duration ) {\n\n\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\tsyncWith( action ) {\n\n\t\tthis.time = action.time;\n\t\tthis.timeScale = action.timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\thalt( duration ) {\n\n\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t}\n\n\twarp( startTimeScale, endTimeScale, duration ) {\n\n\t\tconst mixer = this._mixer,\n\t\t\tnow = mixer.time,\n\t\t\ttimeScale = this.timeScale;\n\n\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\ttimes[ 1 ] = now + duration;\n\n\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\treturn this;\n\n\t}\n\n\tstopWarping() {\n\n\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Object Accessors\n\n\tgetMixer() {\n\n\t\treturn this._mixer;\n\n\t}\n\n\tgetClip() {\n\n\t\treturn this._clip;\n\n\t}\n\n\tgetRoot() {\n\n\t\treturn this._localRoot || this._mixer._root;\n\n\t}\n\n\t// Interna\n\n\t_update( time, deltaTime, timeDirection, accuIndex ) {\n\n\t\t// called by the mixer\n\n\t\tif ( ! this.enabled ) {\n\n\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\n\t\t\tthis._updateWeight( time );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst startTime = this._startTime;\n\n\t\tif ( startTime !== null ) {\n\n\t\t\t// check for scheduled start of action\n\n\t\t\tconst timeRunning = ( time - startTime ) * timeDirection;\n\t\t\tif ( timeRunning < 0 || timeDirection === 0 ) {\n\n\t\t\t\tdeltaTime = 0;\n\n\t\t\t} else {\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// apply time scale and advance time\n\n\t\tdeltaTime *= this._updateTimeScale( time );\n\t\tconst clipTime = this._updateTime( deltaTime );\n\n\t\t// note: _updateTime may disable the action resulting in\n\t\t// an effective weight of 0\n\n\t\tconst weight = this._updateWeight( time );\n\n\t\tif ( weight > 0 ) {\n\n\t\t\tconst interpolants = this._interpolants;\n\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\tswitch ( this.blendMode ) {\n\n\t\t\t\tcase AdditiveAnimationBlendMode:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulateAdditive( weight );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\tdefault:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_updateWeight( time ) {\n\n\t\tlet weight = 0;\n\n\t\tif ( this.enabled ) {\n\n\t\t\tweight = this.weight;\n\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveWeight = weight;\n\t\treturn weight;\n\n\t}\n\n\t_updateTimeScale( time ) {\n\n\t\tlet timeScale = 0;\n\n\t\tif ( ! this.paused ) {\n\n\t\t\ttimeScale = this.timeScale;\n\n\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveTimeScale = timeScale;\n\t\treturn timeScale;\n\n\t}\n\n\t_updateTime( deltaTime ) {\n\n\t\tconst duration = this._clip.duration;\n\t\tconst loop = this.loop;\n\n\t\tlet time = this.time + deltaTime;\n\t\tlet loopCount = this._loopCount;\n\n\t\tconst pingPong = ( loop === LoopPingPong );\n\n\t\tif ( deltaTime === 0 ) {\n\n\t\t\tif ( loopCount === - 1 ) return time;\n\n\t\t\treturn ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time;\n\n\t\t}\n\n\t\tif ( loop === LoopOnce ) {\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tthis._loopCount = 0;\n\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t}\n\n\t\t\thandle_stop: {\n\n\t\t\t\tif ( time >= duration ) {\n\n\t\t\t\t\ttime = duration;\n\n\t\t\t\t} else if ( time < 0 ) {\n\n\t\t\t\t\ttime = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tbreak handle_stop;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\telse this.enabled = false;\n\n\t\t\t\tthis.time = time;\n\n\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\tdirection: deltaTime < 0 ? - 1 : 1\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tif ( deltaTime >= 0 ) {\n\n\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\tthis._setEndings( true, this.repetitions === 0, pingPong );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\tthis._setEndings( this.repetitions === 0, true, pingPong );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( time >= duration || time < 0 ) {\n\n\t\t\t\t// wrap around\n\n\t\t\t\tconst loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\tif ( pending <= 0 ) {\n\n\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : - 1\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// keep running\n\n\t\t\t\t\tif ( pending === 1 ) {\n\n\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.time = time;\n\n\t\t\t}\n\n\t\t\tif ( pingPong && ( loopCount & 1 ) === 1 ) {\n\n\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\treturn duration - time;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn time;\n\n\t}\n\n\t_setEndings( atStart, atEnd, pingPong ) {\n\n\t\tconst settings = this._interpolantSettings;\n\n\t\tif ( pingPong ) {\n\n\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\n\t\t} else {\n\n\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\tif ( atStart ) {\n\n\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t\tif ( atEnd ) {\n\n\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_scheduleFading( duration, weightNow, weightThen ) {\n\n\t\tconst mixer = this._mixer, now = mixer.time;\n\t\tlet interpolant = this._weightInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\tvalues[ 0 ] = weightNow;\n\t\ttimes[ 1 ] = now + duration;\n\t\tvalues[ 1 ] = weightThen;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _controlInterpolantsResultBuffer = new Float32Array( 1 );\n\n\nclass AnimationMixer extends EventDispatcher {\n\n\tconstructor( root ) {\n\n\t\tsuper();\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\t\tthis.time = 0;\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\t_bindAction( action, prototypeAction ) {\n\n\t\tconst root = action._localRoot || this._root,\n\t\t\ttracks = action._clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tbindings = action._propertyBindings,\n\t\t\tinterpolants = action._interpolants,\n\t\t\trootUuid = root.uuid,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\n\t\tlet bindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingsByName === undefined ) {\n\n\t\t\tbindingsByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t}\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst track = tracks[ i ],\n\t\t\t\ttrackName = track.name;\n\n\t\t\tlet binding = bindingsByName[ trackName ];\n\n\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t} else {\n\n\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst path = prototypeAction && prototypeAction.\n\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t}\n\n\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t}\n\n\t}\n\n\t_activateAction( action ) {\n\n\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t// appears to be still using it -> rebind\n\n\t\t\t\tconst rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\tthis._bindAction( action,\n\t\t\t\t\tactionsForClip && actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t}\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// increment reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._lendAction( action );\n\n\t\t}\n\n\t}\n\n\t_deactivateAction( action ) {\n\n\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// decrement reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._takeBackAction( action );\n\n\t\t}\n\n\t}\n\n\t// Memory manager\n\n\t_initMemoryManager() {\n\n\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\tthis._nActiveActions = 0;\n\n\t\tthis._actionsByClip = {};\n\t\t// inside:\n\t\t// {\n\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t// }\n\n\n\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\tthis._nActiveBindings = 0;\n\n\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\n\t\tthis._controlInterpolants = []; // same game as above\n\t\tthis._nActiveControlInterpolants = 0;\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tactions: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._actions.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveActions;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tbindings: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._bindings.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveBindings;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontrolInterpolants: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._controlInterpolants.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t// Memory management for AnimationAction objects\n\n\t_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;\n\t\treturn index !== null && index < this._nActiveActions;\n\n\t}\n\n\t_addInactiveAction( action, clipUuid, rootUuid ) {\n\n\t\tconst actions = this._actions,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tlet actionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip === undefined ) {\n\n\t\t\tactionsForClip = {\n\n\t\t\t\tknownActions: [ action ],\n\t\t\t\tactionByRoot: {}\n\n\t\t\t};\n\n\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t} else {\n\n\t\t\tconst knownActions = actionsForClip.knownActions;\n\n\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\tknownActions.push( action );\n\n\t\t}\n\n\t\taction._cacheIndex = actions.length;\n\t\tactions.push( action );\n\n\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t}\n\n\t_removeInactiveAction( action ) {\n\n\t\tconst actions = this._actions,\n\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\tcacheIndex = action._cacheIndex;\n\n\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\tactions.pop();\n\n\t\taction._cacheIndex = null;\n\n\n\t\tconst clipUuid = action._clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\tlastKnownAction =\n\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\tknownActionsForClip.pop();\n\n\t\taction._byClipCacheIndex = null;\n\n\n\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\trootUuid = ( action._localRoot || this._root ).uuid;\n\n\t\tdelete actionByRoot[ rootUuid ];\n\n\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t\tthis._removeInactiveBindingsForAction( action );\n\n\t}\n\n\t_removeInactiveBindingsForAction( action ) {\n\n\t\tconst bindings = action._propertyBindings;\n\n\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tconst binding = bindings[ i ];\n\n\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_lendAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions >| inactive actions ]\n\t\t// s a\n\t\t// <-swap->\n\t\t// a s\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\taction._cacheIndex = lastActiveIndex;\n\t\tactions[ lastActiveIndex ] = action;\n\n\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t}\n\n\t_takeBackAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions |< inactive actions ]\n\t\t// a s\n\t\t// <-swap->\n\t\t// s a\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\taction._cacheIndex = firstInactiveIndex;\n\t\tactions[ firstInactiveIndex ] = action;\n\n\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t}\n\n\t// Memory management for PropertyMixer objects\n\n\t_addInactiveBinding( binding, rootUuid, trackName ) {\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindings = this._bindings;\n\n\t\tlet bindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName === undefined ) {\n\n\t\t\tbindingByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t}\n\n\t\tbindingByName[ trackName ] = binding;\n\n\t\tbinding._cacheIndex = bindings.length;\n\t\tbindings.push( binding );\n\n\t}\n\n\t_removeInactiveBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tpropBinding = binding.binding,\n\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\ttrackName = propBinding.path,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\tbindings.pop();\n\n\t\tdelete bindingByName[ trackName ];\n\n\t\tif ( Object.keys( bindingByName ).length === 0 ) {\n\n\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t}\n\n\t}\n\n\t_lendBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\tbinding._cacheIndex = lastActiveIndex;\n\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t}\n\n\t_takeBackBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t}\n\n\n\t// Memory management of Interpolants for weight and time scale\n\n\t_lendControlInterpolant() {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++;\n\n\t\tlet interpolant = interpolants[ lastActiveIndex ];\n\n\t\tif ( interpolant === undefined ) {\n\n\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t1, _controlInterpolantsResultBuffer );\n\n\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t}\n\n\t\treturn interpolant;\n\n\t}\n\n\t_takeBackControlInterpolant( interpolant ) {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t}\n\n\t// return an action for a clip optionally using a custom root target\n\t// object (this method allocates a lot of dynamic memory in case a\n\t// previously unknown clip/root combination is specified)\n\tclipAction( clip, optionalRoot, blendMode ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid;\n\n\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip;\n\n\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\n\t\tconst actionsForClip = this._actionsByClip[ clipUuid ];\n\t\tlet prototypeAction = null;\n\n\t\tif ( blendMode === undefined ) {\n\n\t\t\tif ( clipObject !== null ) {\n\n\t\t\t\tblendMode = clipObject.blendMode;\n\n\t\t\t} else {\n\n\t\t\t\tblendMode = NormalAnimationBlendMode;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\tconst existingAction = actionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\tif ( existingAction !== undefined && existingAction.blendMode === blendMode ) {\n\n\t\t\t\treturn existingAction;\n\n\t\t\t}\n\n\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t// the bindings again but can just copy\n\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t// also, take the clip from the prototype action\n\t\t\tif ( clipObject === null )\n\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t}\n\n\t\t// clip must be known when specified via string\n\t\tif ( clipObject === null ) return null;\n\n\t\t// allocate all resources required to run it\n\t\tconst newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode );\n\n\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t// and make the action known to the memory manager\n\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\treturn newAction;\n\n\t}\n\n\t// get an existing action\n\texistingAction( clip, optionalRoot ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid,\n\n\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// deactivates all previously scheduled actions\n\tstopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// advance the time and update apply the animation\n\tupdate( deltaTime ) {\n\n\t\tdeltaTime *= this.timeScale;\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\n\t\t\ttime = this.time += deltaTime,\n\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t// run active actions\n\n\t\tfor ( let i = 0; i !== nActions; ++ i ) {\n\n\t\t\tconst action = actions[ i ];\n\n\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t}\n\n\t\t// update scene graph\n\n\t\tconst bindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tfor ( let i = 0; i !== nBindings; ++ i ) {\n\n\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Allows you to seek to a specific time in an animation.\n\tsetTime( timeInSeconds ) {\n\n\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\t\tfor ( let i = 0; i < this._actions.length; i ++ ) {\n\n\t\t\tthis._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\n\t\t}\n\n\t\treturn this.update( timeInSeconds ); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\n\t}\n\n\t// return this mixer's root target object\n\tgetRoot() {\n\n\t\treturn this._root;\n\n\t}\n\n\t// free all resources specific to a particular clip\n\tuncacheClip( clip ) {\n\n\t\tconst actions = this._actions,\n\t\t\tclipUuid = clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t// iteration state and also require updating the state we can\n\t\t\t// just throw away\n\n\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\tfor ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\tconst action = actionsToRemove[ i ];\n\n\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\taction._cacheIndex = null;\n\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\tactions.pop();\n\n\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t}\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t}\n\n\t// free all resources specific to a particular root target object\n\tuncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remove a targeted clip from the cache\n\tuncacheAction( clip, optionalRoot ) {\n\n\t\tconst action = this.existingAction( clip, optionalRoot );\n\n\t\tif ( action !== null ) {\n\n\t\t\tthis._deactivateAction( action );\n\t\t\tthis._removeInactiveAction( action );\n\n\t\t}\n\n\t}\n\n}\n\nclass Uniform {\n\n\tconstructor( value ) {\n\n\t\tthis.value = value;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );\n\n\t}\n\n}\n\nlet _id = 0;\n\nclass UniformsGroup extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isUniformsGroup = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _id ++ } );\n\n\t\tthis.name = '';\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.uniforms = [];\n\n\t}\n\n\tadd( uniform ) {\n\n\t\tthis.uniforms.push( uniform );\n\n\t\treturn this;\n\n\t}\n\n\tremove( uniform ) {\n\n\t\tconst index = this.uniforms.indexOf( uniform );\n\n\t\tif ( index !== - 1 ) this.uniforms.splice( index, 1 );\n\n\t\treturn this;\n\n\t}\n\n\tsetName( name ) {\n\n\t\tthis.name = name;\n\n\t\treturn this;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.usage = source.usage;\n\n\t\tconst uniformsSource = source.uniforms;\n\n\t\tthis.uniforms.length = 0;\n\n\t\tfor ( let i = 0, l = uniformsSource.length; i < l; i ++ ) {\n\n\t\t\tconst uniforms = Array.isArray( uniformsSource[ i ] ) ? uniformsSource[ i ] : [ uniformsSource[ i ] ];\n\n\t\t\tfor ( let j = 0; j < uniforms.length; j ++ ) {\n\n\t\t\t\tthis.uniforms.push( uniforms[ j ].clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\n\tconstructor( array, stride, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, stride );\n\n\t\tthis.isInstancedInterleavedBuffer = true;\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tconst ib = super.clone( data );\n\n\t\tib.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn ib;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tconst json = super.toJSON( data );\n\n\t\tjson.isInstancedInterleavedBuffer = true;\n\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn json;\n\n\t}\n\n}\n\nclass GLBufferAttribute {\n\n\tconstructor( buffer, type, itemSize, elementSize, count ) {\n\n\t\tthis.isGLBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.buffer = buffer;\n\t\tthis.type = type;\n\t\tthis.itemSize = itemSize;\n\t\tthis.elementSize = elementSize;\n\t\tthis.count = count;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetBuffer( buffer ) {\n\n\t\tthis.buffer = buffer;\n\n\t\treturn this;\n\n\t}\n\n\tsetType( type, elementSize ) {\n\n\t\tthis.type = type;\n\t\tthis.elementSize = elementSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetItemSize( itemSize ) {\n\n\t\tthis.itemSize = itemSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetCount( count ) {\n\n\t\tthis.count = count;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _matrix = /*@__PURE__*/ new Matrix4();\n\nclass Raycaster {\n\n\tconstructor( origin, direction, near = 0, far = Infinity ) {\n\n\t\tthis.ray = new Ray( origin, direction );\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.camera = null;\n\t\tthis.layers = new Layers();\n\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: { threshold: 1 },\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.ray.set( origin, direction );\n\n\t}\n\n\tsetFromCamera( coords, camera ) {\n\n\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\t\t\tthis.camera = camera;\n\n\t\t} else if ( camera.isOrthographicCamera ) {\n\n\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\tthis.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );\n\t\t\tthis.camera = camera;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );\n\n\t\t}\n\n\t}\n\n\tsetFromXRController( controller ) {\n\n\t\t_matrix.identity().extractRotation( controller.matrixWorld );\n\n\t\tthis.ray.origin.setFromMatrixPosition( controller.matrixWorld );\n\t\tthis.ray.direction.set( 0, 0, - 1 ).applyMatrix4( _matrix );\n\n\t\treturn this;\n\n\t}\n\n\tintersectObject( object, recursive = true, intersects = [] ) {\n\n\t\tintersect( object, this, intersects, recursive );\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n\tintersectObjects( objects, recursive = true, intersects = [] ) {\n\n\t\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\t\tintersect( objects[ i ], this, intersects, recursive );\n\n\t\t}\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n}\n\nfunction ascSort( a, b ) {\n\n\treturn a.distance - b.distance;\n\n}\n\nfunction intersect( object, raycaster, intersects, recursive ) {\n\n\tif ( object.layers.test( raycaster.layers ) ) {\n\n\t\tobject.raycast( raycaster, intersects );\n\n\t}\n\n\tif ( recursive === true ) {\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tintersect( children[ i ], raycaster, intersects, true );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n *\n * phi (the polar angle) is measured from the positive y-axis. The positive y-axis is up.\n * theta (the azimuthal angle) is measured from the positive z-axis.\n */\nclass Spherical {\n\n\tconstructor( radius = 1, phi = 0, theta = 0 ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, phi, theta ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\n\t\treturn this;\n\n\t}\n\n\t// restrict phi to be between EPS and PI-EPS\n\tmakeSafe() {\n\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + y * y + z * z );\n\n\t\tif ( this.radius === 0 ) {\n\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\n\t\t} else {\n\n\t\t\tthis.theta = Math.atan2( x, z );\n\t\t\tthis.phi = Math.acos( clamp( y / this.radius, - 1, 1 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n */\n\nclass Cylindrical {\n\n\tconstructor( radius = 1, theta = 0, y = 0 ) {\n\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, theta, y ) {\n\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + z * z );\n\t\tthis.theta = Math.atan2( x, z );\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$4 = /*@__PURE__*/ new Vector2();\n\nclass Box2 {\n\n\tconstructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {\n\n\t\tthis.isBox2 = true;\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 );\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = + Infinity;\n\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x < this.min.x || point.x > this.max.x ||\n\t\t\tpoint.y < this.min.y || point.y > this.max.y ? false : true;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 4 splitting planes to rule out intersections\n\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\tbox.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$4 ).distanceTo( point );\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/ new Vector3();\nconst _startEnd = /*@__PURE__*/ new Vector3();\n\nclass Line3 {\n\n\tconstructor( start = new Vector3(), end = new Vector3() ) {\n\n\t\tthis.start = start;\n\t\tthis.end = end;\n\n\t}\n\n\tset( start, end ) {\n\n\t\tthis.start.copy( start );\n\t\tthis.end.copy( end );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( line ) {\n\n\t\tthis.start.copy( line.start );\n\t\tthis.end.copy( line.end );\n\n\t\treturn this;\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t}\n\n\tdelta( target ) {\n\n\t\treturn target.subVectors( this.end, this.start );\n\n\t}\n\n\tdistanceSq() {\n\n\t\treturn this.start.distanceToSquared( this.end );\n\n\t}\n\n\tdistance() {\n\n\t\treturn this.start.distanceTo( this.end );\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tclosestPointToPointParameter( point, clampToLine ) {\n\n\t\t_startP.subVectors( point, this.start );\n\t\t_startEnd.subVectors( this.end, this.start );\n\n\t\tconst startEnd2 = _startEnd.dot( _startEnd );\n\t\tconst startEnd_startP = _startEnd.dot( _startP );\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif ( clampToLine ) {\n\n\t\t\tt = clamp( t, 0, 1 );\n\n\t\t}\n\n\t\treturn t;\n\n\t}\n\n\tclosestPointToPoint( point, clampToLine, target ) {\n\n\t\tconst t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.start.applyMatrix4( matrix );\n\t\tthis.end.applyMatrix4( matrix );\n\n\t\treturn this;\n\n\t}\n\n\tequals( line ) {\n\n\t\treturn line.start.equals( this.start ) && line.end.equals( this.end );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/ new Vector3();\n\nclass SpotLightHelper extends Object3D {\n\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'SpotLightHelper';\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t- 1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, - 1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t// update the local matrix based on the parent and light target transforms\n\t\tif ( this.parent ) {\n\n\t\t\tthis.parent.updateWorldMatrix( true );\n\n\t\t\tthis.matrix\n\t\t\t\t.copy( this.parent.matrixWorld )\n\t\t\t\t.invert()\n\t\t\t\t.multiply( this.light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tthis.matrix.copy( this.light.matrixWorld );\n\n\t\t}\n\n\t\tthis.matrixWorld.copy( this.light.matrixWorld );\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector$3.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector$3 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector$2 = /*@__PURE__*/ new Vector3();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\nconst _matrixWorldInv = /*@__PURE__*/ new Matrix4();\n\n\nclass SkeletonHelper extends LineSegments {\n\n\tconstructor( object ) {\n\n\t\tconst bones = getBoneList( object );\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst color1 = new Color( 0, 0, 1 );\n\t\tconst color2 = new Color( 0, 1, 0 );\n\n\t\tfor ( let i = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tcolors.push( color1.r, color1.g, color1.b );\n\t\t\t\tcolors.push( color2.r, color2.g, color2.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isSkeletonHelper = true;\n\n\t\tthis.type = 'SkeletonHelper';\n\n\t\tthis.root = object;\n\t\tthis.bones = bones;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst bones = this.bones;\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t_matrixWorldInv.copy( this.root.matrixWorld ).invert();\n\n\t\tfor ( let i = 0, j = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction getBoneList( object ) {\n\n\tconst boneList = [];\n\n\tif ( object.isBone === true ) {\n\n\t\tboneList.push( object );\n\n\t}\n\n\tfor ( let i = 0; i < object.children.length; i ++ ) {\n\n\t\tboneList.push.apply( boneList, getBoneList( object.children[ i ] ) );\n\n\t}\n\n\treturn boneList;\n\n}\n\nclass PointLightHelper extends Mesh {\n\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.light = light;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\n\t\t/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\nconst _vector$1 = /*@__PURE__*/ new Vector3();\nconst _color1 = /*@__PURE__*/ new Color();\nconst _color2 = /*@__PURE__*/ new Color();\n\nclass HemisphereLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'HemisphereLightHelper';\n\n\t\tconst geometry = new OctahedronGeometry( size );\n\t\tgeometry.rotateY( Math.PI * 0.5 );\n\n\t\tthis.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\t\tif ( this.color === undefined ) this.material.vertexColors = true;\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\t\tconst colors = new Float32Array( position.count * 3 );\n\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tthis.add( new Mesh( geometry, this.material ) );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tconst mesh = this.children[ 0 ];\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tconst colors = mesh.geometry.getAttribute( 'color' );\n\n\t\t\t_color1.copy( this.light.color );\n\t\t\t_color2.copy( this.light.groundColor );\n\n\t\t\tfor ( let i = 0, l = colors.count; i < l; i ++ ) {\n\n\t\t\t\tconst color = ( i < ( l / 2 ) ) ? _color1 : _color2;\n\n\t\t\t\tcolors.setXYZ( i, color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t\tcolors.needsUpdate = true;\n\n\t\t}\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tmesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\n\t}\n\n}\n\nclass GridHelper extends LineSegments {\n\n\tconstructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst center = divisions / 2;\n\t\tconst step = size / divisions;\n\t\tconst halfSize = size / 2;\n\n\t\tconst vertices = [], colors = [];\n\n\t\tfor ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - halfSize, 0, k, halfSize, 0, k );\n\t\t\tvertices.push( k, 0, - halfSize, k, 0, halfSize );\n\n\t\t\tconst color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'GridHelper';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass PolarGridHelper extends LineSegments {\n\n\tconstructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\t// create the sectors\n\n\t\tif ( sectors > 1 ) {\n\n\t\t\tfor ( let i = 0; i < sectors; i ++ ) {\n\n\t\t\t\tconst v = ( i / sectors ) * ( Math.PI * 2 );\n\n\t\t\t\tconst x = Math.sin( v ) * radius;\n\t\t\t\tconst z = Math.cos( v ) * radius;\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( x, 0, z );\n\n\t\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// create the rings\n\n\t\tfor ( let i = 0; i < rings; i ++ ) {\n\n\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\tconst r = radius - ( radius / rings * i );\n\n\t\t\tfor ( let j = 0; j < divisions; j ++ ) {\n\n\t\t\t\t// first vertex\n\n\t\t\t\tlet v = ( j / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tlet x = Math.sin( v ) * r;\n\t\t\t\tlet z = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t\t// second vertex\n\n\t\t\t\tv = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tx = Math.sin( v ) * r;\n\t\t\t\tz = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'PolarGridHelper';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\nclass DirectionalLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'DirectionalLightHelper';\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tlet geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [\n\t\t\t- size, size, 0,\n\t\t\tsize, size, 0,\n\t\t\tsize, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.lightPlane = new Line( geometry, material );\n\t\tthis.add( this.lightPlane );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\tthis.targetLine = new Line( geometry, material );\n\t\tthis.add( this.targetLine );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.lightPlane.geometry.dispose();\n\t\tthis.lightPlane.material.dispose();\n\t\tthis.targetLine.geometry.dispose();\n\t\tthis.targetLine.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t_v1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t_v2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t_v3.subVectors( _v2, _v1 );\n\n\t\tthis.lightPlane.lookAt( _v2 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.lightPlane.material.color.set( this.color );\n\t\t\tthis.targetLine.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.lightPlane.material.color.copy( this.light.color );\n\t\t\tthis.targetLine.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\tthis.targetLine.lookAt( _v2 );\n\t\tthis.targetLine.scale.z = _v3.length();\n\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/ new Vector3();\nconst _camera = /*@__PURE__*/ new Camera();\n\n/**\n *\t- shows frustum, line of sight and up of the camera\n *\t- suitable for fast updates\n * \t- based on frustum visualization in lightgl.js shadowmap example\n *\t\thttps://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html\n */\n\nclass CameraHelper extends LineSegments {\n\n\tconstructor( camera ) {\n\n\t\tconst geometry = new BufferGeometry();\n\t\tconst material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst pointMap = {};\n\n\t\t// near\n\n\t\taddLine( 'n1', 'n2' );\n\t\taddLine( 'n2', 'n4' );\n\t\taddLine( 'n4', 'n3' );\n\t\taddLine( 'n3', 'n1' );\n\n\t\t// far\n\n\t\taddLine( 'f1', 'f2' );\n\t\taddLine( 'f2', 'f4' );\n\t\taddLine( 'f4', 'f3' );\n\t\taddLine( 'f3', 'f1' );\n\n\t\t// sides\n\n\t\taddLine( 'n1', 'f1' );\n\t\taddLine( 'n2', 'f2' );\n\t\taddLine( 'n3', 'f3' );\n\t\taddLine( 'n4', 'f4' );\n\n\t\t// cone\n\n\t\taddLine( 'p', 'n1' );\n\t\taddLine( 'p', 'n2' );\n\t\taddLine( 'p', 'n3' );\n\t\taddLine( 'p', 'n4' );\n\n\t\t// up\n\n\t\taddLine( 'u1', 'u2' );\n\t\taddLine( 'u2', 'u3' );\n\t\taddLine( 'u3', 'u1' );\n\n\t\t// target\n\n\t\taddLine( 'c', 't' );\n\t\taddLine( 'p', 'c' );\n\n\t\t// cross\n\n\t\taddLine( 'cn1', 'cn2' );\n\t\taddLine( 'cn3', 'cn4' );\n\n\t\taddLine( 'cf1', 'cf2' );\n\t\taddLine( 'cf3', 'cf4' );\n\n\t\tfunction addLine( a, b ) {\n\n\t\t\taddPoint( a );\n\t\t\taddPoint( b );\n\n\t\t}\n\n\t\tfunction addPoint( id ) {\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( ( vertices.length / 3 ) - 1 );\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'CameraHelper';\n\n\t\tthis.camera = camera;\n\t\tif ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t\t// colors\n\n\t\tconst colorFrustum = new Color( 0xffaa00 );\n\t\tconst colorCone = new Color( 0xff0000 );\n\t\tconst colorUp = new Color( 0x00aaff );\n\t\tconst colorTarget = new Color( 0xffffff );\n\t\tconst colorCross = new Color( 0x333333 );\n\n\t\tthis.setColors( colorFrustum, colorCone, colorUp, colorTarget, colorCross );\n\n\t}\n\n\tsetColors( frustum, cone, up, target, cross ) {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\t// near\n\n\t\tcolorAttribute.setXYZ( 0, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 1, frustum.r, frustum.g, frustum.b ); // n1, n2\n\t\tcolorAttribute.setXYZ( 2, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 3, frustum.r, frustum.g, frustum.b ); // n2, n4\n\t\tcolorAttribute.setXYZ( 4, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 5, frustum.r, frustum.g, frustum.b ); // n4, n3\n\t\tcolorAttribute.setXYZ( 6, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 7, frustum.r, frustum.g, frustum.b ); // n3, n1\n\n\t\t// far\n\n\t\tcolorAttribute.setXYZ( 8, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 9, frustum.r, frustum.g, frustum.b ); // f1, f2\n\t\tcolorAttribute.setXYZ( 10, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 11, frustum.r, frustum.g, frustum.b ); // f2, f4\n\t\tcolorAttribute.setXYZ( 12, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 13, frustum.r, frustum.g, frustum.b ); // f4, f3\n\t\tcolorAttribute.setXYZ( 14, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 15, frustum.r, frustum.g, frustum.b ); // f3, f1\n\n\t\t// sides\n\n\t\tcolorAttribute.setXYZ( 16, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 17, frustum.r, frustum.g, frustum.b ); // n1, f1\n\t\tcolorAttribute.setXYZ( 18, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 19, frustum.r, frustum.g, frustum.b ); // n2, f2\n\t\tcolorAttribute.setXYZ( 20, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 21, frustum.r, frustum.g, frustum.b ); // n3, f3\n\t\tcolorAttribute.setXYZ( 22, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 23, frustum.r, frustum.g, frustum.b ); // n4, f4\n\n\t\t// cone\n\n\t\tcolorAttribute.setXYZ( 24, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 25, cone.r, cone.g, cone.b ); // p, n1\n\t\tcolorAttribute.setXYZ( 26, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 27, cone.r, cone.g, cone.b ); // p, n2\n\t\tcolorAttribute.setXYZ( 28, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 29, cone.r, cone.g, cone.b ); // p, n3\n\t\tcolorAttribute.setXYZ( 30, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 31, cone.r, cone.g, cone.b ); // p, n4\n\n\t\t// up\n\n\t\tcolorAttribute.setXYZ( 32, up.r, up.g, up.b ); colorAttribute.setXYZ( 33, up.r, up.g, up.b ); // u1, u2\n\t\tcolorAttribute.setXYZ( 34, up.r, up.g, up.b ); colorAttribute.setXYZ( 35, up.r, up.g, up.b ); // u2, u3\n\t\tcolorAttribute.setXYZ( 36, up.r, up.g, up.b ); colorAttribute.setXYZ( 37, up.r, up.g, up.b ); // u3, u1\n\n\t\t// target\n\n\t\tcolorAttribute.setXYZ( 38, target.r, target.g, target.b ); colorAttribute.setXYZ( 39, target.r, target.g, target.b ); // c, t\n\t\tcolorAttribute.setXYZ( 40, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 41, cross.r, cross.g, cross.b ); // p, c\n\n\t\t// cross\n\n\t\tcolorAttribute.setXYZ( 42, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 43, cross.r, cross.g, cross.b ); // cn1, cn2\n\t\tcolorAttribute.setXYZ( 44, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 45, cross.r, cross.g, cross.b ); // cn3, cn4\n\n\t\tcolorAttribute.setXYZ( 46, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 47, cross.r, cross.g, cross.b ); // cf1, cf2\n\t\tcolorAttribute.setXYZ( 48, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 49, cross.r, cross.g, cross.b ); // cf3, cf4\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t}\n\n\tupdate() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst pointMap = this.pointMap;\n\n\t\tconst w = 1, h = 1;\n\n\t\t// we need just camera projection matrix inverse\n\t\t// world matrix must be identity\n\n\t\t_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );\n\n\t\t// center / target\n\n\t\tsetPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 );\n\t\tsetPoint( 't', pointMap, geometry, _camera, 0, 0, 1 );\n\n\t\t// near\n\n\t\tsetPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 );\n\t\tsetPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 );\n\t\tsetPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 );\n\t\tsetPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 );\n\n\t\t// far\n\n\t\tsetPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 );\n\t\tsetPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 );\n\t\tsetPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 );\n\t\tsetPoint( 'f4', pointMap, geometry, _camera, w, h, 1 );\n\n\t\t// up\n\n\t\tsetPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 );\n\n\t\t// cross\n\n\t\tsetPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 );\n\t\tsetPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 );\n\t\tsetPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 );\n\t\tsetPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 );\n\n\t\tsetPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 );\n\t\tsetPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 );\n\t\tsetPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 );\n\t\tsetPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 );\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction setPoint( point, pointMap, geometry, camera, x, y, z ) {\n\n\t_vector.set( x, y, z ).unproject( camera );\n\n\tconst points = pointMap[ point ];\n\n\tif ( points !== undefined ) {\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tposition.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z );\n\n\t\t}\n\n\t}\n\n}\n\nconst _box = /*@__PURE__*/ new Box3();\n\nclass BoxHelper extends LineSegments {\n\n\tconstructor( object, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tconst positions = new Float32Array( 8 * 3 );\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.object = object;\n\t\tthis.type = 'BoxHelper';\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\tupdate( object ) {\n\n\t\tif ( object !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.BoxHelper: .update() has no longer arguments.' );\n\n\t\t}\n\n\t\tif ( this.object !== undefined ) {\n\n\t\t\t_box.setFromObject( this.object );\n\n\t\t}\n\n\t\tif ( _box.isEmpty() ) return;\n\n\t\tconst min = _box.min;\n\t\tconst max = _box.max;\n\n\t\t/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/\n\n\t\tconst position = this.geometry.attributes.position;\n\t\tconst array = position.array;\n\n\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\tposition.needsUpdate = true;\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tsetFromObject( object ) {\n\n\t\tthis.object = object;\n\t\tthis.update();\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.object = source.object;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass Box3Helper extends LineSegments {\n\n\tconstructor( box, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\n\t\tconst positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ];\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.box = box;\n\n\t\tthis.type = 'Box3Helper';\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst box = this.box;\n\n\t\tif ( box.isEmpty() ) return;\n\n\t\tbox.getCenter( this.position );\n\n\t\tbox.getSize( this.scale );\n\n\t\tthis.scale.multiplyScalar( 0.5 );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass PlaneHelper extends Line {\n\n\tconstructor( plane, size = 1, hex = 0xffff00 ) {\n\n\t\tconst color = hex;\n\n\t\tconst positions = [ 1, - 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\t\tgeometry.computeBoundingSphere();\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.type = 'PlaneHelper';\n\n\t\tthis.plane = plane;\n\n\t\tthis.size = size;\n\n\t\tconst positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ];\n\n\t\tconst geometry2 = new BufferGeometry();\n\t\tgeometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );\n\t\tgeometry2.computeBoundingSphere();\n\n\t\tthis.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tthis.position.set( 0, 0, 0 );\n\n\t\tthis.scale.set( 0.5 * this.size, 0.5 * this.size, 1 );\n\n\t\tthis.lookAt( this.plane.normal );\n\n\t\tthis.translateZ( - this.plane.constant );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n}\n\nconst _axis = /*@__PURE__*/ new Vector3();\nlet _lineGeometry, _coneGeometry;\n\nclass ArrowHelper extends Object3D {\n\n\t// dir is assumed to be normalized\n\n\tconstructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ArrowHelper';\n\n\t\tif ( _lineGeometry === undefined ) {\n\n\t\t\t_lineGeometry = new BufferGeometry();\n\t\t\t_lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\t\t\t_coneGeometry = new CylinderGeometry( 0, 0.5, 1, 5, 1 );\n\t\t\t_coneGeometry.translate( 0, - 0.5, 0 );\n\n\t\t}\n\n\t\tthis.position.copy( origin );\n\n\t\tthis.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\tthis.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\tsetDirection( dir ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tif ( dir.y > 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t} else if ( dir.y < - 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_axis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\tconst radians = Math.acos( dir.y );\n\n\t\t\tthis.quaternion.setFromAxisAngle( _axis, radians );\n\n\t\t}\n\n\t}\n\n\tsetLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tthis.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t}\n\n\tsetColor( color ) {\n\n\t\tthis.line.material.color.set( color );\n\t\tthis.cone.material.color.set( color );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tthis.line.copy( source.line );\n\t\tthis.cone.copy( source.cone );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.line.geometry.dispose();\n\t\tthis.line.material.dispose();\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n}\n\nclass AxesHelper extends LineSegments {\n\n\tconstructor( size = 1 ) {\n\n\t\tconst vertices = [\n\t\t\t0, 0, 0,\tsize, 0, 0,\n\t\t\t0, 0, 0,\t0, size, 0,\n\t\t\t0, 0, 0,\t0, 0, size\n\t\t];\n\n\t\tconst colors = [\n\t\t\t1, 0, 0,\t1, 0.6, 0,\n\t\t\t0, 1, 0,\t0.6, 1, 0,\n\t\t\t0, 0, 1,\t0, 0.6, 1\n\t\t];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'AxesHelper';\n\n\t}\n\n\tsetColors( xAxisColor, yAxisColor, zAxisColor ) {\n\n\t\tconst color = new Color();\n\t\tconst array = this.geometry.attributes.color.array;\n\n\t\tcolor.set( xAxisColor );\n\t\tcolor.toArray( array, 0 );\n\t\tcolor.toArray( array, 3 );\n\n\t\tcolor.set( yAxisColor );\n\t\tcolor.toArray( array, 6 );\n\t\tcolor.toArray( array, 9 );\n\n\t\tcolor.set( zAxisColor );\n\t\tcolor.toArray( array, 12 );\n\t\tcolor.toArray( array, 15 );\n\n\t\tthis.geometry.attributes.color.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass ShapePath {\n\n\tconstructor() {\n\n\t\tthis.type = 'ShapePath';\n\n\t\tthis.color = new Color();\n\n\t\tthis.subPaths = [];\n\t\tthis.currentPath = null;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPath = new Path();\n\t\tthis.subPaths.push( this.currentPath );\n\t\tthis.currentPath.moveTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tthis.currentPath.lineTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts ) {\n\n\t\tthis.currentPath.splineThru( pts );\n\n\t\treturn this;\n\n\t}\n\n\ttoShapes( isCCW ) {\n\n\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\tconst shapes = [];\n\n\t\t\tfor ( let i = 0, l = inSubpaths.length; i < l; i ++ ) {\n\n\t\t\t\tconst tmpPath = inSubpaths[ i ];\n\n\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\tconst polyLen = inPolygon.length;\n\n\t\t\t// inPt on polygon contour => immediate success or\n\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t// with the horizontal line through inPt, left of inPt\n\t\t\t// not counting lowerY endpoints of edges and whole edges on that line\n\t\t\tlet inside = false;\n\t\t\tfor ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) {\n\n\t\t\t\tlet edgeLowPt = inPolygon[ p ];\n\t\t\t\tlet edgeHighPt = inPolygon[ q ];\n\n\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\tif ( Math.abs( edgeDy ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\t\t\t\t\tif ( edgeDy < 0 ) {\n\n\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\tif ( perpEdge < 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\tif ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t// continue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tinside;\n\n\t\t}\n\n\t\tconst isClockWise = ShapeUtils.isClockWise;\n\n\t\tconst subPaths = this.subPaths;\n\t\tif ( subPaths.length === 0 ) return [];\n\n\t\tlet solid, tmpPath, tmpShape;\n\t\tconst shapes = [];\n\n\t\tif ( subPaths.length === 1 ) {\n\n\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\ttmpShape = new Shape();\n\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\tshapes.push( tmpShape );\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tlet holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t// console.log(\"Holes first\", holesFirst);\n\n\t\tconst betterShapeHoles = [];\n\t\tconst newShapes = [];\n\t\tlet newShapeHoles = [];\n\t\tlet mainIdx = 0;\n\t\tlet tmpPoints;\n\n\t\tnewShapes[ mainIdx ] = undefined;\n\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\tfor ( let i = 0, l = subPaths.length; i < l; i ++ ) {\n\n\t\t\ttmpPath = subPaths[ i ];\n\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\tif ( solid ) {\n\n\t\t\t\tif ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t//console.log('cw', i);\n\n\t\t\t} else {\n\n\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t//console.log('ccw', i);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// only Holes? -> probably all Shapes with wrong orientation\n\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tif ( newShapes.length > 1 ) {\n\n\t\t\tlet ambiguous = false;\n\t\t\tlet toChange = 0;\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t}\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tconst sho = newShapeHoles[ sIdx ];\n\n\t\t\t\tfor ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) {\n\n\t\t\t\t\tconst ho = sho[ hIdx ];\n\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\tfor ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange ++;\n\n\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( toChange > 0 && ambiguous === false ) {\n\n\t\t\t\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet tmpHoles;\n\n\t\tfor ( let i = 0, il = newShapes.length; i < il; i ++ ) {\n\n\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\tshapes.push( tmpShape );\n\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\tfor ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) {\n\n\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//console.log(\"shape\", shapes);\n\n\t\treturn shapes;\n\n\t}\n\n}\n\nclass WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162\n\n\tconstructor( width = 1, height = 1, count = 1, options = {} ) {\n\n\t\tconsole.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the \"count\" parameter to enable MRT.' );\n\n\t\tsuper( width, height, { ...options, count } );\n\n\t\tthis.isWebGLMultipleRenderTargets = true;\n\n\t}\n\n\tget texture() {\n\n\t\treturn this.textures;\n\n\t}\n\n}\n\nif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {\n\t\trevision: REVISION,\n\t} } ) );\n\n}\n\nif ( typeof window !== 'undefined' ) {\n\n\tif ( window.__THREE__ ) {\n\n\t\tconsole.warn( 'WARNING: Multiple instances of Three.js being imported.' );\n\n\t} else {\n\n\t\twindow.__THREE__ = REVISION;\n\n\t}\n\n}\n\nexport { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, P3Primaries, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, Rec709Primaries, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, createCanvasElement };\n","// Copyright 2024 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {BoxGeometry, BufferAttribute, BufferGeometry, IcosahedronGeometry, Mesh as ThreeMesh, MeshLambertMaterial, MeshNormalMaterial, PerspectiveCamera, PointLight, Scene, WebGLRenderer} from 'three';\n\nimport Module, {Mesh} from './built/manifold';\n\n// Load Manifold WASM library\nconst wasm = await Module();\nwasm.setup();\nconst {Manifold, Mesh} = wasm;\n\n// Define our set of materials\nconst materials = [\n new MeshNormalMaterial({flatShading: true}),\n new MeshLambertMaterial({color: 'red', flatShading: true}),\n new MeshLambertMaterial({color: 'blue', flatShading: true})\n];\nconst result = new ThreeMesh(undefined, materials);\n\n// Set up Manifold IDs corresponding to materials\nconst firstID = Manifold.reserveIDs(materials.length);\n// ids vector is parallel to materials vector - same indexing\nconst ids = [...Array(materials.length)].map((_, idx) => firstID + idx);\n// Build a mapping to get back from ID to material index\nconst id2matIndex = new Map();\nids.forEach((id, idx) => id2matIndex.set(id, idx));\n\n// Set up Three.js scene\nconst scene = new Scene();\nconst camera = new PerspectiveCamera(30, 1, 0.01, 10);\ncamera.position.z = 1;\ncamera.add(new PointLight(0xffffff, 1));\nscene.add(camera);\nscene.add(result);\n\n// Set up Three.js renderer\nconst output = document.querySelector('#output')!;\nconst renderer = new WebGLRenderer({canvas: output, antialias: true});\nconst dim = output.getBoundingClientRect();\nrenderer.setSize(dim.width, dim.height);\nrenderer.setAnimationLoop(function(time: number) {\n result.rotation.x = time / 2000;\n result.rotation.y = time / 1000;\n renderer.render(scene, camera);\n});\n\n// Create input meshes in Three.js\nconst cube = new BoxGeometry(0.2, 0.2, 0.2);\ncube.clearGroups();\ncube.addGroup(0, 18, 0); // First 6 faces colored by normal\ncube.addGroup(18, Infinity, 1); // Rest of faces are red\n\nconst icosahedron = new IcosahedronGeometry(0.16);\nicosahedron.clearGroups();\nicosahedron.addGroup(30, Infinity, 2); // Last faces are blue\nicosahedron.addGroup(0, 30, 0); // First 10 faces colored by normal\n// The above groups are in reversed order to demonstrate the need for sorting.\n\n// Convert Three.js input meshes to Manifolds\nconst manifoldCube = new Manifold(geometry2mesh(cube));\nconst manifoldIcosahedron = new Manifold(geometry2mesh(icosahedron));\n\n// Set up UI for operations\ntype BooleanOp = 'union'|'difference'|'intersection';\n\nfunction csg(operation: BooleanOp) {\n result.geometry?.dispose();\n result.geometry = mesh2geometry(\n Manifold[operation](manifoldCube, manifoldIcosahedron).getMesh());\n}\n\ncsg('union');\nconst selectElement = document.querySelector('select')!;\nselectElement.onchange = function() {\n csg(selectElement.value as BooleanOp);\n};\n\n// Convert Three.js BufferGeometry to Manifold Mesh\nfunction geometry2mesh(geometry: BufferGeometry) {\n // Only using position in this sample for simplicity. Can interleave any other\n // desired attributes here such as UV, normal, etc.\n const vertProperties = geometry.attributes.position.array as Float32Array;\n // Manifold only uses indexed geometry, so generate an index if necessary.\n const triVerts = geometry.index != null ?\n geometry.index.array as Uint32Array :\n new Uint32Array(vertProperties.length / 3).map((_, idx) => idx);\n // Create a triangle run for each group (material) - akin to a draw call.\n const starts = [...Array(geometry.groups.length)].map(\n (_, idx) => geometry.groups[idx].start);\n // Map the materials to ID.\n const originalIDs = [...Array(geometry.groups.length)].map(\n (_, idx) => ids[geometry.groups[idx].materialIndex!]);\n // List the runs in sequence.\n const indices = Array.from(starts.keys())\n indices.sort((a, b) => starts[a] - starts[b])\n const runIndex = new Uint32Array(indices.map(i => starts[i]));\n const runOriginalID = new Uint32Array(indices.map(i => originalIDs[i]));\n // Create the MeshGL for I/O with Manifold library.\n const mesh =\n new Mesh({numProp: 3, vertProperties, triVerts, runIndex, runOriginalID});\n // Automatically merge vertices with nearly identical positions to create a\n // Manifold. This only fills in the mergeFromVert and mergeToVert vectors -\n // these are automatically filled in for any mesh returned by Manifold. These\n // are necessary because GL drivers require duplicate verts when any\n // properties change, e.g. a UV boundary or sharp corner.\n mesh.merge();\n return mesh;\n}\n\n// Convert Manifold Mesh to Three.js BufferGeometry\nfunction mesh2geometry(mesh: Mesh) {\n const geometry = new BufferGeometry();\n // Assign buffers\n geometry.setAttribute(\n 'position', new BufferAttribute(mesh.vertProperties, 3));\n geometry.setIndex(new BufferAttribute(mesh.triVerts, 1));\n // Create a group (material) for each ID. Note that there may be multiple\n // triangle runs returned with the same ID, though these will always be\n // sequential since they are sorted by ID. In this example there are two runs\n // for the MeshNormalMaterial, one corresponding to each input mesh that had\n // this ID. This allows runTransform to return the total transformation matrix\n // applied to each triangle run from its input mesh - even after many\n // consecutive operations.\n let id = mesh.runOriginalID[0];\n let start = mesh.runIndex[0];\n for (let run = 0; run < mesh.numRun; ++run) {\n const nextID = mesh.runOriginalID[run + 1];\n if (nextID !== id) {\n const end = mesh.runIndex[run + 1];\n geometry.addGroup(start, end - start, id2matIndex.get(id));\n id = nextID;\n start = end;\n }\n }\n return geometry;\n}\n"],"names":["REVISION","CullFaceNone","CullFaceBack","CullFaceFront","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap","FrontSide","BackSide","DoubleSide","NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending","AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation","ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor","NeverDepth","AlwaysDepth","LessDepth","LessEqualDepth","EqualDepth","GreaterEqualDepth","GreaterDepth","NotEqualDepth","MultiplyOperation","MixOperation","AddOperation","NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","CustomToneMapping","AgXToneMapping","NeutralToneMapping","UVMapping","CubeReflectionMapping","CubeRefractionMapping","EquirectangularReflectionMapping","EquirectangularRefractionMapping","CubeUVReflectionMapping","RepeatWrapping","ClampToEdgeWrapping","MirroredRepeatWrapping","NearestFilter","NearestMipmapNearestFilter","NearestMipmapLinearFilter","LinearFilter","LinearMipmapNearestFilter","LinearMipmapLinearFilter","UnsignedByteType","ByteType","ShortType","UnsignedShortType","IntType","UnsignedIntType","FloatType","HalfFloatType","UnsignedShort4444Type","UnsignedShort5551Type","UnsignedInt248Type","UnsignedInt5999Type","AlphaFormat","RGBFormat","RGBAFormat","LuminanceFormat","LuminanceAlphaFormat","DepthFormat","DepthStencilFormat","RedFormat","RedIntegerFormat","RGFormat","RGIntegerFormat","RGBAIntegerFormat","RGB_S3TC_DXT1_Format","RGBA_S3TC_DXT1_Format","RGBA_S3TC_DXT3_Format","RGBA_S3TC_DXT5_Format","RGB_PVRTC_4BPPV1_Format","RGB_PVRTC_2BPPV1_Format","RGBA_PVRTC_4BPPV1_Format","RGBA_PVRTC_2BPPV1_Format","RGB_ETC1_Format","RGB_ETC2_Format","RGBA_ETC2_EAC_Format","RGBA_ASTC_4x4_Format","RGBA_ASTC_5x4_Format","RGBA_ASTC_5x5_Format","RGBA_ASTC_6x5_Format","RGBA_ASTC_6x6_Format","RGBA_ASTC_8x5_Format","RGBA_ASTC_8x6_Format","RGBA_ASTC_8x8_Format","RGBA_ASTC_10x5_Format","RGBA_ASTC_10x6_Format","RGBA_ASTC_10x8_Format","RGBA_ASTC_10x10_Format","RGBA_ASTC_12x10_Format","RGBA_ASTC_12x12_Format","RGBA_BPTC_Format","RGB_BPTC_SIGNED_Format","RGB_BPTC_UNSIGNED_Format","RED_RGTC1_Format","SIGNED_RED_RGTC1_Format","RED_GREEN_RGTC2_Format","SIGNED_RED_GREEN_RGTC2_Format","BasicDepthPacking","RGBADepthPacking","TangentSpaceNormalMap","ObjectSpaceNormalMap","NoColorSpace","SRGBColorSpace","LinearSRGBColorSpace","DisplayP3ColorSpace","LinearDisplayP3ColorSpace","LinearTransfer","SRGBTransfer","Rec709Primaries","P3Primaries","KeepStencilOp","AlwaysStencilFunc","NeverCompare","LessCompare","EqualCompare","LessEqualCompare","GreaterCompare","NotEqualCompare","GreaterEqualCompare","AlwaysCompare","StaticDrawUsage","GLSL3","WebGLCoordinateSystem","WebGPUCoordinateSystem","EventDispatcher","type","listener","listeners","listenerArray","index","event","array","i","l","_lut","DEG2RAD","RAD2DEG","generateUUID","d0","d1","d2","d3","clamp","value","min","max","euclideanModulo","n","m","lerp","x","y","t","denormalize","normalize","Vector2","scalar","v","s","a","b","e","minVal","maxVal","length","denominator","theta","dx","dy","alpha","v1","v2","offset","attribute","center","angle","c","Matrix3","n11","n12","n13","n21","n22","n23","n31","n32","n33","te","me","xAxis","yAxis","zAxis","ae","be","a11","a12","a13","a21","a22","a23","a31","a32","a33","b11","b12","b13","b21","b22","b23","b31","b32","b33","d","f","g","h","t11","t12","t13","det","detInv","tmp","matrix4","r","tx","ty","sx","sy","rotation","cx","cy","_m3","matrix","arrayNeedsUint32","createElementNS","name","createCanvasElement","canvas","_cache","warnOnce","message","LINEAR_SRGB_TO_LINEAR_DISPLAY_P3","LINEAR_DISPLAY_P3_TO_LINEAR_SRGB","COLOR_SPACES","color","SUPPORTED_WORKING_COLOR_SPACES","ColorManagement","colorSpace","sourceColorSpace","targetColorSpace","sourceToReference","targetFromReference","SRGBToLinear","LinearToSRGB","_canvas","ImageUtils","image","context","imageData","data","_sourceId","Source","meta","isRootObject","output","url","serializeImage","_textureId","Texture","mapping","wrapS","wrapT","magFilter","minFilter","format","anisotropy","source","uv","Vector4","z","w","q","m11","m12","m13","m21","m22","m23","m31","m32","m33","xx","yy","zz","xy","xz","yz","RenderTarget","width","height","options","texture","count","depth","il","WebGLRenderTarget","DataArrayTexture","Data3DTexture","Quaternion","dst","dstOffset","src0","srcOffset0","src1","srcOffset1","x0","y0","z0","w0","x1","y1","z1","w1","cos","dir","sqrSin","sin","len","tDir","quaternion","euler","update","order","c1","c2","c3","s1","s2","s3","axis","halfAngle","trace","vFrom","vTo","step","qax","qay","qaz","qaw","qbx","qby","qbz","qbw","qb","cosHalfTheta","sqrSinHalfTheta","sinHalfTheta","halfTheta","ratioA","ratioB","qa","theta1","theta2","r1","r2","callback","Vector3","_quaternion$4","vx","vy","vz","qx","qy","qz","qw","tz","camera","ax","ay","az","bx","by","bz","planeNormal","_vector$c","normal","dz","radius","phi","sinPhiRadius","sz","u","Box3","_vector$b","points","size","halfSize","object","precise","box","target","point","vector","geometry","positionAttribute","_box$4","children","sphere","plane","triangle","_center","_extents","_v0$2","_v1$7","_v2$4","_f0","_f1","_f2","axes","satForAxes","_triangleNormal","_points","_testAxis","v0","extents","j","p0","p1","p2","_box$3","_v1$6","_v2$3","Sphere","optionalCenter","maxRadiusSq","radiusSum","deltaLengthSq","lengthSq","delta","_vector$a","_segCenter","_segDir","_diff","_edge1","_edge2","_normal$1","Ray","origin","direction","ray","directionDistance","optionalPointOnRay","optionalPointOnSegment","segExtent","a01","b0","b1","s0","sqrDist","extDet","invDet","tca","radius2","thc","t0","t1","distToPoint","tmin","tmax","tymin","tymax","tzmin","tzmax","invdirx","invdiry","invdirz","backfaceCulling","DdN","sign","DdQxE2","DdE1xQ","QdN","Matrix4","n14","n24","n34","n41","n42","n43","n44","scaleX","_v1$5","scaleY","scaleZ","af","bf","ce","cf","de","df","ac","ad","bc","bd","_zero","_one","eye","up","_z","_x","_y","a14","a24","a34","a41","a42","a43","a44","b14","b24","b34","b41","b42","b43","b44","t14","scaleXSq","scaleYSq","scaleZSq","yx","zx","zy","position","scale","x2","y2","z2","wx","wy","wz","_m1$4","invSX","invSY","invSZ","left","right","top","bottom","near","far","coordinateSystem","zInv","_matrix$2","_quaternion$3","Euler","newOrder","Layers","channel","layers","_object3DId","_v1$4","_q1","_m1$3","_target","_position$3","_scale$2","_quaternion$2","_xAxis","_yAxis","_zAxis","_addedEvent","_removedEvent","_childaddedEvent","_childremovedEvent","Object3D","onRotationChange","onQuaternionChange","distance","parent","id","result","force","child","updateParents","updateChildren","bound","serialize","library","element","parameters","shapes","shape","uuids","animation","geometries","extractFromCache","materials","textures","images","skeletons","animations","nodes","cache","values","key","recursive","_v0$1","_v1$3","_v2$2","_v3$2","_vab","_vac","_vbc","_vap","_vbp","_vcp","Triangle","targetLengthSq","dot00","dot01","dot02","dot11","dot12","denom","invDenom","p3","v3","i0","i1","i2","p","d4","vc","d5","d6","vb","va","_colorKeywords","_hslA","_hslB","hue2rgb","Color","hex","style","handleAlpha","string","components","_color","hue","saturation","lightness","color1","color2","_materialId","Material","newValue","currentValue","srcPlanes","dstPlanes","MeshBasicMaterial","_vector$9","_vector2$1","BufferAttribute","itemSize","normalized","start","index1","index2","component","Uint16BufferAttribute","Uint32BufferAttribute","Float32BufferAttribute","_id$2","_m1$2","_obj","_offset","_box$2","_boxMorphTargets","_vector$8","BufferGeometry","materialIndex","normalMatrix","tangent","morphAttributesPosition","morphAttribute","morphTargetsRelative","jl","attributes","normalAttribute","uvAttribute","tangentAttribute","tan1","tan2","vA","vB","vC","uvA","uvB","uvC","sdir","tdir","handleTriangle","groups","group","tmp2","n2","handleVertex","pA","pB","pC","nA","nB","nC","cb","ab","normals","convertBufferAttribute","indices","array2","geometry2","newAttribute","morphAttributes","morphArray","hasMorphAttributes","attributeArray","boundingSphere","boundingBox","_inverseMatrix$3","_ray$3","_sphere$6","_sphereHitAt","_vA$1","_vB$1","_vC$1","_tempA","_morphA","_uvA$1","_uvB$1","_uvC$1","_normalA","_normalB","_normalC","_intersectionPoint","_intersectionPointWorld","material","keys","ml","morphPosition","morphInfluences","influence","raycaster","intersects","matrixWorld","rayLocalSpace","intersection","uv1","drawRange","groupMaterial","end","checkGeometryIntersection","checkIntersection$1","intersect","face","BoxGeometry","widthSegments","heightSegments","depthSegments","scope","vertices","uvs","numberOfVertices","groupStart","buildPlane","udir","vdir","gridX","gridY","segmentWidth","segmentHeight","widthHalf","heightHalf","depthHalf","gridX1","gridY1","vertexCounter","groupCount","iy","ix","cloneUniforms","src","property","mergeUniforms","uniforms","merged","cloneUniformsGroups","getUnlitUniformColorSpace","renderer","currentRenderTarget","UniformsUtils","default_vertex","default_fragment","ShaderMaterial","extensions","Camera","_v3$1","_minTarget","_maxTarget","PerspectiveCamera","fov","aspect","focalLength","vExtentSlope","minTarget","maxTarget","fullWidth","fullHeight","view","skew","CubeCamera","renderTarget","cameraPX","cameraNX","cameraPY","cameraNY","cameraPZ","cameraNZ","cameras","scene","activeMipmapLevel","currentActiveCubeFace","currentActiveMipmapLevel","currentXrEnabled","generateMipmaps","CubeTexture","WebGLCubeRenderTarget","shader","mesh","Mesh","currentMinFilter","stencil","_vector1","_vector2","_normalMatrix","Plane","constant","inverseNormalLength","line","startSign","endSign","optionalNormalMatrix","referencePoint","_sphere$5","_vector$7","Frustum","p4","p5","planes","frustum","me0","me1","me2","me3","me4","me5","me6","me7","me8","me9","me10","me11","me12","me13","me14","me15","sprite","negRadius","WebGLAnimation","isAnimating","animationLoop","requestId","onAnimationFrame","time","frame","WebGLAttributes","gl","buffers","createBuffer","bufferType","usage","buffer","updateBuffer","updateRange","updateRanges","range","get","remove","cached","PlaneGeometry","width_half","height_half","segment_width","segment_height","alphahash_fragment","alphahash_pars_fragment","alphamap_fragment","alphamap_pars_fragment","alphatest_fragment","alphatest_pars_fragment","aomap_fragment","aomap_pars_fragment","batching_pars_vertex","batching_vertex","begin_vertex","beginnormal_vertex","bsdfs","iridescence_fragment","bumpmap_pars_fragment","clipping_planes_fragment","clipping_planes_pars_fragment","clipping_planes_pars_vertex","clipping_planes_vertex","color_fragment","color_pars_fragment","color_pars_vertex","color_vertex","common","cube_uv_reflection_fragment","defaultnormal_vertex","displacementmap_pars_vertex","displacementmap_vertex","emissivemap_fragment","emissivemap_pars_fragment","colorspace_fragment","colorspace_pars_fragment","envmap_fragment","envmap_common_pars_fragment","envmap_pars_fragment","envmap_pars_vertex","envmap_vertex","fog_vertex","fog_pars_vertex","fog_fragment","fog_pars_fragment","gradientmap_pars_fragment","lightmap_pars_fragment","lights_lambert_fragment","lights_lambert_pars_fragment","lights_pars_begin","envmap_physical_pars_fragment","lights_toon_fragment","lights_toon_pars_fragment","lights_phong_fragment","lights_phong_pars_fragment","lights_physical_fragment","lights_physical_pars_fragment","lights_fragment_begin","lights_fragment_maps","lights_fragment_end","logdepthbuf_fragment","logdepthbuf_pars_fragment","logdepthbuf_pars_vertex","logdepthbuf_vertex","map_fragment","map_pars_fragment","map_particle_fragment","map_particle_pars_fragment","metalnessmap_fragment","metalnessmap_pars_fragment","morphinstance_vertex","morphcolor_vertex","morphnormal_vertex","morphtarget_pars_vertex","morphtarget_vertex","normal_fragment_begin","normal_fragment_maps","normal_pars_fragment","normal_pars_vertex","normal_vertex","normalmap_pars_fragment","clearcoat_normal_fragment_begin","clearcoat_normal_fragment_maps","clearcoat_pars_fragment","iridescence_pars_fragment","opaque_fragment","packing","premultiplied_alpha_fragment","project_vertex","dithering_fragment","dithering_pars_fragment","roughnessmap_fragment","roughnessmap_pars_fragment","shadowmap_pars_fragment","shadowmap_pars_vertex","shadowmap_vertex","shadowmask_pars_fragment","skinbase_vertex","skinning_pars_vertex","skinning_vertex","skinnormal_vertex","specularmap_fragment","specularmap_pars_fragment","tonemapping_fragment","tonemapping_pars_fragment","transmission_fragment","transmission_pars_fragment","uv_pars_fragment","uv_pars_vertex","uv_vertex","worldpos_vertex","vertex$h","fragment$h","vertex$g","fragment$g","vertex$f","fragment$f","vertex$e","fragment$e","vertex$d","fragment$d","vertex$c","fragment$c","vertex$b","fragment$b","vertex$a","fragment$a","vertex$9","fragment$9","vertex$8","fragment$8","vertex$7","fragment$7","vertex$6","fragment$6","vertex$5","fragment$5","vertex$4","fragment$4","vertex$3","fragment$3","vertex$2","fragment$2","vertex$1","fragment$1","ShaderChunk","UniformsLib","ShaderLib","_rgb","_e1$1","_m1$1","WebGLBackground","cubemaps","cubeuvmaps","state","objects","premultipliedAlpha","clearColor","clearAlpha","planeMesh","boxMesh","currentBackground","currentBackgroundVersion","currentTonemapping","getBackground","background","render","forceClear","setClear","environmentBlendMode","addToRenderList","renderList","WebGLBindingStates","maxVertexAttributes","bindingStates","defaultState","createBindingState","currentState","forceUpdate","setup","program","updateBuffers","getBindingState","bindVertexArrayObject","needsUpdate","saveCache","setupVertexAttributes","createVertexArrayObject","vao","deleteVertexArrayObject","wireframe","programMap","stateMap","newAttributes","enabledAttributes","attributeDivisors","cachedAttributes","geometryAttributes","attributesNum","programAttributes","cachedAttribute","geometryAttribute","initAttributes","enableAttribute","enableAttributeAndDivisor","meshPerAttribute","disableUnusedAttributes","vertexAttribPointer","stride","integer","materialDefaultAttributeValues","programAttribute","bytesPerElement","dispose","reset","geometryId","programId","releaseStatesOfGeometry","releaseStatesOfProgram","resetDefaultState","WebGLBufferRenderer","info","mode","setMode","renderInstances","primcount","renderMultiDraw","starts","counts","drawCount","extension","elementCount","renderMultiDrawInstances","WebGLCapabilities","utils","maxAnisotropy","getMaxAnisotropy","textureFormatReadable","textureFormat","textureTypeReadable","textureType","halfFloatSupportedByExt","getMaxPrecision","precision","maxPrecision","logarithmicDepthBuffer","maxTextures","maxVertexTextures","maxTextureSize","maxCubemapSize","maxAttributes","maxVertexUniforms","maxVaryings","maxFragmentUniforms","vertexTextures","maxSamples","WebGLClipping","properties","globalState","numGlobalPlanes","localClippingEnabled","renderingShadows","viewNormalMatrix","uniform","enableLocalClipping","enabled","projectPlanes","useCache","clipIntersection","clipShadows","materialProperties","resetGlobalState","nGlobal","lGlobal","dstArray","skipTransform","nPlanes","flatSize","viewMatrix","i4","WebGLCubeMaps","mapTextureMapping","cubemap","onTextureDispose","OrthographicCamera","scaleW","scaleH","LOD_MIN","EXTRA_LOD_SIGMA","MAX_SAMPLES","_flatCamera","_clearColor","_oldTarget","_oldActiveCubeFace","_oldActiveMipmapLevel","_oldXrEnabled","PHI","INV_PHI","_axisDirections","PMREMGenerator","sigma","cubeUVRenderTarget","equirectangular","_getCubemapMaterial","_getEquirectMaterial","cubeSize","outputTarget","_setViewport","params","_createRenderTarget","_lodMax","_createPlanes","_getBlurShader","tmpMesh","cubeCamera","upSign","forwardSign","originalAutoClear","toneMapping","backgroundMaterial","backgroundBox","useSolidColor","col","isCubeTexture","autoClear","poleAxis","lodIn","lodOut","pingPongRenderTarget","targetIn","targetOut","sigmaRadians","blurMaterial","STANDARD_DEVIATIONS","blurMesh","blurUniforms","pixels","radiansPerPixel","sigmaPixels","samples","weights","sum","weight","outputSize","lodMax","lodPlanes","sizeLods","sigmas","lod","totalLods","sizeLod","texelSize","cubeFaces","positionSize","uvSize","faceIndexSize","faceIndex","coordinates","fill","_getCommonVertexShader","WebGLCubeUVMaps","cubeUVmaps","pmremGenerator","isEquirectMap","isCubeMap","currentPMREMVersion","isCubeTextureComplete","cubemapUV","WebGLExtensions","getExtension","WebGLGeometries","wireframeAttributes","onGeometryDispose","updateWireframeAttribute","geometryIndex","geometryPosition","version","previousAttribute","getWireframeAttribute","currentAttribute","WebGLIndexedBufferRenderer","setIndex","WebGLInfo","memory","instanceCount","WebGLMorphtargets","capabilities","morphTextures","morph","objectInfluences","morphTargetsCount","entry","disposeTexture","hasMorphPosition","hasMorphNormals","hasMorphColors","morphTargets","morphNormals","morphColors","vertexDataCount","vertexDataStride","morphTarget","morphNormal","morphColor","morphInfluencesSum","morphBaseInfluence","WebGLObjects","updateMap","buffergeometry","onInstancedMeshDispose","skeleton","instancedMesh","DepthTexture","emptyTexture","emptyShadowTexture","emptyArrayTexture","empty3dTexture","emptyCubeTexture","arrayCacheF32","arrayCacheI32","mat4array","mat3array","mat2array","flatten","nBlocks","blockSize","firstElem","arraysEqual","copyArray","allocTexUnits","setValueV1f","setValueV2f","setValueV3f","setValueV4f","setValueM2","elements","setValueM3","setValueM4","setValueV1i","setValueV2i","setValueV3i","setValueV4i","setValueV1ui","setValueV2ui","setValueV3ui","setValueV4ui","setValueT1","unit","emptyTexture2D","setValueT3D1","setValueT6","setValueT2DArray1","getSingularSetter","setValueV1fArray","setValueV2fArray","setValueV3fArray","setValueV4fArray","setValueM2Array","setValueM3Array","setValueM4Array","setValueV1iArray","setValueV2iArray","setValueV3iArray","setValueV4iArray","setValueV1uiArray","setValueV2uiArray","setValueV3uiArray","setValueV4uiArray","setValueT1Array","units","setValueT3DArray","setValueT6Array","setValueT2DArrayArray","getPureArraySetter","SingleUniform","activeInfo","addr","PureArrayUniform","StructuredUniform","seq","RePathPart","addUniform","container","uniformObject","parseUniform","path","pathLength","match","matchEnd","idIsIndex","subscript","next","WebGLUniforms","WebGLShader","COMPLETION_STATUS_KHR","programIdCount","handleSource","errorLine","lines","lines2","from","to","getEncodingComponents","workingPrimaries","encodingPrimaries","gamutMapping","getShaderErrors","status","errors","errorMatches","getTexelEncodingFunction","functionName","getToneMappingFunction","toneMappingName","generateVertexExtensions","filterEmptyLine","generateDefines","defines","chunks","fetchAttributeLocations","locationSize","replaceLightNums","numSpotLightCoords","replaceClippingPlaneNums","includePattern","resolveIncludes","includeReplacer","shaderChunkMap","include","newInclude","unrollLoopPattern","unrollLoops","loopReplacer","snippet","generatePrecision","precisionstring","generateShadowMapTypeDefine","shadowMapTypeDefine","generateEnvMapTypeDefine","envMapTypeDefine","generateEnvMapModeDefine","envMapModeDefine","generateEnvMapBlendingDefine","envMapBlendingDefine","generateCubeUVSize","imageHeight","maxMip","texelHeight","WebGLProgram","cacheKey","vertexShader","fragmentShader","envMapCubeUVSize","customVertexExtensions","customDefines","prefixVertex","prefixFragment","versionString","vertexGlsl","fragmentGlsl","glVertexShader","glFragmentShader","onFirstUse","self","programLog","vertexLog","fragmentLog","runnable","haveDiagnostics","vertexErrors","fragmentErrors","cachedUniforms","programReady","_id$1","WebGLShaderCache","vertexShaderStage","fragmentShaderStage","materialShaders","shaderStage","set","code","stage","WebGLShaderStage","WebGLPrograms","clipping","_programLayers","_customShaders","_activeChannels","programs","SUPPORTS_VERTEX_TEXTURES","shaderIDs","getChannel","getParameters","lights","shadows","fog","environment","envMap","envMapCubeUVHeight","shaderID","morphTextureStride","customVertexShaderID","customFragmentShaderID","IS_INSTANCEDMESH","IS_BATCHEDMESH","HAS_MAP","HAS_MATCAP","HAS_ENVMAP","HAS_AOMAP","HAS_LIGHTMAP","HAS_BUMPMAP","HAS_NORMALMAP","HAS_DISPLACEMENTMAP","HAS_EMISSIVEMAP","HAS_METALNESSMAP","HAS_ROUGHNESSMAP","HAS_ANISOTROPY","HAS_CLEARCOAT","HAS_DISPERSION","HAS_IRIDESCENCE","HAS_SHEEN","HAS_TRANSMISSION","HAS_ANISOTROPYMAP","HAS_CLEARCOATMAP","HAS_CLEARCOAT_NORMALMAP","HAS_CLEARCOAT_ROUGHNESSMAP","HAS_IRIDESCENCEMAP","HAS_IRIDESCENCE_THICKNESSMAP","HAS_SHEEN_COLORMAP","HAS_SHEEN_ROUGHNESSMAP","HAS_SPECULARMAP","HAS_SPECULAR_COLORMAP","HAS_SPECULAR_INTENSITYMAP","HAS_TRANSMISSIONMAP","HAS_THICKNESSMAP","HAS_GRADIENTMAP","HAS_ALPHAMAP","HAS_ALPHATEST","HAS_ALPHAHASH","HAS_EXTENSIONS","getProgramCacheKey","getProgramCacheKeyParameters","getProgramCacheKeyBooleans","getUniforms","acquireProgram","pl","preexistingProgram","releaseProgram","releaseShaderCache","WebGLProperties","map","painterSortStable","reversePainterSortStable","WebGLRenderList","renderItems","renderItemsIndex","opaque","transmissive","transparent","init","getNextRenderItem","groupOrder","renderItem","push","unshift","sort","customOpaqueSort","customTransparentSort","finish","WebGLRenderLists","lists","renderCallDepth","listArray","list","UniformsCache","light","ShadowUniformsCache","nextVersion","shadowCastingAndTexturingLightsFirst","lightA","lightB","WebGLLights","shadowCache","vector3","matrix42","useLegacyLights","directionalLength","pointLength","spotLength","rectAreaLength","hemiLength","numDirectionalShadows","numPointShadows","numSpotShadows","numSpotMaps","numSpotShadowsWithMaps","numLightProbes","scaleFactor","intensity","shadowMap","shadow","shadowUniforms","hash","setupView","WebGLRenderState","lightsArray","shadowsArray","pushLight","pushShadow","shadowLight","setupLights","setupLightsView","WebGLRenderStates","renderStates","renderStateArray","renderState","MeshDepthMaterial","MeshDistanceMaterial","vertex","fragment","WebGLShadowMap","_frustum","_shadowMapSize","_viewportSize","_viewport","_depthMaterial","_distanceMaterial","_materialCache","_maxTextureSize","shadowSide","shadowMaterialVertical","shadowMaterialHorizontal","fullScreenTri","fullScreenMesh","_previousType","activeCubeFace","_state","toVSM","fromVSM","shadowFrameExtents","pars","viewportCount","vp","viewport","renderObject","VSMPass","getDepthMaterial","customMaterial","keyA","keyB","materialsForVariant","cachedMaterial","onMaterialDispose","shadowCamera","k","kl","depthMaterial","uuid","WebGLState","ColorBuffer","locked","currentColorMask","currentColorClear","colorMask","lock","DepthBuffer","currentDepthMask","currentDepthFunc","currentDepthClear","depthTest","enable","disable","depthMask","depthFunc","StencilBuffer","currentStencilMask","currentStencilFunc","currentStencilRef","currentStencilFuncMask","currentStencilFail","currentStencilZFail","currentStencilZPass","currentStencilClear","stencilTest","stencilMask","stencilFunc","stencilRef","stencilFail","stencilZFail","stencilZPass","colorBuffer","depthBuffer","stencilBuffer","uboBindings","uboProgramMap","enabledCapabilities","currentBoundFramebuffers","currentDrawbuffers","defaultDrawbuffers","currentProgram","currentBlendingEnabled","currentBlending","currentBlendEquation","currentBlendSrc","currentBlendDst","currentBlendEquationAlpha","currentBlendSrcAlpha","currentBlendDstAlpha","currentBlendColor","currentBlendAlpha","currentPremultipledAlpha","currentFlipSided","currentCullFace","currentLineWidth","currentPolygonOffsetFactor","currentPolygonOffsetUnits","lineWidthAvailable","glVersion","currentTextureSlot","currentBoundTextures","scissorParam","viewportParam","currentScissor","currentViewport","createTexture","dimensions","emptyTextures","setFlipSided","setCullFace","setBlending","bindFramebuffer","framebuffer","drawBuffers","useProgram","equationToGL","factorToGL","blending","blendEquation","blendSrc","blendDst","blendEquationAlpha","blendSrcAlpha","blendDstAlpha","blendColor","blendAlpha","setMaterial","frontFaceCW","flipSided","stencilWrite","setPolygonOffset","cullFace","setLineWidth","polygonOffset","factor","setScissorTest","scissorTest","activeTexture","webglSlot","bindTexture","webglType","webglTexture","boundTexture","unbindTexture","compressedTexImage2D","error","compressedTexImage3D","texSubImage2D","texSubImage3D","compressedTexSubImage2D","compressedTexSubImage3D","texStorage2D","texStorage3D","texImage2D","texImage3D","scissor","updateUBOMapping","uniformsGroup","blockIndex","uniformBlockBinding","WebGLTextures","_gl","multisampledRTTExt","supportsInvalidateFramebuffer","_imageDimensions","_videoTextures","_sources","useOffscreenCanvas","createCanvas","resizeImage","needsNewCanvas","maxSize","getDimensions","textureNeedsGenerateMipmaps","generateMipmap","getInternalFormat","internalFormatName","glFormat","glType","forceLinearTransfer","internalFormat","transfer","getMipLevels","deallocateTexture","onRenderTargetDispose","deallocateRenderTarget","textureProperties","webglTextures","deleteTexture","renderTargetProperties","level","attachmentProperties","textureUnits","resetTextureUnits","allocateTextureUnit","textureUnit","getTextureCacheKey","setTexture2D","slot","updateVideoTexture","uploadTexture","setTexture2DArray","setTexture3D","setTextureCube","uploadCubeTexture","wrappingToGL","filterToGL","compareToGL","setTextureParameters","initTexture","forceUpload","textureCacheKey","sourceProperties","texturePrimaries","unpackConversion","verifyColorSpace","glInternalFormat","mipmap","mipmaps","useTexStorage","allocateMemory","dataReady","levels","isCompressed","isDataTexture","cubeImage","mipmapImage","setupFrameBufferTexture","attachment","textureTarget","useMultisampledRTT","getRenderTargetSamples","setupRenderBufferStorage","renderbuffer","isMultisample","depthTexture","setupDepthTexture","webglDepthTexture","setupDepthRenderbuffer","isCube","rebindTextures","colorTexture","setupRenderTarget","isMultipleRenderTargets","glTextureType","updateRenderTargetMipmap","invalidationArrayRead","invalidationArrayDraw","updateMultisampleRenderTarget","mask","depthStyle","WebGLUtils","convert","ArrayCamera","Group","_moveEvent","WebXRController","inputSource","hand","inputjoint","referenceSpace","inputPose","gripPose","handPose","targetRay","grip","jointPose","joint","indexTip","thumbTip","distanceToPinch","threshold","_occlusion_vertex","_occlusion_fragment","WebXRDepthSensing","depthData","texProps","cameraXR","WebXRManager","session","framebufferScaleFactor","referenceSpaceType","foveation","customReferenceSpace","pose","glBinding","glProjLayer","glBaseLayer","xrFrame","depthSensing","initialRenderTarget","newRenderTarget","controllers","controllerInputSources","currentSize","currentPixelRatio","cameraL","cameraR","_currentDepthNear","_currentDepthFar","controller","onSessionEvent","controllerIndex","onSessionEnd","onInputSourcesChange","space","layerInit","depthFormat","depthType","glDepthFormat","projectionlayerInit","cameraLPos","cameraRPos","setProjectionFromUnion","ipd","projL","projR","topFov","bottomFov","leftFov","rightFov","zOffset","xOffset","near2","far2","left2","right2","top2","bottom2","updateCamera","updateUserCamera","onAnimationFrameCallback","views","cameraXRNeedsUpdate","glSubImage","enabledFeatures","_e1","_m1","WebGLMaterials","refreshTransformUniform","refreshFogUniforms","refreshMaterialUniforms","pixelRatio","transmissionRenderTarget","refreshUniformsCommon","refreshUniformsToon","refreshUniformsPhong","refreshUniformsStandard","refreshUniformsPhysical","refreshUniformsMatcap","refreshUniformsDistance","refreshUniformsLine","refreshUniformsDash","refreshUniformsPoints","refreshUniformsSprites","envMapRotation","WebGLUniformsGroups","updateList","allocatedBindingPoints","maxBindingPoints","bind","webglProgram","prepareUniformsGroup","onUniformsGroupsDispose","updateBufferData","bindingPointIndex","allocateBindingPointIndex","uniformArray","hasUniformChanged","arrayOffset","getUniformSize","indexArray","indexString","cachedObject","chunkSize","chunkOffsetUniform","chunkOffset","WebGLRenderer","antialias","preserveDrawingBuffer","powerPreference","failIfMajorPerformanceCaveat","_alpha","uintClearColor","intClearColor","currentRenderList","currentRenderState","renderListStack","renderStateStack","_this","_isContextLost","_currentActiveCubeFace","_currentActiveMipmapLevel","_currentRenderTarget","_currentMaterialId","_currentCamera","_currentViewport","_currentScissor","_currentScissorTest","_currentClearColor","_currentClearAlpha","_width","_height","_pixelRatio","_opaqueSort","_transparentSort","_scissor","_scissorTest","_clippingEnabled","_localClippingEnabled","_projScreenMatrix","_vector3","_emptyScene","getTargetPixelRatio","getContext","contextName","contextAttributes","onContextLost","onContextRestore","onContextCreationError","programCache","renderLists","morphtargets","bufferRenderer","indexedBufferRenderer","uniformsGroups","initGLContext","xr","updateStyle","boolean","method","bits","isIntegerFormat","targetFormat","targetType","isUnsignedType","onXRSessionStart","onXRSessionEnd","infoAutoReset","shadowMapEnabled","shadowMapAutoUpdate","shadowMapNeedsUpdate","shadowMapType","deallocateMaterial","releaseMaterialProgramReferences","setProgram","rangeFactor","drawStart","drawEnd","lineWidth","maxInstanceCount","prepareMaterial","getProgram","targetScene","material2","resolve","checkMaterialsReady","projectObject","renderBackground","opaqueObjects","transmissiveObjects","camera2","renderTransmissionPass","renderScene","sortObjects","transparentObjects","renderObjects","activeViewport","currentToneMapping","currentCameraViewport","renderTargetNeedsUpdate","currentSide","overrideMaterial","lightsStateVersion","programCacheKey","updateCommonMaterialProperties","materialNeedsLights","getUniformList","progUniforms","vertexAlphas","vertexTangents","needsProgramChange","refreshProgram","refreshMaterial","refreshLights","p_uniforms","m_uniforms","uCamPos","markUniformsLightsNeedsUpdate","defaultFramebuffer","useDefaultFramebuffer","isRenderTarget3D","__webglFramebuffer","layer","activeCubeFaceIndex","levelScale","srcTexture","dstTexture","sourceBox","glTarget","unpackRowLen","unpackImageHeight","unpackSkipPixels","unpackSkipRows","unpackSkipImages","Scene","PolyhedronGeometry","detail","vertexBuffer","uvBuffer","subdivide","applyRadius","generateUVs","getVertexByIndex","subdivideFace","cols","aj","bj","rows","pushVertex","azimuth","inclination","correctUVs","correctSeam","centroid","azi","correctUV","IcosahedronGeometry","MeshNormalMaterial","MeshLambertMaterial","Light","_projScreenMatrix$1","_lightPositionWorld$1","_lookTarget$1","LightShadow","shadowMatrix","viewportIndex","_lightPositionWorld","_lookTarget","PointLightShadow","PointLight","decay","power","wasm","Module","Manifold","ThreeMesh","firstID","ids","_","idx","id2matIndex","dim","cube","icosahedron","manifoldCube","geometry2mesh","manifoldIcosahedron","csg","operation","mesh2geometry","selectElement","vertProperties","triVerts","originalIDs","runIndex","runOriginalID","run","nextID"],"mappings":"uEAAA;AAAA;AAAA;AAAA;AAAA,GAKA,MAAMA,GAAW,MAIXC,GAAe,EACfC,GAAe,EACfC,GAAgB,EAGhBC,GAAe,EACfC,GAAmB,EACnBC,GAAe,EACfC,GAAY,EACZC,GAAW,EACXC,GAAa,EACbC,GAAa,EACbC,GAAiB,EACjBC,GAAmB,EACnBC,GAAsB,EACtBC,GAAmB,EAC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ACJA,CACT,CAGA,SAAS6zC,GAAc7zC,EAAY,CAC3B,MAAAjb,EAAW,IAAIoR,GAEZpR,EAAA,aACL,WAAY,IAAImQ,GAAgB8K,EAAK,eAAgB,CAAC,CAAA,EAC1Djb,EAAS,SAAS,IAAImQ,GAAgB8K,EAAK,SAAU,CAAC,CAAC,EAQnD,IAAAjQ,EAAKiQ,EAAK,cAAc,CAAC,EACzB3K,EAAQ2K,EAAK,SAAS,CAAC,EAC3B,QAASo0C,EAAM,EAAGA,EAAMp0C,EAAK,OAAQ,EAAEo0C,EAAK,CAC1C,MAAMC,EAASr0C,EAAK,cAAco0C,EAAM,CAAC,EACzC,GAAIC,IAAWtkD,EAAI,CACjB,MAAMmL,EAAM8E,EAAK,SAASo0C,EAAM,CAAC,EACjCrvD,EAAS,SAASsQ,EAAO6F,EAAM7F,EAAO+9C,GAAY,IAAIrjD,CAAE,CAAC,EACpDA,EAAAskD,EACGh/C,EAAA6F,CACV,CACF,CACO,OAAAnW,CACT","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/assets/worker-wrapper-09787a7f.js b/assets/worker-wrapper-09787a7f.js new file mode 100644 index 000000000..1f784db8d --- /dev/null +++ b/assets/worker-wrapper-09787a7f.js @@ -0,0 +1,63 @@ +class gs{constructor(){this._listeners={}}addEventListener(e,r){const n=this._listeners;return n[e]===void 0&&(n[e]=[]),n[e].indexOf(r)===-1&&n[e].push(r),this}removeEventListener(e,r){if(this._listeners===void 0)return this;const s=this._listeners[e];if(s!==void 0){const i=s.indexOf(r);i!==-1&&s.splice(i,1)}return this}dispatchEvent(e){if(this._listeners===void 0)return this;const n=this._listeners[e.type];if(n!==void 0){const s=n.slice(0);for(let i=0,a=s.length;ir.getParent())}listChildEdges(e){return Array.from(this._parentEdges.get(e)||this._emptySet)}listChildren(e){return this.listChildEdges(e).map(r=>r.getChild())}disconnectParents(e,r){let n=this.listParentEdges(e);return r&&(n=n.filter(s=>r(s.getParent()))),n.forEach(s=>s.dispose()),this}createEdge(e,r,n,s){return this._registerEdge(new or(e,r,n,s))}_registerEdge(e){this._edges.add(e);const r=e.getParent();this._parentEdges.has(r)||this._parentEdges.set(r,new Set),this._parentEdges.get(r).add(e);const n=e.getChild();return this._childEdges.has(n)||this._childEdges.set(n,new Set),this._childEdges.get(n).add(e),e.addEventListener("dispose",()=>this._removeEdge(e)),e}_removeEdge(e){return this._edges.delete(e),this._parentEdges.get(e.getParent()).delete(e),this._childEdges.get(e.getChild()).delete(e),this}}function Cr(){return Cr=Object.assign||function(t){for(var e=1;es.dispose()),this[nr].add(n),r[n]=i}else r[n]=s}return r}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"}))}detach(){return this.graph.disconnectParents(this),this}swap(e,r){for(const n in this[he]){const s=this[he][n];if(Zn(s)){const i=s;i.getChild()===e&&this.setRef(n,r,i.getAttributes())}else if(Rr(s)){const a=s.find(o=>o.getChild()===e);if(a){const o=a.getAttributes();this.removeRef(n,e).addRef(n,r,o)}}else if(_r(s)){const i=s;for(const a in i){const o=i[a];o.getChild()===e&&this.setRefMap(n,a,r,o.getAttributes())}}}return this}get(e){return this[he][e]}set(e,r){return this[he][e]=r,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const r=this[he][e];return r?r.getChild():null}setRef(e,r,n){if(this[nr].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const s=this[he][e];if(s&&s.dispose(),!r)return this;const i=this.graph.createEdge(e,this,r,n);return i.addEventListener("dispose",()=>{delete this[he][e],this.dispatchEvent({type:"change",attribute:e})}),this[he][e]=i,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this[he][e].map(n=>n.getChild())}addRef(e,r,n){const s=this.graph.createEdge(e,this,r,n),i=this[he][e];return i.push(s),s.addEventListener("dispose",()=>{let a;for(;(a=i.indexOf(s))!==-1;)i.splice(a,1);this.dispatchEvent({type:"change",attribute:e})}),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,r){return this[he][e].filter(i=>i.getChild()===r).forEach(i=>i.dispose()),this}listRefMapKeys(e){return Object.keys(this[he][e])}listRefMapValues(e){return Object.values(this[he][e]).map(r=>r.getChild())}getRefMap(e,r){const n=this[he][e];return n[r]?n[r].getChild():null}setRefMap(e,r,n,s){const i=this[he][e],a=i[r];if(a&&a.dispose(),!n)return this;s=Object.assign(s||{},{key:r});const o=this.graph.createEdge(e,this,n,Cr({},s,{key:r}));return o.addEventListener("dispose",()=>{delete i[r],this.dispatchEvent({type:"change",attribute:e,key:r})}),i[r]=o,this.dispatchEvent({type:"change",attribute:e,key:r})}dispatchEvent(e){return super.dispatchEvent(Cr({},e,{target:this})),this.graph.dispatchEvent(Cr({},e,{target:this,type:`node:${e.type}`})),this}}const sa="v3.8.0",cr="@glb.bin";var q,fn,Je,it,zt;(function(t){t.ACCESSOR="Accessor",t.ANIMATION="Animation",t.ANIMATION_CHANNEL="AnimationChannel",t.ANIMATION_SAMPLER="AnimationSampler",t.BUFFER="Buffer",t.CAMERA="Camera",t.MATERIAL="Material",t.MESH="Mesh",t.PRIMITIVE="Primitive",t.PRIMITIVE_TARGET="PrimitiveTarget",t.NODE="Node",t.ROOT="Root",t.SCENE="Scene",t.SKIN="Skin",t.TEXTURE="Texture",t.TEXTURE_INFO="TextureInfo"})(q||(q={})),function(t){t.INTERLEAVED="interleaved",t.SEPARATE="separate"}(fn||(fn={})),function(t){t.ARRAY_BUFFER="ARRAY_BUFFER",t.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",t.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",t.OTHER="OTHER",t.SPARSE="SPARSE"}(Je||(Je={})),function(t){t[t.R=4096]="R",t[t.G=256]="G",t[t.B=16]="B",t[t.A=1]="A"}(it||(it={})),function(t){t.GLTF="GLTF",t.GLB="GLB"}(zt||(zt={}));const un={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var Zr,Qn=typeof Float32Array<"u"?Float32Array:Array;function Gn(t){return Math.hypot(t[0],t[1],t[2])}function mu(t,e,r){var n=e[0],s=e[1],i=e[2],a=r[3]*n+r[7]*s+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/a,t}function vu(t){const e={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]},r=t.propertyType===q.NODE?[t]:t.listChildren();for(const n of r)n.traverse(s=>{const i=s.getMesh();if(!i)return;const a=yu(i,s.getWorldMatrix());es(a.min,e),es(a.max,e)});return e}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),Zr=new Qn(3),Qn!=Float32Array&&(Zr[0]=0,Zr[1]=0,Zr[2]=0);function yu(t,e){const r={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]};for(const n of t.listPrimitives()){const s=n.getAttribute("POSITION");if(!s)continue;let i=[0,0,0],a=[0,0,0];for(let o=0;o"u"){const r=atob(e.split(",")[1]),n=new Uint8Array(r.length);for(let s=0;s=0;return Buffer.from(r,n?"base64":"utf8")}}static encodeText(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}static decodeText(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}static concat(e){let r=0;for(const i of e)r+=i.byteLength;const n=new Uint8Array(r);let s=0;for(const i of e)n.set(i,s),s+=i.byteLength;return n}static pad(e,r=0){const n=this.padNumber(e.byteLength);if(n===e.byteLength)return e;const s=new Uint8Array(n);if(s.set(e),r!==0)for(let i=e.byteLength;i>16&255)/255,n[1]=(e>>8&255)/255,n[2]=(255&e)/255,this.convertSRGBToLinear(r,r)}static factorToHex(e){const r=[...e],[n,s,i]=this.convertLinearToSRGB(e,r);return 255*n<<16^255*s<<8^255*i<<0}static convertSRGBToLinear(e,r){const n=e,s=r;for(let i=0;i<3;i++)s[i]=n[i]<.04045?.0773993808*n[i]:Math.pow(.9478672986*n[i]+.0521327014,2.4);return r}static convertLinearToSRGB(e,r){const n=e,s=r;for(let i=0;i<3;i++)s[i]=n[i]<.0031308?12.92*n[i]:1.055*Math.pow(n[i],.41666)-.055;return r}},ia=class aa{match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){const r=new DataView(e.buffer,e.byteOffset);return Q.decodeText(e.slice(12,16))===aa.PNG_FRIED_CHUNK_NAME?[r.getUint32(32,!1),r.getUint32(36,!1)]:[r.getUint32(16,!1),r.getUint32(20,!1)]}getChannels(e){return 4}};ia.PNG_FRIED_CHUNK_NAME="CgBI";let ht=class{static registerFormat(e,r){this.impls[e]=r}static getMimeType(e){for(const r in this.impls)if(this.impls[r].match(e))return r;return null}static getSize(e,r){return this.impls[r]?this.impls[r].getSize(e):null}static getChannels(e,r){return this.impls[r]?this.impls[r].getChannels(e):null}static getVRAMByteLength(e,r){if(!this.impls[r])return null;if(this.impls[r].getVRAMByteLength)return this.impls[r].getVRAMByteLength(e);let n=0;const s=this.getSize(e,r);if(!s)return null;for(;s[0]>1||s[1]>1;)n+=s[0]*s[1]*4,s[0]=Math.max(Math.floor(s[0]/2),1),s[1]=Math.max(Math.floor(s[1]/2),1);return n+=4,n}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}};function xu(t,e){if(e>t.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return t}ht.impls={"image/jpeg":new class{match(t){return t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255}getSize(t){let e,r,n=new DataView(t.buffer,t.byteOffset+4);for(;n.byteLength;){if(e=n.getUint16(0,!1),xu(n,e),r=n.getUint8(e+1),r===192||r===193||r===194)return[n.getUint16(e+7,!1),n.getUint16(e+5,!1)];n=new DataView(t.buffer,n.byteOffset+e+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(t){return 3}},"image/png":new ia};let lr=class{static basename(e){const r=e.split(/[\\/]/).pop();return r.substring(0,r.lastIndexOf("."))}static extension(e){if(e.startsWith("data:image/")){const r=e.match(/data:(image\/\w+)/)[1];return ht.mimeTypeToExtension(r)}return e.startsWith("data:model/gltf+json")?"gltf":e.startsWith("data:model/gltf-binary")?"glb":e.startsWith("data:application/")?"bin":e.split(/[\\/]/).pop().split(/[.]/).pop()}};function bi(t){return Object.prototype.toString.call(t)==="[object Object]"}function jt(t){if(bi(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return bi(r)!==!1&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")!==!1}var qn,ts;(function(t){t[t.SILENT=4]="SILENT",t[t.ERROR=3]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=1]="INFO",t[t.DEBUG=0]="DEBUG"})(ts||(ts={}));let Gt=class Ir{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=Ir.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=Ir.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=Ir.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=Ir.Verbosity.ERROR&&console.error(e)}};function Tu(t,e,r){var n=e[0],s=e[1],i=e[2],a=e[3],o=e[4],c=e[5],u=e[6],h=e[7],m=e[8],y=e[9],x=e[10],E=e[11],_=e[12],p=e[13],R=e[14],g=e[15],T=r[0],M=r[1],I=r[2],S=r[3];return t[0]=T*n+M*o+I*m+S*_,t[1]=T*s+M*c+I*y+S*p,t[2]=T*i+M*u+I*x+S*R,t[3]=T*a+M*h+I*E+S*g,t[4]=(T=r[4])*n+(M=r[5])*o+(I=r[6])*m+(S=r[7])*_,t[5]=T*s+M*c+I*y+S*p,t[6]=T*i+M*u+I*x+S*R,t[7]=T*a+M*h+I*E+S*g,t[8]=(T=r[8])*n+(M=r[9])*o+(I=r[10])*m+(S=r[11])*_,t[9]=T*s+M*c+I*y+S*p,t[10]=T*i+M*u+I*x+S*R,t[11]=T*a+M*h+I*E+S*g,t[12]=(T=r[12])*n+(M=r[13])*o+(I=r[14])*m+(S=r[15])*_,t[13]=T*s+M*c+I*y+S*p,t[14]=T*i+M*u+I*x+S*R,t[15]=T*a+M*h+I*E+S*g,t}qn=Gt,Gt.Verbosity=ts,Gt.DEFAULT_INSTANCE=new qn(qn.Verbosity.INFO);let we=class rs{static identity(e){return e}static eq(e,r,n=1e-5){if(e.length!==r.length)return!1;for(let s=0;sn)return!1;return!0}static decodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static denormalize(e,r){return rs.decodeNormalizedInt(e,r)}static encodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return Math.round(65535*e);case 5121:return Math.round(255*e);case 5122:return Math.round(32767*e);case 5120:return Math.round(127*e);default:throw new Error("Invalid component type.")}}static normalize(e,r){return rs.encodeNormalizedInt(e,r)}static decompose(e,r,n,s){let i=Gn([e[0],e[1],e[2]]);const a=Gn([e[4],e[5],e[6]]),o=Gn([e[8],e[9],e[10]]);var c,u,h,m,y,x,E,_,p,R,g,T,M,I,S,L,F;((u=(c=e)[0])*(E=c[5])-(h=c[1])*(x=c[4]))*((T=c[10])*(F=c[15])-(M=c[11])*(L=c[14]))-(u*(_=c[6])-(m=c[2])*x)*((g=c[9])*F-M*(S=c[13]))+(u*(p=c[7])-(y=c[3])*x)*(g*L-T*S)+(h*_-m*E)*((R=c[8])*F-M*(I=c[12]))-(h*p-y*E)*(R*L-T*I)+(m*p-y*_)*(R*S-g*I)<0&&(i=-i),r[0]=e[12],r[1]=e[13],r[2]=e[14];const $=e.slice(),z=1/i,j=1/a,H=1/o;$[0]*=z,$[1]*=z,$[2]*=z,$[4]*=j,$[5]*=j,$[6]*=j,$[8]*=H,$[9]*=H,$[10]*=H,function(V,U){var X=new Qn(3);(function(We,qe){var Mt=qe[4],at=qe[5],Et=qe[6],Yt=qe[8],jr=qe[9],In=qe[10];We[0]=Math.hypot(qe[0],qe[1],qe[2]),We[1]=Math.hypot(Mt,at,Et),We[2]=Math.hypot(Yt,jr,In)})(X,U);var se=1/X[0],Z=1/X[1],le=1/X[2],oe=U[0]*se,fe=U[1]*Z,ue=U[2]*le,de=U[4]*se,Ce=U[5]*Z,me=U[6]*le,Me=U[8]*se,Ne=U[9]*Z,Ve=U[10]*le,xt=oe+Ce+Ve,ve=0;xt>0?(ve=2*Math.sqrt(xt+1),V[3]=.25*ve,V[0]=(me-Ne)/ve,V[1]=(Me-ue)/ve,V[2]=(fe-de)/ve):oe>Ce&&oe>Ve?(ve=2*Math.sqrt(1+oe-Ce-Ve),V[3]=(me-Ne)/ve,V[0]=.25*ve,V[1]=(fe+de)/ve,V[2]=(Me+ue)/ve):Ce>Ve?(ve=2*Math.sqrt(1+Ce-oe-Ve),V[3]=(Me-ue)/ve,V[0]=(fe+de)/ve,V[1]=.25*ve,V[2]=(me+Ne)/ve):(ve=2*Math.sqrt(1+Ve-oe-Ce),V[3]=(fe-de)/ve,V[0]=(Me+ue)/ve,V[1]=(me+Ne)/ve,V[2]=.25*ve)}(n,$),s[0]=i,s[1]=a,s[2]=o}static compose(e,r,n,s){const i=s,a=r[0],o=r[1],c=r[2],u=r[3],h=a+a,m=o+o,y=c+c,x=a*h,E=a*m,_=a*y,p=o*m,R=o*y,g=c*y,T=u*h,M=u*m,I=u*y,S=n[0],L=n[1],F=n[2];return i[0]=(1-(p+g))*S,i[1]=(E+I)*S,i[2]=(_-M)*S,i[3]=0,i[4]=(E-I)*L,i[5]=(1-(x+g))*L,i[6]=(R+T)*L,i[7]=0,i[8]=(_+M)*F,i[9]=(R-T)*F,i[10]=(1-(x+p))*F,i[11]=0,i[12]=e[0],i[13]=e[1],i[14]=e[2],i[15]=1,i}};function Mu(t,e){if(!!t!=!!e)return!1;const r=t.getChild(),n=e.getChild();return r===n||r.equals(n)}function Eu(t,e){if(!!t!=!!e||t.length!==e.length)return!1;for(let r=0;rt,Iu=new Set;let vs=class extends ms{constructor(e,r=""){super(e),this[he].name=r,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(e,r){return Array.isArray(r)&&(r=r.slice()),super.set(e,r)}getName(){return this.get("name")}setName(e){return this.set("name",e)}getExtras(){return this.get("extras")}setExtras(e){return this.set("extras",e)}clone(){return new this.constructor(this.graph).copy(this,yt)}copy(e,r=yt){for(const n in this[he]){const s=this[he][n];if(s instanceof or)this[nr].has(n)||s.dispose();else if(Rr(s))for(const i of s)i.dispose();else if(_r(s))for(const i in s)s[i].dispose()}for(const n in e[he]){const s=this[he][n],i=e[he][n];if(i instanceof or)this[nr].has(n)?s.getChild().copy(r(i.getChild()),r):this.setRef(n,r(i.getChild()),i.getAttributes());else if(Rr(i))for(const a of i)this.addRef(n,r(a.getChild()),a.getAttributes());else if(_r(i))for(const a in i){const o=i[a];this.setRefMap(n,a,r(o.getChild()),o.getAttributes())}else this[he][n]=jt(i)?JSON.parse(JSON.stringify(i)):Array.isArray(i)||i instanceof ArrayBuffer||ArrayBuffer.isView(i)?i.slice():i}return this}equals(e,r=Iu){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const n in this[he]){if(r.has(n))continue;const s=this[he][n],i=e[he][n];if(Zn(s)||Zn(i)){if(!Mu(s,i))return!1}else if(Rr(s)||Rr(i)){if(!Eu(s,i))return!1}else if(_r(s)||_r(i)){if(!wu(s,i))return!1}else if(jt(s)||jt(i)){if(!ca(s,i))return!1}else if(hn(s)||hn(i)){if(!oa(s,i))return!1}else if(s!==i)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}},Ge=class extends vs{getDefaults(){return Object.assign(super.getDefaults(),{extensions:{}})}getExtension(e){return this.getRefMap("extensions",e)}setExtension(e,r){return r&&r.t(this),this.setRefMap("extensions",e,r)}listExtensions(){return this.listRefMapValues("extensions")}},Y=class xe extends Ge{constructor(...e){super(...e),this.i=we.identity,this.o=we.identity}init(){this.propertyType=q.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:xe.Type.SCALAR,componentType:xe.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}copy(e,r=yt){return super.copy(e,r),this.i=e.i,this.o=e.o,this}static getElementSize(e){switch(e){case xe.Type.SCALAR:return 1;case xe.Type.VEC2:return 2;case xe.Type.VEC3:return 3;case xe.Type.VEC4:case xe.Type.MAT2:return 4;case xe.Type.MAT3:return 9;case xe.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case xe.ComponentType.BYTE:case xe.ComponentType.UNSIGNED_BYTE:return 1;case xe.ComponentType.SHORT:case xe.ComponentType.UNSIGNED_SHORT:return 2;case xe.ComponentType.UNSIGNED_INT:case xe.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){const r=this.getElementSize();this.getMin(e);for(let n=0;nwe.decodeNormalizedInt(r,this.get("componentType")),this.i=r=>we.encodeNormalizedInt(r,this.get("componentType"))):(this.o=we.identity,this.i=we.identity),this}getScalar(e){const r=this.getElementSize();return this.o(this.get("array")[e*r])}setScalar(e,r){return this.get("array")[e*this.getElementSize()]=this.i(r),this}getElement(e,r){const n=this.getElementSize(),s=this.get("array");for(let i=0;ie.u=null),this}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}getParent(){return this.u?this.u:this.listParents().find(e=>e.propertyType===q.SCENE)||null}getParentNode(){return this.u}getMesh(){return this.getRef("mesh")}setMesh(e){return this.setRef("mesh",e)}getCamera(){return this.getRef("camera")}setCamera(e){return this.setRef("camera",e)}getSkin(){return this.getRef("skin")}setSkin(e){return this.setRef("skin",e)}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}traverse(e){e(this);for(const r of this.listChildren())r.traverse(e);return this}},Pr=class ma extends Ge{init(){this.propertyType=q.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:ma.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:Je.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:Je.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}};Pr.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};let bu=class extends vs{init(){this.propertyType=q.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:Je.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}};function ze(){return ze=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.h.delete(this)),this}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}traverse(e){for(const r of this.listChildren())r.traverse(e);return this}},ya=class extends Ge{init(){this.propertyType=q.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:[]})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(e){return this.setRef("skeleton",e)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(e){return this.setRef("inverseBindMatrices",e,{usage:Je.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}},xa=class extends Ge{init(){this.propertyType=q.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||ht.extensionToMimeType(lr.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const r=ht.extensionToMimeType(lr.extension(e));return r&&this.set("mimeType",r),this}getImage(){return this.get("image")}setImage(e){return this.set("image",Q.assertView(e))}getSize(){const e=this.get("image");return e?ht.getSize(e,this.getMimeType()):null}},Ta=class extends Ge{init(){this.propertyType=q.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${sa}`,version:"2.0"},defaultScene:null,accessors:[],animations:[],buffers:[],cameras:[],materials:[],meshes:[],nodes:[],scenes:[],skins:[],textures:[]})}constructor(e){super(e),this.l=new Set,e.addEventListener("node:create",r=>{this.g(r.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(e,r=yt){if(r===yt)throw new Error("Root cannot be copied.");this.set("asset",ze({},e.get("asset"))),this.setName(e.getName()),this.setExtras(ze({},e.getExtras())),this.setDefaultScene(e.getDefaultScene()?r(e.getDefaultScene()):null);for(const n of e.listRefMapKeys("extensions")){const s=e.getExtension(n);this.setExtension(n,r(s))}return this}g(e){return e instanceof va?this.addRef("scenes",e):e instanceof ga?this.addRef("nodes",e):e instanceof Vr?this.addRef("cameras",e):e instanceof ya?this.addRef("skins",e):e instanceof da?this.addRef("meshes",e):e instanceof fr?this.addRef("materials",e):e instanceof xa?this.addRef("textures",e):e instanceof la?this.addRef("animations",e):e instanceof Y?this.addRef("accessors",e):e instanceof ua&&this.addRef("buffers",e),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this.l)}listExtensionsRequired(){return this.listExtensionsUsed().filter(e=>e.isRequired())}p(e){return this.l.add(e),this}m(e){return this.l.delete(e),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(e){return this.setRef("defaultScene",e)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}},xs=class sn{static fromGraph(e){return sn.v.get(e)||null}constructor(){this.T=new pu,this.S=new Ta(this.T),this.M=Gt.DEFAULT_INSTANCE,sn.v.set(this.T,this)}getRoot(){return this.S}getGraph(){return this.T}getLogger(){return this.M}setLogger(e){return this.M=e,this}clone(){return new sn().setLogger(this.M).merge(this)}merge(e){for(const i of e.getRoot().listExtensionsUsed()){const a=this.createExtension(i.constructor);i.isRequired()&&a.setRequired(!0)}const r=new Set,n=new Map;r.add(e.S),n.set(e.S,this.S);for(const i of e.T.listEdges())for(const a of[i.getParent(),i.getChild()]){if(r.has(a))continue;let o;o=a.propertyType===q.TEXTURE_INFO?a:new a.constructor(this.T),n.set(a,o),r.add(a)}const s=i=>{const a=n.get(i);if(!a)throw new Error("Could resolve property.");return a};for(const i of r){const a=n.get(i);if(!a)throw new Error("Could resolve property.");a.propertyType!==q.TEXTURE_INFO&&a.copy(i,s)}return this}async transform(...e){const r=e.map(n=>n.name);for(const n of e)await n(this,{stack:r});return this}createExtension(e){const r=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(n=>n.extensionName===r)||new e(this)}createScene(e=""){return new va(this.T,e)}createNode(e=""){return new ga(this.T,e)}createCamera(e=""){return new Vr(this.T,e)}createSkin(e=""){return new ya(this.T,e)}createMesh(e=""){return new da(this.T,e)}createPrimitive(){return new Pr(this.T)}createPrimitiveTarget(e=""){return new bu(this.T,e)}createMaterial(e=""){return new fr(this.T,e)}createTexture(e=""){return new xa(this.T,e)}createAnimation(e=""){return new la(this.T,e)}createAnimationChannel(e=""){return new ys(this.T,e)}createAnimationSampler(e=""){return new En(this.T,e)}createAccessor(e="",r=null){return r||(r=this.getRoot().listBuffers()[0]),new Y(this.T,e).setBuffer(r)}createBuffer(e=""){return new ua(this.T,e)}};xs.v=new WeakMap;let Te=class{constructor(e){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this.I=void 0,this.document=e,e.getRoot().p(this),this.I=n=>{const s=n,i=s.target;i instanceof Se&&i.extensionName===this.extensionName&&(s.type==="node:create"&&this.N(i),s.type==="node:dispose"&&this.O(i))};const r=e.getGraph();r.addEventListener("node:create",this.I),r.addEventListener("node:dispose",this.I)}dispose(){this.document.getRoot().m(this);const e=this.document.getGraph();e.removeEventListener("node:create",this.I),e.removeEventListener("node:dispose",this.I);for(const r of this.properties)r.dispose()}static register(){}isRequired(){return this.required}setRequired(e){return this.required=e,this}listProperties(){return Array.from(this.properties)}N(e){return this.properties.add(e),this}O(e){return this.properties.delete(e),this}install(e,r){return this}preread(e,r){return this}prewrite(e,r){return this}};Te.EXTENSION_NAME=void 0;let Su=class{constructor(e){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=e}setTextureInfo(e,r){this.textureInfos.set(e,r),r.texCoord!==void 0&&e.setTexCoord(r.texCoord),r.extras!==void 0&&e.setExtras(r.extras);const n=this.jsonDoc.json.textures[r.index];if(n.sampler===void 0)return;const s=this.jsonDoc.json.samplers[n.sampler];s.magFilter!==void 0&&e.setMagFilter(s.magFilter),s.minFilter!==void 0&&e.setMinFilter(s.minFilter),s.wrapS!==void 0&&e.setWrapS(s.wrapS),s.wrapT!==void 0&&e.setWrapT(s.wrapT)}};const Ni={logger:Gt.DEFAULT_INSTANCE,extensions:[],dependencies:{}};let Cu=class{static read(e,r=Ni){const n=ze({},Ni,r),{json:s}=e,i=new xs().setLogger(n.logger);this.validate(e,n);const a=new Su(e),o=s.asset,c=i.getRoot().getAsset();o.copyright&&(c.copyright=o.copyright),o.extras&&(c.extras=o.extras),s.extras!==void 0&&i.getRoot().setExtras(ze({},s.extras));const u=s.extensionsUsed||[],h=s.extensionsRequired||[];for(const g of n.extensions)if(u.includes(g.EXTENSION_NAME)){const T=i.createExtension(g).setRequired(h.includes(g.EXTENSION_NAME));for(const M of T.readDependencies)T.install(M,n.dependencies[M])}const m=s.buffers||[];i.getRoot().listExtensionsUsed().filter(g=>g.prereadTypes.includes(q.BUFFER)).forEach(g=>g.preread(a,q.BUFFER)),a.buffers=m.map(g=>{const T=i.createBuffer(g.name);return g.extras&&T.setExtras(g.extras),g.uri&&g.uri.indexOf("__")!==0&&T.setURI(g.uri),T}),a.bufferViewBuffers=(s.bufferViews||[]).map((g,T)=>{if(!a.bufferViews[T]){const M=e.json.buffers[g.buffer];a.bufferViews[T]=Q.toView(M.uri?e.resources[M.uri]:e.resources[cr],g.byteOffset||0,g.byteLength)}return a.buffers[g.buffer]});const y=s.accessors||[];a.accessors=y.map(g=>{const T=i.createAccessor(g.name,a.bufferViewBuffers[g.bufferView]).setType(g.type);return g.extras&&T.setExtras(g.extras),g.normalized!==void 0&&T.setNormalized(g.normalized),g.bufferView===void 0||T.setArray(rn(g,a)),T});const x=s.images||[],E=s.textures||[];i.getRoot().listExtensionsUsed().filter(g=>g.prereadTypes.includes(q.TEXTURE)).forEach(g=>g.preread(a,q.TEXTURE)),a.textures=x.map(g=>{const T=i.createTexture(g.name);if(g.extras&&T.setExtras(g.extras),g.bufferView!==void 0){const M=s.bufferViews[g.bufferView],I=e.json.buffers[M.buffer],S=M.byteOffset||0,L=(I.uri?e.resources[I.uri]:e.resources[cr]).slice(S,S+M.byteLength);T.setImage(L)}else g.uri!==void 0&&(T.setImage(e.resources[g.uri]),g.uri.indexOf("__")!==0&&T.setURI(g.uri));if(g.mimeType!==void 0)T.setMimeType(g.mimeType);else if(g.uri){const M=lr.extension(g.uri);T.setMimeType(ht.extensionToMimeType(M))}return T}),a.materials=(s.materials||[]).map(g=>{const T=i.createMaterial(g.name);g.extras&&T.setExtras(g.extras),g.alphaMode!==void 0&&T.setAlphaMode(g.alphaMode),g.alphaCutoff!==void 0&&T.setAlphaCutoff(g.alphaCutoff),g.doubleSided!==void 0&&T.setDoubleSided(g.doubleSided);const M=g.pbrMetallicRoughness||{};if(M.baseColorFactor!==void 0&&T.setBaseColorFactor(M.baseColorFactor),g.emissiveFactor!==void 0&&T.setEmissiveFactor(g.emissiveFactor),M.metallicFactor!==void 0&&T.setMetallicFactor(M.metallicFactor),M.roughnessFactor!==void 0&&T.setRoughnessFactor(M.roughnessFactor),M.baseColorTexture!==void 0){const I=M.baseColorTexture;T.setBaseColorTexture(a.textures[E[I.index].source]),a.setTextureInfo(T.getBaseColorTextureInfo(),I)}if(g.emissiveTexture!==void 0){const I=g.emissiveTexture;T.setEmissiveTexture(a.textures[E[I.index].source]),a.setTextureInfo(T.getEmissiveTextureInfo(),I)}if(g.normalTexture!==void 0){const I=g.normalTexture;T.setNormalTexture(a.textures[E[I.index].source]),a.setTextureInfo(T.getNormalTextureInfo(),I),g.normalTexture.scale!==void 0&&T.setNormalScale(g.normalTexture.scale)}if(g.occlusionTexture!==void 0){const I=g.occlusionTexture;T.setOcclusionTexture(a.textures[E[I.index].source]),a.setTextureInfo(T.getOcclusionTextureInfo(),I),g.occlusionTexture.strength!==void 0&&T.setOcclusionStrength(g.occlusionTexture.strength)}if(M.metallicRoughnessTexture!==void 0){const I=M.metallicRoughnessTexture;T.setMetallicRoughnessTexture(a.textures[E[I.index].source]),a.setTextureInfo(T.getMetallicRoughnessTextureInfo(),I)}return T});const _=s.meshes||[];i.getRoot().listExtensionsUsed().filter(g=>g.prereadTypes.includes(q.PRIMITIVE)).forEach(g=>g.preread(a,q.PRIMITIVE)),a.meshes=_.map(g=>{const T=i.createMesh(g.name);return g.extras&&T.setExtras(g.extras),g.weights!==void 0&&T.setWeights(g.weights),(g.primitives||[]).forEach(M=>{const I=i.createPrimitive();M.extras&&I.setExtras(M.extras),M.material!==void 0&&I.setMaterial(a.materials[M.material]),M.mode!==void 0&&I.setMode(M.mode);for(const[L,F]of Object.entries(M.attributes||{}))I.setAttribute(L,a.accessors[F]);M.indices!==void 0&&I.setIndices(a.accessors[M.indices]);const S=g.extras&&g.extras.targetNames||[];(M.targets||[]).forEach((L,F)=>{const $=S[F]||F.toString(),z=i.createPrimitiveTarget($);for(const[j,H]of Object.entries(L))z.setAttribute(j,a.accessors[H]);I.addTarget(z)}),T.addPrimitive(I)}),T}),a.cameras=(s.cameras||[]).map(g=>{const T=i.createCamera(g.name).setType(g.type);if(g.extras&&T.setExtras(g.extras),g.type===Vr.Type.PERSPECTIVE){const M=g.perspective;T.setYFov(M.yfov),T.setZNear(M.znear),M.zfar!==void 0&&T.setZFar(M.zfar),M.aspectRatio!==void 0&&T.setAspectRatio(M.aspectRatio)}else{const M=g.orthographic;T.setZNear(M.znear).setZFar(M.zfar).setXMag(M.xmag).setYMag(M.ymag)}return T});const p=s.nodes||[];i.getRoot().listExtensionsUsed().filter(g=>g.prereadTypes.includes(q.NODE)).forEach(g=>g.preread(a,q.NODE)),a.nodes=p.map(g=>{const T=i.createNode(g.name);if(g.extras&&T.setExtras(g.extras),g.translation!==void 0&&T.setTranslation(g.translation),g.rotation!==void 0&&T.setRotation(g.rotation),g.scale!==void 0&&T.setScale(g.scale),g.matrix!==void 0){const M=[0,0,0],I=[0,0,0,1],S=[1,1,1];we.decompose(g.matrix,M,I,S),T.setTranslation(M),T.setRotation(I),T.setScale(S)}return g.weights!==void 0&&T.setWeights(g.weights),T}),a.skins=(s.skins||[]).map(g=>{const T=i.createSkin(g.name);g.extras&&T.setExtras(g.extras),g.inverseBindMatrices!==void 0&&T.setInverseBindMatrices(a.accessors[g.inverseBindMatrices]),g.skeleton!==void 0&&T.setSkeleton(a.nodes[g.skeleton]);for(const M of g.joints)T.addJoint(a.nodes[M]);return T}),p.map((g,T)=>{const M=a.nodes[T];(g.children||[]).forEach(I=>M.addChild(a.nodes[I])),g.mesh!==void 0&&M.setMesh(a.meshes[g.mesh]),g.camera!==void 0&&M.setCamera(a.cameras[g.camera]),g.skin!==void 0&&M.setSkin(a.skins[g.skin])}),a.animations=(s.animations||[]).map(g=>{const T=i.createAnimation(g.name);g.extras&&T.setExtras(g.extras);const M=(g.samplers||[]).map(I=>{const S=i.createAnimationSampler().setInput(a.accessors[I.input]).setOutput(a.accessors[I.output]).setInterpolation(I.interpolation||En.Interpolation.LINEAR);return I.extras&&S.setExtras(I.extras),T.addSampler(S),S});return(g.channels||[]).forEach(I=>{const S=i.createAnimationChannel().setSampler(M[I.sampler]).setTargetPath(I.target.path);I.target.node!==void 0&&S.setTargetNode(a.nodes[I.target.node]),I.extras&&S.setExtras(I.extras),T.addChannel(S)}),T});const R=s.scenes||[];return i.getRoot().listExtensionsUsed().filter(g=>g.prereadTypes.includes(q.SCENE)).forEach(g=>g.preread(a,q.SCENE)),a.scenes=R.map(g=>{const T=i.createScene(g.name);return g.extras&&T.setExtras(g.extras),(g.nodes||[]).map(M=>a.nodes[M]).forEach(M=>T.addChild(M)),T}),s.scene!==void 0&&i.getRoot().setDefaultScene(a.scenes[s.scene]),i.getRoot().listExtensionsUsed().forEach(g=>g.read(a)),y.forEach((g,T)=>{const M=a.accessors[T],I=!!g.sparse,S=!g.bufferView&&!M.getArray();(I||S)&&M.setSparse(!0).setArray(function(L,F){const $=un[L.componentType],z=Y.getElementSize(L.type);let j;j=L.bufferView!==void 0?rn(L,F):new $(L.count*z);const H=L.sparse;if(!H)return j;const V=H.count,U=ze({},L,H.indices,{count:V,type:"SCALAR"}),X=ze({},L,H.values,{count:V}),se=rn(U,F),Z=rn(X,F);for(let le=0;lei.EXTENSION_NAME===s))throw new Error(`Missing required extension, "${s}".`)}if(n.extensionsUsed)for(const s of n.extensionsUsed)r.extensions.find(i=>i.EXTENSION_NAME===s)||r.logger.warn(`Missing optional extension, "${s}".`)}};function rn(t,e){const r=e.bufferViews[t.bufferView],n=e.jsonDoc.json.bufferViews[t.bufferView],s=un[t.componentType],i=Y.getElementSize(t.type),a=s.BYTES_PER_ELEMENT;if(n.byteStride!==void 0&&n.byteStride!==i*a)return function(c,u){const h=u.bufferViews[c.bufferView],m=u.jsonDoc.json.bufferViews[c.bufferView],y=un[c.componentType],x=Y.getElementSize(c.type),E=y.BYTES_PER_ELEMENT,_=c.byteOffset||0,p=new y(c.count*x),R=new DataView(h.buffer,h.byteOffset,h.byteLength),g=m.byteStride;for(let T=0;T1,()=>n.basename||"buffer"),this.imageURIGenerator=new Oi(a>1,o=>function(c,u){const h=c.getGraph().listParentEdges(u).find(m=>m.getParent()!==c.getRoot());return h?h.getName().replace(/texture$/i,""):""}(e,o)||n.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,r){const n={magFilter:r.getMagFilter()||void 0,minFilter:r.getMinFilter()||void 0,wrapS:r.getWrapS(),wrapT:r.getWrapT()},s=JSON.stringify(n);this.samplerDefIndexMap.has(s)||(this.samplerDefIndexMap.set(s,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(n));const i={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(s)},a=JSON.stringify(i);this.textureDefIndexMap.has(a)||(this.textureDefIndexMap.set(a,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(i));const o={index:this.textureDefIndexMap.get(a)};return r.getTexCoord()!==0&&(o.texCoord=r.getTexCoord()),Object.keys(r.getExtras()).length>0&&(o.extras=r.getExtras()),this.textureInfoDefMap.set(r,o),o}createPropertyDef(e){const r={};return e.getName()&&(r.name=e.getName()),Object.keys(e.getExtras()).length>0&&(r.extras=e.getExtras()),r}createAccessorDef(e){const r=this.createPropertyDef(e);return r.type=e.getType(),r.componentType=e.getComponentType(),r.count=e.getCount(),this.C.getGraph().listParentEdges(e).some(n=>n.getName()==="attributes"&&n.getAttributes().key==="POSITION"||n.getName()==="input")&&(r.max=e.getMax([]).map(Math.fround),r.min=e.getMin([]).map(Math.fround)),e.getNormalized()&&(r.normalized=e.getNormalized()),r}createImageData(e,r,n){if(this.options.format===zt.GLB)this.imageBufferViews.push(r),e.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:r.byteLength});else{const s=ht.mimeTypeToExtension(n.getMimeType());e.uri=this.imageURIGenerator.createURI(n,s),this.jsonDoc.resources[e.uri]=r}}getAccessorUsage(e){const r=this.F.get(e);if(r)return r;if(e.getSparse())return Je.SPARSE;for(const n of this.C.getGraph().listParentEdges(e)){const{usage:s}=n.getAttributes();if(s)return s;n.getParent().propertyType!==q.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${n.getName()}".`)}return Je.OTHER}addAccessorToUsageGroup(e,r){const n=this.F.get(e);if(n&&n!==r)throw new Error(`Accessor with usage "${n}" cannot be reused as "${r}".`);return this.F.set(e,r),this}listAccessorUsageGroups(){const e={};for(const[r,n]of Array.from(this.F.entries()))e[n]=e[n]||[],e[n].push(r);return e}};st.BufferViewTarget=Or,st.BufferViewUsage=Je,st.USAGE_TO_TARGET={[Je.ARRAY_BUFFER]:Or.ARRAY_BUFFER,[Je.ELEMENT_ARRAY_BUFFER]:Or.ELEMENT_ARRAY_BUFFER};let Oi=class{constructor(e,r){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=e,this.basename=r}createURI(e,r){if(e.getURI())return e.getURI();if(this.multiple){const n=this.basename(e);return this.counter[n]=this.counter[n]||1,`${n}_${this.counter[n]++}.${r}`}return`${this.basename(e)}.${r}`}};const{BufferViewUsage:nn}=st,{UNSIGNED_INT:Nu,UNSIGNED_SHORT:Ou,UNSIGNED_BYTE:$u}=Y.ComponentType;let Fu=class{static write(e,r){const n=e.getRoot(),s={asset:ze({generator:`glTF-Transform ${sa}`},n.getAsset()),extras:ze({},n.getExtras())},i={json:s,resources:{}},a=new st(e,i,r),o=r.logger||Gt.DEFAULT_INSTANCE,c=new Set(r.extensions.map(p=>p.EXTENSION_NAME)),u=e.getRoot().listExtensionsUsed().filter(p=>c.has(p.extensionName)),h=e.getRoot().listExtensionsRequired().filter(p=>c.has(p.extensionName));u.lengthV.getCount()/3){const de=(100*X.length/V.getCount()).toFixed(1);o.warn(`Sparse accessor with many non-zero elements (${de}%) may increase file size.`)}const ue=un[V.getComponentType()];fe.indices=X,fe.values=new ue(se)}if(!Number.isFinite(S))return{buffers:T,byteLength:M};const L=S<255?Uint8Array:S<65535?Uint16Array:Uint32Array,F=S<255?$u:S<65535?Ou:Nu,$={buffer:R,byteOffset:g+M,byteLength:0};for(const V of p){const U=I.get(V);if(U.count===0)continue;U.indicesByteOffset=$.byteLength;const X=Q.pad(Q.toView(new L(U.indices)));T.push(X),M+=X.byteLength,$.byteLength+=X.byteLength}s.bufferViews.push($);const z=s.bufferViews.length-1,j={buffer:R,byteOffset:g+M,byteLength:0};for(const V of p){const U=I.get(V);if(U.count===0)continue;U.valuesByteOffset=j.byteLength;const X=Q.pad(Q.toView(U.values));T.push(X),M+=X.byteLength,j.byteLength+=X.byteLength}s.bufferViews.push(j);const H=s.bufferViews.length-1;for(const V of p){const U=I.get(V);U.count!==0&&(U.accessorDef.sparse={count:U.count,indices:{bufferView:z,byteOffset:U.indicesByteOffset,componentType:F},values:{bufferView:H,byteOffset:U.valuesByteOffset}})}return{buffers:T,byteLength:M}}const E=new Map;for(const p of e.getGraph().listEdges()){if(p.getParent()===n)continue;const R=p.getChild();if(R instanceof Y){const g=E.get(R)||[];g.push(p),E.set(R,g)}}if(s.accessors=[],s.bufferViews=[],s.samplers=[],s.textures=[],s.images=n.listTextures().map((p,R)=>{const g=a.createPropertyDef(p);p.getMimeType()&&(g.mimeType=p.getMimeType());const T=p.getImage();return T&&a.createImageData(g,T,p),a.imageIndexMap.set(p,R),g}),u.filter(p=>p.prewriteTypes.includes(q.ACCESSOR)).forEach(p=>p.prewrite(a,q.ACCESSOR)),n.listAccessors().forEach(p=>{const R=a.accessorUsageGroupedByParent,g=a.accessorParents;if(a.accessorIndexMap.has(p))return;const T=E.get(p)||[],M=a.getAccessorUsage(p);if(a.addAccessorToUsageGroup(p,M),R.has(M)){const I=T[0].getParent(),S=g.get(I)||new Set;S.add(p),g.set(I,S)}}),u.filter(p=>p.prewriteTypes.includes(q.BUFFER)).forEach(p=>p.prewrite(a,q.BUFFER)),(n.listAccessors().length>0||n.listTextures().length>0||a.otherBufferViews.size>0)&&n.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");s.buffers=[],n.listBuffers().forEach((p,R)=>{const g=a.createPropertyDef(p),T=a.accessorUsageGroupedByParent,M=a.accessorParents,I=p.listParents().filter(j=>j instanceof Y),S=new Set(I),L=[],F=s.buffers.length;let $=0;const z=a.listAccessorUsageGroups();for(const j in z)if(T.has(j))for(const H of Array.from(M.values())){const V=Array.from(H).filter(U=>S.has(U)).filter(U=>a.getAccessorUsage(U)===j);if(V.length)if(j!==nn.ARRAY_BUFFER||r.vertexLayout===fn.INTERLEAVED){const U=j===nn.ARRAY_BUFFER?y(V,F,$):m(V,F,$);$+=U.byteLength,L.push(...U.buffers)}else for(const U of V){const X=y([U],F,$);$+=X.byteLength,L.push(...X.buffers)}}else{const H=z[j].filter(X=>S.has(X));if(!H.length)continue;const V=j===nn.ELEMENT_ARRAY_BUFFER?st.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,U=j===nn.SPARSE?x(H,F,$):m(H,F,$,V);$+=U.byteLength,L.push(...U.buffers)}if(a.imageBufferViews.length&&R===0){for(let j=0;j!p.getBuffer())&&o.warn("Skipped writing one or more Accessors: no Buffer assigned."),s.materials=n.listMaterials().map((p,R)=>{const g=a.createPropertyDef(p);if(p.getAlphaMode()!==fr.AlphaMode.OPAQUE&&(g.alphaMode=p.getAlphaMode()),p.getAlphaMode()===fr.AlphaMode.MASK&&(g.alphaCutoff=p.getAlphaCutoff()),p.getDoubleSided()&&(g.doubleSided=!0),g.pbrMetallicRoughness={},we.eq(p.getBaseColorFactor(),[1,1,1,1])||(g.pbrMetallicRoughness.baseColorFactor=p.getBaseColorFactor()),we.eq(p.getEmissiveFactor(),[0,0,0])||(g.emissiveFactor=p.getEmissiveFactor()),p.getRoughnessFactor()!==1&&(g.pbrMetallicRoughness.roughnessFactor=p.getRoughnessFactor()),p.getMetallicFactor()!==1&&(g.pbrMetallicRoughness.metallicFactor=p.getMetallicFactor()),p.getBaseColorTexture()){const T=p.getBaseColorTexture(),M=p.getBaseColorTextureInfo();g.pbrMetallicRoughness.baseColorTexture=a.createTextureInfoDef(T,M)}if(p.getEmissiveTexture()){const T=p.getEmissiveTexture(),M=p.getEmissiveTextureInfo();g.emissiveTexture=a.createTextureInfoDef(T,M)}if(p.getNormalTexture()){const T=p.getNormalTexture(),M=p.getNormalTextureInfo(),I=a.createTextureInfoDef(T,M);p.getNormalScale()!==1&&(I.scale=p.getNormalScale()),g.normalTexture=I}if(p.getOcclusionTexture()){const T=p.getOcclusionTexture(),M=p.getOcclusionTextureInfo(),I=a.createTextureInfoDef(T,M);p.getOcclusionStrength()!==1&&(I.strength=p.getOcclusionStrength()),g.occlusionTexture=I}if(p.getMetallicRoughnessTexture()){const T=p.getMetallicRoughnessTexture(),M=p.getMetallicRoughnessTextureInfo();g.pbrMetallicRoughness.metallicRoughnessTexture=a.createTextureInfoDef(T,M)}return a.materialIndexMap.set(p,R),g}),s.meshes=n.listMeshes().map((p,R)=>{const g=a.createPropertyDef(p);let T=null;return g.primitives=p.listPrimitives().map(M=>{const I={attributes:{}};I.mode=M.getMode();const S=M.getMaterial();S&&(I.material=a.materialIndexMap.get(S)),Object.keys(M.getExtras()).length&&(I.extras=M.getExtras());const L=M.getIndices();L&&(I.indices=a.accessorIndexMap.get(L));for(const F of M.listSemantics())I.attributes[F]=a.accessorIndexMap.get(M.getAttribute(F));for(const F of M.listTargets()){const $={};for(const z of F.listSemantics())$[z]=a.accessorIndexMap.get(F.getAttribute(z));I.targets=I.targets||[],I.targets.push($)}return M.listTargets().length&&!T&&(T=M.listTargets().map(F=>F.getName())),I}),p.getWeights().length&&(g.weights=p.getWeights()),T&&(g.extras=g.extras||{},g.extras.targetNames=T),a.meshIndexMap.set(p,R),g}),s.cameras=n.listCameras().map((p,R)=>{const g=a.createPropertyDef(p);if(g.type=p.getType(),g.type===Vr.Type.PERSPECTIVE){g.perspective={znear:p.getZNear(),zfar:p.getZFar(),yfov:p.getYFov()};const T=p.getAspectRatio();T!==null&&(g.perspective.aspectRatio=T)}else g.orthographic={znear:p.getZNear(),zfar:p.getZFar(),xmag:p.getXMag(),ymag:p.getYMag()};return a.cameraIndexMap.set(p,R),g}),s.nodes=n.listNodes().map((p,R)=>{const g=a.createPropertyDef(p);return we.eq(p.getTranslation(),[0,0,0])||(g.translation=p.getTranslation()),we.eq(p.getRotation(),[0,0,0,1])||(g.rotation=p.getRotation()),we.eq(p.getScale(),[1,1,1])||(g.scale=p.getScale()),p.getWeights().length&&(g.weights=p.getWeights()),a.nodeIndexMap.set(p,R),g}),s.skins=n.listSkins().map((p,R)=>{const g=a.createPropertyDef(p),T=p.getInverseBindMatrices();T&&(g.inverseBindMatrices=a.accessorIndexMap.get(T));const M=p.getSkeleton();return M&&(g.skeleton=a.nodeIndexMap.get(M)),g.joints=p.listJoints().map(I=>a.nodeIndexMap.get(I)),a.skinIndexMap.set(p,R),g}),n.listNodes().forEach((p,R)=>{const g=s.nodes[R],T=p.getMesh();T&&(g.mesh=a.meshIndexMap.get(T));const M=p.getCamera();M&&(g.camera=a.cameraIndexMap.get(M));const I=p.getSkin();I&&(g.skin=a.skinIndexMap.get(I)),p.listChildren().length>0&&(g.children=p.listChildren().map(S=>a.nodeIndexMap.get(S)))}),s.animations=n.listAnimations().map((p,R)=>{const g=a.createPropertyDef(p),T=new Map;return g.samplers=p.listSamplers().map((M,I)=>{const S=a.createPropertyDef(M);return S.input=a.accessorIndexMap.get(M.getInput()),S.output=a.accessorIndexMap.get(M.getOutput()),S.interpolation=M.getInterpolation(),T.set(M,I),S}),g.channels=p.listChannels().map(M=>{const I=a.createPropertyDef(M);return I.sampler=T.get(M.getSampler()),I.target={node:a.nodeIndexMap.get(M.getTargetNode()),path:M.getTargetPath()},I}),a.animationIndexMap.set(p,R),g}),s.scenes=n.listScenes().map((p,R)=>{const g=a.createPropertyDef(p);return g.nodes=p.listChildren().map(T=>a.nodeIndexMap.get(T)),a.sceneIndexMap.set(p,R),g});const _=n.getDefaultScene();return _&&(s.scene=n.listScenes().indexOf(_)),s.extensionsUsed=u.map(p=>p.extensionName),s.extensionsRequired=h.map(p=>p.extensionName),u.forEach(p=>p.write(a)),function(p){const R=[];for(const g in p){const T=p[g];(Array.isArray(T)&&T.length===0||T===null||T===""||T&&typeof T=="object"&&Object.keys(T).length===0)&&R.push(g)}for(const g of R)delete p[g]}(s),i}};var pn;(function(t){t[t.JSON=1313821514]="JSON",t[t.BIN=5130562]="BIN"})(pn||(pn={}));let Du=class{constructor(){this.M=Gt.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=fn.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(e){return this.M=e,this}registerExtensions(e){for(const r of e)this.l.add(r),r.register();return this}registerDependencies(e){return Object.assign(this.U,e),this}setVertexLayout(e){return this.P=e,this}async read(e){return await this.readJSON(await this.readAsJSON(e))}async readAsJSON(e){const r=await this.readURI(e,"view");this.lastReadBytes=r.byteLength;const n=$i(r)?this.L(r):{json:JSON.parse(Q.decodeText(r)),resources:{}};return await this.j(n,this.dirname(e)),this.D(n),n}async readJSON(e){return e=this._(e),this.D(e),Cu.read(e,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(e){const r=this.L(Q.assertView(e));this.D(r);const n=r.json;if(n.buffers&&n.buffers.some(s=>function(i,a){return a.uri!==void 0&&!(a.uri in i.resources)}(r,s)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(n.images&&n.images.some(s=>function(i,a){return a.uri!==void 0&&!(a.uri in i.resources)&&a.bufferView===void 0}(r,s)))throw new Error("Cannot resolve external images with binaryToJSON().");return r}async readBinary(e){return this.readJSON(await this.binaryToJSON(Q.assertView(e)))}async writeJSON(e,r={}){if(r.format===zt.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return Fu.write(e,{format:r.format||zt.GLTF,basename:r.basename||"",logger:this.M,vertexLayout:this.P,dependencies:ze({},this.U),extensions:Array.from(this.l)})}async writeBinary(e){const{json:r,resources:n}=await this.writeJSON(e,{format:zt.GLB}),s=new Uint32Array([1179937895,2,12]),i=JSON.stringify(r),a=Q.pad(Q.encodeText(i),32),o=Q.toView(new Uint32Array([a.byteLength,1313821514])),c=Q.concat([o,a]);s[s.length-1]+=c.byteLength;const u=Object.values(n)[0];if(!u||!u.byteLength)return Q.concat([Q.toView(s),c]);const h=Q.pad(u,0),m=Q.toView(new Uint32Array([h.byteLength,5130562])),y=Q.concat([m,h]);return s[s.length-1]+=y.byteLength,Q.concat([Q.toView(s),c,y])}async j(e,r){var n=this;const s=[...e.json.images||[],...e.json.buffers||[]].map(async function(i){const a=i.uri;if(!a||a.match(/data:/))return Promise.resolve();e.resources[a]=await n.readURI(n.resolve(r,a),"view"),n.lastReadBytes+=e.resources[a].byteLength});await Promise.all(s)}D(e){function r(n){if(n.uri){if(n.uri in e.resources)Q.assertView(e.resources[n.uri]);else if(n.uri.match(/data:/)){const s=`__${_u()}.${lr.extension(n.uri)}`;e.resources[s]=Q.createBufferFromDataURI(n.uri),n.uri=s}}}(e.json.images||[]).forEach(n=>{if(n.bufferView===void 0&&n.uri===void 0)throw new Error("Missing resource URI or buffer view.");r(n)}),(e.json.buffers||[]).forEach(r)}_(e){const{images:r,buffers:n}=e.json;return e={json:ze({},e.json),resources:ze({},e.resources)},r&&(e.json.images=r.map(s=>ze({},s))),n&&(e.json.buffers=n.map(s=>ze({},s))),e}L(e){if(!$i(e))throw new Error("Invalid glTF 2.0 binary.");const r=new Uint32Array(e.buffer,e.byteOffset+12,2);if(r[1]!==pn.JSON)throw new Error("Missing required GLB JSON chunk.");const n=r[0],s=Q.decodeText(Q.toView(e,20,n)),i=JSON.parse(s),a=20+n;if(e.byteLength<=a)return{json:i,resources:{}};const o=new Uint32Array(e.buffer,e.byteOffset+a,2);if(o[1]!==pn.BIN)throw new Error("Expected GLB BIN in second chunk.");const c=Q.toView(e,a+8,o[0]);return{json:i,resources:{[cr]:c}}}};function $i(t){if(t.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(t.buffer,t.byteOffset,3);return e[0]===1179937895&&e[1]===2}let Pu=class extends Du{constructor(e=Nr.DEFAULT_INIT){super(),this.J=void 0,this.J=e}async readURI(e,r){const n=await fetch(e,this.J);switch(r){case"view":return new Uint8Array(await n.arrayBuffer());case"text":return n.text()}}resolve(e,r){return Nr.resolve(e,r)}dirname(e){return Nr.dirname(e)}};const Uu=0,Lu=0,Bu=0,Vu=2,ju=0,ku=163,zu=166,Gu=0,qu=2,Hu=1,Wu=64,Xu=0;class Yu{constructor(){this.vkFormat=Xu,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=Uu,this.levels=[],this.dataFormatDescriptor=[{vendorId:Bu,descriptorType:Lu,descriptorBlockSize:0,versionNumber:Vu,colorModel:ju,colorPrimaries:Hu,transferFunction:qu,flags:Gu,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Tr{constructor(e,r,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*r;return this._offset+=8,n}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){const n=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==r&&s{if(!r.extensions||!r.extensions[bt])return;const s=r.extensions[bt],i=this.createInstancedMesh();for(const a in s.attributes)i.setAttribute(a,e.accessors[s.attributes[a]]);e.nodes[n].setExtension(bt,i)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(is);for(const r of this.properties)for(const n of r.listAttributes())e.addAccessorToUsageGroup(n,is);return this}write(e){const r=e.jsonDoc;return this.document.getRoot().listNodes().forEach(n=>{const s=n.getExtension(bt);if(s){const i=e.nodeIndexMap.get(n),a=r.json.nodes[i],o={attributes:{}};s.listSemantics().forEach(c=>{const u=s.getAttribute(c);o.attributes[c]=e.accessorIndexMap.get(u)}),a.extensions=a.extensions||{},a.extensions[bt]=o}}),this}}function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e8?8:4,a.componentType=i>8?Di:Ku,a.normalized=!0,o=t.getElementSize()===3?function(c){const u=new Float32Array(4*c.length/3);for(let h=0,m=c.length/3;hWn(c,t.getComponentType())),a.max=a.max.map(c=>Wn(c,t.getComponentType()))),a.normalized&&(a.min=a.min.map(c=>Pi(c,a.componentType)),a.max=a.max.map(c=>Pi(c,a.componentType)))}else a.byteStride%4&&(a.array=function(o,c){const u=Q.padNumber(o.BYTES_PER_ELEMENT*c)/o.BYTES_PER_ELEMENT,h=new o.constructor(o.length/c*u);for(let m=0;m*cr instanceof Pr&&r.getMode()===Pr.Mode.TRIANGLES)?ir.TRIANGLES:ir.INDICES:ir.ATTRIBUTES}function eh(t,e){const r=e.getGraph().listParentEdges(t).filter(n=>!(n.getParent()instanceof Ta));for(const n of r){const s=n.getName(),i=n.getAttributes().key||"",a=n.getParent().propertyType===q.PRIMITIVE_TARGET;if(s==="indices")return{filter:be.NONE};if(s==="attributes"){if(i==="POSITION")return{filter:be.NONE};if(i==="TEXCOORD_0")return{filter:be.NONE};if(i.startsWith("JOINTS_"))return{filter:be.NONE};if(i.startsWith("WEIGHTS_"))return{filter:be.NONE};if(i==="NORMAL"||i==="TANGENT")return a?{filter:be.NONE}:{filter:be.OCTAHEDRAL,bits:8}}if(s==="output"){const o=Ra(t);return o==="rotation"?{filter:be.QUATERNION,bits:16}:o==="translation"||o==="scale"?{filter:be.EXPONENTIAL,bits:12}:{filter:be.NONE}}if(s==="input")return{filter:be.NONE};if(s==="inverseBindMatrices")return{filter:be.NONE}}return{filter:be.NONE}}function Ra(t){for(const e of t.listParents())if(e instanceof En){for(const r of e.listParents())if(r instanceof ys)return r.getTargetPath()}return null}const ke=ss,Ui={method:Ur.QUANTIZE};class as extends Te{constructor(...e){super(...e),this.extensionName=ke,this.prereadTypes=[q.BUFFER,q.PRIMITIVE],this.prewriteTypes=[q.BUFFER,q.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=Ui,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(e,r){return e==="meshopt.decoder"&&(this._decoder=r),e==="meshopt.encoder"&&(this._encoder=r),this}setEncoderOptions(e){return this._encoderOptions=vt({},Ui,e),this}preread(e,r){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${ke}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${ke}]: Missing WASM support.`)}return r===q.BUFFER?this._prereadBuffers(e):r===q.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const r=e.jsonDoc;(r.json.bufferViews||[]).forEach((n,s)=>{if(!n.extensions||!n.extensions[ke])return;const i=n.extensions[ke],a=i.byteOffset||0,o=i.byteLength||0,c=i.count,u=i.byteStride,h=new Uint8Array(c*u),m=r.json.buffers[i.buffer],y=Q.toView(m.uri?r.resources[m.uri]:r.resources[cr],a,o);this._decoder.decodeGltfBuffer(h,c,u,y,i.mode,i.filter),e.bufferViews[s]=h})}_prereadPrimitives(e){const r=e.jsonDoc;(r.json.bufferViews||[]).forEach(n=>{var s;n.extensions&&n.extensions[ke]&&(s=r.json.buffers[n.buffer]).extensions&&s.extensions[ss]&&s.extensions[ss].fallback&&this._decoderFallbackBufferMap.set(e.buffers[n.buffer],e.buffers[n.extensions[ke].buffer])})}read(e){if(!this.isRequired())return this;for(const[r,n]of this._decoderFallbackBufferMap){for(const s of r.listParents())s instanceof Y&&s.swap(r,n);r.dispose()}return this}prewrite(e,r){return r===q.ACCESSOR?this._prewriteAccessors(e):r===q.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const r=e.jsonDoc.json,n=this._encoder,s=this._encoderOptions,i=this.document.createBuffer(),a=this.document.getRoot().listBuffers().indexOf(i);this._encoderFallbackBuffer=i,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const o of this.document.getRoot().listAccessors()){if(Ra(o)==="weights"||o.getSparse())continue;const c=e.getAccessorUsage(o),u=Qu(o,c),h=s.method===Ur.FILTER?eh(o,this.document):{filter:be.NONE},m=Zu(o,n,u,h),{array:y,byteStride:x}=m,E=o.getBuffer();if(!E)throw new Error(`${ke}: Missing buffer for accessor.`);const _=this.document.getRoot().listBuffers().indexOf(E),p=[c,u,h.filter,x,_].join(":");let R=this._encoderBufferViews[p],g=this._encoderBufferViewData[p],T=this._encoderBufferViewAccessors[p];R&&g||(T=this._encoderBufferViewAccessors[p]=[],g=this._encoderBufferViewData[p]=[],R=this._encoderBufferViews[p]={buffer:a,target:st.USAGE_TO_TARGET[c],byteOffset:0,byteLength:0,byteStride:c===st.BufferViewUsage.ARRAY_BUFFER?x:void 0,extensions:{[ke]:{buffer:_,byteOffset:0,byteLength:0,mode:u,filter:h.filter!==be.NONE?h.filter:void 0,byteStride:x,count:0}}});const M=e.createAccessorDef(o);M.componentType=m.componentType,M.normalized=m.normalized,M.byteOffset=R.byteLength,M.min&&m.min&&(M.min=m.min),M.max&&m.max&&(M.max=m.max),e.accessorIndexMap.set(o,r.accessors.length),r.accessors.push(M),T.push(M),g.push(new Uint8Array(y.buffer,y.byteOffset,y.byteLength)),R.byteLength+=y.byteLength,R.extensions.EXT_meshopt_compression.count+=o.getCount()}}_prewriteBuffers(e){const r=this._encoder;for(const n in this._encoderBufferViews){const s=this._encoderBufferViews[n],i=this._encoderBufferViewData[n],a=this.document.getRoot().listBuffers()[s.extensions[ke].buffer],o=e.otherBufferViews.get(a)||[],{count:c,byteStride:u,mode:h}=s.extensions[ke],m=Q.concat(i),y=r.encodeGltfBuffer(m,c,u,h),x=Q.pad(y);s.extensions[ke].byteLength=y.byteLength,i.length=0,i.push(x),o.push(x),e.otherBufferViews.set(a,o)}}write(e){let r=0;for(const a in this._encoderBufferViews){const o=this._encoderBufferViews[a],c=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[a][0]),u=this._encoderBufferViewAccessors[a];for(const y of u)y.bufferView=c;const h=e.jsonDoc.json.bufferViews[c],m=h.byteOffset||0;Object.assign(h,o),h.byteOffset=r,h.extensions[ke].byteOffset=m,r+=Q.padNumber(o.byteLength)}const n=this._encoderFallbackBuffer,s=e.bufferIndexMap.get(n),i=e.jsonDoc.json.buffers[s];return i.byteLength=r,i.extensions={[ke]:{fallback:!0}},n.dispose(),this}}as.EXTENSION_NAME=ke,as.EncoderMethod=Ur;const Ar="EXT_texture_avif";class th{match(e){return e.length>=12&&Q.decodeText(e.slice(4,12))==="ftypavif"}getSize(e){if(!this.match(e))return null;const r=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=Li(r,0);if(!n)return null;let s=n.end;for(;n=Li(r,s);)if(n.type==="meta")s=n.start+4;else if(n.type==="iprp"||n.type==="ipco")s=n.start;else{if(n.type==="ispe")return[r.getUint32(n.start+4),r.getUint32(n.start+8)];if(n.type==="mdat")break;s=n.end}return null}getChannels(e){return 4}}class _a extends Te{constructor(...e){super(...e),this.extensionName=Ar,this.prereadTypes=[q.TEXTURE]}static register(){ht.registerFormat("image/avif",new th)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[Ar]&&(r.source=r.extensions[Ar].source)}),this}read(e){return this}write(e){const r=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/avif"){const s=e.imageIndexMap.get(n);(r.json.textures||[]).forEach(i=>{i.source===s&&(i.extensions=i.extensions||{},i.extensions[Ar]={source:i.source},delete i.source)})}}),this}}function Li(t,e){if(t.byteLength<4+e)return null;const r=t.getUint32(e);return t.byteLength=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80}getSize(e){const r=Q.decodeText(e.slice(0,4)),n=Q.decodeText(e.slice(8,12));if(r!=="RIFF"||n!=="WEBP")return null;const s=new DataView(e.buffer,e.byteOffset);let i=12;for(;i>6)]}i+=8+o+o%2}return null}getChannels(e){return 4}}class Ia extends Te{constructor(...e){super(...e),this.extensionName=br,this.prereadTypes=[q.TEXTURE]}static register(){ht.registerFormat("image/webp",new rh)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[br]&&(r.source=r.extensions[br].source)}),this}read(e){return this}write(e){const r=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/webp"){const s=e.imageIndexMap.get(n);(r.json.textures||[]).forEach(i=>{i.source===s&&(i.extensions=i.extensions||{},i.extensions[br]={source:i.source},delete i.source)})}}),this}}Ia.EXTENSION_NAME=br;const Bi=Ma;let Oe,Aa,ba,Ze;function nh(t,e){const r=new Oe.DecoderBuffer;try{if(r.Init(e,e.length),t.GetEncodedGeometryType(r)!==Oe.TRIANGULAR_MESH)throw new Error(`[${Bi}] Unknown geometry type.`);const n=new Oe.Mesh;if(!t.DecodeBufferToMesh(r,n).ok()||n.ptr===0)throw new Error(`[${Bi}] Decoding failure.`);return n}finally{Oe.destroy(r)}}function sh(t,e){const r=3*e.num_faces();let n,s;if(e.num_points()<=65534){const i=r*Uint16Array.BYTES_PER_ELEMENT;n=Oe._malloc(i),t.GetTrianglesUInt16Array(e,i,n),s=new Uint16Array(Oe.HEAPU16.buffer,n,r).slice()}else{const i=r*Uint32Array.BYTES_PER_ELEMENT;n=Oe._malloc(i),t.GetTrianglesUInt32Array(e,i,n),s=new Uint32Array(Oe.HEAPU32.buffer,n,r).slice()}return Oe._free(n),s}function ih(t,e,r,n){const s=ba[n.componentType],i=Aa[n.componentType],a=r.num_components(),o=e.num_points()*a,c=o*i.BYTES_PER_ELEMENT,u=Oe._malloc(c);t.GetAttributeDataArrayForAllPoints(e,r,s,c,u);const h=new i(Oe.HEAPF32.buffer,u,o).slice();return Oe._free(u),h}var Lr,Qe;(function(t){t[t.EDGEBREAKER=1]="EDGEBREAKER",t[t.SEQUENTIAL=0]="SEQUENTIAL"})(Lr||(Lr={})),function(t){t.POSITION="POSITION",t.NORMAL="NORMAL",t.COLOR="COLOR",t.TEX_COORD="TEX_COORD",t.GENERIC="GENERIC"}(Qe||(Qe={}));const Sa={[Qe.POSITION]:14,[Qe.NORMAL]:10,[Qe.COLOR]:8,[Qe.TEX_COORD]:12,[Qe.GENERIC]:12},Vi={decodeSpeed:5,encodeSpeed:5,method:Lr.EDGEBREAKER,quantizationBits:Sa,quantizationVolume:"mesh"};function ah(t,e=Vi){const r=vt({},Vi,e);r.quantizationBits=vt({},Sa,e.quantizationBits);const n=new Ze.MeshBuilder,s=new Ze.Mesh,i=new Ze.ExpertEncoder(s),a={},o=new Ze.DracoInt8Array,c=t.listTargets().length>0;let u=!1;for(const _ of t.listSemantics()){const p=t.getAttribute(_);if(p.getSparse()){u=!0;continue}const R=oh(_),g=ch(n,p.getComponentType(),s,Ze[R],p.getCount(),p.getElementSize(),p.getArray());if(g===-1)throw new Error(`Error compressing "${_}" attribute.`);if(a[_]=g,r.quantizationVolume==="mesh"||_!=="POSITION")i.SetAttributeQuantization(g,r.quantizationBits[R]);else{if(typeof r.quantizationVolume!="object")throw new Error("Invalid quantization volume state.");{const{quantizationVolume:T}=r,M=Math.max(T.max[0]-T.min[0],T.max[1]-T.min[1],T.max[2]-T.min[2]);i.SetAttributeExplicitQuantization(g,r.quantizationBits[R],p.getElementSize(),T.min,M)}}}const h=t.getIndices();if(!h)throw new os("Primitive must have indices.");n.AddFacesToMesh(s,h.getCount()/3,h.getArray()),i.SetSpeedOptions(r.encodeSpeed,r.decodeSpeed),i.SetTrackEncodedProperties(!0),i.SetEncodingMethod(r.method===Lr.SEQUENTIAL||c||u?Ze.MESH_SEQUENTIAL_ENCODING:Ze.MESH_EDGEBREAKER_ENCODING);const m=i.EncodeToDracoBuffer(!(c||u),o);if(m<=0)throw new os("Error applying Draco compression.");const y=new Uint8Array(m);for(let _=0;_g.propertyType));if(R.size!==2||!R.has(q.PRIMITIVE)||!R.has(q.ROOT))throw new Error(`[${Ae}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const p of Array.from(u)){const R=_.get(p),g=p.getIndices();if(x.get(g)!==R||p.listAttributes().some(T=>x.get(T)!==R))throw new Error(`[${Ae}] Draco primitives must share all, or no, accessors.`)}for(const p of Array.from(h)){const R=p.getIndices();if(x.has(R)||p.listAttributes().some(g=>x.has(g)))throw new Error(`[${Ae}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return _}(this.document),i=new Map;let a="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?n.warn(`[${Ae}]: quantizationVolume=scene requires exactly 1 scene.`):a=vu(this.document.getRoot().listScenes().pop()));for(const o of Array.from(s.keys())){const c=s.get(o);if(!c)throw new Error("Unexpected primitive.");if(i.has(c)){i.set(c,i.get(c));continue}const u=o.getIndices(),h=e.jsonDoc.json.accessors;let m;try{m=ah(o,vt({},this._encoderOptions,{quantizationVolume:a}))}catch(E){if(E instanceof os){n.warn(`[${Ae}]: ${E.message} Skipping primitive compression.`);continue}throw E}i.set(c,m);const y=e.createAccessorDef(u);y.count=m.numIndices,e.accessorIndexMap.set(u,h.length),h.push(y);for(const E of o.listSemantics()){const _=o.getAttribute(E);if(m.attributeIDs[E]===void 0)continue;const p=e.createAccessorDef(_);p.count=m.numVertices,e.accessorIndexMap.set(_,h.length),h.push(p)}const x=o.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(x)||e.otherBufferViews.set(x,[]),e.otherBufferViews.get(x).push(m.data)}return n.debug(`[${Ae}] Compressed ${s.size} primitives.`),e.extensionData[Ae]={primitiveHashMap:s,primitiveEncodingMap:i},this}write(e){const r=e.extensionData[Ae];for(const n of this.document.getRoot().listMeshes()){const s=e.jsonDoc.json.meshes[e.meshIndexMap.get(n)];for(let i=0;is!==Ae),n.extensionsRequired=(n.extensionsRequired||[]).filter(s=>s!==Ae)}return this}}function ji(t,e){const r=[],n=t.getIndices();r.push(e.get(n));for(const s of t.listAttributes())r.push(e.get(s));return r.sort().join("|")}cs.EXTENSION_NAME=Ae,cs.EncoderMethod=Lr;class ur extends Se{init(){this.extensionName=Ms,this.propertyType="Light",this.parentTypes=[q.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:ur.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getColorHex(){return He.factorToHex(this.getColor())}setColorHex(e){const r=this.getColor().slice();return He.hexToFactor(e,r),this.setColor(r)}getIntensity(){return this.get("intensity")}setIntensity(e){return this.set("intensity",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getRange(){return this.get("range")}setRange(e){return this.set("range",e)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(e){return this.set("innerConeAngle",e)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(e){return this.set("outerConeAngle",e)}}ur.EXTENSION_NAME=Ms,ur.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};const lt=Ms;class Ca extends Te{constructor(...e){super(...e),this.extensionName=lt}createLight(e=""){return new ur(this.document.getGraph(),e)}read(e){const r=e.jsonDoc;if(!r.json.extensions||!r.json.extensions[lt])return this;const n=(r.json.extensions[lt].lights||[]).map(s=>{var i,a;const o=this.createLight().setName(s.name||"").setType(s.type);return s.color!==void 0&&o.setColor(s.color),s.intensity!==void 0&&o.setIntensity(s.intensity),s.range!==void 0&&o.setRange(s.range),((i=s.spot)==null?void 0:i.innerConeAngle)!==void 0&&o.setInnerConeAngle(s.spot.innerConeAngle),((a=s.spot)==null?void 0:a.outerConeAngle)!==void 0&&o.setOuterConeAngle(s.spot.outerConeAngle),o});return r.json.nodes.forEach((s,i)=>{s.extensions&&s.extensions[lt]&&e.nodes[i].setExtension(lt,n[s.extensions[lt].light])}),this}write(e){const r=e.jsonDoc;if(this.properties.size===0)return this;const n=[],s=new Map;for(const i of this.properties){const a=i,o={type:a.getType()};we.eq(a.getColor(),[1,1,1])||(o.color=a.getColor()),a.getIntensity()!==1&&(o.intensity=a.getIntensity()),a.getRange()!=null&&(o.range=a.getRange()),a.getName()&&(o.name=a.getName()),a.getType()===ur.Type.SPOT&&(o.spot={innerConeAngle:a.getInnerConeAngle(),outerConeAngle:a.getOuterConeAngle()}),n.push(o),s.set(a,n.length-1)}return this.document.getRoot().listNodes().forEach(i=>{const a=i.getExtension(lt);if(a){const o=e.nodeIndexMap.get(i),c=r.json.nodes[o];c.extensions=c.extensions||{},c.extensions[lt]={light:s.get(a)}}}),r.json.extensions=r.json.extensions||{},r.json.extensions[lt]={lights:n},this}}Ca.EXTENSION_NAME=lt;const{R:lh,G:fh,B:uh}=it;class Na extends Se{init(){this.extensionName=Es,this.propertyType="Anisotropy",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new Re(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(e){return this.set("anisotropyStrength",e)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(e){return this.set("anisotropyRotation",e)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(e){return this.setRef("anisotropyTexture",e,{channels:lh|fh|uh})}}Na.EXTENSION_NAME=Es;const St=Es;class Oa extends Te{constructor(...e){super(...e),this.extensionName=St}createAnisotropy(){return new Na(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[St]){const a=this.createAnisotropy();e.materials[i].setExtension(St,a);const o=s.extensions[St];if(o.anisotropyStrength!==void 0&&a.setAnisotropyStrength(o.anisotropyStrength),o.anisotropyRotation!==void 0&&a.setAnisotropyRotation(o.anisotropyRotation),o.anisotropyTexture!==void 0){const c=o.anisotropyTexture;a.setAnisotropyTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getAnisotropyTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(St);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[St]={};if(s.getAnisotropyStrength()>0&&(o.anisotropyStrength=s.getAnisotropyStrength()),s.getAnisotropyRotation()!==0&&(o.anisotropyRotation=s.getAnisotropyRotation()),s.getAnisotropyTexture()){const c=s.getAnisotropyTexture(),u=s.getAnisotropyTextureInfo();o.anisotropyTexture=e.createTextureInfoDef(c,u)}}}),this}}Oa.EXTENSION_NAME=St;const{R:ki,G:zi,B:hh}=it;class $a extends Se{init(){this.extensionName=ws,this.propertyType="Clearcoat",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new Re(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new Re(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new Re(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(e){return this.set("clearcoatFactor",e)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(e){return this.setRef("clearcoatTexture",e,{channels:ki})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(e){return this.set("clearcoatRoughnessFactor",e)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(e){return this.setRef("clearcoatRoughnessTexture",e,{channels:zi})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(e){return this.set("clearcoatNormalScale",e)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(e){return this.setRef("clearcoatNormalTexture",e,{channels:ki|zi|hh})}}$a.EXTENSION_NAME=ws;const Ct=ws;class Fa extends Te{constructor(...e){super(...e),this.extensionName=Ct}createClearcoat(){return new $a(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Ct]){const a=this.createClearcoat();e.materials[i].setExtension(Ct,a);const o=s.extensions[Ct];if(o.clearcoatFactor!==void 0&&a.setClearcoatFactor(o.clearcoatFactor),o.clearcoatRoughnessFactor!==void 0&&a.setClearcoatRoughnessFactor(o.clearcoatRoughnessFactor),o.clearcoatTexture!==void 0){const c=o.clearcoatTexture;a.setClearcoatTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getClearcoatTextureInfo(),c)}if(o.clearcoatRoughnessTexture!==void 0){const c=o.clearcoatRoughnessTexture;a.setClearcoatRoughnessTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getClearcoatRoughnessTextureInfo(),c)}if(o.clearcoatNormalTexture!==void 0){const c=o.clearcoatNormalTexture;a.setClearcoatNormalTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getClearcoatNormalTextureInfo(),c),c.scale!==void 0&&a.setClearcoatNormalScale(c.scale)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ct);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Ct]={clearcoatFactor:s.getClearcoatFactor(),clearcoatRoughnessFactor:s.getClearcoatRoughnessFactor()};if(s.getClearcoatTexture()){const c=s.getClearcoatTexture(),u=s.getClearcoatTextureInfo();o.clearcoatTexture=e.createTextureInfoDef(c,u)}if(s.getClearcoatRoughnessTexture()){const c=s.getClearcoatRoughnessTexture(),u=s.getClearcoatRoughnessTextureInfo();o.clearcoatRoughnessTexture=e.createTextureInfoDef(c,u)}if(s.getClearcoatNormalTexture()){const c=s.getClearcoatNormalTexture(),u=s.getClearcoatNormalTextureInfo();o.clearcoatNormalTexture=e.createTextureInfoDef(c,u),s.getClearcoatNormalScale()!==1&&(o.clearcoatNormalTexture.scale=s.getClearcoatNormalScale())}}}),this}}Fa.EXTENSION_NAME=Ct;class Da extends Se{init(){this.extensionName=Rs,this.propertyType="EmissiveStrength",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(e){return this.set("emissiveStrength",e)}}Da.EXTENSION_NAME=Rs;const Nt=Rs;class Pa extends Te{constructor(...e){super(...e),this.extensionName=Nt}createEmissiveStrength(){return new Da(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{if(r.extensions&&r.extensions[Nt]){const s=this.createEmissiveStrength();e.materials[n].setExtension(Nt,s);const i=r.extensions[Nt];i.emissiveStrength!==void 0&&s.setEmissiveStrength(i.emissiveStrength)}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Nt);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{},a.extensions[Nt]={emissiveStrength:s.getEmissiveStrength()}}}),this}}Pa.EXTENSION_NAME=Nt;class Ua extends Se{init(){this.extensionName=_s,this.propertyType="IOR",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(e){return this.set("ior",e)}}Ua.EXTENSION_NAME=_s;const Ot=_s;class La extends Te{constructor(...e){super(...e),this.extensionName=Ot}createIOR(){return new Ua(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{if(r.extensions&&r.extensions[Ot]){const s=this.createIOR();e.materials[n].setExtension(Ot,s);const i=r.extensions[Ot];i.ior!==void 0&&s.setIOR(i.ior)}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ot);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{},a.extensions[Ot]={ior:s.getIOR()}}}),this}}La.EXTENSION_NAME=Ot;const{R:ph,G:dh}=it;class Ba extends Se{init(){this.extensionName=Is,this.propertyType="Iridescence",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new Re(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new Re(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(e){return this.set("iridescenceFactor",e)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(e){return this.setRef("iridescenceTexture",e,{channels:ph})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(e){return this.set("iridescenceIOR",e)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(e){return this.set("iridescenceThicknessMinimum",e)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(e){return this.set("iridescenceThicknessMaximum",e)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(e){return this.setRef("iridescenceThicknessTexture",e,{channels:dh})}}Ba.EXTENSION_NAME=Is;const $t=Is;class Va extends Te{constructor(...e){super(...e),this.extensionName=$t}createIridescence(){return new Ba(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[$t]){const a=this.createIridescence();e.materials[i].setExtension($t,a);const o=s.extensions[$t];if(o.iridescenceFactor!==void 0&&a.setIridescenceFactor(o.iridescenceFactor),o.iridescenceIor!==void 0&&a.setIridescenceIOR(o.iridescenceIor),o.iridescenceThicknessMinimum!==void 0&&a.setIridescenceThicknessMinimum(o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&a.setIridescenceThicknessMaximum(o.iridescenceThicknessMaximum),o.iridescenceTexture!==void 0){const c=o.iridescenceTexture;a.setIridescenceTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getIridescenceTextureInfo(),c)}if(o.iridescenceThicknessTexture!==void 0){const c=o.iridescenceThicknessTexture;a.setIridescenceThicknessTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getIridescenceThicknessTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension($t);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[$t]={};if(s.getIridescenceFactor()>0&&(o.iridescenceFactor=s.getIridescenceFactor()),s.getIridescenceIOR()!==1.3&&(o.iridescenceIor=s.getIridescenceIOR()),s.getIridescenceThicknessMinimum()!==100&&(o.iridescenceThicknessMinimum=s.getIridescenceThicknessMinimum()),s.getIridescenceThicknessMaximum()!==400&&(o.iridescenceThicknessMaximum=s.getIridescenceThicknessMaximum()),s.getIridescenceTexture()){const c=s.getIridescenceTexture(),u=s.getIridescenceTextureInfo();o.iridescenceTexture=e.createTextureInfoDef(c,u)}if(s.getIridescenceThicknessTexture()){const c=s.getIridescenceThicknessTexture(),u=s.getIridescenceThicknessTextureInfo();o.iridescenceThicknessTexture=e.createTextureInfoDef(c,u)}}}),this}}Va.EXTENSION_NAME=$t;const{R:Gi,G:qi,B:Hi,A:Wi}=it;class ja extends Se{init(){this.extensionName=As,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new Re(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new Re(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(e){return this.set("diffuseFactor",e)}getDiffuseHex(){return He.factorToHex(this.getDiffuseFactor())}setDiffuseHex(e){const r=this.getDiffuseFactor().slice();return this.setDiffuseFactor(He.hexToFactor(e,r))}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(e){return this.setRef("diffuseTexture",e,{channels:Gi|qi|Hi|Wi,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(e){return this.set("glossinessFactor",e)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(e){return this.setRef("specularGlossinessTexture",e,{channels:Gi|qi|Hi|Wi})}}ja.EXTENSION_NAME=As;const Ft=As;class ka extends Te{constructor(...e){super(...e),this.extensionName=Ft}createPBRSpecularGlossiness(){return new ja(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Ft]){const a=this.createPBRSpecularGlossiness();e.materials[i].setExtension(Ft,a);const o=s.extensions[Ft];if(o.diffuseFactor!==void 0&&a.setDiffuseFactor(o.diffuseFactor),o.specularFactor!==void 0&&a.setSpecularFactor(o.specularFactor),o.glossinessFactor!==void 0&&a.setGlossinessFactor(o.glossinessFactor),o.diffuseTexture!==void 0){const c=o.diffuseTexture;a.setDiffuseTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getDiffuseTextureInfo(),c)}if(o.specularGlossinessTexture!==void 0){const c=o.specularGlossinessTexture;a.setSpecularGlossinessTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getSpecularGlossinessTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ft);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Ft]={diffuseFactor:s.getDiffuseFactor(),specularFactor:s.getSpecularFactor(),glossinessFactor:s.getGlossinessFactor()};if(s.getDiffuseTexture()){const c=s.getDiffuseTexture(),u=s.getDiffuseTextureInfo();o.diffuseTexture=e.createTextureInfoDef(c,u)}if(s.getSpecularGlossinessTexture()){const c=s.getSpecularGlossinessTexture(),u=s.getSpecularGlossinessTextureInfo();o.specularGlossinessTexture=e.createTextureInfoDef(c,u)}}}),this}}ka.EXTENSION_NAME=Ft;const{R:gh,G:mh,B:vh,A:yh}=it;class za extends Se{init(){this.extensionName=bs,this.propertyType="Sheen",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new Re(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new Re(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}getSheenColorHex(){return He.factorToHex(this.getSheenColorFactor())}setSheenColorFactor(e){return this.set("sheenColorFactor",e)}setSheenColorHex(e){const r=this.getSheenColorFactor().slice();return this.set("sheenColorFactor",He.hexToFactor(e,r))}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(e){return this.setRef("sheenColorTexture",e,{channels:gh|mh|vh,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(e){return this.set("sheenRoughnessFactor",e)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(e){return this.setRef("sheenRoughnessTexture",e,{channels:yh})}}za.EXTENSION_NAME=bs;const Dt=bs;class Ga extends Te{constructor(...e){super(...e),this.extensionName=Dt}createSheen(){return new za(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Dt]){const a=this.createSheen();e.materials[i].setExtension(Dt,a);const o=s.extensions[Dt];if(o.sheenColorFactor!==void 0&&a.setSheenColorFactor(o.sheenColorFactor),o.sheenRoughnessFactor!==void 0&&a.setSheenRoughnessFactor(o.sheenRoughnessFactor),o.sheenColorTexture!==void 0){const c=o.sheenColorTexture;a.setSheenColorTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getSheenColorTextureInfo(),c)}if(o.sheenRoughnessTexture!==void 0){const c=o.sheenRoughnessTexture;a.setSheenRoughnessTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getSheenRoughnessTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Dt);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Dt]={sheenColorFactor:s.getSheenColorFactor(),sheenRoughnessFactor:s.getSheenRoughnessFactor()};if(s.getSheenColorTexture()){const c=s.getSheenColorTexture(),u=s.getSheenColorTextureInfo();o.sheenColorTexture=e.createTextureInfoDef(c,u)}if(s.getSheenRoughnessTexture()){const c=s.getSheenRoughnessTexture(),u=s.getSheenRoughnessTextureInfo();o.sheenRoughnessTexture=e.createTextureInfoDef(c,u)}}}),this}}Ga.EXTENSION_NAME=Dt;const{R:xh,G:Th,B:Mh,A:Eh}=it;class qa extends Se{init(){this.extensionName=Ss,this.propertyType="Specular",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new Re(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new Re(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(e){return this.set("specularColorFactor",e)}getSpecularColorHex(){return He.factorToHex(this.getSpecularColorFactor())}setSpecularColorHex(e){const r=this.getSpecularColorFactor().slice();return this.set("specularColorFactor",He.hexToFactor(e,r))}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(e){return this.setRef("specularTexture",e,{channels:Eh})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(e){return this.setRef("specularColorTexture",e,{channels:xh|Th|Mh,isColor:!0})}}qa.EXTENSION_NAME=Ss;const Pt=Ss;class Ha extends Te{constructor(...e){super(...e),this.extensionName=Pt}createSpecular(){return new qa(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Pt]){const a=this.createSpecular();e.materials[i].setExtension(Pt,a);const o=s.extensions[Pt];if(o.specularFactor!==void 0&&a.setSpecularFactor(o.specularFactor),o.specularColorFactor!==void 0&&a.setSpecularColorFactor(o.specularColorFactor),o.specularTexture!==void 0){const c=o.specularTexture;a.setSpecularTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getSpecularTextureInfo(),c)}if(o.specularColorTexture!==void 0){const c=o.specularColorTexture;a.setSpecularColorTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getSpecularColorTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Pt);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Pt]={};if(s.getSpecularFactor()!==1&&(o.specularFactor=s.getSpecularFactor()),we.eq(s.getSpecularColorFactor(),[1,1,1])||(o.specularColorFactor=s.getSpecularColorFactor()),s.getSpecularTexture()){const c=s.getSpecularTexture(),u=s.getSpecularTextureInfo();o.specularTexture=e.createTextureInfoDef(c,u)}if(s.getSpecularColorTexture()){const c=s.getSpecularColorTexture(),u=s.getSpecularColorTextureInfo();o.specularColorTexture=e.createTextureInfoDef(c,u)}}}),this}}Ha.EXTENSION_NAME=Pt;const{R:wh}=it;class Wa extends Se{init(){this.extensionName=Cs,this.propertyType="Transmission",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new Re(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(e){return this.set("transmissionFactor",e)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(e){return this.setRef("transmissionTexture",e,{channels:wh})}}Wa.EXTENSION_NAME=Cs;const Ut=Cs;class Xa extends Te{constructor(...e){super(...e),this.extensionName=Ut}createTransmission(){return new Wa(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Ut]){const a=this.createTransmission();e.materials[i].setExtension(Ut,a);const o=s.extensions[Ut];if(o.transmissionFactor!==void 0&&a.setTransmissionFactor(o.transmissionFactor),o.transmissionTexture!==void 0){const c=o.transmissionTexture;a.setTransmissionTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getTransmissionTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ut);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Ut]={transmissionFactor:s.getTransmissionFactor()};if(s.getTransmissionTexture()){const c=s.getTransmissionTexture(),u=s.getTransmissionTextureInfo();o.transmissionTexture=e.createTextureInfoDef(c,u)}}}),this}}Xa.EXTENSION_NAME=Ut;class Ya extends Se{init(){this.extensionName=Ns,this.propertyType="Unlit",this.parentTypes=[q.MATERIAL]}}Ya.EXTENSION_NAME=Ns;const rr=Ns;class Fs extends Te{constructor(...e){super(...e),this.extensionName=rr}createUnlit(){return new Ya(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{r.extensions&&r.extensions[rr]&&e.materials[n].setExtension(rr,this.createUnlit())}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{if(n.getExtension(rr)){const s=e.materialIndexMap.get(n),i=r.json.materials[s];i.extensions=i.extensions||{},i.extensions[rr]={}}}),this}}Fs.EXTENSION_NAME=rr;class Ka extends Se{init(){this.extensionName=Xt,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:[]})}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}addVariant(e){return this.addRef("variants",e)}removeVariant(e){return this.removeRef("variants",e)}listVariants(){return this.listRefs("variants")}}Ka.EXTENSION_NAME=Xt;class Ja extends Se{init(){this.extensionName=Xt,this.propertyType="MappingList",this.parentTypes=[q.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:[]})}addMapping(e){return this.addRef("mappings",e)}removeMapping(e){return this.removeRef("mappings",e)}listMappings(){return this.listRefs("mappings")}}Ja.EXTENSION_NAME=Xt;class ls extends Se{init(){this.extensionName=Xt,this.propertyType="Variant",this.parentTypes=["MappingList"]}}ls.EXTENSION_NAME=Xt;const ft=Xt;class Za extends Te{constructor(...e){super(...e),this.extensionName=ft}createMappingList(){return new Ja(this.document.getGraph())}createVariant(e=""){return new ls(this.document.getGraph(),e)}createMapping(){return new Ka(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof ls)}read(e){const r=e.jsonDoc;if(!r.json.extensions||!r.json.extensions[ft])return this;const n=(r.json.extensions[ft].variants||[]).map(s=>this.createVariant().setName(s.name||""));return(r.json.meshes||[]).forEach((s,i)=>{const a=e.meshes[i];(s.primitives||[]).forEach((o,c)=>{if(!o.extensions||!o.extensions[ft])return;const u=this.createMappingList(),h=o.extensions[ft];for(const m of h.mappings){const y=this.createMapping();m.material!==void 0&&y.setMaterial(e.materials[m.material]);for(const x of m.variants||[])y.addVariant(n[x]);u.addMapping(y)}a.listPrimitives()[c].setExtension(ft,u)})}),this}write(e){const r=e.jsonDoc,n=this.listVariants();if(!n.length)return this;const s=[],i=new Map;for(const a of n)i.set(a,s.length),s.push(e.createPropertyDef(a));for(const a of this.document.getRoot().listMeshes()){const o=e.meshIndexMap.get(a);a.listPrimitives().forEach((c,u)=>{const h=c.getExtension(ft);if(!h)return;const m=e.jsonDoc.json.meshes[o].primitives[u],y=h.listMappings().map(x=>{const E=e.createPropertyDef(x),_=x.getMaterial();return _&&(E.material=e.materialIndexMap.get(_)),E.variants=x.listVariants().map(p=>i.get(p)),E});m.extensions=m.extensions||{},m.extensions[ft]={mappings:y}})}return r.json.extensions=r.json.extensions||{},r.json.extensions[ft]={variants:s},this}}Za.EXTENSION_NAME=ft;const{G:Rh}=it;class Qa extends Se{init(){this.extensionName=Os,this.propertyType="Volume",this.parentTypes=[q.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new Re(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(e){return this.set("thicknessFactor",e)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(e){return this.setRef("thicknessTexture",e,{channels:Rh})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(e){return this.set("attenuationDistance",e)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(e){return this.set("attenuationColor",e)}getAttenuationColorHex(){return He.factorToHex(this.getAttenuationColor())}setAttenuationColorHex(e){const r=this.getAttenuationColor().slice();return this.set("attenuationColor",He.hexToFactor(e,r))}}Qa.EXTENSION_NAME=Os;const Lt=Os;class eo extends Te{constructor(...e){super(...e),this.extensionName=Lt}createVolume(){return new Qa(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,i)=>{if(s.extensions&&s.extensions[Lt]){const a=this.createVolume();e.materials[i].setExtension(Lt,a);const o=s.extensions[Lt];if(o.thicknessFactor!==void 0&&a.setThicknessFactor(o.thicknessFactor),o.attenuationDistance!==void 0&&a.setAttenuationDistance(o.attenuationDistance),o.attenuationColor!==void 0&&a.setAttenuationColor(o.attenuationColor),o.thicknessTexture!==void 0){const c=o.thicknessTexture;a.setThicknessTexture(e.textures[n[c.index].source]),e.setTextureInfo(a.getThicknessTextureInfo(),c)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Lt);if(s){const i=e.materialIndexMap.get(n),a=r.json.materials[i];a.extensions=a.extensions||{};const o=a.extensions[Lt]={};if(s.getThicknessFactor()>0&&(o.thicknessFactor=s.getThicknessFactor()),Number.isFinite(s.getAttenuationDistance())&&(o.attenuationDistance=s.getAttenuationDistance()),we.eq(s.getAttenuationColor(),[1,1,1])||(o.attenuationColor=s.getAttenuationColor()),s.getThicknessTexture()){const c=s.getThicknessTexture(),u=s.getThicknessTextureInfo();o.thicknessTexture=e.createTextureInfoDef(c,u)}}}),this}}eo.EXTENSION_NAME=Lt;const to="KHR_mesh_quantization";class ro extends Te{constructor(...e){super(...e),this.extensionName=to}read(e){return this}write(e){return this}}ro.EXTENSION_NAME=to;const Sr="KHR_texture_basisu";class _h{match(e){return e[0]===171&&e[1]===75&&e[2]===84&&e[3]===88&&e[4]===32&&e[5]===50&&e[6]===48&&e[7]===187&&e[8]===13&&e[9]===10&&e[10]===26&&e[11]===10}getSize(e){const r=Hn(e);return[r.pixelWidth,r.pixelHeight]}getChannels(e){const r=Hn(e).dataFormatDescriptor[0];if(r.colorModel===ku)return r.samples.length===2&&(15&r.samples[1].channelType)==15?4:3;if(r.colorModel===zu)return(15&r.samples[0].channelType)==3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${r.colorModel}".`)}getVRAMByteLength(e){const r=Hn(e),n=this.getChannels(e)>3;let s=0;for(let i=0;i{r.extensions&&r.extensions[Sr]&&(r.source=r.extensions[Sr].source)}),this}read(e){return this}write(e){const r=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/ktx2"){const s=e.imageIndexMap.get(n);r.json.textures.forEach(i=>{i.source===s&&(i.extensions=i.extensions||{},i.extensions[Sr]={source:i.source},delete i.source)})}}),this}}no.EXTENSION_NAME=Sr;class so extends Se{init(){this.extensionName=$s,this.propertyType="Transform",this.parentTypes=[q.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getRotation(){return this.get("rotation")}setRotation(e){return this.set("rotation",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}}so.EXTENSION_NAME=$s;const Bt=$s;class io extends Te{constructor(...e){super(...e),this.extensionName=Bt}createTransform(){return new so(this.document.getGraph())}read(e){for(const[r,n]of Array.from(e.textureInfos.entries())){if(!n.extensions||!n.extensions[Bt])continue;const s=this.createTransform(),i=n.extensions[Bt];i.offset!==void 0&&s.setOffset(i.offset),i.rotation!==void 0&&s.setRotation(i.rotation),i.scale!==void 0&&s.setScale(i.scale),i.texCoord!==void 0&&s.setTexCoord(i.texCoord),r.setExtension(Bt,s)}return this}write(e){const r=Array.from(e.textureInfoDefMap.entries());for(const[n,s]of r){const i=n.getExtension(Bt);if(!i)continue;s.extensions=s.extensions||{};const a={},o=we.eq;o(i.getOffset(),[0,0])||(a.offset=i.getOffset()),i.getRotation()!==0&&(a.rotation=i.getRotation()),o(i.getScale(),[1,1])||(a.scale=i.getScale()),i.getTexCoord()!=null&&(a.texCoord=i.getTexCoord()),s.extensions[Bt]=a}return this}}io.EXTENSION_NAME=Bt;const Ih=[q.ROOT,q.SCENE,q.NODE,q.MESH,q.MATERIAL,q.TEXTURE,q.ANIMATION];class ao extends Se{init(){this.extensionName=dn,this.propertyType="Packet",this.parentTypes=Ih}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(e){return this.set("context",vt({},e))}listProperties(){return Object.keys(this.get("properties"))}getProperty(e){const r=this.get("properties");return e in r?r[e]:null}setProperty(e,r){this._assertContext(e);const n=vt({},this.get("properties"));return r?n[e]=r:delete n[e],this.set("properties",n)}toJSONLD(){return vt({"@context":Xn(this.get("context"))},Xn(this.get("properties")))}fromJSONLD(e){const r=(e=Xn(e))["@context"];return r&&this.set("context",r),delete e["@context"],this.set("properties",e)}_assertContext(e){if(!(e.split(":")[0]in this.get("context")))throw new Error(`${dn}: Missing context for term, "${e}".`)}}function Xn(t){return JSON.parse(JSON.stringify(t))}ao.EXTENSION_NAME=dn;const mt=dn;class oo extends Te{constructor(...e){super(...e),this.extensionName=mt}createPacket(){return new ao(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(e){var r;const n=(r=e.jsonDoc.json.extensions)==null?void 0:r[mt];if(!n||!n.packets)return this;const s=e.jsonDoc.json,i=this.document.getRoot(),a=n.packets.map(u=>this.createPacket().fromJSONLD(u)),o=[[s.asset],s.scenes,s.nodes,s.meshes,s.materials,s.images,s.animations],c=[[i],i.listScenes(),i.listNodes(),i.listMeshes(),i.listMaterials(),i.listTextures(),i.listAnimations()];for(let u=0;u0&&(r.extensions=r.extensions||{},r.extensions[mt]={packets:n}),this}}oo.EXTENSION_NAME=mt;const co=[cs,Ca,Oa,Fa,Pa,La,Va,ka,Ha,Ga,Xa,Fs,Za,eo,ro,no,io,oo];[...co];const lo=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],fo=t=>{let e="";for(let r=0;r<16;r++)r%4!=3&&(r>0&&(e+=" "),e+=t[r]||0);return e},Ah=(t=1,e=lo)=>` +`,Xi=t=>t?t.toISOString().substring(0,10):"";function bh(t,{unit:e="millimeter",title:r="jscad model",author:n="",description:s="",application:i="jscad",creationDate:a=new Date,license:o="",modificationDate:c}={}){t.push(` + + 1 + ${r} + ${n} + ${s||r} + + ${o} + + ${Xi(a)} + ${Xi(c||a)} + ${i} + `)}function Sh(t,e,r,n){t.push(` +`),t.push(` +`),r.forEach(({objectID:s,transform:i})=>{Ch(t,s,i)}),t.push(` +`),t.push(` +`)}const Ch=(t,e=1,r=lo)=>{t.push(` +`)};function Nh(t,e,r,n,s,i){t.push(` + + +`);for(let a=0;a +`);t.push(` + +`);for(let a=0;a +`);return t.push(` + + +`),t}const Yi={name:"[Content_Types].xml",content:` + + + + +`};function Oh({meshes:t=[],components:e=[],items:r=[],precision:n=17,header:s}){const i=[];return bh(i,s),i.push(` +`),r.length==0&&console.error("3MF empty build! Include items or simple."),t.forEach(({id:a,vertices:o,indices:c,name:u})=>Nh(i,a,o,c,n,u)),e.forEach(({id:a,children:o,name:c})=>{Sh(i,a,o,c)}),i.push(` +`),i.push(` +`),r.forEach(({objectID:a,transform:o})=>{i.push(Ah(a,o))}),i.push(` +`),i.push(` +`),i.join("")}class $h{constructor(){this.idSeq=0,this.lines=['','']}get name(){return"_rels/.rels"}addRel(e,r){this.lines.push(` `)}add3dModel(e){this.addRel(e,"http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel")}addThumbnail(e){this.addRel(e,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")}get content(){return this.lines.join(` +`)+` +`}}var Be=Uint8Array,Ke=Uint16Array,Ds=Int32Array,Ps=new Be([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Us=new Be([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ki=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uo=function(t,e){for(var r=new Ke(31),n=0;n<31;++n)r[n]=e+=1<>1|(ge&21845)<<1;Tt=(Tt&52428)>>2|(Tt&13107)<<2,Tt=(Tt&61680)>>4|(Tt&3855)<<4,us[ge]=((Tt&65280)>>8|(Tt&255)<<8)>>1}var $r=function(t,e,r){for(var n=t.length,s=0,i=new Ke(e);s>c]=u}else for(o=new Ke(n),s=0;s>15-t[s]);return o},Ht=new Be(288);for(var ge=0;ge<144;++ge)Ht[ge]=8;for(var ge=144;ge<256;++ge)Ht[ge]=9;for(var ge=256;ge<280;++ge)Ht[ge]=7;for(var ge=280;ge<288;++ge)Ht[ge]=8;var gn=new Be(32);for(var ge=0;ge<32;++ge)gn[ge]=5;var Ph=$r(Ht,9,0),Uh=$r(gn,5,0),po=function(t){return(t+7)/8|0},go=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new Be(t.subarray(e,r))},Lh=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],wn=function(t,e,r){var n=new Error(e||Lh[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,wn),!r)throw n;return n},gt=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},Mr=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},Yn=function(t,e){for(var r=[],n=0;ny&&(y=i[n].s);var x=new Ke(y+1),E=hs(r[h-1],x,0);if(E>e){var n=0,_=0,p=E-e,R=1<e)_+=R-(1<>=p;_>0;){var T=i[n].s;x[T]=0&&_;--n){var M=i[n].s;x[M]==e&&(--x[M],++_)}E=e}return{t:new Be(x),l:E}},hs=function(t,e,r){return t.s==-1?Math.max(hs(t.l,e,r+1),hs(t.r,e,r+1)):e[t.s]=r},Zi=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ke(++e),n=0,s=t[0],i=1,a=function(c){r[n++]=c},o=1;o<=e;++o)if(t[o]==s&&o!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[o]}return{c:r.subarray(0,n),n:e}},Er=function(t,e){for(var r=0,n=0;n>8,t[s+2]=t[s]^255,t[s+3]=t[s+1]^255;for(var i=0;i4&&!z[Ki[H-1]];--H);var V=u+5<<3,U=Er(s,Ht)+Er(i,gn)+a,X=Er(s,y)+Er(i,_)+a+14+3*H+Er(L,z)+2*L[16]+3*L[17]+7*L[18];if(c>=0&&V<=U&&V<=X)return mo(e,h,t.subarray(c,c+u));var se,Z,le,oe;if(gt(e,h,1+(X15&&(gt(e,h,Ce[F]>>5&127),h+=Ce[F]>>12)}}else se=Ph,Z=Ht,le=Uh,oe=gn;for(var F=0;F255){var me=Me>>18&31;Mr(e,h,se[me+257]),h+=Z[me+257],me>7&&(gt(e,h,Me>>23&31),h+=Ps[me]);var Ne=Me&31;Mr(e,h,le[Ne]),h+=oe[Ne],Ne>3&&(Mr(e,h,Me>>5&8191),h+=Us[Ne])}else Mr(e,h,se[Me]),h+=Z[Me]}return Mr(e,h,se[256]),h+Z[256]},Bh=new Ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vo=new Be(0),Vh=function(t,e,r,n,s,i){var a=i.z||t.length,o=new Be(n+a+5*(1+Math.ceil(a/7e3))+s),c=o.subarray(n,o.length-s),u=i.l,h=(i.r||0)&7;if(e){h&&(c[0]=i.r>>3);for(var m=Bh[e-1],y=m>>13,x=m&8191,E=(1<7e3||z>24576)&&(se>423||!u)){h=Qi(t,c,0,M,I,S,F,z,H,$-H,h),z=L=F=0,H=$;for(var Z=0;Z<286;++Z)I[Z]=0;for(var Z=0;Z<30;++Z)S[Z]=0}var le=2,oe=0,fe=x,ue=U-X&32767;if(se>2&&V==T($-ue))for(var de=Math.min(y,se)-1,Ce=Math.min(32767,$),me=Math.min(258,se);ue<=Ce&&--fe&&U!=X;){if(t[$+le]==t[$+le-ue]){for(var Me=0;Mele){if(le=Me,oe=ue,Me>de)break;for(var Ne=Math.min(ue,Me-2),Ve=0,Z=0;ZVe&&(Ve=We,X=xt)}}}U=X,X=_[U],ue+=U-X&32767}if(oe){M[z++]=268435456|fs[le]<<18|Ji[oe];var qe=fs[le]&31,Mt=Ji[oe]&31;F+=Ps[qe]+Us[Mt],++I[257+qe],++S[Mt],j=$+le,++L}else M[z++]=t[$],++I[t[$]]}}for($=Math.max($,j);$=a&&(c[h/8|0]=u,at=a),h=mo(c,h+1,t.subarray($,at))}i.i=a}return go(o,0,n+po(h)+s)},jh=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),kh=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n>>8;t=r},d:function(){return~t}}},zh=function(t,e,r,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),a=new Be(i.length+t.length);a.set(i),a.set(t,i.length),t=a,s.w=i.length}return Vh(t,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,s)},yo=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},Le=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Gh(t,e){return zh(t,e||{},0,0)}var xo=function(t,e,r,n){for(var s in t){var i=t[s],a=e+s,o=n;Array.isArray(i)&&(o=yo(n,i[1]),i=i[0]),i instanceof Be?r[a]=[i,o]:(r[a+="/"]=[new Be(0),o],xo(i,a,r,n))}},ea=typeof TextEncoder<"u"&&new TextEncoder,qh=typeof TextDecoder<"u"&&new TextDecoder,Hh=0;try{qh.decode(vo,{stream:!0}),Hh=1}catch{}function Fr(t,e){if(e){for(var r=new Be(t.length),n=0;n>1)),a=0,o=function(h){i[a++]=h},n=0;ni.length){var c=new Be(a+8+(s-n<<1));c.set(i),i=c}var u=t.charCodeAt(n);u<128||e?o(u):u<2048?(o(192|u>>6),o(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++n)&1023,o(240|u>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|u&63)):(o(224|u>>12),o(128|u>>6&63),o(128|u&63))}return go(i,0,a)}var ps=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&wn(9),e+=n+4}return e},ta=function(t,e,r,n,s,i,a,o){var c=n.length,u=r.extra,h=o&&o.length,m=ps(u);Le(t,e,a!=null?33639248:67324752),e+=4,a!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(i<0&&8),t[e++]=s&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var y=new Date(r.mtime==null?Date.now():r.mtime),x=y.getFullYear()-1980;if((x<0||x>119)&&wn(10),Le(t,e,x<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>1),e+=4,i!=-1&&(Le(t,e,r.crc),Le(t,e+4,i<0?-i-2:i),Le(t,e+8,r.size)),Le(t,e+12,c),Le(t,e+14,m),e+=16,a!=null&&(Le(t,e,h),Le(t,e+6,r.attrs),Le(t,e+10,a),e+=14),t.set(n,e),e+=c,m)for(var E in u){var _=u[E],p=_.length;Le(t,e,+E),Le(t,e+2,p),t.set(_,e+4),e+=4+p}return h&&(t.set(o,e),e+=h),e},Wh=function(t,e,r,n,s){Le(t,e,101010256),Le(t,e+8,r),Le(t,e+10,r),Le(t,e+12,n),Le(t,e+16,s)};function Xh(t,e){e||(e={});var r={},n=[];xo(t,"",r,e);var s=0,i=0;for(var a in r){var o=r[a],c=o[0],u=o[1],h=u.level==0?0:8,m=Fr(a),y=m.length,x=u.comment,E=x&&Fr(x),_=E&&E.length,p=ps(u.extra);y>65535&&wn(11);var R=h?Gh(c,u):c,g=R.length,T=kh();T.p(c),n.push(yo(u,{size:c.length,crc:T.d(),c:R,f:m,m:E,u:y!=a.length||E&&x.length!=_,o:s,compression:h})),s+=30+y+p+g,i+=76+2*(y+p)+(_||0)+g}for(var M=new Be(i+22),I=s,S=i-s,L=0;L0?(r[0]=(o*a+h*n+c*i-u*s)*2/m,r[1]=(c*a+h*s+u*n-o*i)*2/m,r[2]=(u*a+h*i+o*s-c*n)*2/m):(r[0]=(o*a+h*n+c*i-u*s)*2,r[1]=(c*a+h*s+u*n-o*i)*2,r[2]=(u*a+h*i+o*s-c*n)*2),Co(t,e,r),t}function No(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Oo(t,e){var r=e[0],n=e[1],s=e[2],i=e[4],a=e[5],o=e[6],c=e[8],u=e[9],h=e[10];return t[0]=Math.hypot(r,n,s),t[1]=Math.hypot(i,a,o),t[2]=Math.hypot(c,u,h),t}function $o(t,e){var r=new ee(3);Oo(r,e);var n=1/r[0],s=1/r[1],i=1/r[2],a=e[0]*n,o=e[1]*s,c=e[2]*i,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(j*F+U*$+Z*z),t[13]=r[1]+$-(H*F+X*$+le*z),t[14]=r[2]+z-(V*F+se*$+oe*z),t[15]=1,t}function X1(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],a=r+r,o=n+n,c=s+s,u=r*a,h=n*a,m=n*o,y=s*a,x=s*o,E=s*c,_=i*a,p=i*o,R=i*c;return t[0]=1-m-E,t[1]=h+R,t[2]=y-p,t[3]=0,t[4]=h-R,t[5]=1-u-E,t[6]=x+_,t[7]=0,t[8]=y+p,t[9]=x-_,t[10]=1-u-m,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y1(t,e,r,n,s,i,a){var o=1/(r-e),c=1/(s-n),u=1/(i-a);return t[0]=i*2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*o,t[9]=(s+n)*c,t[10]=(a+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*i*2*u,t[15]=0,t}function Fo(t,e,r,n,s){var i=1/Math.tan(e/2),a;return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(a=1/(n-s),t[10]=(s+n)*a,t[14]=2*s*n*a):(t[10]=-1,t[14]=-2*n),t}var K1=Fo;function J1(t,e,r,n,s){var i=1/Math.tan(e/2),a;return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(a=1/(n-s),t[10]=s*a,t[14]=s*n*a):(t[10]=-1,t[14]=-n),t}function Z1(t,e,r,n){var s=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+o),u=2/(s+i);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((a-o)*c*.5),t[9]=(s-i)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Do(t,e,r,n,s,i,a){var o=1/(e-r),c=1/(n-s),u=1/(i-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*o,t[13]=(s+n)*c,t[14]=(a+i)*u,t[15]=1,t}var Q1=Do;function ed(t,e,r,n,s,i,a){var o=1/(e-r),c=1/(n-s),u=1/(i-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*o,t[13]=(s+n)*c,t[14]=i*u,t[15]=1,t}function td(t,e,r,n){var s,i,a,o,c,u,h,m,y,x,E=e[0],_=e[1],p=e[2],R=n[0],g=n[1],T=n[2],M=r[0],I=r[1],S=r[2];return Math.abs(E-M)0&&(x=1/Math.sqrt(x),h*=x,m*=x,y*=x);var E=c*y-u*m,_=u*h-o*y,p=o*m-c*h;return x=E*E+_*_+p*p,x>0&&(x=1/Math.sqrt(x),E*=x,_*=x,p*=x),t[0]=E,t[1]=_,t[2]=p,t[3]=0,t[4]=m*p-y*_,t[5]=y*E-h*p,t[6]=h*_-m*E,t[7]=0,t[8]=h,t[9]=m,t[10]=y,t[11]=0,t[12]=s,t[13]=i,t[14]=a,t[15]=1,t}function nd(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function sd(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function id(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Po(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function ad(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function od(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function cd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ld(t,e){var r=t[0],n=t[1],s=t[2],i=t[3],a=t[4],o=t[5],c=t[6],u=t[7],h=t[8],m=t[9],y=t[10],x=t[11],E=t[12],_=t[13],p=t[14],R=t[15],g=e[0],T=e[1],M=e[2],I=e[3],S=e[4],L=e[5],F=e[6],$=e[7],z=e[8],j=e[9],H=e[10],V=e[11],U=e[12],X=e[13],se=e[14],Z=e[15];return Math.abs(r-g)<=W*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(n-T)<=W*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(s-M)<=W*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(i-I)<=W*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-S)<=W*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(o-L)<=W*Math.max(1,Math.abs(o),Math.abs(L))&&Math.abs(c-F)<=W*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(u-$)<=W*Math.max(1,Math.abs(u),Math.abs($))&&Math.abs(h-z)<=W*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(m-j)<=W*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(y-H)<=W*Math.max(1,Math.abs(y),Math.abs(H))&&Math.abs(x-V)<=W*Math.max(1,Math.abs(x),Math.abs(V))&&Math.abs(E-U)<=W*Math.max(1,Math.abs(E),Math.abs(U))&&Math.abs(_-X)<=W*Math.max(1,Math.abs(_),Math.abs(X))&&Math.abs(p-se)<=W*Math.max(1,Math.abs(p),Math.abs(se))&&Math.abs(R-Z)<=W*Math.max(1,Math.abs(R),Math.abs(Z))}var fd=So,ud=Po,hd=Object.freeze({__proto__:null,add:id,adjoint:N1,clone:_1,copy:I1,create:R1,determinant:O1,equals:ld,exactEquals:cd,frob:sd,fromQuat:X1,fromQuat2:q1,fromRotation:j1,fromRotationTranslation:Co,fromRotationTranslationScale:H1,fromRotationTranslationScaleOrigin:W1,fromScaling:V1,fromTranslation:B1,fromValues:A1,fromXRotation:k1,fromYRotation:z1,fromZRotation:G1,frustum:Y1,getRotation:$o,getScaling:Oo,getTranslation:No,identity:bo,invert:C1,lookAt:td,mul:fd,multiply:So,multiplyScalar:ad,multiplyScalarAndAdd:od,ortho:Q1,orthoNO:Do,orthoZO:ed,perspective:K1,perspectiveFromFieldOfView:Z1,perspectiveNO:Fo,perspectiveZO:J1,rotate:D1,rotateX:P1,rotateY:U1,rotateZ:L1,scale:F1,set:b1,str:nd,sub:ud,subtract:Po,targetTo:rd,translate:$1,transpose:S1});function Ls(){var t=new ee(3);return ee!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function pd(t){var e=new ee(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Uo(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function ds(t,e,r){var n=new ee(3);return n[0]=t,n[1]=e,n[2]=r,n}function dd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function gd(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function md(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Lo(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Bo(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Vo(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function vd(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function yd(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function xd(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function Td(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function Md(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function Ed(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function wd(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function jo(t,e){var r=e[0]-t[0],n=e[1]-t[1],s=e[2]-t[2];return Math.hypot(r,n,s)}function ko(t,e){var r=e[0]-t[0],n=e[1]-t[1],s=e[2]-t[2];return r*r+n*n+s*s}function zo(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function Rd(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function _d(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Go(t,e){var r=e[0],n=e[1],s=e[2],i=r*r+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Bs(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function an(t,e,r){var n=e[0],s=e[1],i=e[2],a=r[0],o=r[1],c=r[2];return t[0]=s*c-i*o,t[1]=i*a-n*c,t[2]=n*o-s*a,t}function Id(t,e,r,n){var s=e[0],i=e[1],a=e[2];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t[2]=a+n*(r[2]-a),t}function Ad(t,e,r,n,s,i){var a=i*i,o=a*(2*i-3)+1,c=a*(i-2)+i,u=a*(i-1),h=a*(3-2*i);return t[0]=e[0]*o+r[0]*c+n[0]*u+s[0]*h,t[1]=e[1]*o+r[1]*c+n[1]*u+s[1]*h,t[2]=e[2]*o+r[2]*c+n[2]*u+s[2]*h,t}function bd(t,e,r,n,s,i){var a=1-i,o=a*a,c=i*i,u=o*a,h=3*i*o,m=3*c*a,y=c*i;return t[0]=e[0]*u+r[0]*h+n[0]*m+s[0]*y,t[1]=e[1]*u+r[1]*h+n[1]*m+s[1]*y,t[2]=e[2]*u+r[2]*h+n[2]*m+s[2]*y,t}function Sd(t,e){e=e||1;var r=nt()*2*Math.PI,n=nt()*2-1,s=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=n*e,t}function Cd(t,e,r){var n=e[0],s=e[1],i=e[2],a=r[3]*n+r[7]*s+r[11]*i+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/a,t[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/a,t}function Nd(t,e,r){var n=e[0],s=e[1],i=e[2];return t[0]=n*r[0]+s*r[3]+i*r[6],t[1]=n*r[1]+s*r[4]+i*r[7],t[2]=n*r[2]+s*r[5]+i*r[8],t}function Od(t,e,r){var n=r[0],s=r[1],i=r[2],a=r[3],o=e[0],c=e[1],u=e[2],h=s*u-i*c,m=i*o-n*u,y=n*c-s*o,x=s*y-i*m,E=i*h-n*y,_=n*m-s*h,p=a*2;return h*=p,m*=p,y*=p,x*=2,E*=2,_*=2,t[0]=o+h+x,t[1]=c+m+E,t[2]=u+y+_,t}function $d(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Fd(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Dd(t,e,r,n){var s=[],i=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Pd(t,e){var r=t[0],n=t[1],s=t[2],i=e[0],a=e[1],o=e[2],c=Math.sqrt(r*r+n*n+s*s),u=Math.sqrt(i*i+a*a+o*o),h=c*u,m=h&&Bs(t,e)/h;return Math.acos(Math.min(Math.max(m,-1),1))}function Ud(t){return t[0]=0,t[1]=0,t[2]=0,t}function Ld(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Bd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Vd(t,e){var r=t[0],n=t[1],s=t[2],i=e[0],a=e[1],o=e[2];return Math.abs(r-i)<=W*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=W*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-o)<=W*Math.max(1,Math.abs(s),Math.abs(o))}var jd=Lo,kd=Bo,zd=Vo,Gd=jo,qd=ko,qo=Uo,Hd=zo,Wd=function(){var t=Ls();return function(e,r,n,s,i,a){var o,c;for(r||(r=3),n||(n=0),s?c=Math.min(s*r+n,e.length):c=e.length,o=n;o0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=s*a,t[3]=i*a,t}function ic(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ng(t,e,r,n){var s=r[0]*n[1]-r[1]*n[0],i=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],o=r[1]*n[2]-r[2]*n[1],c=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],h=e[0],m=e[1],y=e[2],x=e[3];return t[0]=m*u-y*c+x*o,t[1]=-(h*u)+y*a-x*i,t[2]=h*c-m*a+x*s,t[3]=-(h*o)+m*i-y*s,t}function ac(t,e,r,n){var s=e[0],i=e[1],a=e[2],o=e[3];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t[2]=a+n*(r[2]-a),t[3]=o+n*(r[3]-o),t}function sg(t,e){e=e||1;var r,n,s,i,a,o;do r=nt()*2-1,n=nt()*2-1,a=r*r+n*n;while(a>=1);do s=nt()*2-1,i=nt()*2-1,o=s*s+i*i;while(o>=1);var c=Math.sqrt((1-a)/o);return t[0]=e*r,t[1]=e*n,t[2]=e*s*c,t[3]=e*i*c,t}function ig(t,e,r){var n=e[0],s=e[1],i=e[2],a=e[3];return t[0]=r[0]*n+r[4]*s+r[8]*i+r[12]*a,t[1]=r[1]*n+r[5]*s+r[9]*i+r[13]*a,t[2]=r[2]*n+r[6]*s+r[10]*i+r[14]*a,t[3]=r[3]*n+r[7]*s+r[11]*i+r[15]*a,t}function ag(t,e,r){var n=e[0],s=e[1],i=e[2],a=r[0],o=r[1],c=r[2],u=r[3],h=u*n+o*i-c*s,m=u*s+c*n-a*i,y=u*i+a*s-o*n,x=-a*n-o*s-c*i;return t[0]=h*u+x*-a+m*-c-y*-o,t[1]=m*u+x*-o+y*-a-h*-c,t[2]=y*u+x*-c+h*-o-m*-a,t[3]=e[3],t}function og(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function cg(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function oc(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function cc(t,e){var r=t[0],n=t[1],s=t[2],i=t[3],a=e[0],o=e[1],c=e[2],u=e[3];return Math.abs(r-a)<=W*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=W*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(s-c)<=W*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(i-u)<=W*Math.max(1,Math.abs(i),Math.abs(u))}var lg=Zo,fg=Qo,ug=ec,hg=rc,pg=nc,dg=Vs,gg=js,mg=function(){var t=Ho();return function(e,r,n,s,i,a){var o,c;for(r||(r=4),n||(n=0),s?c=Math.min(s*r+n,e.length):c=e.length,o=n;oW?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function Tg(t,e){var r=zs(t,e);return Math.acos(2*r*r-1)}function fc(t,e,r){var n=e[0],s=e[1],i=e[2],a=e[3],o=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+a*o+s*u-i*c,t[1]=s*h+a*c+i*o-n*u,t[2]=i*h+a*u+n*c-s*o,t[3]=a*h-n*o-s*c-i*u,t}function uc(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],a=e[3],o=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*o,t[1]=s*c+i*o,t[2]=i*c-s*o,t[3]=a*c-n*o,t}function hc(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],a=e[3],o=Math.sin(r),c=Math.cos(r);return t[0]=n*c-i*o,t[1]=s*c+a*o,t[2]=i*c+n*o,t[3]=a*c-s*o,t}function pc(t,e,r){r*=.5;var n=e[0],s=e[1],i=e[2],a=e[3],o=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*o,t[1]=s*c-n*o,t[2]=i*c+a*o,t[3]=a*c-i*o,t}function Mg(t,e){var r=e[0],n=e[1],s=e[2];return t[0]=r,t[1]=n,t[2]=s,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),t}function dc(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],a=Math.sqrt(r*r+n*n+s*s),o=Math.exp(i),c=a>0?o*Math.sin(a)/a:0;return t[0]=r*c,t[1]=n*c,t[2]=s*c,t[3]=o*Math.cos(a),t}function gc(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],a=Math.sqrt(r*r+n*n+s*s),o=a>0?Math.atan2(a,i)/a:0;return t[0]=r*o,t[1]=n*o,t[2]=s*o,t[3]=.5*Math.log(r*r+n*n+s*s+i*i),t}function Eg(t,e,r){return gc(t,e),vc(t,t,r),dc(t,t),t}function on(t,e,r,n){var s=e[0],i=e[1],a=e[2],o=e[3],c=r[0],u=r[1],h=r[2],m=r[3],y,x,E,_,p;return x=s*c+i*u+a*h+o*m,x<0&&(x=-x,c=-c,u=-u,h=-h,m=-m),1-x>W?(y=Math.acos(x),E=Math.sin(y),_=Math.sin((1-n)*y)/E,p=Math.sin(n*y)/E):(_=1-n,p=n),t[0]=_*s+p*c,t[1]=_*i+p*u,t[2]=_*a+p*h,t[3]=_*o+p*m,t}function wg(t){var e=nt(),r=nt(),n=nt(),s=Math.sqrt(1-e),i=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=i*Math.sin(2*Math.PI*n),t[3]=i*Math.cos(2*Math.PI*n),t}function Rg(t,e){var r=e[0],n=e[1],s=e[2],i=e[3],a=r*r+n*n+s*s+i*i,o=a?1/a:0;return t[0]=-r*o,t[1]=-n*o,t[2]=-s*o,t[3]=i*o,t}function _g(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function mc(t,e){var r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var s=0;e[4]>e[0]&&(s=1),e[8]>e[s*3+s]&&(s=2);var i=(s+1)%3,a=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[i*3+i]-e[a*3+a]+1),t[s]=.5*n,n=.5/n,t[3]=(e[i*3+a]-e[a*3+i])*n,t[i]=(e[i*3+s]+e[s*3+i])*n,t[a]=(e[a*3+s]+e[s*3+a])*n}return t}function Ig(t,e,r,n){var s=.5*Math.PI/180;e*=s,r*=s,n*=s;var i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),c=Math.cos(r),u=Math.sin(n),h=Math.cos(n);return t[0]=i*c*h-a*o*u,t[1]=a*o*h+i*c*u,t[2]=a*c*u-i*o*h,t[3]=a*c*h+i*o*u,t}function Ag(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var bg=Wo,Sg=Xo,ks=Yo,Cg=Ko,Ng=Jo,Og=fc,vc=tc,zs=ic,$g=ac,Gs=Vs,Fg=Gs,qs=js,Dg=qs,Hs=sc,Pg=oc,Ug=cc,Lg=function(){var t=Ls(),e=ds(1,0,0),r=ds(0,1,0);return function(n,s,i){var a=Bs(s,i);return a<-.999999?(an(t,e,s),qo(t)<1e-6&&an(t,r,s),Go(t,t),lc(n,t,Math.PI),n):a>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(an(t,s,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+a,Hs(n,n))}}(),Bg=function(){var t=mn(),e=mn();return function(r,n,s,i,a,o){return on(t,n,a,o),on(e,s,i,o),on(r,t,e,2*o*(1-o)),r}}(),Vg=function(){var t=_o();return function(e,r,n,s){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],Hs(e,mc(e,t))}}(),jg=Object.freeze({__proto__:null,add:Ng,calculateW:Mg,clone:bg,conjugate:_g,copy:ks,create:mn,dot:zs,equals:Ug,exactEquals:Pg,exp:dc,fromEuler:Ig,fromMat3:mc,fromValues:Sg,getAngle:Tg,getAxisAngle:xg,identity:yg,invert:Rg,len:Fg,length:Gs,lerp:$g,ln:gc,mul:Og,multiply:fc,normalize:Hs,pow:Eg,random:wg,rotateX:uc,rotateY:hc,rotateZ:pc,rotationTo:Lg,scale:vc,set:Cg,setAxes:Vg,setAxisAngle:lc,slerp:on,sqlerp:Bg,sqrLen:Dg,squaredLength:qs,str:Ag});function kg(){var t=new ee(8);return ee!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function zg(t){var e=new ee(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Gg(t,e,r,n,s,i,a,o){var c=new ee(8);return c[0]=t,c[1]=e,c[2]=r,c[3]=n,c[4]=s,c[5]=i,c[6]=a,c[7]=o,c}function qg(t,e,r,n,s,i,a){var o=new ee(8);o[0]=t,o[1]=e,o[2]=r,o[3]=n;var c=s*.5,u=i*.5,h=a*.5;return o[4]=c*n+u*r-h*e,o[5]=u*n+h*t-c*r,o[6]=h*n+c*e-u*t,o[7]=-c*t-u*e-h*r,o}function yc(t,e,r){var n=r[0]*.5,s=r[1]*.5,i=r[2]*.5,a=e[0],o=e[1],c=e[2],u=e[3];return t[0]=a,t[1]=o,t[2]=c,t[3]=u,t[4]=n*u+s*c-i*o,t[5]=s*u+i*a-n*c,t[6]=i*u+n*o-s*a,t[7]=-n*a-s*o-i*c,t}function Hg(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0]*.5,t[5]=e[1]*.5,t[6]=e[2]*.5,t[7]=0,t}function Wg(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Xg(t,e){var r=mn();$o(r,e);var n=new ee(3);return No(n,e),yc(t,r,n),t}function xc(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Yg(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Kg(t,e,r,n,s,i,a,o,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=s,t[4]=i,t[5]=a,t[6]=o,t[7]=c,t}var Jg=ks;function Zg(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Qg=ks;function e0(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function t0(t,e){var r=e[4],n=e[5],s=e[6],i=e[7],a=-e[0],o=-e[1],c=-e[2],u=e[3];return t[0]=(r*u+i*a+n*c-s*o)*2,t[1]=(n*u+i*o+s*a-r*c)*2,t[2]=(s*u+i*c+r*o-n*a)*2,t}function r0(t,e,r){var n=e[0],s=e[1],i=e[2],a=e[3],o=r[0]*.5,c=r[1]*.5,u=r[2]*.5,h=e[4],m=e[5],y=e[6],x=e[7];return t[0]=n,t[1]=s,t[2]=i,t[3]=a,t[4]=a*o+s*u-i*c+h,t[5]=a*c+i*o-n*u+m,t[6]=a*u+n*c-s*o+y,t[7]=-n*o-s*c-i*u+x,t}function n0(t,e,r){var n=-e[0],s=-e[1],i=-e[2],a=e[3],o=e[4],c=e[5],u=e[6],h=e[7],m=o*a+h*n+c*i-u*s,y=c*a+h*s+u*n-o*i,x=u*a+h*i+o*s-c*n,E=h*a-o*n-c*s-u*i;return uc(t,e,r),n=t[0],s=t[1],i=t[2],a=t[3],t[4]=m*a+E*n+y*i-x*s,t[5]=y*a+E*s+x*n-m*i,t[6]=x*a+E*i+m*s-y*n,t[7]=E*a-m*n-y*s-x*i,t}function s0(t,e,r){var n=-e[0],s=-e[1],i=-e[2],a=e[3],o=e[4],c=e[5],u=e[6],h=e[7],m=o*a+h*n+c*i-u*s,y=c*a+h*s+u*n-o*i,x=u*a+h*i+o*s-c*n,E=h*a-o*n-c*s-u*i;return hc(t,e,r),n=t[0],s=t[1],i=t[2],a=t[3],t[4]=m*a+E*n+y*i-x*s,t[5]=y*a+E*s+x*n-m*i,t[6]=x*a+E*i+m*s-y*n,t[7]=E*a-m*n-y*s-x*i,t}function i0(t,e,r){var n=-e[0],s=-e[1],i=-e[2],a=e[3],o=e[4],c=e[5],u=e[6],h=e[7],m=o*a+h*n+c*i-u*s,y=c*a+h*s+u*n-o*i,x=u*a+h*i+o*s-c*n,E=h*a-o*n-c*s-u*i;return pc(t,e,r),n=t[0],s=t[1],i=t[2],a=t[3],t[4]=m*a+E*n+y*i-x*s,t[5]=y*a+E*s+x*n-m*i,t[6]=x*a+E*i+m*s-y*n,t[7]=E*a-m*n-y*s-x*i,t}function a0(t,e,r){var n=r[0],s=r[1],i=r[2],a=r[3],o=e[0],c=e[1],u=e[2],h=e[3];return t[0]=o*a+h*n+c*i-u*s,t[1]=c*a+h*s+u*n-o*i,t[2]=u*a+h*i+o*s-c*n,t[3]=h*a-o*n-c*s-u*i,o=e[4],c=e[5],u=e[6],h=e[7],t[4]=o*a+h*n+c*i-u*s,t[5]=c*a+h*s+u*n-o*i,t[6]=u*a+h*i+o*s-c*n,t[7]=h*a-o*n-c*s-u*i,t}function o0(t,e,r){var n=e[0],s=e[1],i=e[2],a=e[3],o=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+a*o+s*u-i*c,t[1]=s*h+a*c+i*o-n*u,t[2]=i*h+a*u+n*c-s*o,t[3]=a*h-n*o-s*c-i*u,o=r[4],c=r[5],u=r[6],h=r[7],t[4]=n*h+a*o+s*u-i*c,t[5]=s*h+a*c+i*o-n*u,t[6]=i*h+a*u+n*c-s*o,t[7]=a*h-n*o-s*c-i*u,t}function c0(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,s=e[1]/r,i=e[2]/r,a=e[3]/r,o=e[4],c=e[5],u=e[6],h=e[7],m=n*o+s*c+i*u+a*h;t[0]=n,t[1]=s,t[2]=i,t[3]=a,t[4]=(o-n*m)/r,t[5]=(c-s*m)/r,t[6]=(u-i*m)/r,t[7]=(h-a*m)/r}return t}function y0(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function x0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function T0(t,e){var r=t[0],n=t[1],s=t[2],i=t[3],a=t[4],o=t[5],c=t[6],u=t[7],h=e[0],m=e[1],y=e[2],x=e[3],E=e[4],_=e[5],p=e[6],R=e[7];return Math.abs(r-h)<=W*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-m)<=W*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(s-y)<=W*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(i-x)<=W*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-E)<=W*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-_)<=W*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(c-p)<=W*Math.max(1,Math.abs(c),Math.abs(p))&&Math.abs(u-R)<=W*Math.max(1,Math.abs(u),Math.abs(R))}var M0=Object.freeze({__proto__:null,add:l0,clone:zg,conjugate:d0,copy:xc,create:kg,dot:Mc,equals:T0,exactEquals:x0,fromMat4:Xg,fromRotation:Wg,fromRotationTranslation:yc,fromRotationTranslationValues:qg,fromTranslation:Hg,fromValues:Gg,getDual:Zg,getReal:Jg,getTranslation:t0,identity:Yg,invert:p0,len:g0,length:Ec,lerp:h0,mul:f0,multiply:Tc,normalize:v0,rotateAroundAxis:c0,rotateByQuatAppend:a0,rotateByQuatPrepend:o0,rotateX:n0,rotateY:s0,rotateZ:i0,scale:u0,set:Kg,setDual:e0,setReal:Qg,sqrLen:m0,squaredLength:Rn,str:y0,translate:r0});function wc(){var t=new ee(2);return ee!=Float32Array&&(t[0]=0,t[1]=0),t}function E0(t){var e=new ee(2);return e[0]=t[0],e[1]=t[1],e}function w0(t,e){var r=new ee(2);return r[0]=t,r[1]=e,r}function R0(t,e){return t[0]=e[0],t[1]=e[1],t}function _0(t,e,r){return t[0]=e,t[1]=r,t}function I0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Rc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function _c(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function Ic(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function A0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function b0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function S0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function C0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function N0(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function O0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function $0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function Ac(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function bc(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function Sc(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function Cc(t){var e=t[0],r=t[1];return e*e+r*r}function F0(t,e){return t[0]=-e[0],t[1]=-e[1],t}function D0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P0(t,e){var r=e[0],n=e[1],s=r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t}function U0(t,e){return t[0]*e[0]+t[1]*e[1]}function L0(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function B0(t,e,r,n){var s=e[0],i=e[1];return t[0]=s+n*(r[0]-s),t[1]=i+n*(r[1]-i),t}function V0(t,e){e=e||1;var r=nt()*2*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function j0(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s,t[1]=r[1]*n+r[3]*s,t}function k0(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[2]*s+r[4],t[1]=r[1]*n+r[3]*s+r[5],t}function z0(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[3]*s+r[6],t[1]=r[1]*n+r[4]*s+r[7],t}function G0(t,e,r){var n=e[0],s=e[1];return t[0]=r[0]*n+r[4]*s+r[12],t[1]=r[1]*n+r[5]*s+r[13],t}function q0(t,e,r,n){var s=e[0]-r[0],i=e[1]-r[1],a=Math.sin(n),o=Math.cos(n);return t[0]=s*o-i*a+r[0],t[1]=s*a+i*o+r[1],t}function H0(t,e){var r=t[0],n=t[1],s=e[0],i=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(s*s+i*i),o=a&&(r*s+n*i)/a;return Math.acos(Math.min(Math.max(o,-1),1))}function W0(t){return t[0]=0,t[1]=0,t}function X0(t){return"vec2("+t[0]+", "+t[1]+")"}function Y0(t,e){return t[0]===e[0]&&t[1]===e[1]}function K0(t,e){var r=t[0],n=t[1],s=e[0],i=e[1];return Math.abs(r-s)<=W*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=W*Math.max(1,Math.abs(n),Math.abs(i))}var J0=Sc,Z0=Rc,Q0=_c,em=Ic,tm=Ac,rm=bc,nm=Cc,sm=function(){var t=wc();return function(e,r,n,s,i,a){var o,c;for(r||(r=2),n||(n=0),s?c=Math.min(s*r+n,e.length):c=e.length,o=n;o{var t=import.meta.url;return async function(e={}){var r,n=e,s,i,a=new Promise((l,f)=>{s=l,i=f}),o=typeof window=="object",c=typeof importScripts=="function",u=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(u){const{createRequire:l}=await import("./__vite-browser-external-4ed993c7.js");var h=l(import.meta.url)}var m=!1;n.setup=function(){if(m)return;m=!0;function l(A,O,P=k=>k){if(O)for(let k of O)A.push_back(P(k));return A}function f(A,O=P=>P){const P=[],k=A.size();for(let J=0;JP){const P=[],k=A.size();for(let J=0;Jl(new n.Vector_vec2,O,P=>P instanceof Array?{x:P[0],y:P[1]}:P))}function w(A){for(let O=0;OA.min[O]),max:["x","y"].map(O=>A.max[O])}},n.CrossSection.prototype.offset=function(A,O="Square",P=2,k=0){return this._Offset(A,D(O),P,k)},n.CrossSection.prototype.extrude=function(A,O=0,P=0,k=[1,1],J=!1){k=b([k]);const Ee=n._Extrude(this._ToPolygons(),A,O,P,k);return J?Ee.translate([0,0,-A/2]):Ee},n.CrossSection.prototype.revolve=function(A=0,O=360){return n._Revolve(this._ToPolygons(),A,O)},n.CrossSection.prototype.add=function(A){return this._add(G(A))},n.CrossSection.prototype.subtract=function(A){return this._subtract(G(A))},n.CrossSection.prototype.intersect=function(A){return this._intersect(G(A))},n.CrossSection.prototype.toPolygons=function(){const A=this._ToPolygons(),O=d(A);return A.delete(),O},n.Manifold.prototype.smoothOut=function(A=60,O=0){return this._SmoothOut(A,O)},n.Manifold.prototype.warp=function(A){const O=yr(function(J){const Ee=tt(J,"double"),_e=tt(J+8,"double"),Ye=tt(J+16,"double"),Fe=[Ee,_e,Ye];A(Fe),Kt(J,Fe[0],"double"),Kt(J+8,Fe[1],"double"),Kt(J+16,Fe[2],"double")},"vi"),P=this._Warp(O);xr(O);const k=P.status();if(k.value!==0)throw new n.ManifoldError(k.value);return P},n.Manifold.prototype.calculateNormals=function(A,O=60){return this._CalculateNormals(A,O)},n.Manifold.prototype.setProperties=function(A,O){const P=this.numProp(),k=yr(function(Ee,_e,Ye){const Fe=[];for(let Ie=0;IeA.min[O]),max:["x","y","z"].map(O=>A.max[O])}};class K{constructor({numProp:O=3,triVerts:P=new Uint32Array,vertProperties:k=new Float32Array,mergeFromVert:J,mergeToVert:Ee,runIndex:_e,runOriginalID:Ye,faceID:Fe,halfedgeTangent:er,runTransform:tr}={}){this.numProp=O,this.triVerts=P,this.vertProperties=k,this.mergeFromVert=J,this.mergeToVert=Ee,this.runIndex=_e,this.runOriginalID=Ye,this.faceID=Fe,this.halfedgeTangent=er,this.runTransform=tr}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:O,mesh:P}=n._Merge(this);return Object.assign(this,{...P}),O}verts(O){return this.triVerts.subarray(3*O,3*(O+1))}position(O){return this.vertProperties.subarray(this.numProp*O,this.numProp*O+3)}extras(O){return this.vertProperties.subarray(this.numProp*O+3,this.numProp*(O+1))}tangent(O){return this.halfedgeTangent.subarray(4*O,4*(O+1))}transform(O){const P=new Array(16);for(const k of[0,1,2,3])for(const J of[0,1,2])P[4*k+J]=this.runTransform[12*O+3*k+J];return P[15]=1,P}}n.Mesh=K,n.Manifold.prototype.getMesh=function(A=[0,0,0]){return A instanceof Array&&(A={0:A[0],1:A[1],2:A[2]}),new K(this._GetMeshJS(A))},n.ManifoldError=function(O,...P){let k="Unknown error";switch(O){case n.status.NonFiniteVertex.value:k="Non-finite vertex";break;case n.status.NotManifold.value:k="Not manifold";break;case n.status.VertexOutOfBounds.value:k="Vertex index out of bounds";break;case n.status.PropertiesWrongLength.value:k="Properties have wrong length";break;case n.status.MissingPositionProperties.value:k="Less than three properties";break;case n.status.MergeVectorsDifferentLengths.value:k="Merge vectors have different lengths";break;case n.status.MergeIndexOutOfBounds.value:k="Merge index out of bounds";break;case n.status.TransformWrongLength.value:k="Transform vector has wrong length";break;case n.status.RunIndexWrongLength.value:k="Run index vector has wrong length";break;case n.status.FaceIDWrongLength.value:k="Face ID vector has wrong length";case n.status.InvalidConstruction.value:k="Manifold constructed with invalid parameters"}const J=Error.apply(this,[k,...P]);J.name=this.name="ManifoldError",this.message=J.message,this.stack=J.stack,this.code=O},n.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:n.ManifoldError,writable:!0,configurable:!0}}),n.CrossSection=function(A,O="Positive"){const P=v(A),k=new B(P,C(O));return w(P),k},n.CrossSection.ofPolygons=function(A,O="Positive"){return new n.CrossSection(A,O)},n.CrossSection.square=function(...A){let O;A.length==0?O={x:1,y:1}:typeof A[0]=="number"?O={x:A[0],y:A[0]}:O=b(A);const P=A[1]||!1;return n._Square(O,P)},n.CrossSection.circle=function(A,O=0){return n._Circle(A,O)};function re(A){return function(...O){O.length==1&&(O=O[0]);const P=new n.Vector_crossSection;for(const J of O)P.push_back(G(J));const k=n["_crossSection"+A](P);return P.delete(),k}}n.CrossSection.compose=re("Compose"),n.CrossSection.union=re("UnionN"),n.CrossSection.difference=re("DifferenceN"),n.CrossSection.intersection=re("IntersectionN");function ye(A,O){l(A,O,P=>P instanceof Array?{x:P[0],y:P[1]}:P)}n.CrossSection.hull=function(...A){A.length==1&&(A=A[0]);let O=new n.Vector_vec2;for(const k of A)if(k instanceof B)n._crossSectionCollectVertices(O,k);else if(k instanceof Array&&k.length==2&&typeof k[0]=="number")O.push_back({x:k[0],y:k[1]});else if(k.x)O.push_back(k);else{const Ee=k[0].length==2&&typeof k[0][0]=="number"||k[0].x?[k]:k;for(const _e of Ee)ye(O,_e)}const P=n._crossSectionHullPoints(O);return O.delete(),P},n.CrossSection.prototype=Object.create(B.prototype),Object.defineProperty(n.CrossSection,Symbol.hasInstance,{get:()=>A=>A instanceof B});const pe=n.Manifold;n.Manifold=function(A){const O=new pe(A),P=O.status();if(P.value!==0)throw new n.ManifoldError(P.value);return O},n.Manifold.ofMesh=function(A){return new n.Manifold(A)},n.Manifold.tetrahedron=function(){return n._Tetrahedron()},n.Manifold.cube=function(...A){let O;A.length==0?O={x:1,y:1,z:1}:typeof A[0]=="number"?O={x:A[0],y:A[0],z:A[0]}:O=N(A);const P=A[1]||!1;return n._Cube(O,P)},n.Manifold.cylinder=function(A,O,P=-1,k=0,J=!1){return n._Cylinder(A,O,P,k,J)},n.Manifold.sphere=function(A,O=0){return n._Sphere(A,O)},n.Manifold.smooth=function(A,O=[]){const P=new n.Vector_smoothness;l(P,O);const k=n._Smooth(A,P);return P.delete(),k},n.Manifold.extrude=function(A,O,P=0,k=0,J=[1,1],Ee=!1){return(A instanceof B?A:n.CrossSection(A,"Positive")).extrude(O,P,k,J,Ee)},n.Manifold.revolve=function(A,O=0,P=360){return(A instanceof B?A:n.CrossSection(A,"Positive")).revolve(O,P)},n.Manifold.reserveIDs=function(A){return n._ReserveIDs(A)},n.Manifold.compose=function(A){const O=new n.Vector_manifold;l(O,A);const P=n._manifoldCompose(O);return O.delete(),P};function Ue(A){return function(...O){O.length==1&&(O=O[0]);const P=new n.Vector_manifold;for(const J of O)P.push_back(J);const k=n["_manifold"+A+"N"](P);return P.delete(),k}}n.Manifold.union=Ue("Union"),n.Manifold.difference=Ue("Difference"),n.Manifold.intersection=Ue("Intersection"),n.Manifold.levelSet=function(A,O,P,k=0,J=-1){const Ee={min:{x:O.min[0],y:O.min[1],z:O.min[2]},max:{x:O.max[0],y:O.max[1],z:O.max[2]}},_e=yr(function(Fe){const er=tt(Fe,"double"),tr=tt(Fe+8,"double"),Ie=tt(Fe+16,"double");return A([er,tr,Ie])},"di"),Ye=n._LevelSet(_e,Ee,P,k,J);return xr(_e),Ye};function Xe(A,O){l(A,O,P=>P instanceof Array?{x:P[0],y:P[1],z:P[2]}:P)}n.Manifold.hull=function(...A){A.length==1&&(A=A[0]);let O=new n.Vector_vec3;for(const k of A)k instanceof pe?n._manifoldCollectVertices(O,k):k instanceof Array&&k.length==3&&typeof k[0]=="number"?O.push_back({x:k[0],y:k[1],z:k[2]}):k.x?O.push_back(k):Xe(O,k);const P=n._manifoldHullPoints(O);return O.delete(),P},n.Manifold.prototype=Object.create(pe.prototype),Object.defineProperty(n.Manifold,Symbol.hasInstance,{get:()=>A=>A instanceof pe}),n.triangulate=function(A,O=-1){const P=v(A),k=f(n._Triangulate(P,O),J=>[J[0],J[1],J[2]]);return w(P),k}};var y=Object.assign({},n),x="";function E(l){return n.locateFile?n.locateFile(l,x):x+l}var _,p,R;if(u){var g=h("fs"),T=h("path");x=h("url").fileURLToPath(new URL("./",self.location)),_=(l,f)=>(l=at(l)?new URL(l):T.normalize(l),g.readFileSync(l,f?void 0:"utf8")),R=l=>{var f=_(l,!0);return f.buffer||(f=new Uint8Array(f)),f},p=(l,f,d,v=!0)=>{l=at(l)?new URL(l):T.normalize(l),g.readFile(l,v?void 0:"utf8",(w,b)=>{w?d(w):f(v?b.buffer:b)})},!n.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(o||c)&&(c?x=self.location.href:typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),t&&(x=t),x.startsWith("blob:")?x="":x=x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1),_=l=>{var f=new XMLHttpRequest;return f.open("GET",l,!1),f.send(null),f.responseText},c&&(R=l=>{var f=new XMLHttpRequest;return f.open("GET",l,!1),f.responseType="arraybuffer",f.send(null),new Uint8Array(f.response)}),p=(l,f,d)=>{if(at(l)){var v=new XMLHttpRequest;v.open("GET",l,!0),v.responseType="arraybuffer",v.onload=()=>{if(v.status==200||v.status==0&&v.response){f(v.response);return}d()},v.onerror=d,v.send(null);return}fetch(l,{credentials:"same-origin"}).then(w=>w.ok?w.arrayBuffer():Promise.reject(new Error(w.status+" : "+w.url))).then(f,d)});n.print||console.log.bind(console);var M=n.printErr||console.error.bind(console);Object.assign(n,y),y=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.quit&&n.quit;var I;n.wasmBinary&&(I=n.wasmBinary);var S,L=!1,F,$,z,j,H,V,U,X;function se(){var l=S.buffer;n.HEAP8=F=new Int8Array(l),n.HEAP16=z=new Int16Array(l),n.HEAPU8=$=new Uint8Array(l),n.HEAPU16=j=new Uint16Array(l),n.HEAP32=H=new Int32Array(l),n.HEAPU32=V=new Uint32Array(l),n.HEAPF32=U=new Float32Array(l),n.HEAPF64=X=new Float64Array(l)}var Z=[],le=[],oe=[];function fe(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Ce(n.preRun.shift());An(Z)}function ue(){An(le)}function de(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Me(n.postRun.shift());An(oe)}function Ce(l){Z.unshift(l)}function me(l){le.unshift(l)}function Me(l){oe.unshift(l)}var Ne=0,Ve=null;function xt(l){Ne++,n.monitorRunDependencies?.(Ne)}function ve(l){if(Ne--,n.monitorRunDependencies?.(Ne),Ne==0&&Ve){var f=Ve;Ve=null,f()}}function We(l){n.onAbort?.(l),l="Aborted("+l+")",M(l),L=!0,l+=". Build with -sASSERTIONS for more info.";var f=new WebAssembly.RuntimeError(l);throw i(f),f}var qe="data:application/octet-stream;base64,",Mt=l=>l.startsWith(qe),at=l=>l.startsWith("file://");function Et(){if(n.locateFile){var l="manifold.wasm";return Mt(l)?l:E(l)}return new URL("/assets/manifold-0f9aa664.wasm",self.location).href}var Yt;function jr(l){if(l==Yt&&I)return new Uint8Array(I);if(R)return R(l);throw"both async and sync fetching of the wasm failed"}function In(l){return I?Promise.resolve().then(()=>jr(l)):new Promise((f,d)=>{p(l,v=>f(new Uint8Array(v)),v=>{try{f(jr(l))}catch(w){d(w)}})})}function Ks(l,f,d){return In(l).then(v=>WebAssembly.instantiate(v,f)).then(d,v=>{M(`failed to asynchronously prepare wasm: ${v}`),We(v)})}function kc(l,f,d,v){return!l&&typeof WebAssembly.instantiateStreaming=="function"&&!Mt(f)&&!at(f)&&!u&&typeof fetch=="function"?fetch(f,{credentials:"same-origin"}).then(w=>{var b=WebAssembly.instantiateStreaming(w,d);return b.then(v,function(N){return M(`wasm streaming compile failed: ${N}`),M("falling back to ArrayBuffer instantiation"),Ks(f,d,v)})}):Ks(f,d,v)}function zc(){return{a:Cf}}function Gc(){var l=zc();function f(v,w){return Pe=v.exports,S=Pe.xa,se(),It=Pe.Aa,me(Pe.ya),ve(),Pe}xt();function d(v){f(v.instance)}if(n.instantiateWasm)try{return n.instantiateWasm(l,f)}catch(v){M(`Module.instantiateWasm callback failed with error: ${v}`),i(v)}return Yt||(Yt=Et()),kc(I,Yt,l,d).catch(i),{}}var An=l=>{for(;l.length>0;)l.shift()(n)};function tt(l,f="i8"){switch(f.endsWith("*")&&(f="*"),f){case"i1":return F[l];case"i8":return F[l];case"i16":return z[l>>1];case"i32":return H[l>>2];case"i64":We("to do getValue(i64) use WASM_BIGINT");case"float":return U[l>>2];case"double":return X[l>>3];case"*":return V[l>>2];default:We(`invalid type for getValue: ${f}`)}}n.noExitRuntime;function Kt(l,f,d="i8"){switch(d.endsWith("*")&&(d="*"),d){case"i1":F[l]=f;break;case"i8":F[l]=f;break;case"i16":z[l>>1]=f;break;case"i32":H[l>>2]=f;break;case"i64":We("to do setValue(i64) use WASM_BIGINT");case"float":U[l>>2]=f;break;case"double":X[l>>3]=f;break;case"*":V[l>>2]=f;break;default:We(`invalid type for setValue: ${d}`)}}var ie=l=>Ti(l),ae=()=>Mi(),Js=[],qc=l=>{var f=new bn(l);return f.get_caught()||f.set_caught(!0),f.set_rethrown(!1),Js.push(f),wi(f.excPtr),f.get_exception_ptr()},wt=0,Hc=()=>{ne(0,0);var l=Js.pop();Ei(l.excPtr),wt=0};class bn{constructor(f){this.excPtr=f,this.ptr=f-24}set_type(f){V[this.ptr+4>>2]=f}get_type(){return V[this.ptr+4>>2]}set_destructor(f){V[this.ptr+8>>2]=f}get_destructor(){return V[this.ptr+8>>2]}set_caught(f){f=f?1:0,F[this.ptr+12]=f}get_caught(){return F[this.ptr+12]!=0}set_rethrown(f){f=f?1:0,F[this.ptr+13]=f}get_rethrown(){return F[this.ptr+13]!=0}init(f,d){this.set_adjusted_ptr(0),this.set_type(f),this.set_destructor(d)}set_adjusted_ptr(f){V[this.ptr+16>>2]=f}get_adjusted_ptr(){return V[this.ptr+16>>2]}get_exception_ptr(){var f=_i(this.get_type());if(f)return V[this.excPtr>>2];var d=this.get_adjusted_ptr();return d!==0?d:this.excPtr}}var Wc=l=>{throw wt||(wt=l),wt},kr=l=>xi(l),Zs=l=>{var f=wt;if(!f)return kr(0),0;var d=new bn(f);d.set_adjusted_ptr(f);var v=d.get_type();if(!v)return kr(0),f;for(var w of l){if(w===0||w===v)break;var b=d.ptr+16;if(Ri(w,v,b))return kr(w),f}return kr(v),f},Xc=()=>Zs([]),Yc=l=>Zs([l]),Kc=(l,f,d)=>{var v=new bn(l);throw v.init(f,d),wt=l,wt},Jc=()=>{We("")},zr={},Sn=l=>{for(;l.length;){var f=l.pop(),d=l.pop();d(f)}};function hr(l){return this.fromWireType(V[l>>2])}var Jt={},Rt={},Gr={},Qs,qr=l=>{throw new Qs(l)},_t=(l,f,d)=>{l.forEach(function(C){Gr[C]=f});function v(C){var D=d(C);D.length!==l.length&&qr("Mismatched type converter count");for(var B=0;B{Rt.hasOwnProperty(C)?w[D]=Rt[C]:(b.push(C),Jt.hasOwnProperty(C)||(Jt[C]=[]),Jt[C].push(()=>{w[D]=Rt[C],++N,N===b.length&&v(w)}))}),b.length===0&&v(w)},Zc=l=>{var f=zr[l];delete zr[l];var d=f.rawConstructor,v=f.rawDestructor,w=f.fields,b=w.map(N=>N.getterReturnType).concat(w.map(N=>N.setterArgumentType));_t([l],b,N=>{var C={};return w.forEach((D,B)=>{var G=D.fieldName,K=N[B],re=D.getter,ye=D.getterContext,pe=N[B+w.length],Ue=D.setter,Xe=D.setterContext;C[G]={read:A=>K.fromWireType(re(ye,A)),write:(A,O)=>{var P=[];Ue(Xe,A,pe.toWireType(P,O)),Sn(P)}}}),[{name:f.name,fromWireType:D=>{var B={};for(var G in C)B[G]=C[G].read(D);return v(D),B},toWireType:(D,B)=>{for(var G in C)if(!(G in B))throw new TypeError(`Missing field: "${G}"`);var K=d();for(G in C)C[G].write(K,B[G]);return D!==null&&D.push(v,K),K},argPackAdvance:ct,readValueFromPointer:hr,destructorFunction:v}]})},Qc=(l,f,d,v,w)=>{},el=()=>{for(var l=new Array(256),f=0;f<256;++f)l[f]=String.fromCharCode(f);ei=l},ei,De=l=>{for(var f="",d=l;$[d];)f+=ei[$[d++]];return f},Zt,ce=l=>{throw new Zt(l)};function tl(l,f,d={}){var v=f.name;if(l||ce(`type "${v}" must have a positive integer typeid pointer`),Rt.hasOwnProperty(l)){if(d.ignoreDuplicateRegistrations)return;ce(`Cannot register type '${v}' twice`)}if(Rt[l]=f,delete Gr[l],Jt.hasOwnProperty(l)){var w=Jt[l];delete Jt[l],w.forEach(b=>b())}}function ot(l,f,d={}){if(!("argPackAdvance"in f))throw new TypeError("registerType registeredInstance requires argPackAdvance");return tl(l,f,d)}var ct=8,rl=(l,f,d,v)=>{f=De(f),ot(l,{name:f,fromWireType:function(w){return!!w},toWireType:function(w,b){return b?d:v},argPackAdvance:ct,readValueFromPointer:function(w){return this.fromWireType($[w])},destructorFunction:null})},nl=l=>({count:l.count,deleteScheduled:l.deleteScheduled,preservePointerOnDelete:l.preservePointerOnDelete,ptr:l.ptr,ptrType:l.ptrType,smartPtr:l.smartPtr,smartPtrType:l.smartPtrType}),Cn=l=>{function f(d){return d.$$.ptrType.registeredClass.name}ce(f(l)+" instance already deleted")},Nn=!1,ti=l=>{},sl=l=>{l.smartPtr?l.smartPtrType.rawDestructor(l.smartPtr):l.ptrType.registeredClass.rawDestructor(l.ptr)},ri=l=>{l.count.value-=1;var f=l.count.value===0;f&&sl(l)},ni=(l,f,d)=>{if(f===d)return l;if(d.baseClass===void 0)return null;var v=ni(l,f,d.baseClass);return v===null?null:d.downcast(v)},si={},il=()=>Object.keys(gr).length,al=()=>{var l=[];for(var f in gr)gr.hasOwnProperty(f)&&l.push(gr[f]);return l},pr=[],On=()=>{for(;pr.length;){var l=pr.pop();l.$$.deleteScheduled=!1,l.delete()}},dr,ol=l=>{dr=l,pr.length&&dr&&dr(On)},cl=()=>{n.getInheritedInstanceCount=il,n.getLiveInheritedInstances=al,n.flushPendingDeletes=On,n.setDelayFunction=ol},gr={},ll=(l,f)=>{for(f===void 0&&ce("ptr should not be undefined");l.baseClass;)f=l.upcast(f),l=l.baseClass;return f},fl=(l,f)=>(f=ll(l,f),gr[f]),Hr=(l,f)=>{(!f.ptrType||!f.ptr)&&qr("makeClassHandle requires ptr and ptrType");var d=!!f.smartPtrType,v=!!f.smartPtr;return d!==v&&qr("Both smartPtrType and smartPtr must be specified"),f.count={value:1},mr(Object.create(l,{$$:{value:f,writable:!0}}))};function ul(l){var f=this.getPointee(l);if(!f)return this.destructor(l),null;var d=fl(this.registeredClass,f);if(d!==void 0){if(d.$$.count.value===0)return d.$$.ptr=f,d.$$.smartPtr=l,d.clone();var v=d.clone();return this.destructor(l),v}function w(){return this.isSmartPointer?Hr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:f,smartPtrType:this,smartPtr:l}):Hr(this.registeredClass.instancePrototype,{ptrType:this,ptr:l})}var b=this.registeredClass.getActualType(f),N=si[b];if(!N)return w.call(this);var C;this.isConst?C=N.constPointerType:C=N.pointerType;var D=ni(f,this.registeredClass,C.registeredClass);return D===null?w.call(this):this.isSmartPointer?Hr(C.registeredClass.instancePrototype,{ptrType:C,ptr:D,smartPtrType:this,smartPtr:l}):Hr(C.registeredClass.instancePrototype,{ptrType:C,ptr:D})}var mr=l=>typeof FinalizationRegistry>"u"?(mr=f=>f,l):(Nn=new FinalizationRegistry(f=>{ri(f.$$)}),mr=f=>{var d=f.$$,v=!!d.smartPtr;if(v){var w={$$:d};Nn.register(f,w,f)}return f},ti=f=>Nn.unregister(f),mr(l)),hl=()=>{Object.assign(Wr.prototype,{isAliasOf(l){if(!(this instanceof Wr)||!(l instanceof Wr))return!1;var f=this.$$.ptrType.registeredClass,d=this.$$.ptr;l.$$=l.$$;for(var v=l.$$.ptrType.registeredClass,w=l.$$.ptr;f.baseClass;)d=f.upcast(d),f=f.baseClass;for(;v.baseClass;)w=v.upcast(w),v=v.baseClass;return f===v&&d===w},clone(){if(this.$$.ptr||Cn(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var l=mr(Object.create(Object.getPrototypeOf(this),{$$:{value:nl(this.$$)}}));return l.$$.count.value+=1,l.$$.deleteScheduled=!1,l},delete(){this.$$.ptr||Cn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ce("Object already scheduled for deletion"),ti(this),ri(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Cn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ce("Object already scheduled for deletion"),pr.push(this),pr.length===1&&dr&&dr(On),this.$$.deleteScheduled=!0,this}})};function Wr(){}var Qt=(l,f)=>Object.defineProperty(f,"name",{value:l}),ii=(l,f,d)=>{if(l[f].overloadTable===void 0){var v=l[f];l[f]=function(...w){return l[f].overloadTable.hasOwnProperty(w.length)||ce(`Function '${d}' called with an invalid number of arguments (${w.length}) - expects one of (${l[f].overloadTable})!`),l[f].overloadTable[w.length].apply(this,w)},l[f].overloadTable=[],l[f].overloadTable[v.argCount]=v}},$n=(l,f,d)=>{n.hasOwnProperty(l)?((d===void 0||n[l].overloadTable!==void 0&&n[l].overloadTable[d]!==void 0)&&ce(`Cannot register public name '${l}' twice`),ii(n,l,l),n.hasOwnProperty(d)&&ce(`Cannot register multiple overloads of a function with the same number of arguments (${d})!`),n[l].overloadTable[d]=f):(n[l]=f,d!==void 0&&(n[l].numArguments=d))},pl=48,dl=57,gl=l=>{if(l===void 0)return"_unknown";l=l.replace(/[^a-zA-Z0-9_]/g,"$");var f=l.charCodeAt(0);return f>=pl&&f<=dl?`_${l}`:l};function ml(l,f,d,v,w,b,N,C){this.name=l,this.constructor=f,this.instancePrototype=d,this.rawDestructor=v,this.baseClass=w,this.getActualType=b,this.upcast=N,this.downcast=C,this.pureVirtualFunctions=[]}var Fn=(l,f,d)=>{for(;f!==d;)f.upcast||ce(`Expected null or instance of ${d.name}, got an instance of ${f.name}`),l=f.upcast(l),f=f.baseClass;return l};function vl(l,f){if(f===null)return this.isReference&&ce(`null is not a valid ${this.name}`),0;f.$$||ce(`Cannot pass "${Bn(f)}" as a ${this.name}`),f.$$.ptr||ce(`Cannot pass deleted object as a pointer of type ${this.name}`);var d=f.$$.ptrType.registeredClass,v=Fn(f.$$.ptr,d,this.registeredClass);return v}function yl(l,f){var d;if(f===null)return this.isReference&&ce(`null is not a valid ${this.name}`),this.isSmartPointer?(d=this.rawConstructor(),l!==null&&l.push(this.rawDestructor,d),d):0;(!f||!f.$$)&&ce(`Cannot pass "${Bn(f)}" as a ${this.name}`),f.$$.ptr||ce(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&f.$$.ptrType.isConst&&ce(`Cannot convert argument of type ${f.$$.smartPtrType?f.$$.smartPtrType.name:f.$$.ptrType.name} to parameter type ${this.name}`);var v=f.$$.ptrType.registeredClass;if(d=Fn(f.$$.ptr,v,this.registeredClass),this.isSmartPointer)switch(f.$$.smartPtr===void 0&&ce("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:f.$$.smartPtrType===this?d=f.$$.smartPtr:ce(`Cannot convert argument of type ${f.$$.smartPtrType?f.$$.smartPtrType.name:f.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:d=f.$$.smartPtr;break;case 2:if(f.$$.smartPtrType===this)d=f.$$.smartPtr;else{var w=f.clone();d=this.rawShare(d,$e.toHandle(()=>w.delete())),l!==null&&l.push(this.rawDestructor,d)}break;default:ce("Unsupporting sharing policy")}return d}function xl(l,f){if(f===null)return this.isReference&&ce(`null is not a valid ${this.name}`),0;f.$$||ce(`Cannot pass "${Bn(f)}" as a ${this.name}`),f.$$.ptr||ce(`Cannot pass deleted object as a pointer of type ${this.name}`),f.$$.ptrType.isConst&&ce(`Cannot convert argument of type ${f.$$.ptrType.name} to parameter type ${this.name}`);var d=f.$$.ptrType.registeredClass,v=Fn(f.$$.ptr,d,this.registeredClass);return v}var Tl=()=>{Object.assign(Xr.prototype,{getPointee(l){return this.rawGetPointee&&(l=this.rawGetPointee(l)),l},destructor(l){this.rawDestructor?.(l)},argPackAdvance:ct,readValueFromPointer:hr,fromWireType:ul})};function Xr(l,f,d,v,w,b,N,C,D,B,G){this.name=l,this.registeredClass=f,this.isReference=d,this.isConst=v,this.isSmartPointer=w,this.pointeeType=b,this.sharingPolicy=N,this.rawGetPointee=C,this.rawConstructor=D,this.rawShare=B,this.rawDestructor=G,!w&&f.baseClass===void 0?v?(this.toWireType=vl,this.destructorFunction=null):(this.toWireType=xl,this.destructorFunction=null):this.toWireType=yl}var ai=(l,f,d)=>{n.hasOwnProperty(l)||qr("Replacing nonexistent public symbol"),n[l].overloadTable!==void 0&&d!==void 0?n[l].overloadTable[d]=f:(n[l]=f,n[l].argCount=d)},Ml=(l,f,d)=>{l=l.replace(/p/g,"i");var v=n["dynCall_"+l];return v(f,...d)},vr=[],It,te=l=>{var f=vr[l];return f||(l>=vr.length&&(vr.length=l+1),vr[l]=f=It.get(l)),f},El=(l,f,d=[])=>{if(l.includes("j"))return Ml(l,f,d);var v=te(f)(...d);return v},wl=(l,f)=>(...d)=>El(l,f,d),rt=(l,f)=>{l=De(l);function d(){return l.includes("j")?wl(l,f):te(f)}var v=d();return typeof v!="function"&&ce(`unknown function pointer with signature ${l}: ${f}`),v},Rl=(l,f)=>{var d=Qt(f,function(v){this.name=f,this.message=v;var w=new Error(v).stack;w!==void 0&&(this.stack=this.toString()+` +`+w.replace(/^Error(:[^\n]*)?\n/,""))});return d.prototype=Object.create(l.prototype),d.prototype.constructor=d,d.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},d},oi,ci=l=>{var f=yi(l),d=De(f);return dt(f),d},Yr=(l,f)=>{var d=[],v={};function w(b){if(!v[b]&&!Rt[b]){if(Gr[b]){Gr[b].forEach(w);return}d.push(b),v[b]=!0}}throw f.forEach(w),new oi(`${l}: `+d.map(ci).join([", "]))},_l=(l,f,d,v,w,b,N,C,D,B,G,K,re)=>{G=De(G),b=rt(w,b),C&&=rt(N,C),B&&=rt(D,B),re=rt(K,re);var ye=gl(G);$n(ye,function(){Yr(`Cannot construct ${G} due to unbound types`,[v])}),_t([l,f,d],v?[v]:[],pe=>{pe=pe[0];var Ue,Xe;v?(Ue=pe.registeredClass,Xe=Ue.instancePrototype):Xe=Wr.prototype;var A=Qt(G,function(..._e){if(Object.getPrototypeOf(this)!==O)throw new Zt("Use 'new' to construct "+G);if(P.constructor_body===void 0)throw new Zt(G+" has no accessible constructor");var Ye=P.constructor_body[_e.length];if(Ye===void 0)throw new Zt(`Tried to invoke ctor of ${G} with invalid number of parameters (${_e.length}) - expected (${Object.keys(P.constructor_body).toString()}) parameters instead!`);return Ye.apply(this,_e)}),O=Object.create(Xe,{constructor:{value:A}});A.prototype=O;var P=new ml(G,A,O,re,Ue,b,C,B);P.baseClass&&(P.baseClass.__derivedClasses??=[],P.baseClass.__derivedClasses.push(P));var k=new Xr(G,P,!0,!1,!1),J=new Xr(G+"*",P,!1,!1,!1),Ee=new Xr(G+" const*",P,!1,!0,!1);return si[l]={pointerType:J,constPointerType:Ee},ai(ye,A),[k,J,Ee]})},Dn=(l,f)=>{for(var d=[],v=0;v>2]);return d};function li(l){for(var f=1;f0?", ":"")+C),B+=(d||v?"var rv = ":"")+"invoker(fn"+(C.length>0?", ":"")+C+`); +`,w)B+=`runDestructors(destructors); +`;else for(var D=f?1:2;D{var N=Dn(f,d);w=rt(v,w),_t([],[l],C=>{C=C[0];var D=`constructor ${C.name}`;if(C.registeredClass.constructor_body===void 0&&(C.registeredClass.constructor_body=[]),C.registeredClass.constructor_body[f-1]!==void 0)throw new Zt(`Cannot register multiple constructors with identical number of parameters (${f-1}) for class '${C.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return C.registeredClass.constructor_body[f-1]=()=>{Yr(`Cannot construct ${C.name} due to unbound types`,N)},_t([],N,B=>(B.splice(1,0,null),C.registeredClass.constructor_body[f-1]=Pn(D,B,null,w,b),[])),[]})},ui=l=>{l=l.trim();const f=l.indexOf("(");return f!==-1?l.substr(0,f):l},bl=(l,f,d,v,w,b,N,C,D)=>{var B=Dn(d,v);f=De(f),f=ui(f),b=rt(w,b),_t([],[l],G=>{G=G[0];var K=`${G.name}.${f}`;f.startsWith("@@")&&(f=Symbol[f.substring(2)]),C&&G.registeredClass.pureVirtualFunctions.push(f);function re(){Yr(`Cannot call ${K} due to unbound types`,B)}var ye=G.registeredClass.instancePrototype,pe=ye[f];return pe===void 0||pe.overloadTable===void 0&&pe.className!==G.name&&pe.argCount===d-2?(re.argCount=d-2,re.className=G.name,ye[f]=re):(ii(ye,f,K),ye[f].overloadTable[d-2]=re),_t([],B,Ue=>{var Xe=Pn(K,Ue,G,b,N,D);return ye[f].overloadTable===void 0?(Xe.argCount=d-2,ye[f]=Xe):ye[f].overloadTable[d-2]=Xe,[]}),[]})},Un=[],pt=[],Ln=l=>{l>9&&--pt[l+1]===0&&(pt[l]=void 0,Un.push(l))},Sl=()=>pt.length/2-5-Un.length,Cl=()=>{pt.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=Sl},$e={toValue:l=>(l||ce("Cannot use deleted val. handle = "+l),pt[l]),toHandle:l=>{switch(l){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const f=Un.pop()||pt.length;return pt[f]=l,pt[f+1]=1,f}}}},Nl={name:"emscripten::val",fromWireType:l=>{var f=$e.toValue(l);return Ln(l),f},toWireType:(l,f)=>$e.toHandle(f),argPackAdvance:ct,readValueFromPointer:hr,destructorFunction:null},hi=l=>ot(l,Nl),Ol=(l,f,d)=>{switch(f){case 1:return d?function(v){return this.fromWireType(F[v])}:function(v){return this.fromWireType($[v])};case 2:return d?function(v){return this.fromWireType(z[v>>1])}:function(v){return this.fromWireType(j[v>>1])};case 4:return d?function(v){return this.fromWireType(H[v>>2])}:function(v){return this.fromWireType(V[v>>2])};default:throw new TypeError(`invalid integer width (${f}): ${l}`)}},$l=(l,f,d,v)=>{f=De(f);function w(){}w.values={},ot(l,{name:f,constructor:w,fromWireType:function(b){return this.constructor.values[b]},toWireType:(b,N)=>N.value,argPackAdvance:ct,readValueFromPointer:Ol(f,d,v),destructorFunction:null}),$n(f,w)},Kr=(l,f)=>{var d=Rt[l];return d===void 0&&ce(`${f} has unknown type ${ci(l)}`),d},Fl=(l,f,d)=>{var v=Kr(l,"enum");f=De(f);var w=v.constructor,b=Object.create(v.constructor.prototype,{value:{value:d},constructor:{value:Qt(`${v.name}_${f}`,function(){})}});w.values[d]=b,w[f]=b},Bn=l=>{if(l===null)return"null";var f=typeof l;return f==="object"||f==="array"||f==="function"?l.toString():""+l},Dl=(l,f)=>{switch(f){case 4:return function(d){return this.fromWireType(U[d>>2])};case 8:return function(d){return this.fromWireType(X[d>>3])};default:throw new TypeError(`invalid float width (${f}): ${l}`)}},Pl=(l,f,d)=>{f=De(f),ot(l,{name:f,fromWireType:v=>v,toWireType:(v,w)=>w,argPackAdvance:ct,readValueFromPointer:Dl(f,d),destructorFunction:null})},Ul=(l,f,d,v,w,b,N)=>{var C=Dn(f,d);l=De(l),l=ui(l),w=rt(v,w),$n(l,function(){Yr(`Cannot call ${l} due to unbound types`,C)},f-1),_t([],C,D=>{var B=[D[0],null].concat(D.slice(1));return ai(l,Pn(l,B,null,w,b,N),f-1),[]})},Ll=(l,f,d)=>{switch(f){case 1:return d?v=>F[v]:v=>$[v];case 2:return d?v=>z[v>>1]:v=>j[v>>1];case 4:return d?v=>H[v>>2]:v=>V[v>>2];default:throw new TypeError(`invalid integer width (${f}): ${l}`)}},Bl=(l,f,d,v,w)=>{f=De(f);var b=G=>G;if(v===0){var N=32-8*d;b=G=>G<>>N}var C=f.includes("unsigned"),D=(G,K)=>{},B;C?B=function(G,K){return D(K,this.name),K>>>0}:B=function(G,K){return D(K,this.name),K},ot(l,{name:f,fromWireType:b,toWireType:B,argPackAdvance:ct,readValueFromPointer:Ll(f,d,v!==0),destructorFunction:null})},Vl=(l,f,d)=>{var v=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],w=v[f];function b(N){var C=V[N>>2],D=V[N+4>>2];return new w(F.buffer,D,C)}d=De(d),ot(l,{name:d,fromWireType:b,argPackAdvance:ct,readValueFromPointer:b},{ignoreDuplicateRegistrations:!0})},jl=(l,f)=>{hi(l)},kl=(l,f,d,v)=>{if(!(v>0))return 0;for(var w=d,b=d+v-1,N=0;N=55296&&C<=57343){var D=l.charCodeAt(++N);C=65536+((C&1023)<<10)|D&1023}if(C<=127){if(d>=b)break;f[d++]=C}else if(C<=2047){if(d+1>=b)break;f[d++]=192|C>>6,f[d++]=128|C&63}else if(C<=65535){if(d+2>=b)break;f[d++]=224|C>>12,f[d++]=128|C>>6&63,f[d++]=128|C&63}else{if(d+3>=b)break;f[d++]=240|C>>18,f[d++]=128|C>>12&63,f[d++]=128|C>>6&63,f[d++]=128|C&63}}return f[d]=0,d-w},zl=(l,f,d)=>kl(l,$,f,d),Gl=l=>{for(var f=0,d=0;d=55296&&v<=57343?(f+=4,++d):f+=3}return f},pi=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,ql=(l,f,d)=>{for(var v=f+d,w=f;l[w]&&!(w>=v);)++w;if(w-f>16&&l.buffer&&pi)return pi.decode(l.subarray(f,w));for(var b="";f>10,56320|B&1023)}}return b},Hl=(l,f)=>l?ql($,l,f):"",Wl=(l,f)=>{f=De(f);var d=f==="std::string";ot(l,{name:f,fromWireType(v){var w=V[v>>2],b=v+4,N;if(d)for(var C=b,D=0;D<=w;++D){var B=b+D;if(D==w||$[B]==0){var G=B-C,K=Hl(C,G);N===void 0?N=K:(N+=String.fromCharCode(0),N+=K),C=B+1}}else{for(var re=new Array(w),D=0;D>2]=b,d&&N)zl(w,D,b+1);else if(N)for(var B=0;B255&&(dt(D),ce("String has UTF-16 code units that do not fit in 8 bits")),$[D+B]=G}else for(var B=0;B{for(var d=l,v=d>>1,w=v+f/2;!(v>=w)&&j[v];)++v;if(d=v<<1,d-l>32&&di)return di.decode($.subarray(l,d));for(var b="",N=0;!(N>=f/2);++N){var C=z[l+N*2>>1];if(C==0)break;b+=String.fromCharCode(C)}return b},Yl=(l,f,d)=>{if(d??=2147483647,d<2)return 0;d-=2;for(var v=f,w=d>1]=N,f+=2}return z[f>>1]=0,f-v},Kl=l=>l.length*2,Jl=(l,f)=>{for(var d=0,v="";!(d>=f/4);){var w=H[l+d*4>>2];if(w==0)break;if(++d,w>=65536){var b=w-65536;v+=String.fromCharCode(55296|b>>10,56320|b&1023)}else v+=String.fromCharCode(w)}return v},Zl=(l,f,d)=>{if(d??=2147483647,d<4)return 0;for(var v=f,w=v+d-4,b=0;b=55296&&N<=57343){var C=l.charCodeAt(++b);N=65536+((N&1023)<<10)|C&1023}if(H[f>>2]=N,f+=4,f+4>w)break}return H[f>>2]=0,f-v},Ql=l=>{for(var f=0,d=0;d=55296&&v<=57343&&++d,f+=4}return f},ef=(l,f,d)=>{d=De(d);var v,w,b,N;f===2?(v=Xl,w=Yl,N=Kl,b=C=>j[C>>1]):f===4&&(v=Jl,w=Zl,N=Ql,b=C=>V[C>>2]),ot(l,{name:d,fromWireType:C=>{for(var D=V[C>>2],B,G=C+4,K=0;K<=D;++K){var re=C+4+K*f;if(K==D||b(re)==0){var ye=re-G,pe=v(G,ye);B===void 0?B=pe:(B+=String.fromCharCode(0),B+=pe),G=re+f}}return dt(C),B},toWireType:(C,D)=>{typeof D!="string"&&ce(`Cannot pass non-string to C++ string type ${d}`);var B=N(D),G=zn(4+B+f);return V[G>>2]=B/f,w(D,G+4,B+f),C!==null&&C.push(dt,G),G},argPackAdvance:ct,readValueFromPointer:hr,destructorFunction(C){dt(C)}})},tf=(l,f,d,v,w,b)=>{zr[l]={name:De(f),rawConstructor:rt(d,v),rawDestructor:rt(w,b),fields:[]}},rf=(l,f,d,v,w,b,N,C,D,B)=>{zr[l].fields.push({fieldName:De(f),getterReturnType:d,getter:rt(v,w),getterContext:b,setterArgumentType:N,setter:rt(C,D),setterContext:B})},nf=(l,f)=>{f=De(f),ot(l,{isVoid:!0,name:f,argPackAdvance:0,fromWireType:()=>{},toWireType:(d,v)=>{}})},sf=(l,f,d)=>$.copyWithin(l,f,f+d),gi=(l,f,d)=>{var v=[],w=l.toWireType(v,d);return v.length&&(V[f>>2]=$e.toHandle(v)),w},af=(l,f,d)=>(l=$e.toValue(l),f=Kr(f,"emval::as"),gi(f,d,l)),of={},mi=l=>{var f=of[l];return f===void 0?De(l):f},Vn=[],cf=(l,f,d,v,w)=>(l=Vn[l],f=$e.toValue(f),d=mi(d),l(f,f[d],v,w)),lf=(l,f)=>(l=$e.toValue(l),f=$e.toValue(f),l==f),ff=l=>{var f=Vn.length;return Vn.push(l),f},uf=(l,f)=>{for(var d=new Array(l),v=0;v>2],"parameter "+v);return d},hf=(l,f,d)=>{var v=uf(l,f),w=v.shift();l--;var b=`return function (obj, func, destructorsRef, args) { +`,N=0,C=[];d===0&&C.push("obj");for(var D=["retType"],B=[w],G=0;Gpe.name).join(", ")}) => ${w.name}>`;return ff(Qt(ye,re))},pf=(l,f)=>(l=$e.toValue(l),f=$e.toValue(f),$e.toHandle(l[f])),df=l=>{l>9&&(pt[l+1]+=1)},gf=l=>$e.toHandle(mi(l)),mf=()=>$e.toHandle({}),vf=l=>{var f=$e.toValue(l);Sn(f),Ln(l)},yf=(l,f,d)=>{l=$e.toValue(l),f=$e.toValue(f),d=$e.toValue(d),l[f]=d},xf=(l,f)=>{l=Kr(l,"_emval_take_value");var d=l.readValueFromPointer(f);return $e.toHandle(d)},Tf=()=>2147483648,Mf=l=>{var f=S.buffer,d=(l-f.byteLength+65535)/65536;try{return S.grow(d),se(),1}catch{}},Ef=l=>{var f=$.length;l>>>=0;var d=Tf();if(l>d)return!1;for(var v=(D,B)=>D+(B-D%B)%B,w=1;w<=4;w*=2){var b=f*(1+.2/w);b=Math.min(b,l+100663296);var N=Math.min(d,v(Math.max(l,b),65536)),C=Mf(N);if(C)return!0}return!1},wf=l=>l,vi=(l,f)=>{l<128?f.push(l):f.push(l%128|128,l>>7)},Rf=l=>{for(var f={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},d={parameters:[],results:l[0]=="v"?[]:[f[l[0]]]},v=1;v{var d=l.slice(0,1),v=l.slice(1),w={i:127,p:127,j:126,f:125,d:124,e:111};f.push(96),vi(v.length,f);for(var b=0;b{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Rf(f),l);var d=[1];_f(f,d);var v=[0,97,115,109,1,0,0,0,1];vi(d.length,v),v.push(...d),v.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var w=new WebAssembly.Module(new Uint8Array(v)),b=new WebAssembly.Instance(w,{e:{f:l}}),N=b.exports.f;return N},Af=(l,f)=>{if(At)for(var d=l;d(At||(At=new WeakMap,Af(0,It.length)),At.get(l)||0),jn=[],Sf=()=>{if(jn.length)return jn.pop();try{It.grow(1)}catch(l){throw l instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":l}return It.length-1},kn=(l,f)=>{It.set(l,f),vr[l]=It.get(l)},yr=(l,f)=>{var d=bf(l);if(d)return d;var v=Sf();try{kn(v,l)}catch(b){if(!(b instanceof TypeError))throw b;var w=If(l,f);kn(v,w)}return At.set(l,v),v},xr=l=>{At.delete(te(l)),kn(l,null),jn.push(l)};Qs=n.InternalError=class extends Error{constructor(f){super(f),this.name="InternalError"}},el(),Zt=n.BindingError=class extends Error{constructor(f){super(f),this.name="BindingError"}},hl(),cl(),Tl(),oi=n.UnboundTypeError=Rl(Error,"UnboundTypeError"),Cl();var Cf={K:qc,aa:Hc,a:Xc,k:Yc,h:Kc,d:Wc,Z:Jc,oa:Zc,Y:Qc,la:rl,x:_l,w:Al,i:bl,ka:hi,N:$l,t:Fl,U:Pl,o:Ul,z:Bl,s:Vl,A:jl,T:Wl,M:ef,B:tf,pa:rf,na:nf,$:sf,ta:af,ia:cf,va:Ln,sa:lf,ma:hf,ua:pf,ra:df,F:gf,V:mf,W:vf,wa:yf,E:xf,_:Ef,y:Gf,H:au,fa:iu,J:Uf,u:Ff,I:tu,e:Pf,b:Of,m:$f,n:zf,D:Bf,X:hu,j:Hf,f:Df,ea:ou,ca:uu,g:Lf,r:Wf,ha:nu,ga:su,G:fu,O:cu,ja:qf,da:lu,c:Nf,L:ru,qa:jf,l:Vf,v:Zf,S:Kf,p:Xf,Q:Qf,P:eu,C:Yf,q:kf,R:Jf,ba:wf},Pe=Gc(),yi=l=>(yi=Pe.za)(l),dt=l=>(dt=Pe.Ba)(l),zn=l=>(zn=Pe.Ca)(l),ne=(l,f)=>(ne=Pe.Da)(l,f),xi=l=>(xi=Pe.Ea)(l),Ti=l=>(Ti=Pe.Fa)(l),Mi=()=>(Mi=Pe.Ga)(),Ei=l=>(Ei=Pe.Ha)(l),wi=l=>(wi=Pe.Ia)(l),Ri=(l,f,d)=>(Ri=Pe.Ja)(l,f,d),_i=l=>(_i=Pe.Ka)(l),Ii=n.dynCall_iiij=(l,f,d,v,w)=>(Ii=n.dynCall_iiij=Pe.La)(l,f,d,v,w);function Nf(l,f,d,v){var w=ae();try{te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function Of(l,f,d){var v=ae();try{return te(l)(f,d)}catch(w){if(ie(v),w!==w+0)throw w;ne(1,0)}}function $f(l,f,d,v){var w=ae();try{return te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function Ff(l,f,d,v,w,b){var N=ae();try{return te(l)(f,d,v,w,b)}catch(C){if(ie(N),C!==C+0)throw C;ne(1,0)}}function Df(l,f){var d=ae();try{te(l)(f)}catch(v){if(ie(d),v!==v+0)throw v;ne(1,0)}}function Pf(l,f){var d=ae();try{return te(l)(f)}catch(v){if(ie(d),v!==v+0)throw v;ne(1,0)}}function Uf(l,f,d,v){var w=ae();try{return te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function Lf(l,f,d){var v=ae();try{te(l)(f,d)}catch(w){if(ie(v),w!==w+0)throw w;ne(1,0)}}function Bf(l,f,d,v,w,b){var N=ae();try{return te(l)(f,d,v,w,b)}catch(C){if(ie(N),C!==C+0)throw C;ne(1,0)}}function Vf(l,f,d,v,w){var b=ae();try{te(l)(f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}function jf(l,f,d,v,w,b,N,C){var D=ae();try{te(l)(f,d,v,w,b,N,C)}catch(B){if(ie(D),B!==B+0)throw B;ne(1,0)}}function kf(l,f,d,v,w,b,N,C,D,B,G){var K=ae();try{te(l)(f,d,v,w,b,N,C,D,B,G)}catch(re){if(ie(K),re!==re+0)throw re;ne(1,0)}}function zf(l,f,d,v,w){var b=ae();try{return te(l)(f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}function Gf(l,f){var d=ae();try{return te(l)(f)}catch(v){if(ie(d),v!==v+0)throw v;ne(1,0)}}function qf(l,f,d,v,w,b,N){var C=ae();try{te(l)(f,d,v,w,b,N)}catch(D){if(ie(C),D!==D+0)throw D;ne(1,0)}}function Hf(l){var f=ae();try{te(l)()}catch(d){if(ie(f),d!==d+0)throw d;ne(1,0)}}function Wf(l,f,d,v){var w=ae();try{te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function Xf(l,f,d,v,w,b,N){var C=ae();try{te(l)(f,d,v,w,b,N)}catch(D){if(ie(C),D!==D+0)throw D;ne(1,0)}}function Yf(l,f,d,v,w,b,N,C,D,B,G,K,re,ye){var pe=ae();try{te(l)(f,d,v,w,b,N,C,D,B,G,K,re,ye)}catch(Ue){if(ie(pe),Ue!==Ue+0)throw Ue;ne(1,0)}}function Kf(l,f,d,v,w,b,N){var C=ae();try{te(l)(f,d,v,w,b,N)}catch(D){if(ie(C),D!==D+0)throw D;ne(1,0)}}function Jf(l,f,d,v,w,b,N,C,D,B,G,K,re,ye,pe,Ue,Xe,A,O){var P=ae();try{te(l)(f,d,v,w,b,N,C,D,B,G,K,re,ye,pe,Ue,Xe,A,O)}catch(k){if(ie(P),k!==k+0)throw k;ne(1,0)}}function Zf(l,f,d,v,w,b){var N=ae();try{te(l)(f,d,v,w,b)}catch(C){if(ie(N),C!==C+0)throw C;ne(1,0)}}function Qf(l,f,d,v,w,b,N,C){var D=ae();try{te(l)(f,d,v,w,b,N,C)}catch(B){if(ie(D),B!==B+0)throw B;ne(1,0)}}function eu(l,f,d,v,w,b,N,C,D,B){var G=ae();try{te(l)(f,d,v,w,b,N,C,D,B)}catch(K){if(ie(G),K!==K+0)throw K;ne(1,0)}}function tu(l){var f=ae();try{return te(l)()}catch(d){if(ie(f),d!==d+0)throw d;ne(1,0)}}function ru(l,f,d,v,w){var b=ae();try{te(l)(f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}function nu(l,f,d,v,w){var b=ae();try{te(l)(f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}function su(l,f,d,v,w,b){var N=ae();try{te(l)(f,d,v,w,b)}catch(C){if(ie(N),C!==C+0)throw C;ne(1,0)}}function iu(l,f,d,v){var w=ae();try{return te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function au(l,f,d){var v=ae();try{return te(l)(f,d)}catch(w){if(ie(v),w!==w+0)throw w;ne(1,0)}}function ou(l,f,d){var v=ae();try{te(l)(f,d)}catch(w){if(ie(v),w!==w+0)throw w;ne(1,0)}}function cu(l,f,d,v,w){var b=ae();try{te(l)(f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}function lu(l,f,d,v,w,b,N,C,D){var B=ae();try{te(l)(f,d,v,w,b,N,C,D)}catch(G){if(ie(B),G!==G+0)throw G;ne(1,0)}}function fu(l,f,d,v,w,b){var N=ae();try{te(l)(f,d,v,w,b)}catch(C){if(ie(N),C!==C+0)throw C;ne(1,0)}}function uu(l,f,d,v){var w=ae();try{te(l)(f,d,v)}catch(b){if(ie(w),b!==b+0)throw b;ne(1,0)}}function hu(l,f,d,v,w){var b=ae();try{return Ii(l,f,d,v,w)}catch(N){if(ie(b),N!==N+0)throw N;ne(1,0)}}n.addFunction=yr,n.removeFunction=xr;var Jr;Ve=function l(){Jr||Ai(),Jr||(Ve=l)};function Ai(){if(Ne>0||(fe(),Ne>0))return;function l(){Jr||(Jr=!0,n.calledRun=!0,!L&&(ue(),s(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),de()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),l()},1)):l()}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Ai(),r=a,r}})();const ut="EXT_mesh_manifold",ra="MERGE";class Ws extends Se{static EXTENSION_NAME=ut;init(){Ws.EXTENSION_NAME=ut,this.propertyType="ManifoldPrimitive",this.parentTypes=[q.MESH]}getDefaults(){return Object.assign(super.getDefaults(),{manifoldPrimitive:null,mergeIndices:null,mergeValues:null})}getMergeIndices(){return this.getRef("mergeIndices")}getMergeValues(){return this.getRef("mergeValues")}setMerge(e,r){if(e.getCount()!==r.getCount())throw new Error("merge vectors must be the same length.");return this.setRef("mergeIndices",e),this.setRef("mergeValues",r)}getRunIndex(){return this.get("runIndex")}setRunIndex(e){return this.set("runIndex",e)}setIndices(e){return this.setRef("indices",e)}getIndices(){return this.getRef("indices")}}class Oc extends Te{extensionName=ut;prewriteTypes=[q.ACCESSOR];static EXTENSION_NAME=ut;createManifoldPrimitive(){return new Ws(this.document.getGraph())}read(e){const{json:r}=e.jsonDoc;return(r.meshes||[]).forEach((s,i)=>{if(!s.extensions||!s.extensions[ut])return;const a=e.meshes[i],o=this.createManifoldPrimitive();a.setExtension(ut,o);const c=s.extensions[ut];if(c.manifoldPrimitive){let u=0;const h=Array();h.push(u);for(const m of a.listPrimitives()){const y=m.getIndices();if(!y){console.log("Skipping non-indexed primitive ",m.getName());continue}u+=y.getCount(),h.push(u)}o.setRunIndex(h),o.setIndices(e.accessors[c.manifoldPrimitive.indices])}c.mergeIndices!=null&&c.mergeValues!=null&&o.setMerge(e.accessors[c.mergeIndices],e.accessors[c.mergeValues])}),this}prewrite(e){return this.document.getRoot().listMeshes().forEach(r=>{const n=r.getExtension(ut);if(!n)return;const s=n.getIndices();e.addAccessorToUsageGroup(s,st.BufferViewUsage.ELEMENT_ARRAY_BUFFER);const i=n.getMergeIndices(),a=n.getMergeValues();!i||!a||(e.addAccessorToUsageGroup(i,ra),e.addAccessorToUsageGroup(a,ra))}),this}write(e){const{json:r}=e.jsonDoc;return this.document.getRoot().listMeshes().forEach(n=>{const s=n.getExtension(ut);if(!s)return;const i=e.meshIndexMap.get(n),a=r.meshes[i],o=s.getRunIndex(),c=o.length-1;if(c!==a.primitives.length)throw new Error("The number of primitives must be exactly one less than the length of runIndex.");const u=e.accessorIndexMap.get(s.getMergeIndices()),h=e.accessorIndexMap.get(s.getMergeValues()),m=r.accessors[u],y=r.accessors[h],x=a.primitives[0],E={indices:e.accessorIndexMap.get(s.getIndices()),mode:x.mode,attributes:{POSITION:x.attributes.POSITION}},_=r.accessors[E.indices];if(_){m&&y&&(_.sparse={count:m.count,indices:{bufferView:m.bufferView,byteOffset:m.byteOffset,componentType:m.componentType},values:{bufferView:y.bufferView,byteOffset:y.byteOffset}});for(let p=0;p{if(j>=o.length)o.push(z);else{const H=wr[z].components,V=wr[o[j]].components;if(H!=V)throw new Error("Attribute sizes do not correspond: "+z+" and "+o[j]);wr[o[j]].type==null&&(o[j]=z)}})}else c.set(S,["POSITION"]);i.addPrimitive(S)}a.push(e.runIndex[u]);const m=e.numVert,y=e.numProp;let x=0;o.forEach((T,M)=>{const I=wr[T];if(I==null)throw new Error(T+" is not a recognized attribute.");if(I.type==null){++x;return}const S=I.components;if(x+S>y)throw new Error("Too many attribute channels.");const L=new Float32Array(S*m);for(let $=0;$M&&wr[z[M]].type!=null&&$.setAttribute(T,F)}x+=S});const E=s.createManifoldPrimitive();i.setExtension("EXT_mesh_manifold",E);const _=t.createAccessor("manifold indices").setBuffer(n).setType(Y.Type.SCALAR).setArray(e.triVerts);E.setIndices(_),E.setRunIndex(a);const p=[...Array(e.numVert).keys()],R=Array(),g=Array();if(e.mergeFromVert&&e.mergeToVert){for(const[T,M]of e.mergeFromVert.entries())p[M]=e.mergeToVert[T];for(const[T,M]of e.triVerts.entries()){const I=p[M];M!==I&&(R.push(T),g.push(I))}}if(R.length>0){const T=t.createAccessor("merge from").setBuffer(n).setType(Y.Type.SCALAR).setArray(new Uint32Array(R)),M=t.createAccessor("merge to").setBuffer(n).setType(Y.Type.SCALAR).setArray(new Uint32Array(g));E.setMerge(T,M)}return i}const et=await am();et.setup();To(Array);const $c=om(new Pu);$c.registerExtensions(co);const cm=["cube","cylinder","sphere","tetrahedron","extrude","revolve","compose","union","difference","intersection","levelSet","smooth","ofMesh","hull"],lm=["add","subtract","intersect","decompose","warp","transform","translate","rotate","scale","mirror","calculateCurvature","calculateNormals","smoothByNormals","smoothOut","refine","refineToLength","setProperties","asOriginal","trimByPlane","split","splitByPlane","slice","project","hull"],fm=["square","circle","union","difference","intersection","compose","ofPolygons","hull"],um=["add","subtract","intersect","rectClip","decompose","transform","translate","rotate","scale","mirror","simplify","offset","hull"],Fc=["show","only","setMaterial"],hm=["setMinCircularAngle","setMinCircularEdgeLength","setCircularSegments","getCircularSegments","resetToCircularDefaults","Mesh","GLTFNode","Manifold","CrossSection","setMorphStart","setMorphEnd"],pm=Fc.concat(hm),vn=new Array;function _n(t,e,r){const n=et[t],s=r?n:n.prototype;for(const i of e){const a=s[i];s[i]=function(...o){const c=a(...o);return vn.push(c),c}}}_n("Manifold",lm,!1);_n("Manifold",cm,!0);_n("CrossSection",um,!1);_n("CrossSection",fm,!0);for(const t of Fc){const e=et[t];et[t]=function(...r){const n=e(...r);return vn.push(n),n}}let Xs=!1;const yn=new Map,Ys=new Map,dm=30,Dc={roughness:.2,metallic:1,baseColorFactor:[1,1,0],alpha:1,unlit:!1,animationLength:1,animationMode:"loop"},gm={baseColorFactor:[1,0,0],alpha:.25,roughness:1,metallic:0},mm={baseColorFactor:[.5,.5,.5],alpha:.25,roughness:1,metallic:0},kt=new Array,xn=new Map,cn=new Map,qt=new Map,Wt=new Map;let Br=1,ar,Dr,Kn,ln,Tn;function vm(){for(const t of vn)if(t instanceof Array)for(const e of t)e.delete();else t.delete();vn.length=0,Xs=!1,yn.clear(),Ys.clear(),kt.length=0,xn.clear(),cn.clear(),qt.clear(),Wt.clear(),Br=1}class ym{_parent;manifold;translation;rotation;scale;material;name;constructor(e){this._parent=e,kt.push(this)}clone(e){const r={...this};return r._parent=e,kt.push(r),r}get parent(){return this._parent}}et.GLTFNode=ym;const Vt={...Dc};et.setMaterial=(t,e)=>{const r=t.asOriginal();return xn.set(r.originalID(),e),r};et.setMorphStart=(t,e)=>{const r=Wt.get(t);r!=null?r.start=e:Wt.set(t,{start:e})};et.setMorphEnd=(t,e)=>{const r=Wt.get(t);r!=null?r.end=e:Wt.set(t,{end:e})};function Pc(t,e){let r=t.asOriginal();return e.set(r.originalID(),r.getMesh()),r}et.show=t=>Pc(t,yn);et.only=t=>(Xs=!0,Pc(t,Ys));function sr(...t){typeof self<"u"&&self.console&&self.console.log(...t)}function Uc(t){const{quat:e}=Nc,r=Math.PI/180,n=e.create();return e.rotateZ(n,n,r*t[2]),e.rotateY(n,n,r*t[1]),e.rotateX(n,n,r*t[0]),n}function Jn(t,e,r,n){const s=r[e];if(s==null)return null;if(typeof s!="function")return s;const i=Dr.getCount(),a=e=="rotation"?4:3,o=new Float32Array(a*i);for(let m=0;m{if(s.end)for(let y=0;y3)for(let _=0;_{const n=r.clone();t.addChild(n)})}function Rm(t,e,r,n,s){Vc(e,r);const i=t.createMesh();e.setMesh(i),r.getMesh().listPrimitives().forEach(a=>{const o=a.clone();a.getMaterial()===s&&o.setMaterial(n),i.addPrimitive(o)})}function _m(t,e,r,n){const s=Em(t,r),{manifold:i}=r;if(i!=null){xm(t,s,i);const a=Lc(r),o=n.get(i);if(o==null){Bc(t,e,s,i,a);const c=new Map;c.set(a,s),n.set(i,c)}else{const c=o.get(a);if(c==null){const[u,h]=o.entries().next().value;Rm(t,s,h,Mn(t,a),Mn(t,u)),o.set(a,s)}else Vc(s,c)}}return qt.set(r,Br),e.components.push({id:`${Br++}`,name:r.name,children:i==null?[]:[{objectID:`${qt.get(i)}`}]}),s}async function jc(t,e){Object.assign(Vt,Dc),Object.assign(Vt,t);const r=new xs,n=Math.sqrt(2)/2,s=1/1e3,i=r.createNode("wrapper").setRotation([-n,0,0,n]).setScale([s,s,s]);r.createScene().addChild(i),ar=r.createAnimation(""),Tn=!1;const a=Math.round(Vt.animationLength*dm)+1,o=new Float32Array(a),c=new Float32Array(a);for(let R=0;R0){const R=new Map,g=new Map;let T=0;for(const M of kt)R.set(M,_m(r,u,M,g)),M.manifold&&++T;for(const M of kt){const I=R.get(M),S={objectID:`${qt.get(M)}`,transform:I.getMatrix()},{parent:L}=M;L==null?(i.addChild(I),u.items.push(S)):(R.get(L).addChild(I),u.components.find($=>$.id==`${qt.get(L)}`).children.push(S))}sr("Total glTF nodes: ",kt.length,", Total mesh references: ",T)}else{if(e==null){sr('No output because "result" is undefined and no "GLTFNode"s were created.');return}const R=r.createNode();Bc(r,u,R,e),i.addChild(R),u.items.push({objectID:`${qt.get(e)}`})}Tn||(Dr.dispose(),Kn.dispose(),ln.dispose(),ar.dispose());const h=await $c.writeBinary(r),m=new Blob([h],{type:"application/octet-stream"}),y=new $h;y.add3dModel("3D/3dmodel.model");const x=Oh(u),E={};E["3D/3dmodel.model"]=Fr(x),E[Yi.name]=Fr(Yi.content),E[y.name]=Fr(y.content);const _=Xh(E),p=new Blob([_],{type:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});return{glbURL:URL.createObjectURL(m),threeMFURL:URL.createObjectURL(p)}}function Im(t){const e={},r={globalDefaults:e,exportModels:jc,glMatrix:Nc,module:et,...Object.fromEntries(pm.map(i=>[i,et[i]]))},s=new Function(...Object.keys(r),`resetToCircularDefaults(); +`+t+` + return typeof result === "undefined" ? undefined : result;`)(...Object.values(r));return{globalDefaults:e,manifold:s}}async function Am(t){const{globalDefaults:e,manifold:r}=Im(t);return await jc(e,r)}self.postMessage(null);if(self.console){const t=self.console.log;self.console.log=function(...e){let r="";for(const n of e)n==null?r+="undefined":typeof n=="object"?r+=JSON.stringify(n,null,4):r+=n.toString();self.postMessage({log:r}),t(...e)}}self.onmessage=async t=>{try{const e=await Am(t.data);self.postMessage(e)}catch(e){console.log(e.toString()),self.postMessage({objectURL:null})}finally{vm()}}; +//# sourceMappingURL=worker-wrapper-09787a7f.js.map diff --git a/assets/worker-wrapper-09787a7f.js.map b/assets/worker-wrapper-09787a7f.js.map new file mode 100644 index 000000000..10207a183 --- /dev/null +++ b/assets/worker-wrapper-09787a7f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"worker-wrapper-09787a7f.js","sources":["../node_modules/property-graph/dist/property-graph.modern.js","../node_modules/@gltf-transform/core/dist/core.modern.js","../node_modules/ktx-parse/dist/ktx-parse.modern.js","../node_modules/@gltf-transform/extensions/dist/extensions.modern.js","../node_modules/@jscadui/3mf-export/src/defMatrix.js","../node_modules/@jscadui/3mf-export/src/matrix2str.js","../node_modules/@jscadui/3mf-export/src/makeItem.js","../node_modules/@jscadui/3mf-export/src/toDate3mf.js","../node_modules/@jscadui/3mf-export/src/pushHeader.js","../node_modules/@jscadui/3mf-export/src/pushObjectComponent.js","../node_modules/@jscadui/3mf-export/src/pushObjectMesh.js","../node_modules/@jscadui/3mf-export/src/staticFiles.js","../node_modules/@jscadui/3mf-export/index.js","../node_modules/fflate/esm/browser.js","../node_modules/gl-matrix/esm/common.js","../node_modules/gl-matrix/esm/mat2.js","../node_modules/gl-matrix/esm/mat2d.js","../node_modules/gl-matrix/esm/mat3.js","../node_modules/gl-matrix/esm/mat4.js","../node_modules/gl-matrix/esm/vec3.js","../node_modules/gl-matrix/esm/vec4.js","../node_modules/gl-matrix/esm/quat.js","../node_modules/gl-matrix/esm/quat2.js","../node_modules/gl-matrix/esm/vec2.js","../built/manifold.js","../manifold-gltf.ts","../gltf-io.ts","../worker.ts","../worker-wrapper.ts"],"sourcesContent":["class EventDispatcher {\n constructor() {\n this._listeners = {};\n }\n\n addEventListener(type, listener) {\n const listeners = this._listeners;\n\n if (listeners[type] === undefined) {\n listeners[type] = [];\n }\n\n if (listeners[type].indexOf(listener) === -1) {\n listeners[type].push(listener);\n }\n\n return this;\n }\n\n removeEventListener(type, listener) {\n if (this._listeners === undefined) return this;\n const listeners = this._listeners;\n const listenerArray = listeners[type];\n\n if (listenerArray !== undefined) {\n const index = listenerArray.indexOf(listener);\n\n if (index !== -1) {\n listenerArray.splice(index, 1);\n }\n }\n\n return this;\n }\n\n dispatchEvent(event) {\n if (this._listeners === undefined) return this;\n const listeners = this._listeners;\n const listenerArray = listeners[event.type];\n\n if (listenerArray !== undefined) {\n // Make a copy, in case listeners are removed while iterating.\n const array = listenerArray.slice(0);\n\n for (let i = 0, l = array.length; i < l; i++) {\n array[i].call(this, event);\n }\n }\n\n return this;\n }\n\n dispose() {\n for (const key in this._listeners) {\n delete this._listeners[key];\n }\n }\n\n}\n\n/**\n * Represents a connection between two {@link GraphNode} resources in a {@link Graph}.\n *\n * The left node is considered the owner, and the right node the resource. The\n * owner is responsible for being able find and remove a reference to a resource, given\n * that link. The resource does not hold a reference to the link or to the owner,\n * although that reverse lookup can be done on the graph.\n */\n\nclass GraphEdge extends EventDispatcher {\n constructor(_name, _parent, _child, _attributes = {}) {\n super();\n this._name = void 0;\n this._parent = void 0;\n this._child = void 0;\n this._attributes = void 0;\n this._disposed = false;\n this._name = _name;\n this._parent = _parent;\n this._child = _child;\n this._attributes = _attributes;\n\n if (!_parent.isOnGraph(_child)) {\n throw new Error('Cannot connect disconnected graphs.');\n }\n }\n /** Name. */\n\n\n getName() {\n return this._name;\n }\n /** Owner node. */\n\n\n getParent() {\n return this._parent;\n }\n /** Resource node. */\n\n\n getChild() {\n return this._child;\n }\n /**\n * Sets the child node.\n *\n * @internal Only {@link Graph} implementations may safely call this method directly. Use\n * \t{@link Property.swap} or {@link Graph.swapChild} instead.\n */\n\n\n setChild(child) {\n this._child = child;\n return this;\n }\n /** Attributes of the graph node relationship. */\n\n\n getAttributes() {\n return this._attributes;\n }\n /** Destroys a (currently intact) edge, updating both the graph and the owner. */\n\n\n dispose() {\n if (this._disposed) return;\n this._disposed = true;\n this.dispatchEvent({\n type: 'dispose',\n target: this\n });\n super.dispose();\n }\n /** Whether this link has been destroyed. */\n\n\n isDisposed() {\n return this._disposed;\n }\n\n}\n\n/**\n * A graph manages a network of {@link GraphNode} nodes, connected\n * by {@link @Link} edges.\n */\n\nclass Graph extends EventDispatcher {\n constructor(...args) {\n super(...args);\n this._emptySet = new Set();\n this._edges = new Set();\n this._parentEdges = new Map();\n this._childEdges = new Map();\n }\n\n /** Returns a list of all parent->child edges on this graph. */\n listEdges() {\n return Array.from(this._edges);\n }\n /** Returns a list of all edges on the graph having the given node as their child. */\n\n\n listParentEdges(node) {\n return Array.from(this._childEdges.get(node) || this._emptySet);\n }\n /** Returns a list of parent nodes for the given child node. */\n\n\n listParents(node) {\n return this.listParentEdges(node).map(edge => edge.getParent());\n }\n /** Returns a list of all edges on the graph having the given node as their parent. */\n\n\n listChildEdges(node) {\n return Array.from(this._parentEdges.get(node) || this._emptySet);\n }\n /** Returns a list of child nodes for the given parent node. */\n\n\n listChildren(node) {\n return this.listChildEdges(node).map(edge => edge.getChild());\n }\n\n disconnectParents(node, filter) {\n let edges = this.listParentEdges(node);\n\n if (filter) {\n edges = edges.filter(edge => filter(edge.getParent()));\n }\n\n edges.forEach(edge => edge.dispose());\n return this;\n }\n /**\n * Creates a {@link GraphEdge} connecting two {@link GraphNode} instances. Edge is returned\n * for the caller to store.\n * @param a Owner\n * @param b Resource\n */\n\n\n createEdge(name, a, b, attributes) {\n return this._registerEdge(new GraphEdge(name, a, b, attributes));\n }\n /**********************************************************************************************\n * Internal.\n */\n\n /** @hidden */\n\n\n _registerEdge(edge) {\n this._edges.add(edge);\n\n const parent = edge.getParent();\n if (!this._parentEdges.has(parent)) this._parentEdges.set(parent, new Set());\n\n this._parentEdges.get(parent).add(edge);\n\n const child = edge.getChild();\n if (!this._childEdges.has(child)) this._childEdges.set(child, new Set());\n\n this._childEdges.get(child).add(edge);\n\n edge.addEventListener('dispose', () => this._removeEdge(edge));\n return edge;\n }\n /**\n * Removes the {@link GraphEdge} from the {@link Graph}. This method should only\n * be invoked by the onDispose() listener created in {@link _registerEdge()}. The\n * public method of removing an edge is {@link GraphEdge.dispose}.\n */\n\n\n _removeEdge(edge) {\n this._edges.delete(edge);\n\n this._parentEdges.get(edge.getParent()).delete(edge);\n\n this._childEdges.get(edge.getChild()).delete(edge);\n\n return this;\n }\n\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction isRef(value) {\n return value instanceof GraphEdge;\n}\nfunction isRefList(value) {\n return Array.isArray(value) && value[0] instanceof GraphEdge;\n}\nfunction isRefMap(value) {\n return !!(isPlainObject(value) && getFirstValue(value) instanceof GraphEdge);\n}\n\nfunction getFirstValue(value) {\n for (const key in value) {\n return value[key];\n }\n}\n\nfunction isPlainObject(value) {\n return Boolean(value) && Object.getPrototypeOf(value) === Object.prototype;\n}\n\nconst $attributes = Symbol('attributes');\nconst $immutableKeys = Symbol('immutableKeys');\n/**\n * Represents a node in a {@link Graph}.\n */\n\nclass GraphNode extends EventDispatcher {\n /**\n * Internal graph used to search and maintain references.\n * @hidden\n */\n\n /**\n * Attributes (literal values and GraphNode references) associated with this instance. For each\n * GraphNode reference, the attributes stores a {@link GraphEdge}. List and Map references are\n * stored as arrays and dictionaries of edges.\n * @internal\n */\n\n /**\n * Attributes included with `getDefaultAttributes` are considered immutable, and cannot be\n * modifed by `.setRef()`, `.copy()`, or other GraphNode methods. Both the edges and the\n * properties will be disposed with the parent GraphNode.\n *\n * Currently, only single-edge references (getRef/setRef) are supported as immutables.\n *\n * @internal\n */\n constructor(graph) {\n super();\n this._disposed = false;\n this.graph = void 0;\n this[$attributes] = void 0;\n this[$immutableKeys] = void 0;\n this.graph = graph;\n this[$immutableKeys] = new Set();\n this[$attributes] = this._createAttributes();\n }\n /**\n * Returns default attributes for the graph node. Subclasses having any attributes (either\n * literal values or references to other graph nodes) must override this method. Literal\n * attributes should be given their default values, if any. References should generally be\n * initialized as empty (Ref → null, RefList → [], RefMap → {}) and then modified by setters.\n *\n * Any single-edge references (setRef) returned by this method will be considered immutable,\n * to be owned by and disposed with the parent node. Multi-edge references (addRef, removeRef,\n * setRefMap) cannot be returned as default attributes.\n */\n\n\n getDefaults() {\n return {};\n }\n /**\n * Constructs and returns an object used to store a graph nodes attributes. Compared to the\n * default Attributes interface, this has two distinctions:\n *\n * 1. Slots for GraphNode objects are replaced with slots for GraphEdge>\n * 2. GraphNode objects provided as defaults are considered immutable\n *\n * @internal\n */\n\n\n _createAttributes() {\n const defaultAttributes = this.getDefaults();\n const attributes = {};\n\n for (const key in defaultAttributes) {\n const value = defaultAttributes[key];\n\n if (value instanceof GraphNode) {\n const ref = this.graph.createEdge(key, this, value);\n ref.addEventListener('dispose', () => value.dispose());\n this[$immutableKeys].add(key);\n attributes[key] = ref;\n } else {\n attributes[key] = value;\n }\n }\n\n return attributes;\n }\n /** @internal Returns true if two nodes are on the same {@link Graph}. */\n\n\n isOnGraph(other) {\n return this.graph === other.graph;\n }\n /** Returns true if the node has been permanently removed from the graph. */\n\n\n isDisposed() {\n return this._disposed;\n }\n /**\n * Removes both inbound references to and outbound references from this object. At the end\n * of the process the object holds no references, and nothing holds references to it. A\n * disposed object is not reusable.\n */\n\n\n dispose() {\n if (this._disposed) return;\n this.graph.listChildEdges(this).forEach(edge => edge.dispose());\n this.graph.disconnectParents(this);\n this._disposed = true;\n this.dispatchEvent({\n type: 'dispose'\n });\n }\n /**\n * Removes all inbound references to this object. At the end of the process the object is\n * considered 'detached': it may hold references to child resources, but nothing holds\n * references to it. A detached object may be re-attached.\n */\n\n\n detach() {\n this.graph.disconnectParents(this);\n return this;\n }\n /**\n * Transfers this object's references from the old node to the new one. The old node is fully\n * detached from this parent at the end of the process.\n *\n * @hidden\n */\n\n\n swap(old, replacement) {\n for (const attribute in this[$attributes]) {\n const value = this[$attributes][attribute];\n\n if (isRef(value)) {\n const ref = value;\n\n if (ref.getChild() === old) {\n this.setRef(attribute, replacement, ref.getAttributes());\n }\n } else if (isRefList(value)) {\n const refs = value;\n const ref = refs.find(ref => ref.getChild() === old);\n\n if (ref) {\n const refAttributes = ref.getAttributes();\n this.removeRef(attribute, old).addRef(attribute, replacement, refAttributes);\n }\n } else if (isRefMap(value)) {\n const refMap = value;\n\n for (const key in refMap) {\n const ref = refMap[key];\n\n if (ref.getChild() === old) {\n this.setRefMap(attribute, key, replacement, ref.getAttributes());\n }\n }\n }\n }\n\n return this;\n }\n /**********************************************************************************************\n * Literal attributes.\n */\n\n /** @hidden */\n\n\n get(attribute) {\n return this[$attributes][attribute];\n }\n /** @hidden */\n\n\n set(attribute, value) {\n this[$attributes][attribute] = value;\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /**********************************************************************************************\n * Ref: 1:1 graph node references.\n */\n\n /** @hidden */\n\n\n getRef(attribute) {\n const ref = this[$attributes][attribute];\n return ref ? ref.getChild() : null;\n }\n /** @hidden */\n\n\n setRef(attribute, value, attributes) {\n if (this[$immutableKeys].has(attribute)) {\n throw new Error(`Cannot overwrite immutable attribute, \"${attribute}\".`);\n }\n\n const prevRef = this[$attributes][attribute];\n if (prevRef) prevRef.dispose(); // TODO(cleanup): Possible duplicate event.\n\n if (!value) return this;\n const ref = this.graph.createEdge(attribute, this, value, attributes);\n ref.addEventListener('dispose', () => {\n delete this[$attributes][attribute];\n this.dispatchEvent({\n type: 'change',\n attribute\n });\n });\n this[$attributes][attribute] = ref;\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /**********************************************************************************************\n * RefList: 1:many graph node references.\n */\n\n /** @hidden */\n\n\n listRefs(attribute) {\n const refs = this[$attributes][attribute];\n return refs.map(ref => ref.getChild());\n }\n /** @hidden */\n\n\n addRef(attribute, value, attributes) {\n const ref = this.graph.createEdge(attribute, this, value, attributes);\n const refs = this[$attributes][attribute];\n refs.push(ref);\n ref.addEventListener('dispose', () => {\n let index;\n\n while ((index = refs.indexOf(ref)) !== -1) {\n refs.splice(index, 1);\n }\n\n this.dispatchEvent({\n type: 'change',\n attribute\n });\n });\n return this.dispatchEvent({\n type: 'change',\n attribute\n });\n }\n /** @hidden */\n\n\n removeRef(attribute, value) {\n const refs = this[$attributes][attribute];\n const pruned = refs.filter(ref => ref.getChild() === value);\n pruned.forEach(ref => ref.dispose()); // TODO(cleanup): Possible duplicate event.\n\n return this;\n }\n /**********************************************************************************************\n * RefMap: Named 1:many (map) graph node references.\n */\n\n /** @hidden */\n\n\n listRefMapKeys(key) {\n return Object.keys(this[$attributes][key]);\n }\n /** @hidden */\n\n\n listRefMapValues(key) {\n return Object.values(this[$attributes][key]).map(ref => ref.getChild());\n }\n /** @hidden */\n\n\n getRefMap(attribute, key) {\n const refMap = this[$attributes][attribute];\n return refMap[key] ? refMap[key].getChild() : null;\n }\n /** @hidden */\n\n\n setRefMap(attribute, key, value, metadata) {\n const refMap = this[$attributes][attribute];\n const prevRef = refMap[key];\n if (prevRef) prevRef.dispose(); // TODO(cleanup): Possible duplicate event.\n\n if (!value) return this;\n metadata = Object.assign(metadata || {}, {\n key: key\n });\n const ref = this.graph.createEdge(attribute, this, value, _extends({}, metadata, {\n key\n }));\n ref.addEventListener('dispose', () => {\n delete refMap[key];\n this.dispatchEvent({\n type: 'change',\n attribute,\n key\n });\n });\n refMap[key] = ref;\n return this.dispatchEvent({\n type: 'change',\n attribute,\n key\n });\n }\n /**********************************************************************************************\n * Events.\n */\n\n /**\n * Dispatches an event on the GraphNode, and on the associated\n * Graph. Event types on the graph are prefixed, `\"node:[type]\"`.\n */\n\n\n dispatchEvent(event) {\n super.dispatchEvent(_extends({}, event, {\n target: this\n }));\n this.graph.dispatchEvent(_extends({}, event, {\n target: this,\n type: `node:${event.type}`\n }));\n return this;\n }\n\n}\n\nexport { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, isRef, isRefList, isRefMap };\n//# sourceMappingURL=property-graph.modern.js.map\n","import{GraphNode as t,$attributes as e,GraphEdge as r,$immutableKeys as s,isRefList as n,isRefMap as i,isRef as o,Graph as a}from\"property-graph\";export{Graph,GraphEdge}from\"property-graph\";const u=\"v3.8.0\",c=\"@glb.bin\";var h,f,l,d,g;!function(t){t.ACCESSOR=\"Accessor\",t.ANIMATION=\"Animation\",t.ANIMATION_CHANNEL=\"AnimationChannel\",t.ANIMATION_SAMPLER=\"AnimationSampler\",t.BUFFER=\"Buffer\",t.CAMERA=\"Camera\",t.MATERIAL=\"Material\",t.MESH=\"Mesh\",t.PRIMITIVE=\"Primitive\",t.PRIMITIVE_TARGET=\"PrimitiveTarget\",t.NODE=\"Node\",t.ROOT=\"Root\",t.SCENE=\"Scene\",t.SKIN=\"Skin\",t.TEXTURE=\"Texture\",t.TEXTURE_INFO=\"TextureInfo\"}(h||(h={})),function(t){t.INTERLEAVED=\"interleaved\",t.SEPARATE=\"separate\"}(f||(f={})),function(t){t.ARRAY_BUFFER=\"ARRAY_BUFFER\",t.ELEMENT_ARRAY_BUFFER=\"ELEMENT_ARRAY_BUFFER\",t.INVERSE_BIND_MATRICES=\"INVERSE_BIND_MATRICES\",t.OTHER=\"OTHER\",t.SPARSE=\"SPARSE\"}(l||(l={})),function(t){t[t.R=4096]=\"R\",t[t.G=256]=\"G\",t[t.B=16]=\"B\",t[t.A=1]=\"A\"}(d||(d={})),function(t){t.GLTF=\"GLTF\",t.GLB=\"GLB\"}(g||(g={}));const p={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var m,w=\"undefined\"!=typeof Float32Array?Float32Array:Array;function y(t){return Math.hypot(t[0],t[1],t[2])}function v(t,e,r){var s=e[0],n=e[1],i=e[2],o=r[3]*s+r[7]*n+r[11]*i+r[15];return t[0]=(r[0]*s+r[4]*n+r[8]*i+r[12])/(o=o||1),t[1]=(r[1]*s+r[5]*n+r[9]*i+r[13])/o,t[2]=(r[2]*s+r[6]*n+r[10]*i+r[14])/o,t}function T(t){const e={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]},r=t.propertyType===h.NODE?[t]:t.listChildren();for(const t of r)t.traverse(t=>{const r=t.getMesh();if(!r)return;const s=x(r,t.getWorldMatrix());A(s.min,e),A(s.max,e)});return e}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),m=new w(3),w!=Float32Array&&(m[0]=0,m[1]=0,m[2]=0);const b=T;function x(t,e){const r={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]};for(const s of t.listPrimitives()){const t=s.getAttribute(\"POSITION\");if(!t)continue;let n=[0,0,0],i=[0,0,0];for(let s=0;s=0;return Buffer.from(e,r?\"base64\":\"utf8\")}}static encodeText(t){return\"undefined\"!=typeof TextEncoder?(new TextEncoder).encode(t):Buffer.from(t)}static decodeText(t){return\"undefined\"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString(\"utf8\")}static concat(t){let e=0;for(const r of t)e+=r.byteLength;const r=new Uint8Array(e);let s=0;for(const e of t)r.set(e,s),s+=e.byteLength;return r}static pad(t,e=0){const r=this.padNumber(t.byteLength);if(r===t.byteLength)return t;const s=new Uint8Array(r);if(s.set(t),0!==e)for(let n=t.byteLength;n>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,this.convertSRGBToLinear(e,e)}static factorToHex(t){const e=[...t],[r,s,n]=this.convertLinearToSRGB(t,e);return 255*r<<16^255*s<<8^255*n<<0}static convertSRGBToLinear(t,e){const r=t,s=e;for(let t=0;t<3;t++)s[t]=r[t]<.04045?.0773993808*r[t]:Math.pow(.9478672986*r[t]+.0521327014,2.4);return e}static convertLinearToSRGB(t,e){const r=t,s=e;for(let t=0;t<3;t++)s[t]=r[t]<.0031308?12.92*r[t]:1.055*Math.pow(r[t],.41666)-.055;return e}}class M{match(t){return t.length>=8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}getSize(t){const e=new DataView(t.buffer,t.byteOffset);return E.decodeText(t.slice(12,16))===M.PNG_FRIED_CHUNK_NAME?[e.getUint32(32,!1),e.getUint32(36,!1)]:[e.getUint32(16,!1),e.getUint32(20,!1)]}getChannels(t){return 4}}M.PNG_FRIED_CHUNK_NAME=\"CgBI\";class I{static registerFormat(t,e){this.impls[t]=e}static getMimeType(t){for(const e in this.impls)if(this.impls[e].match(t))return e;return null}static getSize(t,e){return this.impls[e]?this.impls[e].getSize(t):null}static getChannels(t,e){return this.impls[e]?this.impls[e].getChannels(t):null}static getVRAMByteLength(t,e){if(!this.impls[e])return null;if(this.impls[e].getVRAMByteLength)return this.impls[e].getVRAMByteLength(t);let r=0;const s=this.getSize(t,e);if(!s)return null;for(;s[0]>1||s[1]>1;)r+=s[0]*s[1]*4,s[0]=Math.max(Math.floor(s[0]/2),1),s[1]=Math.max(Math.floor(s[1]/2),1);return r+=4,r}static mimeTypeToExtension(t){return\"image/jpeg\"===t?\"jpg\":t.split(\"/\").pop()}static extensionToMimeType(t){return\"jpg\"===t?\"image/jpeg\":t?`image/${t}`:\"\"}}function R(t,e){if(e>t.byteLength)throw new TypeError(\"Corrupt JPG, exceeded buffer limits\");if(255!==t.getUint8(e))throw new TypeError(\"Invalid JPG, marker table corrupted\");return t}I.impls={\"image/jpeg\":new class{match(t){return t.length>=3&&255===t[0]&&216===t[1]&&255===t[2]}getSize(t){let e,r,s=new DataView(t.buffer,t.byteOffset+4);for(;s.byteLength;){if(e=s.getUint16(0,!1),R(s,e),r=s.getUint8(e+1),192===r||193===r||194===r)return[s.getUint16(e+7,!1),s.getUint16(e+5,!1)];s=new DataView(t.buffer,s.byteOffset+e+2)}throw new TypeError(\"Invalid JPG, no size found\")}getChannels(t){return 3}},\"image/png\":new M};class N{static basename(t){const e=t.split(/[\\\\/]/).pop();return e.substring(0,e.lastIndexOf(\".\"))}static extension(t){if(t.startsWith(\"data:image/\")){const e=t.match(/data:(image\\/\\w+)/)[1];return I.mimeTypeToExtension(e)}return t.startsWith(\"data:model/gltf+json\")?\"gltf\":t.startsWith(\"data:model/gltf-binary\")?\"glb\":t.startsWith(\"data:application/\")?\"bin\":t.split(/[\\\\/]/).pop().split(/[.]/).pop()}}function O(t){return\"[object Object]\"===Object.prototype.toString.call(t)}function C(t){if(!1===O(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!1!==O(r)&&!1!==Object.prototype.hasOwnProperty.call(r,\"isPrototypeOf\")}var F,U;!function(t){t[t.SILENT=4]=\"SILENT\",t[t.ERROR=3]=\"ERROR\",t[t.WARN=2]=\"WARN\",t[t.INFO=1]=\"INFO\",t[t.DEBUG=0]=\"DEBUG\"}(U||(U={}));class B{constructor(t){this.verbosity=void 0,this.verbosity=t}debug(t){this.verbosity<=B.Verbosity.DEBUG&&console.debug(t)}info(t){this.verbosity<=B.Verbosity.INFO&&console.info(t)}warn(t){this.verbosity<=B.Verbosity.WARN&&console.warn(t)}error(t){this.verbosity<=B.Verbosity.ERROR&&console.error(t)}}function P(t,e,r){var s=e[0],n=e[1],i=e[2],o=e[3],a=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],g=e[11],p=e[12],m=e[13],w=e[14],y=e[15],v=r[0],T=r[1],b=r[2],x=r[3];return t[0]=v*s+T*a+b*f+x*p,t[1]=v*n+T*u+b*l+x*m,t[2]=v*i+T*c+b*d+x*w,t[3]=v*o+T*h+b*g+x*y,t[4]=(v=r[4])*s+(T=r[5])*a+(b=r[6])*f+(x=r[7])*p,t[5]=v*n+T*u+b*l+x*m,t[6]=v*i+T*c+b*d+x*w,t[7]=v*o+T*h+b*g+x*y,t[8]=(v=r[8])*s+(T=r[9])*a+(b=r[10])*f+(x=r[11])*p,t[9]=v*n+T*u+b*l+x*m,t[10]=v*i+T*c+b*d+x*w,t[11]=v*o+T*h+b*g+x*y,t[12]=(v=r[12])*s+(T=r[13])*a+(b=r[14])*f+(x=r[15])*p,t[13]=v*n+T*u+b*l+x*m,t[14]=v*i+T*c+b*d+x*w,t[15]=v*o+T*h+b*g+x*y,t}F=B,B.Verbosity=U,B.DEFAULT_INSTANCE=new F(F.Verbosity.INFO);class L{static identity(t){return t}static eq(t,e,r=1e-5){if(t.length!==e.length)return!1;for(let s=0;sr)return!1;return!0}static decodeNormalizedInt(t,e){switch(e){case 5126:return t;case 5123:return t/65535;case 5121:return t/255;case 5122:return Math.max(t/32767,-1);case 5120:return Math.max(t/127,-1);default:throw new Error(\"Invalid component type.\")}}static denormalize(t,e){return L.decodeNormalizedInt(t,e)}static encodeNormalizedInt(t,e){switch(e){case 5126:return t;case 5123:return Math.round(65535*t);case 5121:return Math.round(255*t);case 5122:return Math.round(32767*t);case 5120:return Math.round(127*t);default:throw new Error(\"Invalid component type.\")}}static normalize(t,e){return L.encodeNormalizedInt(t,e)}static decompose(t,e,r,s){let n=y([t[0],t[1],t[2]]);const i=y([t[4],t[5],t[6]]),o=y([t[8],t[9],t[10]]);var a,u,c,h,f,l,d,g,p,m,v,T,b,x,A,E,S;((u=(a=t)[0])*(d=a[5])-(c=a[1])*(l=a[4]))*((T=a[10])*(S=a[15])-(b=a[11])*(E=a[14]))-(u*(g=a[6])-(h=a[2])*l)*((v=a[9])*S-b*(A=a[13]))+(u*(p=a[7])-(f=a[3])*l)*(v*E-T*A)+(c*g-h*d)*((m=a[8])*S-b*(x=a[12]))-(c*p-f*d)*(m*E-T*x)+(h*p-f*g)*(m*A-v*x)<0&&(n=-n),e[0]=t[12],e[1]=t[13],e[2]=t[14];const M=t.slice(),I=1/n,R=1/i,N=1/o;M[0]*=I,M[1]*=I,M[2]*=I,M[4]*=R,M[5]*=R,M[6]*=R,M[8]*=N,M[9]*=N,M[10]*=N,function(t,e){var r=new w(3);!function(t,e){var r=e[4],s=e[5],n=e[6],i=e[8],o=e[9],a=e[10];t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,s,n),t[2]=Math.hypot(i,o,a)}(r,e);var s=1/r[0],n=1/r[1],i=1/r[2],o=e[0]*s,a=e[1]*n,u=e[2]*i,c=e[4]*s,h=e[5]*n,f=e[6]*i,l=e[8]*s,d=e[9]*n,g=e[10]*i,p=o+h+g,m=0;p>0?(m=2*Math.sqrt(p+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(l-u)/m,t[2]=(a-c)/m):o>h&&o>g?(m=2*Math.sqrt(1+o-h-g),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(a+c)/m,t[2]=(l+u)/m):h>g?(m=2*Math.sqrt(1+h-o-g),t[3]=(l-u)/m,t[0]=(a+c)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+g-o-h),t[3]=(a-c)/m,t[0]=(l+u)/m,t[1]=(f+d)/m,t[2]=.25*m)}(r,M),s[0]=n,s[1]=i,s[2]=o}static compose(t,e,r,s){const n=s,i=e[0],o=e[1],a=e[2],u=e[3],c=i+i,h=o+o,f=a+a,l=i*c,d=i*h,g=i*f,p=o*h,m=o*f,w=a*f,y=u*c,v=u*h,T=u*f,b=r[0],x=r[1],A=r[2];return n[0]=(1-(p+w))*b,n[1]=(d+T)*b,n[2]=(g-v)*b,n[3]=0,n[4]=(d-T)*x,n[5]=(1-(l+w))*x,n[6]=(m+y)*x,n[7]=0,n[8]=(g+v)*A,n[9]=(m-y)*A,n[10]=(1-(l+p))*A,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}}function j(t,e){if(!!t!=!!e)return!1;const r=t.getChild(),s=e.getChild();return r===s||r.equals(s)}function D(t,e){if(!!t!=!!e)return!1;if(t.length!==e.length)return!1;for(let r=0;rt,Y=new Set;class Z extends t{constructor(t,r=\"\"){super(t),this[e].name=r,this.init(),this.dispatchEvent({type:\"create\"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:\"\",extras:{}})}set(t,e){return Array.isArray(e)&&(e=e.slice()),super.set(t,e)}getName(){return this.get(\"name\")}setName(t){return this.set(\"name\",t)}getExtras(){return this.get(\"extras\")}setExtras(t){return this.set(\"extras\",t)}clone(){return new(0,this.constructor)(this.graph).copy(this,H)}copy(t,o=H){for(const t in this[e]){const o=this[e][t];if(o instanceof r)this[s].has(t)||o.dispose();else if(n(o))for(const t of o)t.dispose();else if(i(o))for(const t in o)o[t].dispose()}for(const a in t[e]){const u=this[e][a],c=t[e][a];if(c instanceof r)this[s].has(a)?u.getChild().copy(o(c.getChild()),o):this.setRef(a,o(c.getChild()),c.getAttributes());else if(n(c))for(const t of c)this.addRef(a,o(t.getChild()),t.getAttributes());else if(i(c))for(const t in c){const e=c[t];this.setRefMap(a,t,o(e.getChild()),e.getAttributes())}else this[e][a]=C(c)?JSON.parse(JSON.stringify(c)):Array.isArray(c)||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c.slice():c}return this}equals(t,r=Y){if(this===t)return!0;if(this.propertyType!==t.propertyType)return!1;for(const s in this[e]){if(r.has(s))continue;const a=this[e][s],u=t[e][s];if(o(a)||o(u)){if(!j(a,u))return!1}else if(n(a)||n(u)){if(!D(a,u))return!1}else if(i(a)||i(u)){if(!_(a,u))return!1}else if(C(a)||C(u)){if(!z(a,u))return!1}else if(G(a)||G(u)){if(!k(a,u))return!1}else if(a!==u)return!1}return!0}detach(){return this.graph.disconnectParents(this,t=>\"Root\"!==t.propertyType),this}listParents(){return this.graph.listParents(this)}}class K extends Z{getDefaults(){return Object.assign(super.getDefaults(),{extensions:{}})}getExtension(t){return this.getRefMap(\"extensions\",t)}setExtension(t,e){return e&&e.t(this),this.setRefMap(\"extensions\",t,e)}listExtensions(){return this.listRefMapValues(\"extensions\")}}class Q extends K{constructor(...t){super(...t),this.i=L.identity,this.o=L.identity}init(){this.propertyType=h.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:Q.Type.SCALAR,componentType:Q.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}copy(t,e=H){return super.copy(t,e),this.i=t.i,this.o=t.o,this}static getElementSize(t){switch(t){case Q.Type.SCALAR:return 1;case Q.Type.VEC2:return 2;case Q.Type.VEC3:return 3;case Q.Type.VEC4:case Q.Type.MAT2:return 4;case Q.Type.MAT3:return 9;case Q.Type.MAT4:return 16;default:throw new Error(\"Unexpected type: \"+t)}}static getComponentSize(t){switch(t){case Q.ComponentType.BYTE:case Q.ComponentType.UNSIGNED_BYTE:return 1;case Q.ComponentType.SHORT:case Q.ComponentType.UNSIGNED_SHORT:return 2;case Q.ComponentType.UNSIGNED_INT:case Q.ComponentType.FLOAT:return 4;default:throw new Error(\"Unexpected component type: \"+t)}}getMinNormalized(t){const e=this.getElementSize();this.getMin(t);for(let r=0;rL.decodeNormalizedInt(t,this.get(\"componentType\")),this.i=t=>L.encodeNormalizedInt(t,this.get(\"componentType\"))):(this.o=L.identity,this.i=L.identity),this}getScalar(t){const e=this.getElementSize();return this.o(this.get(\"array\")[t*e])}setScalar(t,e){return this.get(\"array\")[t*this.getElementSize()]=this.i(e),this}getElement(t,e){const r=this.getElementSize(),s=this.get(\"array\");for(let n=0;nt.u=null),this}removeChild(t){return this.removeRef(\"children\",t)}listChildren(){return this.listRefs(\"children\")}getParent(){return this.u?this.u:this.listParents().find(t=>t.propertyType===h.SCENE)||null}getParentNode(){return this.u}getMesh(){return this.getRef(\"mesh\")}setMesh(t){return this.setRef(\"mesh\",t)}getCamera(){return this.getRef(\"camera\")}setCamera(t){return this.setRef(\"camera\",t)}getSkin(){return this.getRef(\"skin\")}setSkin(t){return this.setRef(\"skin\",t)}getWeights(){return this.get(\"weights\")}setWeights(t){return this.set(\"weights\",t)}traverse(t){t(this);for(const e of this.listChildren())e.traverse(t);return this}}class dt extends K{init(){this.propertyType=h.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:dt.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef(\"indices\")}setIndices(t){return this.setRef(\"indices\",t,{usage:l.ELEMENT_ARRAY_BUFFER})}getAttribute(t){return this.getRefMap(\"attributes\",t)}setAttribute(t,e){return this.setRefMap(\"attributes\",t,e,{usage:l.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}getMaterial(){return this.getRef(\"material\")}setMaterial(t){return this.setRef(\"material\",t)}getMode(){return this.get(\"mode\")}setMode(t){return this.set(\"mode\",t)}listTargets(){return this.listRefs(\"targets\")}addTarget(t){return this.addRef(\"targets\",t)}removeTarget(t){return this.removeRef(\"targets\",t)}}dt.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class gt extends Z{init(){this.propertyType=h.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(t){return this.getRefMap(\"attributes\",t)}setAttribute(t,e){return this.setRefMap(\"attributes\",t,e,{usage:l.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}}function pt(){return pt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.h.delete(this)),this}removeChild(t){return this.removeRef(\"children\",t)}listChildren(){return this.listRefs(\"children\")}traverse(t){for(const e of this.listChildren())e.traverse(t);return this}}class wt extends K{init(){this.propertyType=h.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:[]})}getSkeleton(){return this.getRef(\"skeleton\")}setSkeleton(t){return this.setRef(\"skeleton\",t)}getInverseBindMatrices(){return this.getRef(\"inverseBindMatrices\")}setInverseBindMatrices(t){return this.setRef(\"inverseBindMatrices\",t,{usage:l.INVERSE_BIND_MATRICES})}addJoint(t){return this.addRef(\"joints\",t)}removeJoint(t){return this.removeRef(\"joints\",t)}listJoints(){return this.listRefs(\"joints\")}}class yt extends K{init(){this.propertyType=h.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:\"\",uri:\"\"})}getMimeType(){return this.get(\"mimeType\")||I.extensionToMimeType(N.extension(this.get(\"uri\")))}setMimeType(t){return this.set(\"mimeType\",t)}getURI(){return this.get(\"uri\")}setURI(t){this.set(\"uri\",t);const e=I.extensionToMimeType(N.extension(t));return e&&this.set(\"mimeType\",e),this}getImage(){return this.get(\"image\")}setImage(t){return this.set(\"image\",E.assertView(t))}getSize(){const t=this.get(\"image\");return t?I.getSize(t,this.getMimeType()):null}}class vt extends K{init(){this.propertyType=h.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${u}`,version:\"2.0\"},defaultScene:null,accessors:[],animations:[],buffers:[],cameras:[],materials:[],meshes:[],nodes:[],scenes:[],skins:[],textures:[]})}constructor(t){super(t),this.l=new Set,t.addEventListener(\"node:create\",t=>{this.g(t.target)})}clone(){throw new Error(\"Root cannot be cloned.\")}copy(t,e=H){if(e===H)throw new Error(\"Root cannot be copied.\");this.set(\"asset\",pt({},t.get(\"asset\"))),this.setName(t.getName()),this.setExtras(pt({},t.getExtras())),this.setDefaultScene(t.getDefaultScene()?e(t.getDefaultScene()):null);for(const r of t.listRefMapKeys(\"extensions\")){const s=t.getExtension(r);this.setExtension(r,e(s))}return this}g(t){return t instanceof mt?this.addRef(\"scenes\",t):t instanceof lt?this.addRef(\"nodes\",t):t instanceof st?this.addRef(\"cameras\",t):t instanceof wt?this.addRef(\"skins\",t):t instanceof ft?this.addRef(\"meshes\",t):t instanceof ht?this.addRef(\"materials\",t):t instanceof yt?this.addRef(\"textures\",t):t instanceof X?this.addRef(\"animations\",t):t instanceof Q?this.addRef(\"accessors\",t):t instanceof rt&&this.addRef(\"buffers\",t),this}getAsset(){return this.get(\"asset\")}listExtensionsUsed(){return Array.from(this.l)}listExtensionsRequired(){return this.listExtensionsUsed().filter(t=>t.isRequired())}p(t){return this.l.add(t),this}m(t){return this.l.delete(t),this}listScenes(){return this.listRefs(\"scenes\")}setDefaultScene(t){return this.setRef(\"defaultScene\",t)}getDefaultScene(){return this.getRef(\"defaultScene\")}listNodes(){return this.listRefs(\"nodes\")}listCameras(){return this.listRefs(\"cameras\")}listSkins(){return this.listRefs(\"skins\")}listMeshes(){return this.listRefs(\"meshes\")}listMaterials(){return this.listRefs(\"materials\")}listTextures(){return this.listRefs(\"textures\")}listAnimations(){return this.listRefs(\"animations\")}listAccessors(){return this.listRefs(\"accessors\")}listBuffers(){return this.listRefs(\"buffers\")}}class Tt{static fromGraph(t){return Tt.v.get(t)||null}constructor(){this.T=new a,this.S=new vt(this.T),this.M=B.DEFAULT_INSTANCE,Tt.v.set(this.T,this)}getRoot(){return this.S}getGraph(){return this.T}getLogger(){return this.M}setLogger(t){return this.M=t,this}clone(){return(new Tt).setLogger(this.M).merge(this)}merge(t){for(const e of t.getRoot().listExtensionsUsed()){const t=this.createExtension(e.constructor);e.isRequired()&&t.setRequired(!0)}const e=new Set,r=new Map;e.add(t.S),r.set(t.S,this.S);for(const s of t.T.listEdges())for(const t of[s.getParent(),s.getChild()]){if(e.has(t))continue;let s;s=t.propertyType===h.TEXTURE_INFO?t:new(0,t.constructor)(this.T),r.set(t,s),e.add(t)}const s=t=>{const e=r.get(t);if(!e)throw new Error(\"Could resolve property.\");return e};for(const t of e){const e=r.get(t);if(!e)throw new Error(\"Could resolve property.\");e.propertyType!==h.TEXTURE_INFO&&e.copy(t,s)}return this}async transform(...t){const e=t.map(t=>t.name);for(const r of t)await r(this,{stack:e});return this}createExtension(t){const e=t.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(t=>t.extensionName===e)||new t(this)}createScene(t=\"\"){return new mt(this.T,t)}createNode(t=\"\"){return new lt(this.T,t)}createCamera(t=\"\"){return new st(this.T,t)}createSkin(t=\"\"){return new wt(this.T,t)}createMesh(t=\"\"){return new ft(this.T,t)}createPrimitive(){return new dt(this.T)}createPrimitiveTarget(t=\"\"){return new gt(this.T,t)}createMaterial(t=\"\"){return new ht(this.T,t)}createTexture(t=\"\"){return new yt(this.T,t)}createAnimation(t=\"\"){return new X(this.T,t)}createAnimationChannel(t=\"\"){return new tt(this.T,t)}createAnimationSampler(t=\"\"){return new et(this.T,t)}createAccessor(t=\"\",e=null){return e||(e=this.getRoot().listBuffers()[0]),new Q(this.T,t).setBuffer(e)}createBuffer(t=\"\"){return new rt(this.T,t)}}Tt.v=new WeakMap;class bt{constructor(t){this.extensionName=\"\",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this.I=void 0,this.document=t,t.getRoot().p(this),this.I=t=>{const e=t,r=e.target;r instanceof nt&&r.extensionName===this.extensionName&&(\"node:create\"===e.type&&this.N(r),\"node:dispose\"===e.type&&this.O(r))};const e=t.getGraph();e.addEventListener(\"node:create\",this.I),e.addEventListener(\"node:dispose\",this.I)}dispose(){this.document.getRoot().m(this);const t=this.document.getGraph();t.removeEventListener(\"node:create\",this.I),t.removeEventListener(\"node:dispose\",this.I);for(const t of this.properties)t.dispose()}static register(){}isRequired(){return this.required}setRequired(t){return this.required=t,this}listProperties(){return Array.from(this.properties)}N(t){return this.properties.add(t),this}O(t){return this.properties.delete(t),this}install(t,e){return this}preread(t,e){return this}prewrite(t,e){return this}}bt.EXTENSION_NAME=void 0;class xt{constructor(t){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=t}setTextureInfo(t,e){this.textureInfos.set(t,e),void 0!==e.texCoord&&t.setTexCoord(e.texCoord),void 0!==e.extras&&t.setExtras(e.extras);const r=this.jsonDoc.json.textures[e.index];if(void 0===r.sampler)return;const s=this.jsonDoc.json.samplers[r.sampler];void 0!==s.magFilter&&t.setMagFilter(s.magFilter),void 0!==s.minFilter&&t.setMinFilter(s.minFilter),void 0!==s.wrapS&&t.setWrapS(s.wrapS),void 0!==s.wrapT&&t.setWrapT(s.wrapT)}}const At={logger:B.DEFAULT_INSTANCE,extensions:[],dependencies:{}};class Et{static read(t,e=At){const r=pt({},At,e),{json:s}=t,n=(new Tt).setLogger(r.logger);this.validate(t,r);const i=new xt(t),o=s.asset,a=n.getRoot().getAsset();o.copyright&&(a.copyright=o.copyright),o.extras&&(a.extras=o.extras),void 0!==s.extras&&n.getRoot().setExtras(pt({},s.extras));const u=s.extensionsUsed||[],f=s.extensionsRequired||[];for(const t of r.extensions)if(u.includes(t.EXTENSION_NAME)){const e=n.createExtension(t).setRequired(f.includes(t.EXTENSION_NAME));for(const t of e.readDependencies)e.install(t,r.dependencies[t])}const l=s.buffers||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.BUFFER)).forEach(t=>t.preread(i,h.BUFFER)),i.buffers=l.map(t=>{const e=n.createBuffer(t.name);return t.extras&&e.setExtras(t.extras),t.uri&&0!==t.uri.indexOf(\"__\")&&e.setURI(t.uri),e}),i.bufferViewBuffers=(s.bufferViews||[]).map((e,r)=>{if(!i.bufferViews[r]){const s=t.json.buffers[e.buffer];i.bufferViews[r]=E.toView(s.uri?t.resources[s.uri]:t.resources[c],e.byteOffset||0,e.byteLength)}return i.buffers[e.buffer]});const d=s.accessors||[];i.accessors=d.map(t=>{const e=n.createAccessor(t.name,i.bufferViewBuffers[t.bufferView]).setType(t.type);return t.extras&&e.setExtras(t.extras),void 0!==t.normalized&&e.setNormalized(t.normalized),void 0===t.bufferView||e.setArray(St(t,i)),e});const g=s.images||[],m=s.textures||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.TEXTURE)).forEach(t=>t.preread(i,h.TEXTURE)),i.textures=g.map(e=>{const r=n.createTexture(e.name);if(e.extras&&r.setExtras(e.extras),void 0!==e.bufferView){const n=s.bufferViews[e.bufferView],i=t.json.buffers[n.buffer],o=n.byteOffset||0,a=(i.uri?t.resources[i.uri]:t.resources[c]).slice(o,o+n.byteLength);r.setImage(a)}else void 0!==e.uri&&(r.setImage(t.resources[e.uri]),0!==e.uri.indexOf(\"__\")&&r.setURI(e.uri));if(void 0!==e.mimeType)r.setMimeType(e.mimeType);else if(e.uri){const t=N.extension(e.uri);r.setMimeType(I.extensionToMimeType(t))}return r}),i.materials=(s.materials||[]).map(t=>{const e=n.createMaterial(t.name);t.extras&&e.setExtras(t.extras),void 0!==t.alphaMode&&e.setAlphaMode(t.alphaMode),void 0!==t.alphaCutoff&&e.setAlphaCutoff(t.alphaCutoff),void 0!==t.doubleSided&&e.setDoubleSided(t.doubleSided);const r=t.pbrMetallicRoughness||{};if(void 0!==r.baseColorFactor&&e.setBaseColorFactor(r.baseColorFactor),void 0!==t.emissiveFactor&&e.setEmissiveFactor(t.emissiveFactor),void 0!==r.metallicFactor&&e.setMetallicFactor(r.metallicFactor),void 0!==r.roughnessFactor&&e.setRoughnessFactor(r.roughnessFactor),void 0!==r.baseColorTexture){const t=r.baseColorTexture;e.setBaseColorTexture(i.textures[m[t.index].source]),i.setTextureInfo(e.getBaseColorTextureInfo(),t)}if(void 0!==t.emissiveTexture){const r=t.emissiveTexture;e.setEmissiveTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getEmissiveTextureInfo(),r)}if(void 0!==t.normalTexture){const r=t.normalTexture;e.setNormalTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getNormalTextureInfo(),r),void 0!==t.normalTexture.scale&&e.setNormalScale(t.normalTexture.scale)}if(void 0!==t.occlusionTexture){const r=t.occlusionTexture;e.setOcclusionTexture(i.textures[m[r.index].source]),i.setTextureInfo(e.getOcclusionTextureInfo(),r),void 0!==t.occlusionTexture.strength&&e.setOcclusionStrength(t.occlusionTexture.strength)}if(void 0!==r.metallicRoughnessTexture){const t=r.metallicRoughnessTexture;e.setMetallicRoughnessTexture(i.textures[m[t.index].source]),i.setTextureInfo(e.getMetallicRoughnessTextureInfo(),t)}return e});const w=s.meshes||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.PRIMITIVE)).forEach(t=>t.preread(i,h.PRIMITIVE)),i.meshes=w.map(t=>{const e=n.createMesh(t.name);return t.extras&&e.setExtras(t.extras),void 0!==t.weights&&e.setWeights(t.weights),(t.primitives||[]).forEach(r=>{const s=n.createPrimitive();r.extras&&s.setExtras(r.extras),void 0!==r.material&&s.setMaterial(i.materials[r.material]),void 0!==r.mode&&s.setMode(r.mode);for(const[t,e]of Object.entries(r.attributes||{}))s.setAttribute(t,i.accessors[e]);void 0!==r.indices&&s.setIndices(i.accessors[r.indices]);const o=t.extras&&t.extras.targetNames||[];(r.targets||[]).forEach((t,e)=>{const r=o[e]||e.toString(),a=n.createPrimitiveTarget(r);for(const[e,r]of Object.entries(t))a.setAttribute(e,i.accessors[r]);s.addTarget(a)}),e.addPrimitive(s)}),e}),i.cameras=(s.cameras||[]).map(t=>{const e=n.createCamera(t.name).setType(t.type);if(t.extras&&e.setExtras(t.extras),t.type===st.Type.PERSPECTIVE){const r=t.perspective;e.setYFov(r.yfov),e.setZNear(r.znear),void 0!==r.zfar&&e.setZFar(r.zfar),void 0!==r.aspectRatio&&e.setAspectRatio(r.aspectRatio)}else{const r=t.orthographic;e.setZNear(r.znear).setZFar(r.zfar).setXMag(r.xmag).setYMag(r.ymag)}return e});const y=s.nodes||[];n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.NODE)).forEach(t=>t.preread(i,h.NODE)),i.nodes=y.map(t=>{const e=n.createNode(t.name);if(t.extras&&e.setExtras(t.extras),void 0!==t.translation&&e.setTranslation(t.translation),void 0!==t.rotation&&e.setRotation(t.rotation),void 0!==t.scale&&e.setScale(t.scale),void 0!==t.matrix){const r=[0,0,0],s=[0,0,0,1],n=[1,1,1];L.decompose(t.matrix,r,s,n),e.setTranslation(r),e.setRotation(s),e.setScale(n)}return void 0!==t.weights&&e.setWeights(t.weights),e}),i.skins=(s.skins||[]).map(t=>{const e=n.createSkin(t.name);t.extras&&e.setExtras(t.extras),void 0!==t.inverseBindMatrices&&e.setInverseBindMatrices(i.accessors[t.inverseBindMatrices]),void 0!==t.skeleton&&e.setSkeleton(i.nodes[t.skeleton]);for(const r of t.joints)e.addJoint(i.nodes[r]);return e}),y.map((t,e)=>{const r=i.nodes[e];(t.children||[]).forEach(t=>r.addChild(i.nodes[t])),void 0!==t.mesh&&r.setMesh(i.meshes[t.mesh]),void 0!==t.camera&&r.setCamera(i.cameras[t.camera]),void 0!==t.skin&&r.setSkin(i.skins[t.skin])}),i.animations=(s.animations||[]).map(t=>{const e=n.createAnimation(t.name);t.extras&&e.setExtras(t.extras);const r=(t.samplers||[]).map(t=>{const r=n.createAnimationSampler().setInput(i.accessors[t.input]).setOutput(i.accessors[t.output]).setInterpolation(t.interpolation||et.Interpolation.LINEAR);return t.extras&&r.setExtras(t.extras),e.addSampler(r),r});return(t.channels||[]).forEach(t=>{const s=n.createAnimationChannel().setSampler(r[t.sampler]).setTargetPath(t.target.path);void 0!==t.target.node&&s.setTargetNode(i.nodes[t.target.node]),t.extras&&s.setExtras(t.extras),e.addChannel(s)}),e});const v=s.scenes||[];return n.getRoot().listExtensionsUsed().filter(t=>t.prereadTypes.includes(h.SCENE)).forEach(t=>t.preread(i,h.SCENE)),i.scenes=v.map(t=>{const e=n.createScene(t.name);return t.extras&&e.setExtras(t.extras),(t.nodes||[]).map(t=>i.nodes[t]).forEach(t=>e.addChild(t)),e}),void 0!==s.scene&&n.getRoot().setDefaultScene(i.scenes[s.scene]),n.getRoot().listExtensionsUsed().forEach(t=>t.read(i)),d.forEach((t,e)=>{const r=i.accessors[e],s=!!t.sparse,n=!t.bufferView&&!r.getArray();(s||n)&&r.setSparse(!0).setArray(function(t,e){const r=p[t.componentType],s=Q.getElementSize(t.type);let n;n=void 0!==t.bufferView?St(t,e):new r(t.count*s);const i=t.sparse;if(!i)return n;const o=i.count,a=pt({},t,i.indices,{count:o,type:\"SCALAR\"}),u=pt({},t,i.values,{count:o}),c=St(a,e),h=St(u,e);for(let t=0;te.EXTENSION_NAME===t))throw new Error(`Missing required extension, \"${t}\".`);if(r.extensionsUsed)for(const t of r.extensionsUsed)e.extensions.find(e=>e.EXTENSION_NAME===t)||e.logger.warn(`Missing optional extension, \"${t}\".`)}}function St(t,e){const r=e.bufferViews[t.bufferView],s=e.jsonDoc.json.bufferViews[t.bufferView],n=p[t.componentType],i=Q.getElementSize(t.type),o=n.BYTES_PER_ELEMENT;if(void 0!==s.byteStride&&s.byteStride!==i*o)return function(t,e){const r=e.bufferViews[t.bufferView],s=e.jsonDoc.json.bufferViews[t.bufferView],n=p[t.componentType],i=Q.getElementSize(t.type),o=n.BYTES_PER_ELEMENT,a=t.byteOffset||0,u=new n(t.count*i),c=new DataView(r.buffer,r.byteOffset,r.byteLength),h=s.byteStride;for(let e=0;e1,()=>r.basename||\"buffer\"),this.imageURIGenerator=new Rt(i>1,e=>function(t,e){const r=t.getGraph().listParentEdges(e).find(e=>e.getParent()!==t.getRoot());return r?r.getName().replace(/texture$/i,\"\"):\"\"}(t,e)||r.basename||\"texture\"),this.logger=t.getLogger()}createTextureInfoDef(t,e){const r={magFilter:e.getMagFilter()||void 0,minFilter:e.getMinFilter()||void 0,wrapS:e.getWrapS(),wrapT:e.getWrapT()},s=JSON.stringify(r);this.samplerDefIndexMap.has(s)||(this.samplerDefIndexMap.set(s,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(r));const n={source:this.imageIndexMap.get(t),sampler:this.samplerDefIndexMap.get(s)},i=JSON.stringify(n);this.textureDefIndexMap.has(i)||(this.textureDefIndexMap.set(i,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(n));const o={index:this.textureDefIndexMap.get(i)};return 0!==e.getTexCoord()&&(o.texCoord=e.getTexCoord()),Object.keys(e.getExtras()).length>0&&(o.extras=e.getExtras()),this.textureInfoDefMap.set(e,o),o}createPropertyDef(t){const e={};return t.getName()&&(e.name=t.getName()),Object.keys(t.getExtras()).length>0&&(e.extras=t.getExtras()),e}createAccessorDef(t){const e=this.createPropertyDef(t);return e.type=t.getType(),e.componentType=t.getComponentType(),e.count=t.getCount(),this.C.getGraph().listParentEdges(t).some(t=>\"attributes\"===t.getName()&&\"POSITION\"===t.getAttributes().key||\"input\"===t.getName())&&(e.max=t.getMax([]).map(Math.fround),e.min=t.getMin([]).map(Math.fround)),t.getNormalized()&&(e.normalized=t.getNormalized()),e}createImageData(t,e,r){if(this.options.format===g.GLB)this.imageBufferViews.push(e),t.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:e.byteLength});else{const s=I.mimeTypeToExtension(r.getMimeType());t.uri=this.imageURIGenerator.createURI(r,s),this.jsonDoc.resources[t.uri]=e}}getAccessorUsage(t){const e=this.F.get(t);if(e)return e;if(t.getSparse())return l.SPARSE;for(const e of this.C.getGraph().listParentEdges(t)){const{usage:t}=e.getAttributes();if(t)return t;e.getParent().propertyType!==h.ROOT&&this.logger.warn(`Missing attribute \".usage\" on edge, \"${e.getName()}\".`)}return l.OTHER}addAccessorToUsageGroup(t,e){const r=this.F.get(t);if(r&&r!==e)throw new Error(`Accessor with usage \"${r}\" cannot be reused as \"${e}\".`);return this.F.set(t,e),this}listAccessorUsageGroups(){const t={};for(const[e,r]of Array.from(this.F.entries()))t[r]=t[r]||[],t[r].push(e);return t}}It.BufferViewTarget=Mt,It.BufferViewUsage=l,It.USAGE_TO_TARGET={[l.ARRAY_BUFFER]:Mt.ARRAY_BUFFER,[l.ELEMENT_ARRAY_BUFFER]:Mt.ELEMENT_ARRAY_BUFFER};class Rt{constructor(t,e){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=t,this.basename=e}createURI(t,e){if(t.getURI())return t.getURI();if(this.multiple){const r=this.basename(t);return this.counter[r]=this.counter[r]||1,`${r}_${this.counter[r]++}.${e}`}return`${this.basename(t)}.${e}`}}const{BufferViewUsage:Nt}=It,{UNSIGNED_INT:Ot,UNSIGNED_SHORT:Ct,UNSIGNED_BYTE:Ft}=Q.ComponentType;class Ut{static write(t,e){const r=t.getRoot(),s={asset:pt({generator:`glTF-Transform ${u}`},r.getAsset()),extras:pt({},r.getExtras())},n={json:s,resources:{}},i=new It(t,n,e),o=e.logger||B.DEFAULT_INSTANCE,a=new Set(e.extensions.map(t=>t.EXTENSION_NAME)),l=t.getRoot().listExtensionsUsed().filter(t=>a.has(t.extensionName)),d=t.getRoot().listExtensionsRequired().filter(t=>a.has(t.extensionName));l.lengthe.getCount()/3){const t=(100*r.length/e.getCount()).toFixed(1);o.warn(`Sparse accessor with many non-zero elements (${t}%) may increase file size.`)}const d=p[e.getComponentType()];l.indices=r,l.values=new d(n)}if(!Number.isFinite(c))return{buffers:n,byteLength:a};const h=c<255?Uint8Array:c<65535?Uint16Array:Uint32Array,f=c<255?Ft:c<65535?Ct:Ot,l={buffer:e,byteOffset:r+a,byteLength:0};for(const e of t){const t=u.get(e);if(0===t.count)continue;t.indicesByteOffset=l.byteLength;const r=E.pad(E.toView(new h(t.indices)));n.push(r),a+=r.byteLength,l.byteLength+=r.byteLength}s.bufferViews.push(l);const d=s.bufferViews.length-1,g={buffer:e,byteOffset:r+a,byteLength:0};for(const e of t){const t=u.get(e);if(0===t.count)continue;t.valuesByteOffset=g.byteLength;const r=E.pad(E.toView(t.values));n.push(r),a+=r.byteLength,g.byteLength+=r.byteLength}s.bufferViews.push(g);const m=s.bufferViews.length-1;for(const e of t){const t=u.get(e);0!==t.count&&(t.accessorDef.sparse={count:t.count,indices:{bufferView:d,byteOffset:t.indicesByteOffset,componentType:f},values:{bufferView:m,byteOffset:t.valuesByteOffset}})}return{buffers:n,byteLength:a}}const v=new Map;for(const e of t.getGraph().listEdges()){if(e.getParent()===r)continue;const t=e.getChild();if(t instanceof Q){const r=v.get(t)||[];r.push(e),v.set(t,r)}}if(s.accessors=[],s.bufferViews=[],s.samplers=[],s.textures=[],s.images=r.listTextures().map((t,e)=>{const r=i.createPropertyDef(t);t.getMimeType()&&(r.mimeType=t.getMimeType());const s=t.getImage();return s&&i.createImageData(r,s,t),i.imageIndexMap.set(t,e),r}),l.filter(t=>t.prewriteTypes.includes(h.ACCESSOR)).forEach(t=>t.prewrite(i,h.ACCESSOR)),r.listAccessors().forEach(t=>{const e=i.accessorUsageGroupedByParent,r=i.accessorParents;if(i.accessorIndexMap.has(t))return;const s=v.get(t)||[],n=i.getAccessorUsage(t);if(i.addAccessorToUsageGroup(t,n),e.has(n)){const e=s[0].getParent(),n=r.get(e)||new Set;n.add(t),r.set(e,n)}}),l.filter(t=>t.prewriteTypes.includes(h.BUFFER)).forEach(t=>t.prewrite(i,h.BUFFER)),(r.listAccessors().length>0||r.listTextures().length>0||i.otherBufferViews.size>0)&&0===r.listBuffers().length)throw new Error(\"Buffer required for Document resources, but none was found.\");s.buffers=[],r.listBuffers().forEach((t,r)=>{const o=i.createPropertyDef(t),a=i.accessorUsageGroupedByParent,u=i.accessorParents,h=t.listParents().filter(t=>t instanceof Q),l=new Set(h),d=[],p=s.buffers.length;let v=0;const T=i.listAccessorUsageGroups();for(const t in T)if(a.has(t))for(const r of Array.from(u.values())){const s=Array.from(r).filter(t=>l.has(t)).filter(e=>i.getAccessorUsage(e)===t);if(s.length)if(t!==Nt.ARRAY_BUFFER||e.vertexLayout===f.INTERLEAVED){const e=t===Nt.ARRAY_BUFFER?w(s,p,v):m(s,p,v);v+=e.byteLength,d.push(...e.buffers)}else for(const t of s){const e=w([t],p,v);v+=e.byteLength,d.push(...e.buffers)}}else{const e=T[t].filter(t=>l.has(t));if(!e.length)continue;const r=t===Nt.ELEMENT_ARRAY_BUFFER?It.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,s=t===Nt.SPARSE?y(e,p,v):m(e,p,v,r);v+=s.byteLength,d.push(...s.buffers)}if(i.imageBufferViews.length&&0===r)for(let t=0;t!t.getBuffer())&&o.warn(\"Skipped writing one or more Accessors: no Buffer assigned.\"),s.materials=r.listMaterials().map((t,e)=>{const r=i.createPropertyDef(t);if(t.getAlphaMode()!==ht.AlphaMode.OPAQUE&&(r.alphaMode=t.getAlphaMode()),t.getAlphaMode()===ht.AlphaMode.MASK&&(r.alphaCutoff=t.getAlphaCutoff()),t.getDoubleSided()&&(r.doubleSided=!0),r.pbrMetallicRoughness={},L.eq(t.getBaseColorFactor(),[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=t.getBaseColorFactor()),L.eq(t.getEmissiveFactor(),[0,0,0])||(r.emissiveFactor=t.getEmissiveFactor()),1!==t.getRoughnessFactor()&&(r.pbrMetallicRoughness.roughnessFactor=t.getRoughnessFactor()),1!==t.getMetallicFactor()&&(r.pbrMetallicRoughness.metallicFactor=t.getMetallicFactor()),t.getBaseColorTexture()){const e=t.getBaseColorTexture(),s=t.getBaseColorTextureInfo();r.pbrMetallicRoughness.baseColorTexture=i.createTextureInfoDef(e,s)}if(t.getEmissiveTexture()){const e=t.getEmissiveTexture(),s=t.getEmissiveTextureInfo();r.emissiveTexture=i.createTextureInfoDef(e,s)}if(t.getNormalTexture()){const e=t.getNormalTexture(),s=t.getNormalTextureInfo(),n=i.createTextureInfoDef(e,s);1!==t.getNormalScale()&&(n.scale=t.getNormalScale()),r.normalTexture=n}if(t.getOcclusionTexture()){const e=t.getOcclusionTexture(),s=t.getOcclusionTextureInfo(),n=i.createTextureInfoDef(e,s);1!==t.getOcclusionStrength()&&(n.strength=t.getOcclusionStrength()),r.occlusionTexture=n}if(t.getMetallicRoughnessTexture()){const e=t.getMetallicRoughnessTexture(),s=t.getMetallicRoughnessTextureInfo();r.pbrMetallicRoughness.metallicRoughnessTexture=i.createTextureInfoDef(e,s)}return i.materialIndexMap.set(t,e),r}),s.meshes=r.listMeshes().map((t,e)=>{const r=i.createPropertyDef(t);let s=null;return r.primitives=t.listPrimitives().map(t=>{const e={attributes:{}};e.mode=t.getMode();const r=t.getMaterial();r&&(e.material=i.materialIndexMap.get(r)),Object.keys(t.getExtras()).length&&(e.extras=t.getExtras());const n=t.getIndices();n&&(e.indices=i.accessorIndexMap.get(n));for(const r of t.listSemantics())e.attributes[r]=i.accessorIndexMap.get(t.getAttribute(r));for(const r of t.listTargets()){const t={};for(const e of r.listSemantics())t[e]=i.accessorIndexMap.get(r.getAttribute(e));e.targets=e.targets||[],e.targets.push(t)}return t.listTargets().length&&!s&&(s=t.listTargets().map(t=>t.getName())),e}),t.getWeights().length&&(r.weights=t.getWeights()),s&&(r.extras=r.extras||{},r.extras.targetNames=s),i.meshIndexMap.set(t,e),r}),s.cameras=r.listCameras().map((t,e)=>{const r=i.createPropertyDef(t);if(r.type=t.getType(),r.type===st.Type.PERSPECTIVE){r.perspective={znear:t.getZNear(),zfar:t.getZFar(),yfov:t.getYFov()};const e=t.getAspectRatio();null!==e&&(r.perspective.aspectRatio=e)}else r.orthographic={znear:t.getZNear(),zfar:t.getZFar(),xmag:t.getXMag(),ymag:t.getYMag()};return i.cameraIndexMap.set(t,e),r}),s.nodes=r.listNodes().map((t,e)=>{const r=i.createPropertyDef(t);return L.eq(t.getTranslation(),[0,0,0])||(r.translation=t.getTranslation()),L.eq(t.getRotation(),[0,0,0,1])||(r.rotation=t.getRotation()),L.eq(t.getScale(),[1,1,1])||(r.scale=t.getScale()),t.getWeights().length&&(r.weights=t.getWeights()),i.nodeIndexMap.set(t,e),r}),s.skins=r.listSkins().map((t,e)=>{const r=i.createPropertyDef(t),s=t.getInverseBindMatrices();s&&(r.inverseBindMatrices=i.accessorIndexMap.get(s));const n=t.getSkeleton();return n&&(r.skeleton=i.nodeIndexMap.get(n)),r.joints=t.listJoints().map(t=>i.nodeIndexMap.get(t)),i.skinIndexMap.set(t,e),r}),r.listNodes().forEach((t,e)=>{const r=s.nodes[e],n=t.getMesh();n&&(r.mesh=i.meshIndexMap.get(n));const o=t.getCamera();o&&(r.camera=i.cameraIndexMap.get(o));const a=t.getSkin();a&&(r.skin=i.skinIndexMap.get(a)),t.listChildren().length>0&&(r.children=t.listChildren().map(t=>i.nodeIndexMap.get(t)))}),s.animations=r.listAnimations().map((t,e)=>{const r=i.createPropertyDef(t),s=new Map;return r.samplers=t.listSamplers().map((t,e)=>{const r=i.createPropertyDef(t);return r.input=i.accessorIndexMap.get(t.getInput()),r.output=i.accessorIndexMap.get(t.getOutput()),r.interpolation=t.getInterpolation(),s.set(t,e),r}),r.channels=t.listChannels().map(t=>{const e=i.createPropertyDef(t);return e.sampler=s.get(t.getSampler()),e.target={node:i.nodeIndexMap.get(t.getTargetNode()),path:t.getTargetPath()},e}),i.animationIndexMap.set(t,e),r}),s.scenes=r.listScenes().map((t,e)=>{const r=i.createPropertyDef(t);return r.nodes=t.listChildren().map(t=>i.nodeIndexMap.get(t)),i.sceneIndexMap.set(t,e),r});const T=r.getDefaultScene();return T&&(s.scene=r.listScenes().indexOf(T)),s.extensionsUsed=l.map(t=>t.extensionName),s.extensionsRequired=d.map(t=>t.extensionName),l.forEach(t=>t.write(i)),function(t){const e=[];for(const r in t){const s=t[r];(Array.isArray(s)&&0===s.length||null===s||\"\"===s||s&&\"object\"==typeof s&&0===Object.keys(s).length)&&e.push(r)}for(const r of e)delete t[r]}(s),n}}var Bt;!function(t){t[t.JSON=1313821514]=\"JSON\",t[t.BIN=5130562]=\"BIN\"}(Bt||(Bt={}));class Pt{constructor(){this.M=B.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=f.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(t){return this.M=t,this}registerExtensions(t){for(const e of t)this.l.add(e),e.register();return this}registerDependencies(t){return Object.assign(this.U,t),this}setVertexLayout(t){return this.P=t,this}async read(t){return await this.readJSON(await this.readAsJSON(t))}async readAsJSON(t){const e=await this.readURI(t,\"view\");this.lastReadBytes=e.byteLength;const r=Lt(e)?this.L(e):{json:JSON.parse(E.decodeText(e)),resources:{}};return await this.j(r,this.dirname(t)),this.D(r),r}async readJSON(t){return t=this._(t),this.D(t),Et.read(t,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(t){const e=this.L(E.assertView(t));this.D(e);const r=e.json;if(r.buffers&&r.buffers.some(t=>function(t,e){return void 0!==e.uri&&!(e.uri in t.resources)}(e,t)))throw new Error(\"Cannot resolve external buffers with binaryToJSON().\");if(r.images&&r.images.some(t=>function(t,e){return void 0!==e.uri&&!(e.uri in t.resources)&&void 0===e.bufferView}(e,t)))throw new Error(\"Cannot resolve external images with binaryToJSON().\");return e}async readBinary(t){return this.readJSON(await this.binaryToJSON(E.assertView(t)))}async writeJSON(t,e={}){if(e.format===g.GLB&&t.getRoot().listBuffers().length>1)throw new Error(\"GLB must have 0–1 buffers.\");return Ut.write(t,{format:e.format||g.GLTF,basename:e.basename||\"\",logger:this.M,vertexLayout:this.P,dependencies:pt({},this.U),extensions:Array.from(this.l)})}async writeBinary(t){const{json:e,resources:r}=await this.writeJSON(t,{format:g.GLB}),s=new Uint32Array([1179937895,2,12]),n=JSON.stringify(e),i=E.pad(E.encodeText(n),32),o=E.toView(new Uint32Array([i.byteLength,1313821514])),a=E.concat([o,i]);s[s.length-1]+=a.byteLength;const u=Object.values(r)[0];if(!u||!u.byteLength)return E.concat([E.toView(s),a]);const c=E.pad(u,0),h=E.toView(new Uint32Array([c.byteLength,5130562])),f=E.concat([h,c]);return s[s.length-1]+=f.byteLength,E.concat([E.toView(s),a,f])}async j(t,e){var r=this;const s=[...t.json.images||[],...t.json.buffers||[]].map(async function(s){const n=s.uri;if(!n||n.match(/data:/))return Promise.resolve();t.resources[n]=await r.readURI(r.resolve(e,n),\"view\"),r.lastReadBytes+=t.resources[n].byteLength});await Promise.all(s)}D(t){function e(e){if(e.uri)if(e.uri in t.resources)E.assertView(t.resources[e.uri]);else if(e.uri.match(/data:/)){const r=`__${V()}.${N.extension(e.uri)}`;t.resources[r]=E.createBufferFromDataURI(e.uri),e.uri=r}}(t.json.images||[]).forEach(t=>{if(void 0===t.bufferView&&void 0===t.uri)throw new Error(\"Missing resource URI or buffer view.\");e(t)}),(t.json.buffers||[]).forEach(e)}_(t){const{images:e,buffers:r}=t.json;return t={json:pt({},t.json),resources:pt({},t.resources)},e&&(t.json.images=e.map(t=>pt({},t))),r&&(t.json.buffers=r.map(t=>pt({},t))),t}L(t){if(!Lt(t))throw new Error(\"Invalid glTF 2.0 binary.\");const e=new Uint32Array(t.buffer,t.byteOffset+12,2);if(e[1]!==Bt.JSON)throw new Error(\"Missing required GLB JSON chunk.\");const r=e[0],s=E.decodeText(E.toView(t,20,r)),n=JSON.parse(s),i=20+r;if(t.byteLength<=i)return{json:n,resources:{}};const o=new Uint32Array(t.buffer,t.byteOffset+i,2);if(o[1]!==Bt.BIN)throw new Error(\"Expected GLB BIN in second chunk.\");const a=E.toView(t,i+8,o[0]);return{json:n,resources:{[c]:a}}}}function Lt(t){if(t.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(t.buffer,t.byteOffset,3);return 1179937895===e[0]&&2===e[1]}class jt extends Pt{constructor(t=null,e=q.DEFAULT_INIT){super(),this.k=void 0,this.J=void 0,this.$=void 0,this.V=!1,this.k=t,this.J=e,this.$=this.init()}async init(){return this.$?this.$:Promise.all([import(\"fs\"),import(\"path\")]).then(([t,e])=>{this.W=t.promises,this.q=e})}setAllowHTTP(t){if(t&&!this.k)throw new Error(\"NodeIO requires a Fetch API implementation for HTTP requests.\");return this.V=t,this}async readURI(t,e){if(await this.init(),q.isAbsoluteURL(t)){if(!this.V||!this.k)throw new Error(\"Network request blocked. Allow HTTP requests explicitly, if needed.\");const r=await this.k(t,this.J);switch(e){case\"view\":return new Uint8Array(await r.arrayBuffer());case\"text\":return r.text()}}else switch(e){case\"view\":return this.W.readFile(t);case\"text\":return this.W.readFile(t,\"utf8\")}}resolve(t,e){return q.isAbsoluteURL(t)||q.isAbsoluteURL(e)?q.resolve(t,e):this.q.resolve(t,decodeURIComponent(e))}dirname(t){return q.isAbsoluteURL(t)?q.dirname(t):this.q.dirname(t)}async write(t,e){await this.init();const r=!!t.match(/\\.glb$/);await(r?this.H(t,e):this.Y(t,e))}async Y(t,e){var r=this;this.lastWriteBytes=0;const{json:s,resources:n}=await this.writeJSON(e,{format:g.GLTF,basename:N.basename(t)}),{W:i,q:o}=this,a=o.dirname(t),u=JSON.stringify(s,null,2);this.lastWriteBytes+=u.length,await i.writeFile(t,u);const c=Object.keys(n).map(async function(t){if(q.isAbsoluteURL(t)){if(\"bin\"===q.extension(t))throw new Error(`Cannot write buffer to path \"${t}\".`);return}const e=Buffer.from(n[t]),s=o.join(a,decodeURIComponent(t));await i.mkdir(o.dirname(s),{recursive:!0}),await i.writeFile(s,e),r.lastWriteBytes+=e.byteLength});await Promise.all(c)}async H(t,e){const r=Buffer.from(await this.writeBinary(e));await this.W.writeFile(t,r),this.lastWriteBytes=r.byteLength}}class Dt extends Pt{constructor(t){super(),this.q=void 0,this.q=t}async readURI(t,e){switch(e){case\"view\":return Deno.readFile(t);case\"text\":return Deno.readTextFile(t)}}resolve(t,e){return this.q.resolve(t,decodeURIComponent(e))}dirname(t){return this.q.dirname(t)}}class _t extends Pt{constructor(t=q.DEFAULT_INIT){super(),this.J=void 0,this.J=t}async readURI(t,e){const r=await fetch(t,this.J);switch(e){case\"view\":return new Uint8Array(await r.arrayBuffer());case\"text\":return r.text()}}resolve(t,e){return q.resolve(t,e)}dirname(t){return q.dirname(t)}}export{Q as Accessor,X as Animation,tt as AnimationChannel,et as AnimationSampler,rt as Buffer,E as BufferUtils,H as COPY_IDENTITY,st as Camera,S as ColorUtils,p as ComponentTypeToTypedArray,Dt as DenoIO,Tt as Document,K as ExtensibleProperty,bt as Extension,nt as ExtensionProperty,N as FileUtils,g as Format,c as GLB_BUFFER,q as HTTPUtils,I as ImageUtils,B as Logger,ht as Material,L as MathUtils,ft as Mesh,lt as Node,jt as NodeIO,Pt as PlatformIO,dt as Primitive,gt as PrimitiveTarget,Z as Property,h as PropertyType,xt as ReaderContext,vt as Root,mt as Scene,wt as Skin,yt as Texture,d as TextureChannel,it as TextureInfo,u as VERSION,U as Verbosity,f as VertexLayout,_t as WebIO,It as WriterContext,b as bounds,T as getBounds,V as uuid};\n//# sourceMappingURL=core.modern.js.map\n","///////////////////////////////////////////////////\n// KTX2 Header.\n///////////////////////////////////////////////////\nconst KHR_SUPERCOMPRESSION_NONE = 0;\nconst KHR_SUPERCOMPRESSION_BASISLZ = 1;\nconst KHR_SUPERCOMPRESSION_ZSTD = 2;\nconst KHR_SUPERCOMPRESSION_ZLIB = 3; ///////////////////////////////////////////////////\n// Data Format Descriptor (DFD).\n///////////////////////////////////////////////////\n\nconst KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT = 0;\nconst KHR_DF_VENDORID_KHRONOS = 0;\nconst KHR_DF_VERSION = 2;\nconst KHR_DF_MODEL_UNSPECIFIED = 0;\nconst KHR_DF_MODEL_RGBSDA = 1; // ...\n\nconst KHR_DF_MODEL_ETC1 = 160;\nconst KHR_DF_MODEL_ETC2 = 161;\nconst KHR_DF_MODEL_ASTC = 162;\nconst KHR_DF_MODEL_ETC1S = 163;\nconst KHR_DF_MODEL_UASTC = 166;\nconst KHR_DF_FLAG_ALPHA_STRAIGHT = 0;\nconst KHR_DF_FLAG_ALPHA_PREMULTIPLIED = 1;\nconst KHR_DF_TRANSFER_UNSPECIFIED = 0;\nconst KHR_DF_TRANSFER_LINEAR = 1;\nconst KHR_DF_TRANSFER_SRGB = 2;\nconst KHR_DF_TRANSFER_ITU = 3;\nconst KHR_DF_TRANSFER_NTSC = 4;\nconst KHR_DF_TRANSFER_SLOG = 5;\nconst KHR_DF_TRANSFER_SLOG2 = 6;\nconst KHR_DF_TRANSFER_BT1886 = 7;\nconst KHR_DF_TRANSFER_HLG_OETF = 8;\nconst KHR_DF_TRANSFER_HLG_EOTF = 9;\nconst KHR_DF_TRANSFER_PQ_EOTF = 10;\nconst KHR_DF_TRANSFER_PQ_OETF = 11;\nconst KHR_DF_TRANSFER_DCIP3 = 12;\nconst KHR_DF_TRANSFER_PAL_OETF = 13;\nconst KHR_DF_TRANSFER_PAL625_EOTF = 14;\nconst KHR_DF_TRANSFER_ST240 = 15;\nconst KHR_DF_TRANSFER_ACESCC = 16;\nconst KHR_DF_TRANSFER_ACESCCT = 17;\nconst KHR_DF_TRANSFER_ADOBERGB = 18;\nconst KHR_DF_PRIMARIES_UNSPECIFIED = 0;\nconst KHR_DF_PRIMARIES_BT709 = 1;\nconst KHR_DF_PRIMARIES_BT601_EBU = 2;\nconst KHR_DF_PRIMARIES_BT601_SMPTE = 3;\nconst KHR_DF_PRIMARIES_BT2020 = 4;\nconst KHR_DF_PRIMARIES_CIEXYZ = 5;\nconst KHR_DF_PRIMARIES_ACES = 6;\nconst KHR_DF_PRIMARIES_ACESCC = 7;\nconst KHR_DF_PRIMARIES_NTSC1953 = 8;\nconst KHR_DF_PRIMARIES_PAL525 = 9;\nconst KHR_DF_PRIMARIES_DISPLAYP3 = 10;\nconst KHR_DF_PRIMARIES_ADOBERGB = 11;\nconst KHR_DF_CHANNEL_RGBSDA_RED = 0;\nconst KHR_DF_CHANNEL_RGBSDA_GREEN = 1;\nconst KHR_DF_CHANNEL_RGBSDA_BLUE = 2;\nconst KHR_DF_CHANNEL_RGBSDA_STENCIL = 13;\nconst KHR_DF_CHANNEL_RGBSDA_DEPTH = 14;\nconst KHR_DF_CHANNEL_RGBSDA_ALPHA = 15;\nconst KHR_DF_SAMPLE_DATATYPE_FLOAT = 0x80;\nconst KHR_DF_SAMPLE_DATATYPE_SIGNED = 0x40;\nconst KHR_DF_SAMPLE_DATATYPE_EXPONENT = 0x20;\nconst KHR_DF_SAMPLE_DATATYPE_LINEAR = 0x10; ///////////////////////////////////////////////////\n// VK FORMAT.\n///////////////////////////////////////////////////\n\nconst VK_FORMAT_UNDEFINED = 0;\nconst VK_FORMAT_R4G4_UNORM_PACK8 = 1;\nconst VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2;\nconst VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3;\nconst VK_FORMAT_R5G6B5_UNORM_PACK16 = 4;\nconst VK_FORMAT_B5G6R5_UNORM_PACK16 = 5;\nconst VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6;\nconst VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7;\nconst VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8;\nconst VK_FORMAT_R8_UNORM = 9;\nconst VK_FORMAT_R8_SNORM = 10;\nconst VK_FORMAT_R8_UINT = 13;\nconst VK_FORMAT_R8_SINT = 14;\nconst VK_FORMAT_R8_SRGB = 15;\nconst VK_FORMAT_R8G8_UNORM = 16;\nconst VK_FORMAT_R8G8_SNORM = 17;\nconst VK_FORMAT_R8G8_UINT = 20;\nconst VK_FORMAT_R8G8_SINT = 21;\nconst VK_FORMAT_R8G8_SRGB = 22;\nconst VK_FORMAT_R8G8B8_UNORM = 23;\nconst VK_FORMAT_R8G8B8_SNORM = 24;\nconst VK_FORMAT_R8G8B8_UINT = 27;\nconst VK_FORMAT_R8G8B8_SINT = 28;\nconst VK_FORMAT_R8G8B8_SRGB = 29;\nconst VK_FORMAT_B8G8R8_UNORM = 30;\nconst VK_FORMAT_B8G8R8_SNORM = 31;\nconst VK_FORMAT_B8G8R8_UINT = 34;\nconst VK_FORMAT_B8G8R8_SINT = 35;\nconst VK_FORMAT_B8G8R8_SRGB = 36;\nconst VK_FORMAT_R8G8B8A8_UNORM = 37;\nconst VK_FORMAT_R8G8B8A8_SNORM = 38;\nconst VK_FORMAT_R8G8B8A8_UINT = 41;\nconst VK_FORMAT_R8G8B8A8_SINT = 42;\nconst VK_FORMAT_R8G8B8A8_SRGB = 43;\nconst VK_FORMAT_B8G8R8A8_UNORM = 44;\nconst VK_FORMAT_B8G8R8A8_SNORM = 45;\nconst VK_FORMAT_B8G8R8A8_UINT = 48;\nconst VK_FORMAT_B8G8R8A8_SINT = 49;\nconst VK_FORMAT_B8G8R8A8_SRGB = 50;\nconst VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58;\nconst VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59;\nconst VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62;\nconst VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63;\nconst VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64;\nconst VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65;\nconst VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68;\nconst VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69;\nconst VK_FORMAT_R16_UNORM = 70;\nconst VK_FORMAT_R16_SNORM = 71;\nconst VK_FORMAT_R16_UINT = 74;\nconst VK_FORMAT_R16_SINT = 75;\nconst VK_FORMAT_R16_SFLOAT = 76;\nconst VK_FORMAT_R16G16_UNORM = 77;\nconst VK_FORMAT_R16G16_SNORM = 78;\nconst VK_FORMAT_R16G16_UINT = 81;\nconst VK_FORMAT_R16G16_SINT = 82;\nconst VK_FORMAT_R16G16_SFLOAT = 83;\nconst VK_FORMAT_R16G16B16_UNORM = 84;\nconst VK_FORMAT_R16G16B16_SNORM = 85;\nconst VK_FORMAT_R16G16B16_UINT = 88;\nconst VK_FORMAT_R16G16B16_SINT = 89;\nconst VK_FORMAT_R16G16B16_SFLOAT = 90;\nconst VK_FORMAT_R16G16B16A16_UNORM = 91;\nconst VK_FORMAT_R16G16B16A16_SNORM = 92;\nconst VK_FORMAT_R16G16B16A16_UINT = 95;\nconst VK_FORMAT_R16G16B16A16_SINT = 96;\nconst VK_FORMAT_R16G16B16A16_SFLOAT = 97;\nconst VK_FORMAT_R32_UINT = 98;\nconst VK_FORMAT_R32_SINT = 99;\nconst VK_FORMAT_R32_SFLOAT = 100;\nconst VK_FORMAT_R32G32_UINT = 101;\nconst VK_FORMAT_R32G32_SINT = 102;\nconst VK_FORMAT_R32G32_SFLOAT = 103;\nconst VK_FORMAT_R32G32B32_UINT = 104;\nconst VK_FORMAT_R32G32B32_SINT = 105;\nconst VK_FORMAT_R32G32B32_SFLOAT = 106;\nconst VK_FORMAT_R32G32B32A32_UINT = 107;\nconst VK_FORMAT_R32G32B32A32_SINT = 108;\nconst VK_FORMAT_R32G32B32A32_SFLOAT = 109;\nconst VK_FORMAT_R64_UINT = 110;\nconst VK_FORMAT_R64_SINT = 111;\nconst VK_FORMAT_R64_SFLOAT = 112;\nconst VK_FORMAT_R64G64_UINT = 113;\nconst VK_FORMAT_R64G64_SINT = 114;\nconst VK_FORMAT_R64G64_SFLOAT = 115;\nconst VK_FORMAT_R64G64B64_UINT = 116;\nconst VK_FORMAT_R64G64B64_SINT = 117;\nconst VK_FORMAT_R64G64B64_SFLOAT = 118;\nconst VK_FORMAT_R64G64B64A64_UINT = 119;\nconst VK_FORMAT_R64G64B64A64_SINT = 120;\nconst VK_FORMAT_R64G64B64A64_SFLOAT = 121;\nconst VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122;\nconst VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123;\nconst VK_FORMAT_D16_UNORM = 124;\nconst VK_FORMAT_X8_D24_UNORM_PACK32 = 125;\nconst VK_FORMAT_D32_SFLOAT = 126;\nconst VK_FORMAT_S8_UINT = 127;\nconst VK_FORMAT_D16_UNORM_S8_UINT = 128;\nconst VK_FORMAT_D24_UNORM_S8_UINT = 129;\nconst VK_FORMAT_D32_SFLOAT_S8_UINT = 130;\nconst VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131;\nconst VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132;\nconst VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133;\nconst VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134;\nconst VK_FORMAT_BC2_UNORM_BLOCK = 135;\nconst VK_FORMAT_BC2_SRGB_BLOCK = 136;\nconst VK_FORMAT_BC3_UNORM_BLOCK = 137;\nconst VK_FORMAT_BC3_SRGB_BLOCK = 138;\nconst VK_FORMAT_BC4_UNORM_BLOCK = 139;\nconst VK_FORMAT_BC4_SNORM_BLOCK = 140;\nconst VK_FORMAT_BC5_UNORM_BLOCK = 141;\nconst VK_FORMAT_BC5_SNORM_BLOCK = 142;\nconst VK_FORMAT_BC6H_UFLOAT_BLOCK = 143;\nconst VK_FORMAT_BC6H_SFLOAT_BLOCK = 144;\nconst VK_FORMAT_BC7_UNORM_BLOCK = 145;\nconst VK_FORMAT_BC7_SRGB_BLOCK = 146;\nconst VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147;\nconst VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148;\nconst VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149;\nconst VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150;\nconst VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151;\nconst VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152;\nconst VK_FORMAT_EAC_R11_UNORM_BLOCK = 153;\nconst VK_FORMAT_EAC_R11_SNORM_BLOCK = 154;\nconst VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155;\nconst VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156;\nconst VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157;\nconst VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158;\nconst VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159;\nconst VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160;\nconst VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161;\nconst VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162;\nconst VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163;\nconst VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164;\nconst VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165;\nconst VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166;\nconst VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167;\nconst VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168;\nconst VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169;\nconst VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170;\nconst VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171;\nconst VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172;\nconst VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173;\nconst VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174;\nconst VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175;\nconst VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176;\nconst VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177;\nconst VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178;\nconst VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179;\nconst VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180;\nconst VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181;\nconst VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182;\nconst VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183;\nconst VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184;\nconst VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007;\nconst VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008;\nconst VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009;\nconst VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010;\nconst VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011;\nconst VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017;\nconst VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018;\nconst VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019;\nconst VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020;\nconst VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021;\nconst VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000;\nconst VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001;\nconst VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002;\nconst VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003;\nconst VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004;\nconst VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005;\nconst VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006;\nconst VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007;\nconst VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = 1000066000;\nconst VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = 1000066001;\nconst VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = 1000066002;\nconst VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = 1000066003;\nconst VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = 1000066004;\nconst VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = 1000066005;\nconst VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = 1000066006;\nconst VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = 1000066007;\nconst VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = 1000066008;\nconst VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = 1000066009;\nconst VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = 1000066010;\nconst VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = 1000066011;\nconst VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = 1000066012;\nconst VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = 1000066013;\nconst VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = 1000340000;\nconst VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = 1000340001;\n\n/**\r\n * Represents an unpacked KTX 2.0 texture container. Data for individual mip levels are stored in\r\n * the `.levels` array, typically compressed in Basis Universal formats. Additional properties\r\n * provide metadata required to process, transcode, and upload these textures.\r\n */\n\nclass KTX2Container {\n constructor() {\n this.vkFormat = VK_FORMAT_UNDEFINED;\n this.typeSize = 1;\n this.pixelWidth = 0;\n this.pixelHeight = 0;\n this.pixelDepth = 0;\n this.layerCount = 0;\n this.faceCount = 1;\n this.supercompressionScheme = KHR_SUPERCOMPRESSION_NONE;\n this.levels = [];\n this.dataFormatDescriptor = [{\n vendorId: KHR_DF_VENDORID_KHRONOS,\n descriptorType: KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,\n descriptorBlockSize: 0,\n versionNumber: KHR_DF_VERSION,\n colorModel: KHR_DF_MODEL_UNSPECIFIED,\n colorPrimaries: KHR_DF_PRIMARIES_BT709,\n transferFunction: KHR_DF_TRANSFER_SRGB,\n flags: KHR_DF_FLAG_ALPHA_STRAIGHT,\n texelBlockDimension: [0, 0, 0, 0],\n bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0],\n samples: []\n }];\n this.keyValue = {};\n this.globalData = null;\n }\n\n}\n\nclass BufferReader {\n constructor(data, byteOffset, byteLength, littleEndian) {\n this._dataView = void 0;\n this._littleEndian = void 0;\n this._offset = void 0;\n this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength);\n this._littleEndian = littleEndian;\n this._offset = 0;\n }\n\n _nextUint8() {\n const value = this._dataView.getUint8(this._offset);\n\n this._offset += 1;\n return value;\n }\n\n _nextUint16() {\n const value = this._dataView.getUint16(this._offset, this._littleEndian);\n\n this._offset += 2;\n return value;\n }\n\n _nextUint32() {\n const value = this._dataView.getUint32(this._offset, this._littleEndian);\n\n this._offset += 4;\n return value;\n }\n\n _nextUint64() {\n const left = this._dataView.getUint32(this._offset, this._littleEndian);\n\n const right = this._dataView.getUint32(this._offset + 4, this._littleEndian); // TODO(cleanup): Just test this...\n // const value = this._littleEndian ? left + (2 ** 32 * right) : (2 ** 32 * left) + right;\n\n\n const value = left + 2 ** 32 * right;\n this._offset += 8;\n return value;\n }\n\n _nextInt32() {\n const value = this._dataView.getInt32(this._offset, this._littleEndian);\n\n this._offset += 4;\n return value;\n }\n\n _nextUint8Array(len) {\n const value = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._offset, len);\n this._offset += len;\n return value;\n }\n\n _skip(bytes) {\n this._offset += bytes;\n return this;\n }\n\n _scan(maxByteLength, term = 0x00) {\n const byteOffset = this._offset;\n let byteLength = 0;\n\n while (this._dataView.getUint8(this._offset) !== term && byteLength < maxByteLength) {\n byteLength++;\n this._offset++;\n }\n\n if (byteLength < maxByteLength) this._offset++;\n return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);\n }\n\n}\n\n///////////////////////////////////////////////////\n// Common.\n///////////////////////////////////////////////////\nconst KTX_WRITER = `KTX-Parse v${\"0.6.0\"}`;\nconst NUL = new Uint8Array([0x00]); ///////////////////////////////////////////////////\n// KTX2 Header.\n///////////////////////////////////////////////////\n\nconst KTX2_ID = [// '´', 'K', 'T', 'X', '2', '0', 'ª', '\\r', '\\n', '\\x1A', '\\n'\n0xab, 0x4b, 0x54, 0x58, 0x20, 0x32, 0x30, 0xbb, 0x0d, 0x0a, 0x1a, 0x0a];\nconst HEADER_BYTE_LENGTH = 68; // 13 * 4 + 2 * 8\n\n/** Encodes text to an ArrayBuffer. */\nfunction encodeText(text) {\n if (typeof TextEncoder !== 'undefined') {\n return new TextEncoder().encode(text);\n }\n\n return Buffer.from(text);\n}\n/** Decodes an ArrayBuffer to text. */\n\nfunction decodeText(buffer) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(buffer);\n }\n\n return Buffer.from(buffer).toString('utf8');\n}\n/** Concatenates N ArrayBuffers. */\n\nfunction concat(buffers) {\n let totalByteLength = 0;\n\n for (const buffer of buffers) {\n totalByteLength += buffer.byteLength;\n }\n\n const result = new Uint8Array(totalByteLength);\n let byteOffset = 0;\n\n for (const buffer of buffers) {\n result.set(new Uint8Array(buffer), byteOffset);\n byteOffset += buffer.byteLength;\n }\n\n return result;\n}\n\n/**\r\n * Parses a KTX 2.0 file, returning an unpacked {@link KTX2Container} instance with all associated\r\n * data. The container's mip levels and other binary data are pointers into the original file, not\r\n * copies, so the original file should not be overwritten after reading.\r\n *\r\n * @param data Bytes of KTX 2.0 file, as Uint8Array or Buffer.\r\n */\n\nfunction read(data) {\n ///////////////////////////////////////////////////\n // KTX 2.0 Identifier.\n ///////////////////////////////////////////////////\n const id = new Uint8Array(data.buffer, data.byteOffset, KTX2_ID.length);\n\n if (id[0] !== KTX2_ID[0] || // '´'\n id[1] !== KTX2_ID[1] || // 'K'\n id[2] !== KTX2_ID[2] || // 'T'\n id[3] !== KTX2_ID[3] || // 'X'\n id[4] !== KTX2_ID[4] || // ' '\n id[5] !== KTX2_ID[5] || // '2'\n id[6] !== KTX2_ID[6] || // '0'\n id[7] !== KTX2_ID[7] || // 'ª'\n id[8] !== KTX2_ID[8] || // '\\r'\n id[9] !== KTX2_ID[9] || // '\\n'\n id[10] !== KTX2_ID[10] || // '\\x1A'\n id[11] !== KTX2_ID[11] // '\\n'\n ) {\n throw new Error('Missing KTX 2.0 identifier.');\n }\n\n const container = new KTX2Container(); ///////////////////////////////////////////////////\n // Header.\n ///////////////////////////////////////////////////\n\n const headerByteLength = 17 * Uint32Array.BYTES_PER_ELEMENT;\n const headerReader = new BufferReader(data, KTX2_ID.length, headerByteLength, true);\n container.vkFormat = headerReader._nextUint32();\n container.typeSize = headerReader._nextUint32();\n container.pixelWidth = headerReader._nextUint32();\n container.pixelHeight = headerReader._nextUint32();\n container.pixelDepth = headerReader._nextUint32();\n container.layerCount = headerReader._nextUint32();\n container.faceCount = headerReader._nextUint32();\n\n const levelCount = headerReader._nextUint32();\n\n container.supercompressionScheme = headerReader._nextUint32();\n\n const dfdByteOffset = headerReader._nextUint32();\n\n const dfdByteLength = headerReader._nextUint32();\n\n const kvdByteOffset = headerReader._nextUint32();\n\n const kvdByteLength = headerReader._nextUint32();\n\n const sgdByteOffset = headerReader._nextUint64();\n\n const sgdByteLength = headerReader._nextUint64(); ///////////////////////////////////////////////////\n // Level Index.\n ///////////////////////////////////////////////////\n\n\n const levelByteLength = levelCount * 3 * 8;\n const levelReader = new BufferReader(data, KTX2_ID.length + headerByteLength, levelByteLength, true);\n\n for (let i = 0; i < levelCount; i++) {\n container.levels.push({\n levelData: new Uint8Array(data.buffer, data.byteOffset + levelReader._nextUint64(), levelReader._nextUint64()),\n uncompressedByteLength: levelReader._nextUint64()\n });\n } ///////////////////////////////////////////////////\n // Data Format Descriptor (DFD).\n ///////////////////////////////////////////////////\n\n\n const dfdReader = new BufferReader(data, dfdByteOffset, dfdByteLength, true);\n const dfd = {\n vendorId: dfdReader._skip(4\n /* totalSize */\n )._nextUint16(),\n descriptorType: dfdReader._nextUint16(),\n versionNumber: dfdReader._nextUint16(),\n descriptorBlockSize: dfdReader._nextUint16(),\n colorModel: dfdReader._nextUint8(),\n colorPrimaries: dfdReader._nextUint8(),\n transferFunction: dfdReader._nextUint8(),\n flags: dfdReader._nextUint8(),\n texelBlockDimension: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n bytesPlane: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n samples: []\n };\n const sampleStart = 6;\n const sampleWords = 4;\n const numSamples = (dfd.descriptorBlockSize / 4 - sampleStart) / sampleWords;\n\n for (let i = 0; i < numSamples; i++) {\n const sample = {\n bitOffset: dfdReader._nextUint16(),\n bitLength: dfdReader._nextUint8(),\n channelType: dfdReader._nextUint8(),\n samplePosition: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n sampleLower: -Infinity,\n sampleUpper: Infinity\n };\n\n if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {\n sample.sampleLower = dfdReader._nextInt32();\n sample.sampleUpper = dfdReader._nextInt32();\n } else {\n sample.sampleLower = dfdReader._nextUint32();\n sample.sampleUpper = dfdReader._nextUint32();\n }\n\n dfd.samples[i] = sample;\n }\n\n container.dataFormatDescriptor.length = 0;\n container.dataFormatDescriptor.push(dfd); ///////////////////////////////////////////////////\n // Key/Value Data (KVD).\n ///////////////////////////////////////////////////\n\n const kvdReader = new BufferReader(data, kvdByteOffset, kvdByteLength, true);\n\n while (kvdReader._offset < kvdByteLength) {\n const keyValueByteLength = kvdReader._nextUint32();\n\n const keyData = kvdReader._scan(keyValueByteLength);\n\n const key = decodeText(keyData);\n container.keyValue[key] = kvdReader._nextUint8Array(keyValueByteLength - keyData.byteLength - 1);\n\n if (key.match(/^ktx/i)) {\n const text = decodeText(container.keyValue[key]);\n container.keyValue[key] = text.substring(0, text.lastIndexOf('\\x00'));\n }\n\n const kvPadding = keyValueByteLength % 4 ? 4 - keyValueByteLength % 4 : 0; // align(4)\n // 4-byte alignment.\n\n kvdReader._skip(kvPadding);\n } ///////////////////////////////////////////////////\n // Supercompression Global Data (SGD).\n ///////////////////////////////////////////////////\n\n\n if (sgdByteLength <= 0) return container;\n const sgdReader = new BufferReader(data, sgdByteOffset, sgdByteLength, true);\n\n const endpointCount = sgdReader._nextUint16();\n\n const selectorCount = sgdReader._nextUint16();\n\n const endpointsByteLength = sgdReader._nextUint32();\n\n const selectorsByteLength = sgdReader._nextUint32();\n\n const tablesByteLength = sgdReader._nextUint32();\n\n const extendedByteLength = sgdReader._nextUint32();\n\n const imageDescs = [];\n\n for (let i = 0; i < levelCount; i++) {\n imageDescs.push({\n imageFlags: sgdReader._nextUint32(),\n rgbSliceByteOffset: sgdReader._nextUint32(),\n rgbSliceByteLength: sgdReader._nextUint32(),\n alphaSliceByteOffset: sgdReader._nextUint32(),\n alphaSliceByteLength: sgdReader._nextUint32()\n });\n }\n\n const endpointsByteOffset = sgdByteOffset + sgdReader._offset;\n const selectorsByteOffset = endpointsByteOffset + endpointsByteLength;\n const tablesByteOffset = selectorsByteOffset + selectorsByteLength;\n const extendedByteOffset = tablesByteOffset + tablesByteLength;\n const endpointsData = new Uint8Array(data.buffer, data.byteOffset + endpointsByteOffset, endpointsByteLength);\n const selectorsData = new Uint8Array(data.buffer, data.byteOffset + selectorsByteOffset, selectorsByteLength);\n const tablesData = new Uint8Array(data.buffer, data.byteOffset + tablesByteOffset, tablesByteLength);\n const extendedData = new Uint8Array(data.buffer, data.byteOffset + extendedByteOffset, extendedByteLength);\n container.globalData = {\n endpointCount,\n selectorCount,\n imageDescs,\n endpointsData,\n selectorsData,\n tablesData,\n extendedData\n };\n return container;\n}\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nconst DEFAULT_OPTIONS = {\n keepWriter: false\n};\n/**\r\n * Serializes a {@link KTX2Container} instance to a KTX 2.0 file. Mip levels and other binary data\r\n * are copied into the resulting Uint8Array, so the original container can safely be edited or\r\n * destroyed after it is serialized.\r\n *\r\n * Options:\r\n * - keepWriter: If true, 'KTXWriter' key/value field is written as provided by the container.\r\n * \t\tOtherwise, a string for the current ktx-parse version is generated. Default: false.\r\n *\r\n * @param container\r\n * @param options\r\n */\n\nfunction write(container, options = {}) {\n options = _extends({}, DEFAULT_OPTIONS, options); ///////////////////////////////////////////////////\n // Supercompression Global Data (SGD).\n ///////////////////////////////////////////////////\n\n let sgdBuffer = new ArrayBuffer(0);\n\n if (container.globalData) {\n const sgdHeaderBuffer = new ArrayBuffer(20 + container.globalData.imageDescs.length * 5 * 4);\n const sgdHeaderView = new DataView(sgdHeaderBuffer);\n sgdHeaderView.setUint16(0, container.globalData.endpointCount, true);\n sgdHeaderView.setUint16(2, container.globalData.selectorCount, true);\n sgdHeaderView.setUint32(4, container.globalData.endpointsData.byteLength, true);\n sgdHeaderView.setUint32(8, container.globalData.selectorsData.byteLength, true);\n sgdHeaderView.setUint32(12, container.globalData.tablesData.byteLength, true);\n sgdHeaderView.setUint32(16, container.globalData.extendedData.byteLength, true);\n\n for (let i = 0; i < container.globalData.imageDescs.length; i++) {\n const imageDesc = container.globalData.imageDescs[i];\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 0, imageDesc.imageFlags, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 4, imageDesc.rgbSliceByteOffset, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 8, imageDesc.rgbSliceByteLength, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 12, imageDesc.alphaSliceByteOffset, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 16, imageDesc.alphaSliceByteLength, true);\n }\n\n sgdBuffer = concat([sgdHeaderBuffer, container.globalData.endpointsData, container.globalData.selectorsData, container.globalData.tablesData, container.globalData.extendedData]);\n } ///////////////////////////////////////////////////\n // Key/Value Data (KVD).\n ///////////////////////////////////////////////////\n\n\n const keyValueData = [];\n let keyValue = container.keyValue;\n\n if (!options.keepWriter) {\n keyValue = _extends({}, container.keyValue, {\n KTXwriter: KTX_WRITER\n });\n }\n\n for (const key in keyValue) {\n const value = keyValue[key];\n const keyData = encodeText(key);\n const valueData = typeof value === 'string' ? concat([encodeText(value), NUL]) : value;\n const kvByteLength = keyData.byteLength + 1 + valueData.byteLength;\n const kvPadding = kvByteLength % 4 ? 4 - kvByteLength % 4 : 0; // align(4)\n\n keyValueData.push(concat([new Uint32Array([kvByteLength]), keyData, NUL, valueData, new Uint8Array(kvPadding).fill(0x00) // align(4)\n ]));\n }\n\n const kvdBuffer = concat(keyValueData); ///////////////////////////////////////////////////\n // Data Format Descriptor (DFD).\n ///////////////////////////////////////////////////\n\n if (container.dataFormatDescriptor.length !== 1 || container.dataFormatDescriptor[0].descriptorType !== KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT) {\n throw new Error('Only BASICFORMAT Data Format Descriptor output supported.');\n }\n\n const dfd = container.dataFormatDescriptor[0];\n const dfdBuffer = new ArrayBuffer(28 + dfd.samples.length * 16);\n const dfdView = new DataView(dfdBuffer);\n const descriptorBlockSize = 24 + dfd.samples.length * 16;\n dfdView.setUint32(0, dfdBuffer.byteLength, true);\n dfdView.setUint16(4, dfd.vendorId, true);\n dfdView.setUint16(6, dfd.descriptorType, true);\n dfdView.setUint16(8, dfd.versionNumber, true);\n dfdView.setUint16(10, descriptorBlockSize, true);\n dfdView.setUint8(12, dfd.colorModel);\n dfdView.setUint8(13, dfd.colorPrimaries);\n dfdView.setUint8(14, dfd.transferFunction);\n dfdView.setUint8(15, dfd.flags);\n\n if (!Array.isArray(dfd.texelBlockDimension)) {\n throw new Error('texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.');\n }\n\n dfdView.setUint8(16, dfd.texelBlockDimension[0]);\n dfdView.setUint8(17, dfd.texelBlockDimension[1]);\n dfdView.setUint8(18, dfd.texelBlockDimension[2]);\n dfdView.setUint8(19, dfd.texelBlockDimension[3]);\n\n for (let i = 0; i < 8; i++) dfdView.setUint8(20 + i, dfd.bytesPlane[i]);\n\n for (let i = 0; i < dfd.samples.length; i++) {\n const sample = dfd.samples[i];\n const sampleByteOffset = 28 + i * 16;\n\n if (sample.channelID) {\n throw new Error('channelID has been renamed to channelType.');\n }\n\n dfdView.setUint16(sampleByteOffset + 0, sample.bitOffset, true);\n dfdView.setUint8(sampleByteOffset + 2, sample.bitLength);\n dfdView.setUint8(sampleByteOffset + 3, sample.channelType);\n dfdView.setUint8(sampleByteOffset + 4, sample.samplePosition[0]);\n dfdView.setUint8(sampleByteOffset + 5, sample.samplePosition[1]);\n dfdView.setUint8(sampleByteOffset + 6, sample.samplePosition[2]);\n dfdView.setUint8(sampleByteOffset + 7, sample.samplePosition[3]);\n\n if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {\n dfdView.setInt32(sampleByteOffset + 8, sample.sampleLower, true);\n dfdView.setInt32(sampleByteOffset + 12, sample.sampleUpper, true);\n } else {\n dfdView.setUint32(sampleByteOffset + 8, sample.sampleLower, true);\n dfdView.setUint32(sampleByteOffset + 12, sample.sampleUpper, true);\n }\n } ///////////////////////////////////////////////////\n // Data alignment.\n ///////////////////////////////////////////////////\n\n\n const dfdByteOffset = KTX2_ID.length + HEADER_BYTE_LENGTH + container.levels.length * 3 * 8;\n const kvdByteOffset = dfdByteOffset + dfdBuffer.byteLength;\n let sgdByteOffset = sgdBuffer.byteLength > 0 ? kvdByteOffset + kvdBuffer.byteLength : 0;\n if (sgdByteOffset % 8) sgdByteOffset += 8 - sgdByteOffset % 8; // align(8)\n ///////////////////////////////////////////////////\n // Level Index.\n ///////////////////////////////////////////////////\n\n const levelData = [];\n const levelIndex = new DataView(new ArrayBuffer(container.levels.length * 3 * 8));\n let levelDataByteOffset = (sgdByteOffset || kvdByteOffset + kvdBuffer.byteLength) + sgdBuffer.byteLength;\n\n for (let i = 0; i < container.levels.length; i++) {\n const level = container.levels[i];\n levelData.push(level.levelData);\n levelIndex.setBigUint64(i * 24 + 0, BigInt(levelDataByteOffset), true);\n levelIndex.setBigUint64(i * 24 + 8, BigInt(level.levelData.byteLength), true);\n levelIndex.setBigUint64(i * 24 + 16, BigInt(level.uncompressedByteLength), true);\n levelDataByteOffset += level.levelData.byteLength;\n } ///////////////////////////////////////////////////\n // Header.\n ///////////////////////////////////////////////////\n\n\n const headerBuffer = new ArrayBuffer(HEADER_BYTE_LENGTH);\n const headerView = new DataView(headerBuffer);\n headerView.setUint32(0, container.vkFormat, true);\n headerView.setUint32(4, container.typeSize, true);\n headerView.setUint32(8, container.pixelWidth, true);\n headerView.setUint32(12, container.pixelHeight, true);\n headerView.setUint32(16, container.pixelDepth, true);\n headerView.setUint32(20, container.layerCount, true);\n headerView.setUint32(24, container.faceCount, true);\n headerView.setUint32(28, container.levels.length, true);\n headerView.setUint32(32, container.supercompressionScheme, true);\n headerView.setUint32(36, dfdByteOffset, true);\n headerView.setUint32(40, dfdBuffer.byteLength, true);\n headerView.setUint32(44, kvdByteOffset, true);\n headerView.setUint32(48, kvdBuffer.byteLength, true);\n headerView.setBigUint64(52, BigInt(sgdBuffer.byteLength > 0 ? sgdByteOffset : 0), true);\n headerView.setBigUint64(60, BigInt(sgdBuffer.byteLength), true); ///////////////////////////////////////////////////\n // Compose.\n ///////////////////////////////////////////////////\n\n return new Uint8Array(concat([new Uint8Array(KTX2_ID).buffer, headerBuffer, levelIndex.buffer, dfdBuffer, kvdBuffer, sgdByteOffset > 0 ? new ArrayBuffer(sgdByteOffset - (kvdByteOffset + kvdBuffer.byteLength)) // align(8)\n : new ArrayBuffer(0), sgdBuffer, ...levelData]));\n}\n\nexport { KHR_DF_CHANNEL_RGBSDA_ALPHA, KHR_DF_CHANNEL_RGBSDA_BLUE, KHR_DF_CHANNEL_RGBSDA_DEPTH, KHR_DF_CHANNEL_RGBSDA_GREEN, KHR_DF_CHANNEL_RGBSDA_RED, KHR_DF_CHANNEL_RGBSDA_STENCIL, KHR_DF_FLAG_ALPHA_PREMULTIPLIED, KHR_DF_FLAG_ALPHA_STRAIGHT, KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT, KHR_DF_MODEL_ASTC, KHR_DF_MODEL_ETC1, KHR_DF_MODEL_ETC1S, KHR_DF_MODEL_ETC2, KHR_DF_MODEL_RGBSDA, KHR_DF_MODEL_UASTC, KHR_DF_MODEL_UNSPECIFIED, KHR_DF_PRIMARIES_ACES, KHR_DF_PRIMARIES_ACESCC, KHR_DF_PRIMARIES_ADOBERGB, KHR_DF_PRIMARIES_BT2020, KHR_DF_PRIMARIES_BT601_EBU, KHR_DF_PRIMARIES_BT601_SMPTE, KHR_DF_PRIMARIES_BT709, KHR_DF_PRIMARIES_CIEXYZ, KHR_DF_PRIMARIES_DISPLAYP3, KHR_DF_PRIMARIES_NTSC1953, KHR_DF_PRIMARIES_PAL525, KHR_DF_PRIMARIES_UNSPECIFIED, KHR_DF_SAMPLE_DATATYPE_EXPONENT, KHR_DF_SAMPLE_DATATYPE_FLOAT, KHR_DF_SAMPLE_DATATYPE_LINEAR, KHR_DF_SAMPLE_DATATYPE_SIGNED, KHR_DF_TRANSFER_ACESCC, KHR_DF_TRANSFER_ACESCCT, KHR_DF_TRANSFER_ADOBERGB, KHR_DF_TRANSFER_BT1886, KHR_DF_TRANSFER_DCIP3, KHR_DF_TRANSFER_HLG_EOTF, KHR_DF_TRANSFER_HLG_OETF, KHR_DF_TRANSFER_ITU, KHR_DF_TRANSFER_LINEAR, KHR_DF_TRANSFER_NTSC, KHR_DF_TRANSFER_PAL625_EOTF, KHR_DF_TRANSFER_PAL_OETF, KHR_DF_TRANSFER_PQ_EOTF, KHR_DF_TRANSFER_PQ_OETF, KHR_DF_TRANSFER_SLOG, KHR_DF_TRANSFER_SLOG2, KHR_DF_TRANSFER_SRGB, KHR_DF_TRANSFER_ST240, KHR_DF_TRANSFER_UNSPECIFIED, KHR_DF_VENDORID_KHRONOS, KHR_DF_VERSION, KHR_SUPERCOMPRESSION_BASISLZ, KHR_SUPERCOMPRESSION_NONE, KHR_SUPERCOMPRESSION_ZLIB, KHR_SUPERCOMPRESSION_ZSTD, KTX2Container, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A2B10G10R10_SINT_PACK32, VK_FORMAT_A2B10G10R10_SNORM_PACK32, VK_FORMAT_A2B10G10R10_UINT_PACK32, VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_SINT_PACK32, VK_FORMAT_A2R10G10B10_SNORM_PACK32, VK_FORMAT_A2R10G10B10_UINT_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT, VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT, VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x6_SRGB_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_12x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_12x12_SRGB_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_5x5_SRGB_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_6x6_SRGB_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x8_SRGB_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B5G5R5A1_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B8G8R8A8_SINT, VK_FORMAT_B8G8R8A8_SNORM, VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UINT, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8_SINT, VK_FORMAT_B8G8R8_SNORM, VK_FORMAT_B8G8R8_SRGB, VK_FORMAT_B8G8R8_UINT, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_D16_UNORM, VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_EAC_R11G11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, VK_FORMAT_R10X6G10X6_UNORM_2PACK16, VK_FORMAT_R10X6_UNORM_PACK16, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, VK_FORMAT_R12X4G12X4_UNORM_2PACK16, VK_FORMAT_R12X4_UNORM_PACK16, VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16_SFLOAT, VK_FORMAT_R16G16B16_SINT, VK_FORMAT_R16G16B16_SNORM, VK_FORMAT_R16G16B16_UINT, VK_FORMAT_R16G16B16_UNORM, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SINT, VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_UINT, VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16_SINT, VK_FORMAT_R16_SNORM, VK_FORMAT_R16_UINT, VK_FORMAT_R16_UNORM, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32_SINT, VK_FORMAT_R32G32B32_UINT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SINT, VK_FORMAT_R32_UINT, VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_R4G4_UNORM_PACK8, VK_FORMAT_R5G5B5A1_UNORM_PACK16, VK_FORMAT_R5G6B5_UNORM_PACK16, VK_FORMAT_R64G64B64A64_SFLOAT, VK_FORMAT_R64G64B64A64_SINT, VK_FORMAT_R64G64B64A64_UINT, VK_FORMAT_R64G64B64_SFLOAT, VK_FORMAT_R64G64B64_SINT, VK_FORMAT_R64G64B64_UINT, VK_FORMAT_R64G64_SFLOAT, VK_FORMAT_R64G64_SINT, VK_FORMAT_R64G64_UINT, VK_FORMAT_R64_SFLOAT, VK_FORMAT_R64_SINT, VK_FORMAT_R64_UINT, VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8_SINT, VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_R8G8B8_SRGB, VK_FORMAT_R8G8B8_UINT, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8_SINT, VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_SRGB, VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8_SINT, VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SRGB, VK_FORMAT_R8_UINT, VK_FORMAT_R8_UNORM, VK_FORMAT_S8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, read, write };\n//# sourceMappingURL=ktx-parse.modern.js.map\n","import{ExtensionProperty as e,PropertyType as t,Extension as s,BufferUtils as n,WriterContext as r,Primitive as o,Root as i,AnimationSampler as a,AnimationChannel as c,Accessor as u,MathUtils as l,GLB_BUFFER as h,ImageUtils as f,getBounds as g,ColorUtils as p,TextureInfo as x,TextureChannel as d}from\"@gltf-transform/core\";import{read as T,KHR_DF_MODEL_ETC1S as m,KHR_DF_MODEL_UASTC as E}from\"ktx-parse\";const I=\"EXT_mesh_gpu_instancing\",N=\"EXT_meshopt_compression\",R=\"KHR_draco_mesh_compression\",y=\"KHR_lights_punctual\",A=\"KHR_materials_anisotropy\",S=\"KHR_materials_clearcoat\",C=\"KHR_materials_emissive_strength\",M=\"KHR_materials_ior\",O=\"KHR_materials_iridescence\",_=\"KHR_materials_pbrSpecularGlossiness\",w=\"KHR_materials_sheen\",D=\"KHR_materials_specular\",b=\"KHR_materials_transmission\",F=\"KHR_materials_unlit\",j=\"KHR_materials_volume\",v=\"KHR_materials_variants\",k=\"KHR_texture_transform\",B=\"KHR_xmp_json_ld\",G=\"INSTANCE_ATTRIBUTE\";class L extends e{init(){this.extensionName=I,this.propertyType=\"InstancedMesh\",this.parentTypes=[t.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:{}})}getAttribute(e){return this.getRefMap(\"attributes\",e)}setAttribute(e,t){return this.setRefMap(\"attributes\",e,t,{usage:G})}listAttributes(){return this.listRefMapValues(\"attributes\")}listSemantics(){return this.listRefMapKeys(\"attributes\")}}L.EXTENSION_NAME=I;const U=I;class V extends s{constructor(...e){super(...e),this.extensionName=U,this.provideTypes=[t.NODE],this.prewriteTypes=[t.ACCESSOR]}createInstancedMesh(){return new L(this.document.getGraph())}read(e){return(e.jsonDoc.json.nodes||[]).forEach((t,s)=>{if(!t.extensions||!t.extensions[U])return;const n=t.extensions[U],r=this.createInstancedMesh();for(const t in n.attributes)r.setAttribute(t,e.accessors[n.attributes[t]]);e.nodes[s].setExtension(U,r)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(G);for(const t of this.properties)for(const s of t.listAttributes())e.addAccessorToUsageGroup(s,G);return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listNodes().forEach(s=>{const n=s.getExtension(U);if(n){const r=e.nodeIndexMap.get(s),o=t.json.nodes[r],i={attributes:{}};n.listSemantics().forEach(t=>{const s=n.getAttribute(t);i.attributes[t]=e.accessorIndexMap.get(s)}),o.extensions=o.extensions||{},o.extensions[U]=i}}),this}}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t8?8:4,a.componentType=i>8?q:$,a.normalized=!0,s=3===e.getElementSize()?function(e){const t=new Float32Array(4*e.length/3);for(let s=0,n=e.length/3;sQ(t,e.getComponentType())),a.max=a.max.map(t=>Q(t,e.getComponentType()))),a.normalized&&(a.min=a.min.map(e=>Y(e,a.componentType)),a.max=a.max.map(e=>Y(e,a.componentType)))}else a.byteStride%4&&(a.array=function(e,t){const s=n.padNumber(e.BYTES_PER_ELEMENT*t)/e.BYTES_PER_ELEMENT,r=new e.constructor(e.length/t*s);for(let n=0;n*te instanceof o&&e.getMode()===o.Mode.TRIANGLES)?H.TRIANGLES:H.INDICES:H.ATTRIBUTES}function Z(e,s){const n=s.getGraph().listParentEdges(e).filter(e=>!(e.getParent()instanceof i));for(const s of n){const n=s.getName(),r=s.getAttributes().key||\"\",o=s.getParent().propertyType===t.PRIMITIVE_TARGET;if(\"indices\"===n)return{filter:z.NONE};if(\"attributes\"===n){if(\"POSITION\"===r)return{filter:z.NONE};if(\"TEXCOORD_0\"===r)return{filter:z.NONE};if(r.startsWith(\"JOINTS_\"))return{filter:z.NONE};if(r.startsWith(\"WEIGHTS_\"))return{filter:z.NONE};if(\"NORMAL\"===r||\"TANGENT\"===r)return o?{filter:z.NONE}:{filter:z.OCTAHEDRAL,bits:8}}if(\"output\"===n){const t=ee(e);return\"rotation\"===t?{filter:z.QUATERNION,bits:16}:\"translation\"===t||\"scale\"===t?{filter:z.EXPONENTIAL,bits:12}:{filter:z.NONE}}if(\"input\"===n)return{filter:z.NONE};if(\"inverseBindMatrices\"===n)return{filter:z.NONE}}return{filter:z.NONE}}function ee(e){for(const t of e.listParents())if(t instanceof a)for(const e of t.listParents())if(e instanceof c)return e.getTargetPath();return null}const te=N,se={method:X.QUANTIZE};class ne extends s{constructor(...e){super(...e),this.extensionName=te,this.prereadTypes=[t.BUFFER,t.PRIMITIVE],this.prewriteTypes=[t.BUFFER,t.ACCESSOR],this.readDependencies=[\"meshopt.decoder\"],this.writeDependencies=[\"meshopt.encoder\"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=se,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(e,t){return\"meshopt.decoder\"===e&&(this._decoder=t),\"meshopt.encoder\"===e&&(this._encoder=t),this}setEncoderOptions(e){return this._encoderOptions=P({},se,e),this}preread(e,s){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${te}] Please install extension dependency, \"meshopt.decoder\".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${te}]: Missing WASM support.`)}return s===t.BUFFER?this._prereadBuffers(e):s===t.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach((s,r)=>{if(!s.extensions||!s.extensions[te])return;const o=s.extensions[te],i=o.byteOffset||0,a=o.byteLength||0,c=o.count,u=o.byteStride,l=new Uint8Array(c*u),f=t.json.buffers[o.buffer],g=n.toView(f.uri?t.resources[f.uri]:t.resources[h],i,a);this._decoder.decodeGltfBuffer(l,c,u,g,o.mode,o.filter),e.bufferViews[r]=l})}_prereadPrimitives(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach(s=>{var n;s.extensions&&s.extensions[te]&&(n=t.json.buffers[s.buffer]).extensions&&n.extensions[N]&&n.extensions[N].fallback&&this._decoderFallbackBufferMap.set(e.buffers[s.buffer],e.buffers[s.extensions[te].buffer])})}read(e){if(!this.isRequired())return this;for(const[e,t]of this._decoderFallbackBufferMap){for(const s of e.listParents())s instanceof u&&s.swap(e,t);e.dispose()}return this}prewrite(e,s){return s===t.ACCESSOR?this._prewriteAccessors(e):s===t.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const t=e.jsonDoc.json,s=this._encoder,n=this._encoderOptions,o=this.document.createBuffer(),i=this.document.getRoot().listBuffers().indexOf(o);this._encoderFallbackBuffer=o,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const o of this.document.getRoot().listAccessors()){if(\"weights\"===ee(o))continue;if(o.getSparse())continue;const a=e.getAccessorUsage(o),c=J(o,a),u=n.method===X.FILTER?Z(o,this.document):{filter:z.NONE},l=W(o,s,c,u),{array:h,byteStride:f}=l,g=o.getBuffer();if(!g)throw new Error(`${te}: Missing buffer for accessor.`);const p=this.document.getRoot().listBuffers().indexOf(g),x=[a,c,u.filter,f,p].join(\":\");let d=this._encoderBufferViews[x],T=this._encoderBufferViewData[x],m=this._encoderBufferViewAccessors[x];d&&T||(m=this._encoderBufferViewAccessors[x]=[],T=this._encoderBufferViewData[x]=[],d=this._encoderBufferViews[x]={buffer:i,target:r.USAGE_TO_TARGET[a],byteOffset:0,byteLength:0,byteStride:a===r.BufferViewUsage.ARRAY_BUFFER?f:void 0,extensions:{[te]:{buffer:p,byteOffset:0,byteLength:0,mode:c,filter:u.filter!==z.NONE?u.filter:void 0,byteStride:f,count:0}}});const E=e.createAccessorDef(o);E.componentType=l.componentType,E.normalized=l.normalized,E.byteOffset=d.byteLength,E.min&&l.min&&(E.min=l.min),E.max&&l.max&&(E.max=l.max),e.accessorIndexMap.set(o,t.accessors.length),t.accessors.push(E),m.push(E),T.push(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),d.byteLength+=h.byteLength,d.extensions.EXT_meshopt_compression.count+=o.getCount()}}_prewriteBuffers(e){const t=this._encoder;for(const s in this._encoderBufferViews){const r=this._encoderBufferViews[s],o=this._encoderBufferViewData[s],i=this.document.getRoot().listBuffers()[r.extensions[te].buffer],a=e.otherBufferViews.get(i)||[],{count:c,byteStride:u,mode:l}=r.extensions[te],h=n.concat(o),f=t.encodeGltfBuffer(h,c,u,l),g=n.pad(f);r.extensions[te].byteLength=f.byteLength,o.length=0,o.push(g),a.push(g),e.otherBufferViews.set(i,a)}}write(e){let t=0;for(const s in this._encoderBufferViews){const r=this._encoderBufferViews[s],o=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[s][0]),i=this._encoderBufferViewAccessors[s];for(const e of i)e.bufferView=o;const a=e.jsonDoc.json.bufferViews[o],c=a.byteOffset||0;Object.assign(a,r),a.byteOffset=t,a.extensions[te].byteOffset=c,t+=n.padNumber(r.byteLength)}const s=this._encoderFallbackBuffer,r=e.bufferIndexMap.get(s),o=e.jsonDoc.json.buffers[r];return o.byteLength=t,o.extensions={[te]:{fallback:!0}},s.dispose(),this}}ne.EXTENSION_NAME=te,ne.EncoderMethod=X;const re=\"EXT_texture_avif\";class oe{match(e){return e.length>=12&&\"ftypavif\"===n.decodeText(e.slice(4,12))}getSize(e){if(!this.match(e))return null;const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let s=ae(t,0);if(!s)return null;let n=s.end;for(;s=ae(t,n);)if(\"meta\"===s.type)n=s.start+4;else if(\"iprp\"===s.type||\"ipco\"===s.type)n=s.start;else{if(\"ispe\"===s.type)return[t.getUint32(s.start+4),t.getUint32(s.start+8)];if(\"mdat\"===s.type)break;n=s.end}return null}getChannels(e){return 4}}class ie extends s{constructor(...e){super(...e),this.extensionName=re,this.prereadTypes=[t.TEXTURE]}static register(){f.registerFormat(\"image/avif\",new oe)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions[re]&&(e.source=e.extensions[re].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/avif\"===s.getMimeType()){const n=e.imageIndexMap.get(s);(t.json.textures||[]).forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[re]={source:e.source},delete e.source)})}}),this}}function ae(e,t){if(e.byteLength<4+t)return null;const s=e.getUint32(t);return e.byteLength=12&&87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]}getSize(e){const t=n.decodeText(e.slice(0,4)),s=n.decodeText(e.slice(8,12));if(\"RIFF\"!==t||\"WEBP\"!==s)return null;const r=new DataView(e.buffer,e.byteOffset);let o=12;for(;o>6)]}o+=8+t+t%2}return null}getChannels(e){return 4}}class le extends s{constructor(...e){super(...e),this.extensionName=ce,this.prereadTypes=[t.TEXTURE]}static register(){f.registerFormat(\"image/webp\",new ue)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions[ce]&&(e.source=e.extensions[ce].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/webp\"===s.getMimeType()){const n=e.imageIndexMap.get(s);(t.json.textures||[]).forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[ce]={source:e.source},delete e.source)})}}),this}}le.EXTENSION_NAME=ce;const he=R;let fe,ge,pe,xe;function de(e,t){const s=new fe.DecoderBuffer;try{if(s.Init(t,t.length),e.GetEncodedGeometryType(s)!==fe.TRIANGULAR_MESH)throw new Error(`[${he}] Unknown geometry type.`);const n=new fe.Mesh;if(!e.DecodeBufferToMesh(s,n).ok()||0===n.ptr)throw new Error(`[${he}] Decoding failure.`);return n}finally{fe.destroy(s)}}function Te(e,t){const s=3*t.num_faces();let n,r;if(t.num_points()<=65534){const o=s*Uint16Array.BYTES_PER_ELEMENT;n=fe._malloc(o),e.GetTrianglesUInt16Array(t,o,n),r=new Uint16Array(fe.HEAPU16.buffer,n,s).slice()}else{const o=s*Uint32Array.BYTES_PER_ELEMENT;n=fe._malloc(o),e.GetTrianglesUInt32Array(t,o,n),r=new Uint32Array(fe.HEAPU32.buffer,n,s).slice()}return fe._free(n),r}function me(e,t,s,n){const r=pe[n.componentType],o=ge[n.componentType],i=s.num_components(),a=t.num_points()*i,c=a*o.BYTES_PER_ELEMENT,u=fe._malloc(c);e.GetAttributeDataArrayForAllPoints(t,s,r,c,u);const l=new o(fe.HEAPF32.buffer,u,a).slice();return fe._free(u),l}var Ee,Ie;!function(e){e[e.EDGEBREAKER=1]=\"EDGEBREAKER\",e[e.SEQUENTIAL=0]=\"SEQUENTIAL\"}(Ee||(Ee={})),function(e){e.POSITION=\"POSITION\",e.NORMAL=\"NORMAL\",e.COLOR=\"COLOR\",e.TEX_COORD=\"TEX_COORD\",e.GENERIC=\"GENERIC\"}(Ie||(Ie={}));const Ne={[Ie.POSITION]:14,[Ie.NORMAL]:10,[Ie.COLOR]:8,[Ie.TEX_COORD]:12,[Ie.GENERIC]:12},Re={decodeSpeed:5,encodeSpeed:5,method:Ee.EDGEBREAKER,quantizationBits:Ne,quantizationVolume:\"mesh\"};function ye(e,t=Re){const s=P({},Re,t);s.quantizationBits=P({},Ne,t.quantizationBits);const n=new xe.MeshBuilder,r=new xe.Mesh,o=new xe.ExpertEncoder(r),i={},a=new xe.DracoInt8Array,c=e.listTargets().length>0;let u=!1;for(const t of e.listSemantics()){const a=e.getAttribute(t);if(a.getSparse()){u=!0;continue}const c=Ae(t),l=Se(n,a.getComponentType(),r,xe[c],a.getCount(),a.getElementSize(),a.getArray());if(-1===l)throw new Error(`Error compressing \"${t}\" attribute.`);if(i[t]=l,\"mesh\"===s.quantizationVolume||\"POSITION\"!==t)o.SetAttributeQuantization(l,s.quantizationBits[c]);else{if(\"object\"!=typeof s.quantizationVolume)throw new Error(\"Invalid quantization volume state.\");{const{quantizationVolume:e}=s,t=Math.max(e.max[0]-e.min[0],e.max[1]-e.min[1],e.max[2]-e.min[2]);o.SetAttributeExplicitQuantization(l,s.quantizationBits[c],a.getElementSize(),e.min,t)}}}const l=e.getIndices();if(!l)throw new Ce(\"Primitive must have indices.\");n.AddFacesToMesh(r,l.getCount()/3,l.getArray()),o.SetSpeedOptions(s.encodeSpeed,s.decodeSpeed),o.SetTrackEncodedProperties(!0),o.SetEncodingMethod(s.method===Ee.SEQUENTIAL||c||u?xe.MESH_SEQUENTIAL_ENCODING:xe.MESH_EDGEBREAKER_ENCODING);const h=o.EncodeToDracoBuffer(!(c||u),a);if(h<=0)throw new Ce(\"Error applying Draco compression.\");const f=new Uint8Array(h);for(let e=0;ee.propertyType));if(2!==s.size||!s.has(t.PRIMITIVE)||!s.has(t.ROOT))throw new Error(`[${Me}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const e of Array.from(n)){const t=l.get(e),s=e.getIndices();if(c.get(s)!==t||e.listAttributes().some(e=>c.get(e)!==t))throw new Error(`[${Me}] Draco primitives must share all, or no, accessors.`)}for(const e of Array.from(r)){const t=e.getIndices();if(c.has(t)||e.listAttributes().some(e=>c.has(e)))throw new Error(`[${Me}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return l}(this.document),i=new Map;let a=\"mesh\";\"scene\"===this._encoderOptions.quantizationVolume&&(1!==this.document.getRoot().listScenes().length?n.warn(`[${Me}]: quantizationVolume=scene requires exactly 1 scene.`):a=g(this.document.getRoot().listScenes().pop()));for(const t of Array.from(r.keys())){const s=r.get(t);if(!s)throw new Error(\"Unexpected primitive.\");if(i.has(s)){i.set(s,i.get(s));continue}const o=t.getIndices(),c=e.jsonDoc.json.accessors;let u;try{u=ye(t,P({},this._encoderOptions,{quantizationVolume:a}))}catch(e){if(e instanceof Ce){n.warn(`[${Me}]: ${e.message} Skipping primitive compression.`);continue}throw e}i.set(s,u);const l=e.createAccessorDef(o);l.count=u.numIndices,e.accessorIndexMap.set(o,c.length),c.push(l);for(const s of t.listSemantics()){const n=t.getAttribute(s);if(void 0===u.attributeIDs[s])continue;const r=e.createAccessorDef(n);r.count=u.numVertices,e.accessorIndexMap.set(n,c.length),c.push(r)}const h=t.getAttribute(\"POSITION\").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(h)||e.otherBufferViews.set(h,[]),e.otherBufferViews.get(h).push(u.data)}return n.debug(`[${Me}] Compressed ${r.size} primitives.`),e.extensionData[Me]={primitiveHashMap:r,primitiveEncodingMap:i},this}write(e){const t=e.extensionData[Me];for(const s of this.document.getRoot().listMeshes()){const n=e.jsonDoc.json.meshes[e.meshIndexMap.get(s)];for(let r=0;re!==Me),t.extensionsRequired=(t.extensionsRequired||[]).filter(e=>e!==Me)}return this}}function _e(e,t){const s=[],n=e.getIndices();s.push(t.get(n));for(const n of e.listAttributes())s.push(t.get(n));return s.sort().join(\"|\")}Oe.EXTENSION_NAME=Me,Oe.EncoderMethod=Ee;class we extends e{init(){this.extensionName=y,this.propertyType=\"Light\",this.parentTypes=[t.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:we.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get(\"color\")}setColor(e){return this.set(\"color\",e)}getColorHex(){return p.factorToHex(this.getColor())}setColorHex(e){const t=this.getColor().slice();return p.hexToFactor(e,t),this.setColor(t)}getIntensity(){return this.get(\"intensity\")}setIntensity(e){return this.set(\"intensity\",e)}getType(){return this.get(\"type\")}setType(e){return this.set(\"type\",e)}getRange(){return this.get(\"range\")}setRange(e){return this.set(\"range\",e)}getInnerConeAngle(){return this.get(\"innerConeAngle\")}setInnerConeAngle(e){return this.set(\"innerConeAngle\",e)}getOuterConeAngle(){return this.get(\"outerConeAngle\")}setOuterConeAngle(e){return this.set(\"outerConeAngle\",e)}}we.EXTENSION_NAME=y,we.Type={POINT:\"point\",SPOT:\"spot\",DIRECTIONAL:\"directional\"};const De=y;class be extends s{constructor(...e){super(...e),this.extensionName=De}createLight(e=\"\"){return new we(this.document.getGraph(),e)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[De])return this;const s=(t.json.extensions[De].lights||[]).map(e=>{var t,s;const n=this.createLight().setName(e.name||\"\").setType(e.type);return void 0!==e.color&&n.setColor(e.color),void 0!==e.intensity&&n.setIntensity(e.intensity),void 0!==e.range&&n.setRange(e.range),void 0!==(null==(t=e.spot)?void 0:t.innerConeAngle)&&n.setInnerConeAngle(e.spot.innerConeAngle),void 0!==(null==(s=e.spot)?void 0:s.outerConeAngle)&&n.setOuterConeAngle(e.spot.outerConeAngle),n});return t.json.nodes.forEach((t,n)=>{t.extensions&&t.extensions[De]&&e.nodes[n].setExtension(De,s[t.extensions[De].light])}),this}write(e){const t=e.jsonDoc;if(0===this.properties.size)return this;const s=[],n=new Map;for(const e of this.properties){const t=e,r={type:t.getType()};l.eq(t.getColor(),[1,1,1])||(r.color=t.getColor()),1!==t.getIntensity()&&(r.intensity=t.getIntensity()),null!=t.getRange()&&(r.range=t.getRange()),t.getName()&&(r.name=t.getName()),t.getType()===we.Type.SPOT&&(r.spot={innerConeAngle:t.getInnerConeAngle(),outerConeAngle:t.getOuterConeAngle()}),s.push(r),n.set(t,s.length-1)}return this.document.getRoot().listNodes().forEach(s=>{const r=s.getExtension(De);if(r){const o=e.nodeIndexMap.get(s),i=t.json.nodes[o];i.extensions=i.extensions||{},i.extensions[De]={light:n.get(r)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[De]={lights:s},this}}be.EXTENSION_NAME=De;const{R:Fe,G:je,B:ve}=d;class ke extends e{init(){this.extensionName=A,this.propertyType=\"Anisotropy\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new x(this.graph,\"anisotropyTextureInfo\")})}getAnisotropyStrength(){return this.get(\"anisotropyStrength\")}setAnisotropyStrength(e){return this.set(\"anisotropyStrength\",e)}getAnisotropyRotation(){return this.get(\"anisotropyRotation\")}setAnisotropyRotation(e){return this.set(\"anisotropyRotation\",e)}getAnisotropyTexture(){return this.getRef(\"anisotropyTexture\")}getAnisotropyTextureInfo(){return this.getRef(\"anisotropyTexture\")?this.getRef(\"anisotropyTextureInfo\"):null}setAnisotropyTexture(e){return this.setRef(\"anisotropyTexture\",e,{channels:Fe|je|ve})}}ke.EXTENSION_NAME=A;const Be=A;class Ge extends s{constructor(...e){super(...e),this.extensionName=Be}createAnisotropy(){return new ke(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Be]){const r=this.createAnisotropy();e.materials[n].setExtension(Be,r);const o=t.extensions[Be];if(void 0!==o.anisotropyStrength&&r.setAnisotropyStrength(o.anisotropyStrength),void 0!==o.anisotropyRotation&&r.setAnisotropyRotation(o.anisotropyRotation),void 0!==o.anisotropyTexture){const t=o.anisotropyTexture;r.setAnisotropyTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getAnisotropyTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Be);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Be]={};if(n.getAnisotropyStrength()>0&&(i.anisotropyStrength=n.getAnisotropyStrength()),0!==n.getAnisotropyRotation()&&(i.anisotropyRotation=n.getAnisotropyRotation()),n.getAnisotropyTexture()){const t=n.getAnisotropyTexture(),s=n.getAnisotropyTextureInfo();i.anisotropyTexture=e.createTextureInfoDef(t,s)}}}),this}}Ge.EXTENSION_NAME=Be;const{R:Le,G:Ue,B:Ve}=d;class Pe extends e{init(){this.extensionName=S,this.propertyType=\"Clearcoat\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new x(this.graph,\"clearcoatTextureInfo\"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new x(this.graph,\"clearcoatRoughnessTextureInfo\"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new x(this.graph,\"clearcoatNormalTextureInfo\")})}getClearcoatFactor(){return this.get(\"clearcoatFactor\")}setClearcoatFactor(e){return this.set(\"clearcoatFactor\",e)}getClearcoatTexture(){return this.getRef(\"clearcoatTexture\")}getClearcoatTextureInfo(){return this.getRef(\"clearcoatTexture\")?this.getRef(\"clearcoatTextureInfo\"):null}setClearcoatTexture(e){return this.setRef(\"clearcoatTexture\",e,{channels:Le})}getClearcoatRoughnessFactor(){return this.get(\"clearcoatRoughnessFactor\")}setClearcoatRoughnessFactor(e){return this.set(\"clearcoatRoughnessFactor\",e)}getClearcoatRoughnessTexture(){return this.getRef(\"clearcoatRoughnessTexture\")}getClearcoatRoughnessTextureInfo(){return this.getRef(\"clearcoatRoughnessTexture\")?this.getRef(\"clearcoatRoughnessTextureInfo\"):null}setClearcoatRoughnessTexture(e){return this.setRef(\"clearcoatRoughnessTexture\",e,{channels:Ue})}getClearcoatNormalScale(){return this.get(\"clearcoatNormalScale\")}setClearcoatNormalScale(e){return this.set(\"clearcoatNormalScale\",e)}getClearcoatNormalTexture(){return this.getRef(\"clearcoatNormalTexture\")}getClearcoatNormalTextureInfo(){return this.getRef(\"clearcoatNormalTexture\")?this.getRef(\"clearcoatNormalTextureInfo\"):null}setClearcoatNormalTexture(e){return this.setRef(\"clearcoatNormalTexture\",e,{channels:Le|Ue|Ve})}}Pe.EXTENSION_NAME=S;const Xe=S;class He extends s{constructor(...e){super(...e),this.extensionName=Xe}createClearcoat(){return new Pe(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Xe]){const r=this.createClearcoat();e.materials[n].setExtension(Xe,r);const o=t.extensions[Xe];if(void 0!==o.clearcoatFactor&&r.setClearcoatFactor(o.clearcoatFactor),void 0!==o.clearcoatRoughnessFactor&&r.setClearcoatRoughnessFactor(o.clearcoatRoughnessFactor),void 0!==o.clearcoatTexture){const t=o.clearcoatTexture;r.setClearcoatTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatTextureInfo(),t)}if(void 0!==o.clearcoatRoughnessTexture){const t=o.clearcoatRoughnessTexture;r.setClearcoatRoughnessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatRoughnessTextureInfo(),t)}if(void 0!==o.clearcoatNormalTexture){const t=o.clearcoatNormalTexture;r.setClearcoatNormalTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getClearcoatNormalTextureInfo(),t),void 0!==t.scale&&r.setClearcoatNormalScale(t.scale)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Xe);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Xe]={clearcoatFactor:n.getClearcoatFactor(),clearcoatRoughnessFactor:n.getClearcoatRoughnessFactor()};if(n.getClearcoatTexture()){const t=n.getClearcoatTexture(),s=n.getClearcoatTextureInfo();i.clearcoatTexture=e.createTextureInfoDef(t,s)}if(n.getClearcoatRoughnessTexture()){const t=n.getClearcoatRoughnessTexture(),s=n.getClearcoatRoughnessTextureInfo();i.clearcoatRoughnessTexture=e.createTextureInfoDef(t,s)}if(n.getClearcoatNormalTexture()){const t=n.getClearcoatNormalTexture(),s=n.getClearcoatNormalTextureInfo();i.clearcoatNormalTexture=e.createTextureInfoDef(t,s),1!==n.getClearcoatNormalScale()&&(i.clearcoatNormalTexture.scale=n.getClearcoatNormalScale())}}}),this}}He.EXTENSION_NAME=Xe;class ze extends e{init(){this.extensionName=C,this.propertyType=\"EmissiveStrength\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get(\"emissiveStrength\")}setEmissiveStrength(e){return this.set(\"emissiveStrength\",e)}}ze.EXTENSION_NAME=C;const $e=C;class qe extends s{constructor(...e){super(...e),this.extensionName=$e}createEmissiveStrength(){return new ze(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[$e]){const n=this.createEmissiveStrength();e.materials[s].setExtension($e,n);const r=t.extensions[$e];void 0!==r.emissiveStrength&&n.setEmissiveStrength(r.emissiveStrength)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension($e);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[$e]={emissiveStrength:n.getEmissiveStrength()}}}),this}}qe.EXTENSION_NAME=$e;class Ke extends e{init(){this.extensionName=M,this.propertyType=\"IOR\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get(\"ior\")}setIOR(e){return this.set(\"ior\",e)}}Ke.EXTENSION_NAME=M;const Ye=M;class Qe extends s{constructor(...e){super(...e),this.extensionName=Ye}createIOR(){return new Ke(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[Ye]){const n=this.createIOR();e.materials[s].setExtension(Ye,n);const r=t.extensions[Ye];void 0!==r.ior&&n.setIOR(r.ior)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Ye);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[Ye]={ior:n.getIOR()}}}),this}}Qe.EXTENSION_NAME=Ye;const{R:We,G:Je}=d;class Ze extends e{init(){this.extensionName=O,this.propertyType=\"Iridescence\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new x(this.graph,\"iridescenceTextureInfo\"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new x(this.graph,\"iridescenceThicknessTextureInfo\")})}getIridescenceFactor(){return this.get(\"iridescenceFactor\")}setIridescenceFactor(e){return this.set(\"iridescenceFactor\",e)}getIridescenceTexture(){return this.getRef(\"iridescenceTexture\")}getIridescenceTextureInfo(){return this.getRef(\"iridescenceTexture\")?this.getRef(\"iridescenceTextureInfo\"):null}setIridescenceTexture(e){return this.setRef(\"iridescenceTexture\",e,{channels:We})}getIridescenceIOR(){return this.get(\"iridescenceIOR\")}setIridescenceIOR(e){return this.set(\"iridescenceIOR\",e)}getIridescenceThicknessMinimum(){return this.get(\"iridescenceThicknessMinimum\")}setIridescenceThicknessMinimum(e){return this.set(\"iridescenceThicknessMinimum\",e)}getIridescenceThicknessMaximum(){return this.get(\"iridescenceThicknessMaximum\")}setIridescenceThicknessMaximum(e){return this.set(\"iridescenceThicknessMaximum\",e)}getIridescenceThicknessTexture(){return this.getRef(\"iridescenceThicknessTexture\")}getIridescenceThicknessTextureInfo(){return this.getRef(\"iridescenceThicknessTexture\")?this.getRef(\"iridescenceThicknessTextureInfo\"):null}setIridescenceThicknessTexture(e){return this.setRef(\"iridescenceThicknessTexture\",e,{channels:Je})}}Ze.EXTENSION_NAME=O;const et=O;class tt extends s{constructor(...e){super(...e),this.extensionName=et}createIridescence(){return new Ze(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[et]){const r=this.createIridescence();e.materials[n].setExtension(et,r);const o=t.extensions[et];if(void 0!==o.iridescenceFactor&&r.setIridescenceFactor(o.iridescenceFactor),void 0!==o.iridescenceIor&&r.setIridescenceIOR(o.iridescenceIor),void 0!==o.iridescenceThicknessMinimum&&r.setIridescenceThicknessMinimum(o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&r.setIridescenceThicknessMaximum(o.iridescenceThicknessMaximum),void 0!==o.iridescenceTexture){const t=o.iridescenceTexture;r.setIridescenceTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getIridescenceTextureInfo(),t)}if(void 0!==o.iridescenceThicknessTexture){const t=o.iridescenceThicknessTexture;r.setIridescenceThicknessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getIridescenceThicknessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(et);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[et]={};if(n.getIridescenceFactor()>0&&(i.iridescenceFactor=n.getIridescenceFactor()),1.3!==n.getIridescenceIOR()&&(i.iridescenceIor=n.getIridescenceIOR()),100!==n.getIridescenceThicknessMinimum()&&(i.iridescenceThicknessMinimum=n.getIridescenceThicknessMinimum()),400!==n.getIridescenceThicknessMaximum()&&(i.iridescenceThicknessMaximum=n.getIridescenceThicknessMaximum()),n.getIridescenceTexture()){const t=n.getIridescenceTexture(),s=n.getIridescenceTextureInfo();i.iridescenceTexture=e.createTextureInfoDef(t,s)}if(n.getIridescenceThicknessTexture()){const t=n.getIridescenceThicknessTexture(),s=n.getIridescenceThicknessTextureInfo();i.iridescenceThicknessTexture=e.createTextureInfoDef(t,s)}}}),this}}tt.EXTENSION_NAME=et;const{R:st,G:nt,B:rt,A:ot}=d;class it extends e{init(){this.extensionName=_,this.propertyType=\"PBRSpecularGlossiness\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new x(this.graph,\"diffuseTextureInfo\"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new x(this.graph,\"specularGlossinessTextureInfo\")})}getDiffuseFactor(){return this.get(\"diffuseFactor\")}setDiffuseFactor(e){return this.set(\"diffuseFactor\",e)}getDiffuseHex(){return p.factorToHex(this.getDiffuseFactor())}setDiffuseHex(e){const t=this.getDiffuseFactor().slice();return this.setDiffuseFactor(p.hexToFactor(e,t))}getDiffuseTexture(){return this.getRef(\"diffuseTexture\")}getDiffuseTextureInfo(){return this.getRef(\"diffuseTexture\")?this.getRef(\"diffuseTextureInfo\"):null}setDiffuseTexture(e){return this.setRef(\"diffuseTexture\",e,{channels:st|nt|rt|ot,isColor:!0})}getSpecularFactor(){return this.get(\"specularFactor\")}setSpecularFactor(e){return this.set(\"specularFactor\",e)}getGlossinessFactor(){return this.get(\"glossinessFactor\")}setGlossinessFactor(e){return this.set(\"glossinessFactor\",e)}getSpecularGlossinessTexture(){return this.getRef(\"specularGlossinessTexture\")}getSpecularGlossinessTextureInfo(){return this.getRef(\"specularGlossinessTexture\")?this.getRef(\"specularGlossinessTextureInfo\"):null}setSpecularGlossinessTexture(e){return this.setRef(\"specularGlossinessTexture\",e,{channels:st|nt|rt|ot})}}it.EXTENSION_NAME=_;const at=_;class ct extends s{constructor(...e){super(...e),this.extensionName=at}createPBRSpecularGlossiness(){return new it(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[at]){const r=this.createPBRSpecularGlossiness();e.materials[n].setExtension(at,r);const o=t.extensions[at];if(void 0!==o.diffuseFactor&&r.setDiffuseFactor(o.diffuseFactor),void 0!==o.specularFactor&&r.setSpecularFactor(o.specularFactor),void 0!==o.glossinessFactor&&r.setGlossinessFactor(o.glossinessFactor),void 0!==o.diffuseTexture){const t=o.diffuseTexture;r.setDiffuseTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getDiffuseTextureInfo(),t)}if(void 0!==o.specularGlossinessTexture){const t=o.specularGlossinessTexture;r.setSpecularGlossinessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularGlossinessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(at);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[at]={diffuseFactor:n.getDiffuseFactor(),specularFactor:n.getSpecularFactor(),glossinessFactor:n.getGlossinessFactor()};if(n.getDiffuseTexture()){const t=n.getDiffuseTexture(),s=n.getDiffuseTextureInfo();i.diffuseTexture=e.createTextureInfoDef(t,s)}if(n.getSpecularGlossinessTexture()){const t=n.getSpecularGlossinessTexture(),s=n.getSpecularGlossinessTextureInfo();i.specularGlossinessTexture=e.createTextureInfoDef(t,s)}}}),this}}ct.EXTENSION_NAME=at;const{R:ut,G:lt,B:ht,A:ft}=d;class gt extends e{init(){this.extensionName=w,this.propertyType=\"Sheen\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new x(this.graph,\"sheenColorTextureInfo\"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new x(this.graph,\"sheenRoughnessTextureInfo\")})}getSheenColorFactor(){return this.get(\"sheenColorFactor\")}getSheenColorHex(){return p.factorToHex(this.getSheenColorFactor())}setSheenColorFactor(e){return this.set(\"sheenColorFactor\",e)}setSheenColorHex(e){const t=this.getSheenColorFactor().slice();return this.set(\"sheenColorFactor\",p.hexToFactor(e,t))}getSheenColorTexture(){return this.getRef(\"sheenColorTexture\")}getSheenColorTextureInfo(){return this.getRef(\"sheenColorTexture\")?this.getRef(\"sheenColorTextureInfo\"):null}setSheenColorTexture(e){return this.setRef(\"sheenColorTexture\",e,{channels:ut|lt|ht,isColor:!0})}getSheenRoughnessFactor(){return this.get(\"sheenRoughnessFactor\")}setSheenRoughnessFactor(e){return this.set(\"sheenRoughnessFactor\",e)}getSheenRoughnessTexture(){return this.getRef(\"sheenRoughnessTexture\")}getSheenRoughnessTextureInfo(){return this.getRef(\"sheenRoughnessTexture\")?this.getRef(\"sheenRoughnessTextureInfo\"):null}setSheenRoughnessTexture(e){return this.setRef(\"sheenRoughnessTexture\",e,{channels:ft})}}gt.EXTENSION_NAME=w;const pt=w;class xt extends s{constructor(...e){super(...e),this.extensionName=pt}createSheen(){return new gt(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[pt]){const r=this.createSheen();e.materials[n].setExtension(pt,r);const o=t.extensions[pt];if(void 0!==o.sheenColorFactor&&r.setSheenColorFactor(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&r.setSheenRoughnessFactor(o.sheenRoughnessFactor),void 0!==o.sheenColorTexture){const t=o.sheenColorTexture;r.setSheenColorTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSheenColorTextureInfo(),t)}if(void 0!==o.sheenRoughnessTexture){const t=o.sheenRoughnessTexture;r.setSheenRoughnessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSheenRoughnessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(pt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[pt]={sheenColorFactor:n.getSheenColorFactor(),sheenRoughnessFactor:n.getSheenRoughnessFactor()};if(n.getSheenColorTexture()){const t=n.getSheenColorTexture(),s=n.getSheenColorTextureInfo();i.sheenColorTexture=e.createTextureInfoDef(t,s)}if(n.getSheenRoughnessTexture()){const t=n.getSheenRoughnessTexture(),s=n.getSheenRoughnessTextureInfo();i.sheenRoughnessTexture=e.createTextureInfoDef(t,s)}}}),this}}xt.EXTENSION_NAME=pt;const{R:dt,G:Tt,B:mt,A:Et}=d;class It extends e{init(){this.extensionName=D,this.propertyType=\"Specular\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new x(this.graph,\"specularTextureInfo\"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new x(this.graph,\"specularColorTextureInfo\")})}getSpecularFactor(){return this.get(\"specularFactor\")}setSpecularFactor(e){return this.set(\"specularFactor\",e)}getSpecularColorFactor(){return this.get(\"specularColorFactor\")}setSpecularColorFactor(e){return this.set(\"specularColorFactor\",e)}getSpecularColorHex(){return p.factorToHex(this.getSpecularColorFactor())}setSpecularColorHex(e){const t=this.getSpecularColorFactor().slice();return this.set(\"specularColorFactor\",p.hexToFactor(e,t))}getSpecularTexture(){return this.getRef(\"specularTexture\")}getSpecularTextureInfo(){return this.getRef(\"specularTexture\")?this.getRef(\"specularTextureInfo\"):null}setSpecularTexture(e){return this.setRef(\"specularTexture\",e,{channels:Et})}getSpecularColorTexture(){return this.getRef(\"specularColorTexture\")}getSpecularColorTextureInfo(){return this.getRef(\"specularColorTexture\")?this.getRef(\"specularColorTextureInfo\"):null}setSpecularColorTexture(e){return this.setRef(\"specularColorTexture\",e,{channels:dt|Tt|mt,isColor:!0})}}It.EXTENSION_NAME=D;const Nt=D;class Rt extends s{constructor(...e){super(...e),this.extensionName=Nt}createSpecular(){return new It(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Nt]){const r=this.createSpecular();e.materials[n].setExtension(Nt,r);const o=t.extensions[Nt];if(void 0!==o.specularFactor&&r.setSpecularFactor(o.specularFactor),void 0!==o.specularColorFactor&&r.setSpecularColorFactor(o.specularColorFactor),void 0!==o.specularTexture){const t=o.specularTexture;r.setSpecularTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularTextureInfo(),t)}if(void 0!==o.specularColorTexture){const t=o.specularColorTexture;r.setSpecularColorTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getSpecularColorTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Nt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Nt]={};if(1!==n.getSpecularFactor()&&(i.specularFactor=n.getSpecularFactor()),l.eq(n.getSpecularColorFactor(),[1,1,1])||(i.specularColorFactor=n.getSpecularColorFactor()),n.getSpecularTexture()){const t=n.getSpecularTexture(),s=n.getSpecularTextureInfo();i.specularTexture=e.createTextureInfoDef(t,s)}if(n.getSpecularColorTexture()){const t=n.getSpecularColorTexture(),s=n.getSpecularColorTextureInfo();i.specularColorTexture=e.createTextureInfoDef(t,s)}}}),this}}Rt.EXTENSION_NAME=Nt;const{R:yt}=d;class At extends e{init(){this.extensionName=b,this.propertyType=\"Transmission\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new x(this.graph,\"transmissionTextureInfo\")})}getTransmissionFactor(){return this.get(\"transmissionFactor\")}setTransmissionFactor(e){return this.set(\"transmissionFactor\",e)}getTransmissionTexture(){return this.getRef(\"transmissionTexture\")}getTransmissionTextureInfo(){return this.getRef(\"transmissionTexture\")?this.getRef(\"transmissionTextureInfo\"):null}setTransmissionTexture(e){return this.setRef(\"transmissionTexture\",e,{channels:yt})}}At.EXTENSION_NAME=b;const St=b;class Ct extends s{constructor(...e){super(...e),this.extensionName=St}createTransmission(){return new At(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[St]){const r=this.createTransmission();e.materials[n].setExtension(St,r);const o=t.extensions[St];if(void 0!==o.transmissionFactor&&r.setTransmissionFactor(o.transmissionFactor),void 0!==o.transmissionTexture){const t=o.transmissionTexture;r.setTransmissionTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getTransmissionTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(St);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[St]={transmissionFactor:n.getTransmissionFactor()};if(n.getTransmissionTexture()){const t=n.getTransmissionTexture(),s=n.getTransmissionTextureInfo();i.transmissionTexture=e.createTextureInfoDef(t,s)}}}),this}}Ct.EXTENSION_NAME=St;class Mt extends e{init(){this.extensionName=F,this.propertyType=\"Unlit\",this.parentTypes=[t.MATERIAL]}}Mt.EXTENSION_NAME=F;const Ot=F;class _t extends s{constructor(...e){super(...e),this.extensionName=Ot}createUnlit(){return new Mt(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((t,s)=>{t.extensions&&t.extensions[Ot]&&e.materials[s].setExtension(Ot,this.createUnlit())}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{if(s.getExtension(Ot)){const n=e.materialIndexMap.get(s),r=t.json.materials[n];r.extensions=r.extensions||{},r.extensions[Ot]={}}}),this}}_t.EXTENSION_NAME=Ot;class wt extends e{init(){this.extensionName=v,this.propertyType=\"Mapping\",this.parentTypes=[\"MappingList\"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:[]})}getMaterial(){return this.getRef(\"material\")}setMaterial(e){return this.setRef(\"material\",e)}addVariant(e){return this.addRef(\"variants\",e)}removeVariant(e){return this.removeRef(\"variants\",e)}listVariants(){return this.listRefs(\"variants\")}}wt.EXTENSION_NAME=v;class Dt extends e{init(){this.extensionName=v,this.propertyType=\"MappingList\",this.parentTypes=[t.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:[]})}addMapping(e){return this.addRef(\"mappings\",e)}removeMapping(e){return this.removeRef(\"mappings\",e)}listMappings(){return this.listRefs(\"mappings\")}}Dt.EXTENSION_NAME=v;class bt extends e{init(){this.extensionName=v,this.propertyType=\"Variant\",this.parentTypes=[\"MappingList\"]}}bt.EXTENSION_NAME=v;const Ft=v;class jt extends s{constructor(...e){super(...e),this.extensionName=Ft}createMappingList(){return new Dt(this.document.getGraph())}createVariant(e=\"\"){return new bt(this.document.getGraph(),e)}createMapping(){return new wt(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof bt)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[Ft])return this;const s=(t.json.extensions[Ft].variants||[]).map(e=>this.createVariant().setName(e.name||\"\"));return(t.json.meshes||[]).forEach((t,n)=>{const r=e.meshes[n];(t.primitives||[]).forEach((t,n)=>{if(!t.extensions||!t.extensions[Ft])return;const o=this.createMappingList(),i=t.extensions[Ft];for(const t of i.mappings){const n=this.createMapping();void 0!==t.material&&n.setMaterial(e.materials[t.material]);for(const e of t.variants||[])n.addVariant(s[e]);o.addMapping(n)}r.listPrimitives()[n].setExtension(Ft,o)})}),this}write(e){const t=e.jsonDoc,s=this.listVariants();if(!s.length)return this;const n=[],r=new Map;for(const t of s)r.set(t,n.length),n.push(e.createPropertyDef(t));for(const t of this.document.getRoot().listMeshes()){const s=e.meshIndexMap.get(t);t.listPrimitives().forEach((t,n)=>{const o=t.getExtension(Ft);if(!o)return;const i=e.jsonDoc.json.meshes[s].primitives[n],a=o.listMappings().map(t=>{const s=e.createPropertyDef(t),n=t.getMaterial();return n&&(s.material=e.materialIndexMap.get(n)),s.variants=t.listVariants().map(e=>r.get(e)),s});i.extensions=i.extensions||{},i.extensions[Ft]={mappings:a}})}return t.json.extensions=t.json.extensions||{},t.json.extensions[Ft]={variants:n},this}}jt.EXTENSION_NAME=Ft;const{G:vt}=d;class kt extends e{init(){this.extensionName=j,this.propertyType=\"Volume\",this.parentTypes=[t.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new x(this.graph,\"thicknessTexture\"),attenuationDistance:Infinity,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get(\"thicknessFactor\")}setThicknessFactor(e){return this.set(\"thicknessFactor\",e)}getThicknessTexture(){return this.getRef(\"thicknessTexture\")}getThicknessTextureInfo(){return this.getRef(\"thicknessTexture\")?this.getRef(\"thicknessTextureInfo\"):null}setThicknessTexture(e){return this.setRef(\"thicknessTexture\",e,{channels:vt})}getAttenuationDistance(){return this.get(\"attenuationDistance\")}setAttenuationDistance(e){return this.set(\"attenuationDistance\",e)}getAttenuationColor(){return this.get(\"attenuationColor\")}setAttenuationColor(e){return this.set(\"attenuationColor\",e)}getAttenuationColorHex(){return p.factorToHex(this.getAttenuationColor())}setAttenuationColorHex(e){const t=this.getAttenuationColor().slice();return this.set(\"attenuationColor\",p.hexToFactor(e,t))}}kt.EXTENSION_NAME=j;const Bt=j;class Gt extends s{constructor(...e){super(...e),this.extensionName=Bt}createVolume(){return new kt(this.document.getGraph())}read(e){const t=e.jsonDoc,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,n)=>{if(t.extensions&&t.extensions[Bt]){const r=this.createVolume();e.materials[n].setExtension(Bt,r);const o=t.extensions[Bt];if(void 0!==o.thicknessFactor&&r.setThicknessFactor(o.thicknessFactor),void 0!==o.attenuationDistance&&r.setAttenuationDistance(o.attenuationDistance),void 0!==o.attenuationColor&&r.setAttenuationColor(o.attenuationColor),void 0!==o.thicknessTexture){const t=o.thicknessTexture;r.setThicknessTexture(e.textures[s[t.index].source]),e.setTextureInfo(r.getThicknessTextureInfo(),t)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(s=>{const n=s.getExtension(Bt);if(n){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{};const i=o.extensions[Bt]={};if(n.getThicknessFactor()>0&&(i.thicknessFactor=n.getThicknessFactor()),Number.isFinite(n.getAttenuationDistance())&&(i.attenuationDistance=n.getAttenuationDistance()),l.eq(n.getAttenuationColor(),[1,1,1])||(i.attenuationColor=n.getAttenuationColor()),n.getThicknessTexture()){const t=n.getThicknessTexture(),s=n.getThicknessTextureInfo();i.thicknessTexture=e.createTextureInfoDef(t,s)}}}),this}}Gt.EXTENSION_NAME=Bt;const Lt=\"KHR_mesh_quantization\";class Ut extends s{constructor(...e){super(...e),this.extensionName=Lt}read(e){return this}write(e){return this}}Ut.EXTENSION_NAME=Lt;const Vt=\"KHR_texture_basisu\";class Pt{match(e){return 171===e[0]&&75===e[1]&&84===e[2]&&88===e[3]&&32===e[4]&&50===e[5]&&48===e[6]&&187===e[7]&&13===e[8]&&10===e[9]&&26===e[10]&&10===e[11]}getSize(e){const t=T(e);return[t.pixelWidth,t.pixelHeight]}getChannels(e){const t=T(e).dataFormatDescriptor[0];if(t.colorModel===m)return 2===t.samples.length&&15==(15&t.samples[1].channelType)?4:3;if(t.colorModel===E)return 3==(15&t.samples[0].channelType)?4:3;throw new Error(`Unexpected KTX2 colorModel, \"${t.colorModel}\".`)}getVRAMByteLength(e){const t=T(e),s=this.getChannels(e)>3;let n=0;for(let e=0;e{e.extensions&&e.extensions[Vt]&&(e.source=e.extensions[Vt].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(s=>{if(\"image/ktx2\"===s.getMimeType()){const n=e.imageIndexMap.get(s);t.json.textures.forEach(e=>{e.source===n&&(e.extensions=e.extensions||{},e.extensions[Vt]={source:e.source},delete e.source)})}}),this}}Xt.EXTENSION_NAME=Vt;class Ht extends e{init(){this.extensionName=k,this.propertyType=\"Transform\",this.parentTypes=[t.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get(\"offset\")}setOffset(e){return this.set(\"offset\",e)}getRotation(){return this.get(\"rotation\")}setRotation(e){return this.set(\"rotation\",e)}getScale(){return this.get(\"scale\")}setScale(e){return this.set(\"scale\",e)}getTexCoord(){return this.get(\"texCoord\")}setTexCoord(e){return this.set(\"texCoord\",e)}}Ht.EXTENSION_NAME=k;const zt=k;class $t extends s{constructor(...e){super(...e),this.extensionName=zt}createTransform(){return new Ht(this.document.getGraph())}read(e){for(const[t,s]of Array.from(e.textureInfos.entries())){if(!s.extensions||!s.extensions[zt])continue;const e=this.createTransform(),n=s.extensions[zt];void 0!==n.offset&&e.setOffset(n.offset),void 0!==n.rotation&&e.setRotation(n.rotation),void 0!==n.scale&&e.setScale(n.scale),void 0!==n.texCoord&&e.setTexCoord(n.texCoord),t.setExtension(zt,e)}return this}write(e){const t=Array.from(e.textureInfoDefMap.entries());for(const[e,s]of t){const t=e.getExtension(zt);if(!t)continue;s.extensions=s.extensions||{};const n={},r=l.eq;r(t.getOffset(),[0,0])||(n.offset=t.getOffset()),0!==t.getRotation()&&(n.rotation=t.getRotation()),r(t.getScale(),[1,1])||(n.scale=t.getScale()),null!=t.getTexCoord()&&(n.texCoord=t.getTexCoord()),s.extensions[zt]=n}return this}}$t.EXTENSION_NAME=zt;const qt=[t.ROOT,t.SCENE,t.NODE,t.MESH,t.MATERIAL,t.TEXTURE,t.ANIMATION];class Kt extends e{init(){this.extensionName=B,this.propertyType=\"Packet\",this.parentTypes=qt}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get(\"context\")}setContext(e){return this.set(\"context\",P({},e))}listProperties(){return Object.keys(this.get(\"properties\"))}getProperty(e){const t=this.get(\"properties\");return e in t?t[e]:null}setProperty(e,t){this._assertContext(e);const s=P({},this.get(\"properties\"));return t?s[e]=t:delete s[e],this.set(\"properties\",s)}toJSONLD(){return P({\"@context\":Yt(this.get(\"context\"))},Yt(this.get(\"properties\")))}fromJSONLD(e){const t=(e=Yt(e))[\"@context\"];return t&&this.set(\"context\",t),delete e[\"@context\"],this.set(\"properties\",e)}_assertContext(e){if(!(e.split(\":\")[0]in this.get(\"context\")))throw new Error(`${B}: Missing context for term, \"${e}\".`)}}function Yt(e){return JSON.parse(JSON.stringify(e))}Kt.EXTENSION_NAME=B;const Qt=B;class Wt extends s{constructor(...e){super(...e),this.extensionName=Qt}createPacket(){return new Kt(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(e){var t;const s=null==(t=e.jsonDoc.json.extensions)?void 0:t[Qt];if(!s||!s.packets)return this;const n=e.jsonDoc.json,r=this.document.getRoot(),o=s.packets.map(e=>this.createPacket().fromJSONLD(e)),i=[[n.asset],n.scenes,n.nodes,n.meshes,n.materials,n.images,n.animations],a=[[r],r.listScenes(),r.listNodes(),r.listMeshes(),r.listMaterials(),r.listTextures(),r.listAnimations()];for(let e=0;e0&&(s.extensions=s.extensions||{},s.extensions[Qt]={packets:n}),this}}Wt.EXTENSION_NAME=Qt;const Jt=[Oe,be,Ge,He,qe,Qe,tt,ct,Rt,xt,Ct,_t,jt,Gt,Ut,Xt,$t,Wt],Zt=[V,ne,ie,le,...Jt];export{Zt as ALL_EXTENSIONS,ke as Anisotropy,Pe as Clearcoat,V as EXTMeshGPUInstancing,ne as EXTMeshoptCompression,ie as EXTTextureAVIF,le as EXTTextureWebP,ze as EmissiveStrength,G as INSTANCE_ATTRIBUTE,Ke as IOR,L as InstancedMesh,Ze as Iridescence,Oe as KHRDracoMeshCompression,be as KHRLightsPunctual,Ge as KHRMaterialsAnisotropy,He as KHRMaterialsClearcoat,qe as KHRMaterialsEmissiveStrength,Qe as KHRMaterialsIOR,tt as KHRMaterialsIridescence,ct as KHRMaterialsPBRSpecularGlossiness,xt as KHRMaterialsSheen,Rt as KHRMaterialsSpecular,Ct as KHRMaterialsTransmission,_t as KHRMaterialsUnlit,jt as KHRMaterialsVariants,Gt as KHRMaterialsVolume,Ut as KHRMeshQuantization,Jt as KHRONOS_EXTENSIONS,Xt as KHRTextureBasisu,$t as KHRTextureTransform,Wt as KHRXMP,we as Light,wt as Mapping,Dt as MappingList,it as PBRSpecularGlossiness,Kt as Packet,gt as Sheen,It as Specular,Ht as Transform,At as Transmission,Mt as Unlit,bt as Variant,kt as Volume};\n//# sourceMappingURL=extensions.modern.js.map\n","/* prettier-ignore */\r\nexport const defMatrix = [\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1\r\n ]\r\n","\r\n/** transform for attribute as specifiend in 3mf format\r\n * \r\n * When objects need to be transformed for rotation, scaling, or translation purposes, \r\n * row-major affine 3D matrices (4x4) are used. The matrix SHOULD NOT be singular or nearly singular.\r\n * Transforms are of the form, where only the first 3 column values are specified. \r\n * The last column is never provided, and has the fixed values 0.0, 0.0, 0.0, 1.0. \r\n * When specified as an attribute value, \r\n * matrices have the form \"m00 m01 m02 m10 m11 m12 m20 m21 m22 m30 m31 m32\" \r\n * where each value is a decimal number of arbitrary precision.\r\n * \r\n * @param {mat4} matrix\r\n * @return string tarnsform attribute value\r\n*/\r\nexport const matrix2str = m=>{\r\n let str = ''\r\n for(let i=0; i<16; i++){\r\n if(i % 4 == 3) continue\r\n if(i>0) str += ' '\r\n str += m[i] || 0\r\n }\r\n return str\r\n}","import { defMatrix } from './defMatrix.js'\r\nimport { matrix2str } from './matrix2str.js'\r\n/**\r\n * \r\n * @param {string} id - must start with 1, can not be zero by spec\r\n * @param {mat4} matrix \r\n * @returns \r\n */\r\nexport const makeItem = (id = 1, matrix = defMatrix) =>\r\n ` \\n`\r\n","export const toDate3mf = d => (d ? d.toISOString().substring(0, 10) : '')\r\n","import { toDate3mf } from './toDate3mf.js'\r\n\r\n/**\r\n * @typedef Header\r\n * @prop {'micron'|'millimeter'|'centimeter'|'inch'|'foot'|'meter'} unit\r\n * @prop {string} [title]\r\n * @prop {string} [author]\r\n * @prop {string} [description]\r\n * @prop {string} [application]\r\n * @prop {string} [creationDate]\r\n * @prop {string} [license]\r\n * @prop {string} [modificationDate] \r\n * \r\n * \r\n * @param {Array} out \r\n * @param {Header} param1 \r\n */\r\nexport function pushHeader(out,{\r\n unit = 'millimeter',\r\n title = 'jscad model',\r\n author = '',\r\n description = '',\r\n application = 'jscad',\r\n creationDate = new Date(),\r\n license = '',\r\n modificationDate,\r\n}={}) {\r\n out.push(\r\n `\r\n\r\n 1\r\n ${title}\r\n ${author}\r\n ${description || title}\r\n \r\n ${license}\r\n \r\n ${toDate3mf(creationDate)}\r\n ${toDate3mf(modificationDate || creationDate)}\r\n ${application}\r\n `,\r\n )\r\n}\r\n","import {defMatrix} from './defMatrix.js'\r\nimport {matrix2str} from './matrix2str.js'\r\n\r\n/**\r\n * \r\n * @param {Array} out \r\n * @param {string} id \r\n * @param {Array} children \r\n * @param {string} name \r\n */\r\nexport function pushObjectWithComponents(out, id, children, name) {\r\n out.push(`\\n`)\r\n out.push(` \\n`)\r\n children.forEach(\r\n ({objectID, transform}) => {addComp(out, objectID, transform)})\r\n out.push(` \\n`)\r\n out.push(`\\n`)\r\n}\r\n\r\n/**\r\n * \r\n * @param {*} out \r\n * @param {*} id - must start with 1, can not be zero by spec \r\n * @param {*} matrix \r\n */\r\nconst addComp = (out, id = 1, matrix = defMatrix) => {\r\n out.push(\r\n ` \\n`)\r\n}\r\n","/**\r\n *\r\n * @param {Arrray} out\r\n * @param {string} id\r\n * @param {Float32Array} vertices\r\n * @param {Uint32Array} indices\r\n * @param {number} precision\r\n * @param {string} [name]\r\n * @returns\r\n */\r\nexport function pushObjectWithMesh(\r\n out, id, vertices, indices, precision, name) {\r\n out.push(` \r\n \r\n \r\n`)\r\n\r\n for (let i = 0; i < vertices.length; i += 3) {\r\n out.push(` \\n`)\r\n }\r\n\r\n out.push(` \r\n \r\n`)\r\n\r\n for (let i = 0; i < indices.length; i += 3) {\r\n out.push(` \\n`)\r\n }\r\n\r\n\r\n out.push(` \r\n \r\n \r\n`)\r\n\r\n return out\r\n}","\r\n/** File that describes content types inside a 3mf */\r\nexport const fileForContentTypes = {\r\n name:'[Content_Types].xml',\r\n content: `\r\n\r\n\r\n\r\n\r\n`\r\n}\r\n\r\n","// this implementation exports to 3mf by filling array of strings and doing join\r\n// at the encoding tests for large files have shown significant speedup related\r\n// to using string concatenation\r\nimport { makeItem } from './src/makeItem.js'\r\nimport { pushHeader } from './src/pushHeader.js'\r\nimport { pushObjectWithComponents } from './src/pushObjectComponent.js'\r\nimport { pushObjectWithMesh } from './src/pushObjectMesh.js'\r\n\r\nexport * from './src/staticFiles.js'\r\n\r\n/**\r\n * @typedef Mesh3MF\r\n * @prop {string} id\r\n * @prop {Float32Array} vertices\r\n * @prop {Uint32Array} indices\r\n * @prop {string} [name]\r\n *\r\n * @typedef Mesh3MFSimpleExt\r\n * @prop {mat4} transform\r\n *\r\n * @typedef {Mesh3MF & Mesh3MFSimpleExt} Mesh3MFSimple\r\n *\r\n * @typedef Component3MF\r\n * @prop {string} id\r\n * @prop {string} name\r\n * @prop {Array} children\r\n *\r\n * @typedef Child3MF\r\n * @prop {string} objectID\r\n * @prop {mat4} transform\r\n *\r\n * @typedef To3MF\r\n * @prop {Array} meshes - manually declare meshes\r\n * @prop {Array} [components] - components can combine items\r\n * @prop {Array} items - output items, each pointing to component or mesh with objectID\r\n * @prop {number} precision\r\n * @prop {import('./src/pushHeader.js').Header} header\r\n */\r\n\r\n/**\r\n * @param {To3MF} options\r\n * @returns string\r\n */\r\nexport function to3dmodel({ meshes = [], components = [], items = [], precision = 17, header }) {\r\n // items to be placed on the scene (build section of 3mf)\r\n const out = []\r\n\r\n // tag is opened here\r\n pushHeader(out, header)\r\n\r\n // #region resources\r\n out.push(' \\n')\r\n\r\n if (items.length == 0) {\r\n console.error('3MF empty build! Include items or simple.')\r\n }\r\n\r\n meshes.forEach(({ id, vertices, indices, name }) => pushObjectWithMesh(out, id, vertices, indices, precision, name))\r\n\r\n components.forEach(({ id, children, name }) => {\r\n pushObjectWithComponents(out, id, children, name)\r\n })\r\n\r\n out.push(' \\n')\r\n // #endregion\r\n\r\n out.push(`\\n`)\r\n items.forEach(({ objectID, transform }) => {\r\n out.push(makeItem(objectID, transform))\r\n })\r\n out.push('\\n')\r\n\r\n out.push('\\n') // model tag was opened in the pushHeader()\r\n\r\n return out.join('')\r\n}\r\n\r\n/** Simple export provided meshes that have transform attached to them and autocreate items and pass to to3dmodel.\r\n *\r\n * @param {Array} meshes\r\n * @param {import('./src/pushHeader.js').Header} header\r\n * @param {number} precision\r\n * @returns string\r\n */\r\nexport function to3dmodelSimple(meshes, header, precision) {\r\n const items = []\r\n meshes.forEach(({ id, transform }) => {\r\n items.push({ objectID: id, transform })\r\n })\r\n return to3dmodel({ meshes, items, header, precision })\r\n}\r\n\r\n/** File that describes file relationships inside a 3mf */\r\nexport class FileForRelThumbnail {\r\n constructor() {\r\n this.idSeq = 0\r\n this.lines = [\r\n ``,\r\n ``,\r\n ]\r\n }\r\n get name() {\r\n return '_rels/.rels'\r\n }\r\n /**\r\n *\r\n * @param {*} target file path\r\n * @param {*} xmlType xml schema url\r\n */\r\n addRel(target, xmlType) {\r\n this.lines.push(` `)\r\n }\r\n add3dModel(path) {\r\n this.addRel(path, 'http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel')\r\n }\r\n addThumbnail(path) {\r\n this.addRel(path, 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail')\r\n }\r\n\r\n get content() {\r\n return this.lines.join('\\n') + `\\n`\r\n }\r\n}\r\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n }\n else\n strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain)\n strm.ondrain(dat[0]);\n }\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n if (flush) {\n strm.flush = function () { w.postMessage([]); };\n }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o)\n : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain)\n _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this.d & 1))\n return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c)\n _this.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 2x3 Matrix\n * @module mat2d\n * @description\n * A mat2d contains six elements defined as:\n *
\n * [a, b,\n *  c, d,\n *  tx, ty]\n * 
\n * This is a short form for the 3x3 matrix:\n *
\n * [a, b, 0,\n *  c, d, 0,\n *  tx, ty, 1]\n * 
\n * The last column is ignored so the array is shorter and operations are faster.\n */\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Create a new mat2d with the given values\n *\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} A new mat2d\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Set the components of a mat2d to the given values\n *\n * @param {mat2d} out the receiving matrix\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} out\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2d} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat2d} out\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2d\n *\n * @param {ReadonlyMat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\n * Adds two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2d} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2d} out the receiving vector\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2d} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat2d.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nexport var perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nexport var ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {ReadonlyQuat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\n * Returns a string representation of a quatenion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\n\nexport var clone = vec4.clone;\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\n\nexport var fromValues = vec4.fromValues;\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\n\nexport var copy = vec4.copy;\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\n\nexport var set = vec4.set;\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\n\nexport var add = vec4.add;\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\n\nexport var scale = vec4.scale;\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nexport var dot = vec4.dot;\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\n\nexport var lerp = vec4.lerp;\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport var length = vec4.length;\n/**\n * Alias for {@link quat.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\n\nexport var normalize = vec4.normalize;\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat} a The first vector.\n * @param {ReadonlyQuat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport var equals = vec4.equals;\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\n * Dual Quaternion
\n * Format: [real, dual]
\n * Quaternion format: XYZW
\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\n * @module quat2\n */\n\n/**\n * Creates a new identity dual quat\n *\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat2} a dual quaternion to clone\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\n * Creates a new dual quat initialized with the given values\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\n * Creates a new dual quat from the given values (quat and translation)\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component (translation)\n * @param {Number} y2 Y component (translation)\n * @param {Number} z2 Z component (translation)\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\n * Creates a dual quat from a quaternion and a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q a normalized quaternion\n * @param {ReadonlyVec3} t tranlation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Creates a dual quat from a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyVec3} t translation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a dual quat from a quaternion\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q the quaternion\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a new dual quat from a matrix (4x4)\n *\n * @param {quat2} out the dual quaternion\n * @param {ReadonlyMat4} a the matrix\n * @returns {quat2} dual quat receiving operation result\n * @function\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\n * Copy the values from one dual quat to another\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the source dual quaternion\n * @returns {quat2} out\n * @function\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Set a dual quat to the identity dual quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @returns {quat2} out\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Set the components of a dual quat to the given values\n *\n * @param {quat2} out the receiving quaternion\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} out\n * @function\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\n * Gets the real part of a dual quat\n * @param {quat} out real part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} real part\n */\n\nexport var getReal = quat.copy;\n/**\n * Gets the dual part of a dual quat\n * @param {quat} out dual part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} dual part\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\n * Set the real component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the real part\n * @returns {quat2} out\n * @function\n */\n\nexport var setReal = quat.copy;\n/**\n * Set the dual component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the dual part\n * @returns {quat2} out\n * @function\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\n * Gets the translation of a normalized dual quat\n * @param {vec3} out translation\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\n * @return {vec3} translation\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\n * Translates a dual quat by the given vector\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {quat2} out\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\n * Rotates a dual quat around the X axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Y axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Z axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (a * q)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @returns {quat2} out\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (q * a)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @returns {quat2} out\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\n * Rotates a dual quat around a given axis. Does the normalisation automatically\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @param {Number} rad how far the rotation should be\n * @returns {quat2} out\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Adds two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n * @function\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\n * Multiplies two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\n * Alias for {@link quat2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Scales a dual quat by a scalar number\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the dual quat to scale\n * @param {Number} b amount to scale the dual quat by\n * @returns {quat2} out\n * @function\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\n *\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nexport var dot = quat.dot;\n/**\n * Performs a linear interpolation between two dual quats's\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat2} out\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\n * @returns {quat2} out\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\n * Calculates the conjugate of a dual quat\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\n * @returns {quat2} out\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Calculates the length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate length of\n * @returns {Number} length of a\n * @function\n */\n\nexport var length = quat.length;\n/**\n * Alias for {@link quat2.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Calculates the squared length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\n * Alias for {@link quat2.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Normalize a dual quat\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quaternion to normalize\n * @returns {quat2} out\n * @function\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\n * Returns a string representation of a dual quatenion\n *\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\n * @returns {String} string representation of the dual quat\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat2} a the first dual quaternion.\n * @param {ReadonlyQuat2} b the second dual quaternion.\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat2} a the first dual quat.\n * @param {ReadonlyQuat2} b the second dual quat.\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\nvar Module = (() => {\n var _scriptName = import.meta.url;\n \n return (\nasync function(moduleArg = {}) {\n var moduleRtn;\n\nvar Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window==\"object\";var ENVIRONMENT_IS_WORKER=typeof importScripts==\"function\";var ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){const{createRequire:createRequire}=await import(\"module\");var require=createRequire(import.meta.url)}var _ManifoldInitialized=false;Module.setup=function(){if(_ManifoldInitialized)return;_ManifoldInitialized=true;function toVec(vec,list,f=(x=>x)){if(list){for(let x of list){vec.push_back(f(x))}}return vec}function fromVec(vec,f=(x=>x)){const result=[];const size=vec.size();for(let i=0;ix)){const result=[];const nPoly=vec.size();for(let i=0;itoVec(new Module.Vector_vec2,poly,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p}))}function disposePolygons(polygonsVec){for(let i=0;iresult.min[f]),max:[\"x\",\"y\"].map(f=>result.max[f])}};Module.CrossSection.prototype.offset=function(delta,joinType=\"Square\",miterLimit=2,circularSegments=0){return this._Offset(delta,joinTypeToInt(joinType),miterLimit,circularSegments)};Module.CrossSection.prototype.extrude=function(height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){scaleTop=vararg2vec2([scaleTop]);const man=Module._Extrude(this._ToPolygons(),height,nDivisions,twistDegrees,scaleTop);return center?man.translate([0,0,-height/2]):man};Module.CrossSection.prototype.revolve=function(circularSegments=0,revolveDegrees=360){return Module._Revolve(this._ToPolygons(),circularSegments,revolveDegrees)};Module.CrossSection.prototype.add=function(other){return this._add(cross(other))};Module.CrossSection.prototype.subtract=function(other){return this._subtract(cross(other))};Module.CrossSection.prototype.intersect=function(other){return this._intersect(cross(other))};Module.CrossSection.prototype.toPolygons=function(){const vec=this._ToPolygons();const result=vec2polygons(vec);vec.delete();return result};Module.Manifold.prototype.smoothOut=function(minSharpAngle=60,minSmoothness=0){return this._SmoothOut(minSharpAngle,minSmoothness)};Module.Manifold.prototype.warp=function(func){const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,\"double\");const y=getValue(vec3Ptr+8,\"double\");const z=getValue(vec3Ptr+16,\"double\");const vert=[x,y,z];func(vert);setValue(vec3Ptr,vert[0],\"double\");setValue(vec3Ptr+8,vert[1],\"double\");setValue(vec3Ptr+16,vert[2],\"double\")},\"vi\");const out=this._Warp(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return out};Module.Manifold.prototype.calculateNormals=function(normalIdx,minSharpAngle=60){return this._CalculateNormals(normalIdx,minSharpAngle)};Module.Manifold.prototype.setProperties=function(numProp,func){const oldNumProp=this.numProp();const wasmFuncPtr=addFunction(function(newPtr,vec3Ptr,oldPtr){const newProp=[];for(let i=0;iresult.min[f]),max:[\"x\",\"y\",\"z\"].map(f=>result.max[f])}};class Mesh{constructor({numProp:numProp=3,triVerts:triVerts=new Uint32Array,vertProperties:vertProperties=new Float32Array,mergeFromVert:mergeFromVert,mergeToVert:mergeToVert,runIndex:runIndex,runOriginalID:runOriginalID,faceID:faceID,halfedgeTangent:halfedgeTangent,runTransform:runTransform}={}){this.numProp=numProp;this.triVerts=triVerts;this.vertProperties=vertProperties;this.mergeFromVert=mergeFromVert;this.mergeToVert=mergeToVert;this.runIndex=runIndex;this.runOriginalID=runOriginalID;this.faceID=faceID;this.halfedgeTangent=halfedgeTangent;this.runTransform=runTransform}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:changed,mesh:mesh}=Module._Merge(this);Object.assign(this,{...mesh});return changed}verts(tri){return this.triVerts.subarray(3*tri,3*(tri+1))}position(vert){return this.vertProperties.subarray(this.numProp*vert,this.numProp*vert+3)}extras(vert){return this.vertProperties.subarray(this.numProp*vert+3,this.numProp*(vert+1))}tangent(halfedge){return this.halfedgeTangent.subarray(4*halfedge,4*(halfedge+1))}transform(run){const mat4=new Array(16);for(const col of[0,1,2,3]){for(const row of[0,1,2]){mat4[4*col+row]=this.runTransform[12*run+3*col+row]}}mat4[15]=1;return mat4}}Module.Mesh=Mesh;Module.Manifold.prototype.getMesh=function(normalIdx=[0,0,0]){if(normalIdx instanceof Array)normalIdx={0:normalIdx[0],1:normalIdx[1],2:normalIdx[2]};return new Mesh(this._GetMeshJS(normalIdx))};Module.ManifoldError=function ManifoldError(code,...args){let message=\"Unknown error\";switch(code){case Module.status.NonFiniteVertex.value:message=\"Non-finite vertex\";break;case Module.status.NotManifold.value:message=\"Not manifold\";break;case Module.status.VertexOutOfBounds.value:message=\"Vertex index out of bounds\";break;case Module.status.PropertiesWrongLength.value:message=\"Properties have wrong length\";break;case Module.status.MissingPositionProperties.value:message=\"Less than three properties\";break;case Module.status.MergeVectorsDifferentLengths.value:message=\"Merge vectors have different lengths\";break;case Module.status.MergeIndexOutOfBounds.value:message=\"Merge index out of bounds\";break;case Module.status.TransformWrongLength.value:message=\"Transform vector has wrong length\";break;case Module.status.RunIndexWrongLength.value:message=\"Run index vector has wrong length\";break;case Module.status.FaceIDWrongLength.value:message=\"Face ID vector has wrong length\";case Module.status.InvalidConstruction.value:message=\"Manifold constructed with invalid parameters\"}const base=Error.apply(this,[message,...args]);base.name=this.name=\"ManifoldError\";this.message=base.message;this.stack=base.stack;this.code=code};Module.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:Module.ManifoldError,writable:true,configurable:true}});Module.CrossSection=function(polygons,fillRule=\"Positive\"){const polygonsVec=polygons2vec(polygons);const cs=new CrossSectionCtor(polygonsVec,fillRuleToInt(fillRule));disposePolygons(polygonsVec);return cs};Module.CrossSection.ofPolygons=function(polygons,fillRule=\"Positive\"){return new Module.CrossSection(polygons,fillRule)};Module.CrossSection.square=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1};else if(typeof args[0]==\"number\")size={x:args[0],y:args[0]};else size=vararg2vec2(args);const center=args[1]||false;return Module._Square(size,center)};Module.CrossSection.circle=function(radius,circularSegments=0){return Module._Circle(radius,circularSegments)};function crossSectionBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_crossSection;for(const cs of args)v.push_back(cross(cs));const result=Module[\"_crossSection\"+name](v);v.delete();return result}}Module.CrossSection.compose=crossSectionBatchbool(\"Compose\");Module.CrossSection.union=crossSectionBatchbool(\"UnionN\");Module.CrossSection.difference=crossSectionBatchbool(\"DifferenceN\");Module.CrossSection.intersection=crossSectionBatchbool(\"IntersectionN\");function pushVec2(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p})}Module.CrossSection.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec2;for(const cs of args){if(cs instanceof CrossSectionCtor){Module._crossSectionCollectVertices(pts,cs)}else if(cs instanceof Array&&cs.length==2&&typeof cs[0]==\"number\"){pts.push_back({x:cs[0],y:cs[1]})}else if(cs.x){pts.push_back(cs)}else{const wrap=cs[0].length==2&&typeof cs[0][0]==\"number\"||cs[0].x;const polys=wrap?[cs]:cs;for(const poly of polys)pushVec2(pts,poly)}}const result=Module._crossSectionHullPoints(pts);pts.delete();return result};Module.CrossSection.prototype=Object.create(CrossSectionCtor.prototype);Object.defineProperty(Module.CrossSection,Symbol.hasInstance,{get:()=>t=>t instanceof CrossSectionCtor});const ManifoldCtor=Module.Manifold;Module.Manifold=function(mesh){const manifold=new ManifoldCtor(mesh);const status=manifold.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return manifold};Module.Manifold.ofMesh=function(mesh){return new Module.Manifold(mesh)};Module.Manifold.tetrahedron=function(){return Module._Tetrahedron()};Module.Manifold.cube=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1,z:1};else if(typeof args[0]==\"number\")size={x:args[0],y:args[0],z:args[0]};else size=vararg2vec3(args);const center=args[1]||false;return Module._Cube(size,center)};Module.Manifold.cylinder=function(height,radiusLow,radiusHigh=-1,circularSegments=0,center=false){return Module._Cylinder(height,radiusLow,radiusHigh,circularSegments,center)};Module.Manifold.sphere=function(radius,circularSegments=0){return Module._Sphere(radius,circularSegments)};Module.Manifold.smooth=function(mesh,sharpenedEdges=[]){const sharp=new Module.Vector_smoothness;toVec(sharp,sharpenedEdges);const result=Module._Smooth(mesh,sharp);sharp.delete();return result};Module.Manifold.extrude=function(polygons,height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,\"Positive\");return cs.extrude(height,nDivisions,twistDegrees,scaleTop,center)};Module.Manifold.revolve=function(polygons,circularSegments=0,revolveDegrees=360){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,\"Positive\");return cs.revolve(circularSegments,revolveDegrees)};Module.Manifold.reserveIDs=function(n){return Module._ReserveIDs(n)};Module.Manifold.compose=function(manifolds){const vec=new Module.Vector_manifold;toVec(vec,manifolds);const result=Module._manifoldCompose(vec);vec.delete();return result};function manifoldBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_manifold;for(const m of args)v.push_back(m);const result=Module[\"_manifold\"+name+\"N\"](v);v.delete();return result}}Module.Manifold.union=manifoldBatchbool(\"Union\");Module.Manifold.difference=manifoldBatchbool(\"Difference\");Module.Manifold.intersection=manifoldBatchbool(\"Intersection\");Module.Manifold.levelSet=function(sdf,bounds,edgeLength,level=0,precision=-1){const bounds2={min:{x:bounds.min[0],y:bounds.min[1],z:bounds.min[2]},max:{x:bounds.max[0],y:bounds.max[1],z:bounds.max[2]}};const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,\"double\");const y=getValue(vec3Ptr+8,\"double\");const z=getValue(vec3Ptr+16,\"double\");const vert=[x,y,z];return sdf(vert)},\"di\");const out=Module._LevelSet(wasmFuncPtr,bounds2,edgeLength,level,precision);removeFunction(wasmFuncPtr);return out};function pushVec3(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1],z:p[2]};return p})}Module.Manifold.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec3;for(const m of args){if(m instanceof ManifoldCtor){Module._manifoldCollectVertices(pts,m)}else if(m instanceof Array&&m.length==3&&typeof m[0]==\"number\"){pts.push_back({x:m[0],y:m[1],z:m[2]})}else if(m.x){pts.push_back(m)}else{pushVec3(pts,m)}}const result=Module._manifoldHullPoints(pts);pts.delete();return result};Module.Manifold.prototype=Object.create(ManifoldCtor.prototype);Object.defineProperty(Module.Manifold,Symbol.hasInstance,{get:()=>t=>t instanceof ManifoldCtor});Module.triangulate=function(polygons,precision=-1){const polygonsVec=polygons2vec(polygons);const result=fromVec(Module._Triangulate(polygonsVec,precision),x=>[x[0],x[1],x[2]]);disposePolygons(polygonsVec);return result}};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram=\"./this.program\";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require(\"fs\");var nodePath=require(\"path\");scriptDirectory=require(\"url\").fileURLToPath(new URL(\"./\",import.meta.url));read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:\"utf8\")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:\"utf8\",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module[\"thisProgram\"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\\\/g,\"/\")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith(\"blob:\")){scriptDirectory=\"\"}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1)}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{if(isFileURI(url)){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null);return}fetch(url,{credentials:\"same-origin\"}).then(response=>{if(response.ok){return response.arrayBuffer()}return Promise.reject(new Error(response.status+\" : \"+response.url))}).then(onload,onerror)}}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var wasmMemory;var ABORT=false;var EXITSTATUS;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module[\"HEAP8\"]=HEAP8=new Int8Array(b);Module[\"HEAP16\"]=HEAP16=new Int16Array(b);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(b);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(b);Module[\"HEAP32\"]=HEAP32=new Int32Array(b);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(b);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(b);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module[\"monitorRunDependencies\"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module[\"monitorRunDependencies\"]?.(runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module[\"onAbort\"]?.(what);what=\"Aborted(\"+what+\")\";err(what);ABORT=true;EXITSTATUS=1;what+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix=\"data:application/octet-stream;base64,\";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith(\"file://\");function findWasmBinary(){if(Module[\"locateFile\"]){var f=\"manifold.wasm\";if(!isDataURI(f)){return locateFile(f)}return f}return new URL(\"manifold.wasm\",import.meta.url).href}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw\"both async and sync fetching of the wasm failed\"}function getBinaryPromise(binaryFile){if(!wasmBinary){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),error=>{try{resolve(getBinarySync(binaryFile))}catch(e){reject(e)}})})}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming==\"function\"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch==\"function\"){return fetch(binaryFile,{credentials:\"same-origin\"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function getWasmImports(){return{a:wasmImports}}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports[\"xa\"];updateMemoryViews();wasmTable=wasmExports[\"Aa\"];addOnInit(wasmExports[\"ya\"]);removeRunDependency(\"wasm-instantiate\");return wasmExports}addRunDependency(\"wasm-instantiate\");function receiveInstantiationResult(result){receiveInstance(result[\"instance\"])}if(Module[\"instantiateWasm\"]){try{return Module[\"instantiateWasm\"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":return HEAP8[ptr];case\"i8\":return HEAP8[ptr];case\"i16\":return HEAP16[ptr>>1];case\"i32\":return HEAP32[ptr>>2];case\"i64\":abort(\"to do getValue(i64) use WASM_BIGINT\");case\"float\":return HEAPF32[ptr>>2];case\"double\":return HEAPF64[ptr>>3];case\"*\":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module[\"noExitRuntime\"]||true;function setValue(ptr,value,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":HEAP8[ptr]=value;break;case\"i8\":HEAP8[ptr]=value;break;case\"i16\":HEAP16[ptr>>1]=value;break;case\"i32\":HEAP32[ptr>>2]=value;break;case\"i64\":abort(\"to do setValue(i64) use WASM_BIGINT\");case\"float\":HEAPF32[ptr>>2]=value;break;case\"double\":HEAPF64[ptr>>3]=value;break;case\"*\":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw exceptionLast};var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var __abort_js=()=>{abort(\"\")};var structRegistrations={};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function readPointer(pointer){return this[\"fromWireType\"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError;var throwInternalError=message=>{throw new InternalError(message)};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError(\"Mismatched type converter count\")}for(var i=0;i{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_finalize_value_object=structType=>{var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>getterReturnType[\"fromWireType\"](getter(getterContext,ptr)),write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType[\"toWireType\"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,fromWireType:ptr=>{var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},toWireType:(destructors,o)=>{for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError(`Missing field: \"${fieldName}\"`)}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:rawDestructor}]})};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{};var embind_init_charCodes=()=>{var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes};var embind_charCodes;var readLatin1String=ptr=>{var ret=\"\";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret};var BindingError;var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type \"${name}\" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){if(!(\"argPackAdvance\"in registeredInstance)){throw new TypeError(\"registerType registeredInstance requires argPackAdvance\")}return sharedRegisterType(rawType,registeredInstance,options)}var GenericWireTypeSize=8;var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(pointer){return this[\"fromWireType\"](HEAPU8[pointer])},destructorFunction:null})};var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+\" instance already deleted\")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredPointers={};var getInheritedInstanceCount=()=>Object.keys(registeredInstances).length;var getLiveInheritedInstances=()=>{var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj[\"delete\"]()}};var delayFunction;var setDelayFunction=fn=>{delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}};var init_embind=()=>{Module[\"getInheritedInstanceCount\"]=getInheritedInstanceCount;Module[\"getLiveInheritedInstances\"]=getLiveInheritedInstances;Module[\"flushPendingDeletes\"]=flushPendingDeletes;Module[\"setDelayFunction\"]=setDelayFunction};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError(\"ptr should not be undefined\")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError(\"makeClassHandle requires ptr and ptrType\")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError(\"Both smartPtrType and smartPtr must be specified\")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance[\"clone\"]()}else{var rv=registeredInstance[\"clone\"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var attachFinalizer=handle=>{if(\"undefined\"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError(\"Object already scheduled for deletion\")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError(\"Object already scheduled for deletion\")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}})};function ClassHandle(){}var createNamedFunction=(name,body)=>Object.defineProperty(body,\"name\",{value:name});var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{if(undefined===name){return\"_unknown\"}name=name.replace(/[^a-zA-Z0-9_]/g,\"$\");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError(\"Passing raw pointer to smart pointer is illegal\")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle[\"clone\"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle[\"delete\"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError(\"Unsupporting sharing policy\")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this[\"toWireType\"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this[\"toWireType\"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this[\"toWireType\"]=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError(\"Replacing nonexistent public symbol\")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var dynCallLegacy=(sig,ptr,args)=>{sig=sig.replace(/p/g,\"i\");var f=Module[\"dynCall_\"+sig];return f(ptr,...args)};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args=[])=>{if(sig.includes(\"j\")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr)(...args);return rtn};var getDynCaller=(sig,ptr)=>(...args)=>dynCall(sig,ptr,args);var embind__requireFunction=(signature,rawFunction)=>{signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes(\"j\")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!=\"function\"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};var extendError=(baseErrorType,errorName)=>{var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+\"\\n\"+stack.replace(/^Error(:[^\\n]*)?\\n/,\"\")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return`${this.name}: ${this.message}`}};return errorClass};var UnboundTypeError;var getTypeName=type=>{var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([\", \"]))};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError(\"Use 'new' to construct \"+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+\" has no accessible constructor\")}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+\"*\",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+\" const*\",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i>2])}return array};function usesDestructorStack(argTypes){for(var i=1;i0?\", \":\"\")+argsListWired}invokerFnBody+=(returns||isAsync?\"var rv = \":\"\")+\"invoker(fn\"+(argsListWired.length>0?\", \":\"\")+argsListWired+\");\\n\";if(needsDestructorStack){invokerFnBody+=\"runDestructors(destructors);\\n\"}else{for(var i=isClassMethodFunc?1:2;i{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf(\"(\");if(argsIndex!==-1){return signature.substr(0,argsIndex)}else{return signature}};var __embind_register_class_function=(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);methodName=getFunctionName(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith(\"@@\")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};var emval_freelist=[];var emval_handles=[];var __emval_decref=handle=>{if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}};var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length;var init_emval=()=>{emval_handles.push(0,1,undefined,1,null,1,true,1,false,1);Module[\"count_emval_handles\"]=count_emval_handles};var Emval={toValue:handle=>{if(!handle){throwBindingError(\"Cannot use deleted val. handle = \"+handle)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:\"emscripten::val\",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};var __embind_register_emval=rawType=>registerType(rawType,EmValType);var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this[\"fromWireType\"](HEAP8[pointer])}:function(pointer){return this[\"fromWireType\"](HEAPU8[pointer])};case 2:return signed?function(pointer){return this[\"fromWireType\"](HEAP16[pointer>>1])}:function(pointer){return this[\"fromWireType\"](HEAPU16[pointer>>1])};case 4:return signed?function(pointer){return this[\"fromWireType\"](HEAP32[pointer>>2])}:function(pointer){return this[\"fromWireType\"](HEAPU32[pointer>>2])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_enum=(rawType,name,size,isSigned)=>{name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,fromWireType:function(c){return this.constructor.values[c]},toWireType:(destructors,c)=>c.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};var __embind_register_enum_value=(rawEnumType,name,enumValue)=>{var enumType=requireRegisteredType(rawEnumType,\"enum\");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value};var embindRepr=v=>{if(v===null){return\"null\"}var t=typeof v;if(t===\"object\"||t===\"array\"||t===\"function\"){return v.toString()}else{return\"\"+v}};var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this[\"fromWireType\"](HEAPF32[pointer>>2])};case 8:return function(pointer){return this[\"fromWireType\"](HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:value=>value,toWireType:(destructors,value)=>value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<>>bitshift}var isUnsignedType=name.includes(\"unsigned\");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,fromWireType:fromWireType,toWireType:toWireType,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:decodeMemoryView,argPackAdvance:GenericWireTypeSize,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})};var __embind_register_optional=(rawOptionalType,rawType)=>{__embind_register_emval(rawOptionalType)};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str=\"\";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\";var __embind_register_std_string=(rawType,name)=>{name=readLatin1String(name);var stdStringIsUTF8=name===\"std::string\";registerType(rawType,{name:name,fromWireType(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError(\"String has UTF-16 code units that do not fit in 8 bits\")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i{var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str=\"\";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead)=>{var i=0;var str=\"\";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=readLatin1String(name);var decodeString,encodeString,readCharAt,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;readCharAt=pointer=>HEAPU16[pointer>>1]}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;readCharAt=pointer=>HEAPU32[pointer>>2]}registerType(rawType,{name:name,fromWireType:value=>{var length=HEAPU32[value>>2];var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||readCharAt(currentBytePtr)==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value==\"string\")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var __embind_register_value_object=(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor)=>{structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}};var __embind_register_value_object_field=(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})};var __embind_register_void=(rawType,name)=>{name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,argPackAdvance:0,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var emval_returnValue=(returnType,destructorsRef,handle)=>{var destructors=[];var result=returnType[\"toWireType\"](destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors)}return result};var __emval_as=(handle,returnType,destructorsRef)=>{handle=Emval.toValue(handle);returnType=requireRegisteredType(returnType,\"emval::as\");return emval_returnValue(returnType,destructorsRef,handle)};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol};var emval_methodCallers=[];var __emval_call_method=(caller,objHandle,methodName,destructorsRef,args)=>{caller=emval_methodCallers[caller];objHandle=Emval.toValue(objHandle);methodName=getStringOrSymbol(methodName);return caller(objHandle,objHandle[methodName],destructorsRef,args)};var __emval_equals=(first,second)=>{first=Emval.toValue(first);second=Emval.toValue(second);return first==second};var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i>2],\"parameter \"+i)}return a};var reflectConstruct=Reflect.construct;var __emval_get_method_caller=(argCount,argTypes,kind)=>{var types=emval_lookupTypes(argCount,argTypes);var retType=types.shift();argCount--;var functionBody=`return function (obj, func, destructorsRef, args) {\\n`;var offset=0;var argsList=[];if(kind===0){argsList.push(\"obj\")}var params=[\"retType\"];var args=[retType];for(var i=0;it.name).join(\", \")}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};var __emval_get_property=(handle,key)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>9){emval_handles[handle+1]+=1}};var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_new_object=()=>Emval.toHandle({});var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __emval_set_property=(handle,key,value)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value};var __emval_take_value=(type,arg)=>{type=requireRegisteredType(type,\"_emval_take_value\");var v=type[\"readValueFromPointer\"](arg);return Emval.toHandle(v)};var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _llvm_eh_typeid_for=type=>type;var uleb128Encode=(n,target)=>{if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}};var sigToWasmTypes=sig=>{var typeNames={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\",e:\"externref\",p:\"i32\"};var type={parameters:[],results:sig[0]==\"v\"?[]:[typeNames[sig[0]]]};for(var i=1;i{var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={i:127,p:127,j:126,f:125,d:124,e:111};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i{if(typeof WebAssembly.Function==\"function\"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push(...typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{e:{f:func}});var wrappedFunc=instance.exports[\"f\"];return wrappedFunc};var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\"}return wasmTable.length-1};var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));setWasmTableEntry(index,null);freeTableIndexes.push(index)};InternalError=Module[\"InternalError\"]=class InternalError extends Error{constructor(message){super(message);this.name=\"InternalError\"}};embind_init_charCodes();BindingError=Module[\"BindingError\"]=class BindingError extends Error{constructor(message){super(message);this.name=\"BindingError\"}};init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module[\"UnboundTypeError\"]=extendError(Error,\"UnboundTypeError\");init_emval();var wasmImports={K:___cxa_begin_catch,aa:___cxa_end_catch,a:___cxa_find_matching_catch_2,k:___cxa_find_matching_catch_3,h:___cxa_throw,d:___resumeException,Z:__abort_js,oa:__embind_finalize_value_object,Y:__embind_register_bigint,la:__embind_register_bool,x:__embind_register_class,w:__embind_register_class_constructor,i:__embind_register_class_function,ka:__embind_register_emval,N:__embind_register_enum,t:__embind_register_enum_value,U:__embind_register_float,o:__embind_register_function,z:__embind_register_integer,s:__embind_register_memory_view,A:__embind_register_optional,T:__embind_register_std_string,M:__embind_register_std_wstring,B:__embind_register_value_object,pa:__embind_register_value_object_field,na:__embind_register_void,$:__emscripten_memcpy_js,ta:__emval_as,ia:__emval_call_method,va:__emval_decref,sa:__emval_equals,ma:__emval_get_method_caller,ua:__emval_get_property,ra:__emval_incref,F:__emval_new_cstring,V:__emval_new_object,W:__emval_run_destructors,wa:__emval_set_property,E:__emval_take_value,_:_emscripten_resize_heap,y:invoke_dd,H:invoke_dii,fa:invoke_diid,J:invoke_diii,u:invoke_diiiii,I:invoke_i,e:invoke_ii,b:invoke_iii,m:invoke_iiii,n:invoke_iiiii,D:invoke_iiiiii,X:invoke_iiij,j:invoke_v,f:invoke_vi,ea:invoke_vid,ca:invoke_vidi,g:invoke_vii,r:invoke_viid,ha:invoke_viidd,ga:invoke_viiddd,G:invoke_viiddi,O:invoke_viidi,ja:invoke_viididi,da:invoke_viidiidid,c:invoke_viii,L:invoke_viiid,qa:invoke_viiidddi,l:invoke_viiii,v:invoke_viiiii,S:invoke_viiiiid,p:invoke_viiiiii,Q:invoke_viiiiiii,P:invoke_viiiiiiiii,C:invoke_viiiiiiiiidiii,q:invoke_viiiiiiiiii,R:invoke_viiiiiiiiiiiiiiiiii,ba:_llvm_eh_typeid_for};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports[\"ya\"])();var ___getTypeName=a0=>(___getTypeName=wasmExports[\"za\"])(a0);var _free=a0=>(_free=wasmExports[\"Ba\"])(a0);var _malloc=a0=>(_malloc=wasmExports[\"Ca\"])(a0);var _setThrew=(a0,a1)=>(_setThrew=wasmExports[\"Da\"])(a0,a1);var __emscripten_tempret_set=a0=>(__emscripten_tempret_set=wasmExports[\"Ea\"])(a0);var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports[\"Fa\"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports[\"Ga\"])();var ___cxa_decrement_exception_refcount=a0=>(___cxa_decrement_exception_refcount=wasmExports[\"Ha\"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports[\"Ia\"])(a0);var ___cxa_can_catch=(a0,a1,a2)=>(___cxa_can_catch=wasmExports[\"Ja\"])(a0,a1,a2);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports[\"Ka\"])(a0);var dynCall_iiij=Module[\"dynCall_iiij\"]=(a0,a1,a2,a3,a4)=>(dynCall_iiij=Module[\"dynCall_iiij\"]=wasmExports[\"La\"])(a0,a1,a2,a3,a4);function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiidddi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dd(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viididi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiid(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidd(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddd(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diid(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidiidid(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vidi(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module[\"addFunction\"]=addFunction;Module[\"removeFunction\"]=removeFunction;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();moduleRtn=readyPromise;\n\n\n return moduleRtn;\n}\n);\n})();\nexport default Module;\n","// Copyright 2023 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Accessor, Extension, ExtensionProperty, GLTF, IProperty, PropertyType, ReaderContext, WriterContext} from '@gltf-transform/core';\n\nconst NAME = 'EXT_mesh_manifold';\nconst MERGE = 'MERGE';\n\ninterface IManifoldPrimitive extends IProperty {\n mergeIndices: Accessor;\n mergeValues: Accessor;\n indices: Accessor;\n runIndex: number[]|Uint32Array;\n}\n\ninterface ManifoldDef {\n manifoldPrimitive: GLTF.IMeshPrimitive;\n mergeIndices: number;\n mergeValues: number;\n}\n\nexport class ManifoldPrimitive extends ExtensionProperty {\n static EXTENSION_NAME = NAME;\n public declare extensionName: typeof NAME;\n public declare propertyType: 'ManifoldPrimitive';\n public declare parentTypes: [PropertyType.MESH];\n\n init() {\n ManifoldPrimitive.EXTENSION_NAME = NAME;\n this.propertyType = 'ManifoldPrimitive';\n this.parentTypes = [PropertyType.MESH];\n }\n\n getDefaults() {\n return Object.assign(\n super.getDefaults(),\n {manifoldPrimitive: null, mergeIndices: null, mergeValues: null});\n }\n\n getMergeIndices() {\n return this.getRef('mergeIndices');\n }\n\n getMergeValues() {\n return this.getRef('mergeValues');\n }\n\n setMerge(indicesAccessor: Accessor, valuesAccessor: Accessor) {\n if (indicesAccessor.getCount() !== valuesAccessor.getCount())\n throw new Error('merge vectors must be the same length.');\n this.setRef('mergeIndices', indicesAccessor);\n return this.setRef('mergeValues', valuesAccessor);\n }\n\n getRunIndex() {\n return this.get('runIndex');\n }\n\n setRunIndex(runIndex: number[]|Uint32Array) {\n return this.set('runIndex', runIndex);\n }\n\n setIndices(indices: Accessor) {\n return this.setRef('indices', indices);\n }\n\n getIndices() {\n return this.getRef('indices')!;\n }\n}\n\nexport class EXTManifold extends Extension {\n extensionName = NAME;\n prewriteTypes = [PropertyType.ACCESSOR];\n static EXTENSION_NAME = NAME;\n\n createManifoldPrimitive() {\n return new ManifoldPrimitive(this.document.getGraph());\n }\n\n read(context: ReaderContext) {\n const {json} = context.jsonDoc;\n const meshDefs = json.meshes || [];\n\n meshDefs.forEach((meshDef, meshIndex) => {\n if (!meshDef.extensions || !meshDef.extensions[NAME]) return;\n\n const mesh = context.meshes[meshIndex];\n const manifoldPrimitive = this.createManifoldPrimitive();\n mesh.setExtension(NAME, manifoldPrimitive);\n\n const manifoldDef = meshDef.extensions[NAME] as ManifoldDef;\n\n if (manifoldDef.manifoldPrimitive) {\n let count = 0;\n const runIndex = Array();\n runIndex.push(count);\n for (const primitive of mesh.listPrimitives()) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n count += indices.getCount();\n runIndex.push(count);\n }\n manifoldPrimitive.setRunIndex(runIndex);\n manifoldPrimitive.setIndices(\n context.accessors[manifoldDef.manifoldPrimitive.indices!]);\n }\n\n if (manifoldDef.mergeIndices != null && manifoldDef.mergeValues != null) {\n manifoldPrimitive.setMerge(\n context.accessors[manifoldDef.mergeIndices],\n context.accessors[manifoldDef.mergeValues]);\n }\n });\n\n return this;\n }\n\n prewrite(context: WriterContext) {\n this.document.getRoot().listMeshes().forEach((mesh) => {\n const manifoldPrimitive = mesh.getExtension(NAME) as ManifoldPrimitive;\n if (!manifoldPrimitive) return;\n\n const indices = manifoldPrimitive.getIndices();\n context.addAccessorToUsageGroup(\n indices, WriterContext.BufferViewUsage.ELEMENT_ARRAY_BUFFER);\n\n const mergeFrom = manifoldPrimitive.getMergeIndices();\n const mergeTo = manifoldPrimitive.getMergeValues();\n if (!mergeFrom || !mergeTo) return;\n\n context.addAccessorToUsageGroup(mergeFrom, MERGE);\n context.addAccessorToUsageGroup(mergeTo, MERGE);\n });\n return this;\n }\n\n write(context: WriterContext) {\n const {json} = context.jsonDoc;\n\n this.document.getRoot().listMeshes().forEach((mesh) => {\n const manifoldPrimitive = mesh.getExtension(NAME) as ManifoldPrimitive;\n if (!manifoldPrimitive) return;\n\n const meshIndex = context.meshIndexMap.get(mesh)!;\n const meshDef = json.meshes![meshIndex];\n\n const runIndex = manifoldPrimitive.getRunIndex();\n const numPrimitive = runIndex.length - 1;\n\n if (numPrimitive !== meshDef.primitives.length) {\n throw new Error(\n 'The number of primitives must be exactly one less than the length of runIndex.');\n }\n\n const mergeIndicesIndex =\n context.accessorIndexMap.get(manifoldPrimitive.getMergeIndices()!)!;\n const mergeValuesIndex =\n context.accessorIndexMap.get(manifoldPrimitive.getMergeValues()!)!;\n const mergeIndices = json.accessors![mergeIndicesIndex];\n const mergeValues = json.accessors![mergeValuesIndex];\n\n const existingPrimitive = meshDef.primitives[0];\n const primitive = {\n indices: context.accessorIndexMap.get(manifoldPrimitive.getIndices())!,\n mode: existingPrimitive.mode,\n attributes: {'POSITION': existingPrimitive.attributes['POSITION']}\n };\n\n const indices = json.accessors![primitive.indices];\n if (!indices) {\n return;\n }\n\n if (mergeIndices && mergeValues) {\n indices.sparse = {\n count: mergeIndices.count,\n indices: {\n bufferView: mergeIndices.bufferView!,\n byteOffset: mergeIndices.byteOffset,\n componentType: mergeIndices.componentType\n },\n values: {\n bufferView: mergeValues.bufferView!,\n byteOffset: mergeValues.byteOffset,\n }\n };\n }\n\n for (let i = 0; i < numPrimitive; ++i) {\n const accessor = json.accessors![meshDef.primitives[i].indices!];\n accessor.bufferView = indices.bufferView;\n accessor.byteOffset = indices.byteOffset! + 4 * runIndex[i];\n accessor.count = runIndex[i + 1] - runIndex[i];\n }\n\n meshDef.extensions = meshDef.extensions || {};\n meshDef.extensions[NAME] = {\n manifoldPrimitive: primitive,\n mergeIndices: mergeIndicesIndex,\n mergeValues: mergeValuesIndex\n };\n\n // Test the manifold primitive by replacing the material primitives\n // meshDef.primitives = [primitive];\n });\n\n return this;\n }\n}","// Copyright 2023 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Accessor, Document, Material, Mesh, Primitive, Texture, WebIO} from '@gltf-transform/core';\n\nimport {EXTManifold, ManifoldPrimitive} from './manifold-gltf';\nimport {Mesh as ManifoldMesh, MeshOptions} from './public/manifold-encapsulated-types';\n\nexport const attributeDefs = {\n 'POSITION': {type: Accessor.Type.VEC3, components: 3},\n 'NORMAL': {type: Accessor.Type.VEC3, components: 3},\n 'TANGENT': {type: Accessor.Type.VEC4, components: 4},\n 'TEXCOORD_0': {type: Accessor.Type.VEC2, components: 2},\n 'TEXCOORD_1': {type: Accessor.Type.VEC2, components: 2},\n 'COLOR_0': {type: Accessor.Type.VEC3, components: 3},\n 'JOINTS_0': {type: Accessor.Type.VEC4, components: 4},\n 'WEIGHTS_0': {type: Accessor.Type.VEC4, components: 4},\n 'SKIP_1': {type: null, components: 1},\n 'SKIP_2': {type: null, components: 2},\n 'SKIP_3': {type: null, components: 3},\n 'SKIP_4': {type: null, components: 4},\n};\n\nexport type Attribute = keyof(typeof attributeDefs);\n\nexport interface Properties {\n material: Material;\n attributes: Attribute[];\n}\n\n/**\n * Call this first to register the manifold extension so that readMesh and\n * writeMesh will work.\n */\nexport function setupIO(io: WebIO) {\n return io.registerExtensions([EXTManifold]);\n}\n\n/**\n * Read an input mesh into Manifold-compatible data structures, whether it\n * contains the EXT_mesh_manifold extension or not.\n *\n * @param mesh The Mesh to read.\n * @param attributes An array of attributes representing the order of desired\n * properties returned in the vertProperties array of the output mesh. If\n * omitted, this will be populated with the union of all attributes defined\n * in the primitives of the input mesh. If present, the first entry must be\n * 'POSITION', and any attributes in the primitives that are not included in\n * this list will be ignored, while those in the list but not defined in a\n * primitive will be populated with zeros.\n * @returns The returned mesh is suitable for initializing a Manifold or Mesh of\n * the Manifold library if desired. See Manifold documentation if you prefer\n * to use these GL arrays in a different library. The runProperties array\n * gives the Material and attributes list associated with each triangle run,\n * which in turn corresponds to a primitive of the input mesh. These\n * attributes are the intersection of the attributes present on the\n * primitive and those requested in the attributes input.\n */\nexport function readMesh(mesh: Mesh, attributes: Attribute[] = []):\n {mesh: MeshOptions, runProperties: Properties[]}|null {\n const primitives = mesh.listPrimitives();\n if (primitives.length === 0) {\n return null;\n }\n\n if (attributes.length === 0) {\n const attributeSet = new Set();\n for (const primitive of primitives) {\n const semantics = primitive.listSemantics() as Attribute[];\n for (const semantic of semantics) {\n attributeSet.add(semantic);\n }\n }\n let semantic: Attribute;\n for (semantic in attributeDefs) {\n if (attributeSet.has(semantic)) {\n attributes.push(semantic);\n attributeSet.delete(semantic);\n }\n }\n for (const semantic of attributeSet.keys()) {\n attributes.push(semantic);\n }\n }\n\n if (attributes.length < 1 || attributes[0] !== 'POSITION')\n throw new Error('First attribute must be \"POSITION\".');\n\n let numProp = 0;\n const attributeOffsets = attributes.map((numProp = 0, def => {\n const last = numProp;\n numProp += attributeDefs[def].components;\n return last;\n }));\n\n const manifoldPrimitive =\n mesh.getExtension('EXT_mesh_manifold') as ManifoldPrimitive;\n\n let vertPropArray = Array();\n let triVertArray = Array();\n const runIndexArray = [0];\n const mergeFromVertArray = Array();\n const mergeToVertArray = Array();\n const runProperties = Array();\n if (manifoldPrimitive != null) {\n const numVert = primitives[0].getAttribute('POSITION')!.getCount();\n const foundAttribute = attributes.map((a) => attributeDefs[a].type == null);\n vertPropArray = new Array(numProp * numVert);\n\n for (const primitive of primitives) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n\n const attributesIn = primitive.listSemantics() as Attribute[];\n\n attributes.forEach((attributeOut, idx) => {\n if (foundAttribute[idx]) {\n return;\n }\n for (const attributeIn of attributesIn) {\n if (attributeIn === attributeOut) {\n foundAttribute[idx] = true;\n const accessor = primitive.getAttribute(attributeIn)!;\n writeProperties(\n vertPropArray, accessor, numProp, attributeOffsets[idx]);\n }\n }\n });\n\n triVertArray = [...triVertArray, ...indices.getArray()!];\n runIndexArray.push(triVertArray.length);\n runProperties.push({\n material: primitive.getMaterial()!,\n attributes: attributesIn.filter(b => attributes.some(a => a == b))\n });\n }\n const mergeTriVert = manifoldPrimitive.getMergeIndices()?.getArray() ?? [];\n const mergeTo = manifoldPrimitive.getMergeValues()?.getArray() ?? [];\n const vert2merge = new Map();\n for (const [i, idx] of mergeTriVert.entries()) {\n vert2merge.set(triVertArray[idx], mergeTo[i]);\n }\n for (const [from, to] of vert2merge.entries()) {\n mergeFromVertArray.push(from);\n mergeToVertArray.push(to);\n }\n } else {\n for (const primitive of primitives) {\n const indices = primitive.getIndices();\n if (!indices) {\n console.log('Skipping non-indexed primitive ', primitive.getName());\n continue;\n }\n const numVert = vertPropArray.length / numProp;\n vertPropArray =\n [...vertPropArray, ...readPrimitive(primitive, numProp, attributes)];\n triVertArray =\n [...triVertArray, ...indices.getArray()!.map((i) => i + numVert)];\n runIndexArray.push(triVertArray.length);\n\n const attributesIn = primitive.listSemantics() as Attribute[];\n runProperties.push({\n material: primitive.getMaterial()!,\n attributes: attributesIn.filter(b => attributes.some(a => a == b))\n });\n }\n }\n const vertProperties = new Float32Array(vertPropArray);\n const triVerts = new Uint32Array(triVertArray);\n const runIndex = new Uint32Array(runIndexArray);\n const mergeFromVert = new Uint32Array(mergeFromVertArray);\n const mergeToVert = new Uint32Array(mergeToVertArray);\n\n const meshOut =\n {numProp, triVerts, vertProperties, runIndex, mergeFromVert, mergeToVert};\n\n return {mesh: meshOut, runProperties};\n}\n\n/**\n * Write a Manifold Mesh into a glTF Mesh object, using the EXT_mesh_manifold\n * extension to allow for lossless roundtrip of the manifold mesh through the\n * glTF file.\n *\n * @param doc The glTF Document to which this Mesh will be added.\n * @param manifoldMesh The Manifold Mesh to convert to glTF.\n * @param id2properties A map from originalID to Properties that include the\n * glTF Material and the set of attributes to output. All triangle runs with\n * the same originalID will be combined into a single output primitive. Any\n * originalIDs not found in the map will have the glTF default material and\n * no attributes beyond 'POSITION'. Each attributes array must correspond to\n * the manifoldMesh vertProperties, thus the first attribute must always be\n * 'POSITION'. Any properties that should not be output for a given\n * primitive must use the 'SKIP_*' attributes.\n * @returns The glTF Mesh to add to the Document.\n */\nexport function writeMesh(\n doc: Document, manifoldMesh: ManifoldMesh,\n id2properties: Map): Mesh {\n if (doc.getRoot().listBuffers().length === 0) {\n doc.createBuffer();\n }\n const buffer = doc.getRoot().listBuffers()[0];\n const manifoldExtension = doc.createExtension(EXTManifold);\n\n const mesh = doc.createMesh();\n const runIndex = Array();\n const attributeUnion = Array();\n const primitive2attributes = new Map();\n const numRun = manifoldMesh.runIndex.length - 1;\n let lastID = -1;\n for (let run = 0; run < numRun; ++run) {\n const id = manifoldMesh.runOriginalID[run];\n if (id == lastID) {\n continue;\n }\n lastID = id;\n runIndex.push(manifoldMesh.runIndex[run]);\n\n const indices = doc.createAccessor('primitive indices of ID ' + id)\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(1));\n const primitive = doc.createPrimitive().setIndices(indices);\n\n const properties = id2properties.get(id);\n if (properties) {\n const {material, attributes} = properties;\n if (attributes.length < 1 || attributes[0] !== 'POSITION')\n throw new Error('First attribute must be \"POSITION\".');\n\n primitive.setMaterial(material);\n primitive2attributes.set(primitive, attributes);\n\n properties.attributes.forEach((attribute, i) => {\n if (i >= attributeUnion.length) {\n attributeUnion.push(attribute);\n } else {\n const size = attributeDefs[attribute].components;\n const unionSize = attributeDefs[attributeUnion[i]].components;\n if (size != unionSize) {\n throw new Error(\n 'Attribute sizes do not correspond: ' + attribute + ' and ' +\n attributeUnion[i]);\n }\n if (attributeDefs[attributeUnion[i]].type == null) {\n attributeUnion[i] = attribute;\n }\n }\n });\n } else {\n primitive2attributes.set(primitive, ['POSITION']);\n }\n\n mesh.addPrimitive(primitive);\n }\n runIndex.push(manifoldMesh.runIndex[numRun]);\n\n const numVert = manifoldMesh.numVert;\n const numProp = manifoldMesh.numProp;\n let offset = 0;\n attributeUnion.forEach((attribute, aIdx) => {\n const def = attributeDefs[attribute];\n if (def == null)\n throw new Error(attribute + ' is not a recognized attribute.');\n\n if (def.type == null) {\n ++offset;\n return;\n }\n\n const n = def.components;\n if (offset + n > numProp) throw new Error('Too many attribute channels.');\n\n const array = new Float32Array(n * numVert);\n for (let v = 0; v < numVert; ++v) {\n for (let i = 0; i < n; ++i) {\n let x = manifoldMesh.vertProperties[numProp * v + offset + i];\n if (attribute == 'COLOR_0') {\n x = Math.max(0, Math.min(1, x));\n }\n array[n * v + i] = x;\n }\n }\n\n const accessor = doc.createAccessor(attribute)\n .setBuffer(buffer)\n .setType(def.type)\n .setArray(array);\n\n for (const primitive of mesh.listPrimitives()) {\n const attributes = primitive2attributes.get(primitive)!;\n if (attributes.length > aIdx &&\n attributeDefs[attributes[aIdx]].type != null) {\n primitive.setAttribute(attribute, accessor);\n }\n }\n offset += n;\n });\n\n const manifoldPrimitive = manifoldExtension.createManifoldPrimitive();\n mesh.setExtension('EXT_mesh_manifold', manifoldPrimitive);\n\n const indices = doc.createAccessor('manifold indices')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(manifoldMesh.triVerts);\n manifoldPrimitive.setIndices(indices);\n manifoldPrimitive.setRunIndex(runIndex);\n\n const vert2merge = [...Array(manifoldMesh.numVert).keys()];\n const ind = Array();\n const val = Array();\n if (manifoldMesh.mergeFromVert && manifoldMesh.mergeToVert) {\n for (const [i, from] of manifoldMesh.mergeFromVert.entries()) {\n vert2merge[from] = manifoldMesh.mergeToVert[i];\n }\n\n for (const [i, vert] of manifoldMesh.triVerts.entries()) {\n const newVert = vert2merge[vert];\n if (vert !== newVert) {\n ind.push(i);\n val.push(newVert);\n }\n }\n }\n if (ind.length > 0) {\n const indicesAccessor = doc.createAccessor('merge from')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(ind));\n const valuesAccessor = doc.createAccessor('merge to')\n .setBuffer(buffer)\n .setType(Accessor.Type.SCALAR)\n .setArray(new Uint32Array(val));\n manifoldPrimitive.setMerge(indicesAccessor, valuesAccessor);\n }\n\n return mesh;\n}\n\n/**\n * Helper function to dispose of a Mesh, useful when replacing an existing Mesh\n * with one from writeMesh.\n */\nexport function disposeMesh(mesh: Mesh) {\n if (!mesh) return;\n const primitives = mesh.listPrimitives();\n for (const primitive of primitives) {\n primitive.getIndices()?.dispose();\n for (const accessor of primitive.listAttributes()) {\n accessor.dispose();\n }\n }\n\n const manifoldPrimitive =\n mesh.getExtension('EXT_mesh_manifold') as ManifoldPrimitive;\n if (manifoldPrimitive) {\n manifoldPrimitive.getIndices()?.dispose();\n manifoldPrimitive.getMergeIndices()?.dispose();\n manifoldPrimitive.getMergeValues()?.dispose();\n }\n\n mesh.dispose();\n}\n\n/**\n * Helper function to download an image and apply it to the given texture.\n *\n * @param texture The texture to update\n * @param uri The location of the image to download\n */\nexport async function loadTexture(texture: Texture, uri: string) {\n const response = await fetch(uri);\n const blob = await response.blob();\n texture.setMimeType(blob.type);\n texture.setImage(new Uint8Array(await blob.arrayBuffer()));\n}\n\nfunction writeProperties(\n vertProperties: number[], accessor: Accessor, numProp: number,\n offset: number) {\n const array = accessor.getArray()!;\n const size = accessor.getElementSize();\n const numVert = accessor.getCount();\n for (let i = 0; i < numVert; ++i) {\n for (let j = 0; j < size; ++j) {\n vertProperties[numProp * i + offset + j] = array[i * size + j];\n }\n }\n}\n\nfunction readPrimitive(\n primitive: Primitive, numProp: number, attributes: Attribute[]) {\n const vertProperties: number[] = [];\n let offset = 0;\n for (const attribute of attributes) {\n const size = attributeDefs[attribute].components;\n if (attributeDefs[attribute].type == null) {\n offset += size;\n continue;\n }\n const accessor = primitive.getAttribute(attribute);\n if (accessor) {\n writeProperties(vertProperties, accessor, numProp, offset);\n }\n offset += size;\n }\n return vertProperties;\n}","// Copyright 2022 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {Accessor, Animation, AnimationSampler, Document, mat4, Material, Mesh as GLTFMesh, Node, WebIO} from '@gltf-transform/core';\nimport {KHRMaterialsUnlit, KHRONOS_EXTENSIONS} from '@gltf-transform/extensions';\nimport {fileForContentTypes, FileForRelThumbnail, to3dmodel} from '@jscadui/3mf-export';\nimport {strToU8, Zippable, zipSync} from 'fflate'\nimport * as glMatrix from 'gl-matrix';\n\nimport Module, {CrossSection, Manifold, ManifoldToplevel, Mesh, Vec3} from './built/manifold';\nimport {Properties, setupIO, writeMesh} from './gltf-io';\nimport {GLTFMaterial, Quat} from './public/editor';\n\ninterface GlobalDefaults {\n roughness: number;\n metallic: number;\n baseColorFactor: [number, number, number];\n alpha: number;\n unlit: boolean;\n animationLength: number;\n animationMode: 'loop'|'ping-pong';\n}\n\ninterface WorkerStatic extends ManifoldToplevel {\n GLTFNode: typeof GLTFNode;\n show(manifold: Manifold): Manifold;\n only(manifold: Manifold): Manifold;\n setMaterial(manifold: Manifold, material: GLTFMaterial): Manifold;\n setMorphStart(manifold: Manifold, func: (v: Vec3) => void): void;\n setMorphEnd(manifold: Manifold, func: (v: Vec3) => void): void;\n cleanup(): void;\n}\n\nexport const module = await Module() as WorkerStatic;\nmodule.setup();\n\n// Faster on modern browsers than Float32Array\nglMatrix.glMatrix.setMatrixArrayType(Array);\n\nconst io = setupIO(new WebIO());\nio.registerExtensions(KHRONOS_EXTENSIONS);\n\n// manifold static methods (that return a new manifold)\nconst manifoldStaticFunctions = [\n 'cube', 'cylinder', 'sphere', 'tetrahedron', 'extrude', 'revolve', 'compose',\n 'union', 'difference', 'intersection', 'levelSet', 'smooth', 'ofMesh', 'hull'\n];\n// manifold member functions (that return a new manifold)\nconst manifoldMemberFunctions = [\n 'add',\n 'subtract',\n 'intersect',\n 'decompose',\n 'warp',\n 'transform',\n 'translate',\n 'rotate',\n 'scale',\n 'mirror',\n 'calculateCurvature',\n 'calculateNormals',\n 'smoothByNormals',\n 'smoothOut',\n 'refine',\n 'refineToLength',\n 'setProperties',\n 'asOriginal',\n 'trimByPlane',\n 'split',\n 'splitByPlane',\n 'slice',\n 'project',\n 'hull'\n];\n// CrossSection static methods (that return a new cross-section)\nconst crossSectionStaticFunctions = [\n 'square', 'circle', 'union', 'difference', 'intersection', 'compose',\n 'ofPolygons', 'hull'\n];\n// CrossSection member functions (that return a new cross-section)\nconst crossSectionMemberFunctions = [\n 'add', 'subtract', 'intersect', 'rectClip', 'decompose', 'transform',\n 'translate', 'rotate', 'scale', 'mirror', 'simplify', 'offset', 'hull'\n];\n// top level functions that construct a new manifold/mesh\nconst toplevelConstructors = ['show', 'only', 'setMaterial'];\nconst toplevel = [\n 'setMinCircularAngle', 'setMinCircularEdgeLength', 'setCircularSegments',\n 'getCircularSegments', 'resetToCircularDefaults', 'Mesh', 'GLTFNode',\n 'Manifold', 'CrossSection', 'setMorphStart', 'setMorphEnd'\n];\nconst exposedFunctions = toplevelConstructors.concat(toplevel);\n\n// Setup memory management, such that users don't have to care about\n// calling `delete` manually.\n// Note that this only fixes memory leak across different runs: the memory\n// will only be freed when the compilation finishes.\n\nconst memoryRegistry = new Array();\n\nfunction addMembers(\n className: string, methodNames: Array, areStatic: boolean) {\n //@ts-ignore\n const cls = module[className];\n const obj = areStatic ? cls : cls.prototype;\n for (const name of methodNames) {\n const originalFn = obj[name];\n obj[name] = function(...args: any) {\n //@ts-ignore\n const result = originalFn(...args);\n memoryRegistry.push(result);\n return result;\n };\n }\n}\n\naddMembers('Manifold', manifoldMemberFunctions, false);\naddMembers('Manifold', manifoldStaticFunctions, true);\naddMembers('CrossSection', crossSectionMemberFunctions, false);\naddMembers('CrossSection', crossSectionStaticFunctions, true);\n\nfor (const name of toplevelConstructors) {\n //@ts-ignore\n const originalFn = module[name];\n //@ts-ignore\n module[name] = function(...args: any) {\n const result = originalFn(...args);\n memoryRegistry.push(result);\n return result;\n };\n}\n\n// Debug setup to show source meshes\nlet ghost = false;\nconst shown = new Map();\nconst singles = new Map();\n\nconst FPS = 30;\n\nconst GLOBAL_DEFAULTS = {\n roughness: 0.2,\n metallic: 1,\n baseColorFactor: [1, 1, 0] as [number, number, number],\n alpha: 1,\n unlit: false,\n animationLength: 1,\n animationMode: 'loop'\n};\n\nconst SHOW = {\n baseColorFactor: [1, 0, 0],\n alpha: 0.25,\n roughness: 1,\n metallic: 0\n} as GLTFMaterial;\n\nconst GHOST = {\n baseColorFactor: [0.5, 0.5, 0.5],\n alpha: 0.25,\n roughness: 1,\n metallic: 0\n} as GLTFMaterial;\n\nconst nodes = new Array();\nconst id2material = new Map();\nconst materialCache = new Map();\nconst object2globalID = new Map();\nconst manifold2morph = new Map();\n// lib3mf doesn't like objectid=0\nlet nextGlobalID = 1;\nlet animation: Animation;\nlet timesAccessor: Accessor;\nlet weightsAccessor: Accessor;\nlet weightsSampler: AnimationSampler;\nlet hasAnimation: boolean;\n\nexport function cleanup() {\n for (const obj of memoryRegistry) {\n // decompose result is an array of manifolds\n if (obj instanceof Array)\n for (const elem of obj) elem.delete();\n else\n obj.delete();\n }\n memoryRegistry.length = 0;\n\n ghost = false;\n shown.clear();\n singles.clear();\n nodes.length = 0;\n id2material.clear();\n materialCache.clear();\n object2globalID.clear();\n manifold2morph.clear();\n nextGlobalID = 1;\n}\n\ninterface Morph {\n start?: (v: Vec3) => void;\n end?: (v: Vec3) => void;\n}\n\ninterface Mesh3MF {\n id: string;\n vertices: Float32Array;\n indices: Uint32Array;\n name?: string;\n}\n\ninterface Child3MF {\n objectID: string;\n transform?: mat4;\n}\n\ninterface Component3MF {\n id: string;\n children: Array;\n name?: string;\n}\n\ninterface Header {\n unit?: 'micron'|'millimeter'|'centimeter'|'inch'|'foot'|'meter';\n title?: string;\n author?: string;\n description?: string;\n application?: string;\n creationDate?: string;\n license?: string;\n modificationDate?: string;\n}\n\ninterface To3MF {\n meshes: Array;\n components: Array;\n items: Array;\n precision: number;\n header: Header;\n}\n\nclass GLTFNode {\n private _parent?: GLTFNode;\n manifold?: Manifold;\n translation?: Vec3|((t: number) => Vec3);\n rotation?: Vec3|((t: number) => Vec3);\n scale?: Vec3|((t: number) => Vec3);\n material?: GLTFMaterial;\n name?: string;\n\n constructor(parent?: GLTFNode) {\n this._parent = parent;\n nodes.push(this);\n }\n clone(parent?: GLTFNode) {\n const copy = {...this};\n copy._parent = parent;\n nodes.push(copy);\n return copy;\n }\n get parent() {\n return this._parent;\n }\n}\n\nmodule.GLTFNode = GLTFNode;\n\nconst globalDefaults = {...GLOBAL_DEFAULTS};\n\nmodule.setMaterial = (manifold: Manifold, material: GLTFMaterial): Manifold => {\n const out = manifold.asOriginal();\n id2material.set(out.originalID(), material);\n return out;\n};\n\nmodule.setMorphStart = (manifold: Manifold, func: (v: Vec3) => void): void => {\n const morph = manifold2morph.get(manifold);\n if (morph != null) {\n morph.start = func;\n } else {\n manifold2morph.set(manifold, {start: func});\n }\n};\n\nmodule.setMorphEnd = (manifold: Manifold, func: (v: Vec3) => void): void => {\n const morph = manifold2morph.get(manifold);\n if (morph != null) {\n morph.end = func;\n } else {\n manifold2morph.set(manifold, {end: func});\n }\n};\n\nfunction debug(manifold: Manifold, map: Map) {\n let result = manifold.asOriginal();\n map.set(result.originalID(), result.getMesh());\n return result;\n};\n\nmodule.show = (manifold) => {\n return debug(manifold, shown);\n};\n\nmodule.only = (manifold) => {\n ghost = true;\n return debug(manifold, singles);\n};\n\n// Swallow informational logs in testing framework\nfunction log(...args: any[]) {\n if (typeof self !== 'undefined' && self.console) {\n self.console.log(...args);\n }\n}\n\nfunction euler2quat(rotation: Vec3): Quat {\n const {quat} = glMatrix;\n const deg2rad = Math.PI / 180;\n const q = quat.create() as Quat;\n quat.rotateZ(q, q, deg2rad * rotation[2]);\n quat.rotateY(q, q, deg2rad * rotation[1]);\n quat.rotateX(q, q, deg2rad * rotation[0]);\n return q;\n}\n\nfunction addMotion(\n doc: Document, type: 'translation'|'rotation'|'scale', node: GLTFNode,\n out: Node): Vec3|null {\n const motion = node[type];\n if (motion == null) {\n return null;\n }\n if (typeof motion !== 'function') {\n return motion;\n }\n\n const nFrames = timesAccessor.getCount();\n const nEl = type == 'rotation' ? 4 : 3;\n const frames = new Float32Array(nEl * nFrames);\n for (let i = 0; i < nFrames; ++i) {\n const x = i / (nFrames - 1);\n const m = motion(\n globalDefaults.animationMode !== 'ping-pong' ?\n x :\n (1 - Math.cos(x * 2 * Math.PI)) / 2);\n frames.set(nEl === 4 ? euler2quat(m) : m, nEl * i);\n }\n\n const framesAccessor =\n doc.createAccessor(node.name + ' ' + type + ' frames')\n .setBuffer(doc.getRoot().listBuffers()[0])\n .setArray(frames)\n .setType(nEl === 4 ? Accessor.Type.VEC4 : Accessor.Type.VEC3);\n const sampler = doc.createAnimationSampler()\n .setInput(timesAccessor)\n .setOutput(framesAccessor)\n .setInterpolation('LINEAR');\n const channel = doc.createAnimationChannel()\n .setTargetPath(type)\n .setTargetNode(out)\n .setSampler(sampler);\n animation.addSampler(sampler);\n animation.addChannel(channel);\n hasAnimation = true;\n return motion(0);\n}\n\nfunction setMorph(doc: Document, node: Node, manifold: Manifold) {\n if (manifold2morph.has(manifold)) {\n const channel = doc.createAnimationChannel()\n .setTargetPath('weights')\n .setTargetNode(node)\n .setSampler(weightsSampler);\n animation.addChannel(channel);\n hasAnimation = true;\n }\n}\n\nfunction morphStart(manifoldMesh: Mesh, morph?: Morph): number[] {\n const inputPositions: number[] = [];\n if (morph == null) {\n return inputPositions;\n }\n\n for (let i = 0; i < manifoldMesh.numVert; ++i) {\n for (let j = 0; j < 3; ++j)\n inputPositions[i * 3 + j] =\n manifoldMesh.vertProperties[i * manifoldMesh.numProp + j];\n }\n if (morph.start) {\n for (let i = 0; i < manifoldMesh.numVert; ++i) {\n const vertProp = manifoldMesh.vertProperties;\n const offset = i * manifoldMesh.numProp;\n const pos = inputPositions.slice(offset, offset + 3) as Vec3;\n morph.start(pos);\n for (let j = 0; j < 3; ++j) vertProp[offset + j] = pos[j];\n }\n }\n return inputPositions;\n}\n\nfunction morphEnd(\n doc: Document, manifoldMesh: Mesh, mesh: GLTFMesh, inputPositions: number[],\n morph?: Morph) {\n if (morph == null) {\n return;\n }\n\n mesh.setWeights([0]);\n\n mesh.listPrimitives().forEach((primitive, i) => {\n if (morph.end) {\n for (let i = 0; i < manifoldMesh.numVert; ++i) {\n const pos = inputPositions.slice(3 * i, 3 * (i + 1)) as Vec3;\n morph.end(pos);\n inputPositions.splice(3 * i, 3, ...pos);\n }\n }\n\n const startPosition = primitive.getAttribute('POSITION')!.getArray()!;\n const array = new Float32Array(startPosition.length);\n\n const offset = manifoldMesh.runIndex[i];\n for (let j = 0; j < array.length; ++j) {\n array[j] = inputPositions[offset + j] - startPosition[j];\n }\n\n const morphAccessor = doc.createAccessor(mesh.getName() + ' morph target')\n .setBuffer(doc.getRoot().listBuffers()[0])\n .setArray(array)\n .setType(Accessor.Type.VEC3);\n const morphTarget =\n doc.createPrimitiveTarget().setAttribute('POSITION', morphAccessor);\n primitive.addTarget(morphTarget);\n });\n}\n\nfunction createGLTFnode(doc: Document, node: GLTFNode): Node {\n const out = doc.createNode(node.name);\n\n const pos = addMotion(doc, 'translation', node, out);\n if (pos != null) {\n out.setTranslation(pos);\n }\n\n const rot = addMotion(doc, 'rotation', node, out);\n if (rot != null) {\n out.setRotation(euler2quat(rot));\n }\n\n const scale = addMotion(doc, 'scale', node, out);\n if (scale != null) {\n out.setScale(scale);\n }\n\n return out;\n}\n\nfunction getBackupMaterial(node?: GLTFNode): GLTFMaterial {\n if (node == null) {\n return {};\n }\n if (node.material == null) {\n node.material = getBackupMaterial(node.parent);\n }\n return node.material;\n}\n\nfunction makeDefaultedMaterial(\n doc: Document, matIn: GLTFMaterial = {}): Material {\n const defaults = {...globalDefaults};\n Object.assign(defaults, matIn);\n const {roughness, metallic, baseColorFactor, alpha, unlit} = defaults;\n\n const material = doc.createMaterial(matIn.name ?? '');\n\n if (unlit) {\n const unlit = doc.createExtension(KHRMaterialsUnlit).createUnlit();\n material.setExtension('KHR_materials_unlit', unlit);\n }\n\n if (alpha < 1) {\n material.setAlphaMode(Material.AlphaMode.BLEND).setDoubleSided(true);\n }\n\n return material.setRoughnessFactor(roughness)\n .setMetallicFactor(metallic)\n .setBaseColorFactor([...baseColorFactor, alpha]);\n}\n\nfunction getCachedMaterial(doc: Document, matDef: GLTFMaterial): Material {\n if (!materialCache.has(matDef)) {\n materialCache.set(matDef, makeDefaultedMaterial(doc, matDef));\n }\n return materialCache.get(matDef)!;\n}\n\nfunction addMesh(\n doc: Document, to3mf: To3MF, node: Node, manifold: Manifold,\n backupMaterial: GLTFMaterial = {}) {\n const numTri = manifold.numTri();\n if (numTri == 0) {\n log('Empty manifold, skipping.');\n return;\n }\n\n log(`Triangles: ${numTri.toLocaleString()}`);\n const box = manifold.boundingBox();\n const size = [0, 0, 0];\n for (let i = 0; i < 3; i++) {\n size[i] = Math.round((box.max[i] - box.min[i]) * 10) / 10;\n }\n log(`Bounding Box: X = ${size[0].toLocaleString()} mm, Y = ${\n size[1].toLocaleString()} mm, Z = ${size[2].toLocaleString()} mm`);\n const volume = Math.round(manifold.getProperties().volume / 10);\n log(`Genus: ${manifold.genus().toLocaleString()}, Volume: ${\n (volume / 100).toLocaleString()} cm^3`);\n\n // From Z-up to Y-up (glTF)\n const manifoldMesh = manifold.getMesh();\n\n const id2properties = new Map();\n for (const id of manifoldMesh.runOriginalID!) {\n const material = id2material.get(id) || backupMaterial;\n id2properties.set(id, {\n material: getCachedMaterial(doc, ghost ? GHOST : material),\n attributes: ['POSITION', ...material.attributes ?? []]\n });\n }\n\n const morph = manifold2morph.get(manifold);\n const inputPositions = morphStart(manifoldMesh, morph);\n\n const mesh = writeMesh(doc, manifoldMesh, id2properties);\n mesh.setName(node.getName());\n node.setMesh(mesh);\n\n morphEnd(doc, manifoldMesh, mesh, inputPositions, morph);\n\n const vertices = manifoldMesh.numProp === 3 ?\n manifoldMesh.vertProperties :\n new Float32Array(manifoldMesh.numVert * 3);\n if (manifoldMesh.numProp > 3) {\n for (let i = 0; i < manifoldMesh.numVert; ++i) {\n for (let j = 0; j < 3; ++j)\n vertices[i * 3 + j] =\n manifoldMesh.vertProperties[i * manifoldMesh.numProp + j];\n }\n }\n object2globalID.set(manifold, nextGlobalID);\n to3mf.meshes.push(\n {vertices, indices: manifoldMesh.triVerts, id: `${nextGlobalID++}`});\n\n for (const [run, id] of manifoldMesh.runOriginalID!.entries()) {\n const show = shown.has(id);\n const inMesh = show ? shown.get(id) : singles.get(id);\n if (inMesh == null) {\n continue;\n }\n\n id2properties.get(id)!.material = getCachedMaterial(\n doc, show ? SHOW : (id2material.get(id) || backupMaterial));\n\n const debugNode = doc.createNode('debug')\n .setMesh(writeMesh(doc, inMesh, id2properties))\n .setMatrix(manifoldMesh.transform(run));\n node.addChild(debugNode);\n }\n}\n\nfunction cloneNode(toNode: Node, fromNode: Node) {\n toNode.setMesh(fromNode.getMesh());\n fromNode.listChildren().forEach((child) => {\n const clone = child.clone();\n toNode.addChild(clone);\n });\n}\n\nfunction cloneNodeNewMaterial(\n doc: Document, toNode: Node, fromNode: Node, backupMaterial: Material,\n oldBackupMaterial: Material) {\n cloneNode(toNode, fromNode);\n const mesh = doc.createMesh();\n toNode.setMesh(mesh);\n fromNode.getMesh()!.listPrimitives().forEach((primitive) => {\n const newPrimitive = primitive.clone();\n if (primitive.getMaterial() === oldBackupMaterial) {\n newPrimitive.setMaterial(backupMaterial);\n }\n mesh.addPrimitive(newPrimitive);\n });\n}\n\nfunction createNodeFromCache(\n doc: Document, to3MF: To3MF, nodeDef: GLTFNode,\n manifold2node: Map>): Node {\n const node = createGLTFnode(doc, nodeDef);\n const {manifold} = nodeDef;\n if (manifold != null) {\n setMorph(doc, node, manifold);\n const backupMaterial = getBackupMaterial(nodeDef);\n const cachedNodes = manifold2node.get(manifold);\n if (cachedNodes == null) {\n addMesh(doc, to3MF, node, manifold, backupMaterial);\n const cache = new Map();\n cache.set(backupMaterial, node);\n manifold2node.set(manifold, cache);\n } else {\n const cachedNode = cachedNodes.get(backupMaterial);\n if (cachedNode == null) {\n const [oldBackupMaterial, oldNode] = cachedNodes.entries().next().value;\n cloneNodeNewMaterial(\n doc, node, oldNode, getCachedMaterial(doc, backupMaterial),\n getCachedMaterial(doc, oldBackupMaterial));\n cachedNodes.set(backupMaterial, node);\n } else {\n cloneNode(node, cachedNode);\n }\n }\n }\n\n object2globalID.set(nodeDef, nextGlobalID);\n to3MF.components.push({\n id: `${nextGlobalID++}`,\n name: nodeDef.name,\n children:\n manifold == null ? [] : [{objectID: `${object2globalID.get(manifold)}`}]\n });\n return node;\n}\n\nasync function exportModels(defaults: GlobalDefaults, manifold?: Manifold) {\n Object.assign(globalDefaults, GLOBAL_DEFAULTS);\n Object.assign(globalDefaults, defaults);\n\n const doc = new Document();\n const halfRoot2 = Math.sqrt(2) / 2;\n const mm2m = 1 / 1000;\n const wrapper = doc.createNode('wrapper')\n .setRotation([-halfRoot2, 0, 0, halfRoot2])\n .setScale([mm2m, mm2m, mm2m]);\n doc.createScene().addChild(wrapper);\n\n animation = doc.createAnimation('');\n hasAnimation = false;\n const nFrames = Math.round(globalDefaults.animationLength * FPS) + 1;\n const times = new Float32Array(nFrames);\n const weights = new Float32Array(nFrames);\n for (let i = 0; i < nFrames; ++i) {\n const x = i / (nFrames - 1);\n times[i] = x * globalDefaults.animationLength;\n weights[i] = globalDefaults.animationMode !== 'ping-pong' ?\n x :\n (1 - Math.cos(x * 2 * Math.PI)) / 2;\n }\n timesAccessor = doc.createAccessor('animation times')\n .setBuffer(doc.createBuffer())\n .setArray(times)\n .setType(Accessor.Type.SCALAR);\n weightsAccessor = doc.createAccessor('animation weights')\n .setBuffer(doc.getRoot().listBuffers()[0])\n .setArray(weights)\n .setType(Accessor.Type.SCALAR);\n weightsSampler = doc.createAnimationSampler()\n .setInput(timesAccessor)\n .setOutput(weightsAccessor)\n .setInterpolation('LINEAR');\n animation.addSampler(weightsSampler);\n\n const to3mf = {\n meshes: [],\n components: [],\n items: [],\n precision: 7,\n header: {\n unit: 'millimeter',\n title: 'ManifoldCAD.org model',\n description: 'ManifoldCAD.org model',\n application: 'ManifoldCAD.org',\n }\n } as To3MF;\n\n if (nodes.length > 0) {\n const node2gltf = new Map();\n const manifold2node = new Map>();\n let leafNodes = 0;\n\n for (const nodeDef of nodes) {\n node2gltf.set(\n nodeDef, createNodeFromCache(doc, to3mf, nodeDef, manifold2node));\n if (nodeDef.manifold) {\n ++leafNodes;\n }\n }\n\n for (const nodeDef of nodes) {\n const gltfNode = node2gltf.get(nodeDef)!;\n const child = {\n objectID: `${object2globalID.get(nodeDef)}`,\n transform: gltfNode.getMatrix()\n };\n const {parent} = nodeDef;\n if (parent == null) {\n wrapper.addChild(gltfNode);\n to3mf.items.push(child);\n } else {\n node2gltf.get(parent)!.addChild(gltfNode);\n const parent3mf = to3mf.components.find(\n (comp) => comp.id == `${object2globalID.get(parent)}`)!;\n parent3mf.children.push(child);\n }\n }\n\n log('Total glTF nodes: ', nodes.length,\n ', Total mesh references: ', leafNodes);\n } else {\n if (manifold == null) {\n log('No output because \"result\" is undefined and no \"GLTFNode\"s were created.');\n return;\n }\n const node = doc.createNode();\n addMesh(doc, to3mf, node, manifold);\n wrapper.addChild(node);\n to3mf.items.push({objectID: `${object2globalID.get(manifold)}`});\n }\n\n if (!hasAnimation) {\n timesAccessor.dispose();\n weightsAccessor.dispose();\n weightsSampler.dispose();\n animation.dispose();\n }\n\n const glb = await io.writeBinary(doc);\n const blobGLB = new Blob([glb], {type: 'application/octet-stream'});\n\n const fileForRelThumbnail = new FileForRelThumbnail();\n fileForRelThumbnail.add3dModel('3D/3dmodel.model')\n\n const model = to3dmodel(to3mf as any);\n const files: Zippable = {};\n files['3D/3dmodel.model'] = strToU8(model);\n files[fileForContentTypes.name] = strToU8(fileForContentTypes.content);\n files[fileForRelThumbnail.name] = strToU8(fileForRelThumbnail.content);\n const zipFile = zipSync(files);\n const blob3MF = new Blob(\n [zipFile],\n {type: 'application/vnd.ms-package.3dmanufacturing-3dmodel+xml'});\n\n return ({\n glbURL: URL.createObjectURL(blobGLB),\n threeMFURL: URL.createObjectURL(blob3MF)\n });\n}\n\nfunction evaluateCADToManifold(code: string) {\n const globalDefaults = {} as GlobalDefaults;\n const context = {\n globalDefaults,\n exportModels,\n glMatrix,\n module,\n ...Object.fromEntries(\n exposedFunctions.map((name) => [name, (module as any)[name]]),\n ),\n };\n const evalFn = new Function(\n ...Object.keys(context),\n 'resetToCircularDefaults();\\n' + code +\n '\\n return typeof result === \"undefined\" ? undefined : result;',\n );\n const manifold = evalFn(...Object.values(context));\n return {globalDefaults, manifold};\n}\n\nexport async function evaluateCADToModel(code: string) {\n const {globalDefaults, manifold} = evaluateCADToManifold(code);\n return await exportModels(globalDefaults, manifold);\n}\n","// Copyright 2024 The Manifold Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {cleanup, evaluateCADToModel} from './worker';\n\n// Setup complete\nself.postMessage(null);\n\nif (self.console) {\n const oldLog = self.console.log;\n self.console.log = function(...args) {\n let message = '';\n for (const arg of args) {\n if (arg == null) {\n message += 'undefined';\n } else if (typeof arg == 'object') {\n message += JSON.stringify(arg, null, 4);\n } else {\n message += arg.toString();\n }\n }\n self.postMessage({log: message});\n oldLog(...args);\n };\n}\n\nself.onmessage = async (e) => {\n try {\n const result = await evaluateCADToModel(e.data);\n self.postMessage(result);\n } catch (error: any) {\n console.log(error.toString());\n self.postMessage({objectURL: null});\n } finally {\n cleanup();\n }\n};\n"],"names":["EventDispatcher","type","listener","listeners","listenerArray","index","event","array","l","key","GraphEdge","_name","_parent","_child","_attributes","child","Graph","args","node","edge","filter","edges","name","a","b","attributes","parent","_extends","target","i","source","isRef","value","isRefList","isRefMap","isPlainObject","getFirstValue","$attributes","$immutableKeys","GraphNode","graph","defaultAttributes","ref","other","old","replacement","attribute","refAttributes","refMap","prevRef","refs","metadata","u","c","h","f","d","g","p","m","w","y","v","s","n","o","T","t","r","x","A","E","e","S$1","M$1","M","R","I","N$1","O","C","F","U","B$1","B","P","L","S","N","j","D","_","k","z","G","J","$","V","W","q$1","q","H","Y","Z$1","K$1","Z","Q$1","Q","K","X$1","tt$1","tt","et","rt$1","st","nt$1","nt","it$1","it","ot","at","ut","ct","ht$1","ht","ft$1","lt$1","dt$1","dt","gt$1","pt","mt$1","yt$1","vt$1","mt","lt","wt","ft","yt","X","rt","Tt$1","Tt","vt","gt","bt","xt$1","At","Et$1","xt","St","Mt","It$1","Rt","It","Nt","Ot","Ct","Ft","Ut$1","Bt","Lt","Et","Ut","Pt","KHR_SUPERCOMPRESSION_NONE","KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT","KHR_DF_VENDORID_KHRONOS","KHR_DF_VERSION","KHR_DF_MODEL_UNSPECIFIED","KHR_DF_MODEL_ETC1S","KHR_DF_MODEL_UASTC","KHR_DF_FLAG_ALPHA_STRAIGHT","KHR_DF_TRANSFER_SRGB","KHR_DF_PRIMARIES_BT709","KHR_DF_SAMPLE_DATATYPE_SIGNED","VK_FORMAT_UNDEFINED","KTX2Container","BufferReader","data","byteOffset","byteLength","littleEndian","left","right","len","bytes","maxByteLength","term","KTX2_ID","decodeText","buffer","read","id","container","headerByteLength","headerReader","levelCount","dfdByteOffset","dfdByteLength","kvdByteOffset","kvdByteLength","sgdByteOffset","sgdByteLength","levelByteLength","levelReader","dfdReader","dfd","sampleStart","sampleWords","numSamples","sample","kvdReader","keyValueByteLength","keyData","text","kvPadding","sgdReader","endpointCount","selectorCount","endpointsByteLength","selectorsByteLength","tablesByteLength","extendedByteLength","imageDescs","endpointsByteOffset","selectorsByteOffset","tablesByteOffset","extendedByteOffset","endpointsData","selectorsData","tablesData","extendedData","ee","te","se","ne","re","oe","ae","ie","ce","ue","le","he","fe","ge","pe","xe","de","Te","me","Ee","Ie","Ne","Re","ye","Ae","Se","Ce","Me","Oe","_e","we","De","be","Fe","je","ve","ke","Be","Ge","Le","Ue","Ve","Pe","Xe","He","ze","$e","qe","Ke","Ye","Qe","We","Je","Ze","_t","Dt","jt","kt","Gt","Vt","Xt","Ht","zt","$t","qt","Kt","Yt","Qt","Wt","Jt","defMatrix","matrix2str","str","makeItem","matrix","toDate3mf","pushHeader","out","unit","title","author","description","application","creationDate","license","modificationDate","pushObjectWithComponents","children","objectID","transform","addComp","pushObjectWithMesh","vertices","indices","precision","fileForContentTypes","to3dmodel","meshes","components","items","header","FileForRelThumbnail","xmlType","path","u8","u16","i32","fleb","fdeb","clim","freb","eb","start","_a","fl","revfl","_b","revfd","rev","hMap","cd","mb","co","rvb","sv","r_1","flt","fdt","flm","fdm","shft","slc","ec","err","ind","msg","wbits","wbits16","hTree","t2","i0","i1","i2","maxSym","tr","mbt","ln","lft","cst","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","clen","cf","wfblk","pos","dat","wblk","final","syms","lf","df","li","bs","bl","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","lct","mlcb","nlcc","flen","ftlen","dtlen","lm","ll","dm","dl","llm","lcts","clct","sym","dst","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","bs2_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","nl","mmd","md","ti","pti","lin","din","crct","crc","cr","dopt","dict","newDat","mrg","wbytes","deflateSync","opts","fltn","val","op","td","tds","strToU8","latin1","ar_1","ar","ai","exfl","ex","wzh","fn","col","exl","exf","wzf","zipSync","files","tot","file","compression","com","ms","cdl","badd","EPSILON","ARRAY_TYPE","RANDOM","setMatrixArrayType","degree","toRadian","equals","create","glMatrix.ARRAY_TYPE","clone","copy","identity","fromValues","m00","m01","m10","m11","set","transpose","a1","invert","a0","a2","a3","det","adjoint","determinant","multiply","b0","b1","b2","b3","rotate","rad","scale","v0","v1","fromRotation","fromScaling","frob","LDU","add","subtract","exactEquals","glMatrix.EPSILON","multiplyScalar","multiplyScalarAndAdd","mul","sub","tx","ty","aa","ab","ac","ad","atx","aty","a4","a5","b4","b5","translate","fromTranslation","fromMat4","m02","m12","m20","m21","m22","a01","a02","a12","a00","a10","a11","a20","a21","a22","b01","b11","b21","b00","b02","b10","b12","b20","b22","fromMat2d","fromQuat","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","normalFromMat4","a03","a13","a23","a30","a31","a32","a33","b03","b04","b05","b06","b07","b08","b09","projection","width","height","a6","a7","a8","b6","b7","b8","m03","m13","m23","m30","m31","m32","m33","axis","rotateX","rotateY","rotateZ","fromXRotation","fromYRotation","fromZRotation","fromRotationTranslation","xy","xz","yz","fromQuat2","translation","bx","by","bz","bw","ax","ay","az","aw","magnitude","getTranslation","mat","getScaling","getRotation","scaling","is1","is2","is3","sm11","sm12","sm13","sm21","sm22","sm23","sm31","sm32","sm33","trace","fromRotationTranslationScale","sx","sy","sz","fromRotationTranslationScaleOrigin","ox","oy","oz","out0","out1","out2","out4","out5","out6","out8","out9","out10","frustum","bottom","top","near","far","rl","tb","nf","perspectiveNO","fovy","aspect","perspective","perspectiveZO","perspectiveFromFieldOfView","fov","upTan","downTan","leftTan","rightTan","xScale","yScale","orthoNO","lr","ortho","orthoZO","lookAt","eye","center","up","x0","x1","y0","y1","z0","z1","eyex","eyey","eyez","upx","upy","upz","centerx","centery","centerz","targetTo","a9","a14","a15","b9","b13","b14","b15","length","divide","ceil","floor","min","max","round","scaleAndAdd","distance","squaredDistance","squaredLength","negate","inverse","normalize","dot","cross","lerp","hermite","factorTimes2","factor1","factor2","factor3","factor4","bezier","inverseFactor","inverseFactorTimesTwo","random","glMatrix.RANDOM","zScale","transformMat4","transformMat3","transformQuat","qx","qy","qz","qw","uvx","uvy","uvz","uuvx","uuvy","uuvz","w2","angle","mag1","mag2","mag","cosine","zero","div","dist","sqrDist","sqrLen","forEach","vec","stride","offset","count","arg","v2","v3","v4","s1","s2","ix","iy","iz","iw","setAxisAngle","getAxisAngle","out_axis","getAngle","dotproduct","calculateW","exp","pow","slerp","omega","cosom","sinom","scale0","scale1","u1","u2","u3","sqrt1MinusU1","sqrtU1","invDot","conjugate","fromMat3","fTrace","fRoot","fromEuler","halfToRad","cx","cy","cz","vec4.clone","vec4.fromValues","vec4.copy","vec4.set","vec4.add","vec4.scale","vec4.dot","vec4.lerp","vec4.length","vec4.squaredLength","vec4.normalize","vec4.exactEquals","vec4.equals","rotationTo","tmpvec3","vec3.create","xUnitVec3","vec3.fromValues","yUnitVec3","vec3.dot","vec3.cross","vec3.len","vec3.normalize","sqlerp","temp1","temp2","setAxes","matr","mat3.create","view","dq","w1","fromRotationTranslationValues","outer","quat.create","mat4.getRotation","mat4.getTranslation","getReal","quat.copy","getDual","setReal","setDual","ax1","ay1","az1","aw1","bx1","by1","bz1","ax2","ay2","az2","aw2","quat.rotateX","quat.rotateY","quat.rotateZ","rotateByQuatAppend","rotateByQuatPrepend","rotateAroundAxis","axisLength","ax0","ay0","az0","aw0","bw1","bx0","by0","bz0","bw0","quat.dot","sqlen","quat.length","quat.squaredLength","a_dot_b","transformMat2","transformMat2d","p0","p1","sinC","cosC","Module","_scriptName","moduleArg","moduleRtn","readyPromiseResolve","readyPromiseReject","readyPromise","resolve","reject","ENVIRONMENT_IS_WEB","ENVIRONMENT_IS_WORKER","ENVIRONMENT_IS_NODE","createRequire","require","_ManifoldInitialized","toVec","list","fromVec","result","size","vec2polygons","nPoly","nPts","poly","polygons2vec","polygons","disposePolygons","polygonsVec","vararg2vec2","vararg2vec3","fillRuleToInt","fillRule","joinTypeToInt","joinType","CrossSectionCtor","cs","func","wasmFuncPtr","addFunction","vec2Ptr","getValue","vert","setValue","removeFunction","delta","miterLimit","circularSegments","nDivisions","twistDegrees","scaleTop","man","revolveDegrees","minSharpAngle","minSmoothness","vec3Ptr","status","normalIdx","numProp","oldNumProp","newPtr","oldPtr","newProp","oldProp","xOrVec","normal","manifold","Mesh","triVerts","vertProperties","mergeFromVert","mergeToVert","runIndex","runOriginalID","faceID","halfedgeTangent","runTransform","changed","mesh","tri","halfedge","run","mat4","row","code","message","base","radius","crossSectionBatchbool","pushVec2","ps","pts","polys","ManifoldCtor","radiusLow","radiusHigh","sharpenedEdges","sharp","manifolds","manifoldBatchbool","sdf","bounds","edgeLength","level","bounds2","pushVec3","moduleOverrides","scriptDirectory","locateFile","read_","readAsync","readBinary","fs","nodePath","filename","binary","isFileURI","ret","onload","onerror","url","xhr","response","wasmBinary","wasmMemory","ABORT","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAPF32","HEAPF64","updateMemoryViews","__ATPRERUN__","__ATINIT__","__ATPOSTRUN__","preRun","addOnPreRun","callRuntimeCallbacks","initRuntime","postRun","addOnPostRun","cb","addOnInit","runDependencies","dependenciesFulfilled","addRunDependency","removeRunDependency","callback","abort","what","dataURIPrefix","isDataURI","findWasmBinary","wasmBinaryFile","getBinarySync","getBinaryPromise","binaryFile","error","instantiateArrayBuffer","imports","receiver","reason","instantiateAsync","getWasmImports","wasmImports","createWasm","info","receiveInstance","instance","module","wasmExports","wasmTable","receiveInstantiationResult","callbacks","ptr","stackRestore","__emscripten_stack_restore","stackSave","_emscripten_stack_get_current","exceptionCaught","___cxa_begin_catch","ExceptionInfo","___cxa_increment_exception_refcount","exceptionLast","___cxa_end_catch","_setThrew","___cxa_decrement_exception_refcount","excPtr","destructor","caught","rethrown","adjustedPtr","isPointer","___cxa_is_pointer_type","adjusted","___resumeException","setTempRet0","__emscripten_tempret_set","findMatchingCatch","thrown","thrownType","caughtType","adjusted_ptr_addr","___cxa_can_catch","___cxa_find_matching_catch_2","___cxa_find_matching_catch_3","arg0","___cxa_throw","__abort_js","structRegistrations","runDestructors","destructors","del","readPointer","pointer","awaitingDependencies","registeredTypes","typeDependencies","InternalError","throwInternalError","whenDependentTypesAreResolved","myTypes","dependentTypes","getTypeConverters","onComplete","typeConverters","myTypeConverters","registerType","unregisteredTypes","registered","__embind_finalize_value_object","structType","reg","rawConstructor","rawDestructor","fieldRecords","fieldTypes","field","fields","fieldName","getterReturnType","getter","getterContext","setterArgumentType","setter","setterContext","rv","GenericWireTypeSize","__embind_register_bigint","primitiveType","minRange","maxRange","embind_init_charCodes","codes","embind_charCodes","readLatin1String","BindingError","throwBindingError","sharedRegisterType","rawType","registeredInstance","options","__embind_register_bool","trueValue","falseValue","shallowCopyInternalPointer","throwInstanceAlreadyDeleted","obj","getInstanceTypeName","handle","finalizationRegistry","detachFinalizer","runDestructor","$$","releaseClassHandle","toDelete","downcastPointer","ptrClass","desiredClass","registeredPointers","getInheritedInstanceCount","registeredInstances","getLiveInheritedInstances","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","init_embind","getBasestPointer","class_","getInheritedInstance","makeClassHandle","prototype","record","hasSmartPtrType","hasSmartPtr","attachFinalizer","RegisteredPointer_fromWireType","rawPointer","makeDefaultHandle","actualType","registeredPointerRecord","toType","dp","init_ClassHandle","ClassHandle","leftClass","rightClass","createNamedFunction","body","ensureOverloadTable","proto","methodName","humanName","prevFunc","exposePublicSymbol","numArguments","char_0","char_9","makeLegalFunctionName","RegisteredClass","constructor","instancePrototype","baseClass","getActualType","upcast","downcast","upcastPointer","constNoSmartPtrRawPointerToWireType","embindRepr","handleClass","genericPointerToWireType","clonedHandle","Emval","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","registeredClass","isReference","isConst","isSmartPointer","pointeeType","sharingPolicy","rawGetPointee","rawShare","replacePublicSymbol","dynCallLegacy","sig","wasmTableMirror","getWasmTableEntry","funcPtr","dynCall","rtn","getDynCaller","embind__requireFunction","signature","rawFunction","makeDynCaller","fp","extendError","baseErrorType","errorName","errorClass","stack","UnboundTypeError","getTypeName","___getTypeName","_free","throwUnboundTypeError","types","unboundTypes","seen","visit","__embind_register_class","rawPointerType","rawConstPointerType","baseClassRawType","getActualTypeSignature","upcastSignature","downcastSignature","destructorSignature","legalFunctionName","basePrototype","referenceConverter","pointerConverter","constPointerConverter","heap32VectorToArray","firstElement","usesDestructorStack","argTypes","newFunc","argumentList","dummy","createJsInvoker","isClassMethodFunc","returns","isAsync","needsDestructorStack","argCount","argsList","argsListWired","invokerFnBody","dtorStack","args1","paramName","craftInvokerFunction","classType","cppInvokerFunc","cppTargetFunc","closureArgs","invokerFn","__embind_register_class_constructor","rawClassType","rawArgTypesAddr","invokerSignature","invoker","rawArgTypes","getFunctionName","argsIndex","__embind_register_class_function","rawInvoker","context","isPureVirtual","unboundTypesHandler","method","memberFunction","emval_freelist","emval_handles","__emval_decref","count_emval_handles","init_emval","EmValType","__embind_register_emval","enumReadValueFromPointer","signed","__embind_register_enum","isSigned","ctor","requireRegisteredType","impl","__embind_register_enum_value","rawEnumType","enumValue","enumType","Enum","Value","floatReadValueFromPointer","__embind_register_float","__embind_register_function","invokerArgsArray","integerReadValueFromPointer","__embind_register_integer","fromWireType","bitshift","isUnsignedType","checkAssertions","toTypeName","toWireType","__embind_register_memory_view","dataTypeIndex","typeMapping","TA","decodeMemoryView","__embind_register_optional","rawOptionalType","stringToUTF8Array","heap","outIdx","maxBytesToWrite","startIdx","endIdx","stringToUTF8","outPtr","lengthBytesUTF8","UTF8Decoder","UTF8ArrayToString","heapOrArray","idx","maxBytesToRead","endPtr","u0","ch","UTF8ToString","__embind_register_std_string","stdStringIsUTF8","payload","decodeStartPtr","currentBytePtr","maxRead","stringSegment","valueIsOfTypeString","_malloc","charCode","UTF16Decoder","UTF16ToString","maxIdx","codeUnit","stringToUTF16","startPtr","numCharsToWrite","lengthBytesUTF16","UTF32ToString","utf32","stringToUTF32","trailSurrogate","lengthBytesUTF32","__embind_register_std_wstring","charSize","decodeString","encodeString","readCharAt","lengthBytesUTF","maxReadBytes","__embind_register_value_object","constructorSignature","__embind_register_value_object_field","getterSignature","setterSignature","__embind_register_void","__emscripten_memcpy_js","dest","src","num","emval_returnValue","returnType","destructorsRef","__emval_as","emval_symbols","getStringOrSymbol","address","symbol","emval_methodCallers","__emval_call_method","caller","objHandle","__emval_equals","first","second","emval_addMethodCaller","emval_lookupTypes","__emval_get_method_caller","kind","retType","functionBody","params","invokerFunction","functionName","__emval_get_property","__emval_incref","__emval_new_cstring","__emval_new_object","__emval_run_destructors","__emval_set_property","__emval_take_value","getHeapMax","growMemory","pages","_emscripten_resize_heap","requestedSize","oldSize","maxHeapSize","alignUp","multiple","cutDown","overGrownHeapSize","newSize","_llvm_eh_typeid_for","uleb128Encode","sigToWasmTypes","typeNames","generateFuncType","sigRet","sigParam","typeCodes","convertJsFunctionToWasm","typeSectionBody","wrappedFunc","updateTableMap","functionsInTableMap","item","getFunctionAddress","freeTableIndexes","getEmptyTableSlot","setWasmTableEntry","wrapped","invoke_dd","invoke_dii","invoke_diid","invoke_diii","invoke_diiiii","invoke_i","invoke_ii","invoke_iii","invoke_iiii","invoke_iiiii","invoke_iiiiii","invoke_iiij","invoke_v","invoke_vi","invoke_vid","invoke_vidi","invoke_vii","invoke_viid","invoke_viidd","invoke_viiddd","invoke_viiddi","invoke_viidi","invoke_viididi","invoke_viidiidid","invoke_viii","invoke_viiid","invoke_viiidddi","invoke_viiii","invoke_viiiii","invoke_viiiiid","invoke_viiiiii","invoke_viiiiiii","invoke_viiiiiiiii","invoke_viiiiiiiiidiii","invoke_viiiiiiiiii","invoke_viiiiiiiiiiiiiiiiii","dynCall_iiij","sp","a16","a17","a18","calledRun","runCaller","doRun","NAME","MERGE","ManifoldPrimitive","ExtensionProperty","PropertyType","indicesAccessor","valuesAccessor","EXTManifold","Extension","json","meshDef","meshIndex","manifoldPrimitive","manifoldDef","primitive","WriterContext","mergeFrom","mergeTo","numPrimitive","mergeIndicesIndex","mergeValuesIndex","mergeIndices","mergeValues","existingPrimitive","accessor","attributeDefs","Accessor","setupIO","io","writeMesh","doc","manifoldMesh","id2properties","manifoldExtension","attributeUnion","primitive2attributes","numRun","lastID","properties","material","unionSize","numVert","aIdx","def","vert2merge","from","newVert","glMatrix.glMatrix.setMatrixArrayType","WebIO","KHRONOS_EXTENSIONS","manifoldStaticFunctions","manifoldMemberFunctions","crossSectionStaticFunctions","crossSectionMemberFunctions","toplevelConstructors","toplevel","exposedFunctions","memoryRegistry","addMembers","className","methodNames","areStatic","originalFn","ghost","shown","singles","FPS","GLOBAL_DEFAULTS","SHOW","GHOST","nodes","id2material","materialCache","object2globalID","manifold2morph","nextGlobalID","animation","timesAccessor","weightsAccessor","weightsSampler","hasAnimation","cleanup","elem","GLTFNode","globalDefaults","morph","debug","map","log","euler2quat","rotation","quat","glMatrix","deg2rad","addMotion","motion","nFrames","nEl","frames","framesAccessor","sampler","channel","setMorph","morphStart","inputPositions","vertProp","morphEnd","startPosition","morphAccessor","morphTarget","createGLTFnode","rot","getBackupMaterial","makeDefaultedMaterial","matIn","defaults","roughness","metallic","baseColorFactor","alpha","unlit","KHRMaterialsUnlit","Material","getCachedMaterial","matDef","addMesh","to3mf","backupMaterial","numTri","box","volume","show","inMesh","debugNode","cloneNode","toNode","fromNode","cloneNodeNewMaterial","oldBackupMaterial","newPrimitive","createNodeFromCache","to3MF","nodeDef","manifold2node","cachedNodes","cache","cachedNode","oldNode","exportModels","Document","halfRoot2","mm2m","wrapper","times","weights","node2gltf","leafNodes","gltfNode","comp","glb","blobGLB","fileForRelThumbnail","model","zipFile","blob3MF","evaluateCADToManifold","evaluateCADToModel","oldLog"],"mappings":"AAAA,MAAMA,EAAgB,CACpB,aAAc,CACZ,KAAK,WAAa,EACnB,CAED,iBAAiBC,EAAMC,EAAU,CAC/B,MAAMC,EAAY,KAAK,WAEvB,OAAIA,EAAUF,CAAI,IAAM,SACtBE,EAAUF,CAAI,EAAI,IAGhBE,EAAUF,CAAI,EAAE,QAAQC,CAAQ,IAAM,IACxCC,EAAUF,CAAI,EAAE,KAAKC,CAAQ,EAGxB,IACR,CAED,oBAAoBD,EAAMC,EAAU,CAClC,GAAI,KAAK,aAAe,OAAW,OAAO,KAE1C,MAAME,EADY,KAAK,WACSH,CAAI,EAEpC,GAAIG,IAAkB,OAAW,CAC/B,MAAMC,EAAQD,EAAc,QAAQF,CAAQ,EAExCG,IAAU,IACZD,EAAc,OAAOC,EAAO,CAAC,CAEhC,CAED,OAAO,IACR,CAED,cAAcC,EAAO,CACnB,GAAI,K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GAAA,CACF,MAAM81B,EAAS,MAAM2wB,GAAmBzmD,EAAE,IAAI,EAC9C,KAAK,YAAY81B,CAAM,QAChB6I,EAAY,CACX,QAAA,IAAIA,EAAM,SAAU,CAAA,EAC5B,KAAK,YAAY,CAAC,UAAW,IAAK,CAAA,CAAA,QAClC,CACQyiB,IACV,CACF","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]} \ No newline at end of file diff --git a/docs/ParallelBVH.pdf b/docs/ParallelBVH.pdf new file mode 100644 index 000000000..3ea1e99e1 Binary files /dev/null and b/docs/ParallelBVH.pdf differ diff --git a/docs/RobustBoolean.pdf b/docs/RobustBoolean.pdf new file mode 100644 index 000000000..09526809f Binary files /dev/null and b/docs/RobustBoolean.pdf differ diff --git a/docs/TriangleInterpolation.pdf b/docs/TriangleInterpolation.pdf new file mode 100644 index 000000000..eb13c4ed1 Binary files /dev/null and b/docs/TriangleInterpolation.pdf differ diff --git a/docs/Triangulation.pdf b/docs/Triangulation.pdf new file mode 100644 index 000000000..4fdeb3951 Binary files /dev/null and b/docs/Triangulation.pdf differ diff --git a/docs/html/annotated.html b/docs/html/annotated.html new file mode 100644 index 000000000..3ca90cb30 --- /dev/null +++ b/docs/html/annotated.html @@ -0,0 +1,236 @@ + + + + + + + +Manifold: Class List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 1234]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Nbenchmarks
 Nmanifold
 Nnb
 Nstd
 CCubeVoid
 CEdge
 Cglm_name
 Cglm_name< ivec3 >
 Cglm_name< mat3x2 >
 Cglm_name< mat4x3 >
 Cglm_name< vec2 >
 Cglm_name< vec3 >
 CGyroidSDF
 CHullImpl
 CHullImplCGAL
 CHullImplOriginal
 CLayers
 CManifoldIVec3
 CManifoldManifoldPair
 CManifoldProperties
 CManifoldVec2
 CManifoldVec3
 CManifoldVec4
 CMeshSize
 COptions
 CResult
+
+
+
+ + + + diff --git a/docs/html/annotated_dup.js b/docs/html/annotated_dup.js new file mode 100644 index 000000000..50790cc96 --- /dev/null +++ b/docs/html/annotated_dup.js @@ -0,0 +1,124 @@ +var annotated_dup = +[ + [ "benchmarks", null, [ + [ "all_of", "structbenchmarks_1_1all__of.html", null ], + [ "copy", "structbenchmarks_1_1copy.html", null ], + [ "copy_if_1001", "structbenchmarks_1_1copy__if__1001.html", null ], + [ "copy_if_28", "structbenchmarks_1_1copy__if__28.html", null ], + [ "copy_if_55", "structbenchmarks_1_1copy__if__55.html", null ], + [ "copy_if_82", "structbenchmarks_1_1copy__if__82.html", null ], + [ "count", "structbenchmarks_1_1count.html", null ], + [ "exclusive_scan", "structbenchmarks_1_1exclusive__scan.html", null ], + [ "fill", "structbenchmarks_1_1fill.html", null ], + [ "for_each", "structbenchmarks_1_1for__each.html", null ], + [ "reduce", "structbenchmarks_1_1reduce.html", null ], + [ "sort_Asc", "structbenchmarks_1_1sort___asc.html", null ], + [ "sort_Asc_size", "structbenchmarks_1_1sort___asc__size.html", null ], + [ "sort_Asc_size_merge", "structbenchmarks_1_1sort___asc__size__merge.html", null ], + [ "sort_Des", "structbenchmarks_1_1sort___des.html", null ], + [ "sort_Des_size", "structbenchmarks_1_1sort___des__size.html", null ], + [ "sort_Des_size_merge", "structbenchmarks_1_1sort___des__size__merge.html", null ], + [ "sort_Eq", "structbenchmarks_1_1sort___eq.html", null ], + [ "sort_Eq_size", "structbenchmarks_1_1sort___eq__size.html", null ], + [ "sort_Eq_size_merge", "structbenchmarks_1_1sort___eq__size__merge.html", null ], + [ "sort_Rnd", "structbenchmarks_1_1sort___rnd.html", null ], + [ "sort_Rnd_size", "structbenchmarks_1_1sort___rnd__size.html", null ], + [ "sort_Rnd_size_merge", "structbenchmarks_1_1sort___rnd__size__merge.html", null ], + [ "sort_roughly_Asc", "structbenchmarks_1_1sort__roughly___asc.html", null ], + [ "sort_roughly_Asc_size", "structbenchmarks_1_1sort__roughly___asc__size.html", null ], + [ "sort_roughly_Asc_size_merge", "structbenchmarks_1_1sort__roughly___asc__size__merge.html", null ], + [ "transform_reduce", "structbenchmarks_1_1transform__reduce.html", null ] + ] ], + [ "manifold", "namespacemanifold.html", [ + [ "collider_internal", null, [ + [ "BuildInternalBoxes", "structmanifold_1_1collider__internal_1_1_build_internal_boxes.html", null ], + [ "CountCollisions", "structmanifold_1_1collider__internal_1_1_count_collisions.html", null ], + [ "CreateRadixTree", "structmanifold_1_1collider__internal_1_1_create_radix_tree.html", null ], + [ "FindCollisions", "structmanifold_1_1collider__internal_1_1_find_collisions.html", null ], + [ "ParCollisionRecorder", "structmanifold_1_1collider__internal_1_1_par_collision_recorder.html", null ], + [ "SeqCollisionRecorder", "structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html", null ], + [ "TransformBox", "structmanifold_1_1collider__internal_1_1_transform_box.html", null ] + ] ], + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "Boolean3", "classmanifold_1_1_boolean3.html", null ], + [ "Box", "structmanifold_1_1_box.html", "structmanifold_1_1_box" ], + [ "Collider", "classmanifold_1_1_collider.html", null ], + [ "ConcurrentSharedPtr", "classmanifold_1_1_concurrent_shared_ptr.html", "classmanifold_1_1_concurrent_shared_ptr" ], + [ "CountingIterator", "structmanifold_1_1_counting_iterator.html", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html", "classmanifold_1_1_cross_section" ], + [ "CsgLeafNode", "classmanifold_1_1_csg_leaf_node.html", null ], + [ "CsgNode", "classmanifold_1_1_csg_node.html", null ], + [ "CsgOpNode", "classmanifold_1_1_csg_op_node.html", null ], + [ "ExecutionParams", "group___debug.html#structmanifold_1_1_execution_params", "group___debug_structmanifold_1_1_execution_params" ], + [ "ExportOptions", "group___mesh_i_o.html#structmanifold_1_1_export_options", "group___mesh_i_o_structmanifold_1_1_export_options" ], + [ "geometryErr", "structmanifold_1_1geometry_err.html", null ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "HalfEdgeMesh", "classmanifold_1_1_half_edge_mesh.html", null ], + [ "HashTable", "classmanifold_1_1_hash_table.html", null ], + [ "HashTableD", "classmanifold_1_1_hash_table_d.html", null ], + [ "Identity", "structmanifold_1_1_identity.html", null ], + [ "Manifold", "classmanifold_1_1_manifold.html", "classmanifold_1_1_manifold" ], + [ "Material", "group___mesh_i_o.html#structmanifold_1_1_material", "group___mesh_i_o_structmanifold_1_1_material" ], + [ "Mesh", "group___connections.html#structmanifold_1_1_mesh", "group___connections_structmanifold_1_1_mesh" ], + [ "MeshBuilder", "classmanifold_1_1_mesh_builder.html", "classmanifold_1_1_mesh_builder" ], + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", "structmanifold_1_1_mesh_g_l" ], + [ "Negate", "structmanifold_1_1_negate.html", null ], + [ "PathImpl", "structmanifold_1_1_path_impl.html", null ], + [ "Plane", "classmanifold_1_1_plane.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", "group___private_structmanifold_1_1_poly_vert" ], + [ "Pool", "classmanifold_1_1_pool.html", null ], + [ "Properties", "group___connections.html#structmanifold_1_1_properties", null ], + [ "Quality", "classmanifold_1_1_quality.html", null ], + [ "QuickHull", "classmanifold_1_1_quick_hull.html", null ], + [ "Ray", "structmanifold_1_1_ray.html", null ], + [ "Rect", "structmanifold_1_1_rect.html", "structmanifold_1_1_rect" ], + [ "ReindexEdge", "structmanifold_1_1_reindex_edge.html", null ], + [ "Smoothness", "group___connections.html#structmanifold_1_1_smoothness", "group___connections_structmanifold_1_1_smoothness" ], + [ "SparseIndices", "classmanifold_1_1_sparse_indices.html", null ], + [ "StridedRange", "structmanifold_1_1_strided_range.html", null ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "topologyErr", "structmanifold_1_1topology_err.html", null ], + [ "TransformIterator", "structmanifold_1_1_transform_iterator.html", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", "structmanifold_1_1_tri_ref" ], + [ "UnionFind", "structmanifold_1_1_union_find.html", null ], + [ "userErr", "structmanifold_1_1user_err.html", null ], + [ "Vec", "classmanifold_1_1_vec.html", null ], + [ "VecView", "classmanifold_1_1_vec_view.html", null ] + ] ], + [ "nb", null, [ + [ "detail", null, [ + [ "type_caster< glm::mat< C, R, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< glm::vec< N, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< manifold::VecView< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "type_caster< std::vector< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ] + ] ] + ] ], + [ "std", null, [ + [ "hash< manifold::ivec4 >", "structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html", null ], + [ "hash< std::pair< int, int > >", "structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html", null ] + ] ], + [ "CubeVoid", "struct_cube_void.html", null ], + [ "Edge", "struct_edge.html", null ], + [ "glm_name", "structglm__name.html", null ], + [ "glm_name< ivec3 >", "structglm__name_3_01ivec3_01_4.html", null ], + [ "glm_name< mat3x2 >", "structglm__name_3_01mat3x2_01_4.html", null ], + [ "glm_name< mat4x3 >", "structglm__name_3_01mat4x3_01_4.html", null ], + [ "glm_name< vec2 >", "structglm__name_3_01vec2_01_4.html", null ], + [ "glm_name< vec3 >", "structglm__name_3_01vec3_01_4.html", null ], + [ "GyroidSDF", "struct_gyroid_s_d_f.html", null ], + [ "HullImpl", "class_hull_impl.html", null ], + [ "HullImplCGAL", "class_hull_impl_c_g_a_l.html", null ], + [ "HullImplOriginal", "class_hull_impl_original.html", null ], + [ "Layers", "struct_layers.html", null ], + [ "ManifoldIVec3", "struct_manifold_i_vec3.html", null ], + [ "ManifoldManifoldPair", "struct_manifold_manifold_pair.html", null ], + [ "ManifoldProperties", "struct_manifold_properties.html", null ], + [ "ManifoldVec2", "struct_manifold_vec2.html", null ], + [ "ManifoldVec3", "struct_manifold_vec3.html", null ], + [ "ManifoldVec4", "struct_manifold_vec4.html", null ], + [ "MeshSize", "struct_mesh_size.html", null ], + [ "Options", "struct_options.html", null ], + [ "Result", "struct_result.html", null ] +]; \ No newline at end of file diff --git a/docs/html/bc_s.png b/docs/html/bc_s.png new file mode 100644 index 000000000..224b29aa9 Binary files /dev/null and b/docs/html/bc_s.png differ diff --git a/docs/html/bc_sd.png b/docs/html/bc_sd.png new file mode 100644 index 000000000..31ca888dc Binary files /dev/null and b/docs/html/bc_sd.png differ diff --git a/docs/html/boolean3_8h_source.html b/docs/html/boolean3_8h_source.html new file mode 100644 index 000000000..11e2fd847 --- /dev/null +++ b/docs/html/boolean3_8h_source.html @@ -0,0 +1,160 @@ + + + + + + + +Manifold: boolean3.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
boolean3.h
+
+
+
1// Copyright 2020 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include "impl.h"
+
17
+
18#ifdef MANIFOLD_DEBUG
+
19#define PRINT(msg) \
+
20 if (ManifoldParams().verbose) std::cout << msg << std::endl;
+
21#else
+
22#define PRINT(msg)
+
23#endif
+
24
+
45namespace manifold {
+
46
+
+
48class Boolean3 {
+
49 public:
+
50 Boolean3(const Manifold::Impl& inP, const Manifold::Impl& inQ, OpType op);
+ +
52
+
53 private:
+
54 const Manifold::Impl &inP_, &inQ_;
+
55 const double expandP_;
+
56 SparseIndices p1q2_, p2q1_;
+
57 Vec<int> x12_, x21_, w03_, w30_;
+
58 Vec<vec3> v12_, v21_;
+
59};
+
+
60} // namespace manifold
+
Definition boolean3.h:48
+
Definition sparse.h:39
+
Definition vec.h:43
+
OpType
Definition common.h:522
+
Definition meshIO.h:20
+
Definition stl_test.cpp:532
+
Definition impl.h:31
+
+
+ + + + diff --git a/docs/html/class_hull_impl-members.html b/docs/html/class_hull_impl-members.html new file mode 100644 index 000000000..16f6895f2 --- /dev/null +++ b/docs/html/class_hull_impl-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HullImpl Member List
+
+
+ +

This is the complete list of members for HullImpl, including all inherited members.

+ + + + + + +
hull(const manifold::Manifold &input, const std::vector< vec3 > &pts)=0 (defined in HullImpl)HullImplpure virtual
hullManifold (defined in HullImpl)HullImplprotected
inputManifold (defined in HullImpl)HullImplprotected
isMeshConvex() (defined in HullImpl)HullImplinline
~HullImpl()=default (defined in HullImpl)HullImplvirtual
+
+ + + + diff --git a/docs/html/class_hull_impl.html b/docs/html/class_hull_impl.html new file mode 100644 index 000000000..ec7faae10 --- /dev/null +++ b/docs/html/class_hull_impl.html @@ -0,0 +1,137 @@ + + + + + + + +Manifold: HullImpl Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HullImpl Class Referenceabstract
+
+
+ +

Inherited by HullImplCGAL, and HullImplOriginal.

+ + + + + + +

+Public Member Functions

+virtual void hull (const manifold::Manifold &input, const std::vector< vec3 > &pts)=0
 
+bool isMeshConvex ()
 
+ + + + + +

+Protected Attributes

+manifold::Manifold hullManifold
 
+manifold::Manifold inputManifold
 
+
+
+ + + + diff --git a/docs/html/class_hull_impl_c_g_a_l-members.html b/docs/html/class_hull_impl_c_g_a_l-members.html new file mode 100644 index 000000000..0df51653a --- /dev/null +++ b/docs/html/class_hull_impl_c_g_a_l-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HullImplCGAL Member List
+
+
+ +

This is the complete list of members for HullImplCGAL, including all inherited members.

+ + + + + + +
hull(const manifold::Manifold &input, const std::vector< vec3 > &pts) override (defined in HullImplCGAL)HullImplCGALinlinevirtual
hullManifold (defined in HullImpl)HullImplprotected
inputManifold (defined in HullImpl)HullImplprotected
isMeshConvex() (defined in HullImpl)HullImplinline
~HullImpl()=default (defined in HullImpl)HullImplvirtual
+
+ + + + diff --git a/docs/html/class_hull_impl_c_g_a_l.html b/docs/html/class_hull_impl_c_g_a_l.html new file mode 100644 index 000000000..724d80cc0 --- /dev/null +++ b/docs/html/class_hull_impl_c_g_a_l.html @@ -0,0 +1,176 @@ + + + + + + + +Manifold: HullImplCGAL Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HullImplCGAL Class Reference
+
+
+ +

Inherits HullImpl.

+ + + + + + + +

+Public Member Functions

void hull (const manifold::Manifold &input, const std::vector< vec3 > &pts) override
 
- Public Member Functions inherited from HullImpl
+bool isMeshConvex ()
 
+ + + + + + +

+Additional Inherited Members

- Protected Attributes inherited from HullImpl
+manifold::Manifold hullManifold
 
+manifold::Manifold inputManifold
 
+

Member Function Documentation

+ +

◆ hull()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void hull (const manifold::Manifoldinput,
const std::vector< vec3 > & pts 
)
+
+inlineoverridevirtual
+
+ +

Implements HullImpl.

+ +
+
+
+
+ + + + diff --git a/docs/html/class_hull_impl_original-members.html b/docs/html/class_hull_impl_original-members.html new file mode 100644 index 000000000..5b9b4cbcf --- /dev/null +++ b/docs/html/class_hull_impl_original-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HullImplOriginal Member List
+
+
+ +

This is the complete list of members for HullImplOriginal, including all inherited members.

+ + + + + + +
hull(const manifold::Manifold &input, const std::vector< vec3 > &pts) override (defined in HullImplOriginal)HullImplOriginalinlinevirtual
hullManifold (defined in HullImpl)HullImplprotected
inputManifold (defined in HullImpl)HullImplprotected
isMeshConvex() (defined in HullImpl)HullImplinline
~HullImpl()=default (defined in HullImpl)HullImplvirtual
+
+ + + + diff --git a/docs/html/class_hull_impl_original.html b/docs/html/class_hull_impl_original.html new file mode 100644 index 000000000..0ac106bf0 --- /dev/null +++ b/docs/html/class_hull_impl_original.html @@ -0,0 +1,176 @@ + + + + + + + +Manifold: HullImplOriginal Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HullImplOriginal Class Reference
+
+
+ +

Inherits HullImpl.

+ + + + + + + +

+Public Member Functions

void hull (const manifold::Manifold &input, const std::vector< vec3 > &pts) override
 
- Public Member Functions inherited from HullImpl
+bool isMeshConvex ()
 
+ + + + + + +

+Additional Inherited Members

- Protected Attributes inherited from HullImpl
+manifold::Manifold hullManifold
 
+manifold::Manifold inputManifold
 
+

Member Function Documentation

+ +

◆ hull()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void hull (const manifold::Manifoldinput,
const std::vector< vec3 > & pts 
)
+
+inlineoverridevirtual
+
+ +

Implements HullImpl.

+ +
+
+
+
+ + + + diff --git a/docs/html/classes.html b/docs/html/classes.html new file mode 100644 index 000000000..7597453c9 --- /dev/null +++ b/docs/html/classes.html @@ -0,0 +1,171 @@ + + + + + + + +Manifold: Class Index + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Index
+
+
+
A | B | C | E | F | G | H | I | L | M | N | O | P | Q | R | S | T | U | V
+
+
+
A
+
all_of (benchmarks)
+
+
B
+
Barycentric (manifold)
Manifold::Impl::BaryIndices (manifold)
Boolean3 (manifold)
Box (manifold)
BuildInternalBoxes (manifold::collider_internal)
+
+
C
+
Collider (manifold)
ConcurrentSharedPtr (manifold)
copy (benchmarks)
copy_if_1001 (benchmarks)
copy_if_28 (benchmarks)
copy_if_55 (benchmarks)
copy_if_82 (benchmarks)
count (benchmarks)
CountCollisions (manifold::collider_internal)
CountingIterator (manifold)
CreateRadixTree (manifold::collider_internal)
CrossSection (manifold)
CsgLeafNode (manifold)
CsgNode (manifold)
CsgOpNode (manifold)
CubeVoid
+
+
E
+
Edge
exclusive_scan (benchmarks)
ExecutionParams (manifold)
ExportOptions (manifold)
+
+
F
+
MeshBuilder::Face (manifold)
fill (benchmarks)
FindCollisions (manifold::collider_internal)
for_each (benchmarks)
+
+
G
+
geometryErr (manifold)
glm_name
glm_name< ivec3 >
glm_name< mat3x2 >
glm_name< mat4x3 >
glm_name< vec2 >
glm_name< vec3 >
GyroidSDF
+
+
H
+
Halfedge (manifold)
HalfEdgeMesh (manifold)
hash< manifold::ivec4 > (std)
hash< std::pair< int, int > > (std)
HashTable (manifold)
HashTableD (manifold)
HullImpl
HullImplCGAL
HullImplOriginal
+
+
I
+
Identity (manifold)
Manifold::Impl (manifold)
+
+
L
+
Layers
+
+
M
+
Manifold (manifold)
ManifoldIVec3
ManifoldManifoldPair
ManifoldProperties
ManifoldVec2
ManifoldVec3
ManifoldVec4
Material (manifold)
Mesh (manifold)
MeshBuilder (manifold)
MeshGL (manifold)
Manifold::Impl::MeshRelationD (manifold)
MeshSize
+
+
N
+
Negate (manifold)
+
+
O
+
Options
+
+
P
+
ParCollisionRecorder (manifold::collider_internal)
PathImpl (manifold)
Plane (manifold)
PolyVert (manifold)
Pool (manifold)
Properties (manifold)
+
+
Q
+
Quality (manifold)
QuickHull (manifold)
+
+
R
+
Ray (manifold)
Rect (manifold)
reduce (benchmarks)
ReindexEdge (manifold)
Manifold::Impl::Relation (manifold)
Result
+
+
S
+
SeqCollisionRecorder (manifold::collider_internal)
ConcurrentSharedPtr::SharedPtrGuard (manifold)
Smoothness (manifold)
sort_Asc (benchmarks)
sort_Asc_size (benchmarks)
sort_Asc_size_merge (benchmarks)
sort_Des (benchmarks)
sort_Des_size (benchmarks)
sort_Des_size_merge (benchmarks)
sort_Eq (benchmarks)
sort_Eq_size (benchmarks)
sort_Eq_size_merge (benchmarks)
sort_Rnd (benchmarks)
sort_Rnd_size (benchmarks)
sort_Rnd_size_merge (benchmarks)
sort_roughly_Asc (benchmarks)
sort_roughly_Asc_size (benchmarks)
sort_roughly_Asc_size_merge (benchmarks)
SparseIndices (manifold)
StridedRange (manifold)
SVDSet (manifold)
+
+
T
+
Timer (manifold)
TmpEdge (manifold)
topologyErr (manifold)
transform_reduce (benchmarks)
TransformBox (manifold::collider_internal)
TransformIterator (manifold)
TriRef (manifold)
type_caster< glm::mat< C, R, T, Q > > (nb::detail)
type_caster< glm::vec< N, T, Q > > (nb::detail)
type_caster< manifold::VecView< glm::vec< N, T, Q > > > (nb::detail)
type_caster< std::vector< glm::vec< N, T, Q > > > (nb::detail)
+
+
U
+
UnionFind (manifold)
userErr (manifold)
+
+
V
+
Vec (manifold)
VecView (manifold)
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_boolean3-members.html b/docs/html/classmanifold_1_1_boolean3-members.html new file mode 100644 index 000000000..e0740bc09 --- /dev/null +++ b/docs/html/classmanifold_1_1_boolean3-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Boolean3 Member List
+
+
+ +

This is the complete list of members for Boolean3, including all inherited members.

+ + + +
Boolean3(const Manifold::Impl &inP, const Manifold::Impl &inQ, OpType op) (defined in Boolean3)Boolean3
Result(OpType op) const (defined in Boolean3)Boolean3
+
+ + + + diff --git a/docs/html/classmanifold_1_1_boolean3.html b/docs/html/classmanifold_1_1_boolean3.html new file mode 100644 index 000000000..5631e066e --- /dev/null +++ b/docs/html/classmanifold_1_1_boolean3.html @@ -0,0 +1,125 @@ + + + + + + + +Manifold: Boolean3 Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Boolean3 Class Reference
+
+
+ + + + + + +

+Public Member Functions

Boolean3 (const Manifold::Impl &inP, const Manifold::Impl &inQ, OpType op)
 
+Manifold::Impl Result (OpType op) const
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_collider-members.html b/docs/html/classmanifold_1_1_collider-members.html new file mode 100644 index 000000000..de97ebeb2 --- /dev/null +++ b/docs/html/classmanifold_1_1_collider-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Collider Member List
+
+
+ +

This is the complete list of members for Collider, including all inherited members.

+ + + + + + + +
Collider() (defined in Collider)Colliderinline
Collider(const VecView< const Box > &leafBB, const VecView< const uint32_t > &leafMorton) (defined in Collider)Colliderinline
Collisions(const VecView< const T > &queriesIn) const (defined in Collider)Colliderinline
MortonCode(vec3 position, Box bBox) (defined in Collider)Colliderinlinestatic
Transform(mat4x3 transform) (defined in Collider)Colliderinline
UpdateBoxes(const VecView< const Box > &leafBB) (defined in Collider)Colliderinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_collider.html b/docs/html/classmanifold_1_1_collider.html new file mode 100644 index 000000000..7e3e353c8 --- /dev/null +++ b/docs/html/classmanifold_1_1_collider.html @@ -0,0 +1,139 @@ + + + + + + + +Manifold: Collider Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + +

+Public Member Functions

Collider (const VecView< const Box > &leafBB, const VecView< const uint32_t > &leafMorton)
 
+bool Transform (mat4x3 transform)
 
+void UpdateBoxes (const VecView< const Box > &leafBB)
 
+template<const bool selfCollision = false, const bool inverted = false, typename T >
SparseIndices Collisions (const VecView< const T > &queriesIn) const
 
+ + + +

+Static Public Member Functions

+static uint32_t MortonCode (vec3 position, Box bBox)
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr-members.html b/docs/html/classmanifold_1_1_concurrent_shared_ptr-members.html new file mode 100644 index 000000000..ad6fda0ad --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConcurrentSharedPtr< T > Member List
+
+
+ +

This is the complete list of members for ConcurrentSharedPtr< T >, including all inherited members.

+ + + + + +
ConcurrentSharedPtr(T value) (defined in ConcurrentSharedPtr< T >)ConcurrentSharedPtr< T >inline
ConcurrentSharedPtr(const ConcurrentSharedPtr< T > &other) (defined in ConcurrentSharedPtr< T >)ConcurrentSharedPtr< T >inline
GetGuard() (defined in ConcurrentSharedPtr< T >)ConcurrentSharedPtr< T >inline
UseCount() (defined in ConcurrentSharedPtr< T >)ConcurrentSharedPtr< T >inline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr.html b/docs/html/classmanifold_1_1_concurrent_shared_ptr.html new file mode 100644 index 000000000..75540d299 --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr.html @@ -0,0 +1,137 @@ + + + + + + + +Manifold: ConcurrentSharedPtr< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConcurrentSharedPtr< T > Class Template Reference
+
+
+ + + + +

+Classes

class  SharedPtrGuard
 
+ + + + + + + + + +

+Public Member Functions

ConcurrentSharedPtr (T value)
 
ConcurrentSharedPtr (const ConcurrentSharedPtr< T > &other)
 
+SharedPtrGuard GetGuard ()
 
+unsigned int UseCount ()
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr.js b/docs/html/classmanifold_1_1_concurrent_shared_ptr.js new file mode 100644 index 000000000..262cb457b --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr.js @@ -0,0 +1,4 @@ +var classmanifold_1_1_concurrent_shared_ptr = +[ + [ "SharedPtrGuard", "classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html", null ] +]; \ No newline at end of file diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard-members.html b/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard-members.html new file mode 100644 index 000000000..ad9971bad --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConcurrentSharedPtr< T >::SharedPtrGuard Member List
+
+
+ +

This is the complete list of members for ConcurrentSharedPtr< T >::SharedPtrGuard, including all inherited members.

+ + + + + +
operator*() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
operator->() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
SharedPtrGuard(std::recursive_mutex *mutex, T *content) (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
~SharedPtrGuard() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html b/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html new file mode 100644 index 000000000..5cf341e88 --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html @@ -0,0 +1,128 @@ + + + + + + + +Manifold: ConcurrentSharedPtr< T >::SharedPtrGuard Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConcurrentSharedPtr< T >::SharedPtrGuard Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

SharedPtrGuard (std::recursive_mutex *mutex, T *content)
 
+T & operator* ()
 
+T * operator-> ()
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_cross_section-members.html b/docs/html/classmanifold_1_1_cross_section-members.html new file mode 100644 index 000000000..fe3ee3f27 --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section-members.html @@ -0,0 +1,156 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CrossSection Member List
+
+
+ +

This is the complete list of members for CrossSection, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Area() constCrossSection
BatchBoolean(const std::vector< CrossSection > &crossSections, OpType op)CrossSectionstatic
Boolean(const CrossSection &second, OpType op) constCrossSection
Bounds() constCrossSection
Circle(double radius, int circularSegments=0)CrossSectionstatic
Compose(std::vector< CrossSection > &)CrossSectionstatic
CrossSection()CrossSection
CrossSection(const CrossSection &other)CrossSection
CrossSection(CrossSection &&) noexcept (defined in CrossSection)CrossSection
CrossSection(const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)CrossSection
CrossSection(const Polygons &contours, FillRule fillrule=FillRule::Positive)CrossSection
CrossSection(const Rect &rect)CrossSection
Decompose() constCrossSection
FillRule enum nameCrossSection
Hull() constCrossSection
Hull(const std::vector< CrossSection > &crossSections)CrossSectionstatic
Hull(const SimplePolygon poly)CrossSectionstatic
Hull(const Polygons polys)CrossSectionstatic
IsEmpty() constCrossSection
JoinType enum nameCrossSection
Mirror(const vec2 ax) constCrossSection
NumContour() constCrossSection
NumVert() constCrossSection
Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) constCrossSection
operator+(const CrossSection &) constCrossSection
operator+=(const CrossSection &)CrossSection
operator-(const CrossSection &) constCrossSection
operator-=(const CrossSection &)CrossSection
operator=(const CrossSection &other) (defined in CrossSection)CrossSection
operator=(CrossSection &&) noexcept (defined in CrossSection)CrossSection
operator^(const CrossSection &) constCrossSection
operator^=(const CrossSection &)CrossSection
Rotate(double degrees) constCrossSection
Scale(const vec2 s) constCrossSection
Simplify(double epsilon=1e-6) constCrossSection
Square(const vec2 dims, bool center=false)CrossSectionstatic
ToPolygons() constCrossSection
Transform(const mat3x2 &m) constCrossSection
Translate(const vec2 v) constCrossSection
Warp(std::function< void(vec2 &)> warpFunc) constCrossSection
WarpBatch(std::function< void(VecView< vec2 >)> warpFunc) constCrossSection
~CrossSection() (defined in CrossSection)CrossSection
+
+ + + + diff --git a/docs/html/classmanifold_1_1_cross_section.html b/docs/html/classmanifold_1_1_cross_section.html new file mode 100644 index 000000000..e997f7618 --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.html @@ -0,0 +1,1215 @@ + + + + + + + +Manifold: CrossSection Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CrossSection Class Reference
+
+
+ +

#include <cross_section.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + +

Creation

Constructors

+
enum class  FillRule { EvenOdd +, NonZero +, Positive +, Negative + }
 
 CrossSection ()
 
 CrossSection (const CrossSection &other)
 
+CrossSectionoperator= (const CrossSection &other)
 
CrossSection (CrossSection &&) noexcept
 
+CrossSectionoperator= (CrossSection &&) noexcept
 
 CrossSection (const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)
 
 CrossSection (const Polygons &contours, FillRule fillrule=FillRule::Positive)
 
 CrossSection (const Rect &rect)
 
static CrossSection Square (const vec2 dims, bool center=false)
 
static CrossSection Circle (double radius, int circularSegments=0)
 
+ + + + + + + + + + + + + + + + + + + + + +

Modification

enum class  JoinType { Square +, Round +, Miter + }
 
CrossSection Translate (const vec2 v) const
 
CrossSection Rotate (double degrees) const
 
CrossSection Scale (const vec2 s) const
 
CrossSection Mirror (const vec2 ax) const
 
CrossSection Transform (const mat3x2 &m) const
 
CrossSection Warp (std::function< void(vec2 &)> warpFunc) const
 
CrossSection WarpBatch (std::function< void(VecView< vec2 >)> warpFunc) const
 
CrossSection Simplify (double epsilon=1e-6) const
 
CrossSection Offset (double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
 
+ + + + + + + + + + + + +

Information

Details of the cross-section

+
double Area () const
 
int NumVert () const
 
int NumContour () const
 
bool IsEmpty () const
 
Rect Bounds () const
 
+ + + + + + + + + + + + + + + + + + +

Boolean

Combine two manifolds

+
CrossSection Boolean (const CrossSection &second, OpType op) const
 
CrossSection operator+ (const CrossSection &) const
 
CrossSectionoperator+= (const CrossSection &)
 
CrossSection operator- (const CrossSection &) const
 
CrossSectionoperator-= (const CrossSection &)
 
CrossSection operator^ (const CrossSection &) const
 
CrossSectionoperator^= (const CrossSection &)
 
static CrossSection BatchBoolean (const std::vector< CrossSection > &crossSections, OpType op)
 
+ + + + + +

Topological

std::vector< CrossSectionDecompose () const
 
static CrossSection Compose (std::vector< CrossSection > &)
 
+ + + + + + + + + +

Convex Hulling

CrossSection Hull () const
 
static CrossSection Hull (const std::vector< CrossSection > &crossSections)
 
static CrossSection Hull (const SimplePolygon poly)
 
static CrossSection Hull (const Polygons polys)
 
+ + + +

Conversion

Polygons ToPolygons () const
 
+

Detailed Description

+

Two-dimensional cross sections guaranteed to be without self-intersections, or overlaps between polygons (from construction onwards). This class makes use of the Clipper2 library for polygon clipping (boolean) and offsetting operations.

+

Member Enumeration Documentation

+ +

◆ FillRule

+ +
+
+ + + + + +
+ + + + +
enum class FillRule
+
+strong
+
+

Filling rules defining which polygon sub-regions are considered to be inside a given polygon, and which sub-regions will not (based on winding numbers). See the Clipper2 docs for a detailed explaination with illusrations.

+ + + + + +
Enumerator
EvenOdd 

Only odd numbered sub-regions are filled.

+
NonZero 

Only non-zero sub-regions are filled.

+
Positive 

Only sub-regions with winding counts > 0 are filled.

+
Negative 

Only sub-regions with winding counts < 0 are filled.

+
+ +
+
+ +

◆ JoinType

+ +
+
+ + + + + +
+ + + + +
enum class JoinType
+
+strong
+
+

Specifies the treatment of path/contour joins (corners) when offseting CrossSections. See the Clipper2 doc for illustrations.

+ + + + +
Enumerator
Square 

Squaring is applied uniformly at all joins where the internal join angle is less that 90 degrees. The squared edge will be at exactly the offset distance from the join vertex.

+
Round 

Rounding is applied to all joins that have convex external angles, and it maintains the exact offset distance from the join vertex.

+
Miter 

There's a necessary limit to mitered joins (to avoid narrow angled joins producing excessively long and narrow spikes). So where mitered joins would exceed a given maximum miter distance (relative to the offset distance), these are 'squared' instead.

+
+ +
+
+

Constructor & Destructor Documentation

+ +

◆ CrossSection() [1/5]

+ +
+
+ + + + + + + +
CrossSection ()
+
+

The default constructor is an empty cross-section (containing no contours).

+ +
+
+ +

◆ CrossSection() [2/5]

+ +
+
+ + + + + + + + +
CrossSection (const CrossSectionother)
+
+

The copy constructor avoids copying the underlying paths vector (sharing with its parent via shared_ptr), however subsequent transformations, and their application will not be shared. It is generally recommended to avoid this, opting instead to simply create CrossSections with the available const methods.

+ +
+
+ +

◆ CrossSection() [3/5]

+ +
+
+ + + + + + + + + + + + + + + + + + +
CrossSection (const SimplePolygoncontour,
FillRule fillrule = FillRule::Positive 
)
+
+

Create a 2d cross-section from a single contour. A boolean union operation (with Positive filling rule by default) is performed to ensure the resulting CrossSection is free of self-intersections.

+
Parameters
+ + + +
contourA closed path outlining the desired cross-section.
fillruleThe filling rule used to interpret polygon sub-regions created by self-intersections in contour.
+
+
+ +
+
+ +

◆ CrossSection() [4/5]

+ +
+
+ + + + + + + + + + + + + + + + + + +
CrossSection (const Polygonscontours,
FillRule fillrule = FillRule::Positive 
)
+
+

Create a 2d cross-section from a set of contours (complex polygons). A boolean union operation (with Positive filling rule by default) is performed to combine overlapping polygons and ensure the resulting CrossSection is free of intersections.

+
Parameters
+ + + +
contoursA set of closed paths describing zero or more complex polygons.
fillruleThe filling rule used to interpret polygon sub-regions in contours.
+
+
+ +
+
+ +

◆ CrossSection() [5/5]

+ +
+
+ + + + + + + + +
CrossSection (const Rectrect)
+
+

Create a 2d cross-section from an axis-aligned rectangle (bounding box).

+
Parameters
+ + +
rectAn axis-aligned rectangular bounding box.
+
+
+ +
+
+

Member Function Documentation

+ +

◆ Square()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CrossSection Square (const vec2 size,
bool center = false 
)
+
+static
+
+

Constructs a square with the given XY dimensions. By default it is positioned in the first quadrant, touching the origin. If any dimensions in size are negative, or if all are zero, an empty Manifold will be returned.

+
Parameters
+ + + +
sizeThe X, and Y dimensions of the square.
centerSet to true to shift the center to the origin.
+
+
+ +
+
+ +

◆ Circle()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CrossSection Circle (double radius,
int circularSegments = 0 
)
+
+static
+
+

Constructs a circle of a given radius.

+
Parameters
+ + + +
radiusRadius of the circle. Must be positive.
circularSegmentsNumber of segments along its diameter. Default is calculated by the static Quality defaults according to the radius.
+
+
+ +
+
+ +

◆ Area()

+ +
+
+ + + + + + + +
double Area () const
+
+

Return the total area covered by complex polygons making up the CrossSection.

+ +
+
+ +

◆ NumVert()

+ +
+
+ + + + + + + +
int NumVert () const
+
+

Return the number of vertices in the CrossSection.

+ +
+
+ +

◆ NumContour()

+ +
+
+ + + + + + + +
int NumContour () const
+
+

Return the number of contours (both outer and inner paths) in the CrossSection.

+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + + + +
bool IsEmpty () const
+
+

Does the CrossSection contain any contours?

+ +
+
+ +

◆ Bounds()

+ +
+
+ + + + + + + +
Rect Bounds () const
+
+

Returns the axis-aligned bounding rectangle of all the CrossSections' vertices.

+ +
+
+ +

◆ Translate()

+ +
+
+ + + + + + + + +
CrossSection Translate (const vec2 v) const
+
+

Move this CrossSection in space. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
vThe vector to add to every vertex.
+
+
+ +
+
+ +

◆ Rotate()

+ +
+
+ + + + + + + + +
CrossSection Rotate (double degrees) const
+
+

Applies a (Z-axis) rotation to the CrossSection, in degrees. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
degreesdegrees about the Z-axis to rotate.
+
+
+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + + + + +
CrossSection Scale (const vec2 scale) const
+
+

Scale this CrossSection in space. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
vThe vector to multiply every vertex by per component.
+
+
+ +
+
+ +

◆ Mirror()

+ +
+
+ + + + + + + + +
CrossSection Mirror (const vec2 ax) const
+
+

Mirror this CrossSection over the arbitrary axis described by the unit form of the given vector. If the length of the vector is zero, an empty CrossSection is returned. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
axthe axis to be mirrored over
+
+
+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + + + + +
CrossSection Transform (const mat3x2 & m) const
+
+

Transform this CrossSection in space. The first two columns form a 2x2 matrix transform and the last is a translation vector. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
mThe affine transform matrix to apply to all the vertices.
+
+
+ +
+
+ +

◆ Warp()

+ +
+
+ + + + + + + + +
CrossSection Warp (std::function< void(vec2 &)> warpFunc) const
+
+

Move the vertices of this CrossSection (creating a new one) according to any arbitrary input function, followed by a union operation (with a Positive fill rule) that ensures any introduced intersections are not included in the result.

+
Parameters
+ + +
warpFuncA function that modifies a given vertex position.
+
+
+ +
+
+ +

◆ WarpBatch()

+ +
+
+ + + + + + + + +
CrossSection WarpBatch (std::function< void(VecView< vec2 >)> warpFunc) const
+
+

Same as CrossSection::Warp but calls warpFunc with a VecView which is roughly equivalent to std::span pointing to all vec2 elements to be modified in-place

+
Parameters
+ + +
warpFuncA function that modifies multiple vertex positions.
+
+
+ +
+
+ +

◆ Simplify()

+ +
+
+ + + + + + + + +
CrossSection Simplify (double epsilon = 1e-6) const
+
+

Remove vertices from the contours in this CrossSection that are less than the specified distance epsilon from an imaginary line that passes through its two adjacent vertices. Near duplicate vertices and collinear points will be removed at lower epsilons, with elimination of line segments becoming increasingly aggressive with larger epsilons.

+

It is recommended to apply this function following Offset, in order to clean up any spurious tiny line segments introduced that do not improve quality in any meaningful way. This is particularly important if further offseting operations are to be performed, which would compound the issue.

+ +
+
+ +

◆ Offset()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CrossSection Offset (double delta,
JoinType jointype,
double miter_limit = 2.0,
int circularSegments = 0 
) const
+
+

Inflate the contours in CrossSection by the specified delta, handling corners according to the given JoinType.

+
Parameters
+ + + + + +
deltaPositive deltas will cause the expansion of outlining contours to expand, and retraction of inner (hole) contours. Negative deltas will have the opposite effect.
jtThe join type specifying the treatment of contour joins (corners).
miter_limitThe maximum distance in multiples of delta that vertices can be offset from their original positions with before squaring is applied, when the join type is Miter (default is 2, which is the minimum allowed). See the Clipper2 MiterLimit page for a visual example.
circularSegmentsNumber of segments per 360 degrees of JoinType::Round corners (roughly, the number of vertices that will be added to each contour). Default is calculated by the static Quality defaults according to the radius.
+
+
+ +
+
+ +

◆ Boolean()

+ +
+
+ + + + + + + + + + + + + + + + + + +
CrossSection Boolean (const CrossSectionsecond,
OpType op 
) const
+
+

Perform the given boolean operation between this and another CrossSection.

+ +
+
+ +

◆ BatchBoolean()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
CrossSection BatchBoolean (const std::vector< CrossSection > & crossSections,
OpType op 
)
+
+static
+
+

Perform the given boolean operation on a list of CrossSections. In case of Subtract, all CrossSections in the tail are differenced from the head.

+ +
+
+ +

◆ operator+()

+ +
+
+ + + + + + + + +
CrossSection operator+ (const CrossSectionQ) const
+
+

Compute the boolean union between two cross-sections.

+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + + + + +
CrossSection & operator+= (const CrossSectionQ)
+
+

Compute the boolean union between two cross-sections, assigning the result to the first.

+ +
+
+ +

◆ operator-()

+ +
+
+ + + + + + + + +
CrossSection operator- (const CrossSectionQ) const
+
+

Compute the boolean difference of a (clip) cross-section from another (subject).

+ +
+
+ +

◆ operator-=()

+ +
+
+ + + + + + + + +
CrossSection & operator-= (const CrossSectionQ)
+
+

Compute the boolean difference of a (clip) cross-section from a another (subject), assigning the result to the subject.

+ +
+
+ +

◆ operator^()

+ +
+
+ + + + + + + + +
CrossSection operator^ (const CrossSectionQ) const
+
+

Compute the boolean intersection between two cross-sections.

+ +
+
+ +

◆ operator^=()

+ +
+
+ + + + + + + + +
CrossSection & operator^= (const CrossSectionQ)
+
+

Compute the boolean intersection between two cross-sections, assigning the result to the first.

+ +
+
+ +

◆ Compose()

+ +
+
+ + + + + +
+ + + + + + + + +
CrossSection Compose (std::vector< CrossSection > & crossSections)
+
+static
+
+

Construct a CrossSection from a vector of other CrossSections (batch boolean union).

+ +
+
+ +

◆ Decompose()

+ +
+
+ + + + + + + +
std::vector< CrossSection > Decompose () const
+
+

This operation returns a vector of CrossSections that are topologically disconnected, each containing one outline contour with zero or more holes.

+ +
+
+ +

◆ Hull() [1/4]

+ +
+
+ + + + + + + +
CrossSection Hull () const
+
+

Compute the convex hull of this cross-section.

+ +
+
+ +

◆ Hull() [2/4]

+ +
+
+ + + + + +
+ + + + + + + + +
CrossSection Hull (const std::vector< CrossSection > & crossSections)
+
+static
+
+

Compute the convex hull enveloping a set of cross-sections.

+
Parameters
+ + +
crossSectionsA vector of cross-sections over which to compute a convex hull.
+
+
+ +
+
+ +

◆ Hull() [3/4]

+ +
+
+ + + + + +
+ + + + + + + + +
CrossSection Hull (const SimplePolygon poly)
+
+static
+
+

Compute the convex hull of a set of points. If the given points are fewer than 3, an empty CrossSection will be returned.

+
Parameters
+ + +
ptsA vector of 2-dimensional points over which to compute a convex hull.
+
+
+ +
+
+ +

◆ Hull() [4/4]

+ +
+
+ + + + + +
+ + + + + + + + +
CrossSection Hull (const Polygons polys)
+
+static
+
+

Compute the convex hull of a set of points/polygons. If the given points are fewer than 3, an empty CrossSection will be returned.

+
Parameters
+ + +
ptsA vector of vectors of 2-dimensional points over which to compute a convex hull.
+
+
+ +
+
+ +

◆ ToPolygons()

+ +
+
+ + + + + + + +
Polygons ToPolygons () const
+
+

Return the contours of this CrossSection as a Polygons.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_cross_section.js b/docs/html/classmanifold_1_1_cross_section.js new file mode 100644 index 000000000..4d00d6baa --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.js @@ -0,0 +1,43 @@ +var classmanifold_1_1_cross_section = +[ + [ "FillRule", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4", [ + [ "EvenOdd", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390", null ], + [ "NonZero", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a", null ], + [ "Positive", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147", null ], + [ "Negative", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b", null ] + ] ], + [ "JoinType", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d", [ + [ "Square", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304", null ], + [ "Round", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c", null ], + [ "Miter", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514", null ] + ] ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2", null ], + [ "Area", "classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666", null ], + [ "NumVert", "classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumContour", "classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c", null ], + [ "IsEmpty", "classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Bounds", "classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c", null ], + [ "Translate", "classmanifold_1_1_cross_section.html#a38bcb89b28140acbceca56f0bbda67b9", null ], + [ "Rotate", "classmanifold_1_1_cross_section.html#a794f36c935736ecf71806fb3ccd46956", null ], + [ "Scale", "classmanifold_1_1_cross_section.html#ad0f8a0ea9c4e2394bc4808dfb7ae1c69", null ], + [ "Mirror", "classmanifold_1_1_cross_section.html#a3bdcbaf979a769af24a9d61624e639e8", null ], + [ "Transform", "classmanifold_1_1_cross_section.html#a534ac4a433b68882dba4919ade75946c", null ], + [ "Warp", "classmanifold_1_1_cross_section.html#ac50618697f91880859f4d536f2569b5e", null ], + [ "WarpBatch", "classmanifold_1_1_cross_section.html#a2d4ae264fded90c78cf750ad0dbea33a", null ], + [ "Simplify", "classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf", null ], + [ "Offset", "classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a", null ], + [ "Boolean", "classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2", null ], + [ "operator+", "classmanifold_1_1_cross_section.html#a347c593a12693ee05159b34db0957580", null ], + [ "operator+=", "classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a", null ], + [ "operator-", "classmanifold_1_1_cross_section.html#af6a000221ca368c9f2ed3e1f271cfb7f", null ], + [ "operator-=", "classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0", null ], + [ "operator^", "classmanifold_1_1_cross_section.html#a34fcc007d18275e2cc32f4c99bc94cda", null ], + [ "operator^=", "classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3", null ], + [ "Decompose", "classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c", null ], + [ "Hull", "classmanifold_1_1_cross_section.html#aa5ea1caf54ddac72d939a00d13763ace", null ], + [ "ToPolygons", "classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2", null ] +]; \ No newline at end of file diff --git a/docs/html/classmanifold_1_1_csg_leaf_node-members.html b/docs/html/classmanifold_1_1_csg_leaf_node-members.html new file mode 100644 index 000000000..4d1092f3a --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_leaf_node-members.html @@ -0,0 +1,127 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CsgLeafNode Member List
+
+
+ +

This is the complete list of members for CsgLeafNode, including all inherited members.

+ + + + + + + + + + + + + + +
Boolean(const std::shared_ptr< CsgNode > &second, OpType op) (defined in CsgNode)CsgNodevirtual
Compose(const std::vector< std::shared_ptr< CsgLeafNode > > &nodes)CsgLeafNodestatic
CsgLeafNode() (defined in CsgLeafNode)CsgLeafNode
CsgLeafNode(std::shared_ptr< const Manifold::Impl > pImpl_) (defined in CsgLeafNode)CsgLeafNode
CsgLeafNode(std::shared_ptr< const Manifold::Impl > pImpl_, mat4x3 transform_) (defined in CsgLeafNode)CsgLeafNode
GetImpl() const (defined in CsgLeafNode)CsgLeafNode
GetNodeType() const override (defined in CsgLeafNode)CsgLeafNodevirtual
GetTransform() const override (defined in CsgLeafNode)CsgLeafNodevirtual
Rotate(double xDegrees=0, double yDegrees=0, double zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const override (defined in CsgLeafNode)CsgLeafNodevirtual
Transform(const mat4x3 &m) const override (defined in CsgLeafNode)CsgLeafNodevirtual
Translate(const vec3 &t) const (defined in CsgNode)CsgNode
+
+ + + + diff --git a/docs/html/classmanifold_1_1_csg_leaf_node.html b/docs/html/classmanifold_1_1_csg_leaf_node.html new file mode 100644 index 000000000..07ecc72d6 --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_leaf_node.html @@ -0,0 +1,294 @@ + + + + + + + +Manifold: CsgLeafNode Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CsgLeafNode Class Referencefinal
+
+
+ +

Inherits CsgNode.

+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CsgLeafNode (std::shared_ptr< const Manifold::Impl > pImpl_)
 
CsgLeafNode (std::shared_ptr< const Manifold::Impl > pImpl_, mat4x3 transform_)
 
+std::shared_ptr< const Manifold::ImplGetImpl () const
 
std::shared_ptr< CsgLeafNodeToLeafNode () const override
 
std::shared_ptr< CsgNodeTransform (const mat4x3 &m) const override
 
CsgNodeType GetNodeType () const override
 
mat4x3 GetTransform () const override
 
- Public Member Functions inherited from CsgNode
+virtual std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op)
 
+std::shared_ptr< CsgNodeTranslate (const vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (double xDegrees=0, double yDegrees=0, double zDegrees=0) const
 
+ + + +

+Static Public Member Functions

static Manifold::Impl Compose (const std::vector< std::shared_ptr< CsgLeafNode > > &nodes)
 
+

Member Function Documentation

+ +

◆ ToLeafNode()

+ +
+
+ + + + + +
+ + + + + + + +
std::shared_ptr< CsgLeafNode > ToLeafNode () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + +
+ + + + + + + + +
std::shared_ptr< CsgNode > Transform (const mat4x3 & m) const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ GetNodeType()

+ +
+
+ + + + + +
+ + + + + + + +
CsgNodeType GetNodeType () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ GetTransform()

+ +
+
+ + + + + +
+ + + + + + + +
mat4x3 GetTransform () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ Compose()

+ +
+
+ + + + + +
+ + + + + + + + +
Manifold::Impl Compose (const std::vector< std::shared_ptr< CsgLeafNode > > & nodes)
+
+static
+
+

Efficient union of a set of pairwise disjoint meshes.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_csg_node-members.html b/docs/html/classmanifold_1_1_csg_node-members.html new file mode 100644 index 000000000..ce3450bcb --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_node-members.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CsgNode Member List
+
+
+ +

This is the complete list of members for CsgNode, including all inherited members.

+ + + + + + + + + +
Boolean(const std::shared_ptr< CsgNode > &second, OpType op) (defined in CsgNode)CsgNodevirtual
GetNodeType() const =0 (defined in CsgNode)CsgNodepure virtual
GetTransform() const =0 (defined in CsgNode)CsgNodepure virtual
Rotate(double xDegrees=0, double yDegrees=0, double zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const =0 (defined in CsgNode)CsgNodepure virtual
Transform(const mat4x3 &m) const =0 (defined in CsgNode)CsgNodepure virtual
Translate(const vec3 &t) const (defined in CsgNode)CsgNode
+
+ + + + diff --git a/docs/html/classmanifold_1_1_csg_node.html b/docs/html/classmanifold_1_1_csg_node.html new file mode 100644 index 000000000..35a25fb9b --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_node.html @@ -0,0 +1,147 @@ + + + + + + + +Manifold: CsgNode Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CsgNode Class Referenceabstract
+
+
+ +

Inherits enable_shared_from_this< CsgNode >.

+ +

Inherited by CsgLeafNode, and CsgOpNode.

+ + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual std::shared_ptr< CsgLeafNodeToLeafNode () const =0
 
+virtual std::shared_ptr< CsgNodeTransform (const mat4x3 &m) const =0
 
+virtual CsgNodeType GetNodeType () const =0
 
+virtual mat4x3 GetTransform () const =0
 
+virtual std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op)
 
+std::shared_ptr< CsgNodeTranslate (const vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (double xDegrees=0, double yDegrees=0, double zDegrees=0) const
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_csg_op_node-members.html b/docs/html/classmanifold_1_1_csg_op_node-members.html new file mode 100644 index 000000000..41872b37a --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_op_node-members.html @@ -0,0 +1,125 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CsgOpNode Member List
+
+
+ +

This is the complete list of members for CsgOpNode, including all inherited members.

+ + + + + + + + + + + + +
Boolean(const std::shared_ptr< CsgNode > &second, OpType op) override (defined in CsgOpNode)CsgOpNodevirtual
CsgOpNode() (defined in CsgOpNode)CsgOpNode
CsgOpNode(const std::vector< std::shared_ptr< CsgNode > > &children, OpType op) (defined in CsgOpNode)CsgOpNode
CsgOpNode(std::vector< std::shared_ptr< CsgNode > > &&children, OpType op) (defined in CsgOpNode)CsgOpNode
GetNodeType() const override (defined in CsgOpNode)CsgOpNodeinlinevirtual
GetTransform() const override (defined in CsgOpNode)CsgOpNodevirtual
Rotate(double xDegrees=0, double yDegrees=0, double zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const override (defined in CsgOpNode)CsgOpNodevirtual
Transform(const mat4x3 &m) const override (defined in CsgOpNode)CsgOpNodevirtual
Translate(const vec3 &t) const (defined in CsgNode)CsgNode
+
+ + + + diff --git a/docs/html/classmanifold_1_1_csg_op_node.html b/docs/html/classmanifold_1_1_csg_op_node.html new file mode 100644 index 000000000..984df95d8 --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_op_node.html @@ -0,0 +1,296 @@ + + + + + + + +Manifold: CsgOpNode Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CsgOpNode Class Referencefinal
+
+
+ +

Inherits CsgNode.

+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CsgOpNode (const std::vector< std::shared_ptr< CsgNode > > &children, OpType op)
 
CsgOpNode (std::vector< std::shared_ptr< CsgNode > > &&children, OpType op)
 
std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op) override
 
std::shared_ptr< CsgNodeTransform (const mat4x3 &m) const override
 
std::shared_ptr< CsgLeafNodeToLeafNode () const override
 
CsgNodeType GetNodeType () const override
 
mat4x3 GetTransform () const override
 
- Public Member Functions inherited from CsgNode
+std::shared_ptr< CsgNodeTranslate (const vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (double xDegrees=0, double yDegrees=0, double zDegrees=0) const
 
+

Member Function Documentation

+ +

◆ Boolean()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::shared_ptr< CsgNode > Boolean (const std::shared_ptr< CsgNode > & second,
OpType op 
)
+
+overridevirtual
+
+ +

Reimplemented from CsgNode.

+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + +
+ + + + + + + + +
std::shared_ptr< CsgNode > Transform (const mat4x3 & m) const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ ToLeafNode()

+ +
+
+ + + + + +
+ + + + + + + +
std::shared_ptr< CsgLeafNode > ToLeafNode () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ GetNodeType()

+ +
+
+ + + + + +
+ + + + + + + +
CsgNodeType GetNodeType () const
+
+inlineoverridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ GetTransform()

+ +
+
+ + + + + +
+ + + + + + + +
mat4x3 GetTransform () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_half_edge_mesh-members.html b/docs/html/classmanifold_1_1_half_edge_mesh-members.html new file mode 100644 index 000000000..241cbef8d --- /dev/null +++ b/docs/html/classmanifold_1_1_half_edge_mesh-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HalfEdgeMesh Member List
+
+
+ +

This is the complete list of members for HalfEdgeMesh, including all inherited members.

+ + + + + + +
halfEdgeIndexFaces (defined in HalfEdgeMesh)HalfEdgeMesh
HalfEdgeMesh(const MeshBuilder &builderObject, const VecView< vec3 > &vertexData) (defined in HalfEdgeMesh)HalfEdgeMesh
halfedgeNext (defined in HalfEdgeMesh)HalfEdgeMesh
halfedges (defined in HalfEdgeMesh)HalfEdgeMesh
vertices (defined in HalfEdgeMesh)HalfEdgeMesh
+
+ + + + diff --git a/docs/html/classmanifold_1_1_half_edge_mesh.html b/docs/html/classmanifold_1_1_half_edge_mesh.html new file mode 100644 index 000000000..87407cf73 --- /dev/null +++ b/docs/html/classmanifold_1_1_half_edge_mesh.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: HalfEdgeMesh Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HalfEdgeMesh Class Reference
+
+
+ + + + +

+Public Member Functions

HalfEdgeMesh (const MeshBuilder &builderObject, const VecView< vec3 > &vertexData)
 
+ + + + + + + + + +

+Public Attributes

+Vec< vec3 > vertices
 
+std::vector< size_t > halfEdgeIndexFaces
 
+Vec< Halfedgehalfedges
 
+Vec< int > halfedgeNext
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_hash_table-members.html b/docs/html/classmanifold_1_1_hash_table-members.html new file mode 100644 index 000000000..dc2b7362c --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table-members.html @@ -0,0 +1,124 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HashTable< V, H > Member List
+
+
+ +

This is the complete list of members for HashTable< V, H >, including all inherited members.

+ + + + + + + + + + + +
D() (defined in HashTable< V, H >)HashTable< V, H >inline
Entries() const (defined in HashTable< V, H >)HashTable< V, H >inline
FilledFraction() const (defined in HashTable< V, H >)HashTable< V, H >inline
Full() const (defined in HashTable< V, H >)HashTable< V, H >inline
GetValueStore() (defined in HashTable< V, H >)HashTable< V, H >inline
HashTable(size_t size, uint32_t step=1) (defined in HashTable< V, H >)HashTable< V, H >inline
HashTable(const HashTable &other) (defined in HashTable< V, H >)HashTable< V, H >inline
Open() (defined in HashTable< V, H >)HashTable< V, H >inlinestatic
operator=(const HashTable &other) (defined in HashTable< V, H >)HashTable< V, H >inline
Size() const (defined in HashTable< V, H >)HashTable< V, H >inline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_hash_table.html b/docs/html/classmanifold_1_1_hash_table.html new file mode 100644 index 000000000..0ecf40f73 --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table.html @@ -0,0 +1,153 @@ + + + + + + + +Manifold: HashTable< V, H > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HashTable< V, H > Class Template Reference
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

HashTable (size_t size, uint32_t step=1)
 
HashTable (const HashTable &other)
 
+HashTableoperator= (const HashTable &other)
 
+HashTableD< V, H > D ()
 
+int Entries () const
 
+size_t Size () const
 
+bool Full () const
 
+double FilledFraction () const
 
+Vec< V > & GetValueStore ()
 
+ + + +

+Static Public Member Functions

+static Uint64 Open ()
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_hash_table_d-members.html b/docs/html/classmanifold_1_1_hash_table_d-members.html new file mode 100644 index 000000000..4d8a8060e --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table_d-members.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HashTableD< V, H > Member List
+
+
+ +

This is the complete list of members for HashTableD< V, H >, including all inherited members.

+ + + + + + + + + + +
At(int idx) (defined in HashTableD< V, H >)HashTableD< V, H >inline
At(int idx) const (defined in HashTableD< V, H >)HashTableD< V, H >inline
Full() const (defined in HashTableD< V, H >)HashTableD< V, H >inline
HashTableD(Vec< Uint64 > &keys, Vec< V > &values, std::atomic< size_t > &used, uint32_t step=1) (defined in HashTableD< V, H >)HashTableD< V, H >inline
Insert(Uint64 key, const V &val) (defined in HashTableD< V, H >)HashTableD< V, H >inline
KeyAt(int idx) const (defined in HashTableD< V, H >)HashTableD< V, H >inline
operator[](Uint64 key) (defined in HashTableD< V, H >)HashTableD< V, H >inline
operator[](Uint64 key) const (defined in HashTableD< V, H >)HashTableD< V, H >inline
Size() const (defined in HashTableD< V, H >)HashTableD< V, H >inline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_hash_table_d.html b/docs/html/classmanifold_1_1_hash_table_d.html new file mode 100644 index 000000000..430c91604 --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table_d.html @@ -0,0 +1,146 @@ + + + + + + + +Manifold: HashTableD< V, H > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HashTableD< V, H > Class Template Reference
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

HashTableD (Vec< Uint64 > &keys, Vec< V > &values, std::atomic< size_t > &used, uint32_t step=1)
 
+int Size () const
 
+bool Full () const
 
+void Insert (Uint64 key, const V &val)
 
+V & operator[] (Uint64 key)
 
+const V & operator[] (Uint64 key) const
 
+Uint64 KeyAt (int idx) const
 
+V & At (int idx)
 
+const V & At (int idx) const
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_manifold-members.html b/docs/html/classmanifold_1_1_manifold-members.html new file mode 100644 index 000000000..aa69292e9 --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold-members.html @@ -0,0 +1,184 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Manifold Member List
+
+
+ +

This is the complete list of members for Manifold, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AsOriginal() constManifold
BatchBoolean(const std::vector< Manifold > &manifolds, OpType op)Manifoldstatic
Boolean(const Manifold &second, OpType op) constManifold
BoundingBox() constManifold
CalculateCurvature(int gaussianIdx, int meanIdx) constManifold
CalculateNormals(int normalIdx, double minSharpAngle=60) constManifold
Compose(const std::vector< Manifold > &)Manifoldstatic
Cube(vec3 size=vec3(1.0), bool center=false)Manifoldstatic
Cylinder(double height, double radiusLow, double radiusHigh=-1.0, int circularSegments=0, bool center=false)Manifoldstatic
Decompose() constManifold
Error enum name (defined in Manifold)Manifold
Extrude(const Polygons &crossSection, double height, int nDivisions=0, double twistDegrees=0.0, vec2 scaleTop=vec2(1.0))Manifoldstatic
Genus() constManifold
GetMesh() constManifold
GetMeshGL(ivec3 normalIdx=ivec3(0)) constManifold
GetProperties() constManifold
Hull() constManifold
Hull(const std::vector< Manifold > &manifolds)Manifoldstatic
Hull(const std::vector< vec3 > &pts)Manifoldstatic
IsEmpty() constManifold
LevelSet(std::function< double(vec3)> sdf, Box bounds, double edgeLength, double level=0, double precision=-1, bool canParallel=true)Manifoldstatic
Manifold()Manifold
Manifold(const Manifold &other) (defined in Manifold)Manifold
Manifold(Manifold &&) noexcept (defined in Manifold)Manifold
Manifold(const MeshGL &, const std::vector< float > &propertyTolerance={})Manifold
Manifold(const Mesh &)Manifold
MatchesTriNormals() constManifold
MinGap(const Manifold &other, double searchLength) constManifold
Mirror(vec3) constManifold
NumDegenerateTris() constManifold
NumEdge() constManifold
NumOverlaps(const Manifold &second) constManifold
NumProp() constManifold
NumPropVert() constManifold
NumTri() constManifold
NumVert() constManifold
operator+(const Manifold &) constManifold
operator+=(const Manifold &)Manifold
operator-(const Manifold &) constManifold
operator-=(const Manifold &)Manifold
operator=(const Manifold &other) (defined in Manifold)Manifold
operator=(Manifold &&) noexcept (defined in Manifold)Manifold
operator^(const Manifold &) constManifold
operator^=(const Manifold &)Manifold
OriginalID() constManifold
Precision() constManifold
Project() constManifold
Refine(int) constManifold
RefineToLength(double) constManifold
ReserveIDs(uint32_t)Manifoldstatic
Revolve(const Polygons &crossSection, int circularSegments=0, double revolveDegrees=360.0f)Manifoldstatic
Rotate(double xDegrees, double yDegrees=0.0, double zDegrees=0.0) constManifold
Scale(vec3) constManifold
SetProperties(int, std::function< void(double *, vec3, const double *)>) constManifold
Slice(double height=0) constManifold
Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
SmoothByNormals(int normalIdx) constManifold
SmoothOut(double minSharpAngle=60, double minSmoothness=0) constManifold
Sphere(double radius, int circularSegments=0)Manifoldstatic
Split(const Manifold &) constManifold
SplitByPlane(vec3 normal, double originOffset) constManifold
Status() constManifold
Tetrahedron()Manifoldstatic
Transform(const mat4x3 &) constManifold
Translate(vec3) constManifold
TrimByPlane(vec3 normal, double originOffset) constManifold
Warp(std::function< void(vec3 &)>) constManifold
WarpBatch(std::function< void(VecView< vec3 >)>) constManifold
~Manifold() (defined in Manifold)Manifold
+
+ + + + diff --git a/docs/html/classmanifold_1_1_manifold.html b/docs/html/classmanifold_1_1_manifold.html new file mode 100644 index 000000000..f0e03a1cf --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.html @@ -0,0 +1,2055 @@ + + + + + + + +Manifold: Manifold Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Manifold Class Reference
+
+
+ +

#include <manifold.h>

+ + + + +

+Classes

struct  Impl
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Information

Details of the manifold

+
enum class  Error {
+  NoError +, NonFiniteVertex +, NotManifold +, VertexOutOfBounds +,
+  PropertiesWrongLength +, MissingPositionProperties +, MergeVectorsDifferentLengths +, MergeIndexOutOfBounds +,
+  TransformWrongLength +, RunIndexWrongLength +, FaceIDWrongLength +, InvalidConstruction +
+ }
 
Mesh GetMesh () const
 
MeshGL GetMeshGL (ivec3 normalIdx=ivec3(0)) const
 
bool IsEmpty () const
 
Error Status () const
 
int NumVert () const
 
int NumEdge () const
 
int NumTri () const
 
int NumProp () const
 
int NumPropVert () const
 
Box BoundingBox () const
 
double Precision () const
 
int Genus () const
 
Properties GetProperties () const
 
double MinGap (const Manifold &other, double searchLength) const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Creation

Constructors

+
 Manifold ()
 
Manifold (const Manifold &other)
 
+Manifoldoperator= (const Manifold &other)
 
Manifold (Manifold &&) noexcept
 
+Manifoldoperator= (Manifold &&) noexcept
 
 Manifold (const MeshGL &, const std::vector< float > &propertyTolerance={})
 
 Manifold (const Mesh &)
 
static Manifold Smooth (const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})
 
static Manifold Smooth (const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})
 
static Manifold Tetrahedron ()
 
static Manifold Cube (vec3 size=vec3(1.0), bool center=false)
 
static Manifold Cylinder (double height, double radiusLow, double radiusHigh=-1.0, int circularSegments=0, bool center=false)
 
static Manifold Sphere (double radius, int circularSegments=0)
 
static Manifold Extrude (const Polygons &crossSection, double height, int nDivisions=0, double twistDegrees=0.0, vec2 scaleTop=vec2(1.0))
 
static Manifold Revolve (const Polygons &crossSection, int circularSegments=0, double revolveDegrees=360.0f)
 
static Manifold LevelSet (std::function< double(vec3)> sdf, Box bounds, double edgeLength, double level=0, double precision=-1, bool canParallel=true)
 
+ + + + + + +

Topological

No geometric calculations.

+
std::vector< ManifoldDecompose () const
 
static Manifold Compose (const std::vector< Manifold > &)
 
+ + + + + + + + +

Mesh ID

Details of the manifold's relation to its input meshes, for the purposes of reapplying mesh properties.

+
int OriginalID () const
 
Manifold AsOriginal () const
 
static uint32_t ReserveIDs (uint32_t)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Modification

Manifold Translate (vec3) const
 
Manifold Scale (vec3) const
 
Manifold Rotate (double xDegrees, double yDegrees=0.0, double zDegrees=0.0) const
 
Manifold Transform (const mat4x3 &) const
 
Manifold Mirror (vec3) const
 
Manifold Warp (std::function< void(vec3 &)>) const
 
Manifold WarpBatch (std::function< void(VecView< vec3 >)>) const
 
Manifold SetProperties (int, std::function< void(double *, vec3, const double *)>) const
 
Manifold CalculateCurvature (int gaussianIdx, int meanIdx) const
 
Manifold CalculateNormals (int normalIdx, double minSharpAngle=60) const
 
Manifold SmoothByNormals (int normalIdx) const
 
Manifold SmoothOut (double minSharpAngle=60, double minSmoothness=0) const
 
Manifold Refine (int) const
 
Manifold RefineToLength (double) const
 
+ + + + + + + + + + + + + + + + + + + + + + + + +

Boolean

Combine two manifolds

+
Manifold Boolean (const Manifold &second, OpType op) const
 
Manifold operator+ (const Manifold &) const
 
Manifoldoperator+= (const Manifold &)
 
Manifold operator- (const Manifold &) const
 
Manifoldoperator-= (const Manifold &)
 
Manifold operator^ (const Manifold &) const
 
Manifoldoperator^= (const Manifold &)
 
std::pair< Manifold, ManifoldSplit (const Manifold &) const
 
std::pair< Manifold, ManifoldSplitByPlane (vec3 normal, double originOffset) const
 
Manifold TrimByPlane (vec3 normal, double originOffset) const
 
static Manifold BatchBoolean (const std::vector< Manifold > &manifolds, OpType op)
 
+ + + + + +

2D from 3D

Polygons Slice (double height=0) const
 
Polygons Project () const
 
+ + + + + + + +

Convex hull

Manifold Hull () const
 
static Manifold Hull (const std::vector< Manifold > &manifolds)
 
static Manifold Hull (const std::vector< vec3 > &pts)
 
+ + + + + + + + +

Testing hooks

These are just for internal testing.

+
bool MatchesTriNormals () const
 
int NumDegenerateTris () const
 
int NumOverlaps (const Manifold &second) const
 
+

Detailed Description

+

This library's internal representation of an oriented, 2-manifold, triangle mesh - a simple boundary-representation of a solid object. Use this class to store and operate on solids, and use MeshGL for input and output, or potentially Mesh if only basic geometry is required.

+

In addition to storing geometric data, a Manifold can also store an arbitrary number of vertex properties. These could be anything, e.g. normals, UV coordinates, colors, etc, but this library is completely agnostic. All properties are merely float values indexed by channel number. It is up to the user to associate channel numbers with meaning.

+

Manifold allows vertex properties to be shared for efficient storage, or to have multiple property verts associated with a single geometric vertex, allowing sudden property changes, e.g. at Boolean intersections, without sacrificing manifoldness.

+

Manifolds also keep track of their relationships to their inputs, via OriginalIDs and the faceIDs and transforms accessible through MeshGL. This allows object-level properties to be re-associated with the output after many operations, particularly useful for materials. Since separate object's properties are not mixed, there is no requirement that channels have consistent meaning between different inputs.

+

Constructor & Destructor Documentation

+ +

◆ Manifold() [1/3]

+ +
+
+ + + + + + + +
Manifold ()
+
+

Construct an empty Manifold.

+ +
+
+ +

◆ Manifold() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold (const MeshGLmeshGL,
const std::vector< float > & propertyTolerance = {} 
)
+
+

Convert a MeshGL into a Manifold, retaining its properties and merging only the positions according to the merge vectors. Will return an empty Manifold and set an Error Status if the result is not an oriented 2-manifold. Will collapse degenerate triangles and unnecessary vertices.

+

All fields are read, making this structure suitable for a lossless round-trip of data from GetMeshGL. For multi-material input, use ReserveIDs to set a unique originalID for each material, and sort the materials into triangle runs.

+
Parameters
+ + + +
meshGLThe input MeshGL.
propertyToleranceA vector of precision values for each property beyond position. If specified, the propertyTolerance vector must have size = numProp - 3. This is the amount of interpolation error allowed before two neighboring triangles are considered to be on a property boundary edge. Property boundary edges will be retained across operations even if the triangles are coplanar. Defaults to 1e-5, which works well for most properties in the [-1, 1] range.
+
+
+ +
+
+ +

◆ Manifold() [3/3]

+ +
+
+ + + + + + + + +
Manifold (const Meshmesh)
+
+

Convert a Mesh into a Manifold. Will return an empty Manifold and set an Error Status if the Mesh is not an oriented 2-manifold. Will collapse degenerate triangles and unnecessary vertices.

+
Parameters
+ + +
meshThe input Mesh.
+
+
+ +
+
+

Member Function Documentation

+ +

◆ Smooth() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold Smooth (const MeshGLmeshGL,
const std::vector< Smoothness > & sharpenedEdges = {} 
)
+
+static
+
+

Constructs a smooth version of the input mesh by creating tangents; this method will throw if you have supplied tangents with your mesh already. The actual triangle resolution is unchanged; use the Refine() method to interpolate to a higher-resolution curve.

+

By default, every edge is calculated for maximum smoothness (very much approximately), attempting to minimize the maximum mean Curvature magnitude. No higher-order derivatives are considered, as the interpolation is independent per triangle, only sharing constraints on their boundaries.

+
Parameters
+ + + +
meshGLinput MeshGL.
sharpenedEdgesIf desired, you can supply a vector of sharpened halfedges, which should in general be a small subset of all halfedges. Order of entries doesn't matter, as each one specifies the desired smoothness (between zero and one, with one the default for all unspecified halfedges) and the halfedge index (3 * triangle index + [0,1,2] where 0 is the edge between triVert 0 and 1, etc).
+
+
+

At a smoothness value of zero, a sharp crease is made. The smoothness is interpolated along each edge, so the specified value should be thought of as an average. Where exactly two sharpened edges meet at a vertex, their tangents are rotated to be colinear so that the sharpened edge can be continuous. Vertices with only one sharpened edge are completely smooth, allowing sharpened edges to smoothly vanish at termination. A single vertex can be sharpened by sharping all edges that are incident on it, allowing cones to be formed.

+ +
+
+ +

◆ Smooth() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold Smooth (const Meshmesh,
const std::vector< Smoothness > & sharpenedEdges = {} 
)
+
+static
+
+

Constructs a smooth version of the input mesh by creating tangents; this method will throw if you have supplied tangents with your mesh already. The actual triangle resolution is unchanged; use the Refine() method to interpolate to a higher-resolution curve.

+

By default, every edge is calculated for maximum smoothness (very much approximately), attempting to minimize the maximum mean Curvature magnitude. No higher-order derivatives are considered, as the interpolation is independent per triangle, only sharing constraints on their boundaries.

+
Parameters
+ + + +
meshinput Mesh.
sharpenedEdgesIf desired, you can supply a vector of sharpened halfedges, which should in general be a small subset of all halfedges. Order of entries doesn't matter, as each one specifies the desired smoothness (between zero and one, with one the default for all unspecified halfedges) and the halfedge index (3 * triangle index + [0,1,2] where 0 is the edge between triVert 0 and 1, etc).
+
+
+

At a smoothness value of zero, a sharp crease is made. The smoothness is interpolated along each edge, so the specified value should be thought of as an average. Where exactly two sharpened edges meet at a vertex, their tangents are rotated to be colinear so that the sharpened edge can be continuous. Vertices with only one sharpened edge are completely smooth, allowing sharpened edges to smoothly vanish at termination. A single vertex can be sharpened by sharping all edges that are incident on it, allowing cones to be formed.

+ +
+
+ +

◆ Tetrahedron()

+ +
+
+ + + + + +
+ + + + + + + +
Manifold Tetrahedron ()
+
+static
+
+

Constructs a tetrahedron centered at the origin with one vertex at (1,1,1) and the rest at similarly symmetric points.

+ +
+
+ +

◆ Cube()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold Cube (vec3 size = vec3(1.0),
bool center = false 
)
+
+static
+
+

Constructs a unit cube (edge lengths all one), by default in the first octant, touching the origin. If any dimensions in size are negative, or if all are zero, an empty Manifold will be returned.

+
Parameters
+ + + +
sizeThe X, Y, and Z dimensions of the box.
centerSet to true to shift the center to the origin.
+
+
+ +
+
+ +

◆ Cylinder()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Manifold Cylinder (double height,
double radiusLow,
double radiusHigh = -1.0,
int circularSegments = 0,
bool center = false 
)
+
+static
+
+

A convenience constructor for the common case of extruding a circle. Can also form cones if both radii are specified.

+
Parameters
+ + + + + + +
heightZ-extent
radiusLowRadius of bottom circle. Must be positive.
radiusHighRadius of top circle. Can equal zero. Default is equal to radiusLow.
circularSegmentsHow many line segments to use around the circle. Default is calculated by the static Defaults.
centerSet to true to shift the center to the origin. Default is origin at the bottom.
+
+
+ +
+
+ +

◆ Sphere()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold Sphere (double radius,
int circularSegments = 0 
)
+
+static
+
+

Constructs a geodesic sphere of a given radius.

+
Parameters
+ + + +
radiusRadius of the sphere. Must be positive.
circularSegmentsNumber of segments along its diameter. This number will always be rounded up to the nearest factor of four, as this sphere is constructed by refining an octahedron. This means there are a circle of vertices on all three of the axis planes. Default is calculated by the static Defaults.
+
+
+ +
+
+ +

◆ Extrude()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Manifold Extrude (const PolygonscrossSection,
double height,
int nDivisions = 0,
double twistDegrees = 0.0,
vec2 scaleTop = vec2(1.0) 
)
+
+static
+
+

Constructs a manifold from a set of polygons by extruding them along the Z-axis. Note that high twistDegrees with small nDivisions may cause self-intersection. This is not checked here and it is up to the user to choose the correct parameters.

+
Parameters
+ + + + + + +
crossSectionA set of non-overlapping polygons to extrude.
heightZ-extent of extrusion.
nDivisionsNumber of extra copies of the crossSection to insert into the shape vertically; especially useful in combination with twistDegrees to avoid interpolation artifacts. Default is none.
twistDegreesAmount to twist the top crossSection relative to the bottom, interpolated linearly for the divisions in between.
scaleTopAmount to scale the top (independently in X and Y). If the scale is {0, 0}, a pure cone is formed with only a single vertex at the top. Note that scale is applied after twist. Default {1, 1}.
+
+
+ +
+
+ +

◆ Revolve()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Manifold Revolve (const PolygonscrossSection,
int circularSegments = 0,
double revolveDegrees = 360.0f 
)
+
+static
+
+

Constructs a manifold from a set of polygons by revolving this cross-section around its Y-axis and then setting this as the Z-axis of the resulting manifold. If the polygons cross the Y-axis, only the part on the positive X side is used. Geometrically valid input will result in geometrically valid output.

+
Parameters
+ + + + +
crossSectionA set of non-overlapping polygons to revolve.
circularSegmentsNumber of segments along its diameter. Default is calculated by the static Defaults.
revolveDegreesNumber of degrees to revolve. Default is 360 degrees.
+
+
+ +
+
+ +

◆ Compose()

+ +
+
+ + + + + +
+ + + + + + + + +
Manifold Compose (const std::vector< Manifold > & manifolds)
+
+static
+
+

Constructs a new manifold from a vector of other manifolds. This is a purely topological operation, so care should be taken to avoid creating overlapping results. It is the inverse operation of Decompose().

+
Parameters
+ + +
manifoldsA vector of Manifolds to lazy-union together.
+
+
+ +
+
+ +

◆ Decompose()

+ +
+
+ + + + + + + +
std::vector< Manifold > Decompose () const
+
+

This operation returns a vector of Manifolds that are topologically disconnected. If everything is connected, the vector is length one, containing a copy of the original. It is the inverse operation of Compose().

+ +
+
+ +

◆ GetMesh()

+ +
+
+ + + + + + + +
Mesh GetMesh () const
+
+

This returns a Mesh of simple vectors of vertices and triangles suitable for saving or other operations outside of the context of this library.

+ +
+
+ +

◆ GetMeshGL()

+ +
+
+ + + + + + + + +
MeshGL GetMeshGL (ivec3 normalIdx = ivec3(0)) const
+
+

The most complete output of this library, returning a MeshGL that is designed to easily push into a renderer, including all interleaved vertex properties that may have been input. It also includes relations to all the input meshes that form a part of this result and the transforms applied to each.

+
Parameters
+ + +
normalIdxIf the original MeshGL inputs that formed this manifold had properties corresponding to normal vectors, you can specify which property channels these are (x, y, z), which will cause this output MeshGL to automatically update these normals according to the applied transforms and front/back side. Each channel must be >= 3 and < numProp, and all original MeshGLs must use the same channels for their normals.
+
+
+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + + + +
bool IsEmpty () const
+
+

Does the Manifold have any triangles?

+ +
+
+ +

◆ Status()

+ +
+
+ + + + + + + +
Manifold::Error Status () const
+
+

Returns the reason for an input Mesh producing an empty Manifold. This Status only applies to Manifolds newly-created from an input Mesh - once they are combined into a new Manifold via operations, the status reverts to NoError, simply processing the problem mesh as empty. Likewise, empty meshes may still show NoError, for instance if they are small enough relative to their precision to be collapsed to nothing.

+ +
+
+ +

◆ NumVert()

+ +
+
+ + + + + + + +
int NumVert () const
+
+

The number of vertices in the Manifold.

+ +
+
+ +

◆ NumEdge()

+ +
+
+ + + + + + + +
int NumEdge () const
+
+

The number of edges in the Manifold.

+ +
+
+ +

◆ NumTri()

+ +
+
+ + + + + + + +
int NumTri () const
+
+

The number of triangles in the Manifold.

+ +
+
+ +

◆ NumProp()

+ +
+
+ + + + + + + +
int NumProp () const
+
+

The number of properties per vertex in the Manifold.

+ +
+
+ +

◆ NumPropVert()

+ +
+
+ + + + + + + +
int NumPropVert () const
+
+

The number of property vertices in the Manifold. This will always be >= NumVert, as some physical vertices may be duplicated to account for different properties on different neighboring triangles.

+ +
+
+ +

◆ BoundingBox()

+ +
+
+ + + + + + + +
Box BoundingBox () const
+
+

Returns the axis-aligned bounding box of all the Manifold's vertices.

+ +
+
+ +

◆ Precision()

+ +
+
+ + + + + + + +
double Precision () const
+
+

Returns the precision of this Manifold's vertices, which tracks the approximate rounding error over all the transforms and operations that have led to this state. Any triangles that are colinear within this precision are considered degenerate and removed. This is the value of ε defining ε-valid.

+ +
+
+ +

◆ Genus()

+ +
+
+ + + + + + + +
int Genus () const
+
+

The genus is a topological property of the manifold, representing the number of "handles". A sphere is 0, torus 1, etc. It is only meaningful for a single mesh, so it is best to call Decompose() first.

+ +
+
+ +

◆ GetProperties()

+ +
+
+ + + + + + + +
Properties GetProperties () const
+
+

Returns the surface area and volume of the manifold.

+ +
+
+ +

◆ MinGap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
double MinGap (const Manifoldother,
double searchLength 
) const
+
+

Returns the minimum gap between two manifolds. Returns a double between 0 and searchLength.

+
Parameters
+ + + +
otherThe other manifold to compute the minimum gap to.
searchLengthThe maximum distance to search for a minimum gap.
+
+
+ +
+
+ +

◆ OriginalID()

+ +
+
+ + + + + + + +
int OriginalID () const
+
+

If this mesh is an original, this returns its meshID that can be referenced by product manifolds' MeshRelation. If this manifold is a product, this returns -1.

+ +
+
+ +

◆ AsOriginal()

+ +
+
+ + + + + + + +
Manifold AsOriginal () const
+
+

This function condenses all coplanar faces in the relation, and collapses those edges. In the process the relation to ancestor meshes is lost and this new Manifold is marked an original. Properties are preserved, so if they do not match across an edge, that edge will be kept.

+ +
+
+ +

◆ ReserveIDs()

+ +
+
+ + + + + +
+ + + + + + + + +
uint32_t ReserveIDs (uint32_t n)
+
+static
+
+

Returns the first of n sequential new unique mesh IDs for marking sets of triangles that can be looked up after further operations. Assign to MeshGL.runOriginalID vector.

+ +
+
+ +

◆ Translate()

+ +
+
+ + + + + + + + +
Manifold Translate (vec3 v) const
+
+

Move this Manifold in space. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
vThe vector to add to every vertex.
+
+
+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + + + + +
Manifold Scale (vec3 v) const
+
+

Scale this Manifold in space. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
vThe vector to multiply every vertex by per component.
+
+
+ +
+
+ +

◆ Rotate()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Manifold Rotate (double xDegrees,
double yDegrees = 0.0,
double zDegrees = 0.0 
) const
+
+

Applies an Euler angle rotation to the manifold, first about the X axis, then Y, then Z, in degrees. We use degrees so that we can minimize rounding error, and eliminate it completely for any multiples of 90 degrees. Additionally, more efficient code paths are used to update the manifold when the transforms only rotate by multiples of 90 degrees. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + + + +
xDegreesFirst rotation, degrees about the X-axis.
yDegreesSecond rotation, degrees about the Y-axis.
zDegreesThird rotation, degrees about the Z-axis.
+
+
+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + + + + +
Manifold Transform (const mat4x3 & m) const
+
+

Transform this Manifold in space. The first three columns form a 3x3 matrix transform and the last is a translation vector. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
mThe affine transform matrix to apply to all the vertices.
+
+
+ +
+
+ +

◆ Mirror()

+ +
+
+ + + + + + + + +
Manifold Mirror (vec3 normal) const
+
+

Mirror this Manifold over the plane described by the unit form of the given normal vector. If the length of the normal is zero, an empty Manifold is returned. This operation can be chained. Transforms are combined and applied lazily.

+
Parameters
+ + +
normalThe normal vector of the plane to be mirrored over
+
+
+ +
+
+ +

◆ Warp()

+ +
+
+ + + + + + + + +
Manifold Warp (std::function< void(vec3 &)> warpFunc) const
+
+

This function does not change the topology, but allows the vertices to be moved according to any arbitrary input function. It is easy to create a function that warps a geometrically valid object into one which overlaps, but that is not checked here, so it is up to the user to choose their function with discretion.

+
Parameters
+ + +
warpFuncA function that modifies a given vertex position.
+
+
+ +
+
+ +

◆ WarpBatch()

+ +
+
+ + + + + + + + +
Manifold WarpBatch (std::function< void(VecView< vec3 >)> warpFunc) const
+
+

Same as Manifold::Warp but calls warpFunc with with a VecView which is roughly equivalent to std::span pointing to all vec3 elements to be modified in-place

+
Parameters
+ + +
warpFuncA function that modifies multiple vertex positions.
+
+
+ +
+
+ +

◆ SetProperties()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold SetProperties (int ,
std::function< void(double *, vec3, const double *)>  
) const
+
+

Create a new copy of this manifold with updated vertex properties by supplying a function that takes the existing position and properties as input. You may specify any number of output properties, allowing creation and removal of channels. Note: undefined behavior will result if you read past the number of input properties or write past the number of output properties.

+
Parameters
+ + + +
numPropThe new number of properties per vertex.
propFuncA function that modifies the properties of a given vertex.
+
+
+ +
+
+ +

◆ CalculateCurvature()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold CalculateCurvature (int gaussianIdx,
int meanIdx 
) const
+
+

Curvature is the inverse of the radius of curvature, and signed such that positive is convex and negative is concave. There are two orthogonal principal curvatures at any point on a manifold, with one maximum and the other minimum. Gaussian curvature is their product, while mean curvature is their sum. This approximates them for every vertex and assigns them as vertex properties on the given channels.

+
Parameters
+ + + +
gaussianIdxThe property channel index in which to store the Gaussian curvature. An index < 0 will be ignored (stores nothing). The property set will be automatically expanded to include the channel index specified.
meanIdxThe property channel index in which to store the mean curvature. An index < 0 will be ignored (stores nothing). The property set will be automatically expanded to include the channel index specified.
+
+
+ +
+
+ +

◆ CalculateNormals()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold CalculateNormals (int normalIdx,
double minSharpAngle = 60 
) const
+
+

Fills in vertex properties for normal vectors, calculated from the mesh geometry. Flat faces composed of three or more triangles will remain flat.

+
Parameters
+ + + +
normalIdxThe property channel in which to store the X values of the normals. The X, Y, and Z channels will be sequential. The property set will be automatically expanded such that NumProp will be at least normalIdx + 3.
minSharpAngleAny edges with angles greater than this value will remain sharp, getting different normal vector properties on each side of the edge. By default, no edges are sharp and all normals are shared. With a value of zero, the model is faceted and all normals match their triangle normals, but in this case it would be better not to calculate normals at all.
+
+
+ +
+
+ +

◆ SmoothByNormals()

+ +
+
+ + + + + + + + +
Manifold SmoothByNormals (int normalIdx) const
+
+

Smooths out the Manifold by filling in the halfedgeTangent vectors. The geometry will remain unchanged until Refine or RefineToLength is called to interpolate the surface. This version uses the supplied vertex normal properties to define the tangent vectors. Faces of two coplanar triangles will be marked as quads, while faces with three or more will be flat.

+
Parameters
+ + +
normalIdxThe first property channel of the normals. NumProp must be at least normalIdx + 3. Any vertex where multiple normals exist and don't agree will result in a sharp edge.
+
+
+ +
+
+ +

◆ SmoothOut()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold SmoothOut (double minSharpAngle = 60,
double minSmoothness = 0 
) const
+
+

Smooths out the Manifold by filling in the halfedgeTangent vectors. The geometry will remain unchanged until Refine or RefineToLength is called to interpolate the surface. This version uses the geometry of the triangles and pseudo-normals to define the tangent vectors. Faces of two coplanar triangles will be marked as quads.

+
Parameters
+ + + +
minSharpAngledegrees, default 60. Any edges with angles greater than this value will remain sharp. The rest will be smoothed to G1 continuity, with the caveat that flat faces of three or more triangles will always remain flat. With a value of zero, the model is faceted, but in this case there is no point in smoothing.
minSmoothnessrange: 0 - 1, default 0. The smoothness applied to sharp angles. The default gives a hard edge, while values > 0 will give a small fillet on these sharp edges. A value of 1 is equivalent to a minSharpAngle of 180 - all edges will be smooth.
+
+
+ +
+
+ +

◆ Refine()

+ +
+
+ + + + + + + + +
Manifold Refine (int n) const
+
+

Increase the density of the mesh by splitting every edge into n pieces. For instance, with n = 2, each triangle will be split into 4 triangles. Quads will ignore their interior triangle bisector. These will all be coplanar (and will not be immediately collapsed) unless the Mesh/Manifold has halfedgeTangents specified (e.g. from the Smooth() constructor), in which case the new vertices will be moved to the interpolated surface according to their barycentric coordinates.

+
Parameters
+ + +
nThe number of pieces to split every edge into. Must be > 1.
+
+
+ +
+
+ +

◆ RefineToLength()

+ +
+
+ + + + + + + + +
Manifold RefineToLength (double length) const
+
+

Increase the density of the mesh by splitting each edge into pieces of roughly the input length. Interior verts are added to keep the rest of the triangulation edges also of roughly the same length. If halfedgeTangents are present (e.g. from the Smooth() constructor), the new vertices will be moved to the interpolated surface according to their barycentric coordinates. Quads will ignore their interior triangle bisector.

+
Parameters
+ + +
lengthThe length that edges will be broken down to.
+
+
+ +
+
+ +

◆ Boolean()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold Boolean (const Manifoldsecond,
OpType op 
) const
+
+

The central operation of this library: the Boolean combines two manifolds into another by calculating their intersections and removing the unused portions. ε-valid inputs will produce ε-valid output. ε-invalid input may fail triangulation.

+

These operations are optimized to produce nearly-instant results if either input is empty or their bounding boxes do not overlap.

+
Parameters
+ + + +
secondThe other Manifold.
opThe type of operation to perform.
+
+
+ +
+
+ +

◆ BatchBoolean()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold BatchBoolean (const std::vector< Manifold > & manifolds,
OpType op 
)
+
+static
+
+

Perform the given boolean operation on a list of Manifolds. In case of Subtract, all Manifolds in the tail are differenced from the head.

+ +
+
+ +

◆ operator+()

+ +
+
+ + + + + + + + +
Manifold operator+ (const ManifoldQ) const
+
+

Shorthand for Boolean Union.

+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + + + + +
Manifold & operator+= (const ManifoldQ)
+
+

Shorthand for Boolean Union assignment.

+ +
+
+ +

◆ operator-()

+ +
+
+ + + + + + + + +
Manifold operator- (const ManifoldQ) const
+
+

Shorthand for Boolean Difference.

+ +
+
+ +

◆ operator-=()

+ +
+
+ + + + + + + + +
Manifold & operator-= (const ManifoldQ)
+
+

Shorthand for Boolean Difference assignment.

+ +
+
+ +

◆ operator^()

+ +
+
+ + + + + + + + +
Manifold operator^ (const ManifoldQ) const
+
+

Shorthand for Boolean Intersection.

+ +
+
+ +

◆ operator^=()

+ +
+
+ + + + + + + + +
Manifold & operator^= (const ManifoldQ)
+
+

Shorthand for Boolean Intersection assignment.

+ +
+
+ +

◆ Split()

+ +
+
+ + + + + + + + +
std::pair< Manifold, Manifold > Split (const Manifoldcutter) const
+
+

Split cuts this manifold in two using the cutter manifold. The first result is the intersection, second is the difference. This is more efficient than doing them separately.

+
Parameters
+ + +
cutter
+
+
+ +
+
+ +

◆ SplitByPlane()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::pair< Manifold, Manifold > SplitByPlane (vec3 normal,
double originOffset 
) const
+
+

Convenient version of Split() for a half-space.

+
Parameters
+ + + +
normalThis vector is normal to the cutting plane and its length does not matter. The first result is in the direction of this vector, the second result is on the opposite side.
originOffsetThe distance of the plane from the origin in the direction of the normal vector.
+
+
+ +
+
+ +

◆ TrimByPlane()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold TrimByPlane (vec3 normal,
double originOffset 
) const
+
+

Identical to SplitByPlane(), but calculating and returning only the first result.

+
Parameters
+ + + +
normalThis vector is normal to the cutting plane and its length does not matter. The result is in the direction of this vector from the plane.
originOffsetThe distance of the plane from the origin in the direction of the normal vector.
+
+
+ +
+
+ +

◆ Slice()

+ +
+
+ + + + + + + + +
Polygons Slice (double height = 0) const
+
+

Returns the cross section of this object parallel to the X-Y plane at the specified Z height, defaulting to zero. Using a height equal to the bottom of the bounding box will return the bottom faces, while using a height equal to the top of the bounding box will return empty.

+ +
+
+ +

◆ Project()

+ +
+
+ + + + + + + +
Polygons Project () const
+
+

Returns polygons representing the projected outline of this object onto the X-Y plane. These polygons will often self-intersect, so it is recommended to run them through the positive fill rule of CrossSection to get a sensible result before using them.

+ +
+
+ +

◆ Hull() [1/3]

+ +
+
+ + + + + + + +
Manifold Hull () const
+
+

Compute the convex hull of this manifold.

+ +
+
+ +

◆ Hull() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
Manifold Hull (const std::vector< Manifold > & manifolds)
+
+static
+
+

Compute the convex hull enveloping a set of manifolds.

+
Parameters
+ + +
manifoldsA vector of manifolds over which to compute a convex hull.
+
+
+ +
+
+ +

◆ Hull() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + +
Manifold Hull (const std::vector< vec3 > & pts)
+
+static
+
+

Compute the convex hull of a set of points. If the given points are fewer than 4, or they are all coplanar, an empty Manifold will be returned.

+
Parameters
+ + +
ptsA vector of 3-dimensional points over which to compute a convex hull.
+
+
+ +
+
+ +

◆ MatchesTriNormals()

+ +
+
+ + + + + + + +
bool MatchesTriNormals () const
+
+

The triangle normal vectors are saved over the course of operations rather than recalculated to avoid rounding error. This checks that triangles still match their normal vectors within Precision().

+ +
+
+ +

◆ NumDegenerateTris()

+ +
+
+ + + + + + + +
int NumDegenerateTris () const
+
+

The number of triangles that are colinear within Precision(). This library attempts to remove all of these, but it cannot always remove all of them without changing the mesh by too much.

+ +
+
+ +

◆ NumOverlaps()

+ +
+
+ + + + + + + + +
int NumOverlaps (const Manifoldother) const
+
+

This is a checksum-style verification of the collider, simply returning the total number of edge-face bounding box overlaps between this and other.

+
Parameters
+ + +
otherA Manifold to overlap with.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_manifold.js b/docs/html/classmanifold_1_1_manifold.js new file mode 100644 index 000000000..990b1b29e --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.js @@ -0,0 +1,53 @@ +var classmanifold_1_1_manifold = +[ + [ "Manifold", "classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea", null ], + [ "Decompose", "classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106", null ], + [ "GetMesh", "classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750", null ], + [ "GetMeshGL", "classmanifold_1_1_manifold.html#a3711c029f2c9fe2d152455981a3b2d73", null ], + [ "IsEmpty", "classmanifold_1_1_manifold.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Status", "classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d", null ], + [ "NumVert", "classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumEdge", "classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a", null ], + [ "NumTri", "classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6", null ], + [ "NumProp", "classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348", null ], + [ "NumPropVert", "classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d", null ], + [ "BoundingBox", "classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67", null ], + [ "Precision", "classmanifold_1_1_manifold.html#aef800826805cb6d90d03846fdb12c3e3", null ], + [ "Genus", "classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1", null ], + [ "GetProperties", "classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07", null ], + [ "MinGap", "classmanifold_1_1_manifold.html#a1b7ab47f4da039eb3dff5b46ba71658b", null ], + [ "OriginalID", "classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6", null ], + [ "AsOriginal", "classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57", null ], + [ "Translate", "classmanifold_1_1_manifold.html#a78fbea69555ea755f8731255060f7c9d", null ], + [ "Scale", "classmanifold_1_1_manifold.html#aa6153eb69d3a69e38e6508bf58449f04", null ], + [ "Rotate", "classmanifold_1_1_manifold.html#a7f74bf3b7c5dd34e84b82e7738fd25ff", null ], + [ "Transform", "classmanifold_1_1_manifold.html#af4459c0e7355b2805b2694da075c8346", null ], + [ "Mirror", "classmanifold_1_1_manifold.html#ad76d89178ca970900c81f2927f8c7f11", null ], + [ "Warp", "classmanifold_1_1_manifold.html#a5366f7082adcbb2be63fcf2b4c57eb51", null ], + [ "WarpBatch", "classmanifold_1_1_manifold.html#a7825d52e3102cc6e7d48a19f9ea0b468", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a6a852721876d6fce2136ac27e7377f8e", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "CalculateNormals", "classmanifold_1_1_manifold.html#ab6c0e49ed98c9c03bc1324d4ff8452ce", null ], + [ "SmoothByNormals", "classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4", null ], + [ "SmoothOut", "classmanifold_1_1_manifold.html#a0b59680c4bc2300e0e12713ab220d3d5", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", null ], + [ "RefineToLength", "classmanifold_1_1_manifold.html#a1381728e52975862d954032f717106d5", null ], + [ "Boolean", "classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df", null ], + [ "operator+", "classmanifold_1_1_manifold.html#af95e73e5427d09b9d9e025d5cf367c30", null ], + [ "operator+=", "classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688", null ], + [ "operator-", "classmanifold_1_1_manifold.html#ad9da8c505e6846e9645008825833e1da", null ], + [ "operator-=", "classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b", null ], + [ "operator^", "classmanifold_1_1_manifold.html#ad1e4e5720f01934c44aebc597be4d104", null ], + [ "operator^=", "classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522", null ], + [ "Split", "classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba", null ], + [ "SplitByPlane", "classmanifold_1_1_manifold.html#a40c2716b965886e4fb952e5ade866a5a", null ], + [ "TrimByPlane", "classmanifold_1_1_manifold.html#aa8d62161da6e94da7651418c33c3e294", null ], + [ "Slice", "classmanifold_1_1_manifold.html#ad03837de2290a269fa14e0773c9913fa", null ], + [ "Project", "classmanifold_1_1_manifold.html#a328657b69e9bbaaee148572ca314677c", null ], + [ "Hull", "classmanifold_1_1_manifold.html#a9dc9e00112e2b063cfa6fe8482b1afe8", null ], + [ "MatchesTriNormals", "classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7", null ], + [ "NumDegenerateTris", "classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66", null ], + [ "NumOverlaps", "classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704", null ] +]; \ No newline at end of file diff --git a/docs/html/classmanifold_1_1_mesh_builder-members.html b/docs/html/classmanifold_1_1_mesh_builder-members.html new file mode 100644 index 000000000..4f53f54b9 --- /dev/null +++ b/docs/html/classmanifold_1_1_mesh_builder-members.html @@ -0,0 +1,128 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshBuilder Member List
+
+
+ +

This is the complete list of members for MeshBuilder, including all inherited members.

+ + + + + + + + + + + + + + + +
addFace() (defined in MeshBuilder)MeshBuilder
addHalfedge() (defined in MeshBuilder)MeshBuilder
disabledFaces (defined in MeshBuilder)MeshBuilder
disabledHalfedges (defined in MeshBuilder)MeshBuilder
disableFace(size_t faceIndex) (defined in MeshBuilder)MeshBuilderinline
disableHalfedge(size_t heIndex) (defined in MeshBuilder)MeshBuilderinline
faces (defined in MeshBuilder)MeshBuilder
getHalfEdgeIndicesOfFace(const Face &f) const (defined in MeshBuilder)MeshBuilderinline
getVertexIndicesOfFace(const Face &f) const (defined in MeshBuilder)MeshBuilder
getVertexIndicesOfHalfEdge(const Halfedge &he) const (defined in MeshBuilder)MeshBuilderinline
halfedgeNext (defined in MeshBuilder)MeshBuilder
halfedges (defined in MeshBuilder)MeshBuilder
MeshBuilder()=default (defined in MeshBuilder)MeshBuilder
setup(int a, int b, int c, int d) (defined in MeshBuilder)MeshBuilder
+
+ + + + diff --git a/docs/html/classmanifold_1_1_mesh_builder.html b/docs/html/classmanifold_1_1_mesh_builder.html new file mode 100644 index 000000000..db82234a4 --- /dev/null +++ b/docs/html/classmanifold_1_1_mesh_builder.html @@ -0,0 +1,168 @@ + + + + + + + +Manifold: MeshBuilder Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
MeshBuilder Class Reference
+
+
+ + + + +

+Classes

struct  Face
 
+ + + + + + + + + + + + + + + + + +

+Public Member Functions

+size_t addFace ()
 
+size_t addHalfedge ()
 
+std::unique_ptr< Vec< size_t > > disableFace (size_t faceIndex)
 
+void disableHalfedge (size_t heIndex)
 
+void setup (int a, int b, int c, int d)
 
+std::array< int, 3 > getVertexIndicesOfFace (const Face &f) const
 
+std::array< int, 2 > getVertexIndicesOfHalfEdge (const Halfedge &he) const
 
+std::array< int, 3 > getHalfEdgeIndicesOfFace (const Face &f) const
 
+ + + + + + + + + + + +

+Public Attributes

+std::vector< Facefaces
 
+Vec< Halfedgehalfedges
 
+Vec< int > halfedgeNext
 
+Vec< size_t > disabledFaces
 
+Vec< size_t > disabledHalfedges
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_mesh_builder.js b/docs/html/classmanifold_1_1_mesh_builder.js new file mode 100644 index 000000000..0ff8bca8e --- /dev/null +++ b/docs/html/classmanifold_1_1_mesh_builder.js @@ -0,0 +1,4 @@ +var classmanifold_1_1_mesh_builder = +[ + [ "Face", "structmanifold_1_1_mesh_builder_1_1_face.html", null ] +]; \ No newline at end of file diff --git a/docs/html/classmanifold_1_1_plane-members.html b/docs/html/classmanifold_1_1_plane-members.html new file mode 100644 index 000000000..2e717bb68 --- /dev/null +++ b/docs/html/classmanifold_1_1_plane-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Plane Member List
+
+
+ +

This is the complete list of members for Plane, including all inherited members.

+ + + + + + + +
D (defined in Plane)Plane
isPointOnPositiveSide(const vec3 &Q) const (defined in Plane)Planeinline
N (defined in Plane)Plane
Plane()=default (defined in Plane)Plane
Plane(const vec3 &N, const vec3 &P) (defined in Plane)Planeinline
sqrNLength (defined in Plane)Plane
+
+ + + + diff --git a/docs/html/classmanifold_1_1_plane.html b/docs/html/classmanifold_1_1_plane.html new file mode 100644 index 000000000..1c733194e --- /dev/null +++ b/docs/html/classmanifold_1_1_plane.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: Plane Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + +

+Public Member Functions

+bool isPointOnPositiveSide (const vec3 &Q) const
 
Plane (const vec3 &N, const vec3 &P)
 
+ + + + + + + +

+Public Attributes

+vec3 N
 
+double D
 
+double sqrNLength
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_pool-members.html b/docs/html/classmanifold_1_1_pool-members.html new file mode 100644 index 000000000..0fed7c191 --- /dev/null +++ b/docs/html/classmanifold_1_1_pool-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Pool Member List
+
+
+ +

This is the complete list of members for Pool, including all inherited members.

+ + + + +
clear() (defined in Pool)Poolinline
get() (defined in Pool)Poolinline
reclaim(std::unique_ptr< Vec< size_t > > &ptr) (defined in Pool)Poolinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_pool.html b/docs/html/classmanifold_1_1_pool.html new file mode 100644 index 000000000..02f31ddc5 --- /dev/null +++ b/docs/html/classmanifold_1_1_pool.html @@ -0,0 +1,128 @@ + + + + + + + +Manifold: Pool Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Pool Class Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void clear ()
 
+void reclaim (std::unique_ptr< Vec< size_t > > &ptr)
 
+std::unique_ptr< Vec< size_t > > get ()
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_quality-members.html b/docs/html/classmanifold_1_1_quality-members.html new file mode 100644 index 000000000..370ab9d79 --- /dev/null +++ b/docs/html/classmanifold_1_1_quality-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Quality Member List
+
+
+ +

This is the complete list of members for Quality, including all inherited members.

+ + + + + + +
GetCircularSegments(double radius)Qualityinlinestatic
ResetToDefaults()Qualityinlinestatic
SetCircularSegments(int number)Qualityinlinestatic
SetMinCircularAngle(double angle)Qualityinlinestatic
SetMinCircularEdgeLength(double length)Qualityinlinestatic
+
+ + + + diff --git a/docs/html/classmanifold_1_1_quality.html b/docs/html/classmanifold_1_1_quality.html new file mode 100644 index 000000000..ac4fdd994 --- /dev/null +++ b/docs/html/classmanifold_1_1_quality.html @@ -0,0 +1,292 @@ + + + + + + + +Manifold: Quality Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Quality Class Reference
+
+
+ +

#include <common.h>

+ + + + + + + + + + + + +

+Static Public Member Functions

static void SetMinCircularAngle (double angle)
 
static void SetMinCircularEdgeLength (double length)
 
static void SetCircularSegments (int number)
 
static int GetCircularSegments (double radius)
 
static void ResetToDefaults ()
 
+

Detailed Description

+

These static properties control how circular shapes are quantized by default on construction. If circularSegments is specified, it takes precedence. If it is zero, then instead the minimum is used of the segments calculated based on edge length and angle, rounded up to the nearest multiple of four. To get numbers not divisible by four, circularSegments must be specified.

+

Member Function Documentation

+ +

◆ SetMinCircularAngle()

+ +
+
+ + + + + +
+ + + + + + + + +
static void SetMinCircularAngle (double angle)
+
+inlinestatic
+
+

Sets an angle constraint the default number of circular segments for the CrossSection::Circle(), Manifold::Cylinder(), Manifold::Sphere(), and Manifold::Revolve() constructors. The number of segments will be rounded up to the nearest factor of four.

+
Parameters
+ + +
angleThe minimum angle in degrees between consecutive segments. The angle will increase if the the segments hit the minimum edge length. Default is 10 degrees.
+
+
+ +
+
+ +

◆ SetMinCircularEdgeLength()

+ +
+
+ + + + + +
+ + + + + + + + +
static void SetMinCircularEdgeLength (double length)
+
+inlinestatic
+
+

Sets a length constraint the default number of circular segments for the CrossSection::Circle(), Manifold::Cylinder(), Manifold::Sphere(), and Manifold::Revolve() constructors. The number of segments will be rounded up to the nearest factor of four.

+
Parameters
+ + +
lengthThe minimum length of segments. The length will increase if the the segments hit the minimum angle. Default is 1.0.
+
+
+ +
+
+ +

◆ SetCircularSegments()

+ +
+
+ + + + + +
+ + + + + + + + +
static void SetCircularSegments (int number)
+
+inlinestatic
+
+

Sets the default number of circular segments for the CrossSection::Circle(), Manifold::Cylinder(), Manifold::Sphere(), and Manifold::Revolve() constructors. Overrides the edge length and angle constraints and sets the number of segments to exactly this value.

+
Parameters
+ + +
numberNumber of circular segments. Default is 0, meaning no constraint is applied.
+
+
+ +
+
+ +

◆ GetCircularSegments()

+ +
+
+ + + + + +
+ + + + + + + + +
static int GetCircularSegments (double radius)
+
+inlinestatic
+
+

Determine the result of the SetMinCircularAngle(), SetMinCircularEdgeLength(), and SetCircularSegments() defaults.

+
Parameters
+ + +
radiusFor a given radius of circle, determine how many default segments there will be.
+
+
+ +
+
+ +

◆ ResetToDefaults()

+ +
+
+ + + + + +
+ + + + + + + +
static void ResetToDefaults ()
+
+inlinestatic
+
+

Resets the circular construction parameters to their defaults if SetMinCircularAngle, SetMinCircularEdgeLength, or SetCircularSegments have been called.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_quick_hull-members.html b/docs/html/classmanifold_1_1_quick_hull-members.html new file mode 100644 index 000000000..ca55f29fe --- /dev/null +++ b/docs/html/classmanifold_1_1_quick_hull-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
QuickHull Member List
+
+
+ +

This is the complete list of members for QuickHull, including all inherited members.

+ + + +
buildMesh(double eps=defaultEps()) (defined in QuickHull)QuickHull
QuickHull(VecView< vec3 > pointCloudVec) (defined in QuickHull)QuickHullinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_quick_hull.html b/docs/html/classmanifold_1_1_quick_hull.html new file mode 100644 index 000000000..812a25228 --- /dev/null +++ b/docs/html/classmanifold_1_1_quick_hull.html @@ -0,0 +1,126 @@ + + + + + + + +Manifold: QuickHull Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
QuickHull Class Reference
+
+
+ + + + + + +

+Public Member Functions

QuickHull (VecView< vec3 > pointCloudVec)
 
+std::pair< Vec< Halfedge >, Vec< vec3 > > buildMesh (double eps=defaultEps())
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_sparse_indices-members.html b/docs/html/classmanifold_1_1_sparse_indices-members.html new file mode 100644 index 000000000..6cfa01d0c --- /dev/null +++ b/docs/html/classmanifold_1_1_sparse_indices-members.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
SparseIndices Member List
+
+
+ +

This is the complete list of members for SparseIndices, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + +
Add(int p, int q) (defined in SparseIndices)SparseIndicesinline
AsVec32() (defined in SparseIndices)SparseIndicesinline
AsVec32() const (defined in SparseIndices)SparseIndicesinline
AsVec64() (defined in SparseIndices)SparseIndicesinline
AsVec64() const (defined in SparseIndices)SparseIndicesinline
Copy(bool use_q) const (defined in SparseIndices)SparseIndicesinline
Dump() const (defined in SparseIndices)SparseIndicesinline
EncodePQ(int p, int q) (defined in SparseIndices)SparseIndicesinlinestatic
Get(size_t i, bool use_q) (defined in SparseIndices)SparseIndicesinline
Get(size_t i, bool use_q) const (defined in SparseIndices)SparseIndicesinline
GetPQ(size_t i) const (defined in SparseIndices)SparseIndicesinline
KeepFinite(Vec< T > &v, Vec< int > &x) (defined in SparseIndices)SparseIndicesinline
RemoveZeros(Vec< int > &S) (defined in SparseIndices)SparseIndicesinline
Resize(size_t size) (defined in SparseIndices)SparseIndicesinline
Set(size_t i, int p, int q) (defined in SparseIndices)SparseIndicesinline
SetPQ(size_t i, int64_t pq) (defined in SparseIndices)SparseIndicesinline
size() const (defined in SparseIndices)SparseIndicesinline
Sort() (defined in SparseIndices)SparseIndicesinline
SparseIndices()=default (defined in SparseIndices)SparseIndices
SparseIndices(size_t size) (defined in SparseIndices)SparseIndicesinline
Unique() (defined in SparseIndices)SparseIndicesinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_sparse_indices.html b/docs/html/classmanifold_1_1_sparse_indices.html new file mode 100644 index 000000000..5bc099dd7 --- /dev/null +++ b/docs/html/classmanifold_1_1_sparse_indices.html @@ -0,0 +1,184 @@ + + + + + + + +Manifold: SparseIndices Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SparseIndices (size_t size)
 
+size_t size () const
 
+Vec< int > Copy (bool use_q) const
 
+void Sort ()
 
+void Resize (size_t size)
 
+int & Get (size_t i, bool use_q)
 
+int Get (size_t i, bool use_q) const
 
+int64_t GetPQ (size_t i) const
 
+void Set (size_t i, int p, int q)
 
+void SetPQ (size_t i, int64_t pq)
 
+VecView< int64_t > AsVec64 ()
 
+VecView< const int64_t > AsVec64 () const
 
+VecView< int32_t > AsVec32 ()
 
+VecView< const int32_t > AsVec32 () const
 
+void Add (int p, int q)
 
+void Unique ()
 
+size_t RemoveZeros (Vec< int > &S)
 
+template<typename T >
size_t KeepFinite (Vec< T > &v, Vec< int > &x)
 
+void Dump () const
 
+ + + +

+Static Public Member Functions

+static constexpr int64_t EncodePQ (int p, int q)
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_vec-members.html b/docs/html/classmanifold_1_1_vec-members.html new file mode 100644 index 000000000..7e613ce41 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec-members.html @@ -0,0 +1,163 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Vec< T > Member List
+
+
+ +

This is the complete list of members for Vec< T >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
back() const (defined in VecView< T >)VecView< T >inline
back() (defined in VecView< T >)VecView< T >inline
begin() const (defined in VecView< T >)VecView< T >inline
begin() (defined in VecView< T >)VecView< T >inline
capacity() const (defined in Vec< T >)Vec< T >inline
cbegin() const (defined in VecView< T >)VecView< T >inline
cend() const (defined in VecView< T >)VecView< T >inline
clear() (defined in Vec< T >)Vec< T >inline
cview(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const (defined in Vec< T >)Vec< T >inline
data() (defined in Vec< T >)Vec< T >inline
data() const (defined in Vec< T >)Vec< T >inline
Dump() const (defined in VecView< T >)VecView< T >inline
empty() const (defined in VecView< T >)VecView< T >inline
end() const (defined in VecView< T >)VecView< T >inline
end() (defined in VecView< T >)VecView< T >inline
front() const (defined in VecView< T >)VecView< T >inline
front() (defined in VecView< T >)VecView< T >inline
Iter typedef (defined in VecView< T >)VecView< T >
IterC typedef (defined in VecView< T >)VecView< T >
operator VecView< const T >() const (defined in Vec< T >)Vec< T >inline
operator VecView< T >() (defined in Vec< T >)Vec< T >inline
operator VecView< T >() const (defined in Vec< T >)Vec< T >inline
operator=(const Vec< T > &other) (defined in Vec< T >)Vec< T >inline
operator=(Vec< T > &&other) (defined in Vec< T >)Vec< T >inline
operator=(const VecView &other) (defined in VecView< T >)VecView< T >inline
operator[](size_t i) const (defined in VecView< T >)VecView< T >inline
operator[](size_t i) (defined in VecView< T >)VecView< T >inline
pop_back() (defined in Vec< T >)Vec< T >inline
ptr_ (defined in VecView< T >)VecView< T >protected
push_back(const T &val) (defined in Vec< T >)Vec< T >inline
reserve(size_t n) (defined in Vec< T >)Vec< T >inline
resize(size_t newSize, T val=T()) (defined in Vec< T >)Vec< T >inline
shrink_to_fit() (defined in Vec< T >)Vec< T >inline
size() const (defined in VecView< T >)VecView< T >inline
size_ (defined in VecView< T >)VecView< T >protected
swap(Vec< T > &other) (defined in Vec< T >)Vec< T >inline
Vec() (defined in Vec< T >)Vec< T >inline
Vec(size_t size) (defined in Vec< T >)Vec< T >inline
Vec(size_t size, T val) (defined in Vec< T >)Vec< T >inline
Vec(const Vec< T > &vec) (defined in Vec< T >)Vec< T >inline
Vec(const VecView< const T > &vec) (defined in Vec< T >)Vec< T >inline
Vec(const std::vector< T > &vec) (defined in Vec< T >)Vec< T >inline
Vec(Vec< T > &&vec) (defined in Vec< T >)Vec< T >inline
VecView(T *ptr, size_t size) (defined in VecView< T >)VecView< T >inline
VecView(const VecView &other) (defined in VecView< T >)VecView< T >inline
VecView()=default (defined in VecView< T >)VecView< T >protected
view(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) (defined in Vec< T >)Vec< T >inline
view(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const (defined in Vec< T >)Vec< T >inline
~Vec() (defined in Vec< T >)Vec< T >inline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_vec.html b/docs/html/classmanifold_1_1_vec.html new file mode 100644 index 000000000..fe4d802e2 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec.html @@ -0,0 +1,268 @@ + + + + + + + +Manifold: Vec< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Vec< T > Class Template Reference
+
+
+ +

Inherits VecView< T >.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Vec (size_t size)
 
Vec (size_t size, T val)
 
Vec (const Vec< T > &vec)
 
Vec (const VecView< const T > &vec)
 
Vec (const std::vector< T > &vec)
 
Vec (Vec< T > &&vec)
 
operator VecView< T > ()
 
operator VecView< const T > () const
 
+Vec< T > & operator= (const Vec< T > &other)
 
+Vec< T > & operator= (Vec< T > &&other)
 
operator VecView< T > () const
 
+void swap (Vec< T > &other)
 
+void push_back (const T &val)
 
+void reserve (size_t n)
 
+void resize (size_t newSize, T val=T())
 
+void pop_back ()
 
+void clear ()
 
+void shrink_to_fit ()
 
+VecView< T > view (size_t offset=0, size_t length=std::numeric_limits< size_t >::max())
 
+VecView< const T > cview (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
+VecView< const T > view (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
+T * data ()
 
+const T * data () const
 
+size_t capacity () const
 
- Public Member Functions inherited from VecView< T >
VecView (T *ptr, size_t size)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const T & operator[] (size_t i) const
 
+T & operator[] (size_t i)
 
+IterC cbegin () const
 
+IterC cend () const
 
+IterC begin () const
 
+IterC end () const
 
+Iter begin ()
 
+Iter end ()
 
+const T & front () const
 
+const T & back () const
 
+T & front ()
 
+T & back ()
 
+size_t size () const
 
+bool empty () const
 
+void Dump () const
 
+ + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from VecView< T >
+using Iter = T *
 
+using IterC = const T *
 
- Protected Attributes inherited from VecView< T >
+T * ptr_ = nullptr
 
+size_t size_ = 0
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_vec_view-members.html b/docs/html/classmanifold_1_1_vec_view-members.html new file mode 100644 index 000000000..901c44be7 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec_view-members.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
VecView< T > Member List
+
+
+ +

This is the complete list of members for VecView< T >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
back() const (defined in VecView< T >)VecView< T >inline
back() (defined in VecView< T >)VecView< T >inline
begin() const (defined in VecView< T >)VecView< T >inline
begin() (defined in VecView< T >)VecView< T >inline
cbegin() const (defined in VecView< T >)VecView< T >inline
cend() const (defined in VecView< T >)VecView< T >inline
Dump() const (defined in VecView< T >)VecView< T >inline
empty() const (defined in VecView< T >)VecView< T >inline
end() const (defined in VecView< T >)VecView< T >inline
end() (defined in VecView< T >)VecView< T >inline
front() const (defined in VecView< T >)VecView< T >inline
front() (defined in VecView< T >)VecView< T >inline
Iter typedef (defined in VecView< T >)VecView< T >
IterC typedef (defined in VecView< T >)VecView< T >
operator VecView< const T >() const (defined in VecView< T >)VecView< T >inline
operator=(const VecView &other) (defined in VecView< T >)VecView< T >inline
operator[](size_t i) const (defined in VecView< T >)VecView< T >inline
operator[](size_t i) (defined in VecView< T >)VecView< T >inline
ptr_ (defined in VecView< T >)VecView< T >protected
size() const (defined in VecView< T >)VecView< T >inline
size_ (defined in VecView< T >)VecView< T >protected
VecView(T *ptr, size_t size) (defined in VecView< T >)VecView< T >inline
VecView(const VecView &other) (defined in VecView< T >)VecView< T >inline
VecView()=default (defined in VecView< T >)VecView< T >protected
+
+ + + + diff --git a/docs/html/classmanifold_1_1_vec_view.html b/docs/html/classmanifold_1_1_vec_view.html new file mode 100644 index 000000000..b9fc9d9d2 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec_view.html @@ -0,0 +1,203 @@ + + + + + + + +Manifold: VecView< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
VecView< T > Class Template Reference
+
+
+ +

#include <vec_view.h>

+ +

Inherited by Vec< int >, Vec< vec3 >, Vec< manifold::Box >, Vec< std::pair< int, int > >, Vec< manifold::Halfedge >, Vec< Uint64 >, Vec< V >, Vec< vec4 >, Vec< double >, Vec< manifold::TriRef >, Vec< ivec3 >, Vec< size_t >, Vec< FaceData >, Vec< char >, Vec< unsigned char >, and Vec< T >.

+ + + + + + +

+Public Types

+using Iter = T *
 
+using IterC = const T *
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

VecView (T *ptr, size_t size)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const T & operator[] (size_t i) const
 
+T & operator[] (size_t i)
 
+IterC cbegin () const
 
+IterC cend () const
 
+IterC begin () const
 
+IterC end () const
 
+Iter begin ()
 
+Iter end ()
 
+const T & front () const
 
+const T & back () const
 
+T & front ()
 
+T & back ()
 
+size_t size () const
 
+bool empty () const
 
+void Dump () const
 
+ + + + + +

+Protected Attributes

+T * ptr_ = nullptr
 
+size_t size_ = 0
 
+

Detailed Description

+
template<typename T>
+class manifold::VecView< T >

View for Vec, can perform offset operation. This will be invalidated when the original vector is dropped or changes length. Roughly equivalent to std::span<T> from c++20

+
+
+ + + + diff --git a/docs/html/closed.png b/docs/html/closed.png new file mode 100644 index 000000000..98cc2c909 Binary files /dev/null and b/docs/html/closed.png differ diff --git a/docs/html/collider_8h_source.html b/docs/html/collider_8h_source.html new file mode 100644 index 000000000..e9a00b88e --- /dev/null +++ b/docs/html/collider_8h_source.html @@ -0,0 +1,539 @@ + + + + + + + +Manifold: collider.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
collider.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include "manifold/common.h"
+
17#include "manifold/parallel.h"
+
18#include "manifold/sparse.h"
+
19#include "manifold/utils.h"
+
20#include "manifold/vec.h"
+
21
+
22#ifdef _MSC_VER
+
23#include <intrin.h>
+
24#endif
+
25
+
26namespace manifold {
+
27
+
28namespace collider_internal {
+
29// Adjustable parameters
+
30constexpr int kInitialLength = 128;
+
31constexpr int kLengthMultiple = 4;
+
32constexpr int kSequentialThreshold = 512;
+
33// Fundamental constants
+
34constexpr int kRoot = 1;
+
35
+
36#ifdef _MSC_VER
+
37
+
38#ifndef _WINDEF_
+
39typedef unsigned long DWORD;
+
40#endif
+
41
+
42uint32_t inline ctz(uint32_t value) {
+
43 DWORD trailing_zero = 0;
+
44
+
45 if (_BitScanForward(&trailing_zero, value)) {
+
46 return trailing_zero;
+
47 } else {
+
48 // This is undefined, I better choose 32 than 0
+
49 return 32;
+
50 }
+
51}
+
52
+
53uint32_t inline clz(uint32_t value) {
+
54 DWORD leading_zero = 0;
+
55
+
56 if (_BitScanReverse(&leading_zero, value)) {
+
57 return 31 - leading_zero;
+
58 } else {
+
59 // Same remarks as above
+
60 return 32;
+
61 }
+
62}
+
63#endif
+
64
+
65constexpr inline bool IsLeaf(int node) { return node % 2 == 0; }
+
66constexpr inline bool IsInternal(int node) { return node % 2 == 1; }
+
67constexpr inline int Node2Internal(int node) { return (node - 1) / 2; }
+
68constexpr inline int Internal2Node(int internal) { return internal * 2 + 1; }
+
69constexpr inline int Node2Leaf(int node) { return node / 2; }
+
70constexpr inline int Leaf2Node(int leaf) { return leaf * 2; }
+
71
+
+ +
73 VecView<int> nodeParent_;
+
74 VecView<std::pair<int, int>> internalChildren_;
+
75 const VecView<const uint32_t> leafMorton_;
+
76
+
77 int PrefixLength(uint32_t a, uint32_t b) const {
+
78// count-leading-zeros is used to find the number of identical highest-order
+
79// bits
+
80#ifdef _MSC_VER
+
81 // return __lzcnt(a ^ b);
+
82 return clz(a ^ b);
+
83#else
+
84 return __builtin_clz(a ^ b);
+
85#endif
+
86 }
+
87
+
88 int PrefixLength(int i, int j) const {
+
89 if (j < 0 || j >= static_cast<int>(leafMorton_.size())) {
+
90 return -1;
+
91 } else {
+
92 int out;
+
93 if (leafMorton_[i] == leafMorton_[j])
+
94 // use index to disambiguate
+
95 out = 32 +
+
96 PrefixLength(static_cast<uint32_t>(i), static_cast<uint32_t>(j));
+
97 else
+
98 out = PrefixLength(leafMorton_[i], leafMorton_[j]);
+
99 return out;
+
100 }
+
101 }
+
102
+
103 int RangeEnd(int i) const {
+
104 // Determine direction of range (+1 or -1)
+
105 int dir = PrefixLength(i, i + 1) - PrefixLength(i, i - 1);
+
106 dir = (dir > 0) - (dir < 0);
+
107 // Compute conservative range length with exponential increase
+
108 int commonPrefix = PrefixLength(i, i - dir);
+
109 int max_length = kInitialLength;
+
110 while (PrefixLength(i, i + dir * max_length) > commonPrefix)
+
111 max_length *= kLengthMultiple;
+
112 // Compute precise range length with binary search
+
113 int length = 0;
+
114 for (int step = max_length / 2; step > 0; step /= 2) {
+
115 if (PrefixLength(i, i + dir * (length + step)) > commonPrefix)
+
116 length += step;
+
117 }
+
118 return i + dir * length;
+
119 }
+
120
+
121 int FindSplit(int first, int last) const {
+
122 int commonPrefix = PrefixLength(first, last);
+
123 // Find the furthest object that shares more than commonPrefix bits with the
+
124 // first one, using binary search.
+
125 int split = first;
+
126 int step = last - first;
+
127 do {
+
128 step = (step + 1) >> 1; // divide by 2, rounding up
+
129 int newSplit = split + step;
+
130 if (newSplit < last) {
+
131 int splitPrefix = PrefixLength(first, newSplit);
+
132 if (splitPrefix > commonPrefix) split = newSplit;
+
133 }
+
134 } while (step > 1);
+
135 return split;
+
136 }
+
137
+
138 void operator()(int internal) {
+
139 int first = internal;
+
140 // Find the range of objects with a common prefix
+
141 int last = RangeEnd(first);
+
142 if (first > last) std::swap(first, last);
+
143 // Determine where the next-highest difference occurs
+
144 int split = FindSplit(first, last);
+
145 int child1 = split == first ? Leaf2Node(split) : Internal2Node(split);
+
146 ++split;
+
147 int child2 = split == last ? Leaf2Node(split) : Internal2Node(split);
+
148 // Record parent_child relationships.
+
149 internalChildren_[internal].first = child1;
+
150 internalChildren_[internal].second = child2;
+
151 int node = Internal2Node(internal);
+
152 nodeParent_[child1] = node;
+
153 nodeParent_[child2] = node;
+
154 }
+
155};
+
+
156
+
157template <typename T, const bool selfCollision, typename Recorder>
+
+ +
159 VecView<const T> queries;
+
160 VecView<const Box> nodeBBox_;
+
161 VecView<const std::pair<int, int>> internalChildren_;
+
162 Recorder recorder;
+
163
+
164 int RecordCollision(int node, const int queryIdx) {
+
165 bool overlaps = nodeBBox_[node].DoesOverlap(queries[queryIdx]);
+
166 if (overlaps && IsLeaf(node)) {
+
167 int leafIdx = Node2Leaf(node);
+
168 if (!selfCollision || leafIdx != queryIdx) {
+
169 recorder.record(queryIdx, leafIdx);
+
170 }
+
171 }
+
172 return overlaps && IsInternal(node); // Should traverse into node
+
173 }
+
174
+
175 void operator()(const int queryIdx) {
+
176 // stack cannot overflow because radix tree has max depth 30 (Morton code) +
+
177 // 32 (index).
+
178 int stack[64];
+
179 int top = -1;
+
180 // Depth-first search
+
181 int node = kRoot;
+
182 // same implies that this query do not have any collision
+
183 if (recorder.earlyexit(queryIdx)) return;
+
184 while (1) {
+
185 int internal = Node2Internal(node);
+
186 int child1 = internalChildren_[internal].first;
+
187 int child2 = internalChildren_[internal].second;
+
188
+
189 int traverse1 = RecordCollision(child1, queryIdx);
+
190 int traverse2 = RecordCollision(child2, queryIdx);
+
191
+
192 if (!traverse1 && !traverse2) {
+
193 if (top < 0) break; // done
+
194 node = stack[top--]; // get a saved node
+
195 } else {
+
196 node = traverse1 ? child1 : child2; // go here next
+
197 if (traverse1 && traverse2) {
+
198 stack[++top] = child2; // save the other for later
+
199 }
+
200 }
+
201 }
+
202 recorder.end(queryIdx);
+
203 }
+
204};
+
+
205
+
+ +
207 VecView<int> counts;
+
208 VecView<char> empty;
+
209 void record(int queryIdx, int _leafIdx) { counts[queryIdx]++; }
+
210 bool earlyexit(int _queryIdx) { return false; }
+
211 void end(int queryIdx) {
+
212 if (counts[queryIdx] == 0) empty[queryIdx] = 1;
+
213 }
+
214};
+
+
215
+
216template <const bool inverted>
+
+ +
218 SparseIndices& queryTri_;
+
219 void record(int queryIdx, int leafIdx) const {
+
220 if (inverted)
+
221 queryTri_.Add(leafIdx, queryIdx);
+
222 else
+
223 queryTri_.Add(queryIdx, leafIdx);
+
224 }
+
225 bool earlyexit(int queryIdx) const { return false; }
+
226 void end(int queryIdx) const {}
+
227};
+
+
228
+
229template <const bool inverted>
+
+ +
231 SparseIndices& queryTri;
+
232 VecView<int> counts;
+
233 VecView<char> empty;
+
234 void record(int queryIdx, int leafIdx) {
+
235 int pos = counts[queryIdx]++;
+
236 if (inverted)
+
237 queryTri.Set(pos, leafIdx, queryIdx);
+
238 else
+
239 queryTri.Set(pos, queryIdx, leafIdx);
+
240 }
+
241 bool earlyexit(int queryIdx) const { return empty[queryIdx] == 1; }
+
242 void end(int queryIdx) const {}
+
243};
+
+
244
+
+ +
246 VecView<Box> nodeBBox_;
+
247 VecView<int> counter_;
+
248 const VecView<int> nodeParent_;
+
249 const VecView<std::pair<int, int>> internalChildren_;
+
250
+
251 void operator()(int leaf) {
+
252 int node = Leaf2Node(leaf);
+
253 do {
+
254 node = nodeParent_[node];
+
255 int internal = Node2Internal(node);
+
256 if (AtomicAdd(counter_[internal], 1) == 0) return;
+
257 nodeBBox_[node] = nodeBBox_[internalChildren_[internal].first].Union(
+
258 nodeBBox_[internalChildren_[internal].second]);
+
259 } while (node != kRoot);
+
260 }
+
261};
+
+
262
+
+ +
264 const mat4x3 transform;
+
265 void operator()(Box& box) { box = box.Transform(transform); }
+
266};
+
+
267
+
268constexpr inline uint32_t SpreadBits3(uint32_t v) {
+
269 v = 0xFF0000FFu & (v * 0x00010001u);
+
270 v = 0x0F00F00Fu & (v * 0x00000101u);
+
271 v = 0xC30C30C3u & (v * 0x00000011u);
+
272 v = 0x49249249u & (v * 0x00000005u);
+
273 return v;
+
274}
+
275} // namespace collider_internal
+
276
+
+
278class Collider {
+
279 public:
+
280 Collider() {};
+
281
+
282 Collider(const VecView<const Box>& leafBB,
+
283 const VecView<const uint32_t>& leafMorton) {
+
284 ZoneScoped;
+
285 DEBUG_ASSERT(leafBB.size() == leafMorton.size(), userErr,
+
286 "vectors must be the same length");
+
287 int num_nodes = 2 * leafBB.size() - 1;
+
288 // assign and allocate members
+
289 nodeBBox_.resize(num_nodes);
+
290 nodeParent_.resize(num_nodes, -1);
+
291 internalChildren_.resize(leafBB.size() - 1, std::make_pair(-1, -1));
+
292 // organize tree
+
293 for_each_n(autoPolicy(NumInternal(), 1e4), countAt(0), NumInternal(),
+ +
295 {nodeParent_, internalChildren_, leafMorton}));
+
296 UpdateBoxes(leafBB);
+
297 }
+
298
+
299 bool Transform(mat4x3 transform) {
+
300 ZoneScoped;
+
301 bool axisAligned = true;
+
302 for (int row : {0, 1, 2}) {
+
303 int count = 0;
+
304 for (int col : {0, 1, 2}) {
+
305 if (transform[col][row] == 0.0) ++count;
+
306 }
+
307 if (count != 2) axisAligned = false;
+
308 }
+
309 if (axisAligned) {
+
310 for_each(autoPolicy(nodeBBox_.size(), 1e5), nodeBBox_.begin(),
+
311 nodeBBox_.end(),
+
312 [transform](Box& box) { box = box.Transform(transform); });
+
313 }
+
314 return axisAligned;
+
315 }
+
316
+
317 void UpdateBoxes(const VecView<const Box>& leafBB) {
+
318 ZoneScoped;
+
319 DEBUG_ASSERT(leafBB.size() == NumLeaves(), userErr,
+
320 "must have the same number of updated boxes as original");
+
321 // copy in leaf node Boxes
+
322 auto leaves = StridedRange(nodeBBox_.begin(), nodeBBox_.end(), 2);
+
323 copy(leafBB.cbegin(), leafBB.cend(), leaves.begin());
+
324 // create global counters
+
325 Vec<int> counter(NumInternal(), 0);
+
326 // kernel over leaves to save internal Boxes
+
327 for_each_n(autoPolicy(NumInternal(), 1e3), countAt(0), NumLeaves(),
+ +
329 {nodeBBox_, counter, nodeParent_, internalChildren_}));
+
330 }
+
331
+
332 template <const bool selfCollision = false, const bool inverted = false,
+
333 typename T>
+
334 SparseIndices Collisions(const VecView<const T>& queriesIn) const {
+
335 ZoneScoped;
+ +
337 // note that the length is 1 larger than the number of queries so the last
+
338 // element can store the sum when using exclusive scan
+
339 if (queriesIn.size() < collider_internal::kSequentialThreshold) {
+
340 SparseIndices queryTri;
+
341 for_each_n(
+
342 ExecutionPolicy::Seq, countAt(0), queriesIn.size(),
+
343 FindCollisions<T, selfCollision,
+ +
345 queriesIn, nodeBBox_, internalChildren_, {queryTri}});
+
346 return queryTri;
+
347 } else {
+
348 // compute the number of collisions to determine the size for allocation
+
349 // and offset, this avoids the need for atomic
+
350 Vec<int> counts(queriesIn.size() + 1, 0);
+
351 Vec<char> empty(queriesIn.size(), 0);
+
352 for_each_n(
+
353 ExecutionPolicy::Par, countAt(0), queriesIn.size(),
+
354 FindCollisions<T, selfCollision, collider_internal::CountCollisions>{
+
355 queriesIn, nodeBBox_, internalChildren_, {counts, empty}});
+
356 // compute start index for each query and total count
+
357 manifold::exclusive_scan(counts.begin(), counts.end(), counts.begin(), 0,
+
358 std::plus<int>());
+
359 if (counts.back() == 0) return SparseIndices(0);
+
360 SparseIndices queryTri(counts.back());
+
361 // actually recording collisions
+
362 for_each_n(
+
363 ExecutionPolicy::Par, countAt(0), queriesIn.size(),
+
364 FindCollisions<T, selfCollision,
+ +
366 queriesIn,
+
367 nodeBBox_,
+
368 internalChildren_,
+
369 {queryTri, counts, empty}});
+
370 return queryTri;
+
371 }
+
372 }
+
373
+
374 static uint32_t MortonCode(vec3 position, Box bBox) {
+
375 using collider_internal::SpreadBits3;
+
376 vec3 xyz = (position - bBox.min) / (bBox.max - bBox.min);
+
377 xyz = glm::min(vec3(1023.0), glm::max(vec3(0.0), 1024.0 * xyz));
+
378 uint32_t x = SpreadBits3(static_cast<uint32_t>(xyz.x));
+
379 uint32_t y = SpreadBits3(static_cast<uint32_t>(xyz.y));
+
380 uint32_t z = SpreadBits3(static_cast<uint32_t>(xyz.z));
+
381 return x * 4 + y * 2 + z;
+
382 }
+
383
+
384 private:
+
385 Vec<Box> nodeBBox_;
+
386 Vec<int> nodeParent_;
+
387 // even nodes are leaves, odd nodes are internal, root is 1
+
388 Vec<std::pair<int, int>> internalChildren_;
+
389
+
390 size_t NumInternal() const { return internalChildren_.size(); };
+
391 size_t NumLeaves() const {
+
392 return internalChildren_.empty() ? 0 : (NumInternal() + 1);
+
393 };
+
394};
+
+
395
+
396} // namespace manifold
+
Definition collider.h:278
+
Definition sparse.h:39
+
Definition vec.h:43
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
Definition common.h:200
+
Box Transform(const mat4x3 &transform) const
Definition common.h:277
+
Definition iters.h:199
+ + + + + + + +
Definition common.h:629
+
+
+ + + + diff --git a/docs/html/common_8h_source.html b/docs/html/common_8h_source.html new file mode 100644 index 000000000..6be229c72 --- /dev/null +++ b/docs/html/common_8h_source.html @@ -0,0 +1,714 @@ + + + + + + + +Manifold: common.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
common.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#define GLM_ENABLE_EXPERIMENTAL // needed for glm/gtx/compatibility.hpp
+
17#define GLM_FORCE_EXPLICIT_CTOR
+
18#include <glm/ext/matrix_transform.hpp>
+
19#include <glm/glm.hpp>
+
20#include <glm/gtc/constants.hpp>
+
21#include <glm/gtx/compatibility.hpp>
+
22#include <glm/gtx/rotate_vector.hpp>
+
23#include <limits>
+
24#include <memory>
+
25#include <stdexcept>
+
26#include <unordered_map>
+
27#include <vector>
+
28
+
29#ifdef MANIFOLD_DEBUG
+
30#include <iomanip>
+
31#include <iostream>
+
32#include <sstream>
+
33#endif
+
34
+
35namespace manifold {
+
36
+
+
40[[nodiscard]] constexpr std::size_t operator""_uz(
+
41 unsigned long long n) noexcept {
+
42 return n;
+
43}
+
+
44
+
45constexpr double kTolerance = 1e-12;
+
46
+
52using vec2 = glm::dvec2;
+
53using vec3 = glm::dvec3;
+
54using vec4 = glm::dvec4;
+
55using mat2 = glm::dmat2;
+
56using mat2x3 = glm::dmat2x3;
+
57using mat2x4 = glm::dmat2x4;
+
58using mat3x2 = glm::dmat3x2;
+
59using mat3 = glm::dmat3;
+
60using mat3x4 = glm::dmat3x4;
+
61using mat4x3 = glm::dmat4x3;
+
62using mat4 = glm::dmat4;
+
63using ivec2 = glm::vec<2, int>;
+
64using ivec3 = glm::vec<3, int>;
+
65using ivec4 = glm::vec<4, int>;
+
66using quat = glm::dquat;
+
68
+
+
79inline double sind(double x) {
+
80 if (!std::isfinite(x)) return sin(x);
+
81 if (x < 0.0) return -sind(-x);
+
82 int quo;
+
83 x = remquo(fabs(x), 90.0, &quo);
+
84 switch (quo % 4) {
+
85 case 0:
+
86 return sin(glm::radians(x));
+
87 case 1:
+
88 return cos(glm::radians(x));
+
89 case 2:
+
90 return -sin(glm::radians(x));
+
91 case 3:
+
92 return -cos(glm::radians(x));
+
93 }
+
94 return 0.0;
+
95}
+
+
96
+
102inline double cosd(double x) { return sind(x + 90.0); }
+
103
+
+
110inline mat4x3 RotateUp(vec3 up) {
+
111 up = glm::normalize(up);
+
112 vec3 axis = glm::cross(up, {0, 0, 1});
+
113 double angle = glm::asin(glm::length(axis));
+
114 if (glm::dot(up, {0, 0, 1}) < 0) angle = glm::pi<double>() - angle;
+
115 return mat4x3(glm::rotate(mat4(1), angle, axis));
+
116}
+
+
117
+
+
129inline int CCW(vec2 p0, vec2 p1, vec2 p2, double tol) {
+
130 vec2 v1 = p1 - p0;
+
131 vec2 v2 = p2 - p0;
+
132 double area = fma(v1.x, v2.y, -v1.y * v2.x);
+
133 double base2 = glm::max(glm::dot(v1, v1), glm::dot(v2, v2));
+
134 if (area * area * 4 <= base2 * tol * tol)
+
135 return 0;
+
136 else
+
137 return area > 0 ? 1 : -1;
+
138}
+
+
139
+
145using SimplePolygon = std::vector<vec2>;
+
146
+
153using Polygons = std::vector<SimplePolygon>;
+
154
+
+
158struct Mesh {
+
160 std::vector<vec3> vertPos;
+
163 std::vector<ivec3> triVerts;
+
167 std::vector<vec3> vertNormal;
+
172 std::vector<vec4> halfedgeTangent;
+
177 double precision = 0;
+
178};
+
+
179
+
+ +
186 size_t halfedge;
+ +
191};
+
+
192
+
+ +
197 double surfaceArea, volume;
+
198};
+
+
199
+
+
200struct Box {
+
201 vec3 min = vec3(std::numeric_limits<double>::infinity());
+
202 vec3 max = vec3(-std::numeric_limits<double>::infinity());
+
203
+
207 Box() {}
+
208
+
+
212 Box(const vec3 p1, const vec3 p2) {
+
213 min = glm::min(p1, p2);
+
214 max = glm::max(p1, p2);
+
215 }
+
+
216
+
220 vec3 Size() const { return max - min; }
+
221
+
225 vec3 Center() const { return 0.5 * (max + min); }
+
226
+
+
231 double Scale() const {
+
232 vec3 absMax = glm::max(glm::abs(min), glm::abs(max));
+
233 return glm::max(absMax.x, glm::max(absMax.y, absMax.z));
+
234 }
+
+
235
+
+
239 bool Contains(const vec3& p) const {
+
240 return glm::all(glm::greaterThanEqual(p, min)) &&
+
241 glm::all(glm::greaterThanEqual(max, p));
+
242 }
+
+
243
+
+
247 bool Contains(const Box& box) const {
+
248 return glm::all(glm::greaterThanEqual(box.min, min)) &&
+
249 glm::all(glm::greaterThanEqual(max, box.max));
+
250 }
+
+
251
+
+
255 void Union(const vec3 p) {
+
256 min = glm::min(min, p);
+
257 max = glm::max(max, p);
+
258 }
+
+
259
+
+
263 Box Union(const Box& box) const {
+
264 Box out;
+
265 out.min = glm::min(min, box.min);
+
266 out.max = glm::max(max, box.max);
+
267 return out;
+
268 }
+
+
269
+
+
277 Box Transform(const mat4x3& transform) const {
+
278 Box out;
+
279 vec3 minT = transform * vec4(min, 1.0);
+
280 vec3 maxT = transform * vec4(max, 1.0);
+
281 out.min = glm::min(minT, maxT);
+
282 out.max = glm::max(minT, maxT);
+
283 return out;
+
284 }
+
+
285
+
+
289 Box operator+(vec3 shift) const {
+
290 Box out;
+
291 out.min = min + shift;
+
292 out.max = max + shift;
+
293 return out;
+
294 }
+
+
295
+
+
299 Box& operator+=(vec3 shift) {
+
300 min += shift;
+
301 max += shift;
+
302 return *this;
+
303 }
+
+
304
+
+
308 Box operator*(vec3 scale) const {
+
309 Box out;
+
310 out.min = min * scale;
+
311 out.max = max * scale;
+
312 return out;
+
313 }
+
+
314
+
+
318 Box& operator*=(vec3 scale) {
+
319 min *= scale;
+
320 max *= scale;
+
321 return *this;
+
322 }
+
+
323
+
+
327 inline bool DoesOverlap(const Box& box) const {
+
328 return min.x <= box.max.x && min.y <= box.max.y && min.z <= box.max.z &&
+
329 max.x >= box.min.x && max.y >= box.min.y && max.z >= box.min.z;
+
330 }
+
+
331
+
+
336 inline bool DoesOverlap(vec3 p) const { // projected in z
+
337 return p.x <= max.x && p.x >= min.x && p.y <= max.y && p.y >= min.y;
+
338 }
+
+
339
+
+
343 bool IsFinite() const {
+
344 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
345 }
+
+
346};
+
+
347
+
+
351struct Rect {
+
352 vec2 min = vec2(std::numeric_limits<double>::infinity());
+
353 vec2 max = vec2(-std::numeric_limits<double>::infinity());
+
354
+
358 Rect() {}
+
359
+
+
363 Rect(const vec2 a, const vec2 b) {
+
364 min = glm::min(a, b);
+
365 max = glm::max(a, b);
+
366 }
+
+
367
+
372
+
376 vec2 Size() const { return max - min; }
+
377
+
+
381 double Area() const {
+
382 auto sz = Size();
+
383 return sz.x * sz.y;
+
384 }
+
+
385
+
+
390 double Scale() const {
+
391 vec2 absMax = glm::max(glm::abs(min), glm::abs(max));
+
392 return glm::max(absMax.x, absMax.y);
+
393 }
+
+
394
+
398 vec2 Center() const { return 0.5 * (max + min); }
+
399
+
+
403 bool Contains(const vec2& p) const {
+
404 return glm::all(glm::greaterThanEqual(p, min)) &&
+
405 glm::all(glm::greaterThanEqual(max, p));
+
406 }
+
+
407
+
+
411 bool Contains(const Rect& rect) const {
+
412 return glm::all(glm::greaterThanEqual(rect.min, min)) &&
+
413 glm::all(glm::greaterThanEqual(max, rect.max));
+
414 }
+
+
415
+
+
419 bool DoesOverlap(const Rect& rect) const {
+
420 return min.x <= rect.max.x && min.y <= rect.max.y && max.x >= rect.min.x &&
+
421 max.y >= rect.min.y;
+
422 }
+
+
423
+
427 bool IsEmpty() const { return max.y <= min.y || max.x <= min.x; };
+
428
+
+
432 bool IsFinite() const {
+
433 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
434 }
+
+
435
+
437
+
441
+
+
445 void Union(const vec2 p) {
+
446 min = glm::min(min, p);
+
447 max = glm::max(max, p);
+
448 }
+
+
449
+
+
453 Rect Union(const Rect& rect) const {
+
454 Rect out;
+
455 out.min = glm::min(min, rect.min);
+
456 out.max = glm::max(max, rect.max);
+
457 return out;
+
458 }
+
+
459
+
+
463 Rect operator+(const vec2 shift) const {
+
464 Rect out;
+
465 out.min = min + shift;
+
466 out.max = max + shift;
+
467 return out;
+
468 }
+
+
469
+
+
473 Rect& operator+=(const vec2 shift) {
+
474 min += shift;
+
475 max += shift;
+
476 return *this;
+
477 }
+
+
478
+
+
482 Rect operator*(const vec2 scale) const {
+
483 Rect out;
+
484 out.min = min * scale;
+
485 out.max = max * scale;
+
486 return out;
+
487 }
+
+
488
+
+
492 Rect& operator*=(const vec2 scale) {
+
493 min *= scale;
+
494 max *= scale;
+
495 return *this;
+
496 }
+
+
497
+
+
505 Rect Transform(const mat3x2& m) const {
+
506 Rect rect;
+
507 rect.min = m * vec3(min, 1);
+
508 rect.max = m * vec3(max, 1);
+
509 return rect;
+
510 }
+
+
512};
+
+
522enum class OpType { Add, Subtract, Intersect };
+
523
+
524constexpr int DEFAULT_SEGMENTS = 0;
+
525constexpr double DEFAULT_ANGLE = 10.0;
+
526constexpr double DEFAULT_LENGTH = 1.0;
+
+
535class Quality {
+
536 private:
+
537 inline static int circularSegments_ = DEFAULT_SEGMENTS;
+
538 inline static double circularAngle_ = DEFAULT_ANGLE;
+
539 inline static double circularEdgeLength_ = DEFAULT_LENGTH;
+
540
+
541 public:
+
+
552 static void SetMinCircularAngle(double angle) {
+
553 if (angle <= 0) return;
+
554 circularAngle_ = angle;
+
555 }
+
+
556
+
+
566 static void SetMinCircularEdgeLength(double length) {
+
567 if (length <= 0) return;
+
568 circularEdgeLength_ = length;
+
569 }
+
+
570
+
+
580 static void SetCircularSegments(int number) {
+
581 if (number < 3 && number != 0) return;
+
582 circularSegments_ = number;
+
583 }
+
+
584
+
+
592 static int GetCircularSegments(double radius) {
+
593 if (circularSegments_ > 0) return circularSegments_;
+
594 int nSegA = 360.0 / circularAngle_;
+
595 int nSegL = 2.0 * radius * glm::pi<double>() / circularEdgeLength_;
+
596 int nSeg = fmin(nSegA, nSegL) + 3;
+
597 nSeg -= nSeg % 4;
+
598 return std::max(nSeg, 3);
+
599 }
+
+
600
+
+
606 static void ResetToDefaults() {
+
607 circularSegments_ = DEFAULT_SEGMENTS;
+
608 circularAngle_ = DEFAULT_ANGLE;
+
609 circularEdgeLength_ = DEFAULT_LENGTH;
+
610 }
+
+
611};
+
+
+
629struct userErr : public virtual std::runtime_error {
+
630 using std::runtime_error::runtime_error;
+
631};
+
+
+
632struct topologyErr : public virtual std::runtime_error {
+
633 using std::runtime_error::runtime_error;
+
634};
+
+
+
635struct geometryErr : public virtual std::runtime_error {
+
636 using std::runtime_error::runtime_error;
+
637};
+
+
638using logicErr = std::logic_error;
+
+ +
648 bool intermediateChecks = false;
+
651 bool verbose = false;
+
654 bool processOverlaps = true;
+
657 bool suppressErrors = false;
+
659 bool deterministic = false;
+
661 bool cleanupTriangles = true;
+
662};
+
+
663
+
664#ifdef MANIFOLD_DEBUG
+
665
+
666template <typename T>
+
667inline std::ostream& operator<<(std::ostream& stream, const glm::tvec2<T>& v) {
+
668 return stream << "x = " << v.x << ", y = " << v.y;
+
669}
+
670
+
671template <typename T>
+
672inline std::ostream& operator<<(std::ostream& stream, const glm::tvec3<T>& v) {
+
673 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z;
+
674}
+
675
+
676template <typename T>
+
677inline std::ostream& operator<<(std::ostream& stream, const glm::tvec4<T>& v) {
+
678 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z
+
679 << ", w = " << v.w;
+
680}
+
681
+
682inline std::ostream& operator<<(std::ostream& stream, const mat3& mat) {
+
683 mat3 tam = glm::transpose(mat);
+
684 return stream << tam[0] << std::endl
+
685 << tam[1] << std::endl
+
686 << tam[2] << std::endl;
+
687}
+
688
+
689inline std::ostream& operator<<(std::ostream& stream, const mat4x3& mat) {
+
690 mat3x4 tam = glm::transpose(mat);
+
691 return stream << tam[0] << std::endl
+
692 << tam[1] << std::endl
+
693 << tam[2] << std::endl;
+
694}
+
695
+
696inline std::ostream& operator<<(std::ostream& stream, const Box& box) {
+
697 return stream << "min: " << box.min << ", "
+
698 << "max: " << box.max;
+
699}
+
700
+
701inline std::ostream& operator<<(std::ostream& stream, const Rect& box) {
+
702 return stream << "min: " << box.min << ", "
+
703 << "max: " << box.max;
+
704}
+
705
+
710template <typename T>
+
+
711void Dump(const std::vector<T>& vec) {
+
712 std::cout << "Vec = " << std::endl;
+
713 for (size_t i = 0; i < vec.size(); ++i) {
+
714 std::cout << i << ", " << vec[i] << ", " << std::endl;
+
715 }
+
716 std::cout << std::endl;
+
717}
+
+
718
+
719template <typename T>
+
720void Diff(const std::vector<T>& a, const std::vector<T>& b) {
+
721 std::cout << "Diff = " << std::endl;
+
722 if (a.size() != b.size()) {
+
723 std::cout << "a and b must have the same length, aborting Diff"
+
724 << std::endl;
+
725 return;
+
726 }
+
727 for (size_t i = 0; i < a.size(); ++i) {
+
728 if (a[i] != b[i])
+
729 std::cout << i << ": " << a[i] << ", " << b[i] << std::endl;
+
730 }
+
731 std::cout << std::endl;
+
732}
+
734#endif
+
735} // namespace manifold
+
736
+
737#undef HOST_DEVICE
+
Definition common.h:535
+
static void ResetToDefaults()
Definition common.h:606
+
static void SetCircularSegments(int number)
Definition common.h:580
+
static void SetMinCircularAngle(double angle)
Definition common.h:552
+
static int GetCircularSegments(double radius)
Definition common.h:592
+
static void SetMinCircularEdgeLength(double length)
Definition common.h:566
+
std::vector< vec3 > vertPos
Required: The X-Y-Z positions of all vertices.
Definition common.h:160
+
std::vector< ivec3 > triVerts
Definition common.h:163
+
std::vector< vec4 > halfedgeTangent
Definition common.h:172
+
double precision
Definition common.h:177
+
size_t halfedge
The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i].
Definition common.h:186
+
std::vector< vec3 > vertNormal
Definition common.h:167
+
double smoothness
Definition common.h:190
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
mat4x3 RotateUp(vec3 up)
Definition common.h:110
+
int CCW(vec2 p0, vec2 p1, vec2 p2, double tol)
Definition common.h:129
+
double cosd(double x)
Definition common.h:102
+
std::vector< vec2 > SimplePolygon
Definition common.h:145
+
double sind(double x)
Definition common.h:79
+
Definition common.h:158
+
Definition common.h:196
+
Definition common.h:184
+
OpType
Definition common.h:522
+
bool deterministic
Deterministic outputs. Will disable some parallel optimizations.
Definition common.h:659
+
bool suppressErrors
Definition common.h:657
+
bool processOverlaps
Definition common.h:654
+
bool cleanupTriangles
Perform optional but recommended triangle cleanups in SimplifyTopology()
Definition common.h:661
+
bool verbose
Definition common.h:651
+
bool intermediateChecks
Definition common.h:648
+
void Dump(const std::vector< T > &vec)
Definition common.h:711
+
Definition common.h:645
+
Definition meshIO.h:20
+
Definition common.h:200
+
Box operator*(vec3 scale) const
Definition common.h:308
+
bool IsFinite() const
Definition common.h:343
+
bool DoesOverlap(const Box &box) const
Definition common.h:327
+
Box(const vec3 p1, const vec3 p2)
Definition common.h:212
+
Box Union(const Box &box) const
Definition common.h:263
+
void Union(const vec3 p)
Definition common.h:255
+
bool Contains(const vec3 &p) const
Definition common.h:239
+
bool DoesOverlap(vec3 p) const
Definition common.h:336
+
Box & operator*=(vec3 scale)
Definition common.h:318
+
double Scale() const
Definition common.h:231
+
Box Transform(const mat4x3 &transform) const
Definition common.h:277
+
vec3 Center() const
Definition common.h:225
+
vec3 Size() const
Definition common.h:220
+
Box & operator+=(vec3 shift)
Definition common.h:299
+
Box()
Definition common.h:207
+
Box operator+(vec3 shift) const
Definition common.h:289
+
bool Contains(const Box &box) const
Definition common.h:247
+
Definition common.h:351
+
Rect & operator*=(const vec2 scale)
Definition common.h:492
+
Rect Transform(const mat3x2 &m) const
Definition common.h:505
+
bool IsFinite() const
Definition common.h:432
+
Rect(const vec2 a, const vec2 b)
Definition common.h:363
+
Rect operator+(const vec2 shift) const
Definition common.h:463
+
Rect operator*(const vec2 scale) const
Definition common.h:482
+
vec2 Size() const
Definition common.h:376
+
bool IsEmpty() const
Definition common.h:427
+
void Union(const vec2 p)
Definition common.h:445
+
bool Contains(const vec2 &p) const
Definition common.h:403
+
double Scale() const
Definition common.h:390
+
Rect Union(const Rect &rect) const
Definition common.h:453
+
vec2 Center() const
Definition common.h:398
+
double Area() const
Definition common.h:381
+
bool Contains(const Rect &rect) const
Definition common.h:411
+
Rect()
Definition common.h:358
+
Rect & operator+=(const vec2 shift)
Definition common.h:473
+
bool DoesOverlap(const Rect &rect) const
Definition common.h:419
+
Definition common.h:635
+
Definition common.h:632
+
Definition common.h:629
+
+
+ + + + diff --git a/docs/html/conv_8h_source.html b/docs/html/conv_8h_source.html new file mode 100644 index 000000000..793a48653 --- /dev/null +++ b/docs/html/conv_8h_source.html @@ -0,0 +1,210 @@ + + + + + + + +Manifold: conv.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
conv.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <cstring>
+
17#include <vector>
+
18
+
19#include "manifold/common.h"
+
20#include "manifold/cross_section.h"
+
21#include "manifold/manifold.h"
+
22#include "manifold/types.h"
+
23
+
24using namespace manifold;
+
25using ManifoldVec = std::vector<Manifold>;
+
26using CrossSectionVec = std::vector<CrossSection>;
+
27
+
28ManifoldManifold *to_c(manifold::Manifold *m);
+
29ManifoldManifoldVec *to_c(ManifoldVec *ms);
+
30ManifoldCrossSection *to_c(manifold::CrossSection *cs);
+
31ManifoldCrossSectionVec *to_c(CrossSectionVec *csv);
+
32ManifoldSimplePolygon *to_c(manifold::SimplePolygon *p);
+
33ManifoldPolygons *to_c(manifold::Polygons *ps);
+
34ManifoldMesh *to_c(manifold::Mesh *m);
+
35ManifoldMeshGL *to_c(manifold::MeshGL *m);
+
36ManifoldBox *to_c(manifold::Box *m);
+
37ManifoldRect *to_c(manifold::Rect *m);
+
38ManifoldError to_c(manifold::Manifold::Error error);
+
39ManifoldVec2 to_c(vec2 v);
+
40ManifoldVec3 to_c(vec3 v);
+
41ManifoldIVec3 to_c(ivec3 v);
+ +
43
+
44const manifold::Manifold *from_c(ManifoldManifold *m);
+
45ManifoldVec *from_c(ManifoldManifoldVec *ms);
+
46const manifold::CrossSection *from_c(ManifoldCrossSection *cs);
+
47CrossSectionVec *from_c(ManifoldCrossSectionVec *csv);
+
48const manifold::SimplePolygon *from_c(ManifoldSimplePolygon *m);
+
49const manifold::Polygons *from_c(ManifoldPolygons *m);
+
50const manifold::Mesh *from_c(ManifoldMesh *m);
+
51const manifold::MeshGL *from_c(ManifoldMeshGL *m);
+
52OpType from_c(ManifoldOpType op);
+
53CrossSection::FillRule from_c(ManifoldFillRule fillrule);
+
54CrossSection::JoinType from_c(ManifoldJoinType jt);
+
55const manifold::Box *from_c(ManifoldBox *m);
+
56const manifold::Rect *from_c(ManifoldRect *r);
+
57vec2 from_c(ManifoldVec2 v);
+
58vec3 from_c(ManifoldVec3 v);
+
59ivec3 from_c(ManifoldIVec3 v);
+
60vec4 from_c(ManifoldVec4 v);
+
61
+
62std::vector<vec3> vector_of_vec_array(ManifoldVec3 *vs, size_t length);
+
63std::vector<ivec3> vector_of_vec_array(ManifoldIVec3 *vs, size_t length);
+
64std::vector<vec4> vector_of_vec_array(ManifoldVec4 *vs, size_t length);
+
65
+
66template <typename T>
+
67std::vector<T> vector_of_array(T *ts, size_t length) {
+
68 auto vec = std::vector<T>();
+
69 for (size_t i = 0; i < length; ++i) {
+
70 vec.push_back(ts[i]);
+
71 }
+
72 return vec;
+
73}
+
74
+
75template <typename T>
+
76T *copy_data(void *mem, std::vector<T> v) {
+
77 T *ts = reinterpret_cast<T *>(mem);
+
78 memcpy(ts, v.data(), sizeof(T) * v.size());
+
79 return ts;
+
80}
+
Definition cross_section.h:38
+
FillRule
Definition cross_section.h:63
+
JoinType
Definition cross_section.h:111
+
Definition manifold.h:152
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
std::vector< vec2 > SimplePolygon
Definition common.h:145
+
Definition common.h:158
+
Definition common.h:196
+
OpType
Definition common.h:522
+
Definition meshIO.h:20
+
Definition types.h:54
+
Definition types.h:67
+
Definition types.h:43
+
Definition types.h:48
+
Definition types.h:60
+
Definition common.h:200
+
Definition manifold.h:46
+
Definition common.h:351
+
+
+ + + + diff --git a/docs/html/cross__section_8h_source.html b/docs/html/cross__section_8h_source.html new file mode 100644 index 000000000..958b9b116 --- /dev/null +++ b/docs/html/cross__section_8h_source.html @@ -0,0 +1,272 @@ + + + + + + + +Manifold: cross_section.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
cross_section.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include <functional>
+
18#include <memory>
+
19#include <vector>
+
20
+
21#include "manifold/common.h"
+
22#include "manifold/vec_view.h"
+
23
+
24namespace manifold {
+
25
+
30struct PathImpl;
+
31
+
+ +
39 public:
+
44
+ + +
47
+
48 CrossSection(const CrossSection& other);
+
49 CrossSection& operator=(const CrossSection& other);
+
50 CrossSection(CrossSection&&) noexcept;
+
51 CrossSection& operator=(CrossSection&&) noexcept;
+
52
+
53 // Adapted from Clipper2 docs:
+
54 // http://www.angusj.com/clipper2/Docs/Units/Clipper/Types/FillRule.htm
+
55 // (Copyright © 2010-2023 Angus Johnson)
+
+
63 enum class FillRule {
+
64 EvenOdd,
+
65 NonZero,
+
66 Positive,
+ +
68 };
+
+
69
+
70 CrossSection(const SimplePolygon& contour,
+
71 FillRule fillrule = FillRule::Positive);
+
72 CrossSection(const Polygons& contours,
+
73 FillRule fillrule = FillRule::Positive);
+
74 CrossSection(const Rect& rect);
+
75 static CrossSection Square(const vec2 dims, bool center = false);
+
76 static CrossSection Circle(double radius, int circularSegments = 0);
+
78
+
83 double Area() const;
+
84 int NumVert() const;
+
85 int NumContour() const;
+
86 bool IsEmpty() const;
+
87 Rect Bounds() const;
+
89
+
93 CrossSection Translate(const vec2 v) const;
+
94 CrossSection Rotate(double degrees) const;
+
95 CrossSection Scale(const vec2 s) const;
+
96 CrossSection Mirror(const vec2 ax) const;
+
97 CrossSection Transform(const mat3x2& m) const;
+
98 CrossSection Warp(std::function<void(vec2&)> warpFunc) const;
+
99 CrossSection WarpBatch(std::function<void(VecView<vec2>)> warpFunc) const;
+
100 CrossSection Simplify(double epsilon = 1e-6) const;
+
101
+
102 // Adapted from Clipper2 docs:
+
103 // http://www.angusj.com/clipper2/Docs/Units/Clipper/Types/JoinType.htm
+
104 // (Copyright © 2010-2023 Angus Johnson)
+
+
111 enum class JoinType {
+
112 Square,
+
115 Round,
+
118 Miter
+
123 };
+
+
124
+
125 CrossSection Offset(double delta, JoinType jt, double miter_limit = 2.0,
+
126 int circularSegments = 0) const;
+
128
+
133 CrossSection Boolean(const CrossSection& second, OpType op) const;
+ +
135 const std::vector<CrossSection>& crossSections, OpType op);
+
136 CrossSection operator+(const CrossSection&) const;
+ +
138 CrossSection operator-(const CrossSection&) const;
+ +
140 CrossSection operator^(const CrossSection&) const;
+ +
143
+
147 static CrossSection Compose(std::vector<CrossSection>&);
+
148 std::vector<CrossSection> Decompose() const;
+
150
+
154 CrossSection Hull() const;
+
155 static CrossSection Hull(const std::vector<CrossSection>& crossSections);
+
156 static CrossSection Hull(const SimplePolygon poly);
+
157 static CrossSection Hull(const Polygons polys);
+
160
+
163 Polygons ToPolygons() const;
+
165
+
166 private:
+
167 mutable std::shared_ptr<const PathImpl> paths_;
+
168 mutable mat3x2 transform_ = mat3x2(1.0);
+
169 CrossSection(std::shared_ptr<const PathImpl> paths);
+
170 std::shared_ptr<const PathImpl> GetPaths() const;
+
171};
+
+
173} // namespace manifold
+
Definition cross_section.h:38
+
CrossSection Boolean(const CrossSection &second, OpType op) const
Definition cross_section.cpp:358
+
CrossSection & operator+=(const CrossSection &)
Definition cross_section.cpp:406
+
Polygons ToPolygons() const
Definition cross_section.cpp:774
+
CrossSection WarpBatch(std::function< void(VecView< vec2 >)> warpFunc) const
Definition cross_section.cpp:573
+
CrossSection operator+(const CrossSection &) const
Definition cross_section.cpp:398
+
CrossSection operator^(const CrossSection &) const
Definition cross_section.cpp:431
+
CrossSection Translate(const vec2 v) const
Definition cross_section.cpp:484
+
CrossSection Mirror(const vec2 ax) const
Definition cross_section.cpp:527
+
CrossSection & operator-=(const CrossSection &)
Definition cross_section.cpp:423
+
std::vector< CrossSection > Decompose() const
Definition cross_section.cpp:457
+
CrossSection Transform(const mat3x2 &m) const
Definition cross_section.cpp:543
+
static CrossSection Compose(std::vector< CrossSection > &)
Definition cross_section.cpp:448
+
CrossSection Rotate(double degrees) const
Definition cross_section.cpp:497
+
static CrossSection BatchBoolean(const std::vector< CrossSection > &crossSections, OpType op)
Definition cross_section.cpp:370
+
int NumVert() const
Definition cross_section.cpp:742
+
bool IsEmpty() const
Definition cross_section.cpp:760
+
CrossSection Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
Definition cross_section.cpp:655
+
FillRule
Definition cross_section.h:63
+
@ Positive
Only sub-regions with winding counts > 0 are filled.
+
@ NonZero
Only non-zero sub-regions are filled.
+
@ EvenOdd
Only odd numbered sub-regions are filled.
+
@ Negative
Only sub-regions with winding counts < 0 are filled.
+
CrossSection & operator^=(const CrossSection &)
Definition cross_section.cpp:439
+
CrossSection Simplify(double epsilon=1e-6) const
Definition cross_section.cpp:609
+
CrossSection Hull() const
Definition cross_section.cpp:701
+
CrossSection Warp(std::function< void(vec2 &)> warpFunc) const
Definition cross_section.cpp:558
+
double Area() const
Definition cross_section.cpp:737
+
CrossSection()
Definition cross_section.cpp:211
+
CrossSection Scale(const vec2 s) const
Definition cross_section.cpp:512
+
Rect Bounds() const
Definition cross_section.cpp:766
+
JoinType
Definition cross_section.h:111
+ + + +
CrossSection operator-(const CrossSection &) const
Definition cross_section.cpp:415
+
int NumContour() const
Definition cross_section.cpp:755
+
static CrossSection Circle(double radius, int circularSegments=0)
Definition cross_section.cpp:341
+
Definition vec_view.h:27
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
std::vector< vec2 > SimplePolygon
Definition common.h:145
+
OpType
Definition common.h:522
+
Definition meshIO.h:20
+
Definition common.h:351
+
+
+ + + + diff --git a/docs/html/csg__tree_8h_source.html b/docs/html/csg__tree_8h_source.html new file mode 100644 index 000000000..b9d0b8d4e --- /dev/null +++ b/docs/html/csg__tree_8h_source.html @@ -0,0 +1,234 @@ + + + + + + + +Manifold: csg_tree.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
csg_tree.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include "manifold/manifold.h"
+
17#include "manifold/utils.h"
+
18
+
19namespace manifold {
+
20
+
21enum class CsgNodeType { Union, Intersection, Difference, Leaf };
+
22
+
23class CsgLeafNode;
+
24
+
+
25class CsgNode : public std::enable_shared_from_this<CsgNode> {
+
26 public:
+
27 virtual std::shared_ptr<CsgLeafNode> ToLeafNode() const = 0;
+
28 virtual std::shared_ptr<CsgNode> Transform(const mat4x3 &m) const = 0;
+
29 virtual CsgNodeType GetNodeType() const = 0;
+
30 virtual mat4x3 GetTransform() const = 0;
+
31
+
32 virtual std::shared_ptr<CsgNode> Boolean(
+
33 const std::shared_ptr<CsgNode> &second, OpType op);
+
34
+
35 std::shared_ptr<CsgNode> Translate(const vec3 &t) const;
+
36 std::shared_ptr<CsgNode> Scale(const vec3 &s) const;
+
37 std::shared_ptr<CsgNode> Rotate(double xDegrees = 0, double yDegrees = 0,
+
38 double zDegrees = 0) const;
+
39};
+
+
40
+
+
41class CsgLeafNode final : public CsgNode {
+
42 public:
+ +
44 CsgLeafNode(std::shared_ptr<const Manifold::Impl> pImpl_);
+
45 CsgLeafNode(std::shared_ptr<const Manifold::Impl> pImpl_, mat4x3 transform_);
+
46
+
47 std::shared_ptr<const Manifold::Impl> GetImpl() const;
+
48
+
49 std::shared_ptr<CsgLeafNode> ToLeafNode() const override;
+
50
+
51 std::shared_ptr<CsgNode> Transform(const mat4x3 &m) const override;
+
52
+
53 CsgNodeType GetNodeType() const override;
+
54
+
55 mat4x3 GetTransform() const override;
+
56
+ +
58 const std::vector<std::shared_ptr<CsgLeafNode>> &nodes);
+
59
+
60 private:
+
61 mutable std::shared_ptr<const Manifold::Impl> pImpl_;
+
62 mutable mat4x3 transform_ = mat4x3(1.0);
+
63};
+
+
64
+
+
65class CsgOpNode final : public CsgNode {
+
66 public:
+
67 CsgOpNode();
+
68
+
69 CsgOpNode(const std::vector<std::shared_ptr<CsgNode>> &children, OpType op);
+
70
+
71 CsgOpNode(std::vector<std::shared_ptr<CsgNode>> &&children, OpType op);
+
72
+
73 std::shared_ptr<CsgNode> Boolean(const std::shared_ptr<CsgNode> &second,
+
74 OpType op) override;
+
75
+
76 std::shared_ptr<CsgNode> Transform(const mat4x3 &m) const override;
+
77
+
78 std::shared_ptr<CsgLeafNode> ToLeafNode() const override;
+
79
+
80 CsgNodeType GetNodeType() const override { return op_; }
+
81
+
82 mat4x3 GetTransform() const override;
+
83
+
84 private:
+
85 struct Impl {
+
86 std::vector<std::shared_ptr<CsgNode>> children_;
+
87 bool forcedToLeafNodes_ = false;
+
88 };
+ +
90 CsgNodeType op_;
+
91 mat4x3 transform_ = mat4x3(1.0);
+
92 // the following fields are for lazy evaluation, so they are mutable
+
93 mutable std::shared_ptr<CsgLeafNode> cache_ = nullptr;
+
94
+
95 void SetOp(OpType);
+
96 bool IsOp(OpType op);
+
97
+
98 static std::shared_ptr<Manifold::Impl> BatchBoolean(
+
99 OpType operation,
+
100 std::vector<std::shared_ptr<const Manifold::Impl>> &results);
+
101
+
102 void BatchUnion() const;
+
103
+
104 std::vector<std::shared_ptr<CsgNode>> &GetChildren(
+
105 bool forceToLeafNodes = true) const;
+
106};
+
+
107
+
108} // namespace manifold
+
Definition utils.h:108
+
Definition csg_tree.h:41
+
static Manifold::Impl Compose(const std::vector< std::shared_ptr< CsgLeafNode > > &nodes)
Definition csg_tree.cpp:173
+
Definition csg_tree.h:25
+
Definition csg_tree.h:65
+
OpType
Definition common.h:522
+
Definition meshIO.h:20
+
Definition impl.h:31
+
+
+ + + + diff --git a/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html b/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html new file mode 100644 index 000000000..4a8cb225d --- /dev/null +++ b/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: bindings Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
bindings Directory Reference
+
+
+ + + + + + + + +

+Directories

 c
 
 python
 
 wasm
 
+
+
+ + + + diff --git a/docs/html/dir_01ba33e26ccdeaa7023e73de5893fd0d.html b/docs/html/dir_01ba33e26ccdeaa7023e73de5893fd0d.html new file mode 100644 index 000000000..81f6bd975 --- /dev/null +++ b/docs/html/dir_01ba33e26ccdeaa7023e73de5893fd0d.html @@ -0,0 +1,128 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+ + + + + + + + + + + + + + +

+Files

 boolean3.h
 
 csg_tree.h
 
 impl.h
 
 mesh_fixes.h
 
 quickhull.h
 
 shared.h
 
+
+
+ + + + diff --git a/docs/html/dir_035854e2c8d5363d0a7c6528cb1706b0.html b/docs/html/dir_035854e2c8d5363d0a7c6528cb1706b0.html new file mode 100644 index 000000000..ffe5853bb --- /dev/null +++ b/docs/html/dir_035854e2c8d5363d0a7c6528cb1706b0.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_0701a8296ffb54d5e8b875616b7dbaff.html b/docs/html/dir_0701a8296ffb54d5e8b875616b7dbaff.html new file mode 100644 index 000000000..b8711a10f --- /dev/null +++ b/docs/html/dir_0701a8296ffb54d5e8b875616b7dbaff.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_13e138d54eb8818da29c3992edef070a.html b/docs/html/dir_13e138d54eb8818da29c3992edef070a.html new file mode 100644 index 000000000..3533fc6ed --- /dev/null +++ b/docs/html/dir_13e138d54eb8818da29c3992edef070a.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: test Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
test Directory Reference
+
+
+ + + + +

+Files

 test.h
 
+
+
+ + + + diff --git a/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html b/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html new file mode 100644 index 000000000..d41959baa --- /dev/null +++ b/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: extras Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
extras Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_22436d21afed9fe2212ff99306573f86.html b/docs/html/dir_22436d21afed9fe2212ff99306573f86.html new file mode 100644 index 000000000..5affa01af --- /dev/null +++ b/docs/html/dir_22436d21afed9fe2212ff99306573f86.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html b/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html new file mode 100644 index 000000000..4f768e15f --- /dev/null +++ b/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_2f3bb0cab4b2b47ef2f8a491566c2c5e.html b/docs/html/dir_2f3bb0cab4b2b47ef2f8a491566c2c5e.html new file mode 100644 index 000000000..c30d78633 --- /dev/null +++ b/docs/html/dir_2f3bb0cab4b2b47ef2f8a491566c2c5e.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Files

 polygon.h
 
+
+
+ + + + diff --git a/docs/html/dir_3129add96c7ae9ff67479c7829851787.html b/docs/html/dir_3129add96c7ae9ff67479c7829851787.html new file mode 100644 index 000000000..56775a73b --- /dev/null +++ b/docs/html/dir_3129add96c7ae9ff67479c7829851787.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html b/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html new file mode 100644 index 000000000..c1a286018 --- /dev/null +++ b/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: examples Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html b/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html new file mode 100644 index 000000000..430a90e1d --- /dev/null +++ b/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: c Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
c Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html b/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html new file mode 100644 index 000000000..d23db89de --- /dev/null +++ b/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_46e7b3646ff8bc1527ae1e0fd4b7ea0c.html b/docs/html/dir_46e7b3646ff8bc1527ae1e0fd4b7ea0c.html new file mode 100644 index 000000000..7ef5726f4 --- /dev/null +++ b/docs/html/dir_46e7b3646ff8bc1527ae1e0fd4b7ea0c.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_4b3af5e33c6e30f1df245af5cd6be3c5.html b/docs/html/dir_4b3af5e33c6e30f1df245af5cd6be3c5.html new file mode 100644 index 000000000..78e59f1c4 --- /dev/null +++ b/docs/html/dir_4b3af5e33c6e30f1df245af5cd6be3c5.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: polygons Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
polygons Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html b/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html new file mode 100644 index 000000000..2c7e4f0ee --- /dev/null +++ b/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: polygon Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
polygon Directory Reference
+
+
+ + + + +

+Directories

 src
 
+
+
+ + + + diff --git a/docs/html/dir_595091899e7484108f36f28facccf73b.html b/docs/html/dir_595091899e7484108f36f28facccf73b.html new file mode 100644 index 000000000..4473988ee --- /dev/null +++ b/docs/html/dir_595091899e7484108f36f28facccf73b.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_595ba06e7d6ef83c3b4b5ed8a5b33554.html b/docs/html/dir_595ba06e7d6ef83c3b4b5ed8a5b33554.html new file mode 100644 index 000000000..cbcdf3d53 --- /dev/null +++ b/docs/html/dir_595ba06e7d6ef83c3b4b5ed8a5b33554.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Files

 collider.h
 
+
+
+ + + + diff --git a/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html b/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html new file mode 100644 index 000000000..8cf724c21 --- /dev/null +++ b/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: examples Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html b/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html new file mode 100644 index 000000000..3d0cd0498 --- /dev/null +++ b/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: cross_section Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
cross_section Directory Reference
+
+
+ + + + +

+Directories

 src
 
+
+
+ + + + diff --git a/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 000000000..6256971ac --- /dev/null +++ b/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_6f9635d4fbfa321d4c00f29df5cd540c.html b/docs/html/dir_6f9635d4fbfa321d4c00f29df5cd540c.html new file mode 100644 index 000000000..63d569cad --- /dev/null +++ b/docs/html/dir_6f9635d4fbfa321d4c00f29df5cd540c.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: samples Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
samples Directory Reference
+
+
+ + + + + + +

+Directories

 include
 
 src
 
+
+
+ + + + diff --git a/docs/html/dir_791e0ab30be21dbfeefdd31c55c59561.html b/docs/html/dir_791e0ab30be21dbfeefdd31c55c59561.html new file mode 100644 index 000000000..dc5e12847 --- /dev/null +++ b/docs/html/dir_791e0ab30be21dbfeefdd31c55c59561.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 common.h
 
 hashtable.h
 
 iters.h
 
 optional_assert.h
 
 parallel.h
 
 sparse.h
 
 svd.h
 
 tri_dist.h
 
 utils.h
 
 vec.h
 
 vec_view.h
 
+
+
+ + + + diff --git a/docs/html/dir_79ec84d1c32dad719c443df036c21431.html b/docs/html/dir_79ec84d1c32dad719c443df036c21431.html new file mode 100644 index 000000000..2dcf33cb6 --- /dev/null +++ b/docs/html/dir_79ec84d1c32dad719c443df036c21431.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Files

 meshIO.h
 
+
+
+ + + + diff --git a/docs/html/dir_7a1d03d6e98827f36dd6952c603435c3.html b/docs/html/dir_7a1d03d6e98827f36dd6952c603435c3.html new file mode 100644 index 000000000..05cfd9874 --- /dev/null +++ b/docs/html/dir_7a1d03d6e98827f36dd6952c603435c3.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Files

 samples.h
 
+
+
+ + + + diff --git a/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html b/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html new file mode 100644 index 000000000..44cf89fab --- /dev/null +++ b/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: utilities Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
utilities Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html b/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html new file mode 100644 index 000000000..268bb05dc --- /dev/null +++ b/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: collider Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
collider Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html b/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html new file mode 100644 index 000000000..8d704121b --- /dev/null +++ b/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html b/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html new file mode 100644 index 000000000..794330064 --- /dev/null +++ b/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: wasm Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
wasm Directory Reference
+
+
+ + + + +

+Files

 helpers.cpp
 
+
+
+ + + + diff --git a/docs/html/dir_ad6676c85f8243771b2b955151a944c1.html b/docs/html/dir_ad6676c85f8243771b2b955151a944c1.html new file mode 100644 index 000000000..416e20136 --- /dev/null +++ b/docs/html/dir_ad6676c85f8243771b2b955151a944c1.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + + + + + +

+Files

 conv.h
 
 manifoldc.h
 
 types.h
 
+
+
+ + + + diff --git a/docs/html/dir_bec6917ed0ee86d39288c395bdef2150.html b/docs/html/dir_bec6917ed0ee86d39288c395bdef2150.html new file mode 100644 index 000000000..4016fc71d --- /dev/null +++ b/docs/html/dir_bec6917ed0ee86d39288c395bdef2150.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: python Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
python Directory Reference
+
+
+ + + + +

+Directories

 examples
 
+
+
+ + + + diff --git a/docs/html/dir_c5bd9479356315758215f331b902faba.html b/docs/html/dir_c5bd9479356315758215f331b902faba.html new file mode 100644 index 000000000..f613a8811 --- /dev/null +++ b/docs/html/dir_c5bd9479356315758215f331b902faba.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + +

+Directories

 manifold
 
+
+
+ + + + diff --git a/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html b/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html new file mode 100644 index 000000000..64a66513d --- /dev/null +++ b/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html b/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html new file mode 100644 index 000000000..b436dedf8 --- /dev/null +++ b/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Directories

 src
 
+
+
+ + + + diff --git a/docs/html/dir_e04d1e92cddc811868891c497dd4570a.html b/docs/html/dir_e04d1e92cddc811868891c497dd4570a.html new file mode 100644 index 000000000..f39fbafb5 --- /dev/null +++ b/docs/html/dir_e04d1e92cddc811868891c497dd4570a.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Files

 cross_section.h
 
+
+
+ + + + diff --git a/docs/html/dir_e0f73a2e8ebc281e7c1a2507b3f39b17.html b/docs/html/dir_e0f73a2e8ebc281e7c1a2507b3f39b17.html new file mode 100644 index 000000000..0daeac3f2 --- /dev/null +++ b/docs/html/dir_e0f73a2e8ebc281e7c1a2507b3f39b17.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: documents Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
documents Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_e399f696b862bd158a5664316cc046f2.html b/docs/html/dir_e399f696b862bd158a5664316cc046f2.html new file mode 100644 index 000000000..c0b719e14 --- /dev/null +++ b/docs/html/dir_e399f696b862bd158a5664316cc046f2.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + +

+Files

 manifold.h
 
+
+
+ + + + diff --git a/docs/html/dir_e600baf0cd831db43dc31cc567702ce1.html b/docs/html/dir_e600baf0cd831db43dc31cc567702ce1.html new file mode 100644 index 000000000..ef0152694 --- /dev/null +++ b/docs/html/dir_e600baf0cd831db43dc31cc567702ce1.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: meshIO Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
meshIO Directory Reference
+
+
+ + + + +

+Directories

 src
 
+
+
+ + + + diff --git a/docs/html/doc.svg b/docs/html/doc.svg new file mode 100644 index 000000000..0b928a531 --- /dev/null +++ b/docs/html/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/html/docd.svg b/docs/html/docd.svg new file mode 100644 index 000000000..ac18b2755 --- /dev/null +++ b/docs/html/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css new file mode 100644 index 000000000..009a9b554 --- /dev/null +++ b/docs/html/doxygen.css @@ -0,0 +1,2045 @@ +/* The standard CSS for doxygen 1.9.8*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; +--fold-line-color: #808080; +--fold-minus-image: url('minus.svg'); +--fold-plus-image: url('plus.svg'); +--fold-minus-image-relpath: url('../../minus.svg'); +--fold-plus-image-relpath: url('../../plus.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; +--fold-minus-image: url('minusd.svg'); +--fold-plus-image: url('plusd.svg'); +--fold-minus-image-relpath: url('../../minusd.svg'); +--fold-plus-image-relpath: url('../../plusd.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--glow-color); +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +a:hover { + text-decoration: underline; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: var(--code-link-color); +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: var(--font-family-monospace); + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); +} + +div.line { + font-family: var(--font-family-monospace); + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); +} + +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); +} + +span.lineno a:hover { + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: var(--page-foreground-color); + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: var(--code-keyword-color); +} + +span.keywordtype { + color: var(--code-type-keyword-color); +} + +span.keywordflow { + color: var(--code-flow-keyword-color); +} + +span.comment { + color: var(--code-comment-color); +} + +span.preprocessor { + color: var(--code-preprocessor-color); +} + +span.stringliteral { + color: var(--code-string-literal-color); +} + +span.charliteral { + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); +} + +span.vhdldigit { + color: var(--code-vhdl-digit-color); +} + +span.vhdlchar { + color: var(--code-vhdl-char-color); +} + +span.vhdlkeyword { + color: var(--code-vhdl-keyword-color); +} + +span.vhdllogic { + color: var(--code-vhdl-logic-color); +} + +blockquote { + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid var(--table-cell-border-color); +} + +th.dirtab { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid var(--separator-color); +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: var(--memdecl-background-color); + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: var(--memdecl-foreground-color); +} + +.memSeparator { + border-bottom: 1px solid var(--memdecl-separator-color); + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: var(--memdecl-template-color); + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: var(--memdef-title-gradient-image); + background-repeat: repeat-x; + background-color: var(--memdef-title-background-color); + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: var(--memdef-template-color); + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px var(--glow-color); +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: var(--font-family-monospace); + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: var(--memdef-doc-background-color); + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: var(--memdef-param-name-color); + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); + text-shadow: none; + color: var(--label-foreground-color); + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + +.directory tr.even { + padding-left: 6px; + background-color: var(--index-even-item-bg-color); +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: var(--page-link-color); +} + +.arrow { + color: var(--nav-arrow-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-open-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-closed-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-doc-image); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: var(--footer-foreground-color); +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid var(--memdef-border-color); +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: var(--memdef-title-gradient-image); + background-repeat:repeat-x; + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: var(--nav-gradient-image); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: var(--nav-gradient-image); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:var(--nav-breadcrumb-image); + background-repeat:no-repeat; + background-position:right; + color: var(--nav-foreground-color); +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: var(--footer-foreground-color); + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: var(--header-gradient-image); + background-repeat:repeat-x; + background-color: var(--header-background-color); + margin: 0px; + border-bottom: 1px solid var(--header-separator-color); +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: var(--font-family-title); + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 15px; +} + +div.toc li.level4 { + margin-left: 15px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: var(--inherit-header-color); + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); + border-radius: 4px 4px 4px 4px; + box-shadow: var(--tooltip-shadow); + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: var(--tooltip-doc-color); + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: var(--tooltip-link-color); +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: var(--tooltip-declaration-color); +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/docs/html/doxygen.svg b/docs/html/doxygen.svg new file mode 100644 index 000000000..79a763540 --- /dev/null +++ b/docs/html/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/dynsections.js b/docs/html/dynsections.js new file mode 100644 index 000000000..b73c82889 --- /dev/null +++ b/docs/html/dynsections.js @@ -0,0 +1,192 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + var id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + var start = $(this).attr('data-start'); + var end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + var line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); +} + +/* @license-end */ diff --git a/docs/html/folderclosed.svg b/docs/html/folderclosed.svg new file mode 100644 index 000000000..b04bed2e7 --- /dev/null +++ b/docs/html/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/docs/html/folderclosedd.svg b/docs/html/folderclosedd.svg new file mode 100644 index 000000000..52f0166a2 --- /dev/null +++ b/docs/html/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/docs/html/folderopen.svg b/docs/html/folderopen.svg new file mode 100644 index 000000000..f6896dd25 --- /dev/null +++ b/docs/html/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/docs/html/folderopend.svg b/docs/html/folderopend.svg new file mode 100644 index 000000000..2d1f06e7b --- /dev/null +++ b/docs/html/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/html/functions.html b/docs/html/functions.html new file mode 100644 index 000000000..80d02b946 --- /dev/null +++ b/docs/html/functions.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+
+
+ + + + diff --git a/docs/html/functions_b.html b/docs/html/functions_b.html new file mode 100644 index 000000000..61f4d355b --- /dev/null +++ b/docs/html/functions_b.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- b -

+
+
+ + + + diff --git a/docs/html/functions_c.html b/docs/html/functions_c.html new file mode 100644 index 000000000..4ef0334a9 --- /dev/null +++ b/docs/html/functions_c.html @@ -0,0 +1,129 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- c -

+
+
+ + + + diff --git a/docs/html/functions_d.html b/docs/html/functions_d.html new file mode 100644 index 000000000..07172b4b3 --- /dev/null +++ b/docs/html/functions_d.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- d -

+
+
+ + + + diff --git a/docs/html/functions_dup.js b/docs/html/functions_dup.js new file mode 100644 index 000000000..9057317a5 --- /dev/null +++ b/docs/html/functions_dup.js @@ -0,0 +1,24 @@ +var functions_dup = +[ + [ "a", "functions.html", null ], + [ "b", "functions_b.html", null ], + [ "c", "functions_c.html", null ], + [ "d", "functions_d.html", null ], + [ "e", "functions_e.html", null ], + [ "f", "functions_f.html", null ], + [ "g", "functions_g.html", null ], + [ "h", "functions_h.html", null ], + [ "i", "functions_i.html", null ], + [ "j", "functions_j.html", null ], + [ "l", "functions_l.html", null ], + [ "m", "functions_m.html", null ], + [ "n", "functions_n.html", null ], + [ "o", "functions_o.html", null ], + [ "p", "functions_p.html", null ], + [ "r", "functions_r.html", null ], + [ "s", "functions_s.html", null ], + [ "t", "functions_t.html", null ], + [ "u", "functions_u.html", null ], + [ "v", "functions_v.html", null ], + [ "w", "functions_w.html", null ] +]; \ No newline at end of file diff --git a/docs/html/functions_e.html b/docs/html/functions_e.html new file mode 100644 index 000000000..0f3061a71 --- /dev/null +++ b/docs/html/functions_e.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- e -

+
+
+ + + + diff --git a/docs/html/functions_enum.html b/docs/html/functions_enum.html new file mode 100644 index 000000000..8bd4835cf --- /dev/null +++ b/docs/html/functions_enum.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: Class Members - Enumerations + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented enums with links to the class documentation for each member:
+
+
+ + + + diff --git a/docs/html/functions_f.html b/docs/html/functions_f.html new file mode 100644 index 000000000..d4446dc8c --- /dev/null +++ b/docs/html/functions_f.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- f -

+
+
+ + + + diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html new file mode 100644 index 000000000..2b43ed74b --- /dev/null +++ b/docs/html/functions_func.html @@ -0,0 +1,309 @@ + + + + + + + +Manifold: Class Members - Functions + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented functions with links to the class documentation for each member:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+
+
+ + + + diff --git a/docs/html/functions_g.html b/docs/html/functions_g.html new file mode 100644 index 000000000..022c75cc6 --- /dev/null +++ b/docs/html/functions_g.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- g -

+
+
+ + + + diff --git a/docs/html/functions_h.html b/docs/html/functions_h.html new file mode 100644 index 000000000..597b20a15 --- /dev/null +++ b/docs/html/functions_h.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- h -

+
+
+ + + + diff --git a/docs/html/functions_i.html b/docs/html/functions_i.html new file mode 100644 index 000000000..c77755753 --- /dev/null +++ b/docs/html/functions_i.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- i -

+
+
+ + + + diff --git a/docs/html/functions_j.html b/docs/html/functions_j.html new file mode 100644 index 000000000..32c20c0f5 --- /dev/null +++ b/docs/html/functions_j.html @@ -0,0 +1,113 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- j -

+
+
+ + + + diff --git a/docs/html/functions_l.html b/docs/html/functions_l.html new file mode 100644 index 000000000..a79436dea --- /dev/null +++ b/docs/html/functions_l.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- l -

+
+
+ + + + diff --git a/docs/html/functions_m.html b/docs/html/functions_m.html new file mode 100644 index 000000000..ffa733d41 --- /dev/null +++ b/docs/html/functions_m.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- m -

+
+
+ + + + diff --git a/docs/html/functions_n.html b/docs/html/functions_n.html new file mode 100644 index 000000000..ce45655f6 --- /dev/null +++ b/docs/html/functions_n.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- n -

+
+
+ + + + diff --git a/docs/html/functions_o.html b/docs/html/functions_o.html new file mode 100644 index 000000000..1182b820c --- /dev/null +++ b/docs/html/functions_o.html @@ -0,0 +1,124 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- o -

+
+
+ + + + diff --git a/docs/html/functions_p.html b/docs/html/functions_p.html new file mode 100644 index 000000000..cf9051871 --- /dev/null +++ b/docs/html/functions_p.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- p -

+
+
+ + + + diff --git a/docs/html/functions_r.html b/docs/html/functions_r.html new file mode 100644 index 000000000..abaab1aa7 --- /dev/null +++ b/docs/html/functions_r.html @@ -0,0 +1,124 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- r -

+
+
+ + + + diff --git a/docs/html/functions_s.html b/docs/html/functions_s.html new file mode 100644 index 000000000..d25cd0cd0 --- /dev/null +++ b/docs/html/functions_s.html @@ -0,0 +1,137 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- s -

+
+
+ + + + diff --git a/docs/html/functions_t.html b/docs/html/functions_t.html new file mode 100644 index 000000000..253b5b037 --- /dev/null +++ b/docs/html/functions_t.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- t -

+
+
+ + + + diff --git a/docs/html/functions_u.html b/docs/html/functions_u.html new file mode 100644 index 000000000..dbdf507eb --- /dev/null +++ b/docs/html/functions_u.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- u -

+
+
+ + + + diff --git a/docs/html/functions_v.html b/docs/html/functions_v.html new file mode 100644 index 000000000..66c50706d --- /dev/null +++ b/docs/html/functions_v.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- v -

+
+
+ + + + diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html new file mode 100644 index 000000000..9ab7d856a --- /dev/null +++ b/docs/html/functions_vars.html @@ -0,0 +1,194 @@ + + + + + + + +Manifold: Class Members - Variables + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented variables with links to the class documentation for each member:
+ +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+
+
+ + + + diff --git a/docs/html/functions_w.html b/docs/html/functions_w.html new file mode 100644 index 000000000..f47143980 --- /dev/null +++ b/docs/html/functions_w.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- w -

+
+
+ + + + diff --git a/docs/html/group___connections.html b/docs/html/group___connections.html new file mode 100644 index 000000000..21eebca7b --- /dev/null +++ b/docs/html/group___connections.html @@ -0,0 +1,610 @@ + + + + + + + +Manifold: Connections + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Connections
+
+
+ +

Move data in and out of the Manifold class. +More...

+ + + + + + + + + + + + + + + + +

+Classes

struct  MeshGL
 
struct  Mesh
 
struct  Smoothness
 
struct  Properties
 
struct  Box
 
struct  Rect
 
struct  SVDSet
 
+ + + + + +

+Typedefs

using SimplePolygon = std::vector< vec2 >
 
using Polygons = std::vector< SimplePolygon >
 
+ + + + + + + + + + + + + + + + + + +

+Functions

double sind (double x)
 
double cosd (double x)
 
mat4x3 RotateUp (vec3 up)
 
int CCW (vec2 p0, vec2 p1, vec2 p2, double tol)
 
SVDSet SVD (mat3 A)
 
double SpectralNorm (mat3 A)
 
std::vector< ivec3 > Triangulate (const Polygons &polygons, double precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
+ExecutionParamsPolygonParams ()
 
+

Detailed Description

+

Move data in and out of the Manifold class.

+

Class Documentation

+ +

◆ manifold::Mesh

+ +
+
+ + + + +
struct manifold::Mesh
+
+

The triangle-mesh input and output of this library.

+
+ + + + + + + + + + + + + + + + +
Class Members
+vector< vec3 > +vertPos +Required: The X-Y-Z positions of all vertices.
+vector< ivec3 > +triVerts +

Required: The vertex indices of the three triangle corners in CCW (from the outside) order, for each triangle.

+
+vector< vec3 > +vertNormal +

Optional: The X-Y-Z normal vectors of each vertex. If non-empty, must have the same length as vertPos. If empty, these will be calculated automatically.

+
+vector< vec4 > +halfedgeTangent +

Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If non-empty, must be exactly three times as long as Mesh.triVerts. Indexed as 3 * tri + i, representing the tangent from Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted.

+
+double +precision = 0 +

The absolute precision of the vertex positions, based on accrued rounding errors. When creating a Manifold, the precision used will be the maximum of this and a baseline precision from the size of the bounding box. Any edge shorter than precision may be collapsed.

+
+ +
+
+ +

◆ manifold::Smoothness

+ +
+
+ + + + +
struct manifold::Smoothness
+
+

Defines which edges to sharpen and how much for the Manifold.Smooth() constructor.

+
+ + + + + + + +
Class Members
+size_t +halfedge +The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i].
+double +smoothness +

A value between 0 and 1, where 0 is sharp and 1 is the default and the curvature is interpolated between these values. The two paired halfedges can have different values while maintaining C-1 continuity (except for 0).

+
+ +
+
+ +

◆ manifold::Properties

+ +
+
+ + + + +
struct manifold::Properties
+
+

Geometric properties of the manifold, created with Manifold.GetProperties().

+
+ + + + + + + +
Class Members
+double +surfaceArea +
+double +volume +
+ +
+
+ +

◆ manifold::SVDSet

+ +
+
+ + + + +
struct manifold::SVDSet
+
+

The three matrices of a Singular Value Decomposition.

+
+ + + + + + + + + + +
Class Members
+mat3 +U +
+mat3 +S +
+mat3 +V +
+ +
+
+

Typedef Documentation

+ +

◆ SimplePolygon

+ +
+
+ + + + +
using SimplePolygon = std::vector<vec2>
+
+

Single polygon contour, wound CCW. First and last point are implicitly connected. Should ensure all input is ε-valid.

+ +
+
+ +

◆ Polygons

+ +
+
+ + + + +
using Polygons = std::vector<SimplePolygon>
+
+

Set of polygons with holes. Order of contours is arbitrary. Can contain any depth of nested holes and any number of separate polygons. Should ensure all input is ε-valid.

+ +
+
+

Function Documentation

+ +

◆ Triangulate()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::vector< ivec3 > Triangulate (const Polygonspolygons,
double precision 
)
+
+ +

Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.

+
Parameters
+ + + +
polygonsThe set of polygons, wound CCW and representing multiple polygons and/or holes.
precisionThe value of ε, bounding the uncertainty of the input.
+
+
+
Returns
std::vector<ivec3> The triangles, referencing the original polygon points in order.
+ +
+
+ +

◆ sind()

+ +
+
+ + + + + +
+ + + + + + + + +
double sind (double x)
+
+inline
+
+

Sine function where multiples of 90 degrees come out exact.

+
Parameters
+ + +
xAngle in degrees.
+
+
+ +
+
+ +

◆ cosd()

+ +
+
+ + + + + +
+ + + + + + + + +
double cosd (double x)
+
+inline
+
+

Cosine function where multiples of 90 degrees come out exact.

+
Parameters
+ + +
xAngle in degrees.
+
+
+ +
+
+ +

◆ RotateUp()

+ +
+
+ + + + + +
+ + + + + + + + +
mat4x3 RotateUp (vec3 up)
+
+inline
+
+

This 4x3 matrix can be used as an input to Manifold.Transform() to turn an object. Turns along the shortest path from given up-vector to (0, 0, 1).

+
Parameters
+ + +
upThe vector to be turned to point upwards. Length does not matter.
+
+
+ +
+
+ +

◆ CCW()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int CCW (vec2 p0,
vec2 p1,
vec2 p2,
double tol 
)
+
+inline
+
+

Determines if the three points are wound counter-clockwise, clockwise, or colinear within the specified tolerance.

+
Parameters
+ + + + + +
p0First point
p1Second point
p2Third point
tolTolerance value for colinearity
+
+
+
Returns
int, like Signum, this returns 1 for CCW, -1 for CW, and 0 if within tol of colinear.
+ +
+
+ +

◆ SVD()

+ +
+
+ + + + + +
+ + + + + + + + +
SVDSet SVD (mat3 A)
+
+inline
+
+

Returns the Singular Value Decomposition of A: A = U * S * glm::transpose(V).

+
Parameters
+ + +
AThe matrix to decompose.
+
+
+ +
+
+ +

◆ SpectralNorm()

+ +
+
+ + + + + +
+ + + + + + + + +
double SpectralNorm (mat3 A)
+
+inline
+
+

Returns the largest singular value of A.

+
Parameters
+ + +
AThe matrix to measure.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/group___connections.js b/docs/html/group___connections.js new file mode 100644 index 000000000..7108d746a --- /dev/null +++ b/docs/html/group___connections.js @@ -0,0 +1,81 @@ +var group___connections = +[ + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", [ + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed", null ], + [ "NumVert", "structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658", null ], + [ "NumTri", "structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6", null ], + [ "Merge", "structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254", null ], + [ "numProp", "structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75", null ], + [ "vertProperties", "structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983", null ], + [ "triVerts", "structmanifold_1_1_mesh_g_l.html#afe0601a32ce917d3324b430a34f5d118", null ], + [ "mergeFromVert", "structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078", null ], + [ "mergeToVert", "structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a", null ], + [ "runIndex", "structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4", null ], + [ "runOriginalID", "structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0", null ], + [ "runTransform", "structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20", null ], + [ "faceID", "structmanifold_1_1_mesh_g_l.html#ac6e7182a9cef30c9644ee167fbff30e1", null ], + [ "halfedgeTangent", "structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5", null ], + [ "precision", "structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141", null ] + ] ], + [ "Mesh", "group___connections.html#structmanifold_1_1_mesh", [ + [ "vertPos", "group___connections.html#a69e541f12f1d8d7c134608c71441bd1f", null ], + [ "triVerts", "group___connections.html#a83058b9f3f25723fef242bd276e44c01", null ], + [ "vertNormal", "group___connections.html#ab2b1aacb347ab6a07a588e953cf4910d", null ], + [ "halfedgeTangent", "group___connections.html#a967a4893f0c99198fe00c01c6c446d85", null ], + [ "precision", "group___connections.html#a98ce42142601aa81694132ce8af84e8b", null ] + ] ], + [ "Smoothness", "group___connections.html#structmanifold_1_1_smoothness", [ + [ "halfedge", "group___connections.html#aac5709f1a46385ba2978c8184909a8f9", null ], + [ "smoothness", "group___connections.html#af27647008768bbb6d067a4342dad9001", null ] + ] ], + [ "Properties", "group___connections.html#structmanifold_1_1_properties", null ], + [ "Box", "structmanifold_1_1_box.html", [ + [ "Box", "structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5", null ], + [ "Box", "structmanifold_1_1_box.html#a8258a064a735f0c191bab31d0775912d", null ], + [ "Size", "structmanifold_1_1_box.html#ac7f1d96c2e44bdff4079fd40802e2ac6", null ], + [ "Center", "structmanifold_1_1_box.html#ac600d9d9003333be36f390c84dead39e", null ], + [ "Scale", "structmanifold_1_1_box.html#ab30d1e52df44eb451081926df999fc17", null ], + [ "Contains", "structmanifold_1_1_box.html#aa51dc69603c0f65eca337672c9455b5c", null ], + [ "Contains", "structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d", null ], + [ "Union", "structmanifold_1_1_box.html#a9605138c461b1e437e59a71e1aa34653", null ], + [ "Union", "structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd", null ], + [ "Transform", "structmanifold_1_1_box.html#ac57a6312e33544515f782970a3b66eb6", null ], + [ "operator+", "structmanifold_1_1_box.html#af682637d259e4850c42bbe1d1ad98491", null ], + [ "operator+=", "structmanifold_1_1_box.html#ad243f3e9cd636fcd4dfe7c374d0e00c4", null ], + [ "operator*", "structmanifold_1_1_box.html#a0993fea81be0170878dfec3abce2e6dc", null ], + [ "operator*=", "structmanifold_1_1_box.html#ab0ec4bdbe1a152a83073874d2d62db67", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#aaa691916d71188bf3256e204393e8aa7", null ], + [ "IsFinite", "structmanifold_1_1_box.html#a33b7dcc502aae627fbc56bcfecf33af1", null ] + ] ], + [ "Rect", "structmanifold_1_1_rect.html", [ + [ "Rect", "structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22", null ], + [ "Rect", "structmanifold_1_1_rect.html#a4b37d0f1743973da4b1b82d32ed26dfd", null ], + [ "Size", "structmanifold_1_1_rect.html#a8b0310b471c0b5898fb21d12b00eac81", null ], + [ "Area", "structmanifold_1_1_rect.html#ac84b151a969c68d662637e8245548666", null ], + [ "Scale", "structmanifold_1_1_rect.html#ab30d1e52df44eb451081926df999fc17", null ], + [ "Center", "structmanifold_1_1_rect.html#ac73874c64476da0c5d9f3f11c096826d", null ], + [ "Contains", "structmanifold_1_1_rect.html#ab1e5f154a88928d5a6b89ff0e4b2c0b6", null ], + [ "Contains", "structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6", null ], + [ "DoesOverlap", "structmanifold_1_1_rect.html#ae9b86c34e407f27313804c9a7d30c8c2", null ], + [ "IsEmpty", "structmanifold_1_1_rect.html#a8e12342fc420701fbffd97025421575a", null ], + [ "IsFinite", "structmanifold_1_1_rect.html#a33b7dcc502aae627fbc56bcfecf33af1", null ], + [ "Union", "structmanifold_1_1_rect.html#aab08573b89e6715df6a1b0e1c4222e8d", null ], + [ "Union", "structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70", null ], + [ "operator+", "structmanifold_1_1_rect.html#a6fe10cfc3aa4a6bd44cf8867639aff2b", null ], + [ "operator+=", "structmanifold_1_1_rect.html#ae56ad379896fd93dc3e41ab719a52c87", null ], + [ "operator*", "structmanifold_1_1_rect.html#a7f518b4df73d824dfa9117e1e0137082", null ], + [ "operator*=", "structmanifold_1_1_rect.html#a02fcd8a4fd938f130493a48349dcbabe", null ], + [ "Transform", "structmanifold_1_1_rect.html#a16290599b6b48837a6695ae030d288af", null ] + ] ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "SimplePolygon", "group___connections.html#gac63dd7235f7caf5698ab44acb83ba362", null ], + [ "Polygons", "group___connections.html#ga60a66d8ddacc086bb45d8afc37f646d1", null ], + [ "Triangulate", "group___connections.html#ga096515808119cda3b6aff7ab31bf6355", null ], + [ "sind", "group___connections.html#gacbb1fe7fd1a4e41a0754ed80abaa593d", null ], + [ "cosd", "group___connections.html#gac61fa065167cefe7117d0064744c7a52", null ], + [ "RotateUp", "group___connections.html#ga7035018814a651a22f8bb32b84e6820f", null ], + [ "CCW", "group___connections.html#ga92f3267a3f49fa8b9199570c3adcbfb7", null ], + [ "SVD", "group___connections.html#gad55150a21602b41346eb9a1477131fe7", null ], + [ "SpectralNorm", "group___connections.html#ga6f4bce48eb47e3fe5e0d05c6e7ed0d05", null ] +]; \ No newline at end of file diff --git a/docs/html/group___connections_structmanifold_1_1_mesh.js b/docs/html/group___connections_structmanifold_1_1_mesh.js new file mode 100644 index 000000000..5b8b33879 --- /dev/null +++ b/docs/html/group___connections_structmanifold_1_1_mesh.js @@ -0,0 +1,8 @@ +var group___connections_structmanifold_1_1_mesh = +[ + [ "vertPos", "group___connections.html#a69e541f12f1d8d7c134608c71441bd1f", null ], + [ "triVerts", "group___connections.html#a83058b9f3f25723fef242bd276e44c01", null ], + [ "vertNormal", "group___connections.html#ab2b1aacb347ab6a07a588e953cf4910d", null ], + [ "halfedgeTangent", "group___connections.html#a967a4893f0c99198fe00c01c6c446d85", null ], + [ "precision", "group___connections.html#a98ce42142601aa81694132ce8af84e8b", null ] +]; \ No newline at end of file diff --git a/docs/html/group___connections_structmanifold_1_1_smoothness.js b/docs/html/group___connections_structmanifold_1_1_smoothness.js new file mode 100644 index 000000000..c88e18150 --- /dev/null +++ b/docs/html/group___connections_structmanifold_1_1_smoothness.js @@ -0,0 +1,5 @@ +var group___connections_structmanifold_1_1_smoothness = +[ + [ "halfedge", "group___connections.html#aac5709f1a46385ba2978c8184909a8f9", null ], + [ "smoothness", "group___connections.html#af27647008768bbb6d067a4342dad9001", null ] +]; \ No newline at end of file diff --git a/docs/html/group___core.html b/docs/html/group___core.html new file mode 100644 index 000000000..ec1df206f --- /dev/null +++ b/docs/html/group___core.html @@ -0,0 +1,253 @@ + + + + + + + +Manifold: Core + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Core
+
+
+ +

The central classes of the library. +More...

+ + + + + + + + +

+Classes

class  CrossSection
 
class  Manifold
 
class  Quality
 
+ + + +

+Enumerations

enum class  OpType { Add +, Subtract +, Intersect + }
 
+ + + + + + + +

+Variables

+constexpr int DEFAULT_SEGMENTS = 0
 
+constexpr double DEFAULT_ANGLE = 10.0
 
+constexpr double DEFAULT_LENGTH = 1.0
 
+ + + + +

Creation

Constructors

+
static Manifold LevelSet (std::function< double(vec3)> sdf, Box bounds, double edgeLength, double level=0, double precision=-1, bool canParallel=true)
 
+

Detailed Description

+

The central classes of the library.

+

Enumeration Type Documentation

+ +

◆ OpType

+ +
+
+ + + + + +
+ + + + +
enum class OpType
+
+strong
+
+

Boolean operation type: Add (Union), Subtract (Difference), and Intersect.

+ +
+
+

Function Documentation

+ +

◆ LevelSet()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Manifold LevelSet (std::function< double(vec3)> sdf,
Box bounds,
double edgeLength,
double level = 0,
double precision = -1,
bool canParallel = true 
)
+
+static
+
+

Constructs a level-set MeshGL from the input Signed-Distance Function (SDF). This uses a form of Marching Tetrahedra (akin to Marching Cubes, but better for manifoldness). Instead of using a cubic grid, it uses a body-centered cubic grid (two shifted cubic grids). This means if your function's interior exceeds the given bounds, you will see a kind of egg-crate shape closing off the manifold, which is due to the underlying grid.

+
Parameters
+ + + + + + + +
sdfThe signed-distance functor, containing this function signature: double operator()(vec3 point), which returns the signed distance of a given point in R^3. Positive values are inside, negative outside.
boundsAn axis-aligned box that defines the extent of the grid.
edgeLengthApproximate maximum edge length of the triangles in the final result. This affects grid spacing, and hence has a strong effect on performance.
levelYou can inset your Mesh by using a positive value, or outset it with a negative value.
precisionEnsure each vertex is within this distance of the true surface. Defaults to -1, which will return the interpolated crossing-point based on the two nearest grid points. Small positive values will require more sdf evaluations per output vertex.
canParallelParallel policies violate will crash language runtimes with runtime locks that expect to not be called back by unregistered threads. This allows bindings use LevelSet despite being compiled with MANIFOLD_PAR active.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/group___core.js b/docs/html/group___core.js new file mode 100644 index 000000000..618bee0c3 --- /dev/null +++ b/docs/html/group___core.js @@ -0,0 +1,100 @@ +var group___core = +[ + [ "CrossSection", "classmanifold_1_1_cross_section.html", [ + [ "FillRule", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4", [ + [ "EvenOdd", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390", null ], + [ "NonZero", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a", null ], + [ "Positive", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147", null ], + [ "Negative", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b", null ] + ] ], + [ "JoinType", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d", [ + [ "Square", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304", null ], + [ "Round", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c", null ], + [ "Miter", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514", null ] + ] ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2", null ], + [ "Area", "classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666", null ], + [ "NumVert", "classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumContour", "classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c", null ], + [ "IsEmpty", "classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Bounds", "classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c", null ], + [ "Translate", "classmanifold_1_1_cross_section.html#a38bcb89b28140acbceca56f0bbda67b9", null ], + [ "Rotate", "classmanifold_1_1_cross_section.html#a794f36c935736ecf71806fb3ccd46956", null ], + [ "Scale", "classmanifold_1_1_cross_section.html#ad0f8a0ea9c4e2394bc4808dfb7ae1c69", null ], + [ "Mirror", "classmanifold_1_1_cross_section.html#a3bdcbaf979a769af24a9d61624e639e8", null ], + [ "Transform", "classmanifold_1_1_cross_section.html#a534ac4a433b68882dba4919ade75946c", null ], + [ "Warp", "classmanifold_1_1_cross_section.html#ac50618697f91880859f4d536f2569b5e", null ], + [ "WarpBatch", "classmanifold_1_1_cross_section.html#a2d4ae264fded90c78cf750ad0dbea33a", null ], + [ "Simplify", "classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf", null ], + [ "Offset", "classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a", null ], + [ "Boolean", "classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2", null ], + [ "operator+", "classmanifold_1_1_cross_section.html#a347c593a12693ee05159b34db0957580", null ], + [ "operator+=", "classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a", null ], + [ "operator-", "classmanifold_1_1_cross_section.html#af6a000221ca368c9f2ed3e1f271cfb7f", null ], + [ "operator-=", "classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0", null ], + [ "operator^", "classmanifold_1_1_cross_section.html#a34fcc007d18275e2cc32f4c99bc94cda", null ], + [ "operator^=", "classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3", null ], + [ "Decompose", "classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c", null ], + [ "Hull", "classmanifold_1_1_cross_section.html#aa5ea1caf54ddac72d939a00d13763ace", null ], + [ "ToPolygons", "classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2", null ] + ] ], + [ "Manifold", "classmanifold_1_1_manifold.html", [ + [ "Manifold", "classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea", null ], + [ "Decompose", "classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106", null ], + [ "GetMesh", "classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750", null ], + [ "GetMeshGL", "classmanifold_1_1_manifold.html#a3711c029f2c9fe2d152455981a3b2d73", null ], + [ "IsEmpty", "classmanifold_1_1_manifold.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Status", "classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d", null ], + [ "NumVert", "classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumEdge", "classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a", null ], + [ "NumTri", "classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6", null ], + [ "NumProp", "classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348", null ], + [ "NumPropVert", "classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d", null ], + [ "BoundingBox", "classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67", null ], + [ "Precision", "classmanifold_1_1_manifold.html#aef800826805cb6d90d03846fdb12c3e3", null ], + [ "Genus", "classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1", null ], + [ "GetProperties", "classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07", null ], + [ "MinGap", "classmanifold_1_1_manifold.html#a1b7ab47f4da039eb3dff5b46ba71658b", null ], + [ "OriginalID", "classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6", null ], + [ "AsOriginal", "classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57", null ], + [ "Translate", "classmanifold_1_1_manifold.html#a78fbea69555ea755f8731255060f7c9d", null ], + [ "Scale", "classmanifold_1_1_manifold.html#aa6153eb69d3a69e38e6508bf58449f04", null ], + [ "Rotate", "classmanifold_1_1_manifold.html#a7f74bf3b7c5dd34e84b82e7738fd25ff", null ], + [ "Transform", "classmanifold_1_1_manifold.html#af4459c0e7355b2805b2694da075c8346", null ], + [ "Mirror", "classmanifold_1_1_manifold.html#ad76d89178ca970900c81f2927f8c7f11", null ], + [ "Warp", "classmanifold_1_1_manifold.html#a5366f7082adcbb2be63fcf2b4c57eb51", null ], + [ "WarpBatch", "classmanifold_1_1_manifold.html#a7825d52e3102cc6e7d48a19f9ea0b468", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a6a852721876d6fce2136ac27e7377f8e", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "CalculateNormals", "classmanifold_1_1_manifold.html#ab6c0e49ed98c9c03bc1324d4ff8452ce", null ], + [ "SmoothByNormals", "classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4", null ], + [ "SmoothOut", "classmanifold_1_1_manifold.html#a0b59680c4bc2300e0e12713ab220d3d5", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", null ], + [ "RefineToLength", "classmanifold_1_1_manifold.html#a1381728e52975862d954032f717106d5", null ], + [ "Boolean", "classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df", null ], + [ "operator+", "classmanifold_1_1_manifold.html#af95e73e5427d09b9d9e025d5cf367c30", null ], + [ "operator+=", "classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688", null ], + [ "operator-", "classmanifold_1_1_manifold.html#ad9da8c505e6846e9645008825833e1da", null ], + [ "operator-=", "classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b", null ], + [ "operator^", "classmanifold_1_1_manifold.html#ad1e4e5720f01934c44aebc597be4d104", null ], + [ "operator^=", "classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522", null ], + [ "Split", "classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba", null ], + [ "SplitByPlane", "classmanifold_1_1_manifold.html#a40c2716b965886e4fb952e5ade866a5a", null ], + [ "TrimByPlane", "classmanifold_1_1_manifold.html#aa8d62161da6e94da7651418c33c3e294", null ], + [ "Slice", "classmanifold_1_1_manifold.html#ad03837de2290a269fa14e0773c9913fa", null ], + [ "Project", "classmanifold_1_1_manifold.html#a328657b69e9bbaaee148572ca314677c", null ], + [ "Hull", "classmanifold_1_1_manifold.html#a9dc9e00112e2b063cfa6fe8482b1afe8", null ], + [ "MatchesTriNormals", "classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7", null ], + [ "NumDegenerateTris", "classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66", null ], + [ "NumOverlaps", "classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704", null ] + ] ], + [ "Quality", "classmanifold_1_1_quality.html", null ], + [ "OpType", "group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969", null ], + [ "LevelSet", "group___core.html#ga359e374df5225fef63061f32718e2fb3", null ] +]; \ No newline at end of file diff --git a/docs/html/group___debug.html b/docs/html/group___debug.html new file mode 100644 index 000000000..ce9298b59 --- /dev/null +++ b/docs/html/group___debug.html @@ -0,0 +1,269 @@ + + + + + + + +Manifold: Debug + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Debug
+
+
+ +

Debugging features. +More...

+ + + + + +

+Modules

 Exceptions
 Custom Exceptions.
 
+ + + +

+Classes

struct  ExecutionParams
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

ExecutionParamsManifoldParams ()
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec2< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec3< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec4< T > &v)
 
+std::ostream & operator<< (std::ostream &stream, const mat3 &mat)
 
+std::ostream & operator<< (std::ostream &stream, const mat4x3 &mat)
 
+std::ostream & operator<< (std::ostream &stream, const Box &box)
 
+std::ostream & operator<< (std::ostream &stream, const Rect &box)
 
template<typename T >
void Dump (const std::vector< T > &vec)
 
+template<typename T >
void Diff (const std::vector< T > &a, const std::vector< T > &b)
 
+

Detailed Description

+

Debugging features.

+

The features require compiler flags to be enabled. Assertions are enabled with the MANIFOLD_DEBUG flag and then controlled with ExecutionParams. Exceptions are only thrown if the MANIFOLD_EXCEPTIONS flag is set. Import and Export of 3D models is only supported with the MANIFOLD_EXPORT flag, which also requires linking in the Assimp dependency.

+

Class Documentation

+ +

◆ manifold::ExecutionParams

+ +
+
+ + + + +
struct manifold::ExecutionParams
+
+

Global parameters that control debugging output. Only has an effect when compiled with the MANIFOLD_DEBUG flag.

+
+ + + + + + + + + + + + + + + + + + + +
Class Members
+bool +intermediateChecks = false +

Perform extra sanity checks and assertions on the intermediate data structures.

+
+bool +verbose = false +

Verbose output primarily of the Boolean, including timing info and vector sizes.

+
+bool +processOverlaps = true +

If processOverlaps is false, a geometric check will be performed to assert all triangles are CCW.

+
+bool +suppressErrors = false +

Suppresses printed errors regarding CW triangles. Has no effect if processOverlaps is true.

+
+bool +deterministic = false +Deterministic outputs. Will disable some parallel optimizations.
+bool +cleanupTriangles = true +Perform optional but recommended triangle cleanups in SimplifyTopology()
+ +
+
+

Function Documentation

+ +

◆ ManifoldParams()

+ +
+
+ + + + + + + +
ExecutionParams & ManifoldParams ()
+
+

Allows modification of the assertions checked in MANIFOLD_DEBUG mode.

+
Returns
ExecutionParams&
+ +
+
+ +

◆ Dump()

+ +
+
+
+template<typename T >
+ + + + + + + + +
void Dump (const std::vector< T > & vec)
+
+

Print the contents of this vector to standard output. Only exists if compiled with MANIFOLD_DEBUG flag.

+ +
+
+
+
+ + + + diff --git a/docs/html/group___debug.js b/docs/html/group___debug.js new file mode 100644 index 000000000..e0c6396b2 --- /dev/null +++ b/docs/html/group___debug.js @@ -0,0 +1,14 @@ +var group___debug = +[ + [ "Exceptions", "group___exceptions.html", "group___exceptions" ], + [ "ExecutionParams", "group___debug.html#structmanifold_1_1_execution_params", [ + [ "intermediateChecks", "group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb", null ], + [ "verbose", "group___debug.html#ab3f078684998b83967d507d0f453f454", null ], + [ "processOverlaps", "group___debug.html#a7166fd3caef3744f7241075f21f76af3", null ], + [ "suppressErrors", "group___debug.html#a48b673772893c29c426e98f8c84f0206", null ], + [ "deterministic", "group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf", null ], + [ "cleanupTriangles", "group___debug.html#a85c1664e476e1da1b3d0973b3451857b", null ] + ] ], + [ "ManifoldParams", "group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275", null ], + [ "Dump", "group___debug.html#ga5a4ed9a6d64edb22079ff7a5caddcb5a", null ] +]; \ No newline at end of file diff --git a/docs/html/group___debug_structmanifold_1_1_execution_params.js b/docs/html/group___debug_structmanifold_1_1_execution_params.js new file mode 100644 index 000000000..95e902e24 --- /dev/null +++ b/docs/html/group___debug_structmanifold_1_1_execution_params.js @@ -0,0 +1,9 @@ +var group___debug_structmanifold_1_1_execution_params = +[ + [ "intermediateChecks", "group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb", null ], + [ "verbose", "group___debug.html#ab3f078684998b83967d507d0f453f454", null ], + [ "processOverlaps", "group___debug.html#a7166fd3caef3744f7241075f21f76af3", null ], + [ "suppressErrors", "group___debug.html#a48b673772893c29c426e98f8c84f0206", null ], + [ "deterministic", "group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf", null ], + [ "cleanupTriangles", "group___debug.html#a85c1664e476e1da1b3d0973b3451857b", null ] +]; \ No newline at end of file diff --git a/docs/html/group___exceptions.html b/docs/html/group___exceptions.html new file mode 100644 index 000000000..4ba5309b4 --- /dev/null +++ b/docs/html/group___exceptions.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: Exceptions + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Exceptions
+
+
+ +

Custom Exceptions. +More...

+ + + + + + + + +

+Classes

struct  userErr
 
struct  topologyErr
 
struct  geometryErr
 
+ + + +

+Typedefs

+using logicErr = std::logic_error
 
+

Detailed Description

+

Custom Exceptions.

+
+
+ + + + diff --git a/docs/html/group___exceptions.js b/docs/html/group___exceptions.js new file mode 100644 index 000000000..abcf06398 --- /dev/null +++ b/docs/html/group___exceptions.js @@ -0,0 +1,6 @@ +var group___exceptions = +[ + [ "userErr", "structmanifold_1_1user_err.html", null ], + [ "topologyErr", "structmanifold_1_1topology_err.html", null ], + [ "geometryErr", "structmanifold_1_1geometry_err.html", null ] +]; \ No newline at end of file diff --git a/docs/html/group___math.html b/docs/html/group___math.html new file mode 100644 index 000000000..4555fc535 --- /dev/null +++ b/docs/html/group___math.html @@ -0,0 +1,167 @@ + + + + + + + +Manifold: data structure definitions + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
data structure definitions
+
+
+ +

Abstract away from glm. In the future the underlying data type can change. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

+using vec2 = glm::dvec2
 
+using vec3 = glm::dvec3
 
+using vec4 = glm::dvec4
 
+using mat2 = glm::dmat2
 
+using mat2x3 = glm::dmat2x3
 
+using mat2x4 = glm::dmat2x4
 
+using mat3x2 = glm::dmat3x2
 
+using mat3 = glm::dmat3
 
+using mat3x4 = glm::dmat3x4
 
+using mat4x3 = glm::dmat4x3
 
+using mat4 = glm::dmat4
 
+using ivec2 = glm::vec< 2, int >
 
+using ivec3 = glm::vec< 3, int >
 
+using ivec4 = glm::vec< 4, int >
 
+using quat = glm::dquat
 
+

Detailed Description

+

Abstract away from glm. In the future the underlying data type can change.

+
+
+ + + + diff --git a/docs/html/group___mesh_i_o.html b/docs/html/group___mesh_i_o.html new file mode 100644 index 000000000..228621ead --- /dev/null +++ b/docs/html/group___mesh_i_o.html @@ -0,0 +1,352 @@ + + + + + + + +Manifold: MeshIO + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
MeshIO
+
+
+ +

3D model file I/O based on Assimp +More...

+ + + + + + +

+Classes

struct  Material
 
struct  ExportOptions
 
+ + + + + + + +

+Functions

Mesh ImportMesh (const std::string &filename, bool forceCleanup=false)
 
void ExportMesh (const std::string &filename, const Mesh &mesh, const ExportOptions &options)
 
void ExportMesh (const std::string &filename, const MeshGL &mesh, const ExportOptions &options)
 
+

Detailed Description

+

3D model file I/O based on Assimp

+

Class Documentation

+ +

◆ manifold::Material

+ +
+
+ + + + +
struct manifold::Material
+
+

PBR material properties for GLB/glTF files.

+
+ + + + + + + + + + + + + + + + + + + +
Class Members
+double +roughness = 0.2 +Roughness value between 0 (shiny) and 1 (matte).
+double +metalness = 1 +Metalness value, generally either 0 (dielectric) or 1 (metal).
+vec4 +color = vec4(1.0) +

Color (RGBA) multiplier to apply to the whole mesh (each value between 0 and 1).

+
+vector< vec4 > +vertColor +

Optional: If non-empty, must match Mesh.vertPos. Provides an RGBA color for each vertex, linearly interpolated across triangles. Colors are linear, not sRGB. Only used with Mesh export, not MeshGL.

+
+ivec3 +normalChannels = ivec3(-1) +

For MeshGL export, gives the property indicies where the normal channels can be found. Must be >= 3, since the first three are position.

+
+ivec4 +colorChannels = ivec4(-1) +

For MeshGL export, gives the property indicies where the color channels can be found. Any index < 0 will output all 1.0 for that channel.

+
+ +
+
+ +

◆ manifold::ExportOptions

+ +
+
+ + + + +
struct manifold::ExportOptions
+
+

These options only currently affect .glb and .gltf files.

+
+ + + + + + + +
Class Members
+bool +faceted = true +

When false, vertex normals are exported, causing the mesh to appear smooth through normal interpolation.

+
+Material +mat = {} +PBR material properties.
+ +
+
+

Function Documentation

+ +

◆ ImportMesh()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Mesh ImportMesh (const std::string & filename,
bool forceCleanup 
)
+
+

Imports the given file as a Mesh structure, which can be converted to a Manifold if the mesh is a proper oriented 2-manifold. Any supported polygon format will be automatically triangulated.

+

This is a very simple import function and is intended primarily as a demonstration. Generally users of this library will need to modify this to read all the important properties for their application and set up any custom data structures.

+
Parameters
+ + + +
filenameSupports any format the Assimp library supports.
forceCleanupThis merges identical vertices, which can break manifoldness. However it is always done for STLs, as they cannot possibly be manifold without this step.
+
+
+ +
+
+ +

◆ ExportMesh() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void ExportMesh (const std::string & filename,
const Meshmesh,
const ExportOptionsoptions 
)
+
+

Saves the Mesh to the desired file type, determined from the extension specified. In the case of .glb/.gltf, this will save in version 2.0.

+

This is a very simple export function and is intended primarily as a demonstration. Generally users of this library will need to modify this to write all the important properties for their application and read any custom data structures.

+
Parameters
+ + + + +
filenameThe file extension must be one that Assimp supports for export. GLB & 3MF are recommended.
meshThe mesh to export, likely from Manifold.GetMesh().
optionsThe options currently only affect an exported GLB's material. Pass {} for defaults.
+
+
+ +
+
+ +

◆ ExportMesh() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void ExportMesh (const std::string & filename,
const MeshGLmesh,
const ExportOptionsoptions 
)
+
+

Saves the Mesh to the desired file type, determined from the extension specified. In the case of .glb/.gltf, this will save in version 2.0.

+

This is a very simple export function and is intended primarily as a demonstration. Generally users of this library will need to modify this to write all the important properties for their application and read any custom data structures.

+
Parameters
+ + + + +
filenameThe file extension must be one that Assimp supports for export. GLB & 3MF are recommended.
meshThe mesh to export, likely from Manifold.GetMeshGL().
optionsThe options currently only affect an exported GLB's material. Pass {} for defaults.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/group___mesh_i_o.js b/docs/html/group___mesh_i_o.js new file mode 100644 index 000000000..1aa1dbb6f --- /dev/null +++ b/docs/html/group___mesh_i_o.js @@ -0,0 +1,18 @@ +var group___mesh_i_o = +[ + [ "Material", "group___mesh_i_o.html#structmanifold_1_1_material", [ + [ "roughness", "group___mesh_i_o.html#aae6a29bf1aea8336238154d7b4b95994", null ], + [ "metalness", "group___mesh_i_o.html#a75517e1226a2805e9bc0b78668b01812", null ], + [ "color", "group___mesh_i_o.html#a886c13bd5a32c945624abe944ab6235d", null ], + [ "vertColor", "group___mesh_i_o.html#a7833dfe9615e152876dd1cda4a721230", null ], + [ "normalChannels", "group___mesh_i_o.html#aef1da255255dd391ce5690ac8bff68b8", null ], + [ "colorChannels", "group___mesh_i_o.html#a19394e18f09d8e1e8ad3e8ec7362e0ad", null ] + ] ], + [ "ExportOptions", "group___mesh_i_o.html#structmanifold_1_1_export_options", [ + [ "faceted", "group___mesh_i_o.html#a30d67be5305ec851cfd4e8e4a15c6d05", null ], + [ "mat", "group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60", null ] + ] ], + [ "ImportMesh", "group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0", null ], + [ "ExportMesh", "group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb", null ], + [ "ExportMesh", "group___mesh_i_o.html#ga83ff5d8f4ee07ce7902b1d9ccea3640c", null ] +]; \ No newline at end of file diff --git a/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js b/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js new file mode 100644 index 000000000..4d736c18b --- /dev/null +++ b/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js @@ -0,0 +1,5 @@ +var group___mesh_i_o_structmanifold_1_1_export_options = +[ + [ "faceted", "group___mesh_i_o.html#a30d67be5305ec851cfd4e8e4a15c6d05", null ], + [ "mat", "group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60", null ] +]; \ No newline at end of file diff --git a/docs/html/group___mesh_i_o_structmanifold_1_1_material.js b/docs/html/group___mesh_i_o_structmanifold_1_1_material.js new file mode 100644 index 000000000..118a320be --- /dev/null +++ b/docs/html/group___mesh_i_o_structmanifold_1_1_material.js @@ -0,0 +1,9 @@ +var group___mesh_i_o_structmanifold_1_1_material = +[ + [ "roughness", "group___mesh_i_o.html#aae6a29bf1aea8336238154d7b4b95994", null ], + [ "metalness", "group___mesh_i_o.html#a75517e1226a2805e9bc0b78668b01812", null ], + [ "color", "group___mesh_i_o.html#a886c13bd5a32c945624abe944ab6235d", null ], + [ "vertColor", "group___mesh_i_o.html#a7833dfe9615e152876dd1cda4a721230", null ], + [ "normalChannels", "group___mesh_i_o.html#aef1da255255dd391ce5690ac8bff68b8", null ], + [ "colorChannels", "group___mesh_i_o.html#a19394e18f09d8e1e8ad3e8ec7362e0ad", null ] +]; \ No newline at end of file diff --git a/docs/html/group___private.html b/docs/html/group___private.html new file mode 100644 index 000000000..5b9516f60 --- /dev/null +++ b/docs/html/group___private.html @@ -0,0 +1,338 @@ + + + + + + + +Manifold: Private + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Private
+
+
+ +

Internal classes of the library; not currently part of the public API. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  Collider
 
class  Boolean3
 
struct  Manifold::Impl
 
struct  Halfedge
 
struct  Barycentric
 
struct  TriRef
 
struct  TmpEdge
 
struct  PolyVert
 
class  HashTableD< V, H >
 
class  HashTable< V, H >
 
class  SparseIndices
 
struct  Timer
 
class  ConcurrentSharedPtr< T >
 
struct  UnionFind< I, R >
 
struct  Identity< T >
 
struct  Negate< T >
 
class  Vec< T >
 
+ + + + + +

+Typedefs

+using SimplePolygonIdx = std::vector< PolyVert >
 
+using PolygonsIdx = std::vector< SimplePolygonIdx >
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

+vec3 SafeNormalize (vec3 v)
 
+double MaxPrecision (double minPrecision, const Box &bBox)
 
+int NextHalfedge (int current)
 
+mat3 NormalTransform (const mat4x3 &transform)
 
mat3x2 GetAxisAlignedProjection (vec3 normal)
 
+vec3 GetBarycentric (const vec3 &v, const mat3 &triPos, double precision)
 
std::vector< ivec3 > TriangulateIdx (const PolygonsIdx &polys, double precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+template<typename T , typename T1 >
void Permute (Vec< T > &inOut, const Vec< T1 > &new2Old)
 
+template<typename T , typename T1 >
void Permute (std::vector< T > &inOut, const Vec< T1 > &new2Old)
 
+template<typename T >
AtomicAdd (T &target, T add)
 
+template<>
int AtomicAdd (int &target, int add)
 
+

Detailed Description

+

Internal classes of the library; not currently part of the public API.

+

Class Documentation

+ +

◆ manifold::Barycentric

+ +
+
+ + + + +
struct manifold::Barycentric
+
+
+ + + + + + + +
Class Members
+int +tri +
+vec4 +uvw +
+ +
+
+ +

◆ manifold::PolyVert

+ +
+
+ + + + +
struct manifold::PolyVert
+
+

Polygon vertex.

+
+ + + + + + + +
Class Members
+vec2 +pos +X-Y position.
+int +idx +ID or index into another vertex vector.
+ +
+
+

Function Documentation

+ +

◆ GetAxisAlignedProjection()

+ +
+
+ + + + + +
+ + + + + + + + +
mat3x2 GetAxisAlignedProjection (vec3 normal)
+
+inline
+
+

By using the closest axis-aligned projection to the normal instead of a projection along the normal, we avoid introducing any rounding error.

+ +
+
+ +

◆ TriangulateIdx()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::vector< ivec3 > TriangulateIdx (const PolygonsIdx & polys,
double precision 
)
+
+ +

Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.

+
Parameters
+ + + +
polysThe set of polygons, wound CCW and representing multiple polygons and/or holes. These have 2D-projected positions as well as references back to the original vertices.
precisionThe value of ε, bounding the uncertainty of the input.
+
+
+
Returns
std::vector<ivec3> The triangles, referencing the original vertex indicies.
+ +
+
+
+
+ + + + diff --git a/docs/html/group___private.js b/docs/html/group___private.js new file mode 100644 index 000000000..60e6d828d --- /dev/null +++ b/docs/html/group___private.js @@ -0,0 +1,79 @@ +var group___private = +[ + [ "Collider", "classmanifold_1_1_collider.html", null ], + [ "Boolean3", "classmanifold_1_1_boolean3.html", null ], + [ "Impl", "structmanifold_1_1_manifold_1_1_impl.html", [ + [ "BaryIndices", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_bary_indices", null ], + [ "MeshRelationD", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_mesh_relation_d", [ + [ "originalID", "structmanifold_1_1_manifold_1_1_impl.html#aa09887a4f79bfc78615dbd09d9001fd7", null ] + ] ], + [ "Relation", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation", null ], + [ "Impl", "structmanifold_1_1_manifold_1_1_impl.html#a9bb5abff877334251f06225d5037cfd1", null ], + [ "Impl", "structmanifold_1_1_manifold_1_1_impl.html#ab6fd31092fdc69f21bb100d9b92bc5a8", null ], + [ "CreateHalfedges", "structmanifold_1_1_manifold_1_1_impl.html#ab66628e1ea9f38ed586b16e0c1aa4133", null ], + [ "CalculateNormals", "structmanifold_1_1_manifold_1_1_impl.html#adef45f00696640f682ede12311bdace7", null ], + [ "IncrementMeshIDs", "structmanifold_1_1_manifold_1_1_impl.html#a11d47359eb52523a2bc86f6d4ab22633", null ], + [ "Update", "structmanifold_1_1_manifold_1_1_impl.html#aec0783b5a136e042adcc47bae4fe5291", null ], + [ "EdgeCollisions", "structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5", null ], + [ "VertexCollisionsZ", "structmanifold_1_1_manifold_1_1_impl.html#a601f5355c70f7c74a168e5cbd4a817a5", null ], + [ "CalculateBBox", "structmanifold_1_1_manifold_1_1_impl.html#a4bad2940552ae5f952d4b1f710627a25", null ], + [ "IsFinite", "structmanifold_1_1_manifold_1_1_impl.html#a33b7dcc502aae627fbc56bcfecf33af1", null ], + [ "IsIndexInBounds", "structmanifold_1_1_manifold_1_1_impl.html#aa7f6545c1c252ffda922760097cfd68c", null ], + [ "SetPrecision", "structmanifold_1_1_manifold_1_1_impl.html#a496713ae74ada7e6aaee40464afc9d9e", null ], + [ "IsManifold", "structmanifold_1_1_manifold_1_1_impl.html#a28f34ca6c256f1f7fa44e862540ec421", null ], + [ "Is2Manifold", "structmanifold_1_1_manifold_1_1_impl.html#a7b0298da43b37952e432a1a0c4b02e00", null ], + [ "MatchesTriNormals", "structmanifold_1_1_manifold_1_1_impl.html#a611a5fd95dc5d49cd88182b8ead722b7", null ], + [ "NumDegenerateTris", "structmanifold_1_1_manifold_1_1_impl.html#afe3dd0baef775b394ee1a1ee0e353e66", null ], + [ "Finish", "structmanifold_1_1_manifold_1_1_impl.html#af9d1bc46635e487c85720b943dd8ba28", null ], + [ "SortVerts", "structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08", null ], + [ "ReindexVerts", "structmanifold_1_1_manifold_1_1_impl.html#a70e88d0158e9011619309fc502979350", null ], + [ "CompactProps", "structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a", null ], + [ "GetFaceBoxMorton", "structmanifold_1_1_manifold_1_1_impl.html#ae950ed2beaef893ec411aa3921aa25a8", null ], + [ "SortFaces", "structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8", null ], + [ "GatherFaces", "structmanifold_1_1_manifold_1_1_impl.html#abd9a97b16b825e7ee3fd989aaf776757", null ], + [ "Face2Tri", "structmanifold_1_1_manifold_1_1_impl.html#af037f51003b109c22f6a67cea6238021", null ], + [ "Face2Polygons", "structmanifold_1_1_manifold_1_1_impl.html#a517d1cb074912e89da079deef759207e", null ], + [ "CleanupTopology", "structmanifold_1_1_manifold_1_1_impl.html#a91e235740ebc7024be3e7cf6ae46ddad", null ], + [ "SimplifyTopology", "structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7", null ], + [ "GetNeighbor", "structmanifold_1_1_manifold_1_1_impl.html#a8a3b5765ff1df3e2090e792f8a2eb444", null ], + [ "GetHalfedges", "structmanifold_1_1_manifold_1_1_impl.html#ae9b082f1f3b9f6502e252f1fe35e5e3a", null ], + [ "GetIndices", "structmanifold_1_1_manifold_1_1_impl.html#a5663e9c8c9f549c90a3cfd36ad2c787a", null ], + [ "FillRetainedVerts", "structmanifold_1_1_manifold_1_1_impl.html#a0f3beb18c180190ad660336992f0ff64", null ], + [ "Subdivide", "structmanifold_1_1_manifold_1_1_impl.html#a364c1c537f3bfd0f4f37e3189aea3e26", null ], + [ "IsInsideQuad", "structmanifold_1_1_manifold_1_1_impl.html#aa244e3ec23cdce59aa792a297f0c8cde", null ], + [ "IsMarkedInsideQuad", "structmanifold_1_1_manifold_1_1_impl.html#a879e2e73b1f97ca728d306dfb3c520d5", null ], + [ "GetNormal", "structmanifold_1_1_manifold_1_1_impl.html#acb9563addc2ff3283f4bbfe4dd722ece", null ], + [ "TangentFromNormal", "structmanifold_1_1_manifold_1_1_impl.html#a5188293029f53ae9159a9a36fb66533a", null ], + [ "SharpenTangent", "structmanifold_1_1_manifold_1_1_impl.html#a28cc7fde07cd82723e1f71699c7b502d", null ], + [ "SetNormals", "structmanifold_1_1_manifold_1_1_impl.html#ac35adfca9a18e8dd1a6a65355ad0ed07", null ], + [ "LinearizeFlatTangents", "structmanifold_1_1_manifold_1_1_impl.html#a744f7dc967657edf6fdba43aaa81ad3e", null ], + [ "DistributeTangents", "structmanifold_1_1_manifold_1_1_impl.html#ae520f2222155301f5bb6551702222014", null ], + [ "CreateTangents", "structmanifold_1_1_manifold_1_1_impl.html#acc962337837219c991a414bf4033ef61", null ], + [ "CreateTangents", "structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b", null ] + ] ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", [ + [ "meshID", "structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88", null ] + ] ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", [ + [ "pos", "group___private.html#a8b2c7ec938814a57e13bd292f12f3a40", null ], + [ "idx", "group___private.html#ae40354a1051342eb5a9db005715dcfa9", null ] + ] ], + [ "HashTableD< V, H >", "classmanifold_1_1_hash_table_d.html", null ], + [ "HashTable< V, H >", "classmanifold_1_1_hash_table.html", null ], + [ "SparseIndices", "classmanifold_1_1_sparse_indices.html", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "ConcurrentSharedPtr< T >", "classmanifold_1_1_concurrent_shared_ptr.html", [ + [ "SharedPtrGuard", "classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html", null ] + ] ], + [ "UnionFind< I, R >", "structmanifold_1_1_union_find.html", null ], + [ "Identity< T >", "structmanifold_1_1_identity.html", null ], + [ "Negate< T >", "structmanifold_1_1_negate.html", null ], + [ "Vec< T >", "classmanifold_1_1_vec.html", null ], + [ "GetAxisAlignedProjection", "group___private.html#ga8a78bbee39ddfd72a872c6027d376f51", null ], + [ "TriangulateIdx", "group___private.html#ga526f0d57b4e5c29114576fdf13a304c0", null ] +]; \ No newline at end of file diff --git a/docs/html/group___private_structmanifold_1_1_poly_vert.js b/docs/html/group___private_structmanifold_1_1_poly_vert.js new file mode 100644 index 000000000..7c263e4a7 --- /dev/null +++ b/docs/html/group___private_structmanifold_1_1_poly_vert.js @@ -0,0 +1,5 @@ +var group___private_structmanifold_1_1_poly_vert = +[ + [ "pos", "group___private.html#a8b2c7ec938814a57e13bd292f12f3a40", null ], + [ "idx", "group___private.html#ae40354a1051342eb5a9db005715dcfa9", null ] +]; \ No newline at end of file diff --git a/docs/html/group___samples.html b/docs/html/group___samples.html new file mode 100644 index 000000000..956027d54 --- /dev/null +++ b/docs/html/group___samples.html @@ -0,0 +1,441 @@ + + + + + + + +Manifold: Samples + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Samples
+
+
+ +

Examples of usage and interesting designs. +More...

+ + + + + + + + + + + + + + + + + + +

+Functions

Manifold TorusKnot (int p, int q, double majorRadius, double minorRadius, double threadRadius, int circularSegments=0, int linearSegments=0)
 
Manifold StretchyBracelet (double radius=30.0, double height=8.0, double width=15.0, double thickness=0.4, int nDecor=20, int nCut=27, int nDivision=30)
 
Manifold MengerSponge (int n=3)
 
Manifold RoundedFrame (double edgeLength, double radius, int circularSegments=0)
 
Manifold TetPuzzle (double edgeLength, double gap, int nDivisions)
 
Manifold Scallop ()
 
Manifold GyroidModule (double size=20, int n=20)
 
+Manifold CondensedMatter (int fn=16)
 
+

Detailed Description

+

Examples of usage and interesting designs.

+

These are mostly 3D-printable designs I've invented over the years, translated from their original OpenSCAD to C++ to demonstrate the usage of this library. You can find the originals here: http://www.thingiverse.com/emmett These also each have tests you can find in test/samples_test.cpp, which have nice parameter choices for making some of the specific designs I print. While the source code is under the Apache License above, I license all of my designs (the output of those tests if you uncomment the export lines) under CC-BY-SA: https://creativecommons.org/licenses/by-sa/2.0/, which means you're welcome to print and sell them, so long as you attribute the design to Emmett Lalish and share any derivative works under the same license.

+

Function Documentation

+ +

◆ TorusKnot()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Manifold TorusKnot (int p,
int q,
double majorRadius,
double minorRadius,
double threadRadius,
int circularSegments,
int linearSegments 
)
+
+

Creates a classic torus knot, defined as a string wrapping periodically around the surface of an imaginary donut. If p and q have a common factor then you will get multiple separate, interwoven knots. This is an example of using the Manifold.Warp() method, thus avoiding any handling of triangles.

+
Parameters
+ + + + + + + + +
pThe number of times the thread passes through the donut hole.
qThe number of times the thread circles the donut.
majorRadiusRadius of the interior of the imaginary donut.
minorRadiusRadius of the small cross-section of the imaginary donut.
threadRadiusRadius of the small cross-section of the actual object.
circularSegmentsNumber of linear segments making up the threadRadius circle. Default is Quality.GetCircularSegments().
linearSegmentsNumber of segments along the length of the knot. Default makes roughly square facets.
+
+
+ +
+
+ +

◆ StretchyBracelet()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Manifold StretchyBracelet (double radius,
double height,
double width,
double thickness,
int nDecor,
int nCut,
int nDivision 
)
+
+

My Stretchy Bracelet: this is one of my most popular designs, largely because it's quick and easy to 3D print. The defaults are picked to work well; change the radius to fit your wrist. Changing the other values too much may break the design.

+
Parameters
+ + + + + + + + +
radiusThe overall size; the radius left for your wrist is roughly radius - height.
heightThickness of the bracelet around your wrist.
widthThe length along your arm (the height of the print).
thicknessThe width of the material, which should be equal to your printer's nozzle diameter.
nDecorThe number of twisty shapes around the outside.
nCutThe number of cuts that enable stretching.
nDivisionthe number of divisions along the width.
+
+
+ +
+
+ +

◆ MengerSponge()

+ +
+
+ + + + + + + + +
Manifold MengerSponge (int n)
+
+

The classic cubic fractal.

+
Parameters
+ + +
nFractal depth. Warning: scales exponentially, n = 4 has almost 400,000 triangles!
+
+
+ +
+
+ +

◆ RoundedFrame()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Manifold RoundedFrame (double edgeLength,
double radius,
int circularSegments 
)
+
+

A cubic frame with cylinders for edges and spheres at the corners. Demonstrates how at 90-degree intersections, the sphere and cylinder facets match up perfectly.

+
Parameters
+ + + + +
edgeLengthDistance between the corners.
radiusRadius of the frame members.
circularSegmentsNumber of segments in the cylinders and spheres. Defaults to Quality.GetCircularSegments().
+
+
+ +
+
+ +

◆ TetPuzzle()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Manifold TetPuzzle (double edgeLength,
double gap,
int nDivisions 
)
+
+

A tetrahedron cut into two identical halves that can screw together as a puzzle. This only outputs one of the halves. This demonstrates how redundant points along a polygon can be used to make twisted extrusions smoother.

+
Parameters
+ + + + +
edgeLengthLength of each edge of the overall tetrahedron.
gapSpacing between the two halves to allow sliding.
nDivisionsNumber of divisions (both ways) in the screw surface.
+
+
+ +
+
+ +

◆ Scallop()

+ +
+
+ + + + + + + +
Manifold Scallop ()
+
+

A smoothed manifold demonstrating selective edge sharpening with Manifold.Smooth(). Use Manifold.Refine() before export to see the curvature.

+ +
+
+ +

◆ GyroidModule()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold GyroidModule (double size,
int n 
)
+
+

Creates a rhombic dodecahedral module of a gyroid manifold, which can be assembled together to tile space continuously. This one is designed to be 3D-printable, as it is oriented with minimal overhangs. This sample demonstrates the use of a Signed Distance Function (SDF) to create smooth, complex manifolds.

+ +
+
+
+
+ + + + diff --git a/docs/html/group___samples.js b/docs/html/group___samples.js new file mode 100644 index 000000000..21c2207eb --- /dev/null +++ b/docs/html/group___samples.js @@ -0,0 +1,10 @@ +var group___samples = +[ + [ "TorusKnot", "group___samples.html#ga0ccde255ceda709d8e4a54ec95f3ca3e", null ], + [ "StretchyBracelet", "group___samples.html#gac99ae21a77112ea3909eefb0a66e1ae4", null ], + [ "MengerSponge", "group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae", null ], + [ "RoundedFrame", "group___samples.html#gaed7341c943d9bb53a52f01f4d9453bd8", null ], + [ "TetPuzzle", "group___samples.html#gaa69f000001c833bf1534f35c19a7e8b0", null ], + [ "Scallop", "group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36", null ], + [ "GyroidModule", "group___samples.html#ga5141b952c15a0aa27af95791a65455d2", null ] +]; \ No newline at end of file diff --git a/docs/html/hashtable_8h_source.html b/docs/html/hashtable_8h_source.html new file mode 100644 index 000000000..4ffe9a6f1 --- /dev/null +++ b/docs/html/hashtable_8h_source.html @@ -0,0 +1,289 @@ + + + + + + + +Manifold: hashtable.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hashtable.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14#pragma once
+
15#include <stdint.h>
+
16
+
17#include <atomic>
+
18
+
19#include "manifold/common.h"
+
20#include "manifold/vec.h"
+
21
+
22namespace {
+
23typedef unsigned long long int Uint64;
+
24typedef Uint64 (*hash_fun_t)(Uint64);
+
25inline constexpr Uint64 kOpen = std::numeric_limits<Uint64>::max();
+
26
+
27template <typename T>
+
28T AtomicCAS(T& target, T compare, T val) {
+
29 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
30 tar.compare_exchange_strong(compare, val, std::memory_order_acq_rel);
+
31 return compare;
+
32}
+
33
+
34template <typename T>
+
35void AtomicStore(T& target, T val) {
+
36 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
37 // release is good enough, although not really something general
+
38 tar.store(val, std::memory_order_release);
+
39}
+
40
+
41template <typename T>
+
42T AtomicLoad(const T& target) {
+
43 const std::atomic<T>& tar = reinterpret_cast<const std::atomic<T>&>(target);
+
44 // acquire is good enough, although not general
+
45 return tar.load(std::memory_order_acquire);
+
46}
+
47
+
48// https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key
+
49inline Uint64 hash64bit(Uint64 x) {
+
50 x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ull;
+
51 x = (x ^ (x >> 27)) * 0x94d049bb133111ebull;
+
52 x = x ^ (x >> 31);
+
53 return x;
+
54}
+
55} // namespace
+
56
+
57namespace manifold {
+
62template <typename V, hash_fun_t H = hash64bit>
+
+ +
64 public:
+
65 HashTableD(Vec<Uint64>& keys, Vec<V>& values, std::atomic<size_t>& used,
+
66 uint32_t step = 1)
+
67 : step_{step}, keys_{keys}, values_{values}, used_{used} {}
+
68
+
69 int Size() const { return keys_.size(); }
+
70
+
71 bool Full() const {
+
72 return used_.load(std::memory_order_relaxed) * 2 >
+
73 static_cast<size_t>(Size());
+
74 }
+
75
+
76 void Insert(Uint64 key, const V& val) {
+
77 uint32_t idx = H(key) & (Size() - 1);
+
78 while (1) {
+
79 if (Full()) return;
+
80 Uint64& k = keys_[idx];
+
81 const Uint64 found = AtomicCAS(k, kOpen, key);
+
82 if (found == kOpen) {
+
83 used_.fetch_add(1, std::memory_order_relaxed);
+
84 values_[idx] = val;
+
85 return;
+
86 }
+
87 if (found == key) return;
+
88 idx = (idx + step_) & (Size() - 1);
+
89 }
+
90 }
+
91
+
92 V& operator[](Uint64 key) {
+
93 uint32_t idx = H(key) & (Size() - 1);
+
94 while (1) {
+
95 const Uint64 k = AtomicLoad(keys_[idx]);
+
96 if (k == key || k == kOpen) {
+
97 return values_[idx];
+
98 }
+
99 idx = (idx + step_) & (Size() - 1);
+
100 }
+
101 }
+
102
+
103 const V& operator[](Uint64 key) const {
+
104 uint32_t idx = H(key) & (Size() - 1);
+
105 while (1) {
+
106 const Uint64 k = AtomicLoad(keys_[idx]);
+
107 if (k == key || k == kOpen) {
+
108 return values_[idx];
+
109 }
+
110 idx = (idx + step_) & (Size() - 1);
+
111 }
+
112 }
+
113
+
114 Uint64 KeyAt(int idx) const { return AtomicLoad(keys_[idx]); }
+
115 V& At(int idx) { return values_[idx]; }
+
116 const V& At(int idx) const { return values_[idx]; }
+
117
+
118 private:
+
119 uint32_t step_;
+
120 VecView<Uint64> keys_;
+
121 VecView<V> values_;
+
122 std::atomic<size_t>& used_;
+
123};
+
+
124
+
125template <typename V, hash_fun_t H = hash64bit>
+
+ +
127 public:
+
128 HashTable(size_t size, uint32_t step = 1)
+
129 : keys_{size == 0 ? 0 : 1_uz << (int)ceil(log2(size)), kOpen},
+
130 values_{size == 0 ? 0 : 1_uz << (int)ceil(log2(size)), {}},
+
131 step_(step) {}
+
132
+
133 HashTable(const HashTable& other)
+
134 : keys_(other.keys_), values_(other.values_), step_(other.step_) {
+
135 used_.store(other.used_.load());
+
136 }
+
137
+
138 HashTable& operator=(const HashTable& other) {
+
139 if (this == &other) return *this;
+
140 keys_ = other.keys_;
+
141 values_ = other.values_;
+
142 used_.store(other.used_.load());
+
143 step_ = other.step_;
+
144 return *this;
+
145 }
+
146
+
147 HashTableD<V, H> D() { return {keys_, values_, used_, step_}; }
+
148
+
149 int Entries() const { return used_.load(std::memory_order_relaxed); }
+
150
+
151 size_t Size() const { return keys_.size(); }
+
152
+
153 bool Full() const {
+
154 return used_.load(std::memory_order_relaxed) * 2 > Size();
+
155 }
+
156
+
157 double FilledFraction() const {
+
158 return static_cast<double>(used_.load(std::memory_order_relaxed)) / Size();
+
159 }
+
160
+
161 Vec<V>& GetValueStore() { return values_; }
+
162
+
163 static Uint64 Open() { return kOpen; }
+
164
+
165 private:
+
166 Vec<Uint64> keys_;
+
167 Vec<V> values_;
+
168 std::atomic<size_t> used_ = 0;
+
169 uint32_t step_;
+
170};
+
+
171
+
173} // namespace manifold
+
Definition hashtable.h:63
+
Definition hashtable.h:126
+
Definition vec.h:43
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/helpers_8cpp_source.html b/docs/html/helpers_8cpp_source.html new file mode 100644 index 000000000..d464d67c3 --- /dev/null +++ b/docs/html/helpers_8cpp_source.html @@ -0,0 +1,364 @@ + + + + + + + +Manifold: helpers.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
helpers.cpp
+
+
+
1#include <emscripten/bind.h>
+
2#include <emscripten/val.h>
+
3
+
4#include <vector>
+
5
+
6#include "manifold/cross_section.h"
+
7#include "manifold/manifold.h"
+
8#include "manifold/polygon.h"
+
9
+
10using namespace emscripten;
+
11using namespace manifold;
+
12
+
13namespace js {
+
14val MeshGL2JS(const MeshGL& mesh) {
+
15 val meshJS = val::object();
+
16
+
17 meshJS.set("numProp", mesh.numProp);
+
18 meshJS.set("triVerts",
+
19 val(typed_memory_view(mesh.triVerts.size(), mesh.triVerts.data()))
+
20 .call<val>("slice"));
+
21 meshJS.set("vertProperties",
+
22 val(typed_memory_view(mesh.vertProperties.size(),
+
23 mesh.vertProperties.data()))
+
24 .call<val>("slice"));
+
25 meshJS.set("mergeFromVert", val(typed_memory_view(mesh.mergeFromVert.size(),
+
26 mesh.mergeFromVert.data()))
+
27 .call<val>("slice"));
+
28 meshJS.set("mergeToVert", val(typed_memory_view(mesh.mergeToVert.size(),
+
29 mesh.mergeToVert.data()))
+
30 .call<val>("slice"));
+
31 meshJS.set("runIndex",
+
32 val(typed_memory_view(mesh.runIndex.size(), mesh.runIndex.data()))
+
33 .call<val>("slice"));
+
34 meshJS.set("runOriginalID", val(typed_memory_view(mesh.runOriginalID.size(),
+
35 mesh.runOriginalID.data()))
+
36 .call<val>("slice"));
+
37 meshJS.set("faceID",
+
38 val(typed_memory_view(mesh.faceID.size(), mesh.faceID.data()))
+
39 .call<val>("slice"));
+
40 meshJS.set("halfedgeTangent",
+
41 val(typed_memory_view(mesh.halfedgeTangent.size(),
+
42 mesh.halfedgeTangent.data()))
+
43 .call<val>("slice"));
+
44 meshJS.set("runTransform", val(typed_memory_view(mesh.runTransform.size(),
+
45 mesh.runTransform.data()))
+
46 .call<val>("slice"));
+
47
+
48 return meshJS;
+
49}
+
50
+
51MeshGL MeshJS2GL(const val& mesh) {
+
52 MeshGL out;
+
53 out.numProp = mesh["numProp"].as<int>();
+
54 out.triVerts = convertJSArrayToNumberVector<uint32_t>(mesh["triVerts"]);
+
55 out.vertProperties =
+
56 convertJSArrayToNumberVector<float>(mesh["vertProperties"]);
+
57 if (mesh["mergeFromVert"] != val::undefined()) {
+
58 out.mergeFromVert =
+
59 convertJSArrayToNumberVector<uint32_t>(mesh["mergeFromVert"]);
+
60 }
+
61 if (mesh["mergeToVert"] != val::undefined()) {
+
62 out.mergeToVert =
+
63 convertJSArrayToNumberVector<uint32_t>(mesh["mergeToVert"]);
+
64 }
+
65 if (mesh["runIndex"] != val::undefined()) {
+
66 out.runIndex = convertJSArrayToNumberVector<uint32_t>(mesh["runIndex"]);
+
67 }
+
68 if (mesh["runOriginalID"] != val::undefined()) {
+
69 out.runOriginalID =
+
70 convertJSArrayToNumberVector<uint32_t>(mesh["runOriginalID"]);
+
71 }
+
72 if (mesh["faceID"] != val::undefined()) {
+
73 out.faceID = convertJSArrayToNumberVector<uint32_t>(mesh["faceID"]);
+
74 }
+
75 if (mesh["halfedgeTangent"] != val::undefined()) {
+
76 out.halfedgeTangent =
+
77 convertJSArrayToNumberVector<float>(mesh["halfedgeTangent"]);
+
78 }
+
79 if (mesh["runTransform"] != val::undefined()) {
+
80 out.runTransform =
+
81 convertJSArrayToNumberVector<float>(mesh["runTransform"]);
+
82 }
+
83 return out;
+
84}
+
85
+
86val GetMeshJS(const Manifold& manifold, const ivec3& normalIdx) {
+
87 MeshGL mesh = manifold.GetMeshGL(normalIdx);
+
88 return MeshGL2JS(mesh);
+
89}
+
90
+
91val Merge(const val& mesh) {
+
92 val out = val::object();
+
93 MeshGL meshGL = MeshJS2GL(mesh);
+
94 bool changed = meshGL.Merge();
+
95 out.set("changed", changed);
+
96 out.set("mesh", changed ? MeshGL2JS(meshGL) : mesh);
+
97 return out;
+
98}
+
99
+
100Manifold Smooth(const val& mesh,
+
101 const std::vector<Smoothness>& sharpenedEdges = {}) {
+
102 return Manifold::Smooth(MeshJS2GL(mesh), sharpenedEdges);
+
103}
+
104
+
105} // namespace js
+
106
+
107namespace cross_js {
+
108CrossSection OfPolygons(std::vector<std::vector<vec2>> polygons,
+
109 int fill_rule) {
+
110 auto fr = fill_rule == 0 ? CrossSection::FillRule::EvenOdd
+
111 : fill_rule == 1 ? CrossSection::FillRule::NonZero
+
112 : fill_rule == 2 ? CrossSection::FillRule::Positive
+
113 : CrossSection::FillRule::Negative;
+
114 return CrossSection(polygons, fr);
+
115}
+
116
+
117CrossSection Union(const CrossSection& a, const CrossSection& b) {
+
118 return a + b;
+
119}
+
120
+
121CrossSection Difference(const CrossSection& a, const CrossSection& b) {
+
122 return a - b;
+
123}
+
124
+
125CrossSection Intersection(const CrossSection& a, const CrossSection& b) {
+
126 return a ^ b;
+
127}
+
128
+
129CrossSection UnionN(const std::vector<CrossSection>& cross_sections) {
+
130 return CrossSection::BatchBoolean(cross_sections, OpType::Add);
+
131}
+
132
+
133CrossSection DifferenceN(const std::vector<CrossSection>& cross_sections) {
+
134 return CrossSection::BatchBoolean(cross_sections, OpType::Subtract);
+
135}
+
136
+
137CrossSection IntersectionN(const std::vector<CrossSection>& cross_sections) {
+
138 return CrossSection::BatchBoolean(cross_sections, OpType::Intersect);
+
139}
+
140
+
141CrossSection Transform(CrossSection& cross_section, const val& mat) {
+
142 std::vector<double> array = convertJSArrayToNumberVector<double>(mat);
+
143 mat3x2 matrix;
+
144 for (const int col : {0, 1, 2})
+
145 for (const int row : {0, 1}) matrix[col][row] = array[col * 3 + row];
+
146 return cross_section.Transform(matrix);
+
147}
+
148
+
149CrossSection Warp(CrossSection& cross_section, uintptr_t funcPtr) {
+
150 void (*f)(vec2&) = reinterpret_cast<void (*)(vec2&)>(funcPtr);
+
151 return cross_section.Warp(f);
+
152}
+
153
+
154CrossSection Offset(CrossSection& cross_section, double delta, int join_type,
+
155 double miter_limit, double arc_tolerance) {
+
156 auto jt = join_type == 0 ? CrossSection::JoinType::Square
+
157 : join_type == 1 ? CrossSection::JoinType::Round
+
158 : CrossSection::JoinType::Miter;
+
159 return cross_section.Offset(delta, jt, miter_limit, arc_tolerance);
+
160}
+
161
+
162void CollectVertices(std::vector<vec2>& verts, const CrossSection& cs) {
+
163 auto polys = cs.ToPolygons();
+
164 for (auto poly : polys) verts.insert(verts.end(), poly.begin(), poly.end());
+
165}
+
166} // namespace cross_js
+
167
+
168namespace man_js {
+
169Manifold FromMeshJS(const val& mesh) { return Manifold(js::MeshJS2GL(mesh)); }
+
170
+
171Manifold Union(const Manifold& a, const Manifold& b) { return a + b; }
+
172
+
173Manifold Difference(const Manifold& a, const Manifold& b) { return a - b; }
+
174
+
175Manifold Intersection(const Manifold& a, const Manifold& b) { return a ^ b; }
+
176
+
177Manifold UnionN(const std::vector<Manifold>& manifolds) {
+
178 return Manifold::BatchBoolean(manifolds, OpType::Add);
+
179}
+
180
+
181Manifold DifferenceN(const std::vector<Manifold>& manifolds) {
+
182 return Manifold::BatchBoolean(manifolds, OpType::Subtract);
+
183}
+
184
+
185Manifold IntersectionN(const std::vector<Manifold>& manifolds) {
+
186 return Manifold::BatchBoolean(manifolds, OpType::Intersect);
+
187}
+
188
+
189Manifold Transform(Manifold& manifold, const val& mat) {
+
190 std::vector<double> array = convertJSArrayToNumberVector<double>(mat);
+
191 mat4x3 matrix;
+
192 for (const int col : {0, 1, 2, 3})
+
193 for (const int row : {0, 1, 2}) matrix[col][row] = array[col * 4 + row];
+
194 return manifold.Transform(matrix);
+
195}
+
196
+
197Manifold Warp(Manifold& manifold, uintptr_t funcPtr) {
+
198 void (*f)(vec3&) = reinterpret_cast<void (*)(vec3&)>(funcPtr);
+
199 return manifold.Warp(f);
+
200}
+
201
+
202Manifold SetProperties(Manifold& manifold, int numProp, uintptr_t funcPtr) {
+
203 void (*f)(double*, vec3, const double*) =
+
204 reinterpret_cast<void (*)(double*, vec3, const double*)>(funcPtr);
+
205 return manifold.SetProperties(numProp, f);
+
206}
+
207
+
208Manifold LevelSet(uintptr_t funcPtr, Box bounds, double edgeLength,
+
209 double level, double precision) {
+
210 double (*f)(const vec3&) = reinterpret_cast<double (*)(const vec3&)>(funcPtr);
+
211 return Manifold::LevelSet(f, bounds, edgeLength, level, precision);
+
212}
+
213
+
214std::vector<Manifold> Split(Manifold& a, Manifold& b) {
+
215 auto [r1, r2] = a.Split(b);
+
216 return {r1, r2};
+
217}
+
218
+
219std::vector<Manifold> SplitByPlane(Manifold& m, vec3 normal,
+
220 double originOffset) {
+
221 auto [a, b] = m.SplitByPlane(normal, originOffset);
+
222 return {a, b};
+
223}
+
224
+
225void CollectVertices(std::vector<vec3>& verts, const Manifold& manifold) {
+
226 Mesh mesh = manifold.GetMesh();
+
227 verts.insert(verts.end(), mesh.vertPos.begin(), mesh.vertPos.end());
+
228}
+
229} // namespace man_js
+
Definition cross_section.h:38
+
Polygons ToPolygons() const
Definition cross_section.cpp:774
+
CrossSection Transform(const mat3x2 &m) const
Definition cross_section.cpp:543
+
CrossSection Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
Definition cross_section.cpp:655
+
CrossSection Warp(std::function< void(vec2 &)> warpFunc) const
Definition cross_section.cpp:558
+
Definition manifold.h:152
+
std::pair< Manifold, Manifold > SplitByPlane(vec3 normal, double originOffset) const
Definition manifold.cpp:867
+
std::pair< Manifold, Manifold > Split(const Manifold &) const
Definition manifold.cpp:846
+
Definition common.h:158
+
Definition meshIO.h:20
+
Definition common.h:200
+
Definition manifold.h:46
+
std::vector< uint32_t > runIndex
Definition manifold.h:85
+
bool Merge()
Definition sort.cpp:427
+
std::vector< float > runTransform
Definition manifold.h:96
+
std::vector< float > halfedgeTangent
Definition manifold.h:109
+
std::vector< uint32_t > mergeFromVert
Definition manifold.h:73
+
std::vector< float > vertProperties
Definition manifold.h:67
+
std::vector< uint32_t > runOriginalID
Definition manifold.h:91
+
std::vector< uint32_t > faceID
Definition manifold.h:104
+
uint32_t numProp
Number of properties per vertex, always >= 3.
Definition manifold.h:63
+
std::vector< uint32_t > mergeToVert
Definition manifold.h:77
+
std::vector< uint32_t > triVerts
Definition manifold.h:70
+
+
+ + + + diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html new file mode 100644 index 000000000..8fa592827 --- /dev/null +++ b/docs/html/hierarchy.html @@ -0,0 +1,268 @@ + + + + + + + +Manifold: Class Hierarchy + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Call_of< Policy >
 CBarycentric
 CManifold::Impl::BaryIndices
 CBoolean3
 CBox
 CBuildInternalBoxes
 CCollider
 CConcurrentSharedPtr< T >
 CConcurrentSharedPtr< Impl >
 Ccopy< Policy >
 Ccopy_if_1001< Policy >
 Ccopy_if_28< Policy >
 Ccopy_if_55< Policy >
 Ccopy_if_82< Policy >
 Ccount< Policy >
 CCountCollisions
 CCountingIterator< T >
 CCreateRadixTree
 CCrossSection
 CCubeVoid
 CEdge
 Cenable_shared_from_this
 Cexclusive_scan< Policy >
 CExecutionParams
 CExportOptions
 CMeshBuilder::Face
 Cfill< Policy >
 CFindCollisions< T, selfCollision, Recorder >
 Cfor_each< Policy >
 Cglm_name< T >
 Cglm_name< ivec3 >
 Cglm_name< mat3x2 >
 Cglm_name< mat4x3 >
 Cglm_name< vec2 >
 Cglm_name< vec3 >
 CGyroidSDF
 CHalfedge
 CHalfEdgeMesh
 Chash< manifold::ivec4 >
 Chash< std::pair< int, int > >
 CHashTable< V, H >
 CHashTableD< V, H >
 CHullImpl
 CIdentity< T >
 CManifold::Impl
 CLayers
 CManifold
 CManifoldIVec3
 CManifoldManifoldPair
 CManifoldProperties
 CManifoldVec2
 CManifoldVec3
 CManifoldVec4
 CMaterial
 CMesh
 CMeshBuilder
 CMeshGL
 CManifold::Impl::MeshRelationD
 CMeshSize
 CNegate< T >
 COptions
 CParCollisionRecorder< inverted >
 CPathImpl
 CPlane
 CPolyVert
 CPool
 CProperties
 CQuality
 CQuickHull
 CRay
 CRect
 Creduce< Policy >
 CReindexEdge< inverted >
 CManifold::Impl::Relation
 CResult
 Cruntime_error
 CSeqCollisionRecorder< inverted >
 CConcurrentSharedPtr< T >::SharedPtrGuard
 CSmoothness
 Csort_Asc< Policy >
 Csort_Asc_size< Policy >
 Csort_Asc_size_merge< Policy >
 Csort_Des< Policy >
 Csort_Des_size< Policy >
 Csort_Des_size_merge< Policy >
 Csort_Eq< Policy >
 Csort_Eq_size< Policy >
 Csort_Eq_size_merge< Policy >
 Csort_Rnd< Policy >
 Csort_Rnd_size< Policy >
 Csort_Rnd_size_merge< Policy >
 Csort_roughly_Asc< Policy >
 Csort_roughly_Asc_size< Policy >
 Csort_roughly_Asc_size_merge< Policy >
 CSparseIndices
 CStridedRange< Iter >
 CSVDSet
 CTimer
 CTmpEdge
 Ctransform_reduce< Policy >
 CTransformBox
 CTransformIterator< F, Iter >
 CTriRef
 Ctype_caster< glm::mat< C, R, T, Q > >
 Ctype_caster< glm::vec< N, T, Q > >
 Ctype_caster< manifold::VecView< glm::vec< N, T, Q > > >
 Ctype_caster< std::vector< glm::vec< N, T, Q > > >
 CUnionFind< I, R >
 CVecView< T >
 CVecView< char >
 CVecView< const manifold::Box >
 CVecView< const manifold::TmpEdge >
 CVecView< const std::pair< int, int > >
 CVecView< const T >
 CVecView< const uint32_t >
 CVecView< double >
 CVecView< FaceData >
 CVecView< int >
 CVecView< ivec3 >
 CVecView< manifold::Box >
 CVecView< manifold::Halfedge >
 CVecView< manifold::TriRef >
 CVecView< size_t >
 CVecView< std::pair< int, int > >
 CVecView< Uint64 >
 CVecView< unsigned char >
 CVecView< V >
 CVecView< vec3 >
 CVecView< vec4 >
+
+
+
+ + + + diff --git a/docs/html/hierarchy.js b/docs/html/hierarchy.js new file mode 100644 index 000000000..2956a8aee --- /dev/null +++ b/docs/html/hierarchy.js @@ -0,0 +1,161 @@ +var hierarchy = +[ + [ "all_of< Policy >", "structbenchmarks_1_1all__of.html", null ], + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "BaryIndices", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_bary_indices", null ], + [ "Boolean3", "classmanifold_1_1_boolean3.html", null ], + [ "Box", "structmanifold_1_1_box.html", null ], + [ "BuildInternalBoxes", "structmanifold_1_1collider__internal_1_1_build_internal_boxes.html", null ], + [ "Collider", "classmanifold_1_1_collider.html", null ], + [ "ConcurrentSharedPtr< T >", "classmanifold_1_1_concurrent_shared_ptr.html", null ], + [ "ConcurrentSharedPtr< Impl >", "classmanifold_1_1_concurrent_shared_ptr.html", null ], + [ "copy< Policy >", "structbenchmarks_1_1copy.html", null ], + [ "copy_if_1001< Policy >", "structbenchmarks_1_1copy__if__1001.html", null ], + [ "copy_if_28< Policy >", "structbenchmarks_1_1copy__if__28.html", null ], + [ "copy_if_55< Policy >", "structbenchmarks_1_1copy__if__55.html", null ], + [ "copy_if_82< Policy >", "structbenchmarks_1_1copy__if__82.html", null ], + [ "count< Policy >", "structbenchmarks_1_1count.html", null ], + [ "CountCollisions", "structmanifold_1_1collider__internal_1_1_count_collisions.html", null ], + [ "CountingIterator< T >", "structmanifold_1_1_counting_iterator.html", null ], + [ "CreateRadixTree", "structmanifold_1_1collider__internal_1_1_create_radix_tree.html", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html", null ], + [ "CubeVoid", "struct_cube_void.html", null ], + [ "Edge", "struct_edge.html", null ], + [ "enable_shared_from_this", null, [ + [ "CsgNode", "classmanifold_1_1_csg_node.html", [ + [ "CsgLeafNode", "classmanifold_1_1_csg_leaf_node.html", null ], + [ "CsgOpNode", "classmanifold_1_1_csg_op_node.html", null ] + ] ] + ] ], + [ "exclusive_scan< Policy >", "structbenchmarks_1_1exclusive__scan.html", null ], + [ "ExecutionParams", "group___debug.html#structmanifold_1_1_execution_params", null ], + [ "ExportOptions", "group___mesh_i_o.html#structmanifold_1_1_export_options", null ], + [ "Face", "structmanifold_1_1_mesh_builder_1_1_face.html", null ], + [ "fill< Policy >", "structbenchmarks_1_1fill.html", null ], + [ "FindCollisions< T, selfCollision, Recorder >", "structmanifold_1_1collider__internal_1_1_find_collisions.html", null ], + [ "for_each< Policy >", "structbenchmarks_1_1for__each.html", null ], + [ "glm_name< T >", "structglm__name.html", null ], + [ "glm_name< ivec3 >", "structglm__name_3_01ivec3_01_4.html", null ], + [ "glm_name< mat3x2 >", "structglm__name_3_01mat3x2_01_4.html", null ], + [ "glm_name< mat4x3 >", "structglm__name_3_01mat4x3_01_4.html", null ], + [ "glm_name< vec2 >", "structglm__name_3_01vec2_01_4.html", null ], + [ "glm_name< vec3 >", "structglm__name_3_01vec3_01_4.html", null ], + [ "GyroidSDF", "struct_gyroid_s_d_f.html", null ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "HalfEdgeMesh", "classmanifold_1_1_half_edge_mesh.html", null ], + [ "hash< manifold::ivec4 >", "structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html", null ], + [ "hash< std::pair< int, int > >", "structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html", null ], + [ "HashTable< V, H >", "classmanifold_1_1_hash_table.html", null ], + [ "HashTableD< V, H >", "classmanifold_1_1_hash_table_d.html", null ], + [ "HullImpl", "class_hull_impl.html", [ + [ "HullImplCGAL", "class_hull_impl_c_g_a_l.html", null ], + [ "HullImplOriginal", "class_hull_impl_original.html", null ] + ] ], + [ "Identity< T >", "structmanifold_1_1_identity.html", null ], + [ "Impl", "structmanifold_1_1_manifold_1_1_impl.html", null ], + [ "Layers", "struct_layers.html", null ], + [ "Manifold", "classmanifold_1_1_manifold.html", null ], + [ "ManifoldIVec3", "struct_manifold_i_vec3.html", null ], + [ "ManifoldManifoldPair", "struct_manifold_manifold_pair.html", null ], + [ "ManifoldProperties", "struct_manifold_properties.html", null ], + [ "ManifoldVec2", "struct_manifold_vec2.html", null ], + [ "ManifoldVec3", "struct_manifold_vec3.html", null ], + [ "ManifoldVec4", "struct_manifold_vec4.html", null ], + [ "Material", "group___mesh_i_o.html#structmanifold_1_1_material", null ], + [ "Mesh", "group___connections.html#structmanifold_1_1_mesh", null ], + [ "MeshBuilder", "classmanifold_1_1_mesh_builder.html", null ], + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", null ], + [ "MeshRelationD", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_mesh_relation_d", null ], + [ "MeshSize", "struct_mesh_size.html", null ], + [ "Negate< T >", "structmanifold_1_1_negate.html", null ], + [ "Options", "struct_options.html", null ], + [ "ParCollisionRecorder< inverted >", "structmanifold_1_1collider__internal_1_1_par_collision_recorder.html", null ], + [ "PathImpl", "structmanifold_1_1_path_impl.html", null ], + [ "Plane", "classmanifold_1_1_plane.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", null ], + [ "Pool", "classmanifold_1_1_pool.html", null ], + [ "Properties", "group___connections.html#structmanifold_1_1_properties", null ], + [ "Quality", "classmanifold_1_1_quality.html", null ], + [ "QuickHull", "classmanifold_1_1_quick_hull.html", null ], + [ "Ray", "structmanifold_1_1_ray.html", null ], + [ "Rect", "structmanifold_1_1_rect.html", null ], + [ "reduce< Policy >", "structbenchmarks_1_1reduce.html", null ], + [ "ReindexEdge< inverted >", "structmanifold_1_1_reindex_edge.html", null ], + [ "Relation", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation", null ], + [ "Result", "struct_result.html", null ], + [ "runtime_error", null, [ + [ "geometryErr", "structmanifold_1_1geometry_err.html", null ], + [ "topologyErr", "structmanifold_1_1topology_err.html", null ], + [ "userErr", "structmanifold_1_1user_err.html", null ] + ] ], + [ "SeqCollisionRecorder< inverted >", "structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html", null ], + [ "SharedPtrGuard", "classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html", null ], + [ "Smoothness", "group___connections.html#structmanifold_1_1_smoothness", null ], + [ "sort_Asc< Policy >", "structbenchmarks_1_1sort___asc.html", null ], + [ "sort_Asc_size< Policy >", "structbenchmarks_1_1sort___asc__size.html", null ], + [ "sort_Asc_size_merge< Policy >", "structbenchmarks_1_1sort___asc__size__merge.html", null ], + [ "sort_Des< Policy >", "structbenchmarks_1_1sort___des.html", null ], + [ "sort_Des_size< Policy >", "structbenchmarks_1_1sort___des__size.html", null ], + [ "sort_Des_size_merge< Policy >", "structbenchmarks_1_1sort___des__size__merge.html", null ], + [ "sort_Eq< Policy >", "structbenchmarks_1_1sort___eq.html", null ], + [ "sort_Eq_size< Policy >", "structbenchmarks_1_1sort___eq__size.html", null ], + [ "sort_Eq_size_merge< Policy >", "structbenchmarks_1_1sort___eq__size__merge.html", null ], + [ "sort_Rnd< Policy >", "structbenchmarks_1_1sort___rnd.html", null ], + [ "sort_Rnd_size< Policy >", "structbenchmarks_1_1sort___rnd__size.html", null ], + [ "sort_Rnd_size_merge< Policy >", "structbenchmarks_1_1sort___rnd__size__merge.html", null ], + [ "sort_roughly_Asc< Policy >", "structbenchmarks_1_1sort__roughly___asc.html", null ], + [ "sort_roughly_Asc_size< Policy >", "structbenchmarks_1_1sort__roughly___asc__size.html", null ], + [ "sort_roughly_Asc_size_merge< Policy >", "structbenchmarks_1_1sort__roughly___asc__size__merge.html", null ], + [ "SparseIndices", "classmanifold_1_1_sparse_indices.html", null ], + [ "StridedRange< Iter >", "structmanifold_1_1_strided_range.html", null ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "transform_reduce< Policy >", "structbenchmarks_1_1transform__reduce.html", null ], + [ "TransformBox", "structmanifold_1_1collider__internal_1_1_transform_box.html", null ], + [ "TransformIterator< F, Iter >", "structmanifold_1_1_transform_iterator.html", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", null ], + [ "type_caster< glm::mat< C, R, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< glm::vec< N, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< manifold::VecView< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "type_caster< std::vector< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "UnionFind< I, R >", "structmanifold_1_1_union_find.html", null ], + [ "VecView< T >", "classmanifold_1_1_vec_view.html", [ + [ "Vec< int >", "classmanifold_1_1_vec.html", null ], + [ "Vec< vec3 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::Box >", "classmanifold_1_1_vec.html", null ], + [ "Vec< std::pair< int, int > >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::Halfedge >", "classmanifold_1_1_vec.html", null ], + [ "Vec< Uint64 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< V >", "classmanifold_1_1_vec.html", null ], + [ "Vec< vec4 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< double >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::TriRef >", "classmanifold_1_1_vec.html", null ], + [ "Vec< ivec3 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< size_t >", "classmanifold_1_1_vec.html", null ], + [ "Vec< FaceData >", "classmanifold_1_1_vec.html", null ], + [ "Vec< char >", "classmanifold_1_1_vec.html", null ], + [ "Vec< unsigned char >", "classmanifold_1_1_vec.html", null ], + [ "Vec< T >", "classmanifold_1_1_vec.html", null ] + ] ], + [ "VecView< char >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< const manifold::Box >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< const manifold::TmpEdge >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< const std::pair< int, int > >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< const T >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< const uint32_t >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< double >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< FaceData >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< int >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< ivec3 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< manifold::Box >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< manifold::Halfedge >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< manifold::TriRef >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< size_t >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< std::pair< int, int > >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< Uint64 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< unsigned char >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< V >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< vec3 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< vec4 >", "classmanifold_1_1_vec_view.html", null ] +]; \ No newline at end of file diff --git a/docs/html/impl_8h_source.html b/docs/html/impl_8h_source.html new file mode 100644 index 000000000..2bb174b25 --- /dev/null +++ b/docs/html/impl_8h_source.html @@ -0,0 +1,366 @@ + + + + + + + +Manifold: impl.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
impl.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <map>
+
17
+
18#include "manifold/collider.h"
+
19#include "manifold/manifold.h"
+
20#include "manifold/optional_assert.h"
+
21#include "manifold/polygon.h"
+
22#include "manifold/sparse.h"
+
23#include "manifold/utils.h"
+
24#include "manifold/vec.h"
+
25#include "quickhull.h"
+
26#include "shared.h"
+
27
+
28namespace manifold {
+
29
+
+ +
+
32 struct Relation {
+
33 int originalID = -1;
+
34 mat4x3 transform = mat4x3(1);
+
35 bool backSide = false;
+
36 };
+
+
+ +
39 int originalID = -1;
+
40 int numProp = 0;
+
41 Vec<double> properties;
+
42 std::map<int, Relation> meshIDtransform;
+
43 Vec<TriRef> triRef;
+
44 Vec<ivec3> triProperties;
+
45 };
+
+
+
46 struct BaryIndices {
+
47 int tri, start4, end4;
+
48 };
+
+
49
+
50 Box bBox_;
+
51 double precision_ = -1;
+
52 Error status_ = Error::NoError;
+
53 Vec<vec3> vertPos_;
+
54 Vec<Halfedge> halfedge_;
+
55 Vec<vec3> vertNormal_;
+
56 Vec<vec3> faceNormal_;
+
57 Vec<vec4> halfedgeTangent_;
+
58 MeshRelationD meshRelation_;
+
59 Collider collider_;
+
60
+
61 static std::atomic<uint32_t> meshIDCounter_;
+
62 static uint32_t ReserveIDs(uint32_t);
+
63
+
64 Impl() {}
+
65 enum class Shape { Tetrahedron, Cube, Octahedron };
+
66 Impl(Shape, const mat4x3 = mat4x3(1));
+
67
+
68 Impl(const MeshGL&, std::vector<float> propertyTolerance = {});
+
69 Impl(const Mesh&, const MeshRelationD& relation,
+
70 const std::vector<double>& propertyTolerance = {},
+
71 bool hasFaceIDs = false);
+
72
+
73 inline void ForVert(int halfedge, std::function<void(int halfedge)> func) {
+
74 int current = halfedge;
+
75 do {
+
76 current = NextHalfedge(halfedge_[current].pairedHalfedge);
+
77 func(current);
+
78 } while (current != halfedge);
+
79 }
+
80
+
81 template <typename T>
+
82 void ForVert(
+
83 int halfedge, std::function<T(int halfedge)> transform,
+
84 std::function<void(int halfedge, const T& here, T& next)> binaryOp) {
+
85 T here = transform(halfedge);
+
86 int current = halfedge;
+
87 do {
+
88 const int nextHalfedge = NextHalfedge(halfedge_[current].pairedHalfedge);
+
89 T next = transform(nextHalfedge);
+
90 binaryOp(current, here, next);
+
91 here = next;
+
92 current = nextHalfedge;
+
93 } while (current != halfedge);
+
94 }
+
95
+
96 void CreateFaces(const std::vector<double>& propertyTolerance = {});
+
97 void RemoveUnreferencedVerts();
+
98 void InitializeOriginal();
+
99 void CreateHalfedges(const Vec<ivec3>& triVerts);
+
100 void CalculateNormals();
+
101 void IncrementMeshIDs();
+
102
+
103 void Update();
+
104 void MarkFailure(Error status);
+
105 void Warp(std::function<void(vec3&)> warpFunc);
+
106 void WarpBatch(std::function<void(VecView<vec3>)> warpFunc);
+
107 Impl Transform(const mat4x3& transform) const;
+
108 SparseIndices EdgeCollisions(const Impl& B, bool inverted = false) const;
+
109 SparseIndices VertexCollisionsZ(VecView<const vec3> vertsIn,
+
110 bool inverted = false) const;
+
111
+
112 bool IsEmpty() const { return NumTri() == 0; }
+
113 size_t NumVert() const { return vertPos_.size(); }
+
114 size_t NumEdge() const { return halfedge_.size() / 2; }
+
115 size_t NumTri() const { return halfedge_.size() / 3; }
+
116 size_t NumProp() const { return meshRelation_.numProp; }
+
117 size_t NumPropVert() const {
+
118 return NumProp() == 0 ? NumVert()
+
119 : meshRelation_.properties.size() / NumProp();
+
120 }
+
121
+
122 // properties.cu
+
123 Properties GetProperties() const;
+
124 void CalculateCurvature(int gaussianIdx, int meanIdx);
+
125 void CalculateBBox();
+
126 bool IsFinite() const;
+
127 bool IsIndexInBounds(VecView<const ivec3> triVerts) const;
+
128 void SetPrecision(double minPrecision = -1);
+
129 bool IsManifold() const;
+
130 bool Is2Manifold() const;
+
131 bool MatchesTriNormals() const;
+
132 int NumDegenerateTris() const;
+
133 double MinGap(const Impl& other, double searchLength) const;
+
134
+
135 // sort.cu
+
136 void Finish();
+
137 void SortVerts();
+
138 void ReindexVerts(const Vec<int>& vertNew2Old, size_t numOldVert);
+
139 void CompactProps();
+
140 void GetFaceBoxMorton(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton) const;
+
141 void SortFaces(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton);
+
142 void GatherFaces(const Vec<int>& faceNew2Old);
+
143 void GatherFaces(const Impl& old, const Vec<int>& faceNew2Old);
+
144
+
145 // face_op.cu
+
146 void Face2Tri(const Vec<int>& faceEdge, const Vec<TriRef>& halfedgeRef);
+
147 PolygonsIdx Face2Polygons(VecView<Halfedge>::IterC start,
+
148 VecView<Halfedge>::IterC end,
+
149 mat3x2 projection) const;
+
150 Polygons Slice(double height) const;
+
151 Polygons Project() const;
+
152
+
153 // edge_op.cu
+
154 void CleanupTopology();
+
155 void SimplifyTopology();
+
156 void DedupeEdge(int edge);
+
157 void CollapseEdge(int edge, std::vector<int>& edges);
+
158 void RecursiveEdgeSwap(int edge, int& tag, std::vector<int>& visited,
+
159 std::vector<int>& edgeSwapStack,
+
160 std::vector<int>& edges);
+
161 void RemoveIfFolded(int edge);
+
162 void PairUp(int edge0, int edge1);
+
163 void UpdateVert(int vert, int startEdge, int endEdge);
+
164 void FormLoop(int current, int end);
+
165 void CollapseTri(const ivec3& triEdge);
+
166 void SplitPinchedVerts();
+
167
+
168 // subdivision.cpp
+
169 int GetNeighbor(int tri) const;
+
170 ivec4 GetHalfedges(int tri) const;
+
171 BaryIndices GetIndices(int halfedge) const;
+
172 void FillRetainedVerts(Vec<Barycentric>& vertBary) const;
+
173 Vec<Barycentric> Subdivide(std::function<int(vec3)>);
+
174
+
175 // smoothing.cpp
+
176 bool IsInsideQuad(int halfedge) const;
+
177 bool IsMarkedInsideQuad(int halfedge) const;
+
178 vec3 GetNormal(int halfedge, int normalIdx) const;
+
179 vec4 TangentFromNormal(const vec3& normal, int halfedge) const;
+
180 std::vector<Smoothness> UpdateSharpenedEdges(
+
181 const std::vector<Smoothness>&) const;
+
182 Vec<bool> FlatFaces() const;
+
183 Vec<int> VertFlatFace(const Vec<bool>&) const;
+
184 Vec<int> VertHalfedge() const;
+
185 std::vector<Smoothness> SharpenEdges(double minSharpAngle,
+
186 double minSmoothness) const;
+
187 void SharpenTangent(int halfedge, double smoothness);
+
188 void SetNormals(int normalIdx, double minSharpAngle);
+ +
190 void DistributeTangents(const Vec<bool>& fixedHalfedges);
+
191 void CreateTangents(int normalIdx);
+
192 void CreateTangents(std::vector<Smoothness>);
+
193 void Refine(std::function<int(vec3)>);
+
194
+
195 // quickhull.cpp
+
196 void Hull(VecView<vec3> vertPos);
+
197};
+
+
198} // namespace manifold
+
Definition collider.h:278
+
Manifold Hull() const
Definition manifold.cpp:923
+
Definition vec.h:43
+
Definition meshIO.h:20
+
Definition common.h:200
+
Definition impl.h:31
+
void FillRetainedVerts(Vec< Barycentric > &vertBary) const
Definition subdivision.cpp:458
+
void IncrementMeshIDs()
Definition impl.cpp:814
+
void SharpenTangent(int halfedge, double smoothness)
Definition smoothing.cpp:425
+
bool IsManifold() const
Definition properties.cpp:199
+
bool IsFinite() const
Definition properties.cpp:335
+
Vec< Barycentric > Subdivide(std::function< int(vec3)>)
Definition subdivision.cpp:478
+
void SetPrecision(double minPrecision=-1)
Definition impl.cpp:777
+
void CalculateBBox()
Definition properties.cpp:314
+
PolygonsIdx Face2Polygons(VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, mat3x2 projection) const
Definition face_op.cpp:199
+
vec4 TangentFromNormal(const vec3 &normal, int halfedge) const
Definition smoothing.cpp:277
+
BaryIndices GetIndices(int halfedge) const
Definition subdivision.cpp:430
+
void SimplifyTopology()
Definition edge_op.cpp:191
+
SparseIndices VertexCollisionsZ(VecView< const vec3 > vertsIn, bool inverted=false) const
Definition impl.cpp:868
+
bool MatchesTriNormals() const
Definition properties.cpp:229
+
void ReindexVerts(const Vec< int > &vertNew2Old, size_t numOldVert)
Definition sort.cpp:224
+
void LinearizeFlatTangents()
Definition smoothing.cpp:645
+
bool Is2Manifold() const
Definition properties.cpp:209
+
bool IsMarkedInsideQuad(int halfedge) const
Definition smoothing.cpp:322
+
int GetNeighbor(int tri) const
Definition subdivision.cpp:387
+
void CleanupTopology()
Definition edge_op.cpp:128
+
void SortVerts()
Definition sort.cpp:184
+
void SortFaces(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)
Definition sort.cpp:305
+
int originalID
The originalID of this Manifold if it is an original; -1 otherwise.
Definition impl.h:39
+
bool IsInsideQuad(int halfedge) const
Definition smoothing.cpp:291
+
bool IsIndexInBounds(VecView< const ivec3 > triVerts) const
Definition properties.cpp:346
+
void CreateHalfedges(const Vec< ivec3 > &triVerts)
Definition impl.cpp:599
+
void GatherFaces(const Vec< int > &faceNew2Old)
Definition sort.cpp:334
+
void SetNormals(int normalIdx, double minSharpAngle)
Definition smoothing.cpp:436
+
vec3 GetNormal(int halfedge, int normalIdx) const
Definition smoothing.cpp:261
+
void CreateTangents(int normalIdx)
Definition smoothing.cpp:769
+
void CalculateNormals()
Definition impl.cpp:793
+
void DistributeTangents(const Vec< bool > &fixedHalfedges)
Definition smoothing.cpp:678
+
void GetFaceBoxMorton(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) const
Definition sort.cpp:273
+
ivec4 GetHalfedges(int tri) const
Definition subdivision.cpp:403
+
void Update()
Definition impl.cpp:679
+
void Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)
Definition face_op.cpp:40
+
void CompactProps()
Definition sort.cpp:237
+
void Finish()
Definition sort.cpp:123
+
int NumDegenerateTris() const
Definition properties.cpp:238
+
SparseIndices EdgeCollisions(const Impl &B, bool inverted=false) const
Definition impl.cpp:836
+ + + +
Definition manifold.h:46
+
+
+ + + + diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 000000000..58c9ed5e4 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,127 @@ + + + + + + + +Manifold: Python Bindings + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Python Bindings
+
+
+

+

+Autogenerated Doc-Strings

+

Doc-strings for the python API wrapper are generated by gen_docs.py The script is run automatically during the build to keep python doc strings fully up-to-date with c++ sources.

+

It scrapes documentation comments and c++ function signatures from the manifold c++ sources, in order to generate a c++ header file exposing the comments as string variables named by function names. This allows python bindings to re-use the c++ comments directly.

+

Some snake-casing of params is applied for python use case.

+
+

When modifying the Manifold C++ sources, you may need to update gen_docs.py. For example, top-level free functions are white-listed, so if you add a new one, you will need to add it in gen_docs.py.

+

Similarly, the list of source files to parse is also white listed, so if you define functions in new files that need python wrappers, you will also need to up gen_docs.py.

+

To verify that python docs are correct after changes, you can run the following commends from the manifold repo root:

pip install .
+
python -c 'import manifold3d; help(manifold3d)'
+

Alternatively you could generate stubs with roughly the same info

pip install nanobind-stubgen
+
pip install .
+
nanobind-stubgen manifold3d
+

It will emit some warnings and write a file manifold3d.pyi which will show all the function signatures and docstrings.

+
+
+
+ + + + diff --git a/docs/html/index.js b/docs/html/index.js new file mode 100644 index 000000000..baf35f784 --- /dev/null +++ b/docs/html/index.js @@ -0,0 +1,4 @@ +var index = +[ + [ "Autogenerated Doc-Strings", "index.html#autotoc_md1", null ] +]; \ No newline at end of file diff --git a/docs/html/iters_8h_source.html b/docs/html/iters_8h_source.html new file mode 100644 index 000000000..0d96952ec --- /dev/null +++ b/docs/html/iters_8h_source.html @@ -0,0 +1,428 @@ + + + + + + + +Manifold: iters.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
iters.h
+
+
+
1// Copyright 2024 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14#pragma once
+
15
+
16#include <iterator>
+
17#include <type_traits>
+
18
+
19namespace manifold {
+
20
+
21template <typename F, typename Iter>
+
+ +
23 private:
+
24 Iter iter;
+
25 F f;
+
26
+
27 public:
+
28 using pointer = void;
+
29 using reference = std::invoke_result_t<
+
30 F, typename std::iterator_traits<std::remove_const_t<Iter>>::value_type>;
+
31 using difference_type =
+
32 typename std::iterator_traits<std::remove_const_t<Iter>>::difference_type;
+
33 using value_type = reference;
+
34 using iterator_category = typename std::iterator_traits<
+
35 std::remove_const_t<Iter>>::iterator_category;
+
36
+
37 TransformIterator(Iter iter, F f) : iter(iter), f(f) {}
+
38
+
39 TransformIterator& operator=(const TransformIterator& other) {
+
40 if (this == &other) return *this;
+
41 // don't copy function, should be the same
+
42 iter = other.iter;
+
43 return *this;
+
44 }
+
45
+
46 reference operator*() const { return f(*iter); }
+
47
+
48 reference operator[](size_t i) const { return f(iter[i]); }
+
49
+
50 // prefix increment
+
51 TransformIterator& operator++() {
+
52 iter += 1;
+
53 return *this;
+
54 }
+
55
+
56 // postfix
+
57 TransformIterator operator++(int) {
+
58 auto old = *this;
+
59 operator++();
+
60 return old;
+
61 }
+
62
+
63 // prefix increment
+
64 TransformIterator& operator--() {
+
65 iter -= 1;
+
66 return *this;
+
67 }
+
68
+
69 // postfix
+
70 TransformIterator operator--(int) {
+
71 auto old = *this;
+
72 operator--();
+
73 return old;
+
74 }
+
75
+
76 TransformIterator operator+(size_t n) const {
+
77 return TransformIterator(iter + n, f);
+
78 }
+
79
+
80 TransformIterator& operator+=(size_t n) {
+
81 iter += n;
+
82 return *this;
+
83 }
+
84
+
85 TransformIterator operator-(size_t n) const {
+
86 return TransformIterator(iter - n, f);
+
87 }
+
88
+
89 TransformIterator& operator-=(size_t n) {
+
90 iter -= n;
+
91 return *this;
+
92 }
+
93
+
94 bool operator==(TransformIterator other) const { return iter == other.iter; }
+
95
+
96 bool operator!=(TransformIterator other) const {
+
97 return !(iter == other.iter);
+
98 }
+
99
+
100 bool operator<(TransformIterator other) const { return iter < other.iter; }
+
101
+
102 difference_type operator-(TransformIterator other) const {
+
103 return iter - other.iter;
+
104 }
+
105
+
106 operator TransformIterator<F, const Iter>() const {
+
107 return TransformIterator(f, iter);
+
108 }
+
109};
+
+
110
+
111template <typename T>
+
+ +
113 private:
+
114 T counter;
+
115
+
116 public:
+
117 using pointer = void;
+
118 using reference = T;
+
119 using difference_type = std::make_signed_t<T>;
+
120 using value_type = T;
+
121 using iterator_category = std::random_access_iterator_tag;
+
122
+
123 CountingIterator(T counter) : counter(counter) {}
+
124
+
125 value_type operator*() const { return counter; }
+
126 value_type operator[](T i) const { return counter + i; }
+
127
+
128 // prefix increment
+
129 CountingIterator& operator++() {
+
130 counter += 1;
+
131 return *this;
+
132 }
+
133
+
134 // postfix
+
135 CountingIterator operator++(int) {
+
136 auto old = *this;
+
137 operator++();
+
138 return old;
+
139 }
+
140
+
141 // prefix increment
+
142 CountingIterator& operator--() {
+
143 counter -= 1;
+
144 return *this;
+
145 }
+
146
+
147 // postfix
+
148 CountingIterator operator--(int) {
+
149 auto old = *this;
+
150 operator--();
+
151 return old;
+
152 }
+
153
+
154 CountingIterator operator+(T n) const {
+
155 return CountingIterator(counter + n);
+
156 }
+
157
+
158 CountingIterator& operator+=(T n) {
+
159 counter += n;
+
160 return *this;
+
161 }
+
162
+
163 CountingIterator operator-(T n) const {
+
164 return CountingIterator(counter - n);
+
165 }
+
166
+
167 CountingIterator& operator-=(T n) {
+
168 counter -= n;
+
169 return *this;
+
170 }
+
171
+
172 friend bool operator==(CountingIterator a, CountingIterator b) {
+
173 return a.counter == b.counter;
+
174 }
+
175
+
176 friend bool operator!=(CountingIterator a, CountingIterator b) {
+
177 return a.counter != b.counter;
+
178 }
+
179
+
180 friend bool operator<(CountingIterator a, CountingIterator b) {
+
181 return a.counter < b.counter;
+
182 }
+
183
+
184 friend difference_type operator-(CountingIterator a, CountingIterator b) {
+
185 return a.counter - b.counter;
+
186 }
+
187
+
188 operator CountingIterator<const T>() const {
+
189 return CountingIterator(counter);
+
190 }
+
191};
+
+
192
+
193template <typename T>
+
194CountingIterator<T> countAt(T i) {
+
195 return CountingIterator(i);
+
196}
+
197
+
198template <typename Iter>
+
+ +
200 private:
+
201 struct StridedRangeIter {
+
202 private:
+
203 Iter iter;
+
204 size_t stride;
+
205
+
206 public:
+
207 using pointer =
+
208 typename std::iterator_traits<std::remove_const_t<Iter>>::pointer;
+
209 using reference =
+
210 typename std::iterator_traits<std::remove_const_t<Iter>>::reference;
+
211 using difference_type = typename std::iterator_traits<
+
212 std::remove_const_t<Iter>>::difference_type;
+
213 using value_type =
+
214 typename std::iterator_traits<std::remove_const_t<Iter>>::value_type;
+
215 using iterator_category = typename std::iterator_traits<
+
216 std::remove_const_t<Iter>>::iterator_category;
+
217
+
218 StridedRangeIter(Iter iter, int stride) : iter(iter), stride(stride) {}
+
219
+
220 reference operator*() { return *iter; }
+
221
+
222 std::add_const_t<reference> operator*() const { return *iter; }
+
223
+
224 reference operator[](size_t i) { return iter[i * stride]; }
+
225
+
226 std::add_const_t<reference> operator[](size_t i) const {
+
227 return iter[i * stride];
+
228 }
+
229
+
230 // prefix increment
+
231 StridedRangeIter& operator++() {
+
232 iter += stride;
+
233 return *this;
+
234 }
+
235
+
236 // postfix
+
237 StridedRangeIter operator++(int) {
+
238 auto old = *this;
+
239 operator++();
+
240 return old;
+
241 }
+
242
+
243 // prefix increment
+
244 StridedRangeIter& operator--() {
+
245 iter -= stride;
+
246 return *this;
+
247 }
+
248
+
249 // postfix
+
250 StridedRangeIter operator--(int) {
+
251 auto old = *this;
+
252 operator--();
+
253 return old;
+
254 }
+
255
+
256 StridedRangeIter operator+(size_t n) const {
+
257 return StridedRangeIter(iter + n * stride, stride);
+
258 }
+
259
+
260 StridedRangeIter& operator+=(size_t n) {
+
261 iter += n * stride;
+
262 return *this;
+
263 }
+
264
+
265 StridedRangeIter operator-(size_t n) const {
+
266 return StridedRangeIter(iter - n * stride, stride);
+
267 }
+
268
+
269 StridedRangeIter& operator-=(size_t n) {
+
270 iter -= n * stride;
+
271 return *this;
+
272 }
+
273
+
274 friend bool operator==(StridedRangeIter a, StridedRangeIter b) {
+
275 return a.iter == b.iter;
+
276 }
+
277
+
278 friend bool operator!=(StridedRangeIter a, StridedRangeIter b) {
+
279 return !(a.iter == b.iter);
+
280 }
+
281
+
282 friend bool operator<(StridedRangeIter a, StridedRangeIter b) {
+
283 return a.iter < b.iter;
+
284 }
+
285
+
286 friend difference_type operator-(StridedRangeIter a, StridedRangeIter b) {
+
287 // note that this is not well-defined if a.stride != b.stride...
+
288 return (a.iter - b.iter) / a.stride;
+
289 }
+
290 };
+
291 Iter _start, _end;
+
292 const size_t stride;
+
293
+
294 public:
+
295 StridedRange(Iter start, Iter end, size_t stride)
+
296 : _start(start), _end(end), stride(stride) {}
+
297
+
298 StridedRangeIter begin() const { return StridedRangeIter(_start, stride); }
+
299
+
300 StridedRangeIter end() const {
+
301 return StridedRangeIter(_start, stride) +
+
302 ((std::distance(_start, _end) + (stride - 1)) / stride);
+
303 }
+
304};
+
+
305
+
306} // namespace manifold
+
Definition meshIO.h:20
+
Definition iters.h:112
+
Definition iters.h:199
+
Definition iters.h:22
+
+
+ + + + diff --git a/docs/html/jquery.js b/docs/html/jquery.js new file mode 100644 index 000000000..1dffb65b5 --- /dev/null +++ b/docs/html/jquery.js @@ -0,0 +1,34 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/docs/html/manifold_8h_source.html b/docs/html/manifold_8h_source.html new file mode 100644 index 000000000..bcdd2ba19 --- /dev/null +++ b/docs/html/manifold_8h_source.html @@ -0,0 +1,387 @@ + + + + + + + +Manifold: manifold.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <functional>
+
17#include <memory>
+
18
+
19#include "manifold/common.h"
+
20#include "manifold/vec_view.h"
+
21
+
22namespace manifold {
+
23
+
31ExecutionParams& ManifoldParams();
+
32
+
33class CsgNode;
+
34class CsgLeafNode;
+
35
+
+
46struct MeshGL {
+
+
48 uint32_t NumVert() const {
+
49 ASSERT(vertProperties.size() / numProp <
+
50 static_cast<size_t>(std::numeric_limits<uint32_t>::max()),
+
51 std::out_of_range("mesh too large for MeshGL"));
+
52 return vertProperties.size() / numProp;
+
53 };
+
+
+
55 uint32_t NumTri() const {
+
56 ASSERT(triVerts.size() / 3 <
+
57 static_cast<size_t>(std::numeric_limits<uint32_t>::max()),
+
58 std::out_of_range("mesh too large for MeshGL"));
+
59 return triVerts.size() / 3;
+
60 };
+
+
61
+
63 uint32_t numProp = 3;
+
67 std::vector<float> vertProperties;
+
70 std::vector<uint32_t> triVerts;
+
73 std::vector<uint32_t> mergeFromVert;
+
77 std::vector<uint32_t> mergeToVert;
+
85 std::vector<uint32_t> runIndex;
+
91 std::vector<uint32_t> runOriginalID;
+
96 std::vector<float> runTransform;
+
104 std::vector<uint32_t> faceID;
+
109 std::vector<float> halfedgeTangent;
+
114 float precision = 0;
+
115
+
116 MeshGL() = default;
+
117 MeshGL(const Mesh& mesh);
+
118
+
119 bool Merge();
+
120};
+
+
+
152class Manifold {
+
153 public:
+
158 Manifold();
+
159 ~Manifold();
+
160 Manifold(const Manifold& other);
+
161 Manifold& operator=(const Manifold& other);
+
162 Manifold(Manifold&&) noexcept;
+
163 Manifold& operator=(Manifold&&) noexcept;
+
164
+
165 Manifold(const MeshGL&, const std::vector<float>& propertyTolerance = {});
+
166 Manifold(const Mesh&);
+
167
+
168 static Manifold Smooth(const MeshGL&,
+
169 const std::vector<Smoothness>& sharpenedEdges = {});
+
170 static Manifold Smooth(const Mesh&,
+
171 const std::vector<Smoothness>& sharpenedEdges = {});
+
172 static Manifold Tetrahedron();
+
173 static Manifold Cube(vec3 size = vec3(1.0), bool center = false);
+
174 static Manifold Cylinder(double height, double radiusLow,
+
175 double radiusHigh = -1.0, int circularSegments = 0,
+
176 bool center = false);
+
177 static Manifold Sphere(double radius, int circularSegments = 0);
+
178 static Manifold Extrude(const Polygons& crossSection, double height,
+
179 int nDivisions = 0, double twistDegrees = 0.0,
+
180 vec2 scaleTop = vec2(1.0));
+
181 static Manifold Revolve(const Polygons& crossSection,
+
182 int circularSegments = 0,
+
183 double revolveDegrees = 360.0f);
+
184 static Manifold LevelSet(std::function<double(vec3)> sdf, Box bounds,
+
185 double edgeLength, double level = 0,
+
186 double precision = -1, bool canParallel = true);
+
188
+
193 static Manifold Compose(const std::vector<Manifold>&);
+
194 std::vector<Manifold> Decompose() const;
+
196
+
201 Mesh GetMesh() const;
+
202 MeshGL GetMeshGL(ivec3 normalIdx = ivec3(0)) const;
+
203 bool IsEmpty() const;
+
204 enum class Error {
+
205 NoError,
+
206 NonFiniteVertex,
+
207 NotManifold,
+
208 VertexOutOfBounds,
+
209 PropertiesWrongLength,
+
210 MissingPositionProperties,
+
211 MergeVectorsDifferentLengths,
+
212 MergeIndexOutOfBounds,
+
213 TransformWrongLength,
+
214 RunIndexWrongLength,
+
215 FaceIDWrongLength,
+
216 InvalidConstruction,
+
217 };
+
218 Error Status() const;
+
219 int NumVert() const;
+
220 int NumEdge() const;
+
221 int NumTri() const;
+
222 int NumProp() const;
+
223 int NumPropVert() const;
+
224 Box BoundingBox() const;
+
225 double Precision() const;
+
226 int Genus() const;
+ +
228 double MinGap(const Manifold& other, double searchLength) const;
+
230
+
236 int OriginalID() const;
+
237 Manifold AsOriginal() const;
+
238 static uint32_t ReserveIDs(uint32_t);
+
240
+
244 Manifold Translate(vec3) const;
+
245 Manifold Scale(vec3) const;
+
246 Manifold Rotate(double xDegrees, double yDegrees = 0.0,
+
247 double zDegrees = 0.0) const;
+
248 Manifold Transform(const mat4x3&) const;
+
249 Manifold Mirror(vec3) const;
+
250 Manifold Warp(std::function<void(vec3&)>) const;
+
251 Manifold WarpBatch(std::function<void(VecView<vec3>)>) const;
+ +
253 int, std::function<void(double*, vec3, const double*)>) const;
+
254 Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const;
+
255 Manifold CalculateNormals(int normalIdx, double minSharpAngle = 60) const;
+
256 Manifold SmoothByNormals(int normalIdx) const;
+
257 Manifold SmoothOut(double minSharpAngle = 60, double minSmoothness = 0) const;
+
258 Manifold Refine(int) const;
+
259 Manifold RefineToLength(double) const;
+
260 // Manifold RefineToPrecision(double);
+
262
+
267 Manifold Boolean(const Manifold& second, OpType op) const;
+
268 static Manifold BatchBoolean(const std::vector<Manifold>& manifolds,
+
269 OpType op);
+
270 // Boolean operation shorthand
+
271 Manifold operator+(const Manifold&) const; // Add (Union)
+ +
273 Manifold operator-(const Manifold&) const; // Subtract (Difference)
+ +
275 Manifold operator^(const Manifold&) const; // Intersect
+ +
277 std::pair<Manifold, Manifold> Split(const Manifold&) const;
+
278 std::pair<Manifold, Manifold> SplitByPlane(vec3 normal,
+
279 double originOffset) const;
+
280 Manifold TrimByPlane(vec3 normal, double originOffset) const;
+
282
+
286 Polygons Slice(double height = 0) const;
+
287 Polygons Project() const;
+
289
+
293 Manifold Hull() const;
+
294 static Manifold Hull(const std::vector<Manifold>& manifolds);
+
295 static Manifold Hull(const std::vector<vec3>& pts);
+
297
+
302 bool MatchesTriNormals() const;
+
303 int NumDegenerateTris() const;
+
304 int NumOverlaps(const Manifold& second) const;
+
306
+
307 struct Impl;
+
308
+
309 private:
+
310 Manifold(std::shared_ptr<CsgNode> pNode_);
+
311 Manifold(std::shared_ptr<Impl> pImpl_);
+
312 static Manifold Invalid();
+
313 mutable std::shared_ptr<CsgNode> pNode_;
+
314
+
315 CsgLeafNode& GetCsgLeafNode() const;
+
316};
+
+
318} // namespace manifold
+
Definition csg_tree.h:41
+
Definition manifold.h:152
+
Manifold SmoothOut(double minSharpAngle=60, double minSmoothness=0) const
Definition manifold.cpp:703
+
int NumOverlaps(const Manifold &second) const
Definition manifold.cpp:472
+
int NumEdge() const
Definition manifold.cpp:363
+
Manifold RefineToLength(double) const
Definition manifold.cpp:751
+
Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const
Definition manifold.cpp:639
+
static Manifold BatchBoolean(const std::vector< Manifold > &manifolds, OpType op)
Definition manifold.cpp:782
+
double MinGap(const Manifold &other, double searchLength) const
Definition manifold.cpp:945
+
static uint32_t ReserveIDs(uint32_t)
Definition manifold.cpp:444
+
Polygons Project() const
Definition manifold.cpp:901
+
MeshGL GetMeshGL(ivec3 normalIdx=ivec3(0)) const
Definition manifold.cpp:182
+
static Manifold Extrude(const Polygons &crossSection, double height, int nDivisions=0, double twistDegrees=0.0, vec2 scaleTop=vec2(1.0))
Definition constructors.cpp:211
+
Box BoundingBox() const
Definition manifold.cpp:384
+
std::pair< Manifold, Manifold > SplitByPlane(vec3 normal, double originOffset) const
Definition manifold.cpp:867
+
Error Status() const
Definition manifold.cpp:353
+
int NumProp() const
Definition manifold.cpp:371
+
int NumTri() const
Definition manifold.cpp:367
+
int Genus() const
Definition manifold.cpp:402
+
Manifold & operator+=(const Manifold &)
Definition manifold.cpp:804
+
Manifold Warp(std::function< void(vec3 &)>) const
Definition manifold.cpp:554
+
Manifold Refine(int) const
Definition manifold.cpp:733
+
static Manifold Sphere(double radius, int circularSegments=0)
Definition constructors.cpp:172
+
std::pair< Manifold, Manifold > Split(const Manifold &) const
Definition manifold.cpp:846
+
bool MatchesTriNormals() const
Definition manifold.cpp:453
+
int OriginalID() const
Definition manifold.cpp:419
+
Manifold SetProperties(int, std::function< void(double *, vec3, const double *)>) const
Definition manifold.cpp:584
+
Mesh GetMesh() const
Definition manifold.cpp:142
+
Manifold WarpBatch(std::function< void(VecView< vec3 >)>) const
Definition manifold.cpp:567
+
Manifold Translate(vec3) const
Definition manifold.cpp:488
+
std::vector< Manifold > Decompose() const
Definition constructors.cpp:450
+
Manifold Rotate(double xDegrees, double yDegrees=0.0, double zDegrees=0.0) const
Definition manifold.cpp:512
+
int NumVert() const
Definition manifold.cpp:359
+
static Manifold Cylinder(double height, double radiusLow, double radiusHigh=-1.0, int circularSegments=0, bool center=false)
Definition constructors.cpp:140
+
Manifold & operator^=(const Manifold &)
Definition manifold.cpp:834
+
static Manifold Revolve(const Polygons &crossSection, int circularSegments=0, double revolveDegrees=360.0f)
Definition constructors.cpp:297
+
bool IsEmpty() const
Definition manifold.cpp:344
+
static Manifold Compose(const std::vector< Manifold > &)
Definition constructors.cpp:437
+
Manifold Boolean(const Manifold &second, OpType op) const
Definition manifold.cpp:774
+
Manifold AsOriginal() const
Definition manifold.cpp:429
+
Manifold Hull() const
Definition manifold.cpp:923
+
Manifold SmoothByNormals(int normalIdx) const
Definition manifold.cpp:677
+
Manifold Scale(vec3) const
Definition manifold.cpp:498
+
Manifold TrimByPlane(vec3 normal, double originOffset) const
Definition manifold.cpp:881
+
int NumPropVert() const
Definition manifold.cpp:377
+
Manifold CalculateNormals(int normalIdx, double minSharpAngle=60) const
Definition manifold.cpp:660
+
Properties GetProperties() const
Definition manifold.cpp:410
+
Polygons Slice(double height=0) const
Definition manifold.cpp:891
+
Manifold operator^(const Manifold &) const
Definition manifold.cpp:827
+
static Manifold Cube(vec3 size=vec3(1.0), bool center=false)
Definition constructors.cpp:119
+
Manifold()
Definition manifold.cpp:68
+
Manifold Mirror(vec3) const
Definition manifold.cpp:536
+
Manifold operator-(const Manifold &) const
Definition manifold.cpp:812
+
Manifold & operator-=(const Manifold &)
Definition manifold.cpp:819
+
double Precision() const
Definition manifold.cpp:393
+
Manifold Transform(const mat4x3 &) const
Definition manifold.cpp:524
+
Manifold operator+(const Manifold &) const
Definition manifold.cpp:797
+
static Manifold Tetrahedron()
Definition constructors.cpp:107
+
int NumDegenerateTris() const
Definition manifold.cpp:462
+
static Manifold Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})
Definition constructors.cpp:49
+
Definition vec_view.h:27
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
Definition common.h:158
+
Definition common.h:196
+
static Manifold LevelSet(std::function< double(vec3)> sdf, Box bounds, double edgeLength, double level=0, double precision=-1, bool canParallel=true)
Definition sdf.cpp:457
+
OpType
Definition common.h:522
+
ExecutionParams & ManifoldParams()
Definition manifold.cpp:905
+
Definition meshIO.h:20
+
Definition common.h:200
+
Definition impl.h:31
+
Definition manifold.h:46
+
std::vector< uint32_t > runIndex
Definition manifold.h:85
+
bool Merge()
Definition sort.cpp:427
+
uint32_t NumVert() const
Number of property vertices.
Definition manifold.h:48
+
std::vector< float > runTransform
Definition manifold.h:96
+
uint32_t NumTri() const
Number of triangles.
Definition manifold.h:55
+
std::vector< float > halfedgeTangent
Definition manifold.h:109
+
std::vector< uint32_t > mergeFromVert
Definition manifold.h:73
+
std::vector< float > vertProperties
Definition manifold.h:67
+
std::vector< uint32_t > runOriginalID
Definition manifold.h:91
+
std::vector< uint32_t > faceID
Definition manifold.h:104
+
float precision
Definition manifold.h:114
+
uint32_t numProp
Number of properties per vertex, always >= 3.
Definition manifold.h:63
+
std::vector< uint32_t > mergeToVert
Definition manifold.h:77
+
std::vector< uint32_t > triVerts
Definition manifold.h:70
+
+
+ + + + diff --git a/docs/html/manifoldc_8h_source.html b/docs/html/manifoldc_8h_source.html new file mode 100644 index 000000000..e2c350acd --- /dev/null +++ b/docs/html/manifoldc_8h_source.html @@ -0,0 +1,564 @@ + + + + + + + +Manifold: manifoldc.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifoldc.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#include <stddef.h>
+
16#include <stdint.h>
+
17
+
18#include "manifold/types.h"
+
19
+
20#ifdef __cplusplus
+
21#include <cstdint>
+
22extern "C" {
+
23#endif
+
24
+
25// Polygons
+
26
+
27ManifoldSimplePolygon *manifold_simple_polygon(void *mem, ManifoldVec2 *ps,
+
28 size_t length);
+
29ManifoldPolygons *manifold_polygons(void *mem, ManifoldSimplePolygon **ps,
+
30 size_t length);
+
31size_t manifold_simple_polygon_length(ManifoldSimplePolygon *p);
+
32size_t manifold_polygons_length(ManifoldPolygons *ps);
+
33size_t manifold_polygons_simple_length(ManifoldPolygons *ps, int idx);
+
34ManifoldVec2 manifold_simple_polygon_get_point(ManifoldSimplePolygon *p,
+
35 int idx);
+
36ManifoldSimplePolygon *manifold_polygons_get_simple(void *mem,
+
37 ManifoldPolygons *ps,
+
38 int idx);
+
39ManifoldVec2 manifold_polygons_get_point(ManifoldPolygons *ps, int simple_idx,
+
40 int pt_idx);
+
41
+
42// Mesh Construction
+
43
+
44ManifoldMeshGL *manifold_meshgl(void *mem, float *vert_props, size_t n_verts,
+
45 size_t n_props, uint32_t *tri_verts,
+
46 size_t n_tris);
+
47
+
48ManifoldMeshGL *manifold_meshgl_w_tangents(void *mem, float *vert_props,
+
49 size_t n_verts, size_t n_props,
+
50 uint32_t *tri_verts, size_t n_tris,
+
51 float *halfedge_tangent);
+
52ManifoldMeshGL *manifold_get_meshgl(void *mem, ManifoldManifold *m);
+
53ManifoldMeshGL *manifold_meshgl_copy(void *mem, ManifoldMeshGL *m);
+
54ManifoldMeshGL *manifold_meshgl_merge(void *mem, ManifoldMeshGL *m);
+
55
+
56// SDF
+
57// By default, the execution policy (sequential or parallel) of
+
58// manifold_level_set will be chosen automatically depending on the size of the
+
59// job and whether Manifold has been compiled with a PAR backend. If you are
+
60// using these bindings from a language that has a runtime lock preventing the
+
61// parallel execution of closures, then you should use manifold_level_set_seq to
+
62// force sequential execution.
+
63ManifoldManifold *manifold_level_set(void *mem,
+
64 double (*sdf)(double, double, double,
+
65 void *),
+
66 ManifoldBox *bounds, double edge_length,
+
67 double level, double precision, void *ctx);
+
68ManifoldManifold *manifold_level_set_seq(
+
69 void *mem, double (*sdf)(double, double, double, void *),
+
70 ManifoldBox *bounds, double edge_length, double level, double precision,
+
71 void *ctx);
+
72
+
73// Manifold Vectors
+
74
+
75ManifoldManifoldVec *manifold_manifold_empty_vec(void *mem);
+
76ManifoldManifoldVec *manifold_manifold_vec(void *mem, size_t sz);
+
77void manifold_manifold_vec_reserve(ManifoldManifoldVec *ms, size_t sz);
+
78size_t manifold_manifold_vec_length(ManifoldManifoldVec *ms);
+
79ManifoldManifold *manifold_manifold_vec_get(void *mem, ManifoldManifoldVec *ms,
+
80 int idx);
+
81void manifold_manifold_vec_set(ManifoldManifoldVec *ms, int idx,
+
82 ManifoldManifold *m);
+
83void manifold_manifold_vec_push_back(ManifoldManifoldVec *ms,
+
84 ManifoldManifold *m);
+
85
+
86// Manifold Booleans
+
87
+
88ManifoldManifold *manifold_boolean(void *mem, ManifoldManifold *a,
+
89 ManifoldManifold *b, ManifoldOpType op);
+
90ManifoldManifold *manifold_batch_boolean(void *mem, ManifoldManifoldVec *ms,
+
91 ManifoldOpType op);
+
92ManifoldManifold *manifold_union(void *mem, ManifoldManifold *a,
+
93 ManifoldManifold *b);
+
94ManifoldManifold *manifold_difference(void *mem, ManifoldManifold *a,
+
95 ManifoldManifold *b);
+
96ManifoldManifold *manifold_intersection(void *mem, ManifoldManifold *a,
+
97 ManifoldManifold *b);
+
98ManifoldManifoldPair manifold_split(void *mem_first, void *mem_second,
+
99 ManifoldManifold *a, ManifoldManifold *b);
+
100ManifoldManifoldPair manifold_split_by_plane(void *mem_first, void *mem_second,
+
101 ManifoldManifold *m,
+
102 double normal_x, double normal_y,
+
103 double normal_z, double offset);
+
104ManifoldManifold *manifold_trim_by_plane(void *mem, ManifoldManifold *m,
+
105 double normal_x, double normal_y,
+
106 double normal_z, double offset);
+
107
+
108// 3D to 2D
+
109
+
110ManifoldPolygons *manifold_slice(void *mem, ManifoldManifold *m, double height);
+
111ManifoldPolygons *manifold_project(void *mem, ManifoldManifold *m);
+
112
+
113// Convex Hulls
+
114
+
115ManifoldManifold *manifold_hull(void *mem, ManifoldManifold *m);
+
116ManifoldManifold *manifold_batch_hull(void *mem, ManifoldManifoldVec *ms);
+
117ManifoldManifold *manifold_hull_pts(void *mem, ManifoldVec3 *ps, size_t length);
+
118
+
119// Manifold Transformations
+
120
+
121ManifoldManifold *manifold_translate(void *mem, ManifoldManifold *m, double x,
+
122 double y, double z);
+
123ManifoldManifold *manifold_rotate(void *mem, ManifoldManifold *m, double x,
+
124 double y, double z);
+
125ManifoldManifold *manifold_scale(void *mem, ManifoldManifold *m, double x,
+
126 double y, double z);
+
127ManifoldManifold *manifold_transform(void *mem, ManifoldManifold *m, double x1,
+
128 double y1, double z1, double x2, double y2,
+
129 double z2, double x3, double y3, double z3,
+
130 double x4, double y4, double z4);
+
131ManifoldManifold *manifold_mirror(void *mem, ManifoldManifold *m, double nx,
+
132 double ny, double nz);
+
133ManifoldManifold *manifold_warp(void *mem, ManifoldManifold *m,
+
134 ManifoldVec3 (*fun)(double, double, double,
+
135 void *),
+
136 void *ctx);
+
137ManifoldManifold *manifold_smooth_by_normals(void *mem, ManifoldManifold *m,
+
138 int normalIdx);
+
139ManifoldManifold *manifold_smooth_out(void *mem, ManifoldManifold *m,
+
140 double minSharpAngle,
+
141 double minSmoothness);
+
142ManifoldManifold *manifold_refine(void *mem, ManifoldManifold *m, int refine);
+
143ManifoldManifold *manifold_refine_to_length(void *mem, ManifoldManifold *m,
+
144 double length);
+
145
+
146// Manifold Shapes / Constructors
+
147
+
148ManifoldManifold *manifold_empty(void *mem);
+
149ManifoldManifold *manifold_copy(void *mem, ManifoldManifold *m);
+
150ManifoldManifold *manifold_tetrahedron(void *mem);
+
151ManifoldManifold *manifold_cube(void *mem, double x, double y, double z,
+
152 int center);
+
153ManifoldManifold *manifold_cylinder(void *mem, double height, double radius_low,
+
154 double radius_high, int circular_segments,
+
155 int center);
+
156ManifoldManifold *manifold_sphere(void *mem, double radius,
+
157 int circular_segments);
+
158ManifoldManifold *manifold_of_meshgl(void *mem, ManifoldMeshGL *mesh);
+
159ManifoldManifold *manifold_smooth(void *mem, ManifoldMeshGL *mesh,
+
160 size_t *half_edges, double *smoothness,
+
161 size_t n_idxs);
+
162ManifoldManifold *manifold_extrude(void *mem, ManifoldPolygons *cs,
+
163 double height, int slices,
+
164 double twist_degrees, double scale_x,
+
165 double scale_y);
+
166ManifoldManifold *manifold_revolve(void *mem, ManifoldPolygons *cs,
+
167 int circular_segments);
+
168ManifoldManifold *manifold_compose(void *mem, ManifoldManifoldVec *ms);
+
169ManifoldManifoldVec *manifold_decompose(void *mem, ManifoldManifold *m);
+
170ManifoldManifold *manifold_as_original(void *mem, ManifoldManifold *m);
+
171
+
172// Manifold Info
+
173
+
174int manifold_is_empty(ManifoldManifold *m);
+
175ManifoldError manifold_status(ManifoldManifold *m);
+
176int manifold_num_vert(ManifoldManifold *m);
+
177int manifold_num_edge(ManifoldManifold *m);
+
178int manifold_num_tri(ManifoldManifold *m);
+
179ManifoldBox *manifold_bounding_box(void *mem, ManifoldManifold *m);
+
180double manifold_precision(ManifoldManifold *m);
+
181int manifold_genus(ManifoldManifold *m);
+
182ManifoldProperties manifold_get_properties(ManifoldManifold *m);
+
183int manifold_get_circular_segments(double radius);
+
184int manifold_original_id(ManifoldManifold *m);
+
185uint32_t manifold_reserve_ids(uint32_t n);
+
186ManifoldManifold *manifold_set_properties(
+
187 void *mem, ManifoldManifold *m, int num_prop,
+
188 void (*fun)(double *new_prop, ManifoldVec3 position, const double *old_prop,
+
189 void *ctx),
+
190 void *ctx);
+
191ManifoldManifold *manifold_calculate_curvature(void *mem, ManifoldManifold *m,
+
192 int gaussian_idx, int mean_idx);
+
193double manifold_min_gap(ManifoldManifold *m, ManifoldManifold *other,
+
194 double searchLength);
+
195ManifoldManifold *manifold_calculate_normals(void *mem, ManifoldManifold *m,
+
196 int normal_idx,
+
197 int min_sharp_angle);
+
198
+
199// CrossSection Shapes/Constructors
+
200
+
201ManifoldCrossSection *manifold_cross_section_empty(void *mem);
+
202ManifoldCrossSection *manifold_cross_section_copy(void *mem,
+
203 ManifoldCrossSection *cs);
+
204ManifoldCrossSection *manifold_cross_section_of_simple_polygon(
+
205 void *mem, ManifoldSimplePolygon *p, ManifoldFillRule fr);
+
206ManifoldCrossSection *manifold_cross_section_of_polygons(void *mem,
+
207 ManifoldPolygons *p,
+
208 ManifoldFillRule fr);
+
209ManifoldCrossSection *manifold_cross_section_square(void *mem, double x,
+
210 double y, int center);
+
211ManifoldCrossSection *manifold_cross_section_circle(void *mem, double radius,
+
212 int circular_segments);
+
213ManifoldCrossSection *manifold_cross_section_compose(
+
214 void *mem, ManifoldCrossSectionVec *csv);
+
215ManifoldCrossSectionVec *manifold_cross_section_decompose(
+
216 void *mem, ManifoldCrossSection *cs);
+
217
+
218// CrossSection Vectors
+
219
+
220ManifoldCrossSectionVec *manifold_cross_section_empty_vec(void *mem);
+
221ManifoldCrossSectionVec *manifold_cross_section_vec(void *mem, size_t sz);
+
222void manifold_cross_section_vec_reserve(ManifoldCrossSectionVec *csv,
+
223 size_t sz);
+
224size_t manifold_cross_section_vec_length(ManifoldCrossSectionVec *csv);
+
225ManifoldCrossSection *manifold_cross_section_vec_get(
+
226 void *mem, ManifoldCrossSectionVec *csv, int idx);
+
227void manifold_cross_section_vec_set(ManifoldCrossSectionVec *csv, int idx,
+
228 ManifoldCrossSection *cs);
+
229void manifold_cross_section_vec_push_back(ManifoldCrossSectionVec *csv,
+
230 ManifoldCrossSection *cs);
+
231
+
232// CrossSection Booleans
+
233
+
234ManifoldCrossSection *manifold_cross_section_boolean(void *mem,
+
235 ManifoldCrossSection *a,
+
236 ManifoldCrossSection *b,
+
237 ManifoldOpType op);
+
238ManifoldCrossSection *manifold_cross_section_batch_boolean(
+
239 void *mem, ManifoldCrossSectionVec *csv, ManifoldOpType op);
+
240ManifoldCrossSection *manifold_cross_section_union(void *mem,
+
241 ManifoldCrossSection *a,
+
242 ManifoldCrossSection *b);
+
243ManifoldCrossSection *manifold_cross_section_difference(
+
244 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
245ManifoldCrossSection *manifold_cross_section_intersection(
+
246 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
247
+
248// CrossSection Convex Hulls
+
249
+
250ManifoldCrossSection *manifold_cross_section_hull(void *mem,
+
251 ManifoldCrossSection *cs);
+
252ManifoldCrossSection *manifold_cross_section_batch_hull(
+
253 void *mem, ManifoldCrossSectionVec *css);
+
254ManifoldCrossSection *manifold_cross_section_hull_simple_polygon(
+
255 void *mem, ManifoldSimplePolygon *ps);
+
256ManifoldCrossSection *manifold_cross_section_hull_polygons(
+
257 void *mem, ManifoldPolygons *ps);
+
258
+
259// CrossSection Transformation
+
260
+
261ManifoldCrossSection *manifold_cross_section_translate(void *mem,
+
262 ManifoldCrossSection *cs,
+
263 double x, double y);
+
264ManifoldCrossSection *manifold_cross_section_rotate(void *mem,
+
265 ManifoldCrossSection *cs,
+
266 double deg);
+
267ManifoldCrossSection *manifold_cross_section_scale(void *mem,
+
268 ManifoldCrossSection *cs,
+
269 double x, double y);
+
270ManifoldCrossSection *manifold_cross_section_mirror(void *mem,
+
271 ManifoldCrossSection *cs,
+
272 double ax_x, double ax_y);
+
273ManifoldCrossSection *manifold_cross_section_transform(void *mem,
+
274 ManifoldCrossSection *cs,
+
275 double x1, double y1,
+
276 double x2, double y2,
+
277 double x3, double y3);
+
278ManifoldCrossSection *manifold_cross_section_warp(
+
279 void *mem, ManifoldCrossSection *cs, ManifoldVec2 (*fun)(double, double));
+
280ManifoldCrossSection *manifold_cross_section_warp_context(
+
281 void *mem, ManifoldCrossSection *cs,
+
282 ManifoldVec2 (*fun)(double, double, void *), void *ctx);
+
283ManifoldCrossSection *manifold_cross_section_simplify(void *mem,
+
284 ManifoldCrossSection *cs,
+
285 double epsilon);
+
286ManifoldCrossSection *manifold_cross_section_offset(
+
287 void *mem, ManifoldCrossSection *cs, double delta, ManifoldJoinType jt,
+
288 double miter_limit, int circular_segments);
+
289
+
290// CrossSection Info
+
291
+
292double manifold_cross_section_area(ManifoldCrossSection *cs);
+
293int manifold_cross_section_num_vert(ManifoldCrossSection *cs);
+
294int manifold_cross_section_num_contour(ManifoldCrossSection *cs);
+
295int manifold_cross_section_is_empty(ManifoldCrossSection *cs);
+
296ManifoldRect *manifold_cross_section_bounds(void *mem,
+
297 ManifoldCrossSection *cs);
+
298ManifoldPolygons *manifold_cross_section_to_polygons(void *mem,
+
299 ManifoldCrossSection *cs);
+
300
+
301// Rectangle
+
302
+
303ManifoldRect *manifold_rect(void *mem, double x1, double y1, double x2,
+
304 double y2);
+
305ManifoldVec2 manifold_rect_min(ManifoldRect *r);
+
306ManifoldVec2 manifold_rect_max(ManifoldRect *r);
+
307ManifoldVec2 manifold_rect_dimensions(ManifoldRect *r);
+
308ManifoldVec2 manifold_rect_center(ManifoldRect *r);
+
309double manifold_rect_scale(ManifoldRect *r);
+
310int manifold_rect_contains_pt(ManifoldRect *r, double x, double y);
+
311int manifold_rect_contains_rect(ManifoldRect *a, ManifoldRect *b);
+
312void manifold_rect_include_pt(ManifoldRect *r, double x, double y);
+
313ManifoldRect *manifold_rect_union(void *mem, ManifoldRect *a, ManifoldRect *b);
+
314ManifoldRect *manifold_rect_transform(void *mem, ManifoldRect *r, double x1,
+
315 double y1, double x2, double y2,
+
316 double x3, double y3);
+
317ManifoldRect *manifold_rect_translate(void *mem, ManifoldRect *r, double x,
+
318 double y);
+
319ManifoldRect *manifold_rect_mul(void *mem, ManifoldRect *r, double x, double y);
+
320int manifold_rect_does_overlap_rect(ManifoldRect *a, ManifoldRect *r);
+
321int manifold_rect_is_empty(ManifoldRect *r);
+
322int manifold_rect_is_finite(ManifoldRect *r);
+
323
+
324// Bounding Box
+
325
+
326ManifoldBox *manifold_box(void *mem, double x1, double y1, double z1, double x2,
+
327 double y2, double z2);
+
328ManifoldVec3 manifold_box_min(ManifoldBox *b);
+
329ManifoldVec3 manifold_box_max(ManifoldBox *b);
+
330ManifoldVec3 manifold_box_dimensions(ManifoldBox *b);
+
331ManifoldVec3 manifold_box_center(ManifoldBox *b);
+
332double manifold_box_scale(ManifoldBox *b);
+
333int manifold_box_contains_pt(ManifoldBox *b, double x, double y, double z);
+
334int manifold_box_contains_box(ManifoldBox *a, ManifoldBox *b);
+
335void manifold_box_include_pt(ManifoldBox *b, double x, double y, double z);
+
336ManifoldBox *manifold_box_union(void *mem, ManifoldBox *a, ManifoldBox *b);
+
337ManifoldBox *manifold_box_transform(void *mem, ManifoldBox *b, double x1,
+
338 double y1, double z1, double x2, double y2,
+
339 double z2, double x3, double y3, double z3,
+
340 double x4, double y4, double z4);
+
341ManifoldBox *manifold_box_translate(void *mem, ManifoldBox *b, double x,
+
342 double y, double z);
+
343ManifoldBox *manifold_box_mul(void *mem, ManifoldBox *b, double x, double y,
+
344 double z);
+
345int manifold_box_does_overlap_pt(ManifoldBox *b, double x, double y, double z);
+
346int manifold_box_does_overlap_box(ManifoldBox *a, ManifoldBox *b);
+
347int manifold_box_is_finite(ManifoldBox *b);
+
348
+
349// Static Quality Globals
+
350
+
351void manifold_set_min_circular_angle(double degrees);
+
352void manifold_set_min_circular_edge_length(double length);
+
353void manifold_set_circular_segments(int number);
+
354
+
355// Manifold Mesh Extraction
+
356
+
357int manifold_meshgl_num_prop(ManifoldMeshGL *m);
+
358int manifold_meshgl_num_vert(ManifoldMeshGL *m);
+
359int manifold_meshgl_num_tri(ManifoldMeshGL *m);
+
360size_t manifold_meshgl_vert_properties_length(ManifoldMeshGL *m);
+
361size_t manifold_meshgl_tri_length(ManifoldMeshGL *m);
+
362size_t manifold_meshgl_merge_length(ManifoldMeshGL *m);
+
363size_t manifold_meshgl_run_index_length(ManifoldMeshGL *m);
+
364size_t manifold_meshgl_run_original_id_length(ManifoldMeshGL *m);
+
365size_t manifold_meshgl_run_transform_length(ManifoldMeshGL *m);
+
366size_t manifold_meshgl_face_id_length(ManifoldMeshGL *m);
+
367size_t manifold_meshgl_tangent_length(ManifoldMeshGL *m);
+
368float *manifold_meshgl_vert_properties(void *mem, ManifoldMeshGL *m);
+
369uint32_t *manifold_meshgl_tri_verts(void *mem, ManifoldMeshGL *m);
+
370uint32_t *manifold_meshgl_merge_from_vert(void *mem, ManifoldMeshGL *m);
+
371uint32_t *manifold_meshgl_merge_to_vert(void *mem, ManifoldMeshGL *m);
+
372uint32_t *manifold_meshgl_run_index(void *mem, ManifoldMeshGL *m);
+
373uint32_t *manifold_meshgl_run_original_id(void *mem, ManifoldMeshGL *m);
+
374float *manifold_meshgl_run_transform(void *mem, ManifoldMeshGL *m);
+
375uint32_t *manifold_meshgl_face_id(void *mem, ManifoldMeshGL *m);
+
376float *manifold_meshgl_halfedge_tangent(void *mem, ManifoldMeshGL *m);
+
377
+
378// memory size
+
379
+
380size_t manifold_manifold_size();
+
381size_t manifold_manifold_vec_size();
+
382size_t manifold_cross_section_size();
+
383size_t manifold_cross_section_vec_size();
+
384size_t manifold_simple_polygon_size();
+
385size_t manifold_polygons_size();
+
386size_t manifold_manifold_pair_size();
+
387size_t manifold_meshgl_size();
+
388size_t manifold_box_size();
+
389size_t manifold_rect_size();
+
390size_t manifold_curvature_size();
+
391
+
392// destruction
+
393
+
394void manifold_destruct_manifold(ManifoldManifold *m);
+
395void manifold_destruct_manifold_vec(ManifoldManifoldVec *ms);
+
396void manifold_destruct_cross_section(ManifoldCrossSection *m);
+
397void manifold_destruct_cross_section_vec(ManifoldCrossSectionVec *csv);
+
398void manifold_destruct_simple_polygon(ManifoldSimplePolygon *p);
+
399void manifold_destruct_polygons(ManifoldPolygons *p);
+
400void manifold_destruct_meshgl(ManifoldMeshGL *m);
+
401void manifold_destruct_box(ManifoldBox *b);
+
402void manifold_destruct_rect(ManifoldRect *b);
+
403
+
404// pointer free + destruction
+
405
+
406void manifold_delete_manifold(ManifoldManifold *m);
+
407void manifold_delete_manifold_vec(ManifoldManifoldVec *ms);
+
408void manifold_delete_cross_section(ManifoldCrossSection *cs);
+
409void manifold_delete_cross_section_vec(ManifoldCrossSectionVec *csv);
+
410void manifold_delete_simple_polygon(ManifoldSimplePolygon *p);
+
411void manifold_delete_polygons(ManifoldPolygons *p);
+
412void manifold_delete_meshgl(ManifoldMeshGL *m);
+
413void manifold_delete_box(ManifoldBox *b);
+
414void manifold_delete_rect(ManifoldRect *b);
+
415
+
416// MeshIO / Export
+
417
+
418#ifdef MANIFOLD_EXPORT
+
419ManifoldMaterial *manifold_material(void *mem);
+
420void manifold_material_set_roughness(ManifoldMaterial *mat, double roughness);
+
421void manifold_material_set_metalness(ManifoldMaterial *mat, double metalness);
+
422void manifold_material_set_color(ManifoldMaterial *mat, ManifoldVec4 color);
+
423void manifold_material_set_vert_color(ManifoldMaterial *mat,
+
424 ManifoldVec4 *vert_color, size_t n_vert);
+
425ManifoldExportOptions *manifold_export_options(void *mem);
+
426void manifold_export_options_set_faceted(ManifoldExportOptions *options,
+
427 int faceted);
+
428void manifold_export_options_set_material(ManifoldExportOptions *options,
+
429 ManifoldMaterial *mat);
+
430void manifold_export_meshgl(const char *filename, ManifoldMeshGL *mesh,
+
431 ManifoldExportOptions *options);
+
432ManifoldMeshGL *manifold_import_meshgl(void *mem, const char *filename,
+
433 int force_cleanup);
+
434
+
435size_t manifold_material_size();
+
436size_t manifold_export_options_size();
+
437
+
438void manifold_destruct_material(ManifoldMaterial *m);
+
439void manifold_destruct_export_options(ManifoldExportOptions *options);
+
440
+
441void manifold_delete_material(ManifoldMaterial *m);
+
442void manifold_delete_export_options(ManifoldExportOptions *options);
+
443#endif
+
444
+
445#ifdef __cplusplus
+
446}
+
447#endif
+
Definition types.h:38
+
Definition types.h:67
+
Definition types.h:43
+
Definition types.h:48
+
Definition types.h:60
+
+
+ + + + diff --git a/docs/html/md__c_o_n_t_r_i_b_u_t_i_n_g.html b/docs/html/md__c_o_n_t_r_i_b_u_t_i_n_g.html new file mode 100644 index 000000000..559e609ec --- /dev/null +++ b/docs/html/md__c_o_n_t_r_i_b_u_t_i_n_g.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: How to Contribute + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
How to Contribute
+
+
+

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

+

+Contributor License Agreement

+

Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

+

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

+

+Code Reviews

+

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.

+

+Community Guidelines

+

This project follows Google's Open Source Community Guidelines.

+
+
+
+ + + + diff --git a/docs/html/md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html b/docs/html/md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html new file mode 100644 index 000000000..49b42dc5e --- /dev/null +++ b/docs/html/md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html @@ -0,0 +1,151 @@ + + + + + + + +Manifold: RELEASE_CHECKLIST + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
RELEASE_CHECKLIST
+
+
+
    +
  1. Go through Github issues to verify bugs have been fixed and closed.
  2. +
+

Verify ManifoldCAD.org - check a few examples, run them, download a GLB and a 3MF.

    +
  1. Verify our three.js example is functional.
  2. +
+
    +
  1. Verify our model-viewer example is functional - select Union and Intersection.
  2. +
+
    +
  1. Verify make-manifold is functional. Try dropping DragonAttenuation.glb in and verify you can select "View Manifold GLB" and that the dragon is still present while the backdrop is removed. Download the GLB.
  2. +
+
    +
  1. Make a new branch called the version, e.g. v2.3.0.
  2. +
+
    +
  1. Use VSCode to search and replace the old version with the new - so far in test-cmake.sh, flake.nix, pyproject.toml, and package.json.
  2. +
+
    +
  1. Also update CMakeLists.txt version by searching for "set(MANIFOLD_VERSION_".
  2. +
+
    +
  1. Commit, push, open a PR, verify tests pass, merge.
  2. +
+
    +
  1. On Github, draft a new release, make a new tag with the version number, add release notes, and publish.
  2. +
+
    +
  1. Check the Actions and verify that both PyPI and npm publishing actions ran successfully.
  2. +
+
    +
  1. Verify the npm package looks good - unpacked size should be close to 1MB.
  2. +
+
    +
  1. Verify PyPI package looks good - a bunch of built distributions ranging from ~600kB to ~1.1MB.
  2. +
+
    +
  1. If there's a problem with release deployment, the release workflows can be triggered separately, manually for any branch, under the Actions tab.
  2. +
+
+
+
+ + + + diff --git a/docs/html/md_bindings_2wasm_2documents_2_get_01_started.html b/docs/html/md_bindings_2wasm_2documents_2_get_01_started.html new file mode 100644 index 000000000..c7f826317 --- /dev/null +++ b/docs/html/md_bindings_2wasm_2documents_2_get_01_started.html @@ -0,0 +1,131 @@ + + + + + + + +Manifold: Get Started + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Get Started
+
+
+

+

+Installation

+

In your project root folder run:

+
npm i manifold-3d
+

To start using Manifold, import it and initialize it:

+
import Module from 'manifold-3d';
+
+
const wasm = await Module();
+
wasm.setup();
+
const { Manifold } = wasm;
+

Intro example

+
const {cube, sphere} = Manifold;
+
const box = cube([100, 100, 100], true);
+
const ball = sphere(60, 100);
+
const result = box.subtract(ball);
+

+Next steps

+

In order to visualize Manifold mesh using Three.js library please check out our example here

+
+
+
+ + + + diff --git a/docs/html/mesh__fixes_8h_source.html b/docs/html/mesh__fixes_8h_source.html new file mode 100644 index 000000000..23284aa28 --- /dev/null +++ b/docs/html/mesh__fixes_8h_source.html @@ -0,0 +1,165 @@ + + + + + + + +Manifold: mesh_fixes.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
mesh_fixes.h
+
+
+
1#include "impl.h"
+
2
+
3namespace {
+
4using namespace manifold;
+
5
+
6inline int FlipHalfedge(int halfedge) {
+
7 const int tri = halfedge / 3;
+
8 const int vert = 2 - (halfedge - 3 * tri);
+
9 return 3 * tri + vert;
+
10}
+
11
+
12struct TransformNormals {
+
13 mat3 transform;
+
14
+
15 vec3 operator()(vec3 normal) const {
+
16 normal = glm::normalize(transform * normal);
+
17 if (isnan(normal.x)) normal = vec3(0.0);
+
18 return normal;
+
19 }
+
20};
+
21
+
22struct TransformTangents {
+
23 VecView<vec4> tangent;
+
24 const int edgeOffset;
+
25 const mat3 transform;
+
26 const bool invert;
+
27 VecView<const vec4> oldTangents;
+ +
29
+
30 void operator()(const int edgeOut) {
+
31 const int edgeIn =
+
32 invert ? halfedge[FlipHalfedge(edgeOut)].pairedHalfedge : edgeOut;
+
33 tangent[edgeOut + edgeOffset] =
+
34 vec4(transform * vec3(oldTangents[edgeIn]), oldTangents[edgeIn].w);
+
35 }
+
36};
+
37
+
38struct FlipTris {
+
39 VecView<Halfedge> halfedge;
+
40
+
41 void operator()(const int tri) {
+
42 std::swap(halfedge[3 * tri], halfedge[3 * tri + 2]);
+
43
+
44 for (const int i : {0, 1, 2}) {
+
45 std::swap(halfedge[3 * tri + i].startVert, halfedge[3 * tri + i].endVert);
+
46 halfedge[3 * tri + i].pairedHalfedge =
+
47 FlipHalfedge(halfedge[3 * tri + i].pairedHalfedge);
+
48 }
+
49 }
+
50};
+
51} // namespace
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/mesh_i_o_8h_source.html b/docs/html/mesh_i_o_8h_source.html new file mode 100644 index 000000000..494e56230 --- /dev/null +++ b/docs/html/mesh_i_o_8h_source.html @@ -0,0 +1,174 @@ + + + + + + + +Manifold: meshIO.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
meshIO.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <string>
+
17
+
18#include "manifold/manifold.h"
+
19
+
+
20namespace manifold {
+
21
+
+
30struct Material {
+
32 double roughness = 0.2;
+
34 double metalness = 1;
+
37 vec4 color = vec4(1.0);
+
41 std::vector<vec4> vertColor;
+
44 ivec3 normalChannels = ivec3(-1);
+
47 ivec4 colorChannels = ivec4(-1);
+
48};
+
+
49
+
+ +
56 bool faceted = true;
+ +
59};
+
+
60
+
61Mesh ImportMesh(const std::string& filename, bool forceCleanup = false);
+
62
+
63void ExportMesh(const std::string& filename, const Mesh& mesh,
+
64 const ExportOptions& options);
+
65
+
66void ExportMesh(const std::string& filename, const MeshGL& mesh,
+
67 const ExportOptions& options);
+
69} // namespace manifold
+
+
ivec4 colorChannels
Definition meshIO.h:47
+
bool faceted
Definition meshIO.h:56
+
double metalness
Metalness value, generally either 0 (dielectric) or 1 (metal).
Definition meshIO.h:34
+
std::vector< vec4 > vertColor
Definition meshIO.h:41
+
vec4 color
Definition meshIO.h:37
+
double roughness
Roughness value between 0 (shiny) and 1 (matte).
Definition meshIO.h:32
+
Material mat
PBR material properties.
Definition meshIO.h:58
+
ivec3 normalChannels
Definition meshIO.h:44
+
Mesh ImportMesh(const std::string &filename, bool forceCleanup=false)
Definition meshIO/src/meshIO.cpp:115
+
void ExportMesh(const std::string &filename, const Mesh &mesh, const ExportOptions &options)
Definition meshIO/src/meshIO.cpp:271
+
Definition meshIO.h:53
+
Definition meshIO.h:30
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/minus.svg b/docs/html/minus.svg new file mode 100644 index 000000000..f70d0c1a1 --- /dev/null +++ b/docs/html/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/html/minusd.svg b/docs/html/minusd.svg new file mode 100644 index 000000000..5f8e87962 --- /dev/null +++ b/docs/html/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/html/namespacebricks.html b/docs/html/namespacebricks.html new file mode 100644 index 000000000..aa650e8f9 --- /dev/null +++ b/docs/html/namespacebricks.html @@ -0,0 +1,171 @@ + + + + + + + +Manifold: bricks Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
bricks Namespace Reference
+
+
+ + + + + + + + + + + + + + + + +

+Functions

brick ()
 
halfbrick ()
 
row (length)
 
wall (length, height, alternate=0)
 
walls (length, width, height)
 
floor (length, width)
 
run (width=10, length=10, height=10)
 
+ + + + + + + + + + + +

+Variables

+float INCHES = 25.4
 
+tuple brick_depth = (3 + 5 / 8) * INCHES
 
+tuple brick_height = (2 + 1 / 4) * INCHES
 
+tuple brick_length = (7 + 5 / 8) * INCHES
 
+tuple mortar_gap = (3 / 8) * INCHES
 
+

Detailed Description

+
 Copyright 2022 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/namespacecube__with__dents.html b/docs/html/namespacecube__with__dents.html new file mode 100644 index 000000000..9219988d1 --- /dev/null +++ b/docs/html/namespacecube__with__dents.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: cube_with_dents Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
cube_with_dents Namespace Reference
+
+
+ + + + +

+Functions

run (n=5, overlap=True)
 
+

Detailed Description

+
 Copyright 2022 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/namespacegyroid__module.html b/docs/html/namespacegyroid__module.html new file mode 100644 index 000000000..5b9fc3e60 --- /dev/null +++ b/docs/html/namespacegyroid__module.html @@ -0,0 +1,146 @@ + + + + + + + +Manifold: gyroid_module Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
gyroid_module Namespace Reference
+
+
+ + + + + + + + + + + + +

+Functions

gyroid (x, y, z)
 
gyroid_levelset (level, period, size, n)
 
rhombic_dodecahedron (size)
 
gyroid_module (size=20, n=15)
 
run (size=20, n=15)
 
+

Detailed Description

+
 Copyright 2023 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/namespacemanifold.html b/docs/html/namespacemanifold.html new file mode 100644 index 000000000..e8cc1639c --- /dev/null +++ b/docs/html/namespacemanifold.html @@ -0,0 +1,790 @@ + + + + + + + +Manifold: manifold Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
manifold Namespace Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  Barycentric
 
class  Boolean3
 
struct  Box
 
class  Collider
 
class  ConcurrentSharedPtr
 
struct  CountingIterator
 
class  CrossSection
 
class  CsgLeafNode
 
class  CsgNode
 
class  CsgOpNode
 
struct  ExecutionParams
 
struct  ExportOptions
 
struct  geometryErr
 
struct  Halfedge
 
class  HalfEdgeMesh
 
class  HashTable
 
class  HashTableD
 
struct  Identity
 
class  Manifold
 
struct  Material
 
struct  Mesh
 
class  MeshBuilder
 
struct  MeshGL
 
struct  Negate
 
struct  PathImpl
 
class  Plane
 
struct  PolyVert
 
class  Pool
 
struct  Properties
 
class  Quality
 
class  QuickHull
 
struct  Ray
 
struct  Rect
 
struct  ReindexEdge
 
struct  Smoothness
 
class  SparseIndices
 
struct  StridedRange
 
struct  SVDSet
 
struct  Timer
 
struct  TmpEdge
 
struct  topologyErr
 
struct  TransformIterator
 
struct  TriRef
 
struct  UnionFind
 
struct  userErr
 
class  Vec
 
class  VecView
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

+using GeneralTriangulation = std::function< std::vector< ivec3 >(int)>
 
+using AddTriangle = std::function< void(int, ivec3, vec3, TriRef)>
 
+using SimplePolygonIdx = std::vector< PolyVert >
 
+using PolygonsIdx = std::vector< SimplePolygonIdx >
 
+using vec2 = glm::dvec2
 
+using vec3 = glm::dvec3
 
+using vec4 = glm::dvec4
 
+using mat2 = glm::dmat2
 
+using mat2x3 = glm::dmat2x3
 
+using mat2x4 = glm::dmat2x4
 
+using mat3x2 = glm::dmat3x2
 
+using mat3 = glm::dmat3
 
+using mat3x4 = glm::dmat3x4
 
+using mat4x3 = glm::dmat4x3
 
+using mat4 = glm::dmat4
 
+using ivec2 = glm::vec< 2, int >
 
+using ivec3 = glm::vec< 3, int >
 
+using ivec4 = glm::vec< 4, int >
 
+using quat = glm::dquat
 
using SimplePolygon = std::vector< vec2 >
 
using Polygons = std::vector< SimplePolygon >
 
+using logicErr = std::logic_error
 
+ + + + + + + +

+Enumerations

enum class  CsgNodeType { Union +, Intersection +, Difference +, Leaf + }
 
enum class  OpType { Add +, Subtract +, Intersect + }
 
enum class  ExecutionPolicy { Par +, Seq + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Mesh ImportMesh (const std::string &filename, bool forceCleanup=false)
 
void ExportMesh (const std::string &filename, const Mesh &mesh, const ExportOptions &options)
 
void ExportMesh (const std::string &filename, const MeshGL &mesh, const ExportOptions &options)
 
Manifold TorusKnot (int p, int q, double majorRadius, double minorRadius, double threadRadius, int circularSegments=0, int linearSegments=0)
 
Manifold StretchyBracelet (double radius=30.0, double height=8.0, double width=15.0, double thickness=0.4, int nDecor=20, int nCut=27, int nDivision=30)
 
Manifold MengerSponge (int n=3)
 
Manifold RoundedFrame (double edgeLength, double radius, int circularSegments=0)
 
Manifold TetPuzzle (double edgeLength, double gap, int nDivisions)
 
Manifold Scallop ()
 
Manifold GyroidModule (double size=20, int n=20)
 
+Manifold CondensedMatter (int fn=16)
 
ExecutionParamsManifoldParams ()
 
+double defaultEps ()
 
+double getSquaredDistanceBetweenPointAndRay (const vec3 &p, const Ray &r)
 
+double getSquaredDistance (const vec3 &p1, const vec3 &p2)
 
+double getSignedDistanceToPlane (const vec3 &v, const Plane &p)
 
+vec3 getTriangleNormal (const vec3 &a, const vec3 &b, const vec3 &c)
 
+vec3 SafeNormalize (vec3 v)
 
+double MaxPrecision (double minPrecision, const Box &bBox)
 
+int NextHalfedge (int current)
 
+mat3 NormalTransform (const mat4x3 &transform)
 
mat3x2 GetAxisAlignedProjection (vec3 normal)
 
+vec3 GetBarycentric (const vec3 &v, const mat3 &triPos, double precision)
 
+Vec< TmpEdgeCreateTmpEdges (const Vec< Halfedge > &halfedge)
 
+std::ostream & operator<< (std::ostream &stream, const Halfedge &edge)
 
+std::ostream & operator<< (std::ostream &stream, const Barycentric &bary)
 
+std::ostream & operator<< (std::ostream &stream, const TriRef &ref)
 
std::vector< ivec3 > TriangulateIdx (const PolygonsIdx &polys, double precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
constexpr std::size_t operator""_uz (unsigned long long n) noexcept
 
double sind (double x)
 
double cosd (double x)
 
mat4x3 RotateUp (vec3 up)
 
int CCW (vec2 p0, vec2 p1, vec2 p2, double tol)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec2< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec3< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec4< T > &v)
 
+std::ostream & operator<< (std::ostream &stream, const mat3 &mat)
 
+std::ostream & operator<< (std::ostream &stream, const mat4x3 &mat)
 
+std::ostream & operator<< (std::ostream &stream, const Box &box)
 
+std::ostream & operator<< (std::ostream &stream, const Rect &box)
 
template<typename T >
void Dump (const std::vector< T > &vec)
 
+template<typename T >
void Diff (const std::vector< T > &a, const std::vector< T > &b)
 
+template<typename T >
CountingIterator< T > countAt (T i)
 
+constexpr ExecutionPolicy autoPolicy (size_t size, size_t threshold=kSeqThreshold)
 
+template<typename Iter , typename Dummy = std::enable_if_t<!std::is_integral_v<Iter>>>
constexpr ExecutionPolicy autoPolicy (Iter first, Iter last, size_t threshold=kSeqThreshold)
 
+template<typename InputIter , typename OutputIter >
void copy (ExecutionPolicy policy, InputIter first, InputIter last, OutputIter d_first)
 
+template<typename InputIter , typename OutputIter >
void copy (InputIter first, InputIter last, OutputIter d_first)
 
+template<typename Iter , typename F >
void for_each (ExecutionPolicy policy, Iter first, Iter last, F f)
 
+template<typename Iter , typename F >
void for_each_n (ExecutionPolicy policy, Iter first, size_t n, F f)
 
+template<typename InputIter , typename BinaryOp , typename T = typename std::iterator_traits<InputIter>::value_type>
reduce (ExecutionPolicy policy, InputIter first, InputIter last, T init, BinaryOp f)
 
+template<typename InputIter , typename BinaryOp , typename T = typename std::iterator_traits<InputIter>::value_type>
reduce (InputIter first, InputIter last, T init, BinaryOp f)
 
+template<typename InputIter , typename BinaryOp , typename UnaryOp , typename T = std::invoke_result_t< UnaryOp, typename std::iterator_traits<InputIter>::value_type>>
transform_reduce (ExecutionPolicy policy, InputIter first, InputIter last, T init, BinaryOp f, UnaryOp g)
 
+template<typename InputIter , typename BinaryOp , typename UnaryOp , typename T = std::invoke_result_t< UnaryOp, typename std::iterator_traits<InputIter>::value_type>>
transform_reduce (InputIter first, InputIter last, T init, BinaryOp f, UnaryOp g)
 
+template<typename InputIter , typename OutputIter , typename T = typename std::iterator_traits<InputIter>::value_type>
void inclusive_scan (ExecutionPolicy policy, InputIter first, InputIter last, OutputIter d_first)
 
+template<typename InputIter , typename OutputIter , typename T = typename std::iterator_traits<InputIter>::value_type>
void inclusive_scan (InputIter first, InputIter last, OutputIter d_first)
 
+template<typename InputIter , typename OutputIter , typename BinOp = decltype(std::plus<typename std::iterator_traits< InputIter>::value_type>()), typename T = typename std::iterator_traits<InputIter>::value_type>
void exclusive_scan (ExecutionPolicy policy, InputIter first, InputIter last, OutputIter d_first, T init=static_cast< T >(0), BinOp f=std::plus< T >(), T identity=static_cast< T >(0))
 
+template<typename InputIter , typename OutputIter , typename BinOp = decltype(std::plus<typename std::iterator_traits< InputIter>::value_type>()), typename T = typename std::iterator_traits<InputIter>::value_type>
void exclusive_scan (InputIter first, InputIter last, OutputIter d_first, T init=static_cast< T >(0), BinOp f=std::plus< T >(), T identity=static_cast< T >(0))
 
+template<typename InputIter , typename OutputIter , typename F >
void transform (ExecutionPolicy policy, InputIter first, InputIter last, OutputIter d_first, F f)
 
+template<typename InputIter , typename OutputIter , typename F >
void transform (InputIter first, InputIter last, OutputIter d_first, F f)
 
+template<typename InputIter , typename OutputIter >
void copy_n (ExecutionPolicy policy, InputIter first, size_t n, OutputIter d_first)
 
+template<typename InputIter , typename OutputIter >
void copy_n (InputIter first, size_t n, OutputIter d_first)
 
+template<typename OutputIter , typename T >
void fill (ExecutionPolicy policy, OutputIter first, OutputIter last, T value)
 
+template<typename OutputIter , typename T >
void fill (OutputIter first, OutputIter last, T value)
 
+template<typename InputIter , typename P >
size_t count_if (ExecutionPolicy policy, InputIter first, InputIter last, P pred)
 
+template<typename InputIter , typename P >
size_t count_if (InputIter first, InputIter last, P pred)
 
+template<typename InputIter , typename P >
bool all_of (ExecutionPolicy policy, InputIter first, InputIter last, P pred)
 
+template<typename InputIter , typename P >
bool all_of (InputIter first, InputIter last, P pred)
 
+template<typename InputIter , typename OutputIter , typename P >
OutputIter copy_if (ExecutionPolicy policy, InputIter first, InputIter last, OutputIter d_first, P pred)
 
+template<typename InputIter , typename OutputIter , typename P >
OutputIter copy_if (InputIter first, InputIter last, OutputIter d_first, P pred)
 
+template<typename Iter , typename P , typename T = typename std::iterator_traits<Iter>::value_type>
Iter remove_if (ExecutionPolicy policy, Iter first, Iter last, P pred)
 
+template<typename Iter , typename P , typename T = typename std::iterator_traits<Iter>::value_type>
Iter remove_if (Iter first, Iter last, P pred)
 
+template<typename Iter , typename T = typename std::iterator_traits<Iter>::value_type>
Iter remove (ExecutionPolicy policy, Iter first, Iter last, T value)
 
+template<typename Iter , typename T = typename std::iterator_traits<Iter>::value_type>
Iter remove (Iter first, Iter last, T value)
 
+template<typename Iter , typename T = typename std::iterator_traits<Iter>::value_type>
Iter unique (ExecutionPolicy policy, Iter first, Iter last)
 
+template<typename Iter , typename T = typename std::iterator_traits<Iter>::value_type>
Iter unique (Iter first, Iter last)
 
+template<typename Iterator , typename T = typename std::iterator_traits<Iterator>::value_type>
void stable_sort (ExecutionPolicy policy, Iterator first, Iterator last)
 
+template<typename Iterator , typename T = typename std::iterator_traits<Iterator>::value_type>
void stable_sort (Iterator first, Iterator last)
 
+template<typename Iterator , typename T = typename std::iterator_traits<Iterator>::value_type, typename Comp = decltype(std::less<T>())>
void stable_sort (ExecutionPolicy policy, Iterator first, Iterator last, Comp comp)
 
+template<typename Iterator , typename T = typename std::iterator_traits<Iterator>::value_type, typename Comp = decltype(std::less<T>())>
void stable_sort (Iterator first, Iterator last, Comp comp)
 
+template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void scatter (ExecutionPolicy policy, InputIterator1 first, InputIterator1 last, InputIterator2 mapFirst, OutputIterator outputFirst)
 
+template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void scatter (InputIterator1 first, InputIterator1 last, InputIterator2 mapFirst, OutputIterator outputFirst)
 
+template<typename InputIterator , typename RandomAccessIterator , typename OutputIterator >
void gather (ExecutionPolicy policy, InputIterator mapFirst, InputIterator mapLast, RandomAccessIterator inputFirst, OutputIterator outputFirst)
 
+template<typename InputIterator , typename RandomAccessIterator , typename OutputIterator >
void gather (InputIterator mapFirst, InputIterator mapLast, RandomAccessIterator inputFirst, OutputIterator outputFirst)
 
+template<typename Iterator >
void sequence (ExecutionPolicy policy, Iterator first, Iterator last)
 
+template<typename Iterator >
void sequence (Iterator first, Iterator last)
 
SVDSet SVD (mat3 A)
 
double SpectralNorm (mat3 A)
 
void EdgeEdgeDist (vec3 &x, vec3 &y, const vec3 &p, const vec3 &a, const vec3 &q, const vec3 &b)
 
auto DistanceTriangleTriangleSquared (const std::array< vec3, 3 > &p, const std::array< vec3, 3 > &q)
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+template<typename T , typename T1 >
void Permute (Vec< T > &inOut, const Vec< T1 > &new2Old)
 
+template<typename T , typename T1 >
void Permute (std::vector< T > &inOut, const Vec< T1 > &new2Old)
 
+template<typename T >
AtomicAdd (T &target, T add)
 
+template<>
int AtomicAdd (int &target, int add)
 
+ + + + + + + + + + + + + + + + +

+Variables

+constexpr double kTolerance = 1e-12
 
+constexpr int DEFAULT_SEGMENTS = 0
 
+constexpr double DEFAULT_ANGLE = 10.0
 
+constexpr double DEFAULT_LENGTH = 1.0
 
+constexpr size_t kSeqThreshold = 1e4
 
std::vector< ivec3 > Triangulate (const Polygons &polygons, double precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
+ExecutionParamsPolygonParams ()
 
+

Detailed Description

+

The notation in these files is abbreviated due to the complexity of the functions involved. The key is that the input manifolds are P and Q, while the output is R, and these letters in both upper and lower case refer to these objects. Operations are based on dimensionality: vert: 0, edge: 1, face: 2, solid: 3. X denotes a winding-number type quantity from the source paper of this algorithm, while S is closely related but includes only the subset of X values which "shadow" (are on the correct side of).

+

Nearly everything here are sparse arrays, where for instance each pair in p2q1 refers to a face index of P interacting with a halfedge index of Q. Adjacent arrays like x21 refer to the values of X corresponding to each sparse index pair.

+

Note many functions are designed to work symmetrically, for instance for both p2q1 and p1q2. Inside of these functions P and Q are marked as though the function is forwards, but it may include a Boolean "reverse" that indicates P and Q have been swapped.

+

Function Documentation

+ +

◆ operator""_uz()

+ +
+
+ + + + + +
+ + + + + + + + +
constexpr std::size_t operator""_uz (unsigned long long n)
+
+constexprnoexcept
+
+

Stand-in for C++23's operator""uz (P0330R8)[https://wg21.link/P0330R8].

+ +
+
+ +

◆ EdgeEdgeDist()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void EdgeEdgeDist (vec3 & x,
vec3 & y,
const vec3 & p,
const vec3 & a,
const vec3 & q,
const vec3 & b 
)
+
+inline
+
+

Returns the distance between two line segments.

+
Parameters
+ + + + + + + +
[out]xClosest point on line segment pa.
[out]yClosest point on line segment qb.
[in]pOne endpoint of the first line segment.
[in]aOther endpoint of the first line segment.
[in]pOne endpoint of the second line segment.
[in]bOther endpoint of the second line segment.
+
+
+ +
+
+ +

◆ DistanceTriangleTriangleSquared()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
auto DistanceTriangleTriangleSquared (const std::array< vec3, 3 > & p,
const std::array< vec3, 3 > & q 
)
+
+inline
+
+

Returns the minimum squared distance between two triangles.

+
Parameters
+ + + +
pFirst triangle.
qSecond triangle.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html new file mode 100644 index 000000000..1bafcc195 --- /dev/null +++ b/docs/html/namespacemembers.html @@ -0,0 +1,136 @@ + + + + + + + +Manifold: Namespace Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented namespace members with links to the namespaces they belong to:
+
+
+ + + + diff --git a/docs/html/namespacemembers_enum.html b/docs/html/namespacemembers_enum.html new file mode 100644 index 000000000..69c113014 --- /dev/null +++ b/docs/html/namespacemembers_enum.html @@ -0,0 +1,111 @@ + + + + + + + +Manifold: Namespace Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented namespace enums with links to the namespaces they belong to:
+
+
+ + + + diff --git a/docs/html/namespacemembers_func.html b/docs/html/namespacemembers_func.html new file mode 100644 index 000000000..ce4497ce1 --- /dev/null +++ b/docs/html/namespacemembers_func.html @@ -0,0 +1,133 @@ + + + + + + + +Manifold: Namespace Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented namespace functions with links to the namespaces they belong to:
+
+
+ + + + diff --git a/docs/html/namespacemembers_type.html b/docs/html/namespacemembers_type.html new file mode 100644 index 000000000..e9d6da441 --- /dev/null +++ b/docs/html/namespacemembers_type.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: Namespace Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented namespace typedefs with links to the namespaces they belong to:
+
+
+ + + + diff --git a/docs/html/namespacerun__all.html b/docs/html/namespacerun__all.html new file mode 100644 index 000000000..31111c348 --- /dev/null +++ b/docs/html/namespacerun__all.html @@ -0,0 +1,184 @@ + + + + + + + +Manifold: run_all Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
run_all Namespace Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Variables

current_file = pathlib.Path(__file__)
 
current_dir = current_file.parent
 
+list files = [f.parts[-1][:-3] for f in current_dir.glob("*.py") if f != current_file]
 
+int export_models = "-e"
 
module = importlib.import_module(f)
 
t0 = time()
 
model = module.run()
 
mesh = model.to_mesh()
 
vertices = mesh.vert_properties[:, :3]
 
+tuple colors = (mesh.vert_properties[:, 3:] * 255).astype(np.uint8)
 
 meshOut
 
t1 = time()
 
+

Detailed Description

+
 Copyright 2022 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.

Variable Documentation

+ +

◆ meshOut

+ +
+
+ + + + +
meshOut
+
+Initial value:
1= trimesh.Trimesh(
+
2 vertices=vertices, faces=mesh.tri_verts, vertex_colors=colors
+
3 )
+
+
+
+
+
+ + + + diff --git a/docs/html/namespacescallop.html b/docs/html/namespacescallop.html new file mode 100644 index 000000000..edb9ec303 --- /dev/null +++ b/docs/html/namespacescallop.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: scallop Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
scallop Namespace Reference
+
+
+ + + + +

+Functions

run ()
 
+

Detailed Description

+
 Copyright 2023 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/namespacesplit__cube.html b/docs/html/namespacesplit__cube.html new file mode 100644 index 000000000..79b8c6d5f --- /dev/null +++ b/docs/html/namespacesplit__cube.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: split_cube Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
split_cube Namespace Reference
+
+
+ + + + +

+Functions

run ()
 
+

Detailed Description

+
 Copyright 2022 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/nav_f.png b/docs/html/nav_f.png new file mode 100644 index 000000000..72a58a529 Binary files /dev/null and b/docs/html/nav_f.png differ diff --git a/docs/html/nav_fd.png b/docs/html/nav_fd.png new file mode 100644 index 000000000..032fbdd4c Binary files /dev/null and b/docs/html/nav_fd.png differ diff --git a/docs/html/nav_g.png b/docs/html/nav_g.png new file mode 100644 index 000000000..2093a237a Binary files /dev/null and b/docs/html/nav_g.png differ diff --git a/docs/html/nav_h.png b/docs/html/nav_h.png new file mode 100644 index 000000000..33389b101 Binary files /dev/null and b/docs/html/nav_h.png differ diff --git a/docs/html/nav_hd.png b/docs/html/nav_hd.png new file mode 100644 index 000000000..de80f18ad Binary files /dev/null and b/docs/html/nav_hd.png differ diff --git a/docs/html/navtree.css b/docs/html/navtree.css new file mode 100644 index 000000000..69211d4a7 --- /dev/null +++ b/docs/html/navtree.css @@ -0,0 +1,149 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: var(--nav-text-active-color); + text-shadow: var(--nav-text-active-shadow); +} + +#nav-tree .selected .arrow { + color: var(--nav-arrow-selected-color); + text-shadow: none; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px var(--font-family-nav); +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:var(--nav-text-active-color); +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: $width; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:var(--nav-splitbar-image); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-repeat:repeat-x; + background-color: var(--nav-background-color); + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/docs/html/navtree.js b/docs/html/navtree.js new file mode 100644 index 000000000..93dd3d462 --- /dev/null +++ b/docs/html/navtree.js @@ -0,0 +1,559 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, true); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, setFocus) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + var topOffset=5; + if (typeof page_layout!=='undefined' && page_layout==1) { + topOffset+=$('#top').outerHeight(); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +Manifold: optional_assert.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
optional_assert.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#ifdef MANIFOLD_EXCEPTIONS
+
18#include <stdexcept>
+
19#endif
+
20
+
21#ifdef MANIFOLD_DEBUG
+
22#include <iostream>
+
23#include <sstream>
+
24#include <string>
+
25
+
26template <typename Ex>
+
27void Assert(bool condition, const char* file, int line, const std::string& cond,
+
28 const std::string& msg) {
+
29 if (!condition) {
+
30 std::ostringstream output;
+
31 output << "Error in file: " << file << " (" << line << "): \'" << cond
+
32 << "\' is false: " << msg;
+
33 throw Ex(output.str());
+
34 }
+
35}
+
36#define DEBUG_ASSERT(condition, EX, msg) \
+
37 Assert<EX>(condition, __FILE__, __LINE__, #condition, msg);
+
38#else
+
39#define DEBUG_ASSERT(condition, EX, msg)
+
40#endif
+
41
+
42#ifdef MANIFOLD_EXCEPTIONS
+
43#define ASSERT(condition, EX) \
+
44 if (!(condition)) throw(EX);
+
45#else
+
46#define ASSERT(condition, EX)
+
47#endif
+
+
+ + + + diff --git a/docs/html/pages.html b/docs/html/pages.html new file mode 100644 index 000000000..c1067ce80 --- /dev/null +++ b/docs/html/pages.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Related Pages + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Related Pages
+
+
+
Here is a list of all related documentation pages:
+
+
+ + + + diff --git a/docs/html/parallel_8h_source.html b/docs/html/parallel_8h_source.html new file mode 100644 index 000000000..847391a6c --- /dev/null +++ b/docs/html/parallel_8h_source.html @@ -0,0 +1,1231 @@ + + + + + + + +Manifold: parallel.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
parallel.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14//
+
15// Simple implementation of selected functions in PSTL.
+
16// Iterators must be RandomAccessIterator.
+
17
+
18#pragma once
+
19#if MANIFOLD_PAR == 'T'
+
20#include <tbb/combinable.h>
+
21#include <tbb/parallel_for.h>
+
22#include <tbb/parallel_invoke.h>
+
23#include <tbb/parallel_reduce.h>
+
24#include <tbb/parallel_scan.h>
+
25#endif
+
26#include <algorithm>
+
27#include <numeric>
+
28
+
29#include "manifold/common.h"
+
30#include "manifold/iters.h"
+
31namespace manifold {
+
32
+
33enum class ExecutionPolicy {
+
34 Par,
+
35 Seq,
+
36};
+
37
+
38constexpr size_t kSeqThreshold = 1e4;
+
39// ExecutionPolicy:
+
40// - Sequential for small workload,
+
41// - Parallel (CPU) for medium workload,
+
42inline constexpr ExecutionPolicy autoPolicy(size_t size,
+
43 size_t threshold = kSeqThreshold) {
+
44 if (size <= threshold) {
+
45 return ExecutionPolicy::Seq;
+
46 }
+
47 return ExecutionPolicy::Par;
+
48}
+
49
+
50template <typename Iter,
+
51 typename Dummy = std::enable_if_t<!std::is_integral_v<Iter>>>
+
52inline constexpr ExecutionPolicy autoPolicy(Iter first, Iter last,
+
53 size_t threshold = kSeqThreshold) {
+
54 if (static_cast<size_t>(std::distance(first, last)) <= threshold) {
+
55 return ExecutionPolicy::Seq;
+
56 }
+
57 return ExecutionPolicy::Par;
+
58}
+
59
+
60template <typename InputIter, typename OutputIter>
+
61void copy(ExecutionPolicy policy, InputIter first, InputIter last,
+
62 OutputIter d_first);
+
63template <typename InputIter, typename OutputIter>
+
64void copy(InputIter first, InputIter last, OutputIter d_first);
+
65
+
66#if MANIFOLD_PAR == 'T'
+
67namespace details {
+
68using manifold::kSeqThreshold;
+
69// implementation from
+
70// https://duvanenko.tech.blog/2018/01/14/parallel-merge/
+
71// https://github.com/DragonSpit/ParallelAlgorithms
+
72// note that the ranges are now [p, r) to fit our convention.
+
73template <typename SrcIter, typename DestIter, typename Comp>
+
74void mergeRec(SrcIter src, DestIter dest, size_t p1, size_t r1, size_t p2,
+
75 size_t r2, size_t p3, Comp comp) {
+
76 size_t length1 = r1 - p1;
+
77 size_t length2 = r2 - p2;
+
78 if (length1 < length2) {
+
79 std::swap(p1, p2);
+
80 std::swap(r1, r2);
+
81 std::swap(length1, length2);
+
82 }
+
83 if (length1 == 0) return;
+
84 if (length1 + length2 <= kSeqThreshold) {
+
85 std::merge(src + p1, src + r1, src + p2, src + r2, dest + p3, comp);
+
86 } else {
+
87 size_t q1 = p1 + length1 / 2;
+
88 size_t q2 =
+
89 std::distance(src, std::lower_bound(src + p2, src + r2, src[q1], comp));
+
90 size_t q3 = p3 + (q1 - p1) + (q2 - p2);
+
91 dest[q3] = src[q1];
+
92 tbb::parallel_invoke(
+
93 [=] { mergeRec(src, dest, p1, q1, p2, q2, p3, comp); },
+
94 [=] { mergeRec(src, dest, q1 + 1, r1, q2, r2, q3 + 1, comp); });
+
95 }
+
96}
+
97
+
98template <typename SrcIter, typename DestIter, typename Comp>
+
99void mergeSortRec(SrcIter src, DestIter dest, size_t begin, size_t end,
+
100 Comp comp) {
+
101 size_t numElements = end - begin;
+
102 if (numElements <= kSeqThreshold) {
+
103 std::copy(src + begin, src + end, dest + begin);
+
104 std::stable_sort(dest + begin, dest + end, comp);
+
105 } else {
+
106 size_t middle = begin + numElements / 2;
+
107 tbb::parallel_invoke([=] { mergeSortRec(dest, src, begin, middle, comp); },
+
108 [=] { mergeSortRec(dest, src, middle, end, comp); });
+
109 mergeRec(src, dest, begin, middle, middle, end, begin, comp);
+
110 }
+
111}
+
112
+
113template <typename T, typename InputIter, typename OutputIter, typename BinOp>
+
114struct ScanBody {
+
115 T sum;
+
116 T identity;
+
117 BinOp &f;
+
118 InputIter input;
+
119 OutputIter output;
+
120
+
121 ScanBody(T sum, T identity, BinOp &f, InputIter input, OutputIter output)
+
122 : sum(sum), identity(identity), f(f), input(input), output(output) {}
+
123 ScanBody(ScanBody &b, tbb::split)
+
124 : sum(b.identity),
+
125 identity(b.identity),
+
126 f(b.f),
+
127 input(b.input),
+
128 output(b.output) {}
+
129 template <typename Tag>
+
130 void operator()(const tbb::blocked_range<size_t> &r, Tag) {
+
131 T temp = sum;
+
132 for (size_t i = r.begin(); i < r.end(); ++i) {
+
133 T inputTmp = input[i];
+
134 if (Tag::is_final_scan()) output[i] = temp;
+
135 temp = f(temp, inputTmp);
+
136 }
+
137 sum = temp;
+
138 }
+
139 T get_sum() const { return sum; }
+
140 void reverse_join(ScanBody &a) { sum = f(a.sum, sum); }
+
141 void assign(ScanBody &b) { sum = b.sum; }
+
142};
+
143
+
144template <typename InputIter, typename OutputIter, typename P>
+
145struct CopyIfScanBody {
+
146 size_t sum;
+
147 P &pred;
+
148 InputIter input;
+
149 OutputIter output;
+
150
+
151 CopyIfScanBody(P &pred, InputIter input, OutputIter output)
+
152 : sum(0), pred(pred), input(input), output(output) {}
+
153 CopyIfScanBody(CopyIfScanBody &b, tbb::split)
+
154 : sum(0), pred(b.pred), input(b.input), output(b.output) {}
+
155 template <typename Tag>
+
156 void operator()(const tbb::blocked_range<size_t> &r, Tag) {
+
157 size_t temp = sum;
+
158 for (size_t i = r.begin(); i < r.end(); ++i) {
+
159 if (pred(i)) {
+
160 temp += 1;
+
161 if (Tag::is_final_scan()) output[temp - 1] = input[i];
+
162 }
+
163 }
+
164 sum = temp;
+
165 }
+
166 size_t get_sum() const { return sum; }
+
167 void reverse_join(CopyIfScanBody &a) { sum = a.sum + sum; }
+
168 void assign(CopyIfScanBody &b) { sum = b.sum; }
+
169};
+
170
+
171template <typename N, const int K>
+
172struct Hist {
+
173 using SizeType = N;
+
174 static constexpr int k = K;
+
175 N hist[k][256] = {{0}};
+
176 void merge(const Hist<N, K> &other) {
+
177 for (int i = 0; i < k; ++i)
+
178 for (int j = 0; j < 256; ++j) hist[i][j] += other.hist[i][j];
+
179 }
+
180 void prefixSum(N total, bool *canSkip) {
+
181 for (int i = 0; i < k; ++i) {
+
182 size_t count = 0;
+
183 for (int j = 0; j < 256; ++j) {
+
184 N tmp = hist[i][j];
+
185 hist[i][j] = count;
+
186 count += tmp;
+
187 if (tmp == total) canSkip[i] = true;
+
188 }
+
189 }
+
190 }
+
191};
+
192
+
193template <typename T, typename H>
+
194void histogram(T *ptr, typename H::SizeType n, H &hist) {
+
195 auto worker = [](T *ptr, typename H::SizeType n, H &hist) {
+
196 for (typename H::SizeType i = 0; i < n; ++i)
+
197 for (int k = 0; k < hist.k; ++k)
+
198 ++hist.hist[k][(ptr[i] >> (8 * k)) & 0xFF];
+
199 };
+
200 if (n < kSeqThreshold) {
+
201 worker(ptr, n, hist);
+
202 } else {
+
203 tbb::combinable<H> store;
+
204 tbb::parallel_for(
+
205 tbb::blocked_range<typename H::SizeType>(0, n, kSeqThreshold),
+
206 [&worker, &store, ptr](const auto &r) {
+
207 worker(ptr + r.begin(), r.end() - r.begin(), store.local());
+
208 });
+
209 store.combine_each([&hist](const H &h) { hist.merge(h); });
+
210 }
+
211}
+
212
+
213template <typename T, typename H>
+
214void shuffle(T *src, T *target, typename H::SizeType n, H &hist, int k) {
+
215 for (typename H::SizeType i = 0; i < n; ++i)
+
216 target[hist.hist[k][(src[i] >> (8 * k)) & 0xFF]++] = src[i];
+
217}
+
218
+
219template <typename T, typename SizeType>
+
220bool LSB_radix_sort(T *input, T *tmp, SizeType n) {
+
221 Hist<SizeType, sizeof(T) / sizeof(char)> hist;
+
222 if (std::is_sorted(input, input + n)) return false;
+
223 histogram(input, n, hist);
+
224 bool canSkip[hist.k] = {0};
+
225 hist.prefixSum(n, canSkip);
+
226 T *a = input, *b = tmp;
+
227 for (int k = 0; k < hist.k; ++k) {
+
228 if (!canSkip[k]) {
+
229 shuffle(a, b, n, hist, k);
+
230 std::swap(a, b);
+
231 }
+
232 }
+
233 return a == tmp;
+
234}
+
235
+
236// LSB radix sort with merge
+
237template <typename T, typename SizeType>
+
238struct SortedRange {
+
239 T *input, *tmp;
+
240 SizeType offset = 0, length = 0;
+
241 bool inTmp = false;
+
242
+
243 SortedRange(T *input, T *tmp, SizeType offset = 0, SizeType length = 0)
+
244 : input(input), tmp(tmp), offset(offset), length(length) {}
+
245 SortedRange(SortedRange<T, SizeType> &r, tbb::split)
+
246 : input(r.input), tmp(r.tmp) {}
+
247 void operator()(const tbb::blocked_range<SizeType> &range) {
+
248 SortedRange<T, SizeType> rhs(input, tmp, range.begin(),
+
249 range.end() - range.begin());
+
250 rhs.inTmp =
+
251 LSB_radix_sort(input + rhs.offset, tmp + rhs.offset, rhs.length);
+
252 if (length == 0)
+
253 *this = rhs;
+
254 else
+
255 join(rhs);
+
256 }
+
257 bool swapBuffer() const {
+
258 T *src = input, *target = tmp;
+
259 if (inTmp) std::swap(src, target);
+
260 copy(src + offset, src + offset + length, target + offset);
+
261 return !inTmp;
+
262 }
+
263 void join(const SortedRange<T, SizeType> &rhs) {
+
264 if (inTmp != rhs.inTmp) {
+
265 if (length < rhs.length)
+
266 inTmp = swapBuffer();
+
267 else
+
268 rhs.swapBuffer();
+
269 }
+
270 T *src = input, *target = tmp;
+
271 if (inTmp) std::swap(src, target);
+
272 if (src[offset + length - 1] > src[rhs.offset]) {
+
273 mergeRec(src, target, offset, offset + length, rhs.offset,
+
274 rhs.offset + rhs.length, offset, std::less<T>());
+
275 inTmp = !inTmp;
+
276 }
+
277 length += rhs.length;
+
278 }
+
279};
+
280
+
281template <typename T, typename SizeTy>
+
282void radix_sort(T *input, SizeTy n) {
+
283 T *aux = new T[n];
+
284 SizeTy blockSize = std::max(n / tbb::this_task_arena::max_concurrency() / 4,
+
285 static_cast<SizeTy>(kSeqThreshold / sizeof(T)));
+
286 SortedRange<T, SizeTy> result(input, aux);
+
287 tbb::parallel_reduce(tbb::blocked_range<SizeTy>(0, n, blockSize), result);
+
288 if (result.inTmp) copy(aux, aux + n, input);
+
289 delete[] aux;
+
290}
+
291
+
292template <typename Iterator,
+
293 typename T = typename std::iterator_traits<Iterator>::value_type,
+
294 typename Comp = decltype(std::less<T>())>
+
295void mergeSort(ExecutionPolicy policy, Iterator first, Iterator last,
+
296 Comp comp) {
+
297#if MANIFOLD_PAR == 'T'
+
298 if (policy == ExecutionPolicy::Par) {
+
299 // apparently this prioritizes threads inside here?
+
300 tbb::this_task_arena::isolate([&] {
+
301 size_t length = std::distance(first, last);
+
302 T *tmp = new T[length];
+
303 copy(policy, first, last, tmp);
+
304 details::mergeSortRec(tmp, first, 0, length, comp);
+
305 delete[] tmp;
+
306 });
+
307 return;
+
308 }
+
309#endif
+
310 std::stable_sort(first, last, comp);
+
311}
+
312
+
313// stable_sort using merge sort.
+
314//
+
315// For simpler implementation, we do not support types that are not trivially
+
316// destructable.
+
317template <typename Iterator,
+
318 typename T = typename std::iterator_traits<Iterator>::value_type,
+
319 typename Dummy = void>
+
320struct SortFunctor {
+
321 void operator()(ExecutionPolicy policy, Iterator first, Iterator last) {
+
322 static_assert(
+
323 std::is_convertible_v<
+
324 typename std::iterator_traits<Iterator>::iterator_category,
+
325 std::random_access_iterator_tag>,
+
326 "You can only parallelize RandomAccessIterator.");
+
327 static_assert(std::is_trivially_destructible_v<T>,
+
328 "Our simple implementation does not support types that are "
+
329 "not trivially destructable.");
+
330 return mergeSort(policy, first, last, std::less<T>());
+
331 }
+
332};
+
333
+
334// stable_sort specialized with radix sort for integral types.
+
335// Typically faster than merge sort.
+
336template <typename Iterator, typename T>
+
337struct SortFunctor<
+
338 Iterator, T,
+
339 std::enable_if_t<
+
340 std::is_integral_v<T> &&
+
341 std::is_pointer_v<typename std::iterator_traits<Iterator>::pointer>>> {
+
342 void operator()(ExecutionPolicy policy, Iterator first, Iterator last) {
+
343 static_assert(
+
344 std::is_convertible_v<
+
345 typename std::iterator_traits<Iterator>::iterator_category,
+
346 std::random_access_iterator_tag>,
+
347 "You can only parallelize RandomAccessIterator.");
+
348 static_assert(std::is_trivially_destructible_v<T>,
+
349 "Our simple implementation does not support types that are "
+
350 "not trivially destructable.");
+
351#if MANIFOLD_PAR == 'T'
+
352 if (policy == ExecutionPolicy::Par) {
+
353 radix_sort(&*first, static_cast<size_t>(std::distance(first, last)));
+
354 return;
+
355 }
+
356#endif
+
357 stable_sort(policy, first, last, std::less<T>());
+
358 }
+
359};
+
360
+
361} // namespace details
+
362
+
363#endif
+
364
+
365// Applies the function `f` to each element in the range `[first, last)`
+
366template <typename Iter, typename F>
+
367void for_each(ExecutionPolicy policy, Iter first, Iter last, F f) {
+
368 static_assert(std::is_convertible_v<
+
369 typename std::iterator_traits<Iter>::iterator_category,
+
370 std::random_access_iterator_tag>,
+
371 "You can only parallelize RandomAccessIterator.");
+
372#if MANIFOLD_PAR == 'T'
+
373 if (policy == ExecutionPolicy::Par) {
+
374 tbb::parallel_for(tbb::blocked_range<Iter>(first, last),
+
375 [&f](const tbb::blocked_range<Iter> &range) {
+
376 for (Iter i = range.begin(); i != range.end(); i++)
+
377 f(*i);
+
378 });
+
379 return;
+
380 }
+
381#endif
+
382 std::for_each(first, last, f);
+
383}
+
384
+
385// Applies the function `f` to each element in the range `[first, last)`
+
386template <typename Iter, typename F>
+
387void for_each_n(ExecutionPolicy policy, Iter first, size_t n, F f) {
+
388 static_assert(std::is_convertible_v<
+
389 typename std::iterator_traits<Iter>::iterator_category,
+
390 std::random_access_iterator_tag>,
+
391 "You can only parallelize RandomAccessIterator.");
+
392 for_each(policy, first, first + n, f);
+
393}
+
394
+
395// Reduce the range `[first, last)` using a binary operation `f` with an initial
+
396// value `init`.
+
397//
+
398// The binary operation should be commutative and associative. Otherwise, the
+
399// result is non-deterministic.
+
400template <typename InputIter, typename BinaryOp,
+
401 typename T = typename std::iterator_traits<InputIter>::value_type>
+
402T reduce(ExecutionPolicy policy, InputIter first, InputIter last, T init,
+
403 BinaryOp f) {
+
404 static_assert(std::is_convertible_v<
+
405 typename std::iterator_traits<InputIter>::iterator_category,
+
406 std::random_access_iterator_tag>,
+
407 "You can only parallelize RandomAccessIterator.");
+
408#if MANIFOLD_PAR == 'T'
+
409 if (policy == ExecutionPolicy::Par) {
+
410 // should we use deterministic reduce here?
+
411 return tbb::parallel_reduce(
+
412 tbb::blocked_range<InputIter>(first, last, details::kSeqThreshold),
+
413 init,
+
414 [&f](const tbb::blocked_range<InputIter> &range, T value) {
+
415 return std::reduce(range.begin(), range.end(), value, f);
+
416 },
+
417 f);
+
418 }
+
419#endif
+
420 return std::reduce(first, last, init, f);
+
421}
+
422
+
423// Reduce the range `[first, last)` using a binary operation `f` with an initial
+
424// value `init`.
+
425//
+
426// The binary operation should be commutative and associative. Otherwise, the
+
427// result is non-deterministic.
+
428template <typename InputIter, typename BinaryOp,
+
429 typename T = typename std::iterator_traits<InputIter>::value_type>
+
430T reduce(InputIter first, InputIter last, T init, BinaryOp f) {
+
431 return reduce(autoPolicy(first, last, 1e5), first, last, init, f);
+
432}
+
433
+
434// Transform and reduce the range `[first, last)` by first applying a unary
+
435// function `g`, and then combining the results using a binary operation `f`
+
436// with an initial value `init`.
+
437//
+
438// The binary operation should be commutative and associative. Otherwise, the
+
439// result is non-deterministic.
+
440template <typename InputIter, typename BinaryOp, typename UnaryOp,
+
441 typename T = std::invoke_result_t<
+
442 UnaryOp, typename std::iterator_traits<InputIter>::value_type>>
+
443T transform_reduce(ExecutionPolicy policy, InputIter first, InputIter last,
+
444 T init, BinaryOp f, UnaryOp g) {
+
445 return reduce(policy, TransformIterator(first, g), TransformIterator(last, g),
+
446 init, f);
+
447}
+
448
+
449// Transform and reduce the range `[first, last)` by first applying a unary
+
450// function `g`, and then combining the results using a binary operation `f`
+
451// with an initial value `init`.
+
452//
+
453// The binary operation should be commutative and associative. Otherwise, the
+
454// result is non-deterministic.
+
455template <typename InputIter, typename BinaryOp, typename UnaryOp,
+
456 typename T = std::invoke_result_t<
+
457 UnaryOp, typename std::iterator_traits<InputIter>::value_type>>
+
458T transform_reduce(InputIter first, InputIter last, T init, BinaryOp f,
+
459 UnaryOp g) {
+
460 return manifold::reduce(TransformIterator(first, g),
+
461 TransformIterator(last, g), init, f);
+
462}
+
463
+
464// Compute the inclusive prefix sum for the range `[first, last)`
+
465// using the summation operator, and store the result in the range
+
466// starting from `d_first`.
+
467//
+
468// The input range `[first, last)` and
+
469// the output range `[d_first, d_first + last - first)`
+
470// must be equal or non-overlapping.
+
471template <typename InputIter, typename OutputIter,
+
472 typename T = typename std::iterator_traits<InputIter>::value_type>
+
473void inclusive_scan(ExecutionPolicy policy, InputIter first, InputIter last,
+
474 OutputIter d_first) {
+
475 static_assert(std::is_convertible_v<
+
476 typename std::iterator_traits<InputIter>::iterator_category,
+
477 std::random_access_iterator_tag>,
+
478 "You can only parallelize RandomAccessIterator.");
+
479 static_assert(
+
480 std::is_convertible_v<
+
481 typename std::iterator_traits<OutputIter>::iterator_category,
+
482 std::random_access_iterator_tag>,
+
483 "You can only parallelize RandomAccessIterator.");
+
484#if MANIFOLD_PAR == 'T'
+
485 if (policy == ExecutionPolicy::Par) {
+
486 tbb::parallel_scan(
+
487 tbb::blocked_range<size_t>(0, std::distance(first, last)),
+
488 static_cast<T>(0),
+
489 [&](const tbb::blocked_range<size_t> &range, T sum,
+
490 bool is_final_scan) {
+
491 T temp = sum;
+
492 for (size_t i = range.begin(); i < range.end(); ++i) {
+
493 temp = temp + first[i];
+
494 if (is_final_scan) d_first[i] = temp;
+
495 }
+
496 return temp;
+
497 },
+
498 std::plus<T>());
+
499 return;
+
500 }
+
501#endif
+
502 std::inclusive_scan(first, last, d_first);
+
503}
+
504
+
505// Compute the inclusive prefix sum for the range `[first, last)` using the
+
506// summation operator, and store the result in the range
+
507// starting from `d_first`.
+
508//
+
509// The input range `[first, last)` and
+
510// the output range `[d_first, d_first + last - first)`
+
511// must be equal or non-overlapping.
+
512template <typename InputIter, typename OutputIter,
+
513 typename T = typename std::iterator_traits<InputIter>::value_type>
+
514void inclusive_scan(InputIter first, InputIter last, OutputIter d_first) {
+
515 return inclusive_scan(autoPolicy(first, last, 1e5), first, last, d_first);
+
516}
+
517
+
518// Compute the inclusive prefix sum for the range `[first, last)` using the
+
519// binary operator `f`, with initial value `init` and
+
520// identity element `identity`, and store the result in the range
+
521// starting from `d_first`.
+
522//
+
523// This is different from `exclusive_scan` in the sequential algorithm by
+
524// requiring an identity element. This is needed so that each block can be
+
525// scanned in parallel and combined later.
+
526//
+
527// The input range `[first, last)` and
+
528// the output range `[d_first, d_first + last - first)`
+
529// must be equal or non-overlapping.
+
530template <typename InputIter, typename OutputIter,
+
531 typename BinOp = decltype(std::plus<typename std::iterator_traits<
+
532 InputIter>::value_type>()),
+
533 typename T = typename std::iterator_traits<InputIter>::value_type>
+
534void exclusive_scan(ExecutionPolicy policy, InputIter first, InputIter last,
+
535 OutputIter d_first, T init = static_cast<T>(0),
+
536 BinOp f = std::plus<T>(), T identity = static_cast<T>(0)) {
+
537 static_assert(std::is_convertible_v<
+
538 typename std::iterator_traits<InputIter>::iterator_category,
+
539 std::random_access_iterator_tag>,
+
540 "You can only parallelize RandomAccessIterator.");
+
541 static_assert(
+
542 std::is_convertible_v<
+
543 typename std::iterator_traits<OutputIter>::iterator_category,
+
544 std::random_access_iterator_tag>,
+
545 "You can only parallelize RandomAccessIterator.");
+
546#if MANIFOLD_PAR == 'T'
+
547 if (policy == ExecutionPolicy::Par) {
+
548 details::ScanBody<T, InputIter, OutputIter, BinOp> body(init, identity, f,
+
549 first, d_first);
+
550 tbb::parallel_scan(
+
551 tbb::blocked_range<size_t>(0, std::distance(first, last)), body);
+
552 return;
+
553 }
+
554#endif
+
555 std::exclusive_scan(first, last, d_first, init, f);
+
556}
+
557
+
558// Compute the inclusive prefix sum for the range `[first, last)` using the
+
559// binary operator `f`, with initial value `init` and
+
560// identity element `identity`, and store the result in the range
+
561// starting from `d_first`.
+
562//
+
563// This is different from `exclusive_scan` in the sequential algorithm by
+
564// requiring an identity element. This is needed so that each block can be
+
565// scanned in parallel and combined later.
+
566//
+
567// The input range `[first, last)` and
+
568// the output range `[d_first, d_first + last - first)`
+
569// must be equal or non-overlapping.
+
570template <typename InputIter, typename OutputIter,
+
571 typename BinOp = decltype(std::plus<typename std::iterator_traits<
+
572 InputIter>::value_type>()),
+
573 typename T = typename std::iterator_traits<InputIter>::value_type>
+
574void exclusive_scan(InputIter first, InputIter last, OutputIter d_first,
+
575 T init = static_cast<T>(0), BinOp f = std::plus<T>(),
+
576 T identity = static_cast<T>(0)) {
+
577 exclusive_scan(autoPolicy(first, last, 1e5), first, last, d_first, init, f,
+
578 identity);
+
579}
+
580
+
581// Apply function `f` on the input range `[first, last)` and store the result in
+
582// the range starting from `d_first`.
+
583//
+
584// The input range `[first, last)` and
+
585// the output range `[d_first, d_first + last - first)`
+
586// must be equal or non-overlapping.
+
587template <typename InputIter, typename OutputIter, typename F>
+
588void transform(ExecutionPolicy policy, InputIter first, InputIter last,
+
589 OutputIter d_first, F f) {
+
590 static_assert(std::is_convertible_v<
+
591 typename std::iterator_traits<InputIter>::iterator_category,
+
592 std::random_access_iterator_tag>,
+
593 "You can only parallelize RandomAccessIterator.");
+
594 static_assert(
+
595 std::is_convertible_v<
+
596 typename std::iterator_traits<OutputIter>::iterator_category,
+
597 std::random_access_iterator_tag>,
+
598 "You can only parallelize RandomAccessIterator.");
+
599#if MANIFOLD_PAR == 'T'
+
600 if (policy == ExecutionPolicy::Par) {
+
601 tbb::parallel_for(
+
602 tbb::blocked_range<size_t>(
+
603 0_uz, static_cast<size_t>(std::distance(first, last))),
+
604 [&](const tbb::blocked_range<size_t> &range) {
+
605 std::transform(first + range.begin(), first + range.end(),
+
606 d_first + range.begin(), f);
+
607 });
+
608 return;
+
609 }
+
610#endif
+
611 std::transform(first, last, d_first, f);
+
612}
+
613
+
614// Apply function `f` on the input range `[first, last)` and store the result in
+
615// the range starting from `d_first`.
+
616//
+
617// The input range `[first, last)` and
+
618// the output range `[d_first, d_first + last - first)`
+
619// must be equal or non-overlapping.
+
620template <typename InputIter, typename OutputIter, typename F>
+
621void transform(InputIter first, InputIter last, OutputIter d_first, F f) {
+
622 transform(autoPolicy(first, last, 1e5), first, last, d_first, f);
+
623}
+
624
+
625// Copy the input range `[first, last)` to the output range
+
626// starting from `d_first`.
+
627//
+
628// The input range `[first, last)` and
+
629// the output range `[d_first, d_first + last - first)`
+
630// must not overlap.
+
631template <typename InputIter, typename OutputIter>
+
632void copy(ExecutionPolicy policy, InputIter first, InputIter last,
+
633 OutputIter d_first) {
+
634 static_assert(std::is_convertible_v<
+
635 typename std::iterator_traits<InputIter>::iterator_category,
+
636 std::random_access_iterator_tag>,
+
637 "You can only parallelize RandomAccessIterator.");
+
638 static_assert(
+
639 std::is_convertible_v<
+
640 typename std::iterator_traits<OutputIter>::iterator_category,
+
641 std::random_access_iterator_tag>,
+
642 "You can only parallelize RandomAccessIterator.");
+
643#if MANIFOLD_PAR == 'T'
+
644 if (policy == ExecutionPolicy::Par) {
+
645 tbb::parallel_for(tbb::blocked_range<size_t>(
+
646 0_uz, static_cast<size_t>(std::distance(first, last)),
+
647 details::kSeqThreshold),
+
648 [&](const tbb::blocked_range<size_t> &range) {
+
649 std::copy(first + range.begin(), first + range.end(),
+
650 d_first + range.begin());
+
651 });
+
652 return;
+
653 }
+
654#endif
+
655 std::copy(first, last, d_first);
+
656}
+
657
+
658// Copy the input range `[first, last)` to the output range
+
659// starting from `d_first`.
+
660//
+
661// The input range `[first, last)` and
+
662// the output range `[d_first, d_first + last - first)`
+
663// must not overlap.
+
664template <typename InputIter, typename OutputIter>
+
665void copy(InputIter first, InputIter last, OutputIter d_first) {
+
666 copy(autoPolicy(first, last, 1e6), first, last, d_first);
+
667}
+
668
+
669// Copy the input range `[first, first + n)` to the output range
+
670// starting from `d_first`.
+
671//
+
672// The input range `[first, first + n)` and
+
673// the output range `[d_first, d_first + n)`
+
674// must not overlap.
+
675template <typename InputIter, typename OutputIter>
+
676void copy_n(ExecutionPolicy policy, InputIter first, size_t n,
+
677 OutputIter d_first) {
+
678 copy(policy, first, first + n, d_first);
+
679}
+
680
+
681// Copy the input range `[first, first + n)` to the output range
+
682// starting from `d_first`.
+
683//
+
684// The input range `[first, first + n)` and
+
685// the output range `[d_first, d_first + n)`
+
686// must not overlap.
+
687template <typename InputIter, typename OutputIter>
+
688void copy_n(InputIter first, size_t n, OutputIter d_first) {
+
689 copy(autoPolicy(n, 1e6), first, first + n, d_first);
+
690}
+
691
+
692// Fill the range `[first, last)` with `value`.
+
693template <typename OutputIter, typename T>
+
694void fill(ExecutionPolicy policy, OutputIter first, OutputIter last, T value) {
+
695 static_assert(
+
696 std::is_convertible_v<
+
697 typename std::iterator_traits<OutputIter>::iterator_category,
+
698 std::random_access_iterator_tag>,
+
699 "You can only parallelize RandomAccessIterator.");
+
700#if MANIFOLD_PAR == 'T'
+
701 if (policy == ExecutionPolicy::Par) {
+
702 tbb::parallel_for(tbb::blocked_range<OutputIter>(first, last),
+
703 [&](const tbb::blocked_range<OutputIter> &range) {
+
704 std::fill(range.begin(), range.end(), value);
+
705 });
+
706 return;
+
707 }
+
708#endif
+
709 std::fill(first, last, value);
+
710}
+
711
+
712// Fill the range `[first, last)` with `value`.
+
713template <typename OutputIter, typename T>
+
714void fill(OutputIter first, OutputIter last, T value) {
+
715 fill(autoPolicy(first, last, 5e5), first, last, value);
+
716}
+
717
+
718// Count the number of elements in the input range `[first, last)` satisfying
+
719// predicate `pred`, i.e. `pred(x) == true`.
+
720template <typename InputIter, typename P>
+
721size_t count_if(ExecutionPolicy policy, InputIter first, InputIter last,
+
722 P pred) {
+
723#if MANIFOLD_PAR == 'T'
+
724 if (policy == ExecutionPolicy::Par) {
+
725 return reduce(policy, TransformIterator(first, pred),
+
726 TransformIterator(last, pred), 0_uz, std::plus<size_t>());
+
727 }
+
728#endif
+
729 return std::count_if(first, last, pred);
+
730}
+
731
+
732// Count the number of elements in the input range `[first, last)` satisfying
+
733// predicate `pred`, i.e. `pred(x) == true`.
+
734template <typename InputIter, typename P>
+
735size_t count_if(InputIter first, InputIter last, P pred) {
+
736 return count_if(autoPolicy(first, last, 1e4), first, last, pred);
+
737}
+
738
+
739// Check if all elements in the input range `[first, last)` satisfy
+
740// predicate `pred`, i.e. `pred(x) == true`.
+
741template <typename InputIter, typename P>
+
742bool all_of(ExecutionPolicy policy, InputIter first, InputIter last, P pred) {
+
743 static_assert(std::is_convertible_v<
+
744 typename std::iterator_traits<InputIter>::iterator_category,
+
745 std::random_access_iterator_tag>,
+
746 "You can only parallelize RandomAccessIterator.");
+
747#if MANIFOLD_PAR == 'T'
+
748 if (policy == ExecutionPolicy::Par) {
+
749 // should we use deterministic reduce here?
+
750 return tbb::parallel_reduce(
+
751 tbb::blocked_range<InputIter>(first, last), true,
+
752 [&](const tbb::blocked_range<InputIter> &range, bool value) {
+
753 if (!value) return false;
+
754 for (InputIter i = range.begin(); i != range.end(); i++)
+
755 if (!pred(*i)) return false;
+
756 return true;
+
757 },
+
758 [](bool a, bool b) { return a && b; });
+
759 }
+
760#endif
+
761 return std::all_of(first, last, pred);
+
762}
+
763
+
764// Check if all elements in the input range `[first, last)` satisfy
+
765// predicate `pred`, i.e. `pred(x) == true`.
+
766template <typename InputIter, typename P>
+
767bool all_of(InputIter first, InputIter last, P pred) {
+
768 return all_of(autoPolicy(first, last, 1e5), first, last, pred);
+
769}
+
770
+
771// Copy values in the input range `[first, last)` to the output range
+
772// starting from `d_first` that satisfies the predicate `pred`,
+
773// i.e. `pred(x) == true`, and returns `d_first + n` where `n` is the number of
+
774// times the predicate is evaluated to true.
+
775//
+
776// This function is stable, meaning that the relative order of elements in the
+
777// output range remains unchanged.
+
778//
+
779// The input range `[first, last)` and
+
780// the output range `[d_first, d_first + last - first)`
+
781// must not overlap.
+
782template <typename InputIter, typename OutputIter, typename P>
+
783OutputIter copy_if(ExecutionPolicy policy, InputIter first, InputIter last,
+
784 OutputIter d_first, P pred) {
+
785 static_assert(std::is_convertible_v<
+
786 typename std::iterator_traits<InputIter>::iterator_category,
+
787 std::random_access_iterator_tag>,
+
788 "You can only parallelize RandomAccessIterator.");
+
789 static_assert(
+
790 std::is_convertible_v<
+
791 typename std::iterator_traits<OutputIter>::iterator_category,
+
792 std::random_access_iterator_tag>,
+
793 "You can only parallelize RandomAccessIterator.");
+
794#if MANIFOLD_PAR == 'T'
+
795 if (policy == ExecutionPolicy::Par) {
+
796 auto pred2 = [&](size_t i) { return pred(first[i]); };
+
797 details::CopyIfScanBody body(pred2, first, d_first);
+
798 tbb::parallel_scan(
+
799 tbb::blocked_range<size_t>(0, std::distance(first, last)), body);
+
800 return d_first + body.get_sum();
+
801 }
+
802#endif
+
803 return std::copy_if(first, last, d_first, pred);
+
804}
+
805
+
806// Copy values in the input range `[first, last)` to the output range
+
807// starting from `d_first` that satisfies the predicate `pred`, i.e. `pred(x) ==
+
808// true`, and returns `d_first + n` where `n` is the number of times the
+
809// predicate is evaluated to true.
+
810//
+
811// This function is stable, meaning that the relative order of elements in the
+
812// output range remains unchanged.
+
813//
+
814// The input range `[first, last)` and
+
815// the output range `[d_first, d_first + last - first)`
+
816// must not overlap.
+
817template <typename InputIter, typename OutputIter, typename P>
+
818OutputIter copy_if(InputIter first, InputIter last, OutputIter d_first,
+
819 P pred) {
+
820 return copy_if(autoPolicy(first, last, 1e5), first, last, d_first, pred);
+
821}
+
822
+
823// Remove values in the input range `[first, last)` that satisfies
+
824// the predicate `pred`, i.e. `pred(x) == true`, and returns `first + n`
+
825// where `n` is the number of times the predicate is evaluated to false.
+
826//
+
827// This function is stable, meaning that the relative order of elements that
+
828// remained are unchanged.
+
829//
+
830// Only trivially destructable types are supported.
+
831template <typename Iter, typename P,
+
832 typename T = typename std::iterator_traits<Iter>::value_type>
+
833Iter remove_if(ExecutionPolicy policy, Iter first, Iter last, P pred) {
+
834 static_assert(std::is_convertible_v<
+
835 typename std::iterator_traits<Iter>::iterator_category,
+
836 std::random_access_iterator_tag>,
+
837 "You can only parallelize RandomAccessIterator.");
+
838 static_assert(std::is_trivially_destructible_v<T>,
+
839 "Our simple implementation does not support types that are "
+
840 "not trivially destructable.");
+
841#if MANIFOLD_PAR == 'T'
+
842 if (policy == ExecutionPolicy::Par) {
+
843 T *tmp = new T[std::distance(first, last)];
+
844 auto back =
+
845 copy_if(policy, first, last, tmp, [&](T v) { return !pred(v); });
+
846 copy(policy, tmp, back, first);
+
847 auto d = std::distance(tmp, back);
+
848 delete[] tmp;
+
849 return first + d;
+
850 }
+
851#endif
+
852 return std::remove_if(first, last, pred);
+
853}
+
854
+
855// Remove values in the input range `[first, last)` that satisfies
+
856// the predicate `pred`, i.e. `pred(x) == true`, and
+
857// returns `first + n` where `n` is the number of times the predicate is
+
858// evaluated to false.
+
859//
+
860// This function is stable, meaning that the relative order of elements that
+
861// remained are unchanged.
+
862//
+
863// Only trivially destructable types are supported.
+
864template <typename Iter, typename P,
+
865 typename T = typename std::iterator_traits<Iter>::value_type>
+
866Iter remove_if(Iter first, Iter last, P pred) {
+
867 return remove_if(autoPolicy(first, last, 1e4), first, last, pred);
+
868}
+
869
+
870// Remove values in the input range `[first, last)` that are equal to `value`.
+
871// Returns `first + n` where `n` is the number of values
+
872// that are not equal to `value`.
+
873//
+
874// This function is stable, meaning that the relative order of elements that
+
875// remained are unchanged.
+
876//
+
877// Only trivially destructable types are supported.
+
878template <typename Iter,
+
879 typename T = typename std::iterator_traits<Iter>::value_type>
+
880Iter remove(ExecutionPolicy policy, Iter first, Iter last, T value) {
+
881 static_assert(std::is_convertible_v<
+
882 typename std::iterator_traits<Iter>::iterator_category,
+
883 std::random_access_iterator_tag>,
+
884 "You can only parallelize RandomAccessIterator.");
+
885 static_assert(std::is_trivially_destructible_v<T>,
+
886 "Our simple implementation does not support types that are "
+
887 "not trivially destructable.");
+
888#if MANIFOLD_PAR == 'T'
+
889 if (policy == ExecutionPolicy::Par) {
+
890 T *tmp = new T[std::distance(first, last)];
+
891 auto back =
+
892 copy_if(policy, first, last, tmp, [&](T v) { return v != value; });
+
893 copy(policy, tmp, back, first);
+
894 auto d = std::distance(tmp, back);
+
895 delete[] tmp;
+
896 return first + d;
+
897 }
+
898#endif
+
899 return std::remove(first, last, value);
+
900}
+
901
+
902// Remove values in the input range `[first, last)` that are equal to `value`.
+
903// Returns `first + n` where `n` is the number of values
+
904// that are not equal to `value`.
+
905//
+
906// This function is stable, meaning that the relative order of elements that
+
907// remained are unchanged.
+
908//
+
909// Only trivially destructable types are supported.
+
910template <typename Iter,
+
911 typename T = typename std::iterator_traits<Iter>::value_type>
+
912Iter remove(Iter first, Iter last, T value) {
+
913 return remove(autoPolicy(first, last, 1e4), first, last, value);
+
914}
+
915
+
916// For each group of consecutive elements in the range `[first, last)` with the
+
917// same value, unique removes all but the first element of the group. The return
+
918// value is an iterator `new_last` such that no two consecutive elements in the
+
919// range `[first, new_last)` are equal.
+
920//
+
921// This function is stable, meaning that the relative order of elements that
+
922// remained are unchanged.
+
923//
+
924// Only trivially destructable types are supported.
+
925template <typename Iter,
+
926 typename T = typename std::iterator_traits<Iter>::value_type>
+
927Iter unique(ExecutionPolicy policy, Iter first, Iter last) {
+
928 static_assert(std::is_convertible_v<
+
929 typename std::iterator_traits<Iter>::iterator_category,
+
930 std::random_access_iterator_tag>,
+
931 "You can only parallelize RandomAccessIterator.");
+
932 static_assert(std::is_trivially_destructible_v<T>,
+
933 "Our simple implementation does not support types that are "
+
934 "not trivially destructable.");
+
935#if MANIFOLD_PAR == 'T'
+
936 if (policy == ExecutionPolicy::Par && first != last) {
+
937 Iter newSrcStart = first;
+
938 // cap the maximum buffer size, proved to be beneficial for unique with huge
+
939 // array size
+
940 constexpr size_t MAX_BUFFER_SIZE = 1 << 16;
+
941 T *tmp = new T[std::min(MAX_BUFFER_SIZE,
+
942 static_cast<size_t>(std::distance(first, last)))];
+
943 auto pred = [&](size_t i) { return tmp[i] != tmp[i + 1]; };
+
944 do {
+
945 size_t length =
+
946 std::min(MAX_BUFFER_SIZE,
+
947 static_cast<size_t>(std::distance(newSrcStart, last)));
+
948 copy(policy, newSrcStart, newSrcStart + length, tmp);
+
949 *first = *newSrcStart;
+
950 // this is not a typo, the index i is offset by 1, so to compare an
+
951 // element with its predecessor we need to compare i and i + 1.
+
952 details::CopyIfScanBody body(pred, tmp + 1, first + 1);
+
953 tbb::parallel_scan(tbb::blocked_range<size_t>(0, length - 1), body);
+
954 first += body.get_sum() + 1;
+
955 newSrcStart += length;
+
956 } while (newSrcStart != last);
+
957 delete[] tmp;
+
958 return first;
+
959 }
+
960#endif
+
961 return std::unique(first, last);
+
962}
+
963
+
964// For each group of consecutive elements in the range `[first, last)` with the
+
965// same value, unique removes all but the first element of the group. The return
+
966// value is an iterator `new_last` such that no two consecutive elements in the
+
967// range `[first, new_last)` are equal.
+
968//
+
969// This function is stable, meaning that the relative order of elements that
+
970// remained are unchanged.
+
971//
+
972// Only trivially destructable types are supported.
+
973template <typename Iter,
+
974 typename T = typename std::iterator_traits<Iter>::value_type>
+
975Iter unique(Iter first, Iter last) {
+
976 return unique(autoPolicy(first, last, 1e4), first, last);
+
977}
+
978
+
979// Sort the input range `[first, last)` in ascending order.
+
980//
+
981// This function is stable, meaning that the relative order of elements that are
+
982// incomparable remains unchanged.
+
983//
+
984// Only trivially destructable types are supported.
+
985template <typename Iterator,
+
986 typename T = typename std::iterator_traits<Iterator>::value_type>
+
987void stable_sort(ExecutionPolicy policy, Iterator first, Iterator last) {
+
988#if MANIFOLD_PAR == 'T'
+
989 details::SortFunctor<Iterator, T>()(policy, first, last);
+
990#else
+
991 std::stable_sort(first, last);
+
992#endif
+
993}
+
994
+
995// Sort the input range `[first, last)` in ascending order.
+
996//
+
997// This function is stable, meaning that the relative order of elements that are
+
998// incomparable remains unchanged.
+
999//
+
1000// Only trivially destructable types are supported.
+
1001template <typename Iterator,
+
1002 typename T = typename std::iterator_traits<Iterator>::value_type>
+
1003void stable_sort(Iterator first, Iterator last) {
+
1004 stable_sort(autoPolicy(first, last, 1e4), first, last);
+
1005}
+
1006
+
1007// Sort the input range `[first, last)` in ascending order using the comparison
+
1008// function `comp`.
+
1009//
+
1010// This function is stable, meaning that the relative order of elements that are
+
1011// incomparable remains unchanged.
+
1012//
+
1013// Only trivially destructable types are supported.
+
1014template <typename Iterator,
+
1015 typename T = typename std::iterator_traits<Iterator>::value_type,
+
1016 typename Comp = decltype(std::less<T>())>
+
1017void stable_sort(ExecutionPolicy policy, Iterator first, Iterator last,
+
1018 Comp comp) {
+
1019#if MANIFOLD_PAR == 'T'
+
1020 details::mergeSort(policy, first, last, comp);
+
1021#else
+
1022 std::stable_sort(first, last, comp);
+
1023#endif
+
1024}
+
1025
+
1026// Sort the input range `[first, last)` in ascending order using the comparison
+
1027// function `comp`.
+
1028//
+
1029// This function is stable, meaning that the relative order of elements that are
+
1030// incomparable remains unchanged.
+
1031//
+
1032// Only trivially destructable types are supported.
+
1033template <typename Iterator,
+
1034 typename T = typename std::iterator_traits<Iterator>::value_type,
+
1035 typename Comp = decltype(std::less<T>())>
+
1036void stable_sort(Iterator first, Iterator last, Comp comp) {
+
1037 stable_sort(autoPolicy(first, last, 1e4), first, last, comp);
+
1038}
+
1039
+
1040// `scatter` copies elements from a source range into an output array according
+
1041// to a map. For each iterator `i` in the range `[first, last)`, the value `*i`
+
1042// is assigned to `outputFirst[mapFirst[i - first]]`. If the same index appears
+
1043// more than once in the range `[mapFirst, mapFirst + (last - first))`, the
+
1044// result is undefined.
+
1045//
+
1046// The map range, input range and the output range must not overlap.
+
1047template <typename InputIterator1, typename InputIterator2,
+
1048 typename OutputIterator>
+
1049void scatter(ExecutionPolicy policy, InputIterator1 first, InputIterator1 last,
+
1050 InputIterator2 mapFirst, OutputIterator outputFirst) {
+
1051 for_each(policy, countAt(0_uz),
+
1052 countAt(static_cast<size_t>(std::distance(first, last))),
+
1053 [first, mapFirst, outputFirst](size_t i) {
+
1054 outputFirst[mapFirst[i]] = first[i];
+
1055 });
+
1056}
+
1057
+
1058// `scatter` copies elements from a source range into an output array according
+
1059// to a map. For each iterator `i` in the range `[first, last)`, the value `*i`
+
1060// is assigned to `outputFirst[mapFirst[i - first]]`. If the same index appears
+
1061// more than once in the range `[mapFirst, mapFirst + (last - first))`,
+
1062// the result is undefined.
+
1063//
+
1064// The map range, input range and the output range must not overlap.
+
1065template <typename InputIterator1, typename InputIterator2,
+
1066 typename OutputIterator>
+
1067void scatter(InputIterator1 first, InputIterator1 last, InputIterator2 mapFirst,
+
1068 OutputIterator outputFirst) {
+
1069 scatter(autoPolicy(first, last, 1e5), first, last, mapFirst, outputFirst);
+
1070}
+
1071
+
1072// `gather` copies elements from a source array into a destination range
+
1073// according to a map. For each input iterator `i`
+
1074// in the range `[mapFirst, mapLast)`, the value `inputFirst[*i]`
+
1075// is assigned to `outputFirst[i - map_first]`.
+
1076//
+
1077// The map range, input range and the output range must not overlap.
+
1078template <typename InputIterator, typename RandomAccessIterator,
+
1079 typename OutputIterator>
+
1080void gather(ExecutionPolicy policy, InputIterator mapFirst,
+
1081 InputIterator mapLast, RandomAccessIterator inputFirst,
+
1082 OutputIterator outputFirst) {
+
1083 for_each(policy, countAt(0_uz),
+
1084 countAt(static_cast<size_t>(std::distance(mapFirst, mapLast))),
+
1085 [mapFirst, inputFirst, outputFirst](size_t i) {
+
1086 outputFirst[i] = inputFirst[mapFirst[i]];
+
1087 });
+
1088}
+
1089
+
1090// `gather` copies elements from a source array into a destination range
+
1091// according to a map. For each input iterator `i`
+
1092// in the range `[mapFirst, mapLast)`, the value `inputFirst[*i]`
+
1093// is assigned to `outputFirst[i - map_first]`.
+
1094//
+
1095// The map range, input range and the output range must not overlap.
+
1096template <typename InputIterator, typename RandomAccessIterator,
+
1097 typename OutputIterator>
+
1098void gather(InputIterator mapFirst, InputIterator mapLast,
+
1099 RandomAccessIterator inputFirst, OutputIterator outputFirst) {
+
1100 gather(autoPolicy(std::distance(mapFirst, mapLast), 1e5), mapFirst, mapLast,
+
1101 inputFirst, outputFirst);
+
1102}
+
1103
+
1104// Write `[0, last - first)` to the range `[first, last)`.
+
1105template <typename Iterator>
+
1106void sequence(ExecutionPolicy policy, Iterator first, Iterator last) {
+
1107 for_each(policy, countAt(0_uz),
+
1108 countAt(static_cast<size_t>(std::distance(first, last))),
+
1109 [first](size_t i) { first[i] = i; });
+
1110}
+
1111
+
1112// Write `[0, last - first)` to the range `[first, last)`.
+
1113template <typename Iterator>
+
1114void sequence(Iterator first, Iterator last) {
+
1115 sequence(autoPolicy(first, last, 1e5), first, last);
+
1116}
+
1117
+
1118} // namespace manifold
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/plus.svg b/docs/html/plus.svg new file mode 100644 index 000000000..075201655 --- /dev/null +++ b/docs/html/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/html/plusd.svg b/docs/html/plusd.svg new file mode 100644 index 000000000..0c65bfe94 --- /dev/null +++ b/docs/html/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/html/polygon_8h_source.html b/docs/html/polygon_8h_source.html new file mode 100644 index 000000000..071e15bb3 --- /dev/null +++ b/docs/html/polygon_8h_source.html @@ -0,0 +1,155 @@ + + + + + + + +Manifold: polygon.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
polygon.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include "manifold/common.h"
+
17
+
18namespace manifold {
+
19
+
+
27struct PolyVert {
+
29 vec2 pos;
+
31 int idx;
+
32};
+
+
33
+
34using SimplePolygonIdx = std::vector<PolyVert>;
+
35using PolygonsIdx = std::vector<SimplePolygonIdx>;
+
36
+
37std::vector<ivec3> TriangulateIdx(const PolygonsIdx &polys,
+
38 double precision = -1);
+
44std::vector<ivec3> Triangulate(const Polygons &polygons, double precision = -1);
+
45
+
46ExecutionParams &PolygonParams();
+
48} // namespace manifold
+
std::vector< ivec3 > Triangulate(const Polygons &polygons, double precision=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition polygon.cpp:995
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
Definition common.h:645
+
vec2 pos
X-Y position.
Definition polygon.h:29
+
int idx
ID or index into another vertex vector.
Definition polygon.h:31
+
std::vector< ivec3 > TriangulateIdx(const PolygonsIdx &polys, double precision=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition polygon.cpp:946
+
Definition polygon.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/quickhull_8h_source.html b/docs/html/quickhull_8h_source.html new file mode 100644 index 000000000..07fccea70 --- /dev/null +++ b/docs/html/quickhull_8h_source.html @@ -0,0 +1,422 @@ + + + + + + + +Manifold: quickhull.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
quickhull.h
+
+
+
1// Copyright 2024 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14//
+
15// Derived from the public domain work of Antti Kuukka at
+
16// https://github.com/akuukka/quickhull
+
17
+
18/*
+
19 * INPUT: a list of points in 3D space (for example, vertices of a 3D mesh)
+
20 *
+
21 * OUTPUT: a ConvexHull object which provides vertex and index buffers of the
+
22 *generated convex hull as a triangle mesh.
+
23 *
+
24 *
+
25 *
+
26 * The implementation is thread-safe if each thread is using its own QuickHull
+
27 *object.
+
28 *
+
29 *
+
30 * SUMMARY OF THE ALGORITHM:
+
31 * - Create initial simplex (tetrahedron) using extreme points. We have
+
32 *four faces now and they form a convex mesh M.
+
33 * - For each point, assign them to the first face for which they are on
+
34 *the positive side of (so each point is assigned to at most one face). Points
+
35 *inside the initial tetrahedron are left behind now and no longer affect the
+
36 *calculations.
+
37 * - Add all faces that have points assigned to them to Face Stack.
+
38 * - Iterate until Face Stack is empty:
+
39 * - Pop topmost face F from the stack
+
40 * - From the points assigned to F, pick the point P that is
+
41 *farthest away from the plane defined by F.
+
42 * - Find all faces of M that have P on their positive side. Let us
+
43 *call these the "visible faces".
+
44 * - Because of the way M is constructed, these faces are
+
45 *connected. Solve their horizon edge loop.
+
46 * - "Extrude to P": Create new faces by connecting
+
47 *P with the points belonging to the horizon edge. Add the new faces to M and
+
48 *remove the visible faces from M.
+
49 * - Each point that was assigned to visible faces is now assigned
+
50 *to at most one of the newly created faces.
+
51 * - Those new faces that have points assigned to them are added to
+
52 *the top of Face Stack.
+
53 * - M is now the convex hull.
+
54 *
+
55 * */
+
56#pragma once
+
57#include <array>
+
58#include <deque>
+
59#include <vector>
+
60
+
61#include "manifold/vec.h"
+
62#include "shared.h"
+
63
+
64namespace manifold {
+
65
+
+
66class Pool {
+
67 std::vector<std::unique_ptr<Vec<size_t>>> data;
+
68
+
69 public:
+
70 void clear() { data.clear(); }
+
71
+
72 void reclaim(std::unique_ptr<Vec<size_t>>& ptr) {
+
73 data.push_back(std::move(ptr));
+
74 }
+
75
+
76 std::unique_ptr<Vec<size_t>> get() {
+
77 if (data.size() == 0) {
+
78 return std::make_unique<Vec<size_t>>();
+
79 }
+
80 auto it = data.end() - 1;
+
81 std::unique_ptr<Vec<size_t>> r = std::move(*it);
+
82 data.erase(it);
+
83 return r;
+
84 }
+
85};
+
+
86
+
+
87class Plane {
+
88 public:
+
89 vec3 N;
+
90
+
91 // Signed distance (if normal is of length 1) to the plane from origin
+
92 double D;
+
93
+
94 // Normal length squared
+
95 double sqrNLength;
+
96
+
97 bool isPointOnPositiveSide(const vec3& Q) const {
+
98 double d = glm::dot(N, Q) + D;
+
99 if (d >= 0) return true;
+
100 return false;
+
101 }
+
102
+
103 Plane() = default;
+
104
+
105 // Construct a plane using normal N and any point P on the plane
+
106 Plane(const vec3& N, const vec3& P)
+
107 : N(N), D(glm::dot(-N, P)), sqrNLength(glm::dot(N, N)) {}
+
108};
+
+
109
+
+
110struct Ray {
+
111 const vec3 S;
+
112 const vec3 V;
+
113 const double VInvLengthSquared;
+
114
+
115 Ray(const vec3& S, const vec3& V)
+
116 : S(S), V(V), VInvLengthSquared(1 / (glm::dot(V, V))) {}
+
117};
+
+
118
+
+ +
120 public:
+
+
121 struct Face {
+
122 int he;
+
123 Plane P{};
+
124 double mostDistantPointDist = 0.0;
+
125 size_t mostDistantPoint = 0;
+
126 size_t visibilityCheckedOnIteration = 0;
+
127 std::uint8_t isVisibleFaceOnCurrentIteration : 1;
+
128 std::uint8_t inFaceStack : 1;
+
129 // Bit for each half edge assigned to this face, each being 0 or 1 depending
+
130 // on whether the edge belongs to horizon edge
+
131 std::uint8_t horizonEdgesOnCurrentIteration : 3;
+
132 std::unique_ptr<Vec<size_t>> pointsOnPositiveSide;
+
133
+
134 Face(size_t he)
+
135 : he(he),
+
136 isVisibleFaceOnCurrentIteration(0),
+
137 inFaceStack(0),
+
138 horizonEdgesOnCurrentIteration(0) {}
+
139
+
140 Face()
+
141 : he(-1),
+
142 isVisibleFaceOnCurrentIteration(0),
+
143 inFaceStack(0),
+
144 horizonEdgesOnCurrentIteration(0) {}
+
145
+
146 void disable() { he = -1; }
+
147
+
148 bool isDisabled() const { return he == -1; }
+
149 };
+
+
150
+
151 // Mesh data
+
152 std::vector<Face> faces;
+
153 Vec<Halfedge> halfedges;
+
154 Vec<int> halfedgeNext;
+
155
+
156 // When the mesh is modified and faces and half edges are removed from it, we
+
157 // do not actually remove them from the container vectors. Insted, they are
+
158 // marked as disabled which means that the indices can be reused when we need
+
159 // to add new faces and half edges to the mesh. We store the free indices in
+
160 // the following vectors.
+
161 Vec<size_t> disabledFaces, disabledHalfedges;
+
162
+
163 size_t addFace();
+
164
+
165 size_t addHalfedge();
+
166
+
167 // Mark a face as disabled and return a pointer to the points that were on the
+
168 // positive of it.
+
169 std::unique_ptr<Vec<size_t>> disableFace(size_t faceIndex) {
+
170 auto& f = faces[faceIndex];
+
171 f.disable();
+
172 disabledFaces.push_back(faceIndex);
+
173 return std::move(f.pointsOnPositiveSide);
+
174 }
+
175
+
176 void disableHalfedge(size_t heIndex) {
+
177 auto& he = halfedges[heIndex];
+
178 he.pairedHalfedge = -1;
+
179 disabledHalfedges.push_back(heIndex);
+
180 }
+
181
+
182 MeshBuilder() = default;
+
183
+
184 // Create a mesh with initial tetrahedron ABCD. Dot product of AB with the
+
185 // normal of triangle ABC should be negative.
+
186 void setup(int a, int b, int c, int d);
+
187
+
188 std::array<int, 3> getVertexIndicesOfFace(const Face& f) const;
+
189
+
190 std::array<int, 2> getVertexIndicesOfHalfEdge(const Halfedge& he) const {
+
191 return {halfedges[he.pairedHalfedge].endVert, he.endVert};
+
192 }
+
193
+
194 std::array<int, 3> getHalfEdgeIndicesOfFace(const Face& f) const {
+
195 return {f.he, halfedgeNext[f.he], halfedgeNext[halfedgeNext[f.he]]};
+
196 }
+
197};
+
+
198
+
+ +
200 public:
+
201 Vec<vec3> vertices;
+
202 // Index of one of the half edges of the faces
+
203 std::vector<size_t> halfEdgeIndexFaces;
+
204 Vec<Halfedge> halfedges;
+
205 Vec<int> halfedgeNext;
+
206
+
207 HalfEdgeMesh(const MeshBuilder& builderObject,
+
208 const VecView<vec3>& vertexData);
+
209};
+
+
210
+
211double defaultEps();
+
212
+
+ +
214 struct FaceData {
+
215 int faceIndex;
+
216 // If the face turns out not to be visible, this half edge will be marked as
+
217 // horizon edge
+
218 int enteredFromHalfedge;
+
219 };
+
220
+
221 double m_epsilon, epsilonSquared, scale;
+
222 bool planar;
+
223 Vec<vec3> planarPointCloudTemp;
+
224 VecView<vec3> originalVertexData;
+
225 MeshBuilder mesh;
+
226 std::array<size_t, 6> extremeValues;
+
227 size_t failedHorizonEdges = 0;
+
228
+
229 // Temporary variables used during iteration process
+
230 Vec<size_t> newFaceIndices;
+
231 Vec<size_t> newHalfedgeIndices;
+
232 Vec<size_t> visibleFaces;
+
233 Vec<size_t> horizonEdgesData;
+
234 Vec<FaceData> possiblyVisibleFaces;
+
235 std::vector<std::unique_ptr<Vec<size_t>>> disabledFacePointVectors;
+
236 std::deque<int> faceList;
+
237
+
238 // Create a half edge mesh representing the base tetrahedron from which the
+
239 // QuickHull iteration proceeds. extremeValues must be properly set up when
+
240 // this is called.
+
241 void setupInitialTetrahedron();
+
242
+
243 // Given a list of half edges, try to rearrange them so that they form a loop.
+
244 // Return true on success.
+
245 bool reorderHorizonEdges(VecView<size_t>& horizonEdges);
+
246
+
247 // Find indices of extreme values (max x, min x, max y, min y, max z, min z)
+
248 // for the given point cloud
+
249 std::array<size_t, 6> getExtremeValues();
+
250
+
251 // Compute scale of the vertex data.
+
252 double getScale(const std::array<size_t, 6>& extremeValuesInput);
+
253
+
254 // Each face contains a unique pointer to a vector of indices. However, many -
+
255 // often most - faces do not have any points on the positive side of them
+
256 // especially at the the end of the iteration. When a face is removed from the
+
257 // mesh, its associated point vector, if such exists, is moved to the index
+
258 // vector pool, and when we need to add new faces with points on the positive
+
259 // side to the mesh, we reuse these vectors. This reduces the amount of
+
260 // std::vectors we have to deal with, and impact on performance is remarkable.
+
261 Pool indexVectorPool;
+
262 inline std::unique_ptr<Vec<size_t>> getIndexVectorFromPool();
+
263 inline void reclaimToIndexVectorPool(std::unique_ptr<Vec<size_t>>& ptr);
+
264
+
265 // Associates a point with a face if the point resides on the positive side of
+
266 // the plane. Returns true if the points was on the positive side.
+
267 inline bool addPointToFace(typename MeshBuilder::Face& f, size_t pointIndex);
+
268
+
269 // This will create HalfedgeMesh from which we create the ConvexHull object
+
270 // that buildMesh function returns
+
271 void createConvexHalfedgeMesh();
+
272
+
273 public:
+
274 // This function assumes that the pointCloudVec data resides in memory in the
+
275 // following format: x_0,y_0,z_0,x_1,y_1,z_1,...
+
276 QuickHull(VecView<vec3> pointCloudVec)
+
277 : originalVertexData(VecView(pointCloudVec)) {}
+
278
+
279 // Computes convex hull for a given point cloud. Params: eps: minimum distance
+
280 // to a plane to consider a point being on positive side of it (for a point
+
281 // cloud with scale 1) Returns: Convex hull of the point cloud as halfEdge
+
282 // vector and vertex vector
+
283 std::pair<Vec<Halfedge>, Vec<vec3>> buildMesh(double eps = defaultEps());
+
284};
+
+
285
+
286} // namespace manifold
+
Definition quickhull.h:199
+
Definition quickhull.h:119
+
Definition quickhull.h:87
+
Definition quickhull.h:66
+
Definition quickhull.h:213
+
Definition vec.h:43
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
Definition quickhull.h:121
+
Definition quickhull.h:110
+
+
+ + + + diff --git a/docs/html/resize.js b/docs/html/resize.js new file mode 100644 index 000000000..aaeb6fc0a --- /dev/null +++ b/docs/html/resize.js @@ -0,0 +1,155 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var once=1; +function initResizable() +{ + var cookie_namespace = 'doxygen'; + var sidenav,navtree,content,header,barWidth=6,desktop_vp=768,titleHeight; + + function readSetting(cookie) + { + if (window.chrome) { + var val = localStorage.getItem(cookie_namespace+'_width'); + if (val) return val; + } else { + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) { + var index = document.cookie.indexOf(myCookie); + if (index != -1) { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + } + return 250; + } + + function writeSetting(cookie, val) + { + if (window.chrome) { + localStorage.setItem(cookie_namespace+"_width",val); + } else { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; SameSite=Lax; expires=" + expiration+"; path=/"; + } + } + + function resizeWidth() + { + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); + } + writeSetting('width',sidenavWidth-barWidth); + } + + function restoreWidth(navWidth) + { + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + } + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight() + { + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height(); + var contentHeight,navtreeHeight,sideNavHeight; + if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ + contentHeight = windowHeight - headerHeight - footerHeight; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (page_layout==1) { /* DISABLE_INDEX=YES */ + contentHeight = windowHeight - footerHeight; + navtreeHeight = windowHeight - headerHeight; + sideNavHeight = windowHeight; + } + content.css({height:contentHeight + "px"}); + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); + if (location.hash.slice(1)) { + (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); + } + } + + function collapseExpand() + { + var newWidth; + if (sidenav.width()>0) { + newWidth=0; + } + else { + var width = readSetting('width'); + newWidth = (width>250 && width<$(window).width()) ? width : 250; + } + restoreWidth(newWidth); + var sidenavWidth = $(sidenav).outerWidth(); + writeSetting('width',sidenavWidth-barWidth); + } + + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + $(window).resize(function() { resizeHeight(); }); + var device = navigator.userAgent.toLowerCase(); + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + var width = readSetting('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + if (once) { + $(".ui-resizable-handle").dblclick(collapseExpand); + once=0 + } + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/docs/html/samples_8h_source.html b/docs/html/samples_8h_source.html new file mode 100644 index 000000000..ff6d374f1 --- /dev/null +++ b/docs/html/samples_8h_source.html @@ -0,0 +1,160 @@ + + + + + + + +Manifold: samples.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
samples.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include "manifold/manifold.h"
+
17
+
18namespace manifold {
+
19
+
37Manifold TorusKnot(int p, int q, double majorRadius, double minorRadius,
+
38 double threadRadius, int circularSegments = 0,
+
39 int linearSegments = 0);
+
40
+
41Manifold StretchyBracelet(double radius = 30.0, double height = 8.0,
+
42 double width = 15.0, double thickness = 0.4,
+
43 int nDecor = 20, int nCut = 27, int nDivision = 30);
+
44
+
45Manifold MengerSponge(int n = 3);
+
46
+
47Manifold RoundedFrame(double edgeLength, double radius,
+
48 int circularSegments = 0);
+
49
+
50Manifold TetPuzzle(double edgeLength, double gap, int nDivisions);
+
51
+
52Manifold Scallop();
+
53
+
54Manifold GyroidModule(double size = 20, int n = 20);
+
55
+
56Manifold CondensedMatter(int fn = 16);
+ // end of Samples
58} // namespace manifold
+
Manifold TorusKnot(int p, int q, double majorRadius, double minorRadius, double threadRadius, int circularSegments=0, int linearSegments=0)
Definition knot.cpp:41
+
Manifold MengerSponge(int n=3)
Definition menger_sponge.cpp:43
+
Manifold Scallop()
Definition scallop.cpp:23
+
Manifold GyroidModule(double size=20, int n=20)
Definition gyroid_module.cpp:45
+
Manifold TetPuzzle(double edgeLength, double gap, int nDivisions)
Definition tet_puzzle.cpp:28
+
Manifold StretchyBracelet(double radius=30.0, double height=8.0, double width=15.0, double thickness=0.4, int nDecor=20, int nCut=27, int nDivision=30)
Definition bracelet.cpp:75
+
Manifold RoundedFrame(double edgeLength, double radius, int circularSegments=0)
Definition rounded_frame.cpp:29
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js new file mode 100644 index 000000000..71c32053f --- /dev/null +++ b/docs/html/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['1vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_0',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]] +]; diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js new file mode 100644 index 000000000..6f33b3d0b --- /dev/null +++ b/docs/html/search/all_1.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['a_20href_20https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_0',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['a_20href_20https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_1',['a href https: manifoldcad org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['about_20the_20author_2',['about the author',['..//github/workspace/bindings/wasm/README.md#autotoc_md14',1,'About the author'],['..//github/workspace/README.md#autotoc_md34',1,'About the author']]], + ['agreement_3',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md16',1,'']]], + ['all_5fof_4',['all_of',['../structbenchmarks_1_1all__of.html',1,'benchmarks']]], + ['area_5',['area',['../classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666',1,'manifold::CrossSection::Area()'],['../structmanifold_1_1_rect.html#ac84b151a969c68d662637e8245548666',1,'manifold::Rect::Area()']]], + ['asoriginal_6',['AsOriginal',['../classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57',1,'manifold::Manifold']]], + ['author_7',['author',['..//github/workspace/bindings/wasm/README.md#autotoc_md14',1,'About the author'],['..//github/workspace/README.md#autotoc_md34',1,'About the author']]], + ['autogenerated_20doc_20strings_8',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]] +]; diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js new file mode 100644 index 000000000..c84f94dbb --- /dev/null +++ b/docs/html/search/all_10.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['quality_0',['Quality',['../classmanifold_1_1_quality.html',1,'manifold']]], + ['quickhull_1',['QuickHull',['../classmanifold_1_1_quick_hull.html',1,'manifold']]] +]; diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js new file mode 100644 index 000000000..8d510e7ab --- /dev/null +++ b/docs/html/search/all_11.js @@ -0,0 +1,27 @@ +var searchData= +[ + ['ray_0',['Ray',['../structmanifold_1_1_ray.html',1,'manifold']]], + ['rect_1',['rect',['../structmanifold_1_1_rect.html',1,'Rect'],['../structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22',1,'manifold::Rect::Rect()'],['../structmanifold_1_1_rect.html#a4b37d0f1743973da4b1b82d32ed26dfd',1,'manifold::Rect::Rect(const vec2 a, const vec2 b)']]], + ['reduce_2',['reduce',['../structbenchmarks_1_1reduce.html',1,'benchmarks']]], + ['refine_3',['Refine',['../classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac',1,'manifold::Manifold']]], + ['refinetolength_4',['RefineToLength',['../classmanifold_1_1_manifold.html#a1381728e52975862d954032f717106d5',1,'manifold::Manifold']]], + ['reindexedge_5',['ReindexEdge',['../structmanifold_1_1_reindex_edge.html',1,'manifold']]], + ['reindexverts_6',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a70e88d0158e9011619309fc502979350',1,'manifold::Manifold::Impl']]], + ['relation_7',['Relation',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation',1,'manifold::Manifold::Impl']]], + ['release_5fchecklist_8',['RELEASE_CHECKLIST',['../md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html',1,'']]], + ['research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_9',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['reserveids_10',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['resettodefaults_11',['ResetToDefaults',['../classmanifold_1_1_quality.html#a4595203dc1f079e03b20e9d77e868535',1,'manifold::Quality']]], + ['result_12',['Result',['../struct_result.html',1,'']]], + ['reviews_13',['Code Reviews',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md17',1,'']]], + ['revolve_14',['Revolve',['../classmanifold_1_1_manifold.html#a8c454a293abbf86f520e10266087f5a6',1,'manifold::Manifold']]], + ['rotate_15',['rotate',['../classmanifold_1_1_cross_section.html#a794f36c935736ecf71806fb3ccd46956',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a7f74bf3b7c5dd34e84b82e7738fd25ff',1,'manifold::Manifold::Rotate()']]], + ['rotateup_16',['RotateUp',['../group___connections.html#ga7035018814a651a22f8bb32b84e6820f',1,'manifold']]], + ['roughness_17',['roughness',['../group___mesh_i_o.html#aae6a29bf1aea8336238154d7b4b95994',1,'manifold::Material']]], + ['round_18',['Round',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c',1,'manifold::CrossSection']]], + ['roundedframe_19',['RoundedFrame',['../group___samples.html#gaed7341c943d9bb53a52f01f4d9453bd8',1,'manifold']]], + ['run_5fall_20',['run_all',['../namespacerun__all.html',1,'']]], + ['runindex_21',['runIndex',['../structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4',1,'manifold::MeshGL']]], + ['runoriginalid_22',['runOriginalID',['../structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0',1,'manifold::MeshGL']]], + ['runtransform_23',['runTransform',['../structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js new file mode 100644 index 000000000..a837e7b3a --- /dev/null +++ b/docs/html/search/all_12.js @@ -0,0 +1,65 @@ +var searchData= +[ + ['s_20here_0',['s here',['..//github/workspace/README.md#autotoc_md24',1,'What's here'],['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'What's here']]], + ['samples_1',['Samples',['../group___samples.html',1,'']]], + ['sandboxes_2',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md20',1,'']]], + ['scale_3',['scale',['../classmanifold_1_1_cross_section.html#ad0f8a0ea9c4e2394bc4808dfb7ae1c69',1,'manifold::CrossSection::Scale()'],['../classmanifold_1_1_manifold.html#aa6153eb69d3a69e38e6508bf58449f04',1,'manifold::Manifold::Scale()'],['../structmanifold_1_1_rect.html#ab30d1e52df44eb451081926df999fc17',1,'manifold::Rect::Scale()'],['../structmanifold_1_1_box.html#ab30d1e52df44eb451081926df999fc17',1,'manifold::Box::Scale()']]], + ['scallop_4',['scallop',['../group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36',1,'manifold::Scallop()'],['../namespacescallop.html',1,'scallop']]], + ['seqcollisionrecorder_5',['SeqCollisionRecorder',['../structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html',1,'manifold::collider_internal']]], + ['setcircularsegments_6',['SetCircularSegments',['../classmanifold_1_1_quality.html#a6b80d08df8a58d699ce644e1248fe0e2',1,'manifold::Quality']]], + ['setmincircularangle_7',['SetMinCircularAngle',['../classmanifold_1_1_quality.html#a6bde1278da9ae16b0a081ec310c62859',1,'manifold::Quality']]], + ['setmincircularedgelength_8',['SetMinCircularEdgeLength',['../classmanifold_1_1_quality.html#ad5148a903ab599298e8f1df10167de9d',1,'manifold::Quality']]], + ['setnormals_9',['SetNormals',['../structmanifold_1_1_manifold_1_1_impl.html#ac35adfca9a18e8dd1a6a65355ad0ed07',1,'manifold::Manifold::Impl']]], + ['setprecision_10',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a496713ae74ada7e6aaee40464afc9d9e',1,'manifold::Manifold::Impl']]], + ['setproperties_11',['SetProperties',['../classmanifold_1_1_manifold.html#a6a852721876d6fce2136ac27e7377f8e',1,'manifold::Manifold']]], + ['sharedptrguard_12',['SharedPtrGuard',['../classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html',1,'manifold::ConcurrentSharedPtr']]], + ['sharing_20python_20colab_20example_20a_13',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['sharpentangent_14',['SharpenTangent',['../structmanifold_1_1_manifold_1_1_impl.html#a28cc7fde07cd82723e1f71699c7b502d',1,'manifold::Manifold::Impl']]], + ['shenanigans_15',['Windows Shenanigans',['..//github/workspace/README.md#autotoc_md29',1,'']]], + ['simplepolygon_16',['SimplePolygon',['../group___connections.html#gac63dd7235f7caf5698ab44acb83ba362',1,'manifold']]], + ['simplify_17',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_18',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_19',['sind',['../group___connections.html#gacbb1fe7fd1a4e41a0754ed80abaa593d',1,'manifold']]], + ['size_20',['size',['../structmanifold_1_1_rect.html#a8b0310b471c0b5898fb21d12b00eac81',1,'manifold::Rect::Size()'],['../structmanifold_1_1_box.html#ac7f1d96c2e44bdff4079fd40802e2ac6',1,'manifold::Box::Size()']]], + ['slice_21',['Slice',['../classmanifold_1_1_manifold.html#ad03837de2290a269fa14e0773c9913fa',1,'manifold::Manifold']]], + ['smooth_22',['smooth',['../classmanifold_1_1_manifold.html#aad322c5b69ab571a4f4fb5b26f945b90',1,'manifold::Manifold::Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})'],['../classmanifold_1_1_manifold.html#aff03aac40d42a60f8e4254db90530c83',1,'manifold::Manifold::Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})']]], + ['smoothbynormals_23',['SmoothByNormals',['../classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4',1,'manifold::Manifold']]], + ['smoothness_24',['smoothness',['../group___connections.html#structmanifold_1_1_smoothness',1,'Smoothness'],['../group___connections.html#af27647008768bbb6d067a4342dad9001',1,'manifold::Smoothness::smoothness']]], + ['smoothout_25',['SmoothOut',['../classmanifold_1_1_manifold.html#a0b59680c4bc2300e0e12713ab220d3d5',1,'manifold::Manifold']]], + ['sort_5fasc_26',['sort_Asc',['../structbenchmarks_1_1sort___asc.html',1,'benchmarks']]], + ['sort_5fasc_5fsize_27',['sort_Asc_size',['../structbenchmarks_1_1sort___asc__size.html',1,'benchmarks']]], + ['sort_5fasc_5fsize_5fmerge_28',['sort_Asc_size_merge',['../structbenchmarks_1_1sort___asc__size__merge.html',1,'benchmarks']]], + ['sort_5fdes_29',['sort_Des',['../structbenchmarks_1_1sort___des.html',1,'benchmarks']]], + ['sort_5fdes_5fsize_30',['sort_Des_size',['../structbenchmarks_1_1sort___des__size.html',1,'benchmarks']]], + ['sort_5fdes_5fsize_5fmerge_31',['sort_Des_size_merge',['../structbenchmarks_1_1sort___des__size__merge.html',1,'benchmarks']]], + ['sort_5feq_32',['sort_Eq',['../structbenchmarks_1_1sort___eq.html',1,'benchmarks']]], + ['sort_5feq_5fsize_33',['sort_Eq_size',['../structbenchmarks_1_1sort___eq__size.html',1,'benchmarks']]], + ['sort_5feq_5fsize_5fmerge_34',['sort_Eq_size_merge',['../structbenchmarks_1_1sort___eq__size__merge.html',1,'benchmarks']]], + ['sort_5frnd_35',['sort_Rnd',['../structbenchmarks_1_1sort___rnd.html',1,'benchmarks']]], + ['sort_5frnd_5fsize_36',['sort_Rnd_size',['../structbenchmarks_1_1sort___rnd__size.html',1,'benchmarks']]], + ['sort_5frnd_5fsize_5fmerge_37',['sort_Rnd_size_merge',['../structbenchmarks_1_1sort___rnd__size__merge.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_38',['sort_roughly_Asc',['../structbenchmarks_1_1sort__roughly___asc.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_5fsize_39',['sort_roughly_Asc_size',['../structbenchmarks_1_1sort__roughly___asc__size.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_5fsize_5fmerge_40',['sort_roughly_Asc_size_merge',['../structbenchmarks_1_1sort__roughly___asc__size__merge.html',1,'benchmarks']]], + ['sortfaces_41',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_42',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['sparseindices_43',['SparseIndices',['../classmanifold_1_1_sparse_indices.html',1,'manifold']]], + ['spectralnorm_44',['SpectralNorm',['../group___connections.html#ga6f4bce48eb47e3fe5e0d05c6e7ed0d05',1,'manifold']]], + ['sphere_45',['Sphere',['../classmanifold_1_1_manifold.html#a606301a59534ef00a89dc7d7a132abe6',1,'manifold::Manifold']]], + ['split_46',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['split_5fcube_47',['split_cube',['../namespacesplit__cube.html',1,'']]], + ['splitbyplane_48',['SplitByPlane',['../classmanifold_1_1_manifold.html#a40c2716b965886e4fb952e5ade866a5a',1,'manifold::Manifold']]], + ['square_49',['square',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304',1,'manifold::CrossSection::Square'],['../classmanifold_1_1_cross_section.html#a43e92332e827adee0914baf746fa677b',1,'manifold::CrossSection::Square(const vec2 dims, bool center=false)']]], + ['started_50',['Get Started',['../md_bindings_2wasm_2documents_2_get_01_started.html',1,'']]], + ['status_51',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['steps_52',['Next steps',['../md_bindings_2wasm_2documents_2_get_01_started.html#autotoc_md5',1,'']]], + ['stretchybracelet_53',['StretchyBracelet',['../group___samples.html#gac99ae21a77112ea3909eefb0a66e1ae4',1,'manifold']]], + ['stridedrange_54',['StridedRange',['../structmanifold_1_1_strided_range.html',1,'manifold']]], + ['strings_55',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]], + ['structure_20definitions_56',['data structure definitions',['../group___math.html',1,'']]], + ['subdivide_57',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#a364c1c537f3bfd0f4f37e3189aea3e26',1,'manifold::Manifold::Impl']]], + ['support_58',['Fuzzing Support',['..//github/workspace/README.md#autotoc_md33',1,'']]], + ['suppresserrors_59',['suppressErrors',['../group___debug.html#a48b673772893c29c426e98f8c84f0206',1,'manifold::ExecutionParams']]], + ['svd_60',['SVD',['../group___connections.html#gad55150a21602b41346eb9a1477131fe7',1,'manifold']]], + ['svdset_61',['SVDSet',['../group___connections.html#structmanifold_1_1_s_v_d_set',1,'manifold']]] +]; diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js new file mode 100644 index 000000000..d08ceab5c --- /dev/null +++ b/docs/html/search/all_13.js @@ -0,0 +1,28 @@ +var searchData= +[ + ['tangentfromnormal_0',['TangentFromNormal',['../structmanifold_1_1_manifold_1_1_impl.html#a5188293029f53ae9159a9a36fb66533a',1,'manifold::Manifold::Impl']]], + ['tetpuzzle_1',['TetPuzzle',['../group___samples.html#gaa69f000001c833bf1534f35c19a7e8b0',1,'manifold']]], + ['tetrahedron_2',['Tetrahedron',['../classmanifold_1_1_manifold.html#afbd42733f05fb87dec1b3dae9ff9f582',1,'manifold::Manifold']]], + ['the_20author_3',['the author',['..//github/workspace/README.md#autotoc_md34',1,'About the author'],['..//github/workspace/bindings/wasm/README.md#autotoc_md14',1,'About the author']]], + ['timer_4',['Timer',['../structmanifold_1_1_timer.html',1,'manifold']]], + ['tmpedge_5',['TmpEdge',['../structmanifold_1_1_tmp_edge.html',1,'manifold']]], + ['to_20contribute_6',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['topologyerr_7',['topologyErr',['../structmanifold_1_1topology_err.html',1,'manifold']]], + ['topolygons_8',['ToPolygons',['../classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2',1,'manifold::CrossSection']]], + ['torusknot_9',['TorusKnot',['../group___samples.html#ga0ccde255ceda709d8e4a54ec95f3ca3e',1,'manifold']]], + ['transform_10',['transform',['../classmanifold_1_1_cross_section.html#a534ac4a433b68882dba4919ade75946c',1,'manifold::CrossSection::Transform()'],['../classmanifold_1_1_manifold.html#af4459c0e7355b2805b2694da075c8346',1,'manifold::Manifold::Transform()'],['../structmanifold_1_1_box.html#ac57a6312e33544515f782970a3b66eb6',1,'manifold::Box::Transform()'],['../structmanifold_1_1_rect.html#a16290599b6b48837a6695ae030d288af',1,'manifold::Rect::Transform()']]], + ['transform_5freduce_11',['transform_reduce',['../structbenchmarks_1_1transform__reduce.html',1,'benchmarks']]], + ['transformbox_12',['TransformBox',['../structmanifold_1_1collider__internal_1_1_transform_box.html',1,'manifold::collider_internal']]], + ['transformiterator_13',['TransformIterator',['../structmanifold_1_1_transform_iterator.html',1,'manifold']]], + ['translate_14',['translate',['../classmanifold_1_1_manifold.html#a78fbea69555ea755f8731255060f7c9d',1,'manifold::Manifold::Translate()'],['../classmanifold_1_1_cross_section.html#a38bcb89b28140acbceca56f0bbda67b9',1,'manifold::CrossSection::Translate()']]], + ['tri_15',['tri',['../structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88',1,'manifold::TriRef']]], + ['triangulate_16',['Triangulate',['../group___connections.html#ga096515808119cda3b6aff7ab31bf6355',1,'manifold']]], + ['triangulateidx_17',['TriangulateIdx',['../group___private.html#ga526f0d57b4e5c29114576fdf13a304c0',1,'manifold']]], + ['trimbyplane_18',['TrimByPlane',['../classmanifold_1_1_manifold.html#aa8d62161da6e94da7651418c33c3e294',1,'manifold::Manifold']]], + ['triref_19',['TriRef',['../structmanifold_1_1_tri_ref.html',1,'manifold']]], + ['triverts_20',['triverts',['../structmanifold_1_1_mesh_g_l.html#afe0601a32ce917d3324b430a34f5d118',1,'manifold::MeshGL::triVerts'],['../group___connections.html#a83058b9f3f25723fef242bd276e44c01',1,'manifold::Mesh::triVerts']]], + ['type_5fcaster_3c_20glm_3a_3amat_3c_20c_2c_20r_2c_20t_2c_20q_20_3e_20_3e_21',['type_caster< glm::mat< C, R, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_22',['type_caster< glm::vec< N, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20manifold_3a_3avecview_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_23',['type_caster< manifold::VecView< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20std_3a_3avector_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_24',['type_caster< std::vector< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]] +]; diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js new file mode 100644 index 000000000..9f79e6d0a --- /dev/null +++ b/docs/html/search/all_14.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['union_0',['union',['../structmanifold_1_1_box.html#a9605138c461b1e437e59a71e1aa34653',1,'manifold::Box::Union(const vec3 p)'],['../structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd',1,'manifold::Box::Union(const Box &box) const'],['../structmanifold_1_1_rect.html#aab08573b89e6715df6a1b0e1c4222e8d',1,'manifold::Rect::Union(const vec2 p)'],['../structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70',1,'manifold::Rect::Union(const Rect &rect) const']]], + ['unionfind_1',['UnionFind',['../structmanifold_1_1_union_find.html',1,'manifold']]], + ['update_2',['Update',['../structmanifold_1_1_manifold_1_1_impl.html#aec0783b5a136e042adcc47bae4fe5291',1,'manifold::Manifold::Impl']]], + ['usererr_3',['userErr',['../structmanifold_1_1user_err.html',1,'manifold']]], + ['users_4',['users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md8',1,'Note for firefox users'],['..//github/workspace/README.md#autotoc_md19',1,'Users']]], + ['usp_20sharing_20python_20colab_20example_20a_5',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]] +]; diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js new file mode 100644 index 000000000..0fd561bda --- /dev/null +++ b/docs/html/search/all_15.js @@ -0,0 +1,46 @@ +var searchData= +[ + ['vec_0',['Vec',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20char_20_3e_1',['Vec< char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20double_20_3e_2',['Vec< double >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20facedata_20_3e_3',['Vec< FaceData >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20int_20_3e_4',['Vec< int >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20ivec3_20_3e_5',['Vec< ivec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3abox_20_3e_6',['Vec< manifold::Box >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3ahalfedge_20_3e_7',['Vec< manifold::Halfedge >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3atriref_20_3e_8',['Vec< manifold::TriRef >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20size_5ft_20_3e_9',['Vec< size_t >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_10',['Vec< std::pair< int, int > >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint64_20_3e_11',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_12',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_13',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20vec3_20_3e_14',['Vec< vec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20vec4_20_3e_15',['Vec< vec4 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_16',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_17',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3abox_20_3e_18',['VecView< const manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_19',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_20',['VecView< const std::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20t_20_3e_21',['VecView< const T >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20uint32_5ft_20_3e_22',['VecView< const uint32_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20double_20_3e_23',['VecView< double >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20facedata_20_3e_24',['VecView< FaceData >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_25',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20ivec3_20_3e_26',['VecView< ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_27',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_28',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_29',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20size_5ft_20_3e_30',['VecView< size_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_31',['VecView< std::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_32',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_33',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_34',['VecView< V >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20vec3_20_3e_35',['VecView< vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20vec4_20_3e_36',['VecView< vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['verbose_37',['verbose',['../group___debug.html#ab3f078684998b83967d507d0f453f454',1,'manifold::ExecutionParams']]], + ['vertcolor_38',['vertColor',['../group___mesh_i_o.html#a7833dfe9615e152876dd1cda4a721230',1,'manifold::Material']]], + ['vertexcollisionsz_39',['VertexCollisionsZ',['../structmanifold_1_1_manifold_1_1_impl.html#a601f5355c70f7c74a168e5cbd4a817a5',1,'manifold::Manifold::Impl']]], + ['vertnormal_40',['vertNormal',['../group___connections.html#ab2b1aacb347ab6a07a588e953cf4910d',1,'manifold::Mesh']]], + ['vertpos_41',['vertPos',['../group___connections.html#a69e541f12f1d8d7c134608c71441bd1f',1,'manifold::Mesh']]], + ['vertproperties_42',['vertProperties',['../structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_16.js b/docs/html/search/all_16.js new file mode 100644 index 000000000..536a4c39f --- /dev/null +++ b/docs/html/search/all_16.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['warp_0',['warp',['../classmanifold_1_1_cross_section.html#ac50618697f91880859f4d536f2569b5e',1,'manifold::CrossSection::Warp()'],['../classmanifold_1_1_manifold.html#a5366f7082adcbb2be63fcf2b4c57eb51',1,'manifold::Manifold::Warp()']]], + ['warpbatch_1',['warpbatch',['../classmanifold_1_1_cross_section.html#a2d4ae264fded90c78cf750ad0dbea33a',1,'manifold::CrossSection::WarpBatch()'],['../classmanifold_1_1_manifold.html#a7825d52e3102cc6e7d48a19f9ea0b468',1,'manifold::Manifold::WarpBatch()']]], + ['wasm_2',['WASM',['..//github/workspace/README.md#autotoc_md26',1,'']]], + ['what_20s_20here_3',['what s here',['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'What's here'],['..//github/workspace/README.md#autotoc_md24',1,'What's here']]], + ['windows_20shenanigans_4',['Windows Shenanigans',['..//github/workspace/README.md#autotoc_md29',1,'']]] +]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js new file mode 100644 index 000000000..8edb2a902 --- /dev/null +++ b/docs/html/search/all_2.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['barycentric_0',['Barycentric',['../group___private.html#structmanifold_1_1_barycentric',1,'manifold']]], + ['baryindices_1',['BaryIndices',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_bary_indices',1,'manifold::Manifold::Impl']]], + ['batchboolean_2',['batchboolean',['../classmanifold_1_1_cross_section.html#a8543728360bc7dda5472d5aa8647b36e',1,'manifold::CrossSection::BatchBoolean()'],['../classmanifold_1_1_manifold.html#a1b30c42e224bda7e71a3ed3cf02319c1',1,'manifold::Manifold::BatchBoolean()']]], + ['bindings_3',['Python Bindings',['../index.html',1,'']]], + ['boolean_4',['boolean',['../classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2',1,'manifold::CrossSection::Boolean()'],['../classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df',1,'manifold::Manifold::Boolean()']]], + ['boolean3_5',['Boolean3',['../classmanifold_1_1_boolean3.html',1,'manifold']]], + ['boundingbox_6',['BoundingBox',['../classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67',1,'manifold::Manifold']]], + ['bounds_7',['Bounds',['../classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c',1,'manifold::CrossSection']]], + ['box_8',['box',['../structmanifold_1_1_box.html',1,'Box'],['../structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5',1,'manifold::Box::Box()'],['../structmanifold_1_1_box.html#a8258a064a735f0c191bab31d0775912d',1,'manifold::Box::Box(const vec3 p1, const vec3 p2)']]], + ['bricks_9',['bricks',['../namespacebricks.html',1,'']]], + ['building_10',['Building',['..//github/workspace/README.md#autotoc_md25',1,'']]], + ['buildinternalboxes_11',['BuildInternalBoxes',['../structmanifold_1_1collider__internal_1_1_build_internal_boxes.html',1,'manifold::collider_internal']]] +]; diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js new file mode 100644 index 000000000..efea9c43d --- /dev/null +++ b/docs/html/search/all_3.js @@ -0,0 +1,50 @@ +var searchData= +[ + ['calculatebbox_0',['CalculateBBox',['../structmanifold_1_1_manifold_1_1_impl.html#a4bad2940552ae5f952d4b1f710627a25',1,'manifold::Manifold::Impl']]], + ['calculatecurvature_1',['CalculateCurvature',['../classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705',1,'manifold::Manifold']]], + ['calculatenormals_2',['calculatenormals',['../structmanifold_1_1_manifold_1_1_impl.html#adef45f00696640f682ede12311bdace7',1,'manifold::Manifold::Impl::CalculateNormals()'],['../classmanifold_1_1_manifold.html#ab6c0e49ed98c9c03bc1324d4ff8452ce',1,'manifold::Manifold::CalculateNormals()']]], + ['ccw_3',['CCW',['../group___connections.html#ga92f3267a3f49fa8b9199570c3adcbfb7',1,'manifold']]], + ['center_4',['center',['../structmanifold_1_1_rect.html#ac73874c64476da0c5d9f3f11c096826d',1,'manifold::Rect::Center()'],['../structmanifold_1_1_box.html#ac600d9d9003333be36f390c84dead39e',1,'manifold::Box::Center()']]], + ['circle_5',['Circle',['../classmanifold_1_1_cross_section.html#af9c4ae1a5b602abdd9d9d41cfda32ecf',1,'manifold::CrossSection']]], + ['cleanuptopology_6',['CleanupTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a91e235740ebc7024be3e7cf6ae46ddad',1,'manifold::Manifold::Impl']]], + ['cleanuptriangles_7',['cleanupTriangles',['../group___debug.html#a85c1664e476e1da1b3d0973b3451857b',1,'manifold::ExecutionParams']]], + ['clojure_8',['Java / Clojure',['..//github/workspace/README.md#autotoc_md28',1,'']]], + ['code_20reviews_9',['Code Reviews',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md17',1,'']]], + ['colab_20example_20a_10',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_11',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['collider_12',['Collider',['../classmanifold_1_1_collider.html',1,'manifold']]], + ['color_13',['color',['../group___mesh_i_o.html#a886c13bd5a32c945624abe944ab6235d',1,'manifold::Material']]], + ['colorchannels_14',['colorChannels',['../group___mesh_i_o.html#a19394e18f09d8e1e8ad3e8ec7362e0ad',1,'manifold::Material']]], + ['com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_15',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['community_20guidelines_16',['Community Guidelines',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md18',1,'']]], + ['compactprops_17',['CompactProps',['../structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a',1,'manifold::Manifold::Impl']]], + ['compose_18',['compose',['../classmanifold_1_1_cross_section.html#a6eb6f97b4b0c4ac7bfeb79dc1234e8f3',1,'manifold::CrossSection::Compose()'],['../classmanifold_1_1_manifold.html#a96a1b20e25443713304db55196573e3d',1,'manifold::Manifold::Compose()'],['../classmanifold_1_1_csg_leaf_node.html#ac78f0bab130bd5e2cddeb9fed4c149ed',1,'manifold::CsgLeafNode::Compose()']]], + ['concurrentsharedptr_19',['ConcurrentSharedPtr',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['concurrentsharedptr_3c_20impl_20_3e_20',['ConcurrentSharedPtr< Impl >',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['connections_21',['Connections',['../group___connections.html',1,'']]], + ['contains_22',['contains',['../structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6',1,'manifold::Rect::Contains(const Rect &rect) const'],['../structmanifold_1_1_rect.html#ab1e5f154a88928d5a6b89ff0e4b2c0b6',1,'manifold::Rect::Contains(const vec2 &p) const'],['../structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d',1,'manifold::Box::Contains(const Box &box) const'],['../structmanifold_1_1_box.html#aa51dc69603c0f65eca337672c9455b5c',1,'manifold::Box::Contains(const vec3 &p) const']]], + ['contribute_23',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['contributing_24',['Contributing',['..//github/workspace/README.md#autotoc_md30',1,'']]], + ['contributor_20license_20agreement_25',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md16',1,'']]], + ['copy_26',['copy',['../structbenchmarks_1_1copy.html',1,'benchmarks']]], + ['copy_5fif_5f1001_27',['copy_if_1001',['../structbenchmarks_1_1copy__if__1001.html',1,'benchmarks']]], + ['copy_5fif_5f28_28',['copy_if_28',['../structbenchmarks_1_1copy__if__28.html',1,'benchmarks']]], + ['copy_5fif_5f55_29',['copy_if_55',['../structbenchmarks_1_1copy__if__55.html',1,'benchmarks']]], + ['copy_5fif_5f82_30',['copy_if_82',['../structbenchmarks_1_1copy__if__82.html',1,'benchmarks']]], + ['core_31',['Core',['../group___core.html',1,'']]], + ['cosd_32',['cosd',['../group___connections.html#gac61fa065167cefe7117d0064744c7a52',1,'manifold']]], + ['count_33',['count',['../structbenchmarks_1_1count.html',1,'benchmarks']]], + ['countcollisions_34',['CountCollisions',['../structmanifold_1_1collider__internal_1_1_count_collisions.html',1,'manifold::collider_internal']]], + ['countingiterator_35',['CountingIterator',['../structmanifold_1_1_counting_iterator.html',1,'manifold']]], + ['createhalfedges_36',['CreateHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#ab66628e1ea9f38ed586b16e0c1aa4133',1,'manifold::Manifold::Impl']]], + ['createradixtree_37',['CreateRadixTree',['../structmanifold_1_1collider__internal_1_1_create_radix_tree.html',1,'manifold::collider_internal']]], + ['createtangents_38',['createtangents',['../structmanifold_1_1_manifold_1_1_impl.html#acc962337837219c991a414bf4033ef61',1,'manifold::Manifold::Impl::CreateTangents(int normalIdx)'],['../structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b',1,'manifold::Manifold::Impl::CreateTangents(std::vector< Smoothness >)']]], + ['crosssection_39',['crosssection',['../classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2',1,'manifold::CrossSection::CrossSection(const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2',1,'manifold::CrossSection::CrossSection(const Rect &rect)'],['../classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e',1,'manifold::CrossSection::CrossSection(const Polygons &contours, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436',1,'manifold::CrossSection::CrossSection(const CrossSection &other)'],['../classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0',1,'manifold::CrossSection::CrossSection()'],['../classmanifold_1_1_cross_section.html',1,'CrossSection']]], + ['csgleafnode_40',['CsgLeafNode',['../classmanifold_1_1_csg_leaf_node.html',1,'manifold']]], + ['csgnode_41',['CsgNode',['../classmanifold_1_1_csg_node.html',1,'manifold']]], + ['csgopnode_42',['CsgOpNode',['../classmanifold_1_1_csg_op_node.html',1,'manifold']]], + ['cube_43',['Cube',['../classmanifold_1_1_manifold.html#ad5486e9d0cff020565c3c20c1f496ab9',1,'manifold::Manifold']]], + ['cube_5fwith_5fdents_44',['cube_with_dents',['../namespacecube__with__dents.html',1,'']]], + ['cubevoid_45',['CubeVoid',['../struct_cube_void.html',1,'']]], + ['cylinder_46',['Cylinder',['../classmanifold_1_1_manifold.html#a879b867522c562c7166af539894a2815',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_4.js b/docs/html/search/all_4.js new file mode 100644 index 000000000..f94c98d08 --- /dev/null +++ b/docs/html/search/all_4.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['data_20structure_20definitions_0',['data structure definitions',['../group___math.html',1,'']]], + ['debug_1',['Debug',['../group___debug.html',1,'']]], + ['decompose_2',['decompose',['../classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c',1,'manifold::CrossSection::Decompose()'],['../classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106',1,'manifold::Manifold::Decompose()']]], + ['definitions_3',['data structure definitions',['../group___math.html',1,'']]], + ['deterministic_4',['deterministic',['../group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf',1,'manifold::ExecutionParams']]], + ['development_5',['Local development',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md7',1,'']]], + ['distancetriangletrianglesquared_6',['DistanceTriangleTriangleSquared',['../namespacemanifold.html#ae710936bf26af7fd2c51342d8f36984f',1,'manifold']]], + ['distributetangents_7',['DistributeTangents',['../structmanifold_1_1_manifold_1_1_impl.html#ae520f2222155301f5bb6551702222014',1,'manifold::Manifold::Impl']]], + ['doc_20strings_8',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]], + ['doesoverlap_9',['doesoverlap',['../structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669',1,'manifold::Box::DoesOverlap(const Box &box) const'],['../structmanifold_1_1_box.html#aaa691916d71188bf3256e204393e8aa7',1,'manifold::Box::DoesOverlap(vec3 p) const'],['../structmanifold_1_1_rect.html#ae9b86c34e407f27313804c9a7d30c8c2',1,'manifold::Rect::DoesOverlap()']]], + ['drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_10',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['dump_11',['Dump',['../group___debug.html#ga5a4ed9a6d64edb22079ff7a5caddcb5a',1,'manifold']]] +]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js new file mode 100644 index 000000000..3b10822f4 --- /dev/null +++ b/docs/html/search/all_5.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['edge_0',['Edge',['../struct_edge.html',1,'']]], + ['edgecollisions_1',['EdgeCollisions',['../structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5',1,'manifold::Manifold::Impl']]], + ['edgeedgedist_2',['EdgeEdgeDist',['../namespacemanifold.html#a88cecf06626e19ee678becb9c6ef8898',1,'manifold']]], + ['evenodd_3',['EvenOdd',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390',1,'manifold::CrossSection']]], + ['example_20a_4',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['examples_5',['Examples',['..//github/workspace/bindings/wasm/README.md#autotoc_md13',1,'']]], + ['exceptions_6',['Exceptions',['../group___exceptions.html',1,'']]], + ['exclusive_5fscan_7',['exclusive_scan',['../structbenchmarks_1_1exclusive__scan.html',1,'benchmarks']]], + ['executionparams_8',['ExecutionParams',['../group___debug.html#structmanifold_1_1_execution_params',1,'manifold']]], + ['exportmesh_9',['exportmesh',['../group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb',1,'manifold::ExportMesh(const std::string &filename, const Mesh &mesh, const ExportOptions &options)'],['../group___mesh_i_o.html#ga83ff5d8f4ee07ce7902b1d9ccea3640c',1,'manifold::ExportMesh(const std::string &filename, const MeshGL &mesh, const ExportOptions &options)']]], + ['exportoptions_10',['ExportOptions',['../group___mesh_i_o.html#structmanifold_1_1_export_options',1,'manifold']]], + ['extrude_11',['Extrude',['../classmanifold_1_1_manifold.html#a37da082109050d748421069e22eff876',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js new file mode 100644 index 000000000..1be197a67 --- /dev/null +++ b/docs/html/search/all_6.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['face_0',['Face',['../structmanifold_1_1_mesh_builder_1_1_face.html',1,'manifold::MeshBuilder']]], + ['face2polygons_1',['Face2Polygons',['../structmanifold_1_1_manifold_1_1_impl.html#a517d1cb074912e89da079deef759207e',1,'manifold::Manifold::Impl']]], + ['face2tri_2',['Face2Tri',['../structmanifold_1_1_manifold_1_1_impl.html#af037f51003b109c22f6a67cea6238021',1,'manifold::Manifold::Impl']]], + ['faceid_3',['faceID',['../structmanifold_1_1_mesh_g_l.html#ac6e7182a9cef30c9644ee167fbff30e1',1,'manifold::MeshGL']]], + ['faceted_4',['faceted',['../group___mesh_i_o.html#a30d67be5305ec851cfd4e8e4a15c6d05',1,'manifold::ExportOptions']]], + ['fill_5',['fill',['../structbenchmarks_1_1fill.html',1,'benchmarks']]], + ['fillretainedverts_6',['FillRetainedVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a0f3beb18c180190ad660336992f0ff64',1,'manifold::Manifold::Impl']]], + ['fillrule_7',['FillRule',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4',1,'manifold::CrossSection']]], + ['findcollisions_8',['FindCollisions',['../structmanifold_1_1collider__internal_1_1_find_collisions.html',1,'manifold::collider_internal']]], + ['finish_9',['Finish',['../structmanifold_1_1_manifold_1_1_impl.html#af9d1bc46635e487c85720b943dd8ba28',1,'manifold::Manifold::Impl']]], + ['firefox_20users_10',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md8',1,'']]], + ['for_20firefox_20users_11',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md8',1,'']]], + ['for_5feach_12',['for_each',['../structbenchmarks_1_1for__each.html',1,'benchmarks']]], + ['formatting_13',['Formatting',['..//github/workspace/README.md#autotoc_md31',1,'']]], + ['frontend_20sandboxes_14',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md20',1,'']]], + ['fuzzing_20support_15',['Fuzzing Support',['..//github/workspace/README.md#autotoc_md33',1,'']]] +]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js new file mode 100644 index 000000000..3471bd2d2 --- /dev/null +++ b/docs/html/search/all_7.js @@ -0,0 +1,28 @@ +var searchData= +[ + ['gatherfaces_0',['GatherFaces',['../structmanifold_1_1_manifold_1_1_impl.html#abd9a97b16b825e7ee3fd989aaf776757',1,'manifold::Manifold::Impl']]], + ['genus_1',['Genus',['../classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1',1,'manifold::Manifold']]], + ['geometryerr_2',['geometryErr',['../structmanifold_1_1geometry_err.html',1,'manifold']]], + ['get_20started_3',['Get Started',['../md_bindings_2wasm_2documents_2_get_01_started.html',1,'']]], + ['getaxisalignedprojection_4',['GetAxisAlignedProjection',['../group___private.html#ga8a78bbee39ddfd72a872c6027d376f51',1,'manifold']]], + ['getcircularsegments_5',['GetCircularSegments',['../classmanifold_1_1_quality.html#aa4d3c532266d48a96ac9a8b8a7ab4e10',1,'manifold::Quality']]], + ['getfaceboxmorton_6',['GetFaceBoxMorton',['../structmanifold_1_1_manifold_1_1_impl.html#ae950ed2beaef893ec411aa3921aa25a8',1,'manifold::Manifold::Impl']]], + ['gethalfedges_7',['GetHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#ae9b082f1f3b9f6502e252f1fe35e5e3a',1,'manifold::Manifold::Impl']]], + ['getindices_8',['GetIndices',['../structmanifold_1_1_manifold_1_1_impl.html#a5663e9c8c9f549c90a3cfd36ad2c787a',1,'manifold::Manifold::Impl']]], + ['getmesh_9',['GetMesh',['../classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750',1,'manifold::Manifold']]], + ['getmeshgl_10',['GetMeshGL',['../classmanifold_1_1_manifold.html#a3711c029f2c9fe2d152455981a3b2d73',1,'manifold::Manifold']]], + ['getneighbor_11',['GetNeighbor',['../structmanifold_1_1_manifold_1_1_impl.html#a8a3b5765ff1df3e2090e792f8a2eb444',1,'manifold::Manifold::Impl']]], + ['getnormal_12',['GetNormal',['../structmanifold_1_1_manifold_1_1_impl.html#acb9563addc2ff3283f4bbfe4dd722ece',1,'manifold::Manifold::Impl']]], + ['getproperties_13',['GetProperties',['../classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07',1,'manifold::Manifold']]], + ['glm_5fname_14',['glm_name',['../structglm__name.html',1,'']]], + ['glm_5fname_3c_20ivec3_20_3e_15',['glm_name< ivec3 >',['../structglm__name_3_01ivec3_01_4.html',1,'']]], + ['glm_5fname_3c_20mat3x2_20_3e_16',['glm_name< mat3x2 >',['../structglm__name_3_01mat3x2_01_4.html',1,'']]], + ['glm_5fname_3c_20mat4x3_20_3e_17',['glm_name< mat4x3 >',['../structglm__name_3_01mat4x3_01_4.html',1,'']]], + ['glm_5fname_3c_20vec2_20_3e_18',['glm_name< vec2 >',['../structglm__name_3_01vec2_01_4.html',1,'']]], + ['glm_5fname_3c_20vec3_20_3e_19',['glm_name< vec3 >',['../structglm__name_3_01vec3_01_4.html',1,'']]], + ['google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_20',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['guidelines_21',['Community Guidelines',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md18',1,'']]], + ['gyroid_5fmodule_22',['gyroid_module',['../namespacegyroid__module.html',1,'']]], + ['gyroidmodule_23',['GyroidModule',['../group___samples.html#ga5141b952c15a0aa27af95791a65455d2',1,'manifold']]], + ['gyroidsdf_24',['GyroidSDF',['../struct_gyroid_s_d_f.html',1,'']]] +]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js new file mode 100644 index 000000000..78e5f0795 --- /dev/null +++ b/docs/html/search/all_8.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['halfedge_0',['halfedge',['../structmanifold_1_1_halfedge.html',1,'Halfedge'],['../group___connections.html#aac5709f1a46385ba2978c8184909a8f9',1,'manifold::Smoothness::halfedge']]], + ['halfedgemesh_1',['HalfEdgeMesh',['../classmanifold_1_1_half_edge_mesh.html',1,'manifold']]], + ['halfedgetangent_2',['halfedgetangent',['../group___connections.html#a967a4893f0c99198fe00c01c6c446d85',1,'manifold::Mesh::halfedgeTangent'],['../structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5',1,'manifold::MeshGL::halfedgeTangent']]], + ['hash_3c_20manifold_3a_3aivec4_20_3e_3',['hash< manifold::ivec4 >',['../structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html',1,'std']]], + ['hash_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_4',['hash< std::pair< int, int > >',['../structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html',1,'std']]], + ['hashtable_5',['HashTable',['../classmanifold_1_1_hash_table.html',1,'manifold']]], + ['hashtabled_6',['HashTableD',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]], + ['here_7',['here',['..//github/workspace/README.md#autotoc_md24',1,'What's here'],['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'What's here']]], + ['how_20to_20contribute_8',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['href_20https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_9',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['href_20https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_10',['href https: manifoldcad org manifoldcad org a',['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_11',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]], + ['https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_12',['https: manifoldcad org manifoldcad org a',['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['hull_13',['hull',['../classmanifold_1_1_cross_section.html#aa5ea1caf54ddac72d939a00d13763ace',1,'manifold::CrossSection::Hull()'],['../classmanifold_1_1_manifold.html#ab0a6fa5c97e3e47118ee69b741e64ad0',1,'manifold::Manifold::Hull(const std::vector< vec3 > &pts)'],['../classmanifold_1_1_manifold.html#a0b45afc24015963e82745f1f83f3f310',1,'manifold::Manifold::Hull(const std::vector< Manifold > &manifolds)'],['../classmanifold_1_1_manifold.html#a9dc9e00112e2b063cfa6fe8482b1afe8',1,'manifold::Manifold::Hull() const'],['../classmanifold_1_1_cross_section.html#a800d15ed35b3f430a11f1fdc4dfe79a6',1,'manifold::CrossSection::Hull(const Polygons polys)'],['../classmanifold_1_1_cross_section.html#aec35843b9a8e1470605ae615a66643e2',1,'manifold::CrossSection::Hull(const SimplePolygon poly)'],['../classmanifold_1_1_cross_section.html#a49d6309921d09ab4e9874f1987f3b487',1,'manifold::CrossSection::Hull(const std::vector< CrossSection > &crossSections)']]], + ['hullimpl_14',['HullImpl',['../class_hull_impl.html',1,'']]], + ['hullimplcgal_15',['HullImplCGAL',['../class_hull_impl_c_g_a_l.html',1,'']]], + ['hullimploriginal_16',['HullImplOriginal',['../class_hull_impl_original.html',1,'']]] +]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js new file mode 100644 index 000000000..fd0ec0050 --- /dev/null +++ b/docs/html/search/all_9.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['identity_0',['Identity',['../structmanifold_1_1_identity.html',1,'manifold']]], + ['idx_1',['idx',['../group___private.html#ae40354a1051342eb5a9db005715dcfa9',1,'manifold::PolyVert']]], + ['impl_2',['impl',['../structmanifold_1_1_manifold_1_1_impl.html',1,'Manifold::Impl'],['../structmanifold_1_1_manifold_1_1_impl.html#a9bb5abff877334251f06225d5037cfd1',1,'manifold::Manifold::Impl::Impl(Shape, const mat4x3=mat4x3(1))'],['../structmanifold_1_1_manifold_1_1_impl.html#ab6fd31092fdc69f21bb100d9b92bc5a8',1,'manifold::Manifold::Impl::Impl(const Mesh &, const MeshRelationD &relation, const std::vector< double > &propertyTolerance={}, bool hasFaceIDs=false)']]], + ['importmesh_3',['ImportMesh',['../group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0',1,'manifold']]], + ['incrementmeshids_4',['IncrementMeshIDs',['../structmanifold_1_1_manifold_1_1_impl.html#a11d47359eb52523a2bc86f6d4ab22633',1,'manifold::Manifold::Impl']]], + ['installation_5',['Installation',['../md_bindings_2wasm_2documents_2_get_01_started.html#autotoc_md4',1,'']]], + ['intermediatechecks_6',['intermediateChecks',['../group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb',1,'manifold::ExecutionParams']]], + ['is2manifold_7',['Is2Manifold',['../structmanifold_1_1_manifold_1_1_impl.html#a7b0298da43b37952e432a1a0c4b02e00',1,'manifold::Manifold::Impl']]], + ['isempty_8',['isempty',['../classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a',1,'manifold::CrossSection::IsEmpty()'],['../classmanifold_1_1_manifold.html#a8e12342fc420701fbffd97025421575a',1,'manifold::Manifold::IsEmpty()'],['../structmanifold_1_1_rect.html#a8e12342fc420701fbffd97025421575a',1,'manifold::Rect::IsEmpty()']]], + ['isfinite_9',['isfinite',['../structmanifold_1_1_manifold_1_1_impl.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Manifold::Impl::IsFinite()'],['../structmanifold_1_1_box.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Box::IsFinite()'],['../structmanifold_1_1_rect.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Rect::IsFinite()']]], + ['isindexinbounds_10',['IsIndexInBounds',['../structmanifold_1_1_manifold_1_1_impl.html#aa7f6545c1c252ffda922760097cfd68c',1,'manifold::Manifold::Impl']]], + ['isinsidequad_11',['IsInsideQuad',['../structmanifold_1_1_manifold_1_1_impl.html#aa244e3ec23cdce59aa792a297f0c8cde',1,'manifold::Manifold::Impl']]], + ['ismanifold_12',['IsManifold',['../structmanifold_1_1_manifold_1_1_impl.html#a28f34ca6c256f1f7fa44e862540ec421',1,'manifold::Manifold::Impl']]], + ['ismarkedinsidequad_13',['IsMarkedInsideQuad',['../structmanifold_1_1_manifold_1_1_impl.html#a879e2e73b1f97ca728d306dfb3c520d5',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js new file mode 100644 index 000000000..c74a834ef --- /dev/null +++ b/docs/html/search/all_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['java_20clojure_0',['Java / Clojure',['..//github/workspace/README.md#autotoc_md28',1,'']]], + ['jointype_1',['JoinType',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js new file mode 100644 index 000000000..5cc7ca7e0 --- /dev/null +++ b/docs/html/search/all_b.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['layers_0',['Layers',['../struct_layers.html',1,'']]], + ['levelset_1',['LevelSet',['../group___core.html#ga359e374df5225fef63061f32718e2fb3',1,'manifold::Manifold']]], + ['license_20agreement_2',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md16',1,'']]], + ['linearizeflattangents_3',['LinearizeFlatTangents',['../structmanifold_1_1_manifold_1_1_impl.html#a744f7dc967657edf6fdba43aaa81ad3e',1,'manifold::Manifold::Impl']]], + ['local_20development_4',['Local development',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md7',1,'']]] +]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js new file mode 100644 index 000000000..a74765ce0 --- /dev/null +++ b/docs/html/search/all_c.js @@ -0,0 +1,34 @@ +var searchData= +[ + ['management_0',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md12',1,'']]], + ['manifold_1',['manifold',['../classmanifold_1_1_manifold.html',1,'Manifold'],['..//github/workspace/README.md#autotoc_md23',1,'Manifold'],['..//github/workspace/bindings/wasm/README.md#autotoc_md10',1,'Manifold'],['../classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea',1,'manifold::Manifold::Manifold(const Mesh &)'],['../classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599',1,'manifold::Manifold::Manifold(const MeshGL &, const std::vector< float > &propertyTolerance={})'],['../classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b',1,'manifold::Manifold::Manifold()'],['../namespacemanifold.html',1,'manifold']]], + ['manifold_20frontend_20sandboxes_2',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md20',1,'']]], + ['manifoldcad_20org_20a_3',['manifoldcad org a',['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['manifoldcad_20org_20manifoldcad_20org_20a_4',['manifoldcad org manifoldcad org a',['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['manifoldivec3_5',['ManifoldIVec3',['../struct_manifold_i_vec3.html',1,'']]], + ['manifoldmanifoldpair_6',['ManifoldManifoldPair',['../struct_manifold_manifold_pair.html',1,'']]], + ['manifoldparams_7',['ManifoldParams',['../group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275',1,'manifold']]], + ['manifoldproperties_8',['ManifoldProperties',['../struct_manifold_properties.html',1,'']]], + ['manifoldvec2_9',['ManifoldVec2',['../struct_manifold_vec2.html',1,'']]], + ['manifoldvec3_10',['ManifoldVec3',['../struct_manifold_vec3.html',1,'']]], + ['manifoldvec4_11',['ManifoldVec4',['../struct_manifold_vec4.html',1,'']]], + ['mat_12',['mat',['../group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60',1,'manifold::ExportOptions']]], + ['matchestrinormals_13',['matchestrinormals',['../classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::MatchesTriNormals()'],['../structmanifold_1_1_manifold_1_1_impl.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::Impl::MatchesTriNormals()']]], + ['material_14',['Material',['../group___mesh_i_o.html#structmanifold_1_1_material',1,'manifold']]], + ['memory_20management_15',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md12',1,'']]], + ['mengersponge_16',['MengerSponge',['../group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae',1,'manifold']]], + ['merge_17',['Merge',['../structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254',1,'manifold::MeshGL']]], + ['mergefromvert_18',['mergeFromVert',['../structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078',1,'manifold::MeshGL']]], + ['mergetovert_19',['mergeToVert',['../structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a',1,'manifold::MeshGL']]], + ['mesh_20',['Mesh',['../group___connections.html#structmanifold_1_1_mesh',1,'manifold']]], + ['meshbuilder_21',['MeshBuilder',['../classmanifold_1_1_mesh_builder.html',1,'manifold']]], + ['meshgl_22',['meshgl',['../structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed',1,'manifold::MeshGL::MeshGL()'],['../structmanifold_1_1_mesh_g_l.html',1,'MeshGL']]], + ['meshid_23',['meshID',['../structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12',1,'manifold::TriRef']]], + ['meshio_24',['MeshIO',['../group___mesh_i_o.html',1,'']]], + ['meshrelationd_25',['MeshRelationD',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_mesh_relation_d',1,'manifold::Manifold::Impl']]], + ['meshsize_26',['MeshSize',['../struct_mesh_size.html',1,'']]], + ['metalness_27',['metalness',['../group___mesh_i_o.html#a75517e1226a2805e9bc0b78668b01812',1,'manifold::Material']]], + ['mingap_28',['MinGap',['../classmanifold_1_1_manifold.html#a1b7ab47f4da039eb3dff5b46ba71658b',1,'manifold::Manifold']]], + ['mirror_29',['mirror',['../classmanifold_1_1_manifold.html#ad76d89178ca970900c81f2927f8c7f11',1,'manifold::Manifold::Mirror()'],['../classmanifold_1_1_cross_section.html#a3bdcbaf979a769af24a9d61624e639e8',1,'manifold::CrossSection::Mirror(const vec2 ax) const']]], + ['miter_30',['Miter',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js new file mode 100644 index 000000000..41abc2cc4 --- /dev/null +++ b/docs/html/search/all_d.js @@ -0,0 +1,18 @@ +var searchData= +[ + ['negate_0',['Negate',['../structmanifold_1_1_negate.html',1,'manifold']]], + ['negative_1',['Negative',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b',1,'manifold::CrossSection']]], + ['next_20steps_2',['Next steps',['../md_bindings_2wasm_2documents_2_get_01_started.html#autotoc_md5',1,'']]], + ['nonzero_3',['NonZero',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a',1,'manifold::CrossSection']]], + ['normalchannels_4',['normalChannels',['../group___mesh_i_o.html#aef1da255255dd391ce5690ac8bff68b8',1,'manifold::Material']]], + ['note_20for_20firefox_20users_5',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md8',1,'']]], + ['note_20on_20memory_20management_6',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md12',1,'']]], + ['numcontour_7',['NumContour',['../classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c',1,'manifold::CrossSection']]], + ['numdegeneratetris_8',['numdegeneratetris',['../structmanifold_1_1_manifold_1_1_impl.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::Impl::NumDegenerateTris()'],['../classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::NumDegenerateTris() const']]], + ['numedge_9',['NumEdge',['../classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a',1,'manifold::Manifold']]], + ['numoverlaps_10',['NumOverlaps',['../classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704',1,'manifold::Manifold']]], + ['numprop_11',['numprop',['../structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75',1,'manifold::MeshGL::numProp'],['../classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348',1,'manifold::Manifold::NumProp() const']]], + ['numpropvert_12',['NumPropVert',['../classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d',1,'manifold::Manifold']]], + ['numtri_13',['numtri',['../structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6',1,'manifold::MeshGL::NumTri()'],['../classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6',1,'manifold::Manifold::NumTri()']]], + ['numvert_14',['numvert',['../classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::CrossSection::NumVert()'],['../structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658',1,'manifold::MeshGL::NumVert()'],['../classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::Manifold::NumVert()']]] +]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js new file mode 100644 index 000000000..90dffafb3 --- /dev/null +++ b/docs/html/search/all_e.js @@ -0,0 +1,18 @@ +var searchData= +[ + ['offset_0',['Offset',['../classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a',1,'manifold::CrossSection']]], + ['on_20memory_20management_1',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md12',1,'']]], + ['operator_22_22_5fuz_2',['operator""_uz',['../namespacemanifold.html#a94b9f74f9f0e28c9e31534d6fc624d14',1,'manifold']]], + ['operator_2a_3',['operator*',['../structmanifold_1_1_box.html#a0993fea81be0170878dfec3abce2e6dc',1,'manifold::Box::operator*()'],['../structmanifold_1_1_rect.html#a7f518b4df73d824dfa9117e1e0137082',1,'manifold::Rect::operator*()']]], + ['operator_2a_3d_4',['operator*=',['../structmanifold_1_1_box.html#ab0ec4bdbe1a152a83073874d2d62db67',1,'manifold::Box::operator*=()'],['../structmanifold_1_1_rect.html#a02fcd8a4fd938f130493a48349dcbabe',1,'manifold::Rect::operator*=()']]], + ['operator_2b_5',['operator+',['../classmanifold_1_1_cross_section.html#a347c593a12693ee05159b34db0957580',1,'manifold::CrossSection::operator+()'],['../classmanifold_1_1_manifold.html#af95e73e5427d09b9d9e025d5cf367c30',1,'manifold::Manifold::operator+()'],['../structmanifold_1_1_box.html#af682637d259e4850c42bbe1d1ad98491',1,'manifold::Box::operator+()'],['../structmanifold_1_1_rect.html#a6fe10cfc3aa4a6bd44cf8867639aff2b',1,'manifold::Rect::operator+()']]], + ['operator_2b_3d_6',['operator+=',['../classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a',1,'manifold::CrossSection::operator+=()'],['../classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688',1,'manifold::Manifold::operator+=()'],['../structmanifold_1_1_box.html#ad243f3e9cd636fcd4dfe7c374d0e00c4',1,'manifold::Box::operator+=()'],['../structmanifold_1_1_rect.html#ae56ad379896fd93dc3e41ab719a52c87',1,'manifold::Rect::operator+=()']]], + ['operator_2d_7',['operator-',['../classmanifold_1_1_manifold.html#ad9da8c505e6846e9645008825833e1da',1,'manifold::Manifold::operator-()'],['../classmanifold_1_1_cross_section.html#af6a000221ca368c9f2ed3e1f271cfb7f',1,'manifold::CrossSection::operator-(const CrossSection &) const']]], + ['operator_2d_3d_8',['operator-=',['../classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0',1,'manifold::CrossSection::operator-=()'],['../classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b',1,'manifold::Manifold::operator-=()']]], + ['operator_5e_9',['operator^',['../classmanifold_1_1_cross_section.html#a34fcc007d18275e2cc32f4c99bc94cda',1,'manifold::CrossSection::operator^()'],['../classmanifold_1_1_manifold.html#ad1e4e5720f01934c44aebc597be4d104',1,'manifold::Manifold::operator^()']]], + ['operator_5e_3d_10',['operator^=',['../classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3',1,'manifold::CrossSection::operator^=()'],['../classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522',1,'manifold::Manifold::operator^=()']]], + ['options_11',['Options',['../struct_options.html',1,'']]], + ['optype_12',['OpType',['../group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969',1,'manifold']]], + ['org_20manifoldcad_20org_20a_13',['org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md21',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['originalid_14',['originalid',['../structmanifold_1_1_manifold_1_1_impl.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::Manifold::Impl::MeshRelationD::originalID'],['../structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::TriRef::originalID'],['../classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6',1,'manifold::Manifold::OriginalID()']]] +]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js new file mode 100644 index 000000000..fd1ca9f91 --- /dev/null +++ b/docs/html/search/all_f.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['parcollisionrecorder_0',['ParCollisionRecorder',['../structmanifold_1_1collider__internal_1_1_par_collision_recorder.html',1,'manifold::collider_internal']]], + ['pathimpl_1',['PathImpl',['../structmanifold_1_1_path_impl.html',1,'manifold']]], + ['plane_2',['Plane',['../classmanifold_1_1_plane.html',1,'manifold']]], + ['polygons_3',['Polygons',['../group___connections.html#ga60a66d8ddacc086bb45d8afc37f646d1',1,'manifold']]], + ['polyvert_4',['PolyVert',['../group___private.html#structmanifold_1_1_poly_vert',1,'manifold']]], + ['pool_5',['Pool',['../classmanifold_1_1_pool.html',1,'manifold']]], + ['pos_6',['pos',['../group___private.html#a8b2c7ec938814a57e13bd292f12f3a40',1,'manifold::PolyVert']]], + ['positive_7',['Positive',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147',1,'manifold::CrossSection']]], + ['precision_8',['precision',['../group___connections.html#a98ce42142601aa81694132ce8af84e8b',1,'manifold::Mesh::precision'],['../classmanifold_1_1_manifold.html#aef800826805cb6d90d03846fdb12c3e3',1,'manifold::Manifold::Precision()'],['../structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141',1,'manifold::MeshGL::precision']]], + ['private_9',['Private',['../group___private.html',1,'']]], + ['processoverlaps_10',['processOverlaps',['../group___debug.html#a7166fd3caef3744f7241075f21f76af3',1,'manifold::ExecutionParams']]], + ['profiling_11',['Profiling',['..//github/workspace/README.md#autotoc_md32',1,'']]], + ['project_12',['Project',['../classmanifold_1_1_manifold.html#a328657b69e9bbaaee148572ca314677c',1,'manifold::Manifold']]], + ['properties_13',['Properties',['../group___connections.html#structmanifold_1_1_properties',1,'manifold']]], + ['python_14',['Python',['..//github/workspace/README.md#autotoc_md27',1,'']]], + ['python_20bindings_15',['Python Bindings',['../index.html',1,'']]], + ['python_20colab_20example_20a_16',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md22',1,'']]] +]; diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js new file mode 100644 index 000000000..d083a3803 --- /dev/null +++ b/docs/html/search/classes_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['all_5fof_0',['all_of',['../structbenchmarks_1_1all__of.html',1,'benchmarks']]] +]; diff --git a/docs/html/search/classes_1.js b/docs/html/search/classes_1.js new file mode 100644 index 000000000..78c5e3021 --- /dev/null +++ b/docs/html/search/classes_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['barycentric_0',['Barycentric',['../group___private.html#structmanifold_1_1_barycentric',1,'manifold']]], + ['baryindices_1',['BaryIndices',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_bary_indices',1,'manifold::Manifold::Impl']]], + ['boolean3_2',['Boolean3',['../classmanifold_1_1_boolean3.html',1,'manifold']]], + ['box_3',['Box',['../structmanifold_1_1_box.html',1,'manifold']]], + ['buildinternalboxes_4',['BuildInternalBoxes',['../structmanifold_1_1collider__internal_1_1_build_internal_boxes.html',1,'manifold::collider_internal']]] +]; diff --git a/docs/html/search/classes_10.js b/docs/html/search/classes_10.js new file mode 100644 index 000000000..0be7b554d --- /dev/null +++ b/docs/html/search/classes_10.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['timer_0',['Timer',['../structmanifold_1_1_timer.html',1,'manifold']]], + ['tmpedge_1',['TmpEdge',['../structmanifold_1_1_tmp_edge.html',1,'manifold']]], + ['topologyerr_2',['topologyErr',['../structmanifold_1_1topology_err.html',1,'manifold']]], + ['transform_5freduce_3',['transform_reduce',['../structbenchmarks_1_1transform__reduce.html',1,'benchmarks']]], + ['transformbox_4',['TransformBox',['../structmanifold_1_1collider__internal_1_1_transform_box.html',1,'manifold::collider_internal']]], + ['transformiterator_5',['TransformIterator',['../structmanifold_1_1_transform_iterator.html',1,'manifold']]], + ['triref_6',['TriRef',['../structmanifold_1_1_tri_ref.html',1,'manifold']]], + ['type_5fcaster_3c_20glm_3a_3amat_3c_20c_2c_20r_2c_20t_2c_20q_20_3e_20_3e_7',['type_caster< glm::mat< C, R, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_8',['type_caster< glm::vec< N, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20manifold_3a_3avecview_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_9',['type_caster< manifold::VecView< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20std_3a_3avector_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_10',['type_caster< std::vector< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]] +]; diff --git a/docs/html/search/classes_11.js b/docs/html/search/classes_11.js new file mode 100644 index 000000000..70b326a1a --- /dev/null +++ b/docs/html/search/classes_11.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['unionfind_0',['UnionFind',['../structmanifold_1_1_union_find.html',1,'manifold']]], + ['usererr_1',['userErr',['../structmanifold_1_1user_err.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_12.js b/docs/html/search/classes_12.js new file mode 100644 index 000000000..81aacf651 --- /dev/null +++ b/docs/html/search/classes_12.js @@ -0,0 +1,40 @@ +var searchData= +[ + ['vec_0',['Vec',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20char_20_3e_1',['Vec< char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20double_20_3e_2',['Vec< double >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20facedata_20_3e_3',['Vec< FaceData >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20int_20_3e_4',['Vec< int >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20ivec3_20_3e_5',['Vec< ivec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3abox_20_3e_6',['Vec< manifold::Box >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3ahalfedge_20_3e_7',['Vec< manifold::Halfedge >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3atriref_20_3e_8',['Vec< manifold::TriRef >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20size_5ft_20_3e_9',['Vec< size_t >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_10',['Vec< std::pair< int, int > >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint64_20_3e_11',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_12',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_13',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20vec3_20_3e_14',['Vec< vec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20vec4_20_3e_15',['Vec< vec4 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_16',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_17',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3abox_20_3e_18',['VecView< const manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_19',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_20',['VecView< const std::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20t_20_3e_21',['VecView< const T >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20uint32_5ft_20_3e_22',['VecView< const uint32_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20double_20_3e_23',['VecView< double >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20facedata_20_3e_24',['VecView< FaceData >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_25',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20ivec3_20_3e_26',['VecView< ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_27',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_28',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_29',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20size_5ft_20_3e_30',['VecView< size_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_31',['VecView< std::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_32',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_33',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_34',['VecView< V >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20vec3_20_3e_35',['VecView< vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20vec4_20_3e_36',['VecView< vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_2.js b/docs/html/search/classes_2.js new file mode 100644 index 000000000..2e48261ca --- /dev/null +++ b/docs/html/search/classes_2.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['collider_0',['Collider',['../classmanifold_1_1_collider.html',1,'manifold']]], + ['concurrentsharedptr_1',['ConcurrentSharedPtr',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['concurrentsharedptr_3c_20impl_20_3e_2',['ConcurrentSharedPtr< Impl >',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['copy_3',['copy',['../structbenchmarks_1_1copy.html',1,'benchmarks']]], + ['copy_5fif_5f1001_4',['copy_if_1001',['../structbenchmarks_1_1copy__if__1001.html',1,'benchmarks']]], + ['copy_5fif_5f28_5',['copy_if_28',['../structbenchmarks_1_1copy__if__28.html',1,'benchmarks']]], + ['copy_5fif_5f55_6',['copy_if_55',['../structbenchmarks_1_1copy__if__55.html',1,'benchmarks']]], + ['copy_5fif_5f82_7',['copy_if_82',['../structbenchmarks_1_1copy__if__82.html',1,'benchmarks']]], + ['count_8',['count',['../structbenchmarks_1_1count.html',1,'benchmarks']]], + ['countcollisions_9',['CountCollisions',['../structmanifold_1_1collider__internal_1_1_count_collisions.html',1,'manifold::collider_internal']]], + ['countingiterator_10',['CountingIterator',['../structmanifold_1_1_counting_iterator.html',1,'manifold']]], + ['createradixtree_11',['CreateRadixTree',['../structmanifold_1_1collider__internal_1_1_create_radix_tree.html',1,'manifold::collider_internal']]], + ['crosssection_12',['CrossSection',['../classmanifold_1_1_cross_section.html',1,'manifold']]], + ['csgleafnode_13',['CsgLeafNode',['../classmanifold_1_1_csg_leaf_node.html',1,'manifold']]], + ['csgnode_14',['CsgNode',['../classmanifold_1_1_csg_node.html',1,'manifold']]], + ['csgopnode_15',['CsgOpNode',['../classmanifold_1_1_csg_op_node.html',1,'manifold']]], + ['cubevoid_16',['CubeVoid',['../struct_cube_void.html',1,'']]] +]; diff --git a/docs/html/search/classes_3.js b/docs/html/search/classes_3.js new file mode 100644 index 000000000..8f388c038 --- /dev/null +++ b/docs/html/search/classes_3.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['edge_0',['Edge',['../struct_edge.html',1,'']]], + ['exclusive_5fscan_1',['exclusive_scan',['../structbenchmarks_1_1exclusive__scan.html',1,'benchmarks']]], + ['executionparams_2',['ExecutionParams',['../group___debug.html#structmanifold_1_1_execution_params',1,'manifold']]], + ['exportoptions_3',['ExportOptions',['../group___mesh_i_o.html#structmanifold_1_1_export_options',1,'manifold']]] +]; diff --git a/docs/html/search/classes_4.js b/docs/html/search/classes_4.js new file mode 100644 index 000000000..145c19fa8 --- /dev/null +++ b/docs/html/search/classes_4.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['face_0',['Face',['../structmanifold_1_1_mesh_builder_1_1_face.html',1,'manifold::MeshBuilder']]], + ['fill_1',['fill',['../structbenchmarks_1_1fill.html',1,'benchmarks']]], + ['findcollisions_2',['FindCollisions',['../structmanifold_1_1collider__internal_1_1_find_collisions.html',1,'manifold::collider_internal']]], + ['for_5feach_3',['for_each',['../structbenchmarks_1_1for__each.html',1,'benchmarks']]] +]; diff --git a/docs/html/search/classes_5.js b/docs/html/search/classes_5.js new file mode 100644 index 000000000..f1e948387 --- /dev/null +++ b/docs/html/search/classes_5.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['geometryerr_0',['geometryErr',['../structmanifold_1_1geometry_err.html',1,'manifold']]], + ['glm_5fname_1',['glm_name',['../structglm__name.html',1,'']]], + ['glm_5fname_3c_20ivec3_20_3e_2',['glm_name< ivec3 >',['../structglm__name_3_01ivec3_01_4.html',1,'']]], + ['glm_5fname_3c_20mat3x2_20_3e_3',['glm_name< mat3x2 >',['../structglm__name_3_01mat3x2_01_4.html',1,'']]], + ['glm_5fname_3c_20mat4x3_20_3e_4',['glm_name< mat4x3 >',['../structglm__name_3_01mat4x3_01_4.html',1,'']]], + ['glm_5fname_3c_20vec2_20_3e_5',['glm_name< vec2 >',['../structglm__name_3_01vec2_01_4.html',1,'']]], + ['glm_5fname_3c_20vec3_20_3e_6',['glm_name< vec3 >',['../structglm__name_3_01vec3_01_4.html',1,'']]], + ['gyroidsdf_7',['GyroidSDF',['../struct_gyroid_s_d_f.html',1,'']]] +]; diff --git a/docs/html/search/classes_6.js b/docs/html/search/classes_6.js new file mode 100644 index 000000000..6f321997c --- /dev/null +++ b/docs/html/search/classes_6.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['halfedge_0',['Halfedge',['../structmanifold_1_1_halfedge.html',1,'manifold']]], + ['halfedgemesh_1',['HalfEdgeMesh',['../classmanifold_1_1_half_edge_mesh.html',1,'manifold']]], + ['hash_3c_20manifold_3a_3aivec4_20_3e_2',['hash< manifold::ivec4 >',['../structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html',1,'std']]], + ['hash_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_3',['hash< std::pair< int, int > >',['../structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html',1,'std']]], + ['hashtable_4',['HashTable',['../classmanifold_1_1_hash_table.html',1,'manifold']]], + ['hashtabled_5',['HashTableD',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]], + ['hullimpl_6',['HullImpl',['../class_hull_impl.html',1,'']]], + ['hullimplcgal_7',['HullImplCGAL',['../class_hull_impl_c_g_a_l.html',1,'']]], + ['hullimploriginal_8',['HullImplOriginal',['../class_hull_impl_original.html',1,'']]] +]; diff --git a/docs/html/search/classes_7.js b/docs/html/search/classes_7.js new file mode 100644 index 000000000..6fe3afad8 --- /dev/null +++ b/docs/html/search/classes_7.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['identity_0',['Identity',['../structmanifold_1_1_identity.html',1,'manifold']]], + ['impl_1',['Impl',['../structmanifold_1_1_manifold_1_1_impl.html',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/classes_8.js b/docs/html/search/classes_8.js new file mode 100644 index 000000000..940c7fa56 --- /dev/null +++ b/docs/html/search/classes_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['layers_0',['Layers',['../struct_layers.html',1,'']]] +]; diff --git a/docs/html/search/classes_9.js b/docs/html/search/classes_9.js new file mode 100644 index 000000000..030b71c91 --- /dev/null +++ b/docs/html/search/classes_9.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['manifold_0',['Manifold',['../classmanifold_1_1_manifold.html',1,'manifold']]], + ['manifoldivec3_1',['ManifoldIVec3',['../struct_manifold_i_vec3.html',1,'']]], + ['manifoldmanifoldpair_2',['ManifoldManifoldPair',['../struct_manifold_manifold_pair.html',1,'']]], + ['manifoldproperties_3',['ManifoldProperties',['../struct_manifold_properties.html',1,'']]], + ['manifoldvec2_4',['ManifoldVec2',['../struct_manifold_vec2.html',1,'']]], + ['manifoldvec3_5',['ManifoldVec3',['../struct_manifold_vec3.html',1,'']]], + ['manifoldvec4_6',['ManifoldVec4',['../struct_manifold_vec4.html',1,'']]], + ['material_7',['Material',['../group___mesh_i_o.html#structmanifold_1_1_material',1,'manifold']]], + ['mesh_8',['Mesh',['../group___connections.html#structmanifold_1_1_mesh',1,'manifold']]], + ['meshbuilder_9',['MeshBuilder',['../classmanifold_1_1_mesh_builder.html',1,'manifold']]], + ['meshgl_10',['MeshGL',['../structmanifold_1_1_mesh_g_l.html',1,'manifold']]], + ['meshrelationd_11',['MeshRelationD',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_mesh_relation_d',1,'manifold::Manifold::Impl']]], + ['meshsize_12',['MeshSize',['../struct_mesh_size.html',1,'']]] +]; diff --git a/docs/html/search/classes_a.js b/docs/html/search/classes_a.js new file mode 100644 index 000000000..2a27a9612 --- /dev/null +++ b/docs/html/search/classes_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['negate_0',['Negate',['../structmanifold_1_1_negate.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_b.js b/docs/html/search/classes_b.js new file mode 100644 index 000000000..869ec5188 --- /dev/null +++ b/docs/html/search/classes_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['options_0',['Options',['../struct_options.html',1,'']]] +]; diff --git a/docs/html/search/classes_c.js b/docs/html/search/classes_c.js new file mode 100644 index 000000000..107d6d14a --- /dev/null +++ b/docs/html/search/classes_c.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['parcollisionrecorder_0',['ParCollisionRecorder',['../structmanifold_1_1collider__internal_1_1_par_collision_recorder.html',1,'manifold::collider_internal']]], + ['pathimpl_1',['PathImpl',['../structmanifold_1_1_path_impl.html',1,'manifold']]], + ['plane_2',['Plane',['../classmanifold_1_1_plane.html',1,'manifold']]], + ['polyvert_3',['PolyVert',['../group___private.html#structmanifold_1_1_poly_vert',1,'manifold']]], + ['pool_4',['Pool',['../classmanifold_1_1_pool.html',1,'manifold']]], + ['properties_5',['Properties',['../group___connections.html#structmanifold_1_1_properties',1,'manifold']]] +]; diff --git a/docs/html/search/classes_d.js b/docs/html/search/classes_d.js new file mode 100644 index 000000000..c84f94dbb --- /dev/null +++ b/docs/html/search/classes_d.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['quality_0',['Quality',['../classmanifold_1_1_quality.html',1,'manifold']]], + ['quickhull_1',['QuickHull',['../classmanifold_1_1_quick_hull.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_e.js b/docs/html/search/classes_e.js new file mode 100644 index 000000000..2767ab2a7 --- /dev/null +++ b/docs/html/search/classes_e.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['ray_0',['Ray',['../structmanifold_1_1_ray.html',1,'manifold']]], + ['rect_1',['Rect',['../structmanifold_1_1_rect.html',1,'manifold']]], + ['reduce_2',['reduce',['../structbenchmarks_1_1reduce.html',1,'benchmarks']]], + ['reindexedge_3',['ReindexEdge',['../structmanifold_1_1_reindex_edge.html',1,'manifold']]], + ['relation_4',['Relation',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation',1,'manifold::Manifold::Impl']]], + ['result_5',['Result',['../struct_result.html',1,'']]] +]; diff --git a/docs/html/search/classes_f.js b/docs/html/search/classes_f.js new file mode 100644 index 000000000..08ad5bbe8 --- /dev/null +++ b/docs/html/search/classes_f.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['seqcollisionrecorder_0',['SeqCollisionRecorder',['../structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html',1,'manifold::collider_internal']]], + ['sharedptrguard_1',['SharedPtrGuard',['../classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html',1,'manifold::ConcurrentSharedPtr']]], + ['smoothness_2',['Smoothness',['../group___connections.html#structmanifold_1_1_smoothness',1,'manifold']]], + ['sort_5fasc_3',['sort_Asc',['../structbenchmarks_1_1sort___asc.html',1,'benchmarks']]], + ['sort_5fasc_5fsize_4',['sort_Asc_size',['../structbenchmarks_1_1sort___asc__size.html',1,'benchmarks']]], + ['sort_5fasc_5fsize_5fmerge_5',['sort_Asc_size_merge',['../structbenchmarks_1_1sort___asc__size__merge.html',1,'benchmarks']]], + ['sort_5fdes_6',['sort_Des',['../structbenchmarks_1_1sort___des.html',1,'benchmarks']]], + ['sort_5fdes_5fsize_7',['sort_Des_size',['../structbenchmarks_1_1sort___des__size.html',1,'benchmarks']]], + ['sort_5fdes_5fsize_5fmerge_8',['sort_Des_size_merge',['../structbenchmarks_1_1sort___des__size__merge.html',1,'benchmarks']]], + ['sort_5feq_9',['sort_Eq',['../structbenchmarks_1_1sort___eq.html',1,'benchmarks']]], + ['sort_5feq_5fsize_10',['sort_Eq_size',['../structbenchmarks_1_1sort___eq__size.html',1,'benchmarks']]], + ['sort_5feq_5fsize_5fmerge_11',['sort_Eq_size_merge',['../structbenchmarks_1_1sort___eq__size__merge.html',1,'benchmarks']]], + ['sort_5frnd_12',['sort_Rnd',['../structbenchmarks_1_1sort___rnd.html',1,'benchmarks']]], + ['sort_5frnd_5fsize_13',['sort_Rnd_size',['../structbenchmarks_1_1sort___rnd__size.html',1,'benchmarks']]], + ['sort_5frnd_5fsize_5fmerge_14',['sort_Rnd_size_merge',['../structbenchmarks_1_1sort___rnd__size__merge.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_15',['sort_roughly_Asc',['../structbenchmarks_1_1sort__roughly___asc.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_5fsize_16',['sort_roughly_Asc_size',['../structbenchmarks_1_1sort__roughly___asc__size.html',1,'benchmarks']]], + ['sort_5froughly_5fasc_5fsize_5fmerge_17',['sort_roughly_Asc_size_merge',['../structbenchmarks_1_1sort__roughly___asc__size__merge.html',1,'benchmarks']]], + ['sparseindices_18',['SparseIndices',['../classmanifold_1_1_sparse_indices.html',1,'manifold']]], + ['stridedrange_19',['StridedRange',['../structmanifold_1_1_strided_range.html',1,'manifold']]], + ['svdset_20',['SVDSet',['../group___connections.html#structmanifold_1_1_s_v_d_set',1,'manifold']]] +]; diff --git a/docs/html/search/close.svg b/docs/html/search/close.svg new file mode 100644 index 000000000..337d6cc13 --- /dev/null +++ b/docs/html/search/close.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/docs/html/search/enums_0.js b/docs/html/search/enums_0.js new file mode 100644 index 000000000..febcf1f7c --- /dev/null +++ b/docs/html/search/enums_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['fillrule_0',['FillRule',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enums_1.js b/docs/html/search/enums_1.js new file mode 100644 index 000000000..7b4fe3d01 --- /dev/null +++ b/docs/html/search/enums_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['jointype_0',['JoinType',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enums_2.js b/docs/html/search/enums_2.js new file mode 100644 index 000000000..f0b04914f --- /dev/null +++ b/docs/html/search/enums_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['optype_0',['OpType',['../group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969',1,'manifold']]] +]; diff --git a/docs/html/search/enumvalues_0.js b/docs/html/search/enumvalues_0.js new file mode 100644 index 000000000..a69a26fb4 --- /dev/null +++ b/docs/html/search/enumvalues_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['evenodd_0',['EvenOdd',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_1.js b/docs/html/search/enumvalues_1.js new file mode 100644 index 000000000..92ec4fc30 --- /dev/null +++ b/docs/html/search/enumvalues_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['miter_0',['Miter',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_2.js b/docs/html/search/enumvalues_2.js new file mode 100644 index 000000000..b654db0b2 --- /dev/null +++ b/docs/html/search/enumvalues_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['negative_0',['Negative',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b',1,'manifold::CrossSection']]], + ['nonzero_1',['NonZero',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_3.js b/docs/html/search/enumvalues_3.js new file mode 100644 index 000000000..05a616946 --- /dev/null +++ b/docs/html/search/enumvalues_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['positive_0',['Positive',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_4.js b/docs/html/search/enumvalues_4.js new file mode 100644 index 000000000..f5d70a315 --- /dev/null +++ b/docs/html/search/enumvalues_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['round_0',['Round',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_5.js b/docs/html/search/enumvalues_5.js new file mode 100644 index 000000000..d39fd05d9 --- /dev/null +++ b/docs/html/search/enumvalues_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['square_0',['Square',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js new file mode 100644 index 000000000..8cb09d81b --- /dev/null +++ b/docs/html/search/functions_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['area_0',['area',['../classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666',1,'manifold::CrossSection::Area()'],['../structmanifold_1_1_rect.html#ac84b151a969c68d662637e8245548666',1,'manifold::Rect::Area()']]], + ['asoriginal_1',['AsOriginal',['../classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_1.js b/docs/html/search/functions_1.js new file mode 100644 index 000000000..7ac5f86e1 --- /dev/null +++ b/docs/html/search/functions_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['batchboolean_0',['batchboolean',['../classmanifold_1_1_cross_section.html#a8543728360bc7dda5472d5aa8647b36e',1,'manifold::CrossSection::BatchBoolean()'],['../classmanifold_1_1_manifold.html#a1b30c42e224bda7e71a3ed3cf02319c1',1,'manifold::Manifold::BatchBoolean()']]], + ['boolean_1',['boolean',['../classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2',1,'manifold::CrossSection::Boolean()'],['../classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df',1,'manifold::Manifold::Boolean(const Manifold &second, OpType op) const']]], + ['boundingbox_2',['BoundingBox',['../classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67',1,'manifold::Manifold']]], + ['bounds_3',['Bounds',['../classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c',1,'manifold::CrossSection']]], + ['box_4',['box',['../structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5',1,'manifold::Box::Box()'],['../structmanifold_1_1_box.html#a8258a064a735f0c191bab31d0775912d',1,'manifold::Box::Box(const vec3 p1, const vec3 p2)']]] +]; diff --git a/docs/html/search/functions_10.js b/docs/html/search/functions_10.js new file mode 100644 index 000000000..9e2c1fd83 --- /dev/null +++ b/docs/html/search/functions_10.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['tangentfromnormal_0',['TangentFromNormal',['../structmanifold_1_1_manifold_1_1_impl.html#a5188293029f53ae9159a9a36fb66533a',1,'manifold::Manifold::Impl']]], + ['tetpuzzle_1',['TetPuzzle',['../group___samples.html#gaa69f000001c833bf1534f35c19a7e8b0',1,'manifold']]], + ['tetrahedron_2',['Tetrahedron',['../classmanifold_1_1_manifold.html#afbd42733f05fb87dec1b3dae9ff9f582',1,'manifold::Manifold']]], + ['topolygons_3',['ToPolygons',['../classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2',1,'manifold::CrossSection']]], + ['torusknot_4',['TorusKnot',['../group___samples.html#ga0ccde255ceda709d8e4a54ec95f3ca3e',1,'manifold']]], + ['transform_5',['transform',['../classmanifold_1_1_cross_section.html#a534ac4a433b68882dba4919ade75946c',1,'manifold::CrossSection::Transform()'],['../classmanifold_1_1_manifold.html#af4459c0e7355b2805b2694da075c8346',1,'manifold::Manifold::Transform()'],['../structmanifold_1_1_box.html#ac57a6312e33544515f782970a3b66eb6',1,'manifold::Box::Transform()'],['../structmanifold_1_1_rect.html#a16290599b6b48837a6695ae030d288af',1,'manifold::Rect::Transform()']]], + ['translate_6',['translate',['../classmanifold_1_1_cross_section.html#a38bcb89b28140acbceca56f0bbda67b9',1,'manifold::CrossSection::Translate()'],['../classmanifold_1_1_manifold.html#a78fbea69555ea755f8731255060f7c9d',1,'manifold::Manifold::Translate()']]], + ['triangulate_7',['Triangulate',['../group___connections.html#ga096515808119cda3b6aff7ab31bf6355',1,'manifold']]], + ['triangulateidx_8',['TriangulateIdx',['../group___private.html#ga526f0d57b4e5c29114576fdf13a304c0',1,'manifold']]], + ['trimbyplane_9',['TrimByPlane',['../classmanifold_1_1_manifold.html#aa8d62161da6e94da7651418c33c3e294',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_11.js b/docs/html/search/functions_11.js new file mode 100644 index 000000000..30538b018 --- /dev/null +++ b/docs/html/search/functions_11.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['union_0',['union',['../structmanifold_1_1_box.html#a9605138c461b1e437e59a71e1aa34653',1,'manifold::Box::Union(const vec3 p)'],['../structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd',1,'manifold::Box::Union(const Box &box) const'],['../structmanifold_1_1_rect.html#aab08573b89e6715df6a1b0e1c4222e8d',1,'manifold::Rect::Union(const vec2 p)'],['../structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70',1,'manifold::Rect::Union(const Rect &rect) const']]], + ['update_1',['Update',['../structmanifold_1_1_manifold_1_1_impl.html#aec0783b5a136e042adcc47bae4fe5291',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/functions_12.js b/docs/html/search/functions_12.js new file mode 100644 index 000000000..b71d235ab --- /dev/null +++ b/docs/html/search/functions_12.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vertexcollisionsz_0',['VertexCollisionsZ',['../structmanifold_1_1_manifold_1_1_impl.html#a601f5355c70f7c74a168e5cbd4a817a5',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/functions_13.js b/docs/html/search/functions_13.js new file mode 100644 index 000000000..5fa5b53f3 --- /dev/null +++ b/docs/html/search/functions_13.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['warp_0',['warp',['../classmanifold_1_1_cross_section.html#ac50618697f91880859f4d536f2569b5e',1,'manifold::CrossSection::Warp()'],['../classmanifold_1_1_manifold.html#a5366f7082adcbb2be63fcf2b4c57eb51',1,'manifold::Manifold::Warp()']]], + ['warpbatch_1',['warpbatch',['../classmanifold_1_1_cross_section.html#a2d4ae264fded90c78cf750ad0dbea33a',1,'manifold::CrossSection::WarpBatch()'],['../classmanifold_1_1_manifold.html#a7825d52e3102cc6e7d48a19f9ea0b468',1,'manifold::Manifold::WarpBatch()']]] +]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js new file mode 100644 index 000000000..d753f0ee7 --- /dev/null +++ b/docs/html/search/functions_2.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['calculatebbox_0',['CalculateBBox',['../structmanifold_1_1_manifold_1_1_impl.html#a4bad2940552ae5f952d4b1f710627a25',1,'manifold::Manifold::Impl']]], + ['calculatecurvature_1',['CalculateCurvature',['../classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705',1,'manifold::Manifold']]], + ['calculatenormals_2',['calculatenormals',['../classmanifold_1_1_manifold.html#ab6c0e49ed98c9c03bc1324d4ff8452ce',1,'manifold::Manifold::CalculateNormals()'],['../structmanifold_1_1_manifold_1_1_impl.html#adef45f00696640f682ede12311bdace7',1,'manifold::Manifold::Impl::CalculateNormals()']]], + ['ccw_3',['CCW',['../group___connections.html#ga92f3267a3f49fa8b9199570c3adcbfb7',1,'manifold']]], + ['center_4',['center',['../structmanifold_1_1_box.html#ac600d9d9003333be36f390c84dead39e',1,'manifold::Box::Center()'],['../structmanifold_1_1_rect.html#ac73874c64476da0c5d9f3f11c096826d',1,'manifold::Rect::Center()']]], + ['circle_5',['Circle',['../classmanifold_1_1_cross_section.html#af9c4ae1a5b602abdd9d9d41cfda32ecf',1,'manifold::CrossSection']]], + ['cleanuptopology_6',['CleanupTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a91e235740ebc7024be3e7cf6ae46ddad',1,'manifold::Manifold::Impl']]], + ['compactprops_7',['CompactProps',['../structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a',1,'manifold::Manifold::Impl']]], + ['compose_8',['compose',['../classmanifold_1_1_cross_section.html#a6eb6f97b4b0c4ac7bfeb79dc1234e8f3',1,'manifold::CrossSection::Compose()'],['../classmanifold_1_1_manifold.html#a96a1b20e25443713304db55196573e3d',1,'manifold::Manifold::Compose()'],['../classmanifold_1_1_csg_leaf_node.html#ac78f0bab130bd5e2cddeb9fed4c149ed',1,'manifold::CsgLeafNode::Compose()']]], + ['contains_9',['contains',['../structmanifold_1_1_rect.html#ab1e5f154a88928d5a6b89ff0e4b2c0b6',1,'manifold::Rect::Contains(const vec2 &p) const'],['../structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6',1,'manifold::Rect::Contains(const Rect &rect) const'],['../structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d',1,'manifold::Box::Contains(const Box &box) const'],['../structmanifold_1_1_box.html#aa51dc69603c0f65eca337672c9455b5c',1,'manifold::Box::Contains(const vec3 &p) const']]], + ['cosd_10',['cosd',['../group___connections.html#gac61fa065167cefe7117d0064744c7a52',1,'manifold']]], + ['createhalfedges_11',['CreateHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#ab66628e1ea9f38ed586b16e0c1aa4133',1,'manifold::Manifold::Impl']]], + ['createtangents_12',['createtangents',['../structmanifold_1_1_manifold_1_1_impl.html#acc962337837219c991a414bf4033ef61',1,'manifold::Manifold::Impl::CreateTangents(int normalIdx)'],['../structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b',1,'manifold::Manifold::Impl::CreateTangents(std::vector< Smoothness >)']]], + ['crosssection_13',['crosssection',['../classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0',1,'manifold::CrossSection::CrossSection()'],['../classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436',1,'manifold::CrossSection::CrossSection(const CrossSection &other)'],['../classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2',1,'manifold::CrossSection::CrossSection(const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e',1,'manifold::CrossSection::CrossSection(const Polygons &contours, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2',1,'manifold::CrossSection::CrossSection(const Rect &rect)']]], + ['cube_14',['Cube',['../classmanifold_1_1_manifold.html#ad5486e9d0cff020565c3c20c1f496ab9',1,'manifold::Manifold']]], + ['cylinder_15',['Cylinder',['../classmanifold_1_1_manifold.html#a879b867522c562c7166af539894a2815',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_3.js b/docs/html/search/functions_3.js new file mode 100644 index 000000000..a678fa006 --- /dev/null +++ b/docs/html/search/functions_3.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['decompose_0',['decompose',['../classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c',1,'manifold::CrossSection::Decompose()'],['../classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106',1,'manifold::Manifold::Decompose()']]], + ['distancetriangletrianglesquared_1',['DistanceTriangleTriangleSquared',['../namespacemanifold.html#ae710936bf26af7fd2c51342d8f36984f',1,'manifold']]], + ['distributetangents_2',['DistributeTangents',['../structmanifold_1_1_manifold_1_1_impl.html#ae520f2222155301f5bb6551702222014',1,'manifold::Manifold::Impl']]], + ['doesoverlap_3',['doesoverlap',['../structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669',1,'manifold::Box::DoesOverlap(const Box &box) const'],['../structmanifold_1_1_box.html#aaa691916d71188bf3256e204393e8aa7',1,'manifold::Box::DoesOverlap(vec3 p) const'],['../structmanifold_1_1_rect.html#ae9b86c34e407f27313804c9a7d30c8c2',1,'manifold::Rect::DoesOverlap()']]], + ['dump_4',['Dump',['../group___debug.html#ga5a4ed9a6d64edb22079ff7a5caddcb5a',1,'manifold']]] +]; diff --git a/docs/html/search/functions_4.js b/docs/html/search/functions_4.js new file mode 100644 index 000000000..33f2c60c7 --- /dev/null +++ b/docs/html/search/functions_4.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['edgecollisions_0',['EdgeCollisions',['../structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5',1,'manifold::Manifold::Impl']]], + ['edgeedgedist_1',['EdgeEdgeDist',['../namespacemanifold.html#a88cecf06626e19ee678becb9c6ef8898',1,'manifold']]], + ['exportmesh_2',['exportmesh',['../group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb',1,'manifold::ExportMesh(const std::string &filename, const Mesh &mesh, const ExportOptions &options)'],['../group___mesh_i_o.html#ga83ff5d8f4ee07ce7902b1d9ccea3640c',1,'manifold::ExportMesh(const std::string &filename, const MeshGL &mesh, const ExportOptions &options)']]], + ['extrude_3',['Extrude',['../classmanifold_1_1_manifold.html#a37da082109050d748421069e22eff876',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_5.js b/docs/html/search/functions_5.js new file mode 100644 index 000000000..3d7a4ed98 --- /dev/null +++ b/docs/html/search/functions_5.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['face2polygons_0',['Face2Polygons',['../structmanifold_1_1_manifold_1_1_impl.html#a517d1cb074912e89da079deef759207e',1,'manifold::Manifold::Impl']]], + ['face2tri_1',['Face2Tri',['../structmanifold_1_1_manifold_1_1_impl.html#af037f51003b109c22f6a67cea6238021',1,'manifold::Manifold::Impl']]], + ['fillretainedverts_2',['FillRetainedVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a0f3beb18c180190ad660336992f0ff64',1,'manifold::Manifold::Impl']]], + ['finish_3',['Finish',['../structmanifold_1_1_manifold_1_1_impl.html#af9d1bc46635e487c85720b943dd8ba28',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/functions_6.js b/docs/html/search/functions_6.js new file mode 100644 index 000000000..064487dd5 --- /dev/null +++ b/docs/html/search/functions_6.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['gatherfaces_0',['GatherFaces',['../structmanifold_1_1_manifold_1_1_impl.html#abd9a97b16b825e7ee3fd989aaf776757',1,'manifold::Manifold::Impl']]], + ['genus_1',['Genus',['../classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1',1,'manifold::Manifold']]], + ['getaxisalignedprojection_2',['GetAxisAlignedProjection',['../group___private.html#ga8a78bbee39ddfd72a872c6027d376f51',1,'manifold']]], + ['getcircularsegments_3',['GetCircularSegments',['../classmanifold_1_1_quality.html#aa4d3c532266d48a96ac9a8b8a7ab4e10',1,'manifold::Quality']]], + ['getfaceboxmorton_4',['GetFaceBoxMorton',['../structmanifold_1_1_manifold_1_1_impl.html#ae950ed2beaef893ec411aa3921aa25a8',1,'manifold::Manifold::Impl']]], + ['gethalfedges_5',['GetHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#ae9b082f1f3b9f6502e252f1fe35e5e3a',1,'manifold::Manifold::Impl']]], + ['getindices_6',['GetIndices',['../structmanifold_1_1_manifold_1_1_impl.html#a5663e9c8c9f549c90a3cfd36ad2c787a',1,'manifold::Manifold::Impl']]], + ['getmesh_7',['GetMesh',['../classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750',1,'manifold::Manifold']]], + ['getmeshgl_8',['GetMeshGL',['../classmanifold_1_1_manifold.html#a3711c029f2c9fe2d152455981a3b2d73',1,'manifold::Manifold']]], + ['getneighbor_9',['GetNeighbor',['../structmanifold_1_1_manifold_1_1_impl.html#a8a3b5765ff1df3e2090e792f8a2eb444',1,'manifold::Manifold::Impl']]], + ['getnormal_10',['GetNormal',['../structmanifold_1_1_manifold_1_1_impl.html#acb9563addc2ff3283f4bbfe4dd722ece',1,'manifold::Manifold::Impl']]], + ['getproperties_11',['GetProperties',['../classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07',1,'manifold::Manifold']]], + ['gyroidmodule_12',['GyroidModule',['../group___samples.html#ga5141b952c15a0aa27af95791a65455d2',1,'manifold']]] +]; diff --git a/docs/html/search/functions_7.js b/docs/html/search/functions_7.js new file mode 100644 index 000000000..7026c57ad --- /dev/null +++ b/docs/html/search/functions_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hull_0',['hull',['../classmanifold_1_1_cross_section.html#aa5ea1caf54ddac72d939a00d13763ace',1,'manifold::CrossSection::Hull() const'],['../classmanifold_1_1_cross_section.html#a49d6309921d09ab4e9874f1987f3b487',1,'manifold::CrossSection::Hull(const std::vector< CrossSection > &crossSections)'],['../classmanifold_1_1_cross_section.html#aec35843b9a8e1470605ae615a66643e2',1,'manifold::CrossSection::Hull(const SimplePolygon poly)'],['../classmanifold_1_1_cross_section.html#a800d15ed35b3f430a11f1fdc4dfe79a6',1,'manifold::CrossSection::Hull(const Polygons polys)'],['../classmanifold_1_1_manifold.html#a9dc9e00112e2b063cfa6fe8482b1afe8',1,'manifold::Manifold::Hull() const'],['../classmanifold_1_1_manifold.html#a0b45afc24015963e82745f1f83f3f310',1,'manifold::Manifold::Hull(const std::vector< Manifold > &manifolds)'],['../classmanifold_1_1_manifold.html#ab0a6fa5c97e3e47118ee69b741e64ad0',1,'manifold::Manifold::Hull(const std::vector< vec3 > &pts)']]] +]; diff --git a/docs/html/search/functions_8.js b/docs/html/search/functions_8.js new file mode 100644 index 000000000..02c641df5 --- /dev/null +++ b/docs/html/search/functions_8.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['impl_0',['impl',['../structmanifold_1_1_manifold_1_1_impl.html#a9bb5abff877334251f06225d5037cfd1',1,'manifold::Manifold::Impl::Impl(Shape, const mat4x3=mat4x3(1))'],['../structmanifold_1_1_manifold_1_1_impl.html#ab6fd31092fdc69f21bb100d9b92bc5a8',1,'manifold::Manifold::Impl::Impl(const Mesh &, const MeshRelationD &relation, const std::vector< double > &propertyTolerance={}, bool hasFaceIDs=false)']]], + ['importmesh_1',['ImportMesh',['../group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0',1,'manifold']]], + ['incrementmeshids_2',['IncrementMeshIDs',['../structmanifold_1_1_manifold_1_1_impl.html#a11d47359eb52523a2bc86f6d4ab22633',1,'manifold::Manifold::Impl']]], + ['is2manifold_3',['Is2Manifold',['../structmanifold_1_1_manifold_1_1_impl.html#a7b0298da43b37952e432a1a0c4b02e00',1,'manifold::Manifold::Impl']]], + ['isempty_4',['isempty',['../classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a',1,'manifold::CrossSection::IsEmpty()'],['../classmanifold_1_1_manifold.html#a8e12342fc420701fbffd97025421575a',1,'manifold::Manifold::IsEmpty()'],['../structmanifold_1_1_rect.html#a8e12342fc420701fbffd97025421575a',1,'manifold::Rect::IsEmpty()']]], + ['isfinite_5',['isfinite',['../structmanifold_1_1_manifold_1_1_impl.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Manifold::Impl::IsFinite()'],['../structmanifold_1_1_box.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Box::IsFinite()'],['../structmanifold_1_1_rect.html#a33b7dcc502aae627fbc56bcfecf33af1',1,'manifold::Rect::IsFinite()']]], + ['isindexinbounds_6',['IsIndexInBounds',['../structmanifold_1_1_manifold_1_1_impl.html#aa7f6545c1c252ffda922760097cfd68c',1,'manifold::Manifold::Impl']]], + ['isinsidequad_7',['IsInsideQuad',['../structmanifold_1_1_manifold_1_1_impl.html#aa244e3ec23cdce59aa792a297f0c8cde',1,'manifold::Manifold::Impl']]], + ['ismanifold_8',['IsManifold',['../structmanifold_1_1_manifold_1_1_impl.html#a28f34ca6c256f1f7fa44e862540ec421',1,'manifold::Manifold::Impl']]], + ['ismarkedinsidequad_9',['IsMarkedInsideQuad',['../structmanifold_1_1_manifold_1_1_impl.html#a879e2e73b1f97ca728d306dfb3c520d5',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/functions_9.js b/docs/html/search/functions_9.js new file mode 100644 index 000000000..57a389d00 --- /dev/null +++ b/docs/html/search/functions_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['levelset_0',['LevelSet',['../group___core.html#ga359e374df5225fef63061f32718e2fb3',1,'manifold::Manifold']]], + ['linearizeflattangents_1',['LinearizeFlatTangents',['../structmanifold_1_1_manifold_1_1_impl.html#a744f7dc967657edf6fdba43aaa81ad3e',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/functions_a.js b/docs/html/search/functions_a.js new file mode 100644 index 000000000..e69ebdb60 --- /dev/null +++ b/docs/html/search/functions_a.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['manifold_0',['manifold',['../classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b',1,'manifold::Manifold::Manifold()'],['../classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599',1,'manifold::Manifold::Manifold(const MeshGL &, const std::vector< float > &propertyTolerance={})'],['../classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea',1,'manifold::Manifold::Manifold(const Mesh &)']]], + ['manifoldparams_1',['ManifoldParams',['../group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275',1,'manifold']]], + ['matchestrinormals_2',['matchestrinormals',['../classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::MatchesTriNormals()'],['../structmanifold_1_1_manifold_1_1_impl.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::Impl::MatchesTriNormals()']]], + ['mengersponge_3',['MengerSponge',['../group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae',1,'manifold']]], + ['merge_4',['Merge',['../structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254',1,'manifold::MeshGL']]], + ['meshgl_5',['MeshGL',['../structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed',1,'manifold::MeshGL']]], + ['mingap_6',['MinGap',['../classmanifold_1_1_manifold.html#a1b7ab47f4da039eb3dff5b46ba71658b',1,'manifold::Manifold']]], + ['mirror_7',['mirror',['../classmanifold_1_1_cross_section.html#a3bdcbaf979a769af24a9d61624e639e8',1,'manifold::CrossSection::Mirror()'],['../classmanifold_1_1_manifold.html#ad76d89178ca970900c81f2927f8c7f11',1,'manifold::Manifold::Mirror()']]] +]; diff --git a/docs/html/search/functions_b.js b/docs/html/search/functions_b.js new file mode 100644 index 000000000..6c66a9630 --- /dev/null +++ b/docs/html/search/functions_b.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['numcontour_0',['NumContour',['../classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c',1,'manifold::CrossSection']]], + ['numdegeneratetris_1',['numdegeneratetris',['../classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::NumDegenerateTris()'],['../structmanifold_1_1_manifold_1_1_impl.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::Impl::NumDegenerateTris()']]], + ['numedge_2',['NumEdge',['../classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a',1,'manifold::Manifold']]], + ['numoverlaps_3',['NumOverlaps',['../classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704',1,'manifold::Manifold']]], + ['numprop_4',['NumProp',['../classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348',1,'manifold::Manifold']]], + ['numpropvert_5',['NumPropVert',['../classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d',1,'manifold::Manifold']]], + ['numtri_6',['numtri',['../structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6',1,'manifold::MeshGL::NumTri()'],['../classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6',1,'manifold::Manifold::NumTri()']]], + ['numvert_7',['numvert',['../classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::CrossSection::NumVert()'],['../structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658',1,'manifold::MeshGL::NumVert()'],['../classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::Manifold::NumVert()']]] +]; diff --git a/docs/html/search/functions_c.js b/docs/html/search/functions_c.js new file mode 100644 index 000000000..0ba5eb787 --- /dev/null +++ b/docs/html/search/functions_c.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['offset_0',['Offset',['../classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a',1,'manifold::CrossSection']]], + ['operator_22_22_5fuz_1',['operator""_uz',['../namespacemanifold.html#a94b9f74f9f0e28c9e31534d6fc624d14',1,'manifold']]], + ['operator_2a_2',['operator*',['../structmanifold_1_1_box.html#a0993fea81be0170878dfec3abce2e6dc',1,'manifold::Box::operator*()'],['../structmanifold_1_1_rect.html#a7f518b4df73d824dfa9117e1e0137082',1,'manifold::Rect::operator*(const vec2 scale) const']]], + ['operator_2a_3d_3',['operator*=',['../structmanifold_1_1_rect.html#a02fcd8a4fd938f130493a48349dcbabe',1,'manifold::Rect::operator*=()'],['../structmanifold_1_1_box.html#ab0ec4bdbe1a152a83073874d2d62db67',1,'manifold::Box::operator*=()']]], + ['operator_2b_4',['operator+',['../classmanifold_1_1_manifold.html#af95e73e5427d09b9d9e025d5cf367c30',1,'manifold::Manifold::operator+()'],['../structmanifold_1_1_rect.html#a6fe10cfc3aa4a6bd44cf8867639aff2b',1,'manifold::Rect::operator+()'],['../structmanifold_1_1_box.html#af682637d259e4850c42bbe1d1ad98491',1,'manifold::Box::operator+()'],['../classmanifold_1_1_cross_section.html#a347c593a12693ee05159b34db0957580',1,'manifold::CrossSection::operator+(const CrossSection &) const']]], + ['operator_2b_3d_5',['operator+=',['../classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a',1,'manifold::CrossSection::operator+=()'],['../classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688',1,'manifold::Manifold::operator+=()'],['../structmanifold_1_1_box.html#ad243f3e9cd636fcd4dfe7c374d0e00c4',1,'manifold::Box::operator+=()'],['../structmanifold_1_1_rect.html#ae56ad379896fd93dc3e41ab719a52c87',1,'manifold::Rect::operator+=()']]], + ['operator_2d_6',['operator-',['../classmanifold_1_1_cross_section.html#af6a000221ca368c9f2ed3e1f271cfb7f',1,'manifold::CrossSection::operator-()'],['../classmanifold_1_1_manifold.html#ad9da8c505e6846e9645008825833e1da',1,'manifold::Manifold::operator-()']]], + ['operator_2d_3d_7',['operator-=',['../classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0',1,'manifold::CrossSection::operator-=()'],['../classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b',1,'manifold::Manifold::operator-=()']]], + ['operator_5e_8',['operator^',['../classmanifold_1_1_cross_section.html#a34fcc007d18275e2cc32f4c99bc94cda',1,'manifold::CrossSection::operator^()'],['../classmanifold_1_1_manifold.html#ad1e4e5720f01934c44aebc597be4d104',1,'manifold::Manifold::operator^()']]], + ['operator_5e_3d_9',['operator^=',['../classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3',1,'manifold::CrossSection::operator^=()'],['../classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522',1,'manifold::Manifold::operator^=(const Manifold &)']]], + ['originalid_10',['OriginalID',['../classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_d.js b/docs/html/search/functions_d.js new file mode 100644 index 000000000..88ae975f5 --- /dev/null +++ b/docs/html/search/functions_d.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['precision_0',['Precision',['../classmanifold_1_1_manifold.html#aef800826805cb6d90d03846fdb12c3e3',1,'manifold::Manifold']]], + ['project_1',['Project',['../classmanifold_1_1_manifold.html#a328657b69e9bbaaee148572ca314677c',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/functions_e.js b/docs/html/search/functions_e.js new file mode 100644 index 000000000..acb69c18f --- /dev/null +++ b/docs/html/search/functions_e.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['rect_0',['rect',['../structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22',1,'manifold::Rect::Rect()'],['../structmanifold_1_1_rect.html#a4b37d0f1743973da4b1b82d32ed26dfd',1,'manifold::Rect::Rect(const vec2 a, const vec2 b)']]], + ['refine_1',['Refine',['../classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac',1,'manifold::Manifold']]], + ['refinetolength_2',['RefineToLength',['../classmanifold_1_1_manifold.html#a1381728e52975862d954032f717106d5',1,'manifold::Manifold']]], + ['reindexverts_3',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a70e88d0158e9011619309fc502979350',1,'manifold::Manifold::Impl']]], + ['reserveids_4',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['resettodefaults_5',['ResetToDefaults',['../classmanifold_1_1_quality.html#a4595203dc1f079e03b20e9d77e868535',1,'manifold::Quality']]], + ['revolve_6',['Revolve',['../classmanifold_1_1_manifold.html#a8c454a293abbf86f520e10266087f5a6',1,'manifold::Manifold']]], + ['rotate_7',['rotate',['../classmanifold_1_1_cross_section.html#a794f36c935736ecf71806fb3ccd46956',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a7f74bf3b7c5dd34e84b82e7738fd25ff',1,'manifold::Manifold::Rotate()']]], + ['rotateup_8',['RotateUp',['../group___connections.html#ga7035018814a651a22f8bb32b84e6820f',1,'manifold']]], + ['roundedframe_9',['RoundedFrame',['../group___samples.html#gaed7341c943d9bb53a52f01f4d9453bd8',1,'manifold']]] +]; diff --git a/docs/html/search/functions_f.js b/docs/html/search/functions_f.js new file mode 100644 index 000000000..b8bdca099 --- /dev/null +++ b/docs/html/search/functions_f.js @@ -0,0 +1,31 @@ +var searchData= +[ + ['scale_0',['scale',['../classmanifold_1_1_manifold.html#aa6153eb69d3a69e38e6508bf58449f04',1,'manifold::Manifold::Scale()'],['../structmanifold_1_1_box.html#ab30d1e52df44eb451081926df999fc17',1,'manifold::Box::Scale()'],['../structmanifold_1_1_rect.html#ab30d1e52df44eb451081926df999fc17',1,'manifold::Rect::Scale()'],['../classmanifold_1_1_cross_section.html#ad0f8a0ea9c4e2394bc4808dfb7ae1c69',1,'manifold::CrossSection::Scale()']]], + ['scallop_1',['Scallop',['../group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36',1,'manifold']]], + ['setcircularsegments_2',['SetCircularSegments',['../classmanifold_1_1_quality.html#a6b80d08df8a58d699ce644e1248fe0e2',1,'manifold::Quality']]], + ['setmincircularangle_3',['SetMinCircularAngle',['../classmanifold_1_1_quality.html#a6bde1278da9ae16b0a081ec310c62859',1,'manifold::Quality']]], + ['setmincircularedgelength_4',['SetMinCircularEdgeLength',['../classmanifold_1_1_quality.html#ad5148a903ab599298e8f1df10167de9d',1,'manifold::Quality']]], + ['setnormals_5',['SetNormals',['../structmanifold_1_1_manifold_1_1_impl.html#ac35adfca9a18e8dd1a6a65355ad0ed07',1,'manifold::Manifold::Impl']]], + ['setprecision_6',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a496713ae74ada7e6aaee40464afc9d9e',1,'manifold::Manifold::Impl']]], + ['setproperties_7',['SetProperties',['../classmanifold_1_1_manifold.html#a6a852721876d6fce2136ac27e7377f8e',1,'manifold::Manifold']]], + ['sharpentangent_8',['SharpenTangent',['../structmanifold_1_1_manifold_1_1_impl.html#a28cc7fde07cd82723e1f71699c7b502d',1,'manifold::Manifold::Impl']]], + ['simplify_9',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_10',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_11',['sind',['../group___connections.html#gacbb1fe7fd1a4e41a0754ed80abaa593d',1,'manifold']]], + ['size_12',['size',['../structmanifold_1_1_box.html#ac7f1d96c2e44bdff4079fd40802e2ac6',1,'manifold::Box::Size()'],['../structmanifold_1_1_rect.html#a8b0310b471c0b5898fb21d12b00eac81',1,'manifold::Rect::Size()']]], + ['slice_13',['Slice',['../classmanifold_1_1_manifold.html#ad03837de2290a269fa14e0773c9913fa',1,'manifold::Manifold']]], + ['smooth_14',['smooth',['../classmanifold_1_1_manifold.html#aff03aac40d42a60f8e4254db90530c83',1,'manifold::Manifold::Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})'],['../classmanifold_1_1_manifold.html#aad322c5b69ab571a4f4fb5b26f945b90',1,'manifold::Manifold::Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})']]], + ['smoothbynormals_15',['SmoothByNormals',['../classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4',1,'manifold::Manifold']]], + ['smoothout_16',['SmoothOut',['../classmanifold_1_1_manifold.html#a0b59680c4bc2300e0e12713ab220d3d5',1,'manifold::Manifold']]], + ['sortfaces_17',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_18',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['spectralnorm_19',['SpectralNorm',['../group___connections.html#ga6f4bce48eb47e3fe5e0d05c6e7ed0d05',1,'manifold']]], + ['sphere_20',['Sphere',['../classmanifold_1_1_manifold.html#a606301a59534ef00a89dc7d7a132abe6',1,'manifold::Manifold']]], + ['split_21',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['splitbyplane_22',['SplitByPlane',['../classmanifold_1_1_manifold.html#a40c2716b965886e4fb952e5ade866a5a',1,'manifold::Manifold']]], + ['square_23',['Square',['../classmanifold_1_1_cross_section.html#a43e92332e827adee0914baf746fa677b',1,'manifold::CrossSection']]], + ['status_24',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['stretchybracelet_25',['StretchyBracelet',['../group___samples.html#gac99ae21a77112ea3909eefb0a66e1ae4',1,'manifold']]], + ['subdivide_26',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#a364c1c537f3bfd0f4f37e3189aea3e26',1,'manifold::Manifold::Impl']]], + ['svd_27',['SVD',['../group___connections.html#gad55150a21602b41346eb9a1477131fe7',1,'manifold']]] +]; diff --git a/docs/html/search/groups_0.js b/docs/html/search/groups_0.js new file mode 100644 index 000000000..61be2419a --- /dev/null +++ b/docs/html/search/groups_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['connections_0',['Connections',['../group___connections.html',1,'']]], + ['core_1',['Core',['../group___core.html',1,'']]] +]; diff --git a/docs/html/search/groups_1.js b/docs/html/search/groups_1.js new file mode 100644 index 000000000..1de4f7c2d --- /dev/null +++ b/docs/html/search/groups_1.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['data_20structure_20definitions_0',['data structure definitions',['../group___math.html',1,'']]], + ['debug_1',['Debug',['../group___debug.html',1,'']]], + ['definitions_2',['data structure definitions',['../group___math.html',1,'']]] +]; diff --git a/docs/html/search/groups_2.js b/docs/html/search/groups_2.js new file mode 100644 index 000000000..72cde6898 --- /dev/null +++ b/docs/html/search/groups_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['exceptions_0',['Exceptions',['../group___exceptions.html',1,'']]] +]; diff --git a/docs/html/search/groups_3.js b/docs/html/search/groups_3.js new file mode 100644 index 000000000..369bb0ad5 --- /dev/null +++ b/docs/html/search/groups_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['meshio_0',['MeshIO',['../group___mesh_i_o.html',1,'']]] +]; diff --git a/docs/html/search/groups_4.js b/docs/html/search/groups_4.js new file mode 100644 index 000000000..2873760d6 --- /dev/null +++ b/docs/html/search/groups_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['private_0',['Private',['../group___private.html',1,'']]] +]; diff --git a/docs/html/search/groups_5.js b/docs/html/search/groups_5.js new file mode 100644 index 000000000..c33fae9db --- /dev/null +++ b/docs/html/search/groups_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['samples_0',['Samples',['../group___samples.html',1,'']]], + ['structure_20definitions_1',['data structure definitions',['../group___math.html',1,'']]] +]; diff --git a/docs/html/search/mag.svg b/docs/html/search/mag.svg new file mode 100644 index 000000000..ffb6cf0d0 --- /dev/null +++ b/docs/html/search/mag.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_d.svg b/docs/html/search/mag_d.svg new file mode 100644 index 000000000..4122773f9 --- /dev/null +++ b/docs/html/search/mag_d.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_sel.svg b/docs/html/search/mag_sel.svg new file mode 100644 index 000000000..553dba877 --- /dev/null +++ b/docs/html/search/mag_sel.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/mag_seld.svg b/docs/html/search/mag_seld.svg new file mode 100644 index 000000000..c906f84c8 --- /dev/null +++ b/docs/html/search/mag_seld.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/namespaces_0.js b/docs/html/search/namespaces_0.js new file mode 100644 index 000000000..d2dffc716 --- /dev/null +++ b/docs/html/search/namespaces_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bricks_0',['bricks',['../namespacebricks.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_1.js b/docs/html/search/namespaces_1.js new file mode 100644 index 000000000..972924554 --- /dev/null +++ b/docs/html/search/namespaces_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['cube_5fwith_5fdents_0',['cube_with_dents',['../namespacecube__with__dents.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_2.js b/docs/html/search/namespaces_2.js new file mode 100644 index 000000000..34bdc6360 --- /dev/null +++ b/docs/html/search/namespaces_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['gyroid_5fmodule_0',['gyroid_module',['../namespacegyroid__module.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_3.js b/docs/html/search/namespaces_3.js new file mode 100644 index 000000000..bf9bf6a2c --- /dev/null +++ b/docs/html/search/namespaces_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['manifold_0',['manifold',['../namespacemanifold.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_4.js b/docs/html/search/namespaces_4.js new file mode 100644 index 000000000..d28a08b22 --- /dev/null +++ b/docs/html/search/namespaces_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['run_5fall_0',['run_all',['../namespacerun__all.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_5.js b/docs/html/search/namespaces_5.js new file mode 100644 index 000000000..7e2738996 --- /dev/null +++ b/docs/html/search/namespaces_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['scallop_0',['scallop',['../namespacescallop.html',1,'']]], + ['split_5fcube_1',['split_cube',['../namespacesplit__cube.html',1,'']]] +]; diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js new file mode 100644 index 000000000..bdbd6f8fb --- /dev/null +++ b/docs/html/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bindings_0',['Python Bindings',['../index.html',1,'']]] +]; diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js new file mode 100644 index 000000000..86325faaa --- /dev/null +++ b/docs/html/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['contribute_0',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]] +]; diff --git a/docs/html/search/pages_2.js b/docs/html/search/pages_2.js new file mode 100644 index 000000000..aec502727 --- /dev/null +++ b/docs/html/search/pages_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['get_20started_0',['Get Started',['../md_bindings_2wasm_2documents_2_get_01_started.html',1,'']]] +]; diff --git a/docs/html/search/pages_3.js b/docs/html/search/pages_3.js new file mode 100644 index 000000000..c77632f7e --- /dev/null +++ b/docs/html/search/pages_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['how_20to_20contribute_0',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]] +]; diff --git a/docs/html/search/pages_4.js b/docs/html/search/pages_4.js new file mode 100644 index 000000000..c5c5bb855 --- /dev/null +++ b/docs/html/search/pages_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['python_20bindings_0',['Python Bindings',['../index.html',1,'']]] +]; diff --git a/docs/html/search/pages_5.js b/docs/html/search/pages_5.js new file mode 100644 index 000000000..8b7edf4aa --- /dev/null +++ b/docs/html/search/pages_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['release_5fchecklist_0',['RELEASE_CHECKLIST',['../md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html',1,'']]] +]; diff --git a/docs/html/search/pages_6.js b/docs/html/search/pages_6.js new file mode 100644 index 000000000..a80f79427 --- /dev/null +++ b/docs/html/search/pages_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['started_0',['Get Started',['../md_bindings_2wasm_2documents_2_get_01_started.html',1,'']]] +]; diff --git a/docs/html/search/pages_7.js b/docs/html/search/pages_7.js new file mode 100644 index 000000000..8cf0ba009 --- /dev/null +++ b/docs/html/search/pages_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['to_20contribute_0',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]] +]; diff --git a/docs/html/search/search.css b/docs/html/search/search.css new file mode 100644 index 000000000..a53214fcd --- /dev/null +++ b/docs/html/search/search.css @@ -0,0 +1,286 @@ +/*---------------- Search Box */ + +#MSearchBox { + position: absolute; + right: 5px; +} +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} + +#MSearchBox { + display: inline-block; + white-space : nowrap; + background: var(--search-background-color); + border-radius: 0.65em; + box-shadow: var(--search-box-shadow); + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: var(--search-magnification-select-image); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: var(--search-magnification-image); + margin: 0 0 0 0.5em; + padding: 0; +} + + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: var(--search-foreground-color); + outline: none; + font-family: var(--font-family-search); + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: var(--search-active-color); +} + + + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-filter-border-color); + background-color: var(--search-filter-background-color); + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt var(--font-family-search); + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: var(--font-family-monospace); + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: var(--search-filter-foreground-color); + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: var(--search-filter-foreground-color); + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: var(--search-filter-highlight-text-color); + background-color: var(--search-filter-highlight-bg-color); + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + /*width: 60ex;*/ + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-results-border-color); + background-color: var(--search-results-background-color); + z-index:10000; + width: 300px; + height: 400px; + overflow: auto; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +div.SRPage { + margin: 5px 2px; + background-color: var(--search-results-background-color); +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + font-size: 8pt; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: var(--font-family-search); +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: var(--font-family-search); +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: var(--nav-gradient-active-image-parent); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/docs/html/search/search.js b/docs/html/search/search.js new file mode 100644 index 000000000..6fd40c677 --- /dev/null +++ b/docs/html/search/search.js @@ -0,0 +1,840 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + e.stopPropagation(); + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var jsFile; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + var loadJS = function(url, impl, loc){ + var scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); + } + + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + var domSearchBox = this.DOMSearchBox(); + var domPopupSearchResults = this.DOMPopupSearchResults(); + var domSearchClose = this.DOMSearchClose(); + var resultsPath = this.resultsPath; + + var handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') + { + domSearchClose.style.display = 'inline-block'; + var left = getXPos(domSearchBox) + 150; + var top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + var maxWidth = document.body.clientWidth; + var maxHeight = document.body.clientHeight; + var width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + var height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } + } + + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); + } + + this.lastSearchValue = searchValue; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + this.searchActive = true; + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + this.DOMSearchField().value = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults(resultsPath) +{ + var results = document.getElementById("SRResults"); + results.innerHTML = ''; + for (var e=0; e + + + + + + +Manifold: shared.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
shared.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include "manifold/parallel.h"
+
18#include "manifold/sparse.h"
+
19#include "manifold/utils.h"
+
20#include "manifold/vec.h"
+
21
+
22namespace manifold {
+
23
+
27inline vec3 SafeNormalize(vec3 v) {
+
28 v = glm::normalize(v);
+
29 return std::isfinite(v.x) ? v : vec3(0);
+
30}
+
31
+
32inline double MaxPrecision(double minPrecision, const Box& bBox) {
+
33 double precision = std::max(minPrecision, kTolerance * bBox.Scale());
+
34 return std::isfinite(precision) ? precision : -1;
+
35}
+
36
+
37inline int NextHalfedge(int current) {
+
38 ++current;
+
39 if (current % 3 == 0) current -= 3;
+
40 return current;
+
41}
+
42
+
43inline mat3 NormalTransform(const mat4x3& transform) {
+
44 return glm::inverse(glm::transpose(mat3(transform)));
+
45}
+
46
+
+
51inline mat3x2 GetAxisAlignedProjection(vec3 normal) {
+
52 vec3 absNormal = glm::abs(normal);
+
53 double xyzMax;
+
54 mat2x3 projection;
+
55 if (absNormal.z > absNormal.x && absNormal.z > absNormal.y) {
+
56 projection = mat2x3(1.0, 0.0, 0.0, //
+
57 0.0, 1.0, 0.0);
+
58 xyzMax = normal.z;
+
59 } else if (absNormal.y > absNormal.x) {
+
60 projection = mat2x3(0.0, 0.0, 1.0, //
+
61 1.0, 0.0, 0.0);
+
62 xyzMax = normal.y;
+
63 } else {
+
64 projection = mat2x3(0.0, 1.0, 0.0, //
+
65 0.0, 0.0, 1.0);
+
66 xyzMax = normal.x;
+
67 }
+
68 if (xyzMax < 0) projection[0] *= -1.0;
+
69 return glm::transpose(projection);
+
70}
+
+
71
+
72inline vec3 GetBarycentric(const vec3& v, const mat3& triPos,
+
73 double precision) {
+
74 const mat3 edges(triPos[2] - triPos[1], triPos[0] - triPos[2],
+
75 triPos[1] - triPos[0]);
+
76 const vec3 d2(glm::dot(edges[0], edges[0]), glm::dot(edges[1], edges[1]),
+
77 glm::dot(edges[2], edges[2]));
+
78 const int longSide = d2[0] > d2[1] && d2[0] > d2[2] ? 0
+
79 : d2[1] > d2[2] ? 1
+
80 : 2;
+
81 const vec3 crossP = glm::cross(edges[0], edges[1]);
+
82 const double area2 = glm::dot(crossP, crossP);
+
83 const double tol2 = precision * precision;
+
84
+
85 vec3 uvw(0);
+
86 for (const int i : {0, 1, 2}) {
+
87 const vec3 dv = v - triPos[i];
+
88 if (glm::dot(dv, dv) < tol2) {
+
89 // Return exactly equal if within tolerance of vert.
+
90 uvw[i] = 1;
+
91 return uvw;
+
92 }
+
93 }
+
94
+
95 if (d2[longSide] < tol2) { // point
+
96 return vec3(1, 0, 0);
+
97 } else if (area2 > d2[longSide] * tol2) { // triangle
+
98 for (const int i : {0, 1, 2}) {
+
99 const int j = Next3(i);
+
100 const vec3 crossPv = glm::cross(edges[i], v - triPos[j]);
+
101 const double area2v = glm::dot(crossPv, crossPv);
+
102 // Return exactly equal if within tolerance of edge.
+
103 uvw[i] = area2v < d2[i] * tol2 ? 0 : glm::dot(crossPv, crossP);
+
104 }
+
105 uvw /= (uvw[0] + uvw[1] + uvw[2]);
+
106 return uvw;
+
107 } else { // line
+
108 const int nextV = Next3(longSide);
+
109 const double alpha =
+
110 glm::dot(v - triPos[nextV], edges[longSide]) / d2[longSide];
+
111 uvw[longSide] = 0;
+
112 uvw[nextV] = 1 - alpha;
+
113 const int lastV = Next3(nextV);
+
114 uvw[lastV] = alpha;
+
115 return uvw;
+
116 }
+
117}
+
118
+
+
123struct Halfedge {
+
124 int startVert, endVert;
+
125 int pairedHalfedge;
+
126 int face;
+
127 bool IsForward() const { return startVert < endVert; }
+
128 bool operator<(const Halfedge& other) const {
+
129 return startVert == other.startVert ? endVert < other.endVert
+
130 : startVert < other.startVert;
+
131 }
+
132};
+
+
133
+
+ +
135 int tri;
+
136 vec4 uvw;
+
137};
+
+
138
+
+
139struct TriRef {
+ + +
149 int tri;
+
150
+
151 bool SameFace(const TriRef& other) const {
+
152 return meshID == other.meshID && tri == other.tri;
+
153 }
+
154};
+
+
155
+
+
160struct TmpEdge {
+
161 int first, second, halfedgeIdx;
+
162
+
163 TmpEdge() {}
+
164 TmpEdge(int start, int end, int idx) {
+
165 first = std::min(start, end);
+
166 second = std::max(start, end);
+
167 halfedgeIdx = idx;
+
168 }
+
169
+
170 bool operator<(const TmpEdge& other) const {
+
171 return first == other.first ? second < other.second : first < other.first;
+
172 }
+
173};
+
+
176Vec<TmpEdge> inline CreateTmpEdges(const Vec<Halfedge>& halfedge) {
+
177 Vec<TmpEdge> edges(halfedge.size());
+
178 for_each_n(autoPolicy(edges.size()), countAt(0), edges.size(),
+
179 [&edges, &halfedge](const int idx) {
+
180 const Halfedge& half = halfedge[idx];
+
181 edges[idx] = TmpEdge(half.startVert, half.endVert,
+
182 half.IsForward() ? idx : -1);
+
183 });
+
184
+
185 size_t numEdge =
+
186 remove_if(edges.begin(), edges.end(),
+
187 [](const TmpEdge& edge) { return edge.halfedgeIdx < 0; }) -
+
188 edges.begin();
+
189 DEBUG_ASSERT(numEdge == halfedge.size() / 2, topologyErr, "Not oriented!");
+
190 edges.resize(numEdge);
+
191 return edges;
+
192}
+
193
+
194template <const bool inverted>
+
+ + +
197 SparseIndices& indices;
+
198
+
199 void operator()(size_t i) {
+
200 int& edge = indices.Get(i, inverted);
+
201 edge = edges[edge].halfedgeIdx;
+
202 }
+
203};
+
+
204
+
205#ifdef MANIFOLD_DEBUG
+
206inline std::ostream& operator<<(std::ostream& stream, const Halfedge& edge) {
+
207 return stream << "startVert = " << edge.startVert
+
208 << ", endVert = " << edge.endVert
+
209 << ", pairedHalfedge = " << edge.pairedHalfedge
+
210 << ", face = " << edge.face;
+
211}
+
212
+
213inline std::ostream& operator<<(std::ostream& stream, const Barycentric& bary) {
+
214 return stream << "tri = " << bary.tri << ", uvw = " << bary.uvw;
+
215}
+
216
+
217inline std::ostream& operator<<(std::ostream& stream, const TriRef& ref) {
+
218 return stream << "meshID: " << ref.meshID
+
219 << ", originalID: " << ref.originalID << ", tri: " << ref.tri;
+
220}
+
221#endif
+
222} // namespace manifold
+
Definition sparse.h:39
+
Definition vec.h:43
+
Definition vec_view.h:27
+
mat3x2 GetAxisAlignedProjection(vec3 normal)
Definition shared.h:51
+
Definition shared.h:134
+
Definition meshIO.h:20
+
Definition shared.h:123
+
Definition shared.h:195
+
Definition shared.h:160
+
Definition shared.h:139
+
int tri
Definition shared.h:149
+
int meshID
Definition shared.h:143
+
int originalID
Definition shared.h:146
+
Definition common.h:632
+
+
+ + + + diff --git a/docs/html/sparse_8h_source.html b/docs/html/sparse_8h_source.html new file mode 100644 index 000000000..0814fec89 --- /dev/null +++ b/docs/html/sparse_8h_source.html @@ -0,0 +1,329 @@ + + + + + + + +Manifold: sparse.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sparse.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <math.h>
+
17
+
18#include "manifold/common.h"
+
19#include "manifold/optional_assert.h"
+
20#include "manifold/parallel.h"
+
21#include "manifold/utils.h"
+
22#include "manifold/vec.h"
+
23
+
24namespace {
+
25template <typename T>
+
26inline bool FirstFinite(T v) {
+
27 return std::isfinite(v[0]);
+
28}
+
29
+
30template <>
+
31inline bool FirstFinite<double>(double v) {
+
32 return std::isfinite(v);
+
33}
+
34} // namespace
+
35
+
36namespace manifold {
+
37
+
+ +
40 // sparse indices where {p1: q1, p2: q2, ...} are laid out as
+
41 // p1 q1 p2 q2 or q1 p1 q2 p2, depending on endianness
+
42 // such that the indices are sorted by (p << 32) | q
+
43 public:
+
44#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
+
45 defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \
+
46 defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || \
+
47 defined(__MIBSEB__)
+
48 static constexpr size_t pOffset = 0;
+
49#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
+
50 defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \
+
51 defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \
+
52 defined(__MIPSEL) || defined(__MIPSEL__) || defined(__EMSCRIPTEN__) || \
+
53 defined(_WIN32)
+
54 static constexpr size_t pOffset = 1;
+
55#else
+
56#error "unknown architecture"
+
57#endif
+
58 static constexpr int64_t EncodePQ(int p, int q) {
+
59 return (int64_t(p) << 32) | q;
+
60 }
+
61
+
62 SparseIndices() = default;
+
63 SparseIndices(size_t size) { data_ = Vec<char>(size * sizeof(int64_t)); }
+
64
+
65 size_t size() const { return data_.size() / sizeof(int64_t); }
+
66
+
67 Vec<int> Copy(bool use_q) const {
+
68 Vec<int> out(size());
+
69 size_t offset = pOffset;
+
70 if (use_q) offset = 1 - offset;
+
71 const int* p = ptr();
+
72 for_each(autoPolicy(out.size()), countAt(0_uz), countAt(out.size()),
+
73 [&](size_t i) { out[i] = p[i * 2 + offset]; });
+
74 return out;
+
75 }
+
76
+
77 void Sort() {
+
78 VecView<int64_t> view = AsVec64();
+
79 stable_sort(view.begin(), view.end());
+
80 }
+
81
+
82 void Resize(size_t size) { data_.resize(size * sizeof(int64_t), -1); }
+
83
+
84 inline int& Get(size_t i, bool use_q) {
+
85 if (use_q)
+
86 return ptr()[2 * i + 1 - pOffset];
+
87 else
+
88 return ptr()[2 * i + pOffset];
+
89 }
+
90
+
91 inline int Get(size_t i, bool use_q) const {
+
92 if (use_q)
+
93 return ptr()[2 * i + 1 - pOffset];
+
94 else
+
95 return ptr()[2 * i + pOffset];
+
96 }
+
97
+
98 inline int64_t GetPQ(size_t i) const {
+
99 VecView<const int64_t> view = AsVec64();
+
100 return view[i];
+
101 }
+
102
+
103 inline void Set(size_t i, int p, int q) {
+
104 VecView<int64_t> view = AsVec64();
+
105 view[i] = EncodePQ(p, q);
+
106 }
+
107
+
108 inline void SetPQ(size_t i, int64_t pq) {
+
109 VecView<int64_t> view = AsVec64();
+
110 view[i] = pq;
+
111 }
+
112
+
113 VecView<int64_t> AsVec64() {
+
114 return VecView<int64_t>(reinterpret_cast<int64_t*>(data_.data()),
+
115 data_.size() / sizeof(int64_t));
+
116 }
+
117
+
118 VecView<const int64_t> AsVec64() const {
+ +
120 reinterpret_cast<const int64_t*>(data_.data()),
+
121 data_.size() / sizeof(int64_t));
+
122 }
+
123
+
124 VecView<int32_t> AsVec32() {
+
125 return VecView<int32_t>(reinterpret_cast<int32_t*>(data_.data()),
+
126 data_.size() / sizeof(int32_t));
+
127 }
+
128
+
129 VecView<const int32_t> AsVec32() const {
+ +
131 reinterpret_cast<const int32_t*>(data_.data()),
+
132 data_.size() / sizeof(int32_t));
+
133 }
+
134
+
135 inline void Add(int p, int q) {
+
136 for (unsigned int i = 0; i < sizeof(int64_t); ++i) data_.push_back(-1);
+
137 Set(size() - 1, p, q);
+
138 }
+
139
+
140 void Unique() {
+
141 Sort();
+
142 VecView<int64_t> view = AsVec64();
+
143 size_t newSize = unique(view.begin(), view.end()) - view.begin();
+
144 Resize(newSize);
+
145 }
+
146
+
147 size_t RemoveZeros(Vec<int>& S) {
+
148 DEBUG_ASSERT(S.size() == size(), userErr,
+
149 "Different number of values than indicies!");
+
150
+
151 Vec<size_t> new2Old(S.size());
+
152 sequence(new2Old.begin(), new2Old.end());
+
153
+
154 size_t size = copy_if(countAt(0_uz), countAt(S.size()), new2Old.begin(),
+
155 [&S](const size_t i) { return S[i] != 0; }) -
+
156 new2Old.begin();
+
157 new2Old.resize(size);
+
158
+
159 Permute(S, new2Old);
+
160 Vec<char> tmp(std::move(data_));
+
161 Resize(size);
+
162 gather(new2Old.begin(), new2Old.end(),
+
163 reinterpret_cast<int64_t*>(tmp.data()),
+
164 reinterpret_cast<int64_t*>(data_.data()));
+
165
+
166 return size;
+
167 }
+
168
+
169 template <typename T>
+
170 size_t KeepFinite(Vec<T>& v, Vec<int>& x) {
+
171 DEBUG_ASSERT(x.size() == size(), userErr,
+
172 "Different number of values than indicies!");
+
173
+
174 Vec<int> new2Old(v.size());
+
175 size_t size = copy_if(countAt(0_uz), countAt(v.size()), new2Old.begin(),
+
176 [&v](size_t i) { return FirstFinite(v[i]); }) -
+
177 new2Old.begin();
+
178 new2Old.resize(size);
+
179
+
180 Permute(v, new2Old);
+
181 Permute(x, new2Old);
+
182 Vec<char> tmp(std::move(data_));
+
183 Resize(size);
+
184 gather(new2Old.begin(), new2Old.end(),
+
185 reinterpret_cast<int64_t*>(tmp.data()),
+
186 reinterpret_cast<int64_t*>(data_.data()));
+
187
+
188 return size;
+
189 }
+
190
+
191#ifdef MANIFOLD_DEBUG
+
192 void Dump() const {
+
193 std::cout << "SparseIndices = " << std::endl;
+
194 const int* p = ptr();
+
195 for (size_t i = 0; i < size(); ++i) {
+
196 std::cout << i << ", p = " << Get(i, false) << ", q = " << Get(i, true)
+
197 << std::endl;
+
198 }
+
199 std::cout << std::endl;
+
200 }
+
201#endif
+
202
+
203 private:
+
204 Vec<char> data_;
+
205 inline int* ptr() { return reinterpret_cast<int32_t*>(data_.data()); }
+
206 inline const int* ptr() const {
+
207 return reinterpret_cast<const int32_t*>(data_.data());
+
208 }
+
209};
+
+
210
+
211} // namespace manifold
+
Definition sparse.h:39
+
Definition vec.h:43
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
Definition common.h:629
+
+
+ + + + diff --git a/docs/html/splitbar.png b/docs/html/splitbar.png new file mode 100644 index 000000000..fe895f2c5 Binary files /dev/null and b/docs/html/splitbar.png differ diff --git a/docs/html/splitbard.png b/docs/html/splitbard.png new file mode 100644 index 000000000..8367416d7 Binary files /dev/null and b/docs/html/splitbard.png differ diff --git a/docs/html/struct_cube_void-members.html b/docs/html/struct_cube_void-members.html new file mode 100644 index 000000000..c69600924 --- /dev/null +++ b/docs/html/struct_cube_void-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CubeVoid Member List
+
+
+ +

This is the complete list of members for CubeVoid, including all inherited members.

+ + +
operator()(vec3 p) const (defined in CubeVoid)CubeVoidinline
+
+ + + + diff --git a/docs/html/struct_cube_void.html b/docs/html/struct_cube_void.html new file mode 100644 index 000000000..163525684 --- /dev/null +++ b/docs/html/struct_cube_void.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: CubeVoid Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CubeVoid Struct Reference
+
+
+ + + + +

+Public Member Functions

+double operator() (vec3 p) const
 
+
+
+ + + + diff --git a/docs/html/struct_edge-members.html b/docs/html/struct_edge-members.html new file mode 100644 index 000000000..98dbbf3c7 --- /dev/null +++ b/docs/html/struct_edge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Edge Member List
+
+
+ +

This is the complete list of members for Edge, including all inherited members.

+ + + + + + + +
east (defined in Edge)Edge
Edge(const Polygons &polys, size_t i, size_t j) (defined in Edge)Edgeinline
i (defined in Edge)Edge
j (defined in Edge)Edge
operator<(const Edge &other) const (defined in Edge)Edgeinline
west (defined in Edge)Edge
+
+ + + + diff --git a/docs/html/struct_edge.html b/docs/html/struct_edge.html new file mode 100644 index 000000000..5598d867e --- /dev/null +++ b/docs/html/struct_edge.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: Edge Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + +

+Public Member Functions

+bool operator< (const Edge &other) const
 
Edge (const Polygons &polys, size_t i, size_t j)
 
+ + + + + + + + + +

+Public Attributes

+vec2 west
 
+vec2 east
 
+size_t i
 
+size_t j
 
+
+
+ + + + diff --git a/docs/html/struct_gyroid_s_d_f-members.html b/docs/html/struct_gyroid_s_d_f-members.html new file mode 100644 index 000000000..b4642ee05 --- /dev/null +++ b/docs/html/struct_gyroid_s_d_f-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
GyroidSDF Member List
+
+
+ +

This is the complete list of members for GyroidSDF, including all inherited members.

+ + +
operator()(vec3 p) const (defined in GyroidSDF)GyroidSDFinline
+
+ + + + diff --git a/docs/html/struct_gyroid_s_d_f.html b/docs/html/struct_gyroid_s_d_f.html new file mode 100644 index 000000000..1dd418c1d --- /dev/null +++ b/docs/html/struct_gyroid_s_d_f.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: GyroidSDF Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
GyroidSDF Struct Reference
+
+
+ + + + +

+Public Member Functions

+double operator() (vec3 p) const
 
+
+
+ + + + diff --git a/docs/html/struct_layers-members.html b/docs/html/struct_layers-members.html new file mode 100644 index 000000000..493295010 --- /dev/null +++ b/docs/html/struct_layers-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Layers Member List
+
+
+ +

This is the complete list of members for Layers, including all inherited members.

+ + +
operator()(vec3 p) const (defined in Layers)Layersinline
+
+ + + + diff --git a/docs/html/struct_layers.html b/docs/html/struct_layers.html new file mode 100644 index 000000000..8f63676f0 --- /dev/null +++ b/docs/html/struct_layers.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Layers Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Layers Struct Reference
+
+
+ + + + +

+Public Member Functions

+double operator() (vec3 p) const
 
+
+
+ + + + diff --git a/docs/html/struct_manifold_i_vec3-members.html b/docs/html/struct_manifold_i_vec3-members.html new file mode 100644 index 000000000..3166e4e5e --- /dev/null +++ b/docs/html/struct_manifold_i_vec3-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldIVec3 Member List
+
+
+ +

This is the complete list of members for ManifoldIVec3, including all inherited members.

+ + + + +
x (defined in ManifoldIVec3)ManifoldIVec3
y (defined in ManifoldIVec3)ManifoldIVec3
z (defined in ManifoldIVec3)ManifoldIVec3
+
+ + + + diff --git a/docs/html/struct_manifold_i_vec3.html b/docs/html/struct_manifold_i_vec3.html new file mode 100644 index 000000000..14c47aba7 --- /dev/null +++ b/docs/html/struct_manifold_i_vec3.html @@ -0,0 +1,171 @@ + + + + + + + +Manifold: ManifoldIVec3 Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldIVec3 Struct Reference
+
+
+ + + + + + + + +

+Public Attributes

+int x
 
+int y
 
+int z
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
int x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
int y
+
+ +
+
+ +

◆ z

+ +
+
+ + + + +
int z
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_manifold_manifold_pair-members.html b/docs/html/struct_manifold_manifold_pair-members.html new file mode 100644 index 000000000..1ac8c7b0f --- /dev/null +++ b/docs/html/struct_manifold_manifold_pair-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldManifoldPair Member List
+
+
+ +

This is the complete list of members for ManifoldManifoldPair, including all inherited members.

+ + + +
first (defined in ManifoldManifoldPair)ManifoldManifoldPair
second (defined in ManifoldManifoldPair)ManifoldManifoldPair
+
+ + + + diff --git a/docs/html/struct_manifold_manifold_pair.html b/docs/html/struct_manifold_manifold_pair.html new file mode 100644 index 000000000..c926dba27 --- /dev/null +++ b/docs/html/struct_manifold_manifold_pair.html @@ -0,0 +1,154 @@ + + + + + + + +Manifold: ManifoldManifoldPair Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldManifoldPair Struct Reference
+
+
+ + + + + + +

+Public Attributes

+ManifoldManifold * first
 
+ManifoldManifold * second
 
+

Member Data Documentation

+ +

◆ first

+ +
+
+ + + + +
ManifoldManifold* first
+
+ +
+
+ +

◆ second

+ +
+
+ + + + +
ManifoldManifold* second
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_manifold_properties-members.html b/docs/html/struct_manifold_properties-members.html new file mode 100644 index 000000000..a53e637ea --- /dev/null +++ b/docs/html/struct_manifold_properties-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldProperties Member List
+
+
+ +

This is the complete list of members for ManifoldProperties, including all inherited members.

+ + + +
surface_area (defined in ManifoldProperties)ManifoldProperties
volume (defined in ManifoldProperties)ManifoldProperties
+
+ + + + diff --git a/docs/html/struct_manifold_properties.html b/docs/html/struct_manifold_properties.html new file mode 100644 index 000000000..9493da029 --- /dev/null +++ b/docs/html/struct_manifold_properties.html @@ -0,0 +1,154 @@ + + + + + + + +Manifold: ManifoldProperties Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldProperties Struct Reference
+
+
+ + + + + + +

+Public Attributes

+double surface_area
 
+double volume
 
+

Member Data Documentation

+ +

◆ surface_area

+ +
+
+ + + + +
double surface_area
+
+ +
+
+ +

◆ volume

+ +
+
+ + + + +
double volume
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_manifold_vec2-members.html b/docs/html/struct_manifold_vec2-members.html new file mode 100644 index 000000000..a1962183e --- /dev/null +++ b/docs/html/struct_manifold_vec2-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec2 Member List
+
+
+ +

This is the complete list of members for ManifoldVec2, including all inherited members.

+ + + +
x (defined in ManifoldVec2)ManifoldVec2
y (defined in ManifoldVec2)ManifoldVec2
+
+ + + + diff --git a/docs/html/struct_manifold_vec2.html b/docs/html/struct_manifold_vec2.html new file mode 100644 index 000000000..3e1087f1f --- /dev/null +++ b/docs/html/struct_manifold_vec2.html @@ -0,0 +1,154 @@ + + + + + + + +Manifold: ManifoldVec2 Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldVec2 Struct Reference
+
+
+ + + + + + +

+Public Attributes

+double x
 
+double y
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
double x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
double y
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_manifold_vec3-members.html b/docs/html/struct_manifold_vec3-members.html new file mode 100644 index 000000000..bc7c1d818 --- /dev/null +++ b/docs/html/struct_manifold_vec3-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec3 Member List
+
+
+ +

This is the complete list of members for ManifoldVec3, including all inherited members.

+ + + + +
x (defined in ManifoldVec3)ManifoldVec3
y (defined in ManifoldVec3)ManifoldVec3
z (defined in ManifoldVec3)ManifoldVec3
+
+ + + + diff --git a/docs/html/struct_manifold_vec3.html b/docs/html/struct_manifold_vec3.html new file mode 100644 index 000000000..2526cb8b7 --- /dev/null +++ b/docs/html/struct_manifold_vec3.html @@ -0,0 +1,171 @@ + + + + + + + +Manifold: ManifoldVec3 Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldVec3 Struct Reference
+
+
+ + + + + + + + +

+Public Attributes

+double x
 
+double y
 
+double z
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
double x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
double y
+
+ +
+
+ +

◆ z

+ +
+
+ + + + +
double z
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_manifold_vec4-members.html b/docs/html/struct_manifold_vec4-members.html new file mode 100644 index 000000000..a4cf0cd9f --- /dev/null +++ b/docs/html/struct_manifold_vec4-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec4 Member List
+
+
+ +

This is the complete list of members for ManifoldVec4, including all inherited members.

+ + + + + +
w (defined in ManifoldVec4)ManifoldVec4
x (defined in ManifoldVec4)ManifoldVec4
y (defined in ManifoldVec4)ManifoldVec4
z (defined in ManifoldVec4)ManifoldVec4
+
+ + + + diff --git a/docs/html/struct_manifold_vec4.html b/docs/html/struct_manifold_vec4.html new file mode 100644 index 000000000..da363177d --- /dev/null +++ b/docs/html/struct_manifold_vec4.html @@ -0,0 +1,188 @@ + + + + + + + +Manifold: ManifoldVec4 Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ManifoldVec4 Struct Reference
+
+
+ + + + + + + + + + +

+Public Attributes

+double x
 
+double y
 
+double z
 
+double w
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
double x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
double y
+
+ +
+
+ +

◆ z

+ +
+
+ + + + +
double z
+
+ +
+
+ +

◆ w

+ +
+
+ + + + +
double w
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_mesh_size-members.html b/docs/html/struct_mesh_size-members.html new file mode 100644 index 000000000..d51339b5b --- /dev/null +++ b/docs/html/struct_mesh_size-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshSize Member List
+
+
+ +

This is the complete list of members for MeshSize, including all inherited members.

+ + + + + +
numProp (defined in MeshSize)MeshSize
numPropVert (defined in MeshSize)MeshSize
numTri (defined in MeshSize)MeshSize
numVert (defined in MeshSize)MeshSize
+
+ + + + diff --git a/docs/html/struct_mesh_size.html b/docs/html/struct_mesh_size.html new file mode 100644 index 000000000..6c4d437de --- /dev/null +++ b/docs/html/struct_mesh_size.html @@ -0,0 +1,188 @@ + + + + + + + +Manifold: MeshSize Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
MeshSize Struct Reference
+
+
+ + + + + + + + + + +

+Public Attributes

+int numVert
 
+int numTri
 
+int numProp = 0
 
+int numPropVert = numVert
 
+

Member Data Documentation

+ +

◆ numVert

+ +
+
+ + + + +
int numVert
+
+ +
+
+ +

◆ numTri

+ +
+
+ + + + +
int numTri
+
+ +
+
+ +

◆ numProp

+ +
+
+ + + + +
int numProp = 0
+
+ +
+
+ +

◆ numPropVert

+ +
+
+ + + + +
int numPropVert = numVert
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_options-members.html b/docs/html/struct_options-members.html new file mode 100644 index 000000000..915c13de0 --- /dev/null +++ b/docs/html/struct_options-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Options Member List
+
+
+ +

This is the complete list of members for Options, including all inherited members.

+ + + +
exportModels (defined in Options)Options
params (defined in Options)Options
+
+ + + + diff --git a/docs/html/struct_options.html b/docs/html/struct_options.html new file mode 100644 index 000000000..0c6e4c658 --- /dev/null +++ b/docs/html/struct_options.html @@ -0,0 +1,154 @@ + + + + + + + +Manifold: Options Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Options Struct Reference
+
+
+ + + + + + +

+Public Attributes

+bool exportModels = false
 
+manifold::ExecutionParams params = {}
 
+

Member Data Documentation

+ +

◆ exportModels

+ +
+
+ + + + +
bool exportModels = false
+
+ +
+
+ +

◆ params

+ +
+
+ + + + +
manifold::ExecutionParams params = {}
+
+ +
+
+
+
+ + + + diff --git a/docs/html/struct_result-members.html b/docs/html/struct_result-members.html new file mode 100644 index 000000000..eac9f9293 --- /dev/null +++ b/docs/html/struct_result-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Result Member List
+
+
+ +

This is the complete list of members for Result, including all inherited members.

+ + + +
name (defined in Result)Result
speedups (defined in Result)Result
+
+ + + + diff --git a/docs/html/struct_result.html b/docs/html/struct_result.html new file mode 100644 index 000000000..3ae3e3a41 --- /dev/null +++ b/docs/html/struct_result.html @@ -0,0 +1,154 @@ + + + + + + + +Manifold: Result Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Result Struct Reference
+
+
+ + + + + + +

+Public Attributes

+std::string name
 
+std::array< double, std::size(g_Sizes)> speedups
 
+

Member Data Documentation

+ +

◆ name

+ +
+
+ + + + +
std::string name
+
+ +
+
+ +

◆ speedups

+ +
+
+ + + + +
std::array<double, std::size(g_Sizes)> speedups
+
+ +
+
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1all__of-members.html b/docs/html/structbenchmarks_1_1all__of-members.html new file mode 100644 index 000000000..081056676 --- /dev/null +++ b/docs/html/structbenchmarks_1_1all__of-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
all_of< Policy > Member List
+
+
+ +

This is the complete list of members for all_of< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in all_of< Policy >)all_of< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1all__of.html b/docs/html/structbenchmarks_1_1all__of.html new file mode 100644 index 000000000..293a79bbf --- /dev/null +++ b/docs/html/structbenchmarks_1_1all__of.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: all_of< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
all_of< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy-members.html b/docs/html/structbenchmarks_1_1copy-members.html new file mode 100644 index 000000000..cac59a8c6 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
copy< Policy > Member List
+
+
+ +

This is the complete list of members for copy< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in copy< Policy >)copy< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy.html b/docs/html/structbenchmarks_1_1copy.html new file mode 100644 index 000000000..2bc13a2b1 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: copy< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
copy< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__1001-members.html b/docs/html/structbenchmarks_1_1copy__if__1001-members.html new file mode 100644 index 000000000..25006c07c --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__1001-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
copy_if_1001< Policy > Member List
+
+
+ +

This is the complete list of members for copy_if_1001< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in copy_if_1001< Policy >)copy_if_1001< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__1001.html b/docs/html/structbenchmarks_1_1copy__if__1001.html new file mode 100644 index 000000000..4fb63224b --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__1001.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: copy_if_1001< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
copy_if_1001< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__28-members.html b/docs/html/structbenchmarks_1_1copy__if__28-members.html new file mode 100644 index 000000000..73627c3c9 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__28-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
copy_if_28< Policy > Member List
+
+
+ +

This is the complete list of members for copy_if_28< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in copy_if_28< Policy >)copy_if_28< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__28.html b/docs/html/structbenchmarks_1_1copy__if__28.html new file mode 100644 index 000000000..0dc7acb05 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__28.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: copy_if_28< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
copy_if_28< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__55-members.html b/docs/html/structbenchmarks_1_1copy__if__55-members.html new file mode 100644 index 000000000..89e14b759 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__55-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
copy_if_55< Policy > Member List
+
+
+ +

This is the complete list of members for copy_if_55< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in copy_if_55< Policy >)copy_if_55< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__55.html b/docs/html/structbenchmarks_1_1copy__if__55.html new file mode 100644 index 000000000..bc925d8ad --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__55.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: copy_if_55< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
copy_if_55< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__82-members.html b/docs/html/structbenchmarks_1_1copy__if__82-members.html new file mode 100644 index 000000000..66e6009a8 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__82-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
copy_if_82< Policy > Member List
+
+
+ +

This is the complete list of members for copy_if_82< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in copy_if_82< Policy >)copy_if_82< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1copy__if__82.html b/docs/html/structbenchmarks_1_1copy__if__82.html new file mode 100644 index 000000000..5dbead428 --- /dev/null +++ b/docs/html/structbenchmarks_1_1copy__if__82.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: copy_if_82< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
copy_if_82< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1count-members.html b/docs/html/structbenchmarks_1_1count-members.html new file mode 100644 index 000000000..bdf993de7 --- /dev/null +++ b/docs/html/structbenchmarks_1_1count-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
count< Policy > Member List
+
+
+ +

This is the complete list of members for count< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in count< Policy >)count< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1count.html b/docs/html/structbenchmarks_1_1count.html new file mode 100644 index 000000000..b9ac2e42a --- /dev/null +++ b/docs/html/structbenchmarks_1_1count.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: count< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
count< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1exclusive__scan-members.html b/docs/html/structbenchmarks_1_1exclusive__scan-members.html new file mode 100644 index 000000000..d48db1635 --- /dev/null +++ b/docs/html/structbenchmarks_1_1exclusive__scan-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
exclusive_scan< Policy > Member List
+
+
+ +

This is the complete list of members for exclusive_scan< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in exclusive_scan< Policy >)exclusive_scan< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1exclusive__scan.html b/docs/html/structbenchmarks_1_1exclusive__scan.html new file mode 100644 index 000000000..0ff5a23ba --- /dev/null +++ b/docs/html/structbenchmarks_1_1exclusive__scan.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: exclusive_scan< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
exclusive_scan< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1fill-members.html b/docs/html/structbenchmarks_1_1fill-members.html new file mode 100644 index 000000000..b9a252529 --- /dev/null +++ b/docs/html/structbenchmarks_1_1fill-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
fill< Policy > Member List
+
+
+ +

This is the complete list of members for fill< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in fill< Policy >)fill< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1fill.html b/docs/html/structbenchmarks_1_1fill.html new file mode 100644 index 000000000..f6a4921b0 --- /dev/null +++ b/docs/html/structbenchmarks_1_1fill.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: fill< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
fill< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1for__each-members.html b/docs/html/structbenchmarks_1_1for__each-members.html new file mode 100644 index 000000000..23d9313b1 --- /dev/null +++ b/docs/html/structbenchmarks_1_1for__each-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
for_each< Policy > Member List
+
+
+ +

This is the complete list of members for for_each< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in for_each< Policy >)for_each< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1for__each.html b/docs/html/structbenchmarks_1_1for__each.html new file mode 100644 index 000000000..a59186456 --- /dev/null +++ b/docs/html/structbenchmarks_1_1for__each.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: for_each< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
for_each< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1reduce-members.html b/docs/html/structbenchmarks_1_1reduce-members.html new file mode 100644 index 000000000..80e1da52c --- /dev/null +++ b/docs/html/structbenchmarks_1_1reduce-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
reduce< Policy > Member List
+
+
+ +

This is the complete list of members for reduce< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in reduce< Policy >)reduce< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1reduce.html b/docs/html/structbenchmarks_1_1reduce.html new file mode 100644 index 000000000..1580a525a --- /dev/null +++ b/docs/html/structbenchmarks_1_1reduce.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: reduce< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
reduce< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc-members.html b/docs/html/structbenchmarks_1_1sort___asc-members.html new file mode 100644 index 000000000..281f2b2f2 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Asc< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Asc< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Asc< Policy >)sort_Asc< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc.html b/docs/html/structbenchmarks_1_1sort___asc.html new file mode 100644 index 000000000..ef001dbbc --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Asc< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Asc< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc__size-members.html b/docs/html/structbenchmarks_1_1sort___asc__size-members.html new file mode 100644 index 000000000..9882d45be --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc__size-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Asc_size< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Asc_size< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Asc_size< Policy >)sort_Asc_size< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc__size.html b/docs/html/structbenchmarks_1_1sort___asc__size.html new file mode 100644 index 000000000..3bb67f386 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc__size.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Asc_size< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Asc_size< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc__size__merge-members.html b/docs/html/structbenchmarks_1_1sort___asc__size__merge-members.html new file mode 100644 index 000000000..439897a25 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc__size__merge-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Asc_size_merge< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Asc_size_merge< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Asc_size_merge< Policy >)sort_Asc_size_merge< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___asc__size__merge.html b/docs/html/structbenchmarks_1_1sort___asc__size__merge.html new file mode 100644 index 000000000..1f7333557 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___asc__size__merge.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Asc_size_merge< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Asc_size_merge< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des-members.html b/docs/html/structbenchmarks_1_1sort___des-members.html new file mode 100644 index 000000000..55a730542 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Des< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Des< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Des< Policy >)sort_Des< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des.html b/docs/html/structbenchmarks_1_1sort___des.html new file mode 100644 index 000000000..a6b4efbd6 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Des< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Des< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des__size-members.html b/docs/html/structbenchmarks_1_1sort___des__size-members.html new file mode 100644 index 000000000..cb68e157c --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des__size-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Des_size< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Des_size< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Des_size< Policy >)sort_Des_size< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des__size.html b/docs/html/structbenchmarks_1_1sort___des__size.html new file mode 100644 index 000000000..12341f518 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des__size.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Des_size< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Des_size< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des__size__merge-members.html b/docs/html/structbenchmarks_1_1sort___des__size__merge-members.html new file mode 100644 index 000000000..da21a2da2 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des__size__merge-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Des_size_merge< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Des_size_merge< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Des_size_merge< Policy >)sort_Des_size_merge< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___des__size__merge.html b/docs/html/structbenchmarks_1_1sort___des__size__merge.html new file mode 100644 index 000000000..e8558f7d5 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___des__size__merge.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Des_size_merge< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Des_size_merge< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq-members.html b/docs/html/structbenchmarks_1_1sort___eq-members.html new file mode 100644 index 000000000..d2ae783a6 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Eq< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Eq< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Eq< Policy >)sort_Eq< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq.html b/docs/html/structbenchmarks_1_1sort___eq.html new file mode 100644 index 000000000..4a5cb854a --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Eq< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Eq< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq__size-members.html b/docs/html/structbenchmarks_1_1sort___eq__size-members.html new file mode 100644 index 000000000..15e0e2787 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq__size-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Eq_size< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Eq_size< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Eq_size< Policy >)sort_Eq_size< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq__size.html b/docs/html/structbenchmarks_1_1sort___eq__size.html new file mode 100644 index 000000000..1313348ba --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq__size.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Eq_size< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Eq_size< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq__size__merge-members.html b/docs/html/structbenchmarks_1_1sort___eq__size__merge-members.html new file mode 100644 index 000000000..f4fbbfe81 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq__size__merge-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Eq_size_merge< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Eq_size_merge< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Eq_size_merge< Policy >)sort_Eq_size_merge< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___eq__size__merge.html b/docs/html/structbenchmarks_1_1sort___eq__size__merge.html new file mode 100644 index 000000000..b85d1bea7 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___eq__size__merge.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Eq_size_merge< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Eq_size_merge< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd-members.html b/docs/html/structbenchmarks_1_1sort___rnd-members.html new file mode 100644 index 000000000..02dc7c8e5 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Rnd< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Rnd< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Rnd< Policy >)sort_Rnd< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd.html b/docs/html/structbenchmarks_1_1sort___rnd.html new file mode 100644 index 000000000..ac2833bf7 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Rnd< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Rnd< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd__size-members.html b/docs/html/structbenchmarks_1_1sort___rnd__size-members.html new file mode 100644 index 000000000..84048c88a --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd__size-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Rnd_size< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Rnd_size< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Rnd_size< Policy >)sort_Rnd_size< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd__size.html b/docs/html/structbenchmarks_1_1sort___rnd__size.html new file mode 100644 index 000000000..ab1cd3b86 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd__size.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Rnd_size< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Rnd_size< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd__size__merge-members.html b/docs/html/structbenchmarks_1_1sort___rnd__size__merge-members.html new file mode 100644 index 000000000..5610acf31 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd__size__merge-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_Rnd_size_merge< Policy > Member List
+
+
+ +

This is the complete list of members for sort_Rnd_size_merge< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_Rnd_size_merge< Policy >)sort_Rnd_size_merge< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort___rnd__size__merge.html b/docs/html/structbenchmarks_1_1sort___rnd__size__merge.html new file mode 100644 index 000000000..35bbe2773 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort___rnd__size__merge.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_Rnd_size_merge< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_Rnd_size_merge< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc-members.html b/docs/html/structbenchmarks_1_1sort__roughly___asc-members.html new file mode 100644 index 000000000..60bcac4b6 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_roughly_Asc< Policy > Member List
+
+
+ +

This is the complete list of members for sort_roughly_Asc< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_roughly_Asc< Policy >)sort_roughly_Asc< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc.html b/docs/html/structbenchmarks_1_1sort__roughly___asc.html new file mode 100644 index 000000000..bbe347528 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_roughly_Asc< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_roughly_Asc< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc__size-members.html b/docs/html/structbenchmarks_1_1sort__roughly___asc__size-members.html new file mode 100644 index 000000000..4ea319803 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc__size-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_roughly_Asc_size< Policy > Member List
+
+
+ +

This is the complete list of members for sort_roughly_Asc_size< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_roughly_Asc_size< Policy >)sort_roughly_Asc_size< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc__size.html b/docs/html/structbenchmarks_1_1sort__roughly___asc__size.html new file mode 100644 index 000000000..bb2ece4ff --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc__size.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_roughly_Asc_size< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_roughly_Asc_size< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge-members.html b/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge-members.html new file mode 100644 index 000000000..66216ec5a --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sort_roughly_Asc_size_merge< Policy > Member List
+
+
+ +

This is the complete list of members for sort_roughly_Asc_size_merge< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in sort_roughly_Asc_size_merge< Policy >)sort_roughly_Asc_size_merge< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge.html b/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge.html new file mode 100644 index 000000000..3cf63f1f1 --- /dev/null +++ b/docs/html/structbenchmarks_1_1sort__roughly___asc__size__merge.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: sort_roughly_Asc_size_merge< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
sort_roughly_Asc_size_merge< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1transform__reduce-members.html b/docs/html/structbenchmarks_1_1transform__reduce-members.html new file mode 100644 index 000000000..4eef6fea3 --- /dev/null +++ b/docs/html/structbenchmarks_1_1transform__reduce-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
transform_reduce< Policy > Member List
+
+
+ +

This is the complete list of members for transform_reduce< Policy >, including all inherited members.

+ + +
operator()(size_t size) (defined in transform_reduce< Policy >)transform_reduce< Policy >inline
+
+ + + + diff --git a/docs/html/structbenchmarks_1_1transform__reduce.html b/docs/html/structbenchmarks_1_1transform__reduce.html new file mode 100644 index 000000000..6c01a6279 --- /dev/null +++ b/docs/html/structbenchmarks_1_1transform__reduce.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: transform_reduce< Policy > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
transform_reduce< Policy > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+auto operator() (size_t size)
 
+
+
+ + + + diff --git a/docs/html/structglm__name.html b/docs/html/structglm__name.html new file mode 100644 index 000000000..0ccd8661a --- /dev/null +++ b/docs/html/structglm__name.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: glm_name< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< T > Struct Template Reference
+
+
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01ivec3_01_4-members.html b/docs/html/structglm__name_3_01ivec3_01_4-members.html new file mode 100644 index 000000000..f5620a5ee --- /dev/null +++ b/docs/html/structglm__name_3_01ivec3_01_4-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< ivec3 > Member List
+
+
+ +

This is the complete list of members for glm_name< ivec3 >, including all inherited members.

+ + + +
multi_name (defined in glm_name< ivec3 >)glm_name< ivec3 >static
name (defined in glm_name< ivec3 >)glm_name< ivec3 >static
+
+ + + + diff --git a/docs/html/structglm__name_3_01ivec3_01_4.html b/docs/html/structglm__name_3_01ivec3_01_4.html new file mode 100644 index 000000000..419e3f95e --- /dev/null +++ b/docs/html/structglm__name_3_01ivec3_01_4.html @@ -0,0 +1,125 @@ + + + + + + + +Manifold: glm_name< ivec3 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
glm_name< ivec3 > Struct Reference
+
+
+ + + + + + +

+Static Public Attributes

+static constexpr char const name [] = "Intx3"
 
+static constexpr char const multi_name [] = "IntNx3"
 
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01mat3x2_01_4-members.html b/docs/html/structglm__name_3_01mat3x2_01_4-members.html new file mode 100644 index 000000000..27f382631 --- /dev/null +++ b/docs/html/structglm__name_3_01mat3x2_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< mat3x2 > Member List
+
+
+ +

This is the complete list of members for glm_name< mat3x2 >, including all inherited members.

+ + +
name (defined in glm_name< mat3x2 >)glm_name< mat3x2 >static
+
+ + + + diff --git a/docs/html/structglm__name_3_01mat3x2_01_4.html b/docs/html/structglm__name_3_01mat3x2_01_4.html new file mode 100644 index 000000000..fa43dbfa4 --- /dev/null +++ b/docs/html/structglm__name_3_01mat3x2_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: glm_name< mat3x2 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
glm_name< mat3x2 > Struct Reference
+
+
+ + + + +

+Static Public Attributes

+static constexpr char const name [] = "Double2x3"
 
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01mat4x3_01_4-members.html b/docs/html/structglm__name_3_01mat4x3_01_4-members.html new file mode 100644 index 000000000..e86f0a42b --- /dev/null +++ b/docs/html/structglm__name_3_01mat4x3_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< mat4x3 > Member List
+
+
+ +

This is the complete list of members for glm_name< mat4x3 >, including all inherited members.

+ + +
name (defined in glm_name< mat4x3 >)glm_name< mat4x3 >static
+
+ + + + diff --git a/docs/html/structglm__name_3_01mat4x3_01_4.html b/docs/html/structglm__name_3_01mat4x3_01_4.html new file mode 100644 index 000000000..b93b2b849 --- /dev/null +++ b/docs/html/structglm__name_3_01mat4x3_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: glm_name< mat4x3 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
glm_name< mat4x3 > Struct Reference
+
+
+ + + + +

+Static Public Attributes

+static constexpr char const name [] = "Double3x4"
 
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01vec2_01_4-members.html b/docs/html/structglm__name_3_01vec2_01_4-members.html new file mode 100644 index 000000000..6bdeb7dd2 --- /dev/null +++ b/docs/html/structglm__name_3_01vec2_01_4-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< vec2 > Member List
+
+
+ +

This is the complete list of members for glm_name< vec2 >, including all inherited members.

+ + + +
multi_name (defined in glm_name< vec2 >)glm_name< vec2 >static
name (defined in glm_name< vec2 >)glm_name< vec2 >static
+
+ + + + diff --git a/docs/html/structglm__name_3_01vec2_01_4.html b/docs/html/structglm__name_3_01vec2_01_4.html new file mode 100644 index 000000000..1826d3beb --- /dev/null +++ b/docs/html/structglm__name_3_01vec2_01_4.html @@ -0,0 +1,125 @@ + + + + + + + +Manifold: glm_name< vec2 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
glm_name< vec2 > Struct Reference
+
+
+ + + + + + +

+Static Public Attributes

+static constexpr char const name [] = "Doublex2"
 
+static constexpr char const multi_name [] = "DoubleNx2"
 
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01vec3_01_4-members.html b/docs/html/structglm__name_3_01vec3_01_4-members.html new file mode 100644 index 000000000..03b490f39 --- /dev/null +++ b/docs/html/structglm__name_3_01vec3_01_4-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< vec3 > Member List
+
+
+ +

This is the complete list of members for glm_name< vec3 >, including all inherited members.

+ + + +
multi_name (defined in glm_name< vec3 >)glm_name< vec3 >static
name (defined in glm_name< vec3 >)glm_name< vec3 >static
+
+ + + + diff --git a/docs/html/structglm__name_3_01vec3_01_4.html b/docs/html/structglm__name_3_01vec3_01_4.html new file mode 100644 index 000000000..3de7fbf0d --- /dev/null +++ b/docs/html/structglm__name_3_01vec3_01_4.html @@ -0,0 +1,125 @@ + + + + + + + +Manifold: glm_name< vec3 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
glm_name< vec3 > Struct Reference
+
+
+ + + + + + +

+Static Public Attributes

+static constexpr char const name [] = "Doublex3"
 
+static constexpr char const multi_name [] = "DoubleNx3"
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_box-members.html b/docs/html/structmanifold_1_1_box-members.html new file mode 100644 index 000000000..0fef3c026 --- /dev/null +++ b/docs/html/structmanifold_1_1_box-members.html @@ -0,0 +1,133 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Box Member List
+
+
+ +

This is the complete list of members for Box, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
Box()Boxinline
Box(const vec3 p1, const vec3 p2)Boxinline
Center() constBoxinline
Contains(const vec3 &p) constBoxinline
Contains(const Box &box) constBoxinline
DoesOverlap(const Box &box) constBoxinline
DoesOverlap(vec3 p) constBoxinline
IsFinite() constBoxinline
max (defined in Box)Box
min (defined in Box)Box
operator*(vec3 scale) constBoxinline
operator*=(vec3 scale)Boxinline
operator+(vec3 shift) constBoxinline
operator+=(vec3 shift)Boxinline
Scale() constBoxinline
Size() constBoxinline
Transform(const mat4x3 &transform) constBoxinline
Union(const vec3 p)Boxinline
Union(const Box &box) constBoxinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_box.html b/docs/html/structmanifold_1_1_box.html new file mode 100644 index 000000000..f849d9d05 --- /dev/null +++ b/docs/html/structmanifold_1_1_box.html @@ -0,0 +1,630 @@ + + + + + + + +Manifold: Box Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Box ()
 
 Box (const vec3 p1, const vec3 p2)
 
vec3 Size () const
 
vec3 Center () const
 
double Scale () const
 
bool Contains (const vec3 &p) const
 
bool Contains (const Box &box) const
 
void Union (const vec3 p)
 
Box Union (const Box &box) const
 
Box Transform (const mat4x3 &transform) const
 
Box operator+ (vec3 shift) const
 
Boxoperator+= (vec3 shift)
 
Box operator* (vec3 scale) const
 
Boxoperator*= (vec3 scale)
 
bool DoesOverlap (const Box &box) const
 
bool DoesOverlap (vec3 p) const
 
bool IsFinite () const
 
+ + + + + +

+Public Attributes

+vec3 min = vec3(std::numeric_limits<double>::infinity())
 
+vec3 max = vec3(-std::numeric_limits<double>::infinity())
 
+

Constructor & Destructor Documentation

+ +

◆ Box() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Box ()
+
+inline
+
+

Default constructor is an infinite box that contains all space.

+ +
+
+ +

◆ Box() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Box (const vec3 p1,
const vec3 p2 
)
+
+inline
+
+

Creates a box that contains the two given points.

+ +
+
+

Member Function Documentation

+ +

◆ Size()

+ +
+
+ + + + + +
+ + + + + + + +
vec3 Size () const
+
+inline
+
+

Returns the dimensions of the Box.

+ +
+
+ +

◆ Center()

+ +
+
+ + + + + +
+ + + + + + + +
vec3 Center () const
+
+inline
+
+

Returns the center point of the Box.

+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + +
+ + + + + + + +
double Scale () const
+
+inline
+
+

Returns the absolute-largest coordinate value of any contained point.

+ +
+
+ +

◆ Contains() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const vec3 & p) const
+
+inline
+
+

Does this box contain (includes equal) the given point?

+ +
+
+ +

◆ Contains() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const Boxbox) const
+
+inline
+
+

Does this box contain (includes equal) the given box?

+ +
+
+ +

◆ Union() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
void Union (const vec3 p)
+
+inline
+
+

Expand this box to include the given point.

+ +
+
+ +

◆ Union() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
Box Union (const Boxbox) const
+
+inline
+
+

Expand this box to include the given box.

+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + +
+ + + + + + + + +
Box Transform (const mat4x3 & transform) const
+
+inline
+
+

Transform the given box by the given axis-aligned affine transform.

+

Ensure the transform passed in is axis-aligned (rotations are all multiples of 90 degrees), or else the resulting bounding box will no longer bound properly.

+ +
+
+ +

◆ operator+()

+ +
+
+ + + + + +
+ + + + + + + + +
Box operator+ (vec3 shift) const
+
+inline
+
+

Shift this box by the given vector.

+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + +
+ + + + + + + + +
Box & operator+= (vec3 shift)
+
+inline
+
+

Shift this box in-place by the given vector.

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + + +
Box operator* (vec3 scale) const
+
+inline
+
+

Scale this box by the given vector.

+ +
+
+ +

◆ operator*=()

+ +
+
+ + + + + +
+ + + + + + + + +
Box & operator*= (vec3 scale)
+
+inline
+
+

Scale this box in-place by the given vector.

+ +
+
+ +

◆ DoesOverlap() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool DoesOverlap (const Boxbox) const
+
+inline
+
+

Does this box overlap the one given (including equality)?

+ +
+
+ +

◆ DoesOverlap() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool DoesOverlap (vec3 p) const
+
+inline
+
+

Does the given point project within the XY extent of this box (including equality)?

+ +
+
+ +

◆ IsFinite()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsFinite () const
+
+inline
+
+

Does this box have finite bounds?

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_box.js b/docs/html/structmanifold_1_1_box.js new file mode 100644 index 000000000..6d125e0af --- /dev/null +++ b/docs/html/structmanifold_1_1_box.js @@ -0,0 +1,20 @@ +var structmanifold_1_1_box = +[ + [ "Box", "structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5", null ], + [ "Box", "structmanifold_1_1_box.html#a8258a064a735f0c191bab31d0775912d", null ], + [ "Size", "structmanifold_1_1_box.html#ac7f1d96c2e44bdff4079fd40802e2ac6", null ], + [ "Center", "structmanifold_1_1_box.html#ac600d9d9003333be36f390c84dead39e", null ], + [ "Scale", "structmanifold_1_1_box.html#ab30d1e52df44eb451081926df999fc17", null ], + [ "Contains", "structmanifold_1_1_box.html#aa51dc69603c0f65eca337672c9455b5c", null ], + [ "Contains", "structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d", null ], + [ "Union", "structmanifold_1_1_box.html#a9605138c461b1e437e59a71e1aa34653", null ], + [ "Union", "structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd", null ], + [ "Transform", "structmanifold_1_1_box.html#ac57a6312e33544515f782970a3b66eb6", null ], + [ "operator+", "structmanifold_1_1_box.html#af682637d259e4850c42bbe1d1ad98491", null ], + [ "operator+=", "structmanifold_1_1_box.html#ad243f3e9cd636fcd4dfe7c374d0e00c4", null ], + [ "operator*", "structmanifold_1_1_box.html#a0993fea81be0170878dfec3abce2e6dc", null ], + [ "operator*=", "structmanifold_1_1_box.html#ab0ec4bdbe1a152a83073874d2d62db67", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#aaa691916d71188bf3256e204393e8aa7", null ], + [ "IsFinite", "structmanifold_1_1_box.html#a33b7dcc502aae627fbc56bcfecf33af1", null ] +]; \ No newline at end of file diff --git a/docs/html/structmanifold_1_1_counting_iterator-members.html b/docs/html/structmanifold_1_1_counting_iterator-members.html new file mode 100644 index 000000000..427a9cf36 --- /dev/null +++ b/docs/html/structmanifold_1_1_counting_iterator-members.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CountingIterator< T > Member List
+
+
+ +

This is the complete list of members for CountingIterator< T >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + +
CountingIterator(T counter) (defined in CountingIterator< T >)CountingIterator< T >inline
difference_type typedef (defined in CountingIterator< T >)CountingIterator< T >
iterator_category typedef (defined in CountingIterator< T >)CountingIterator< T >
operator CountingIterator< const T >() const (defined in CountingIterator< T >)CountingIterator< T >inline
operator!= (defined in CountingIterator< T >)CountingIterator< T >friend
operator*() const (defined in CountingIterator< T >)CountingIterator< T >inline
operator+(T n) const (defined in CountingIterator< T >)CountingIterator< T >inline
operator++() (defined in CountingIterator< T >)CountingIterator< T >inline
operator++(int) (defined in CountingIterator< T >)CountingIterator< T >inline
operator+=(T n) (defined in CountingIterator< T >)CountingIterator< T >inline
operator-(T n) const (defined in CountingIterator< T >)CountingIterator< T >inline
operator- (defined in CountingIterator< T >)CountingIterator< T >friend
operator--() (defined in CountingIterator< T >)CountingIterator< T >inline
operator--(int) (defined in CountingIterator< T >)CountingIterator< T >inline
operator-=(T n) (defined in CountingIterator< T >)CountingIterator< T >inline
operator< (defined in CountingIterator< T >)CountingIterator< T >friend
operator== (defined in CountingIterator< T >)CountingIterator< T >friend
operator[](T i) const (defined in CountingIterator< T >)CountingIterator< T >inline
pointer typedef (defined in CountingIterator< T >)CountingIterator< T >
reference typedef (defined in CountingIterator< T >)CountingIterator< T >
value_type typedef (defined in CountingIterator< T >)CountingIterator< T >
+
+ + + + diff --git a/docs/html/structmanifold_1_1_counting_iterator.html b/docs/html/structmanifold_1_1_counting_iterator.html new file mode 100644 index 000000000..960bfc291 --- /dev/null +++ b/docs/html/structmanifold_1_1_counting_iterator.html @@ -0,0 +1,190 @@ + + + + + + + +Manifold: CountingIterator< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CountingIterator< T > Struct Template Reference
+
+
+ + + + + + + + + + + + +

+Public Types

+using pointer = void
 
+using reference = T
 
+using difference_type = std::make_signed_t< T >
 
+using value_type = T
 
+using iterator_category = std::random_access_iterator_tag
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CountingIterator (T counter)
 
+value_type operator* () const
 
+value_type operator[] (T i) const
 
+CountingIteratoroperator++ ()
 
+CountingIterator operator++ (int)
 
+CountingIteratoroperator-- ()
 
+CountingIterator operator-- (int)
 
+CountingIterator operator+ (T n) const
 
+CountingIteratoroperator+= (T n)
 
+CountingIterator operator- (T n) const
 
+CountingIteratoroperator-= (T n)
 
operator CountingIterator< const T > () const
 
+ + + + + + + + + +

+Friends

+bool operator== (CountingIterator a, CountingIterator b)
 
+bool operator!= (CountingIterator a, CountingIterator b)
 
+bool operator< (CountingIterator a, CountingIterator b)
 
+difference_type operator- (CountingIterator a, CountingIterator b)
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_halfedge-members.html b/docs/html/structmanifold_1_1_halfedge-members.html new file mode 100644 index 000000000..fb36d451e --- /dev/null +++ b/docs/html/structmanifold_1_1_halfedge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Halfedge Member List
+
+
+ +

This is the complete list of members for Halfedge, including all inherited members.

+ + + + + + + +
endVert (defined in Halfedge)Halfedge
face (defined in Halfedge)Halfedge
IsForward() const (defined in Halfedge)Halfedgeinline
operator<(const Halfedge &other) const (defined in Halfedge)Halfedgeinline
pairedHalfedge (defined in Halfedge)Halfedge
startVert (defined in Halfedge)Halfedge
+
+ + + + diff --git a/docs/html/structmanifold_1_1_halfedge.html b/docs/html/structmanifold_1_1_halfedge.html new file mode 100644 index 000000000..ccea238fa --- /dev/null +++ b/docs/html/structmanifold_1_1_halfedge.html @@ -0,0 +1,145 @@ + + + + + + + +Manifold: Halfedge Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ +

#include <shared.h>

+ + + + + + +

+Public Member Functions

+bool IsForward () const
 
+bool operator< (const Halfedge &other) const
 
+ + + + + + + + + +

+Public Attributes

+int startVert
 
+int endVert
 
+int pairedHalfedge
 
+int face
 
+

Detailed Description

+

The fundamental component of the halfedge data structure used for storing and operating on the Manifold.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_identity-members.html b/docs/html/structmanifold_1_1_identity-members.html new file mode 100644 index 000000000..1e5f6911d --- /dev/null +++ b/docs/html/structmanifold_1_1_identity-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Identity< T > Member List
+
+
+ +

This is the complete list of members for Identity< T >, including all inherited members.

+ + +
operator()(T v) const (defined in Identity< T >)Identity< T >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_identity.html b/docs/html/structmanifold_1_1_identity.html new file mode 100644 index 000000000..4435d66a2 --- /dev/null +++ b/docs/html/structmanifold_1_1_identity.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Identity< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Identity< T > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+T operator() (T v) const
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_manifold_1_1_impl-members.html b/docs/html/structmanifold_1_1_manifold_1_1_impl-members.html new file mode 100644 index 000000000..892fd5748 --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl-members.html @@ -0,0 +1,208 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Manifold::Impl Member List
+
+
+ +

This is the complete list of members for Manifold::Impl, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bBox_ (defined in Manifold::Impl)Manifold::Impl
CalculateBBox()Manifold::Impl
CalculateCurvature(int gaussianIdx, int meanIdx) (defined in Manifold::Impl)Manifold::Impl
CalculateNormals()Manifold::Impl
CleanupTopology()Manifold::Impl
CollapseEdge(int edge, std::vector< int > &edges) (defined in Manifold::Impl)Manifold::Impl
CollapseTri(const ivec3 &triEdge) (defined in Manifold::Impl)Manifold::Impl
collider_ (defined in Manifold::Impl)Manifold::Impl
CompactProps()Manifold::Impl
CreateFaces(const std::vector< double > &propertyTolerance={}) (defined in Manifold::Impl)Manifold::Impl
CreateHalfedges(const Vec< ivec3 > &triVerts)Manifold::Impl
CreateTangents(int normalIdx)Manifold::Impl
CreateTangents(std::vector< Smoothness >)Manifold::Impl
DedupeEdge(int edge) (defined in Manifold::Impl)Manifold::Impl
DistributeTangents(const Vec< bool > &fixedHalfedges)Manifold::Impl
EdgeCollisions(const Impl &B, bool inverted=false) constManifold::Impl
Face2Polygons(VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, mat3x2 projection) constManifold::Impl
Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)Manifold::Impl
faceNormal_ (defined in Manifold::Impl)Manifold::Impl
FillRetainedVerts(Vec< Barycentric > &vertBary) constManifold::Impl
Finish()Manifold::Impl
FlatFaces() const (defined in Manifold::Impl)Manifold::Impl
FormLoop(int current, int end) (defined in Manifold::Impl)Manifold::Impl
ForVert(int halfedge, std::function< void(int halfedge)> func) (defined in Manifold::Impl)Manifold::Implinline
ForVert(int halfedge, std::function< T(int halfedge)> transform, std::function< void(int halfedge, const T &here, T &next)> binaryOp) (defined in Manifold::Impl)Manifold::Implinline
GatherFaces(const Vec< int > &faceNew2Old)Manifold::Impl
GatherFaces(const Impl &old, const Vec< int > &faceNew2Old) (defined in Manifold::Impl)Manifold::Impl
GetFaceBoxMorton(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) constManifold::Impl
GetHalfedges(int tri) constManifold::Impl
GetIndices(int halfedge) constManifold::Impl
GetNeighbor(int tri) constManifold::Impl
GetNormal(int halfedge, int normalIdx) constManifold::Impl
GetProperties() const (defined in Manifold::Impl)Manifold::Impl
halfedge_ (defined in Manifold::Impl)Manifold::Impl
halfedgeTangent_ (defined in Manifold::Impl)Manifold::Impl
Hull(VecView< vec3 > vertPos) (defined in Manifold::Impl)Manifold::Impl
Impl() (defined in Manifold::Impl)Manifold::Implinline
Impl(Shape, const mat4x3=mat4x3(1))Manifold::Impl
Impl(const MeshGL &, std::vector< float > propertyTolerance={}) (defined in Manifold::Impl)Manifold::Impl
Impl(const Mesh &, const MeshRelationD &relation, const std::vector< double > &propertyTolerance={}, bool hasFaceIDs=false)Manifold::Impl
IncrementMeshIDs()Manifold::Impl
InitializeOriginal() (defined in Manifold::Impl)Manifold::Impl
Is2Manifold() constManifold::Impl
IsEmpty() const (defined in Manifold::Impl)Manifold::Implinline
IsFinite() constManifold::Impl
IsIndexInBounds(VecView< const ivec3 > triVerts) constManifold::Impl
IsInsideQuad(int halfedge) constManifold::Impl
IsManifold() constManifold::Impl
IsMarkedInsideQuad(int halfedge) constManifold::Impl
LinearizeFlatTangents()Manifold::Impl
MarkFailure(Error status) (defined in Manifold::Impl)Manifold::Impl
MatchesTriNormals() constManifold::Impl
meshIDCounter_ (defined in Manifold::Impl)Manifold::Implstatic
meshRelation_ (defined in Manifold::Impl)Manifold::Impl
MinGap(const Impl &other, double searchLength) const (defined in Manifold::Impl)Manifold::Impl
NumDegenerateTris() constManifold::Impl
NumEdge() const (defined in Manifold::Impl)Manifold::Implinline
NumProp() const (defined in Manifold::Impl)Manifold::Implinline
NumPropVert() const (defined in Manifold::Impl)Manifold::Implinline
NumTri() const (defined in Manifold::Impl)Manifold::Implinline
NumVert() const (defined in Manifold::Impl)Manifold::Implinline
PairUp(int edge0, int edge1) (defined in Manifold::Impl)Manifold::Impl
precision_ (defined in Manifold::Impl)Manifold::Impl
Project() const (defined in Manifold::Impl)Manifold::Impl
RecursiveEdgeSwap(int edge, int &tag, std::vector< int > &visited, std::vector< int > &edgeSwapStack, std::vector< int > &edges) (defined in Manifold::Impl)Manifold::Impl
Refine(std::function< int(vec3)>) (defined in Manifold::Impl)Manifold::Impl
ReindexVerts(const Vec< int > &vertNew2Old, size_t numOldVert)Manifold::Impl
RemoveIfFolded(int edge) (defined in Manifold::Impl)Manifold::Impl
RemoveUnreferencedVerts() (defined in Manifold::Impl)Manifold::Impl
ReserveIDs(uint32_t) (defined in Manifold::Impl)Manifold::Implstatic
SetNormals(int normalIdx, double minSharpAngle)Manifold::Impl
SetPrecision(double minPrecision=-1)Manifold::Impl
Shape enum name (defined in Manifold::Impl)Manifold::Impl
SharpenEdges(double minSharpAngle, double minSmoothness) const (defined in Manifold::Impl)Manifold::Impl
SharpenTangent(int halfedge, double smoothness)Manifold::Impl
SimplifyTopology()Manifold::Impl
Slice(double height) const (defined in Manifold::Impl)Manifold::Impl
SortFaces(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)Manifold::Impl
SortVerts()Manifold::Impl
SplitPinchedVerts() (defined in Manifold::Impl)Manifold::Impl
status_ (defined in Manifold::Impl)Manifold::Impl
Subdivide(std::function< int(vec3)>)Manifold::Impl
TangentFromNormal(const vec3 &normal, int halfedge) constManifold::Impl
Transform(const mat4x3 &transform) const (defined in Manifold::Impl)Manifold::Impl
Update()Manifold::Impl
UpdateSharpenedEdges(const std::vector< Smoothness > &) const (defined in Manifold::Impl)Manifold::Impl
UpdateVert(int vert, int startEdge, int endEdge) (defined in Manifold::Impl)Manifold::Impl
VertexCollisionsZ(VecView< const vec3 > vertsIn, bool inverted=false) constManifold::Impl
VertFlatFace(const Vec< bool > &) const (defined in Manifold::Impl)Manifold::Impl
VertHalfedge() const (defined in Manifold::Impl)Manifold::Impl
vertNormal_ (defined in Manifold::Impl)Manifold::Impl
vertPos_ (defined in Manifold::Impl)Manifold::Impl
Warp(std::function< void(vec3 &)> warpFunc) (defined in Manifold::Impl)Manifold::Impl
WarpBatch(std::function< void(VecView< vec3 >)> warpFunc) (defined in Manifold::Impl)Manifold::Impl
+
+ + + + diff --git a/docs/html/structmanifold_1_1_manifold_1_1_impl.html b/docs/html/structmanifold_1_1_manifold_1_1_impl.html new file mode 100644 index 000000000..c21673dda --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl.html @@ -0,0 +1,1446 @@ + + + + + + + +Manifold: Manifold::Impl Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + +

+Classes

struct  BaryIndices
 
struct  MeshRelationD
 
struct  Relation
 
+ + + +

+Public Types

enum class  Shape { Tetrahedron +, Cube +, Octahedron + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Impl (Shape, const mat4x3=mat4x3(1))
 
Impl (const MeshGL &, std::vector< float > propertyTolerance={})
 
 Impl (const Mesh &, const MeshRelationD &relation, const std::vector< double > &propertyTolerance={}, bool hasFaceIDs=false)
 
+void ForVert (int halfedge, std::function< void(int halfedge)> func)
 
+template<typename T >
void ForVert (int halfedge, std::function< T(int halfedge)> transform, std::function< void(int halfedge, const T &here, T &next)> binaryOp)
 
+void CreateFaces (const std::vector< double > &propertyTolerance={})
 
+void RemoveUnreferencedVerts ()
 
+void InitializeOriginal ()
 
void CreateHalfedges (const Vec< ivec3 > &triVerts)
 
void CalculateNormals ()
 
void IncrementMeshIDs ()
 
void Update ()
 
+void MarkFailure (Error status)
 
+void Warp (std::function< void(vec3 &)> warpFunc)
 
+void WarpBatch (std::function< void(VecView< vec3 >)> warpFunc)
 
+Impl Transform (const mat4x3 &transform) const
 
SparseIndices EdgeCollisions (const Impl &B, bool inverted=false) const
 
SparseIndices VertexCollisionsZ (VecView< const vec3 > vertsIn, bool inverted=false) const
 
+bool IsEmpty () const
 
+size_t NumVert () const
 
+size_t NumEdge () const
 
+size_t NumTri () const
 
+size_t NumProp () const
 
+size_t NumPropVert () const
 
+Properties GetProperties () const
 
+void CalculateCurvature (int gaussianIdx, int meanIdx)
 
void CalculateBBox ()
 
bool IsFinite () const
 
bool IsIndexInBounds (VecView< const ivec3 > triVerts) const
 
void SetPrecision (double minPrecision=-1)
 
bool IsManifold () const
 
bool Is2Manifold () const
 
bool MatchesTriNormals () const
 
int NumDegenerateTris () const
 
+double MinGap (const Impl &other, double searchLength) const
 
void Finish ()
 
void SortVerts ()
 
void ReindexVerts (const Vec< int > &vertNew2Old, size_t numOldVert)
 
void CompactProps ()
 
void GetFaceBoxMorton (Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) const
 
void SortFaces (Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)
 
void GatherFaces (const Vec< int > &faceNew2Old)
 
+void GatherFaces (const Impl &old, const Vec< int > &faceNew2Old)
 
void Face2Tri (const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)
 
PolygonsIdx Face2Polygons (VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, mat3x2 projection) const
 
+Polygons Slice (double height) const
 
+Polygons Project () const
 
void CleanupTopology ()
 
void SimplifyTopology ()
 
+void DedupeEdge (int edge)
 
+void CollapseEdge (int edge, std::vector< int > &edges)
 
+void RecursiveEdgeSwap (int edge, int &tag, std::vector< int > &visited, std::vector< int > &edgeSwapStack, std::vector< int > &edges)
 
+void RemoveIfFolded (int edge)
 
+void PairUp (int edge0, int edge1)
 
+void UpdateVert (int vert, int startEdge, int endEdge)
 
+void FormLoop (int current, int end)
 
+void CollapseTri (const ivec3 &triEdge)
 
+void SplitPinchedVerts ()
 
int GetNeighbor (int tri) const
 
ivec4 GetHalfedges (int tri) const
 
BaryIndices GetIndices (int halfedge) const
 
void FillRetainedVerts (Vec< Barycentric > &vertBary) const
 
Vec< BarycentricSubdivide (std::function< int(vec3)>)
 
bool IsInsideQuad (int halfedge) const
 
bool IsMarkedInsideQuad (int halfedge) const
 
vec3 GetNormal (int halfedge, int normalIdx) const
 
vec4 TangentFromNormal (const vec3 &normal, int halfedge) const
 
+std::vector< SmoothnessUpdateSharpenedEdges (const std::vector< Smoothness > &) const
 
+Vec< bool > FlatFaces () const
 
+Vec< int > VertFlatFace (const Vec< bool > &) const
 
+Vec< int > VertHalfedge () const
 
+std::vector< SmoothnessSharpenEdges (double minSharpAngle, double minSmoothness) const
 
void SharpenTangent (int halfedge, double smoothness)
 
void SetNormals (int normalIdx, double minSharpAngle)
 
void LinearizeFlatTangents ()
 
void DistributeTangents (const Vec< bool > &fixedHalfedges)
 
void CreateTangents (int normalIdx)
 
void CreateTangents (std::vector< Smoothness >)
 
+void Refine (std::function< int(vec3)>)
 
+void Hull (VecView< vec3 > vertPos)
 
+ + + +

+Static Public Member Functions

+static uint32_t ReserveIDs (uint32_t)
 
+ + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

+Box bBox_
 
+double precision_ = -1
 
+Error status_ = Error::NoError
 
+Vec< vec3 > vertPos_
 
+Vec< Halfedgehalfedge_
 
+Vec< vec3 > vertNormal_
 
+Vec< vec3 > faceNormal_
 
+Vec< vec4 > halfedgeTangent_
 
+MeshRelationD meshRelation_
 
+Collider collider_
 
+ + + +

+Static Public Attributes

+static std::atomic< uint32_t > meshIDCounter_
 
+

Class Documentation

+ +

◆ manifold::Manifold::Impl::BaryIndices

+ +
+
+ + + + +
struct manifold::Manifold::Impl::BaryIndices
+
+
+ + + + + + + + + + +
Class Members
+int +tri +
+int +start4 +
+int +end4 +
+ +
+
+ +

◆ manifold::Manifold::Impl::MeshRelationD

+ +
+
+ + + + +
struct manifold::Manifold::Impl::MeshRelationD
+
+
+ + + + + + + + + + + + + + + + + + + +
Class Members
+int +originalID = -1 +The originalID of this Manifold if it is an original; -1 otherwise.
+int +numProp = 0 +
+Vec< double > +properties +
+map< int, Relation > +meshIDtransform +
+Vec< TriRef > +triRef +
+Vec< ivec3 > +triProperties +
+ +
+
+ +

◆ manifold::Manifold::Impl::Relation

+ +
+
+ + + + +
struct manifold::Manifold::Impl::Relation
+
+
+ + + + + + + + + + +
Class Members
+int +originalID = -1 +
+mat4x3 +transform = mat4x3(1) +
+bool +backSide = false +
+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Impl() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
Impl (Shape shape,
const mat4x3 m = mat4x3(1) 
)
+
+

Create either a unit tetrahedron, cube or octahedron. The cube is in the first octant, while the others are symmetric about the origin.

+ +
+
+ +

◆ Impl() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Impl (const Meshmesh,
const MeshRelationDrelation,
const std::vector< double > & propertyTolerance = {},
bool hasFaceIDs = false 
)
+
+

Create a manifold from an input triangle Mesh. Will return an empty Manifold and set an Error Status if the Mesh is not manifold or otherwise invalid. TODO: update halfedgeTangent during SimplifyTopology.

+ +
+
+

Member Function Documentation

+ +

◆ CreateHalfedges()

+ +
+
+ + + + + + + + +
void CreateHalfedges (const Vec< ivec3 > & triVerts)
+
+

Create the halfedge_ data structure from an input triVerts array like Mesh.

+ +
+
+ +

◆ CalculateNormals()

+ +
+
+ + + + + + + +
void CalculateNormals ()
+
+

If face normals are already present, this function uses them to compute vertex normals (angle-weighted pseudo-normals); otherwise it also computes the face normals. Face normals are only calculated when needed because nearly degenerate faces will accrue rounding error, while the Boolean can retain their original normal, which is more accurate and can help with merging coplanar faces.

+

If the face normals have been invalidated by an operation like Warp(), ensure you do faceNormal_.resize(0) before calling this function to force recalculation.

+ +
+
+ +

◆ IncrementMeshIDs()

+ +
+
+ + + + + + + +
void IncrementMeshIDs ()
+
+

Remaps all the contained meshIDs to new unique values to represent new instances of these meshes.

+ +
+
+ +

◆ Update()

+ +
+
+ + + + + + + +
void Update ()
+
+

Does a full recalculation of the face bounding boxes, including updating the collider, but does not resort the faces.

+ +
+
+ +

◆ EdgeCollisions()

+ +
+
+ + + + + + + + + + + + + + + + + + +
SparseIndices EdgeCollisions (const ImplQ,
bool inverted = false 
) const
+
+

Returns a sparse array of the bounding box overlaps between the edges of the input manifold, Q and the faces of this manifold. Returned indices only point to forward halfedges.

+ +
+
+ +

◆ VertexCollisionsZ()

+ +
+
+ + + + + + + + + + + + + + + + + + +
SparseIndices VertexCollisionsZ (VecView< const vec3 > vertsIn,
bool inverted = false 
) const
+
+

Returns a sparse array of the input vertices that project inside the XY bounding boxes of the faces of this manifold.

+ +
+
+ +

◆ CalculateBBox()

+ +
+
+ + + + + + + +
void CalculateBBox ()
+
+

Calculates the bounding box of the entire manifold, which is stored internally to short-cut Boolean operations and to serve as the precision range for Morton code calculation. Ignores NaNs.

+ +
+
+ +

◆ IsFinite()

+ +
+
+ + + + + + + +
bool IsFinite () const
+
+

Determines if all verts are finite. Checking just the bounding box dimensions is insufficient as it ignores NaNs.

+ +
+
+ +

◆ IsIndexInBounds()

+ +
+
+ + + + + + + + +
bool IsIndexInBounds (VecView< const ivec3 > triVerts) const
+
+

Checks that the input triVerts array has all indices inside bounds of the vertPos_ array.

+ +
+
+ +

◆ SetPrecision()

+ +
+
+ + + + + + + + +
void SetPrecision (double minPrecision = -1)
+
+

Sets the precision based on the bounding box, and limits its minimum value by the optional input.

+ +
+
+ +

◆ IsManifold()

+ +
+
+ + + + + + + +
bool IsManifold () const
+
+

Returns true if this manifold is in fact an oriented even manifold and all of the data structures are consistent.

+ +
+
+ +

◆ Is2Manifold()

+ +
+
+ + + + + + + +
bool Is2Manifold () const
+
+

Returns true if this manifold is in fact an oriented 2-manifold and all of the data structures are consistent.

+ +
+
+ +

◆ MatchesTriNormals()

+ +
+
+ + + + + + + +
bool MatchesTriNormals () const
+
+

Returns true if all triangles are CCW relative to their triNormals_.

+ +
+
+ +

◆ NumDegenerateTris()

+ +
+
+ + + + + + + +
int NumDegenerateTris () const
+
+

Returns the number of triangles that are colinear within precision_.

+ +
+
+ +

◆ Finish()

+ +
+
+ + + + + + + +
void Finish ()
+
+

Once halfedge_ has been filled in, this function can be called to create the rest of the internal data structures. This function also removes the verts and halfedges flagged for removal (NaN verts and -1 halfedges).

+ +
+
+ +

◆ SortVerts()

+ +
+
+ + + + + + + +
void SortVerts ()
+
+

Sorts the vertices according to their Morton code.

+ +
+
+ +

◆ ReindexVerts()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ReindexVerts (const Vec< int > & vertNew2Old,
size_t oldNumVert 
)
+
+

Updates the halfedges to point to new vert indices based on a mapping, vertNew2Old. This may be a subset, so the total number of original verts is also given.

+ +
+
+ +

◆ CompactProps()

+ +
+
+ + + + + + + +
void CompactProps ()
+
+

Removes unreferenced property verts and reindexes triProperties.

+ +
+
+ +

◆ GetFaceBoxMorton()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void GetFaceBoxMorton (Vec< Box > & faceBox,
Vec< uint32_t > & faceMorton 
) const
+
+

Fills the faceBox and faceMorton input with the bounding boxes and Morton codes of the faces, respectively. The Morton code is based on the center of the bounding box.

+ +
+
+ +

◆ SortFaces()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void SortFaces (Vec< Box > & faceBox,
Vec< uint32_t > & faceMorton 
)
+
+

Sorts the faces of this manifold according to their input Morton code. The bounding box and Morton code arrays are also sorted accordingly.

+ +
+
+ +

◆ GatherFaces()

+ +
+
+ + + + + + + + +
void GatherFaces (const Vec< int > & faceNew2Old)
+
+

Creates the halfedge_ vector for this manifold by copying a set of faces from another manifold, given by oldHalfedge. Input faceNew2Old defines the old faces to gather into this.

+ +
+
+ +

◆ Face2Tri()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void Face2Tri (const Vec< int > & faceEdge,
const Vec< TriRef > & halfedgeRef 
)
+
+

Triangulates the faces. In this case, the halfedge_ vector is not yet a set of triangles as required by this data structure, but is instead a set of general faces with the input faceEdge vector having length of the number of faces + 1. The values are indicies into the halfedge_ vector for the first edge of each face, with the final value being the length of the halfedge_ vector itself. Upon return, halfedge_ has been lengthened and properly represents the mesh as a set of triangles as usual. In this process the faceNormal_ values are retained, repeated as necessary.

+ +
+
+ +

◆ Face2Polygons()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PolygonsIdx Face2Polygons (VecView< Halfedge >::IterC start,
VecView< Halfedge >::IterC end,
mat3x2 projection 
) const
+
+

Returns a set of 2D polygons formed by the input projection of the vertices of the list of Halfedges, which must be an even-manifold, meaning each vert must be referenced the same number of times as a startVert and endVert.

+ +
+
+ +

◆ CleanupTopology()

+ +
+
+ + + + + + + +
void CleanupTopology ()
+
+

Duplicates just enough verts to covert an even-manifold to a proper 2-manifold, splitting non-manifold verts and edges with too many triangles.

+ +
+
+ +

◆ SimplifyTopology()

+ +
+
+ + + + + + + +
void SimplifyTopology ()
+
+

Collapses degenerate triangles by removing edges shorter than precision_ and any edge that is preceeded by an edge that joins the same two face relations. It also performs edge swaps on the long edges of degenerate triangles, though there are some configurations of degenerates that cannot be removed this way.

+

Before collapsing edges, the mesh is checked for duplicate edges (more than one pair of triangles sharing the same edge), which are removed by duplicating one vert and adding two triangles. These degenerate triangles are likely to be collapsed again in the subsequent simplification.

+

Note when an edge collapse would result in something non-manifold, the vertices are duplicated in such a way as to remove handles or separate meshes, thus decreasing the Genus(). It only increases when meshes that have collapsed to just a pair of triangles are removed entirely.

+

Rather than actually removing the edges, this step merely marks them for removal, by setting vertPos to NaN and halfedge to {-1, -1, -1, -1}.

+ +
+
+ +

◆ GetNeighbor()

+ +
+
+ + + + + + + + +
int GetNeighbor (int tri) const
+
+

Returns the tri side index (0-2) connected to the other side of this quad if this tri is part of a quad, or -1 otherwise.

+ +
+
+ +

◆ GetHalfedges()

+ +
+
+ + + + + + + + +
ivec4 GetHalfedges (int tri) const
+
+

For the given triangle index, returns either the three halfedge indices of that triangle and halfedges[3] = -1, or if the triangle is part of a quad, it returns those four indices. If the triangle is part of a quad and is not the lower of the two triangle indices, it returns all -1s.

+ +
+
+ +

◆ GetIndices()

+ +
+
+ + + + + + + + +
Manifold::Impl::BaryIndices GetIndices (int halfedge) const
+
+

Returns the BaryIndices, which gives the tri and indices (0-3), such that GetHalfedges(val.tri)[val.start4] points back to this halfedge, and val.end4 will point to the next one. This function handles this for both triangles and quads. Returns {-1, -1, -1} if the edge is the interior of a quad.

+ +
+
+ +

◆ FillRetainedVerts()

+ +
+
+ + + + + + + + +
void FillRetainedVerts (Vec< Barycentric > & vertBary) const
+
+

Retained verts are part of several triangles, and it doesn't matter which one the vertBary refers to. Here, whichever is last will win and it's done on the CPU for simplicity for now. Using AtomicCAS on .tri should work for a GPU version if desired.

+ +
+
+ +

◆ Subdivide()

+ +
+
+ + + + + + + + +
Vec< Barycentric > Subdivide (std::function< int(vec3)> edgeDivisions)
+
+

Split each edge into n pieces as defined by calling the edgeDivisions function, and sub-triangulate each triangle accordingly. This function doesn't run Finish(), as that is expensive and it'll need to be run after the new vertices have moved, which is a likely scenario after refinement (smoothing).

+ +
+
+ +

◆ IsInsideQuad()

+ +
+
+ + + + + + + + +
bool IsInsideQuad (int halfedge) const
+
+

Returns true if this halfedge should be marked as the interior of a quad, as defined by its two triangles referring to the same face, and those triangles having no further face neighbors beyond.

+ +
+
+ +

◆ IsMarkedInsideQuad()

+ +
+
+ + + + + + + + +
bool IsMarkedInsideQuad (int halfedge) const
+
+

Returns true if this halfedge is an interior of a quad, as defined by its halfedge tangent having negative weight.

+ +
+
+ +

◆ GetNormal()

+ +
+
+ + + + + + + + + + + + + + + + + + +
vec3 GetNormal (int halfedge,
int normalIdx 
) const
+
+

Get the property normal associated with the startVert of this halfedge, where normalIdx shows the beginning of where normals are stored in the properties.

+ +
+
+ +

◆ TangentFromNormal()

+ +
+
+ + + + + + + + + + + + + + + + + + +
vec4 TangentFromNormal (const vec3 & normal,
int halfedge 
) const
+
+

Returns a circular tangent for the requested halfedge, orthogonal to the given normal vector, and avoiding folding.

+ +
+
+ +

◆ SharpenTangent()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void SharpenTangent (int halfedge,
double smoothness 
)
+
+

Sharpen tangents that intersect an edge to sharpen that edge. The weight is unchanged, as this has a squared effect on radius of curvature, except in the case of zero radius, which is marked with weight = 0.

+ +
+
+ +

◆ SetNormals()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void SetNormals (int normalIdx,
double minSharpAngle 
)
+
+

Instead of calculating the internal shared normals like CalculateNormals does, this method fills in vertex properties, unshared across edges that are bent more than minSharpAngle.

+ +
+
+ +

◆ LinearizeFlatTangents()

+ +
+
+ + + + + + + +
void LinearizeFlatTangents ()
+
+

Tangents get flattened to create sharp edges by setting their weight to zero. This is the natural limit of reducing the weight to increase the sharpness smoothly. This limit gives a decent shape, but it causes the parameterization to be stretched and compresses it near the edges, which is good for resolving tight curvature, but bad for property interpolation. This function fixes the parameter stretch at the limit for sharp edges, since there is no curvature to resolve. Note this also changes the overall shape - making it more evenly curved.

+ +
+
+ +

◆ DistributeTangents()

+ +
+
+ + + + + + + + +
void DistributeTangents (const Vec< bool > & fixedHalfedges)
+
+

Redistribute the tangents around each vertex so that the angles between them have the same ratios as the angles of the triangles between the corresponding edges. This avoids folding the output shape and gives smoother results. There must be at least one fixed halfedge on a vertex for that vertex to be operated on. If there is only one, then that halfedge is not treated as fixed, but the whole circle is turned to an average orientation.

+ +
+
+ +

◆ CreateTangents() [1/2]

+ +
+
+ + + + + + + + +
void CreateTangents (int normalIdx)
+
+

Calculates halfedgeTangent_, allowing the manifold to be refined and smoothed. The tangents form weighted cubic Beziers along each edge. This function creates circular arcs where possible (minimizing maximum curvature), constrained to the indicated property normals. Across edges that form discontinuities in the normals, the tangent vectors are zero-length, allowing the shape to form a sharp corner with minimal oscillation.

+ +
+
+ +

◆ CreateTangents() [2/2]

+ +
+
+ + + + + + + + +
void CreateTangents (std::vector< SmoothnesssharpenedEdges)
+
+

Calculates halfedgeTangent_, allowing the manifold to be refined and smoothed. The tangents form weighted cubic Beziers along each edge. This function creates circular arcs where possible (minimizing maximum curvature), constrained to the vertex normals. Where sharpenedEdges are specified, the tangents are shortened that intersect the sharpened edge, concentrating the curvature there, while the tangents of the sharp edges themselves are aligned for continuity.

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_builder_1_1_face-members.html b/docs/html/structmanifold_1_1_mesh_builder_1_1_face-members.html new file mode 100644 index 000000000..e1ccabc33 --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_builder_1_1_face-members.html @@ -0,0 +1,127 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshBuilder::Face Member List
+
+
+ +

This is the complete list of members for MeshBuilder::Face, including all inherited members.

+ + + + + + + + + + + + + + +
disable() (defined in MeshBuilder::Face)MeshBuilder::Faceinline
Face(size_t he) (defined in MeshBuilder::Face)MeshBuilder::Faceinline
Face() (defined in MeshBuilder::Face)MeshBuilder::Faceinline
he (defined in MeshBuilder::Face)MeshBuilder::Face
horizonEdgesOnCurrentIteration (defined in MeshBuilder::Face)MeshBuilder::Face
inFaceStack (defined in MeshBuilder::Face)MeshBuilder::Face
isDisabled() const (defined in MeshBuilder::Face)MeshBuilder::Faceinline
isVisibleFaceOnCurrentIteration (defined in MeshBuilder::Face)MeshBuilder::Face
mostDistantPoint (defined in MeshBuilder::Face)MeshBuilder::Face
mostDistantPointDist (defined in MeshBuilder::Face)MeshBuilder::Face
P (defined in MeshBuilder::Face)MeshBuilder::Face
pointsOnPositiveSide (defined in MeshBuilder::Face)MeshBuilder::Face
visibilityCheckedOnIteration (defined in MeshBuilder::Face)MeshBuilder::Face
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_builder_1_1_face.html b/docs/html/structmanifold_1_1_mesh_builder_1_1_face.html new file mode 100644 index 000000000..e5f6fbc1f --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_builder_1_1_face.html @@ -0,0 +1,159 @@ + + + + + + + +Manifold: MeshBuilder::Face Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
MeshBuilder::Face Struct Reference
+
+
+ + + + + + + + +

+Public Member Functions

Face (size_t he)
 
+void disable ()
 
+bool isDisabled () const
 
+ + + + + + + + + + + + + + + + + + + +

+Public Attributes

+int he
 
+Plane P {}
 
+double mostDistantPointDist = 0.0
 
+size_t mostDistantPoint = 0
 
+size_t visibilityCheckedOnIteration = 0
 
+std::uint8_t isVisibleFaceOnCurrentIteration: 1
 
+std::uint8_t inFaceStack: 1
 
+std::uint8_t horizonEdgesOnCurrentIteration: 3
 
+std::unique_ptr< Vec< size_t > > pointsOnPositiveSide
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_g_l-members.html b/docs/html/structmanifold_1_1_mesh_g_l-members.html new file mode 100644 index 000000000..376b11fd4 --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_g_l-members.html @@ -0,0 +1,130 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshGL Member List
+
+
+ +

This is the complete list of members for MeshGL, including all inherited members.

+ + + + + + + + + + + + + + + + + +
faceIDMeshGL
halfedgeTangentMeshGL
Merge()MeshGL
mergeFromVertMeshGL
mergeToVertMeshGL
MeshGL()=default (defined in MeshGL)MeshGL
MeshGL(const Mesh &mesh)MeshGL
numPropMeshGL
NumTri() constMeshGLinline
NumVert() constMeshGLinline
precisionMeshGL
runIndexMeshGL
runOriginalIDMeshGL
runTransformMeshGL
triVertsMeshGL
vertPropertiesMeshGL
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_g_l.html b/docs/html/structmanifold_1_1_mesh_g_l.html new file mode 100644 index 000000000..2fefc7d8b --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_g_l.html @@ -0,0 +1,336 @@ + + + + + + + +Manifold: MeshGL Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ +

#include <manifold.h>

+ + + + + + + + + + + + + +

+Public Member Functions

+uint32_t NumVert () const
 Number of property vertices.
 
+uint32_t NumTri () const
 Number of triangles.
 
MeshGL (const Mesh &mesh)
 Constructs a position-only MeshGL from the input Mesh.
 
bool Merge ()
 
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

+uint32_t numProp = 3
 Number of properties per vertex, always >= 3.
 
std::vector< float > vertProperties
 
std::vector< uint32_t > triVerts
 
std::vector< uint32_t > mergeFromVert
 
std::vector< uint32_t > mergeToVert
 
std::vector< uint32_t > runIndex
 
std::vector< uint32_t > runOriginalID
 
std::vector< float > runTransform
 
std::vector< uint32_t > faceID
 
std::vector< float > halfedgeTangent
 
float precision = 0
 
+

Detailed Description

+

An alternative to Mesh for output suitable for pushing into graphics libraries directly. This may not be manifold since the verts are duplicated along property boundaries that do not match. The additional merge vectors store this missing information, allowing the manifold to be reconstructed.

+

Member Function Documentation

+ +

◆ Merge()

+ +
+
+ + + + + + + +
bool Merge ()
+
+

Updates the mergeFromVert and mergeToVert vectors in order to create a manifold solid. If the MeshGL is already manifold, no change will occur and the function will return false. Otherwise, this will merge verts along open edges within precision (the maximum of the MeshGL precision and the baseline bounding-box precision), keeping any from the existing merge vectors.

+

There is no guarantee the result will be manifold - this is a best-effort helper function designed primarily to aid in the case where a manifold multi-material MeshGL was produced, but its merge vectors were lost due to a round-trip through a file format. Constructing a Manifold from the result will report a Status if it is not manifold.

+ +
+
+

Member Data Documentation

+ +

◆ vertProperties

+ +
+
+ + + + +
std::vector<float> vertProperties
+
+

Flat, GL-style interleaved list of all vertex properties: propVal = vertProperties[vert * numProp + propIdx]. The first three properties are always the position x, y, z.

+ +
+
+ +

◆ triVerts

+ +
+
+ + + + +
std::vector<uint32_t> triVerts
+
+

The vertex indices of the three triangle corners in CCW (from the outside) order, for each triangle.

+ +
+
+ +

◆ mergeFromVert

+ +
+
+ + + + +
std::vector<uint32_t> mergeFromVert
+
+

Optional: A list of only the vertex indicies that need to be merged to reconstruct the manifold.

+ +
+
+ +

◆ mergeToVert

+ +
+
+ + + + +
std::vector<uint32_t> mergeToVert
+
+

Optional: The same length as mergeFromVert, and the corresponding value contains the vertex to merge with. It will have an identical position, but the other properties may differ.

+ +
+
+ +

◆ runIndex

+ +
+
+ + + + +
std::vector<uint32_t> runIndex
+
+

Optional: Indicates runs of triangles that correspond to a particular input mesh instance. The runs encompass all of triVerts and are sorted by runOriginalID. Run i begins at triVerts[runIndex[i]] and ends at triVerts[runIndex[i+1]]. All runIndex values are divisible by 3. Returned runIndex will always be 1 longer than runOriginalID, but same length is also allowed as input: triVerts.size() will be automatically appended in this case.

+ +
+
+ +

◆ runOriginalID

+ +
+
+ + + + +
std::vector<uint32_t> runOriginalID
+
+

Optional: The OriginalID of the mesh this triangle run came from. This ID is ideal for reapplying materials to the output mesh. Multiple runs may have the same ID, e.g. representing different copies of the same input mesh. If you create an input MeshGL that you want to be able to reference as one or more originals, be sure to set unique values from ReserveIDs().

+ +
+
+ +

◆ runTransform

+ +
+
+ + + + +
std::vector<float> runTransform
+
+

Optional: For each run, a 3x4 transform is stored representing how the corresponding original mesh was transformed to create this triangle run. This matrix is stored in column-major order and the length of the overall vector is 12 * runOriginalID.size().

+ +
+
+ +

◆ faceID

+ +
+
+ + + + +
std::vector<uint32_t> faceID
+
+

Optional: Length NumTri, contains an ID of the source face this triangle comes from. When auto-generated, this ID will be a triangle index into the original mesh. All neighboring coplanar triangles from that input mesh will refer to a single triangle of that group as the faceID. When supplying faceIDs, ensure that triangles with the same ID are in fact coplanar and have consistent properties (within some tolerance) or the output will be surprising.

+ +
+
+ +

◆ halfedgeTangent

+ +
+
+ + + + +
std::vector<float> halfedgeTangent
+
+

Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If non-empty, must be exactly four times as long as Mesh.triVerts. Indexed as 4 * (3 * tri + i) + j, i < 3, j < 4, representing the tangent value Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted.

+ +
+
+ +

◆ precision

+ +
+
+ + + + +
float precision = 0
+
+

The absolute precision of the vertex positions, based on accrued rounding errors. When creating a Manifold, the precision used will be the maximum of this and a baseline precision from the size of the bounding box. Any edge shorter than precision may be collapsed.

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_g_l.js b/docs/html/structmanifold_1_1_mesh_g_l.js new file mode 100644 index 000000000..4b5cdaad8 --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_g_l.js @@ -0,0 +1,18 @@ +var structmanifold_1_1_mesh_g_l = +[ + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed", null ], + [ "NumVert", "structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658", null ], + [ "NumTri", "structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6", null ], + [ "Merge", "structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254", null ], + [ "numProp", "structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75", null ], + [ "vertProperties", "structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983", null ], + [ "triVerts", "structmanifold_1_1_mesh_g_l.html#afe0601a32ce917d3324b430a34f5d118", null ], + [ "mergeFromVert", "structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078", null ], + [ "mergeToVert", "structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a", null ], + [ "runIndex", "structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4", null ], + [ "runOriginalID", "structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0", null ], + [ "runTransform", "structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20", null ], + [ "faceID", "structmanifold_1_1_mesh_g_l.html#ac6e7182a9cef30c9644ee167fbff30e1", null ], + [ "halfedgeTangent", "structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5", null ], + [ "precision", "structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141", null ] +]; \ No newline at end of file diff --git a/docs/html/structmanifold_1_1_negate-members.html b/docs/html/structmanifold_1_1_negate-members.html new file mode 100644 index 000000000..1ea970f23 --- /dev/null +++ b/docs/html/structmanifold_1_1_negate-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Negate< T > Member List
+
+
+ +

This is the complete list of members for Negate< T >, including all inherited members.

+ + +
operator()(T v) const (defined in Negate< T >)Negate< T >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_negate.html b/docs/html/structmanifold_1_1_negate.html new file mode 100644 index 000000000..18590905f --- /dev/null +++ b/docs/html/structmanifold_1_1_negate.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Negate< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Negate< T > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+T operator() (T v) const
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_path_impl-members.html b/docs/html/structmanifold_1_1_path_impl-members.html new file mode 100644 index 000000000..bea09e2ea --- /dev/null +++ b/docs/html/structmanifold_1_1_path_impl-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
PathImpl Member List
+
+
+ +

This is the complete list of members for PathImpl, including all inherited members.

+ + + + +
operator const C2::PathsD &() const (defined in PathImpl)PathImplinline
PathImpl(const C2::PathsD paths_) (defined in PathImpl)PathImplinline
paths_ (defined in PathImpl)PathImpl
+
+ + + + diff --git a/docs/html/structmanifold_1_1_path_impl.html b/docs/html/structmanifold_1_1_path_impl.html new file mode 100644 index 000000000..fdcb1e0e0 --- /dev/null +++ b/docs/html/structmanifold_1_1_path_impl.html @@ -0,0 +1,132 @@ + + + + + + + +Manifold: PathImpl Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
PathImpl Struct Reference
+
+
+ + + + + + +

+Public Member Functions

PathImpl (const C2::PathsD paths_)
 
operator const C2::PathsD & () const
 
+ + + +

+Public Attributes

+const C2::PathsD paths_
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_ray-members.html b/docs/html/structmanifold_1_1_ray-members.html new file mode 100644 index 000000000..3810cd152 --- /dev/null +++ b/docs/html/structmanifold_1_1_ray-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Ray Member List
+
+
+ +

This is the complete list of members for Ray, including all inherited members.

+ + + + + +
Ray(const vec3 &S, const vec3 &V) (defined in Ray)Rayinline
S (defined in Ray)Ray
V (defined in Ray)Ray
VInvLengthSquared (defined in Ray)Ray
+
+ + + + diff --git a/docs/html/structmanifold_1_1_ray.html b/docs/html/structmanifold_1_1_ray.html new file mode 100644 index 000000000..82a4cd8e8 --- /dev/null +++ b/docs/html/structmanifold_1_1_ray.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: Ray Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Public Member Functions

Ray (const vec3 &S, const vec3 &V)
 
+ + + + + + + +

+Public Attributes

+const vec3 S
 
+const vec3 V
 
+const double VInvLengthSquared
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_rect-members.html b/docs/html/structmanifold_1_1_rect-members.html new file mode 100644 index 000000000..574b2fb4b --- /dev/null +++ b/docs/html/structmanifold_1_1_rect-members.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Rect Member List
+
+
+ +

This is the complete list of members for Rect, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
Area() constRectinline
Center() constRectinline
Contains(const vec2 &p) constRectinline
Contains(const Rect &rect) constRectinline
DoesOverlap(const Rect &rect) constRectinline
IsEmpty() constRectinline
IsFinite() constRectinline
max (defined in Rect)Rect
min (defined in Rect)Rect
operator*(const vec2 scale) constRectinline
operator*=(const vec2 scale)Rectinline
operator+(const vec2 shift) constRectinline
operator+=(const vec2 shift)Rectinline
Rect()Rectinline
Rect(const vec2 a, const vec2 b)Rectinline
Scale() constRectinline
Size() constRectinline
Transform(const mat3x2 &m) constRectinline
Union(const vec2 p)Rectinline
Union(const Rect &rect) constRectinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_rect.html b/docs/html/structmanifold_1_1_rect.html new file mode 100644 index 000000000..9d80139a7 --- /dev/null +++ b/docs/html/structmanifold_1_1_rect.html @@ -0,0 +1,667 @@ + + + + + + + +Manifold: Rect Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ +

#include <common.h>

+ + + + + + +

+Public Member Functions

 Rect ()
 
 Rect (const vec2 a, const vec2 b)
 
+ + + + + +

+Public Attributes

+vec2 min = vec2(std::numeric_limits<double>::infinity())
 
+vec2 max = vec2(-std::numeric_limits<double>::infinity())
 
+ + + + + + + + + + + + + + + + + + + + +

Information

Details of the rectangle

+
vec2 Size () const
 
double Area () const
 
double Scale () const
 
vec2 Center () const
 
bool Contains (const vec2 &p) const
 
bool Contains (const Rect &rect) const
 
bool DoesOverlap (const Rect &rect) const
 
bool IsEmpty () const
 
bool IsFinite () const
 
+ + + + + + + + + + + + + + + +

Modification

void Union (const vec2 p)
 
Rect Union (const Rect &rect) const
 
Rect operator+ (const vec2 shift) const
 
Rectoperator+= (const vec2 shift)
 
Rect operator* (const vec2 scale) const
 
Rectoperator*= (const vec2 scale)
 
Rect Transform (const mat3x2 &m) const
 
+

Detailed Description

+

Axis-aligned rectangular bounds.

+

Constructor & Destructor Documentation

+ +

◆ Rect() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Rect ()
+
+inline
+
+

Default constructor is an empty rectangle..

+ +
+
+ +

◆ Rect() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Rect (const vec2 a,
const vec2 b 
)
+
+inline
+
+

Create a rectangle that contains the two given points.

+ +
+
+

Member Function Documentation

+ +

◆ Size()

+ +
+
+ + + + + +
+ + + + + + + +
vec2 Size () const
+
+inline
+
+

Return the dimensions of the rectangle.

+ +
+
+ +

◆ Area()

+ +
+
+ + + + + +
+ + + + + + + +
double Area () const
+
+inline
+
+

Return the area of the rectangle.

+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + +
+ + + + + + + +
double Scale () const
+
+inline
+
+

Returns the absolute-largest coordinate value of any contained point.

+ +
+
+ +

◆ Center()

+ +
+
+ + + + + +
+ + + + + + + +
vec2 Center () const
+
+inline
+
+

Returns the center point of the rectangle.

+ +
+
+ +

◆ Contains() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const vec2 & p) const
+
+inline
+
+

Does this rectangle contain (includes on border) the given point?

+ +
+
+ +

◆ Contains() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const Rectrect) const
+
+inline
+
+

Does this rectangle contain (includes equal) the given rectangle?

+ +
+
+ +

◆ DoesOverlap()

+ +
+
+ + + + + +
+ + + + + + + + +
bool DoesOverlap (const Rectrect) const
+
+inline
+
+

Does this rectangle overlap the one given (including equality)?

+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsEmpty () const
+
+inline
+
+

Is the rectangle empty (containing no space)?

+ +
+
+ +

◆ IsFinite()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsFinite () const
+
+inline
+
+

Does this recangle have finite bounds?

+ +
+
+ +

◆ Union() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
void Union (const vec2 p)
+
+inline
+
+

Expand this rectangle (in place) to include the given point.

+ +
+
+ +

◆ Union() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
Rect Union (const Rectrect) const
+
+inline
+
+

Expand this rectangle to include the given Rect.

+ +
+
+ +

◆ operator+()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect operator+ (const vec2 shift) const
+
+inline
+
+

Shift this rectangle by the given vector.

+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect & operator+= (const vec2 shift)
+
+inline
+
+

Shift this rectangle in-place by the given vector.

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect operator* (const vec2 scale) const
+
+inline
+
+

Scale this rectangle by the given vector.

+ +
+
+ +

◆ operator*=()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect & operator*= (const vec2 scale)
+
+inline
+
+

Scale this rectangle in-place by the given vector.

+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect Transform (const mat3x2 & m) const
+
+inline
+
+

Transform the rectangle by the given axis-aligned affine transform.

+

Ensure the transform passed in is axis-aligned (rotations are all multiples of 90 degrees), or else the resulting rectangle will no longer bound properly.

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_rect.js b/docs/html/structmanifold_1_1_rect.js new file mode 100644 index 000000000..9fe3e35b3 --- /dev/null +++ b/docs/html/structmanifold_1_1_rect.js @@ -0,0 +1,21 @@ +var structmanifold_1_1_rect = +[ + [ "Rect", "structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22", null ], + [ "Rect", "structmanifold_1_1_rect.html#a4b37d0f1743973da4b1b82d32ed26dfd", null ], + [ "Size", "structmanifold_1_1_rect.html#a8b0310b471c0b5898fb21d12b00eac81", null ], + [ "Area", "structmanifold_1_1_rect.html#ac84b151a969c68d662637e8245548666", null ], + [ "Scale", "structmanifold_1_1_rect.html#ab30d1e52df44eb451081926df999fc17", null ], + [ "Center", "structmanifold_1_1_rect.html#ac73874c64476da0c5d9f3f11c096826d", null ], + [ "Contains", "structmanifold_1_1_rect.html#ab1e5f154a88928d5a6b89ff0e4b2c0b6", null ], + [ "Contains", "structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6", null ], + [ "DoesOverlap", "structmanifold_1_1_rect.html#ae9b86c34e407f27313804c9a7d30c8c2", null ], + [ "IsEmpty", "structmanifold_1_1_rect.html#a8e12342fc420701fbffd97025421575a", null ], + [ "IsFinite", "structmanifold_1_1_rect.html#a33b7dcc502aae627fbc56bcfecf33af1", null ], + [ "Union", "structmanifold_1_1_rect.html#aab08573b89e6715df6a1b0e1c4222e8d", null ], + [ "Union", "structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70", null ], + [ "operator+", "structmanifold_1_1_rect.html#a6fe10cfc3aa4a6bd44cf8867639aff2b", null ], + [ "operator+=", "structmanifold_1_1_rect.html#ae56ad379896fd93dc3e41ab719a52c87", null ], + [ "operator*", "structmanifold_1_1_rect.html#a7f518b4df73d824dfa9117e1e0137082", null ], + [ "operator*=", "structmanifold_1_1_rect.html#a02fcd8a4fd938f130493a48349dcbabe", null ], + [ "Transform", "structmanifold_1_1_rect.html#a16290599b6b48837a6695ae030d288af", null ] +]; \ No newline at end of file diff --git a/docs/html/structmanifold_1_1_reindex_edge-members.html b/docs/html/structmanifold_1_1_reindex_edge-members.html new file mode 100644 index 000000000..f56b0dd53 --- /dev/null +++ b/docs/html/structmanifold_1_1_reindex_edge-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ReindexEdge< inverted > Member List
+
+
+ +

This is the complete list of members for ReindexEdge< inverted >, including all inherited members.

+ + + + +
edges (defined in ReindexEdge< inverted >)ReindexEdge< inverted >
indices (defined in ReindexEdge< inverted >)ReindexEdge< inverted >
operator()(size_t i) (defined in ReindexEdge< inverted >)ReindexEdge< inverted >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_reindex_edge.html b/docs/html/structmanifold_1_1_reindex_edge.html new file mode 100644 index 000000000..1b14794c7 --- /dev/null +++ b/docs/html/structmanifold_1_1_reindex_edge.html @@ -0,0 +1,132 @@ + + + + + + + +Manifold: ReindexEdge< inverted > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ReindexEdge< inverted > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+void operator() (size_t i)
 
+ + + + + +

+Public Attributes

+VecView< const TmpEdgeedges
 
+SparseIndicesindices
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_strided_range-members.html b/docs/html/structmanifold_1_1_strided_range-members.html new file mode 100644 index 000000000..d31de0597 --- /dev/null +++ b/docs/html/structmanifold_1_1_strided_range-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
StridedRange< Iter > Member List
+
+
+ +

This is the complete list of members for StridedRange< Iter >, including all inherited members.

+ + + + +
begin() const (defined in StridedRange< Iter >)StridedRange< Iter >inline
end() const (defined in StridedRange< Iter >)StridedRange< Iter >inline
StridedRange(Iter start, Iter end, size_t stride) (defined in StridedRange< Iter >)StridedRange< Iter >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_strided_range.html b/docs/html/structmanifold_1_1_strided_range.html new file mode 100644 index 000000000..00d13e0a9 --- /dev/null +++ b/docs/html/structmanifold_1_1_strided_range.html @@ -0,0 +1,129 @@ + + + + + + + +Manifold: StridedRange< Iter > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
StridedRange< Iter > Struct Template Reference
+
+
+ + + + + + + + +

+Public Member Functions

StridedRange (Iter start, Iter end, size_t stride)
 
+StridedRangeIter begin () const
 
+StridedRangeIter end () const
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_timer-members.html b/docs/html/structmanifold_1_1_timer-members.html new file mode 100644 index 000000000..6ca95dd64 --- /dev/null +++ b/docs/html/structmanifold_1_1_timer-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Timer Member List
+
+
+ +

This is the complete list of members for Timer, including all inherited members.

+ + + + + + + +
Elapsed() (defined in Timer)Timerinline
end (defined in Timer)Timer
Print(std::string message) (defined in Timer)Timerinline
start (defined in Timer)Timer
Start() (defined in Timer)Timerinline
Stop() (defined in Timer)Timerinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_timer.html b/docs/html/structmanifold_1_1_timer.html new file mode 100644 index 000000000..5931c3570 --- /dev/null +++ b/docs/html/structmanifold_1_1_timer.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: Timer Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + +

+Public Member Functions

+void Start ()
 
+void Stop ()
 
+float Elapsed ()
 
+void Print (std::string message)
 
+ + + + + +

+Public Attributes

+std::chrono::high_resolution_clock::time_point start
 
+std::chrono::high_resolution_clock::time_point end
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tmp_edge-members.html b/docs/html/structmanifold_1_1_tmp_edge-members.html new file mode 100644 index 000000000..4cb83befc --- /dev/null +++ b/docs/html/structmanifold_1_1_tmp_edge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TmpEdge Member List
+
+
+ +

This is the complete list of members for TmpEdge, including all inherited members.

+ + + + + + + +
first (defined in TmpEdge)TmpEdge
halfedgeIdx (defined in TmpEdge)TmpEdge
operator<(const TmpEdge &other) const (defined in TmpEdge)TmpEdgeinline
second (defined in TmpEdge)TmpEdge
TmpEdge() (defined in TmpEdge)TmpEdgeinline
TmpEdge(int start, int end, int idx) (defined in TmpEdge)TmpEdgeinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tmp_edge.html b/docs/html/structmanifold_1_1_tmp_edge.html new file mode 100644 index 000000000..66b23c1b7 --- /dev/null +++ b/docs/html/structmanifold_1_1_tmp_edge.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: TmpEdge Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ +

#include <shared.h>

+ + + + + + +

+Public Member Functions

TmpEdge (int start, int end, int idx)
 
+bool operator< (const TmpEdge &other) const
 
+ + + + + + + +

+Public Attributes

+int first
 
+int second
 
+int halfedgeIdx
 
+

Detailed Description

+

This is a temporary edge structure which only stores edges forward and references the halfedge it was created from.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_transform_iterator-members.html b/docs/html/structmanifold_1_1_transform_iterator-members.html new file mode 100644 index 000000000..e83bce939 --- /dev/null +++ b/docs/html/structmanifold_1_1_transform_iterator-members.html @@ -0,0 +1,136 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TransformIterator< F, Iter > Member List
+
+
+ +

This is the complete list of members for TransformIterator< F, Iter >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + +
difference_type typedef (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >
iterator_category typedef (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >
operator TransformIterator< F, const Iter >() const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator!=(TransformIterator other) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator*() const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator+(size_t n) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator++() (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator++(int) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator+=(size_t n) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator-(size_t n) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator-(TransformIterator other) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator--() (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator--(int) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator-=(size_t n) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator<(TransformIterator other) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator=(const TransformIterator &other) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator==(TransformIterator other) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
operator[](size_t i) const (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
pointer typedef (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >
reference typedef (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >
TransformIterator(Iter iter, F f) (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >inline
value_type typedef (defined in TransformIterator< F, Iter >)TransformIterator< F, Iter >
+
+ + + + diff --git a/docs/html/structmanifold_1_1_transform_iterator.html b/docs/html/structmanifold_1_1_transform_iterator.html new file mode 100644 index 000000000..78054825c --- /dev/null +++ b/docs/html/structmanifold_1_1_transform_iterator.html @@ -0,0 +1,189 @@ + + + + + + + +Manifold: TransformIterator< F, Iter > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
TransformIterator< F, Iter > Struct Template Reference
+
+
+ + + + + + + + + + + + +

+Public Types

+using pointer = void
 
+using reference = std::invoke_result_t< F, typename std::iterator_traits< std::remove_const_t< Iter > >::value_type >
 
+using difference_type = typename std::iterator_traits< std::remove_const_t< Iter > >::difference_type
 
+using value_type = reference
 
+using iterator_category = typename std::iterator_traits< std::remove_const_t< Iter > >::iterator_category
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

TransformIterator (Iter iter, F f)
 
+TransformIteratoroperator= (const TransformIterator &other)
 
+reference operator* () const
 
+reference operator[] (size_t i) const
 
+TransformIteratoroperator++ ()
 
+TransformIterator operator++ (int)
 
+TransformIteratoroperator-- ()
 
+TransformIterator operator-- (int)
 
+TransformIterator operator+ (size_t n) const
 
+TransformIteratoroperator+= (size_t n)
 
+TransformIterator operator- (size_t n) const
 
+TransformIteratoroperator-= (size_t n)
 
+bool operator== (TransformIterator other) const
 
+bool operator!= (TransformIterator other) const
 
+bool operator< (TransformIterator other) const
 
+difference_type operator- (TransformIterator other) const
 
operator TransformIterator< F, const Iter > () const
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tri_ref-members.html b/docs/html/structmanifold_1_1_tri_ref-members.html new file mode 100644 index 000000000..72e0713e1 --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TriRef Member List
+
+
+ +

This is the complete list of members for TriRef, including all inherited members.

+ + + + + +
meshIDTriRef
originalIDTriRef
SameFace(const TriRef &other) const (defined in TriRef)TriRefinline
triTriRef
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tri_ref.html b/docs/html/structmanifold_1_1_tri_ref.html new file mode 100644 index 000000000..f6c0e6ef9 --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref.html @@ -0,0 +1,178 @@ + + + + + + + +Manifold: TriRef Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Public Member Functions

+bool SameFace (const TriRef &other) const
 
+ + + + + + + +

+Public Attributes

int meshID
 
int originalID
 
int tri
 
+

Member Data Documentation

+ +

◆ meshID

+ +
+
+ + + + +
int meshID
+
+

The unique ID of the mesh instance of this triangle. If .meshID and .tri match for two triangles, then they are coplanar and came from the same face.

+ +
+
+ +

◆ originalID

+ +
+
+ + + + +
int originalID
+
+

The OriginalID of the mesh this triangle came from. This ID is ideal for reapplying properties like UV coordinates to the output mesh.

+ +
+
+ +

◆ tri

+ +
+
+ + + + +
int tri
+
+

The triangle index of the original triangle this was part of: Mesh.triVerts[tri].

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tri_ref.js b/docs/html/structmanifold_1_1_tri_ref.js new file mode 100644 index 000000000..98cc65108 --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref.js @@ -0,0 +1,6 @@ +var structmanifold_1_1_tri_ref = +[ + [ "meshID", "structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88", null ] +]; \ No newline at end of file diff --git a/docs/html/structmanifold_1_1_union_find-members.html b/docs/html/structmanifold_1_1_union_find-members.html new file mode 100644 index 000000000..deedc4069 --- /dev/null +++ b/docs/html/structmanifold_1_1_union_find-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
UnionFind< I, R > Member List
+
+
+ +

This is the complete list of members for UnionFind< I, R >, including all inherited members.

+ + + + + + + +
connectedComponents(std::vector< I > &components) (defined in UnionFind< I, R >)UnionFind< I, R >inline
find(I x) (defined in UnionFind< I, R >)UnionFind< I, R >inline
parents (defined in UnionFind< I, R >)UnionFind< I, R >
ranks (defined in UnionFind< I, R >)UnionFind< I, R >
UnionFind(I numNodes) (defined in UnionFind< I, R >)UnionFind< I, R >inline
unionXY(I x, I y) (defined in UnionFind< I, R >)UnionFind< I, R >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_union_find.html b/docs/html/structmanifold_1_1_union_find.html new file mode 100644 index 000000000..983296472 --- /dev/null +++ b/docs/html/structmanifold_1_1_union_find.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: UnionFind< I, R > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
UnionFind< I, R > Struct Template Reference
+
+
+ + + + + + + + + + +

+Public Member Functions

UnionFind (I numNodes)
 
+I find (I x)
 
+void unionXY (I x, I y)
 
+I connectedComponents (std::vector< I > &components)
 
+ + + + + +

+Public Attributes

+Vec< I > parents
 
+Vec< R > ranks
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes-members.html new file mode 100644 index 000000000..1425cc044 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
BuildInternalBoxes Member List
+
+
+ +

This is the complete list of members for BuildInternalBoxes, including all inherited members.

+ + + + + + +
counter_ (defined in BuildInternalBoxes)BuildInternalBoxes
internalChildren_ (defined in BuildInternalBoxes)BuildInternalBoxes
nodeBBox_ (defined in BuildInternalBoxes)BuildInternalBoxes
nodeParent_ (defined in BuildInternalBoxes)BuildInternalBoxes
operator()(int leaf) (defined in BuildInternalBoxes)BuildInternalBoxesinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes.html b/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes.html new file mode 100644 index 000000000..ba0773332 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_build_internal_boxes.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: BuildInternalBoxes Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
BuildInternalBoxes Struct Reference
+
+
+ + + + +

+Public Member Functions

+void operator() (int leaf)
 
+ + + + + + + + + +

+Public Attributes

+VecView< BoxnodeBBox_
 
+VecView< int > counter_
 
+const VecView< int > nodeParent_
 
+const VecView< std::pair< int, int > > internalChildren_
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions-members.html new file mode 100644 index 000000000..dab5f3872 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CountCollisions Member List
+
+
+ +

This is the complete list of members for CountCollisions, including all inherited members.

+ + + + + + +
counts (defined in CountCollisions)CountCollisions
earlyexit(int _queryIdx) (defined in CountCollisions)CountCollisionsinline
empty (defined in CountCollisions)CountCollisions
end(int queryIdx) (defined in CountCollisions)CountCollisionsinline
record(int queryIdx, int _leafIdx) (defined in CountCollisions)CountCollisionsinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions.html b/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions.html new file mode 100644 index 000000000..a75fbd8f3 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_count_collisions.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: CountCollisions Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CountCollisions Struct Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void record (int queryIdx, int _leafIdx)
 
+bool earlyexit (int _queryIdx)
 
+void end (int queryIdx)
 
+ + + + + +

+Public Attributes

+VecView< int > counts
 
+VecView< char > empty
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree-members.html new file mode 100644 index 000000000..36a4fed7e --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree-members.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CreateRadixTree Member List
+
+
+ +

This is the complete list of members for CreateRadixTree, including all inherited members.

+ + + + + + + + + +
FindSplit(int first, int last) const (defined in CreateRadixTree)CreateRadixTreeinline
internalChildren_ (defined in CreateRadixTree)CreateRadixTree
leafMorton_ (defined in CreateRadixTree)CreateRadixTree
nodeParent_ (defined in CreateRadixTree)CreateRadixTree
operator()(int internal) (defined in CreateRadixTree)CreateRadixTreeinline
PrefixLength(uint32_t a, uint32_t b) const (defined in CreateRadixTree)CreateRadixTreeinline
PrefixLength(int i, int j) const (defined in CreateRadixTree)CreateRadixTreeinline
RangeEnd(int i) const (defined in CreateRadixTree)CreateRadixTreeinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree.html b/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree.html new file mode 100644 index 000000000..c97ed0875 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_create_radix_tree.html @@ -0,0 +1,147 @@ + + + + + + + +Manifold: CreateRadixTree Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CreateRadixTree Struct Reference
+
+
+ + + + + + + + + + + + +

+Public Member Functions

+int PrefixLength (uint32_t a, uint32_t b) const
 
+int PrefixLength (int i, int j) const
 
+int RangeEnd (int i) const
 
+int FindSplit (int first, int last) const
 
+void operator() (int internal)
 
+ + + + + + + +

+Public Attributes

+VecView< int > nodeParent_
 
+VecView< std::pair< int, int > > internalChildren_
 
+const VecView< const uint32_t > leafMorton_
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions-members.html new file mode 100644 index 000000000..3b05728fd --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
FindCollisions< T, selfCollision, Recorder > Member List
+
+ +
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions.html b/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions.html new file mode 100644 index 000000000..2971a368d --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_find_collisions.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: FindCollisions< T, selfCollision, Recorder > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
FindCollisions< T, selfCollision, Recorder > Struct Template Reference
+
+
+ + + + + + +

+Public Member Functions

+int RecordCollision (int node, const int queryIdx)
 
+void operator() (const int queryIdx)
 
+ + + + + + + + + +

+Public Attributes

+VecView< const T > queries
 
+VecView< const BoxnodeBBox_
 
+VecView< const std::pair< int, int > > internalChildren_
 
+Recorder recorder
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder-members.html new file mode 100644 index 000000000..71c467973 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ParCollisionRecorder< inverted > Member List
+
+
+ +

This is the complete list of members for ParCollisionRecorder< inverted >, including all inherited members.

+ + + + + + + +
counts (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >
earlyexit(int queryIdx) const (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >inline
empty (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >
end(int queryIdx) const (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >inline
queryTri (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >
record(int queryIdx, int leafIdx) (defined in ParCollisionRecorder< inverted >)ParCollisionRecorder< inverted >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder.html b/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder.html new file mode 100644 index 000000000..252ddb608 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_par_collision_recorder.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: ParCollisionRecorder< inverted > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ParCollisionRecorder< inverted > Struct Template Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void record (int queryIdx, int leafIdx)
 
+bool earlyexit (int queryIdx) const
 
+void end (int queryIdx) const
 
+ + + + + + + +

+Public Attributes

+SparseIndicesqueryTri
 
+VecView< int > counts
 
+VecView< char > empty
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder-members.html new file mode 100644 index 000000000..f9dd4bc66 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
SeqCollisionRecorder< inverted > Member List
+
+
+ +

This is the complete list of members for SeqCollisionRecorder< inverted >, including all inherited members.

+ + + + + +
earlyexit(int queryIdx) const (defined in SeqCollisionRecorder< inverted >)SeqCollisionRecorder< inverted >inline
end(int queryIdx) const (defined in SeqCollisionRecorder< inverted >)SeqCollisionRecorder< inverted >inline
queryTri_ (defined in SeqCollisionRecorder< inverted >)SeqCollisionRecorder< inverted >
record(int queryIdx, int leafIdx) const (defined in SeqCollisionRecorder< inverted >)SeqCollisionRecorder< inverted >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html b/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html new file mode 100644 index 000000000..03fb8c07a --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_seq_collision_recorder.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: SeqCollisionRecorder< inverted > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
SeqCollisionRecorder< inverted > Struct Template Reference
+
+
+ + + + + + + + +

+Public Member Functions

+void record (int queryIdx, int leafIdx) const
 
+bool earlyexit (int queryIdx) const
 
+void end (int queryIdx) const
 
+ + + +

+Public Attributes

+SparseIndicesqueryTri_
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_transform_box-members.html b/docs/html/structmanifold_1_1collider__internal_1_1_transform_box-members.html new file mode 100644 index 000000000..7f9af62c3 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_transform_box-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TransformBox Member List
+
+
+ +

This is the complete list of members for TransformBox, including all inherited members.

+ + + +
operator()(Box &box) (defined in TransformBox)TransformBoxinline
transform (defined in TransformBox)TransformBox
+
+ + + + diff --git a/docs/html/structmanifold_1_1collider__internal_1_1_transform_box.html b/docs/html/structmanifold_1_1collider__internal_1_1_transform_box.html new file mode 100644 index 000000000..42e53d2b7 --- /dev/null +++ b/docs/html/structmanifold_1_1collider__internal_1_1_transform_box.html @@ -0,0 +1,129 @@ + + + + + + + +Manifold: TransformBox Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
TransformBox Struct Reference
+
+
+ + + + +

+Public Member Functions

+void operator() (Box &box)
 
+ + + +

+Public Attributes

+const mat4x3 transform
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1geometry_err.html b/docs/html/structmanifold_1_1geometry_err.html new file mode 100644 index 000000000..c0b981323 --- /dev/null +++ b/docs/html/structmanifold_1_1geometry_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: geometryErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
geometryErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_1topology_err.html b/docs/html/structmanifold_1_1topology_err.html new file mode 100644 index 000000000..edc729f61 --- /dev/null +++ b/docs/html/structmanifold_1_1topology_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: topologyErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
topologyErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_1user_err.html b/docs/html/structmanifold_1_1user_err.html new file mode 100644 index 000000000..a019abdba --- /dev/null +++ b/docs/html/structmanifold_1_1user_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: userErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
userErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html new file mode 100644 index 000000000..8f506c6f1 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< glm::mat< C, R, T, Q > > Member List
+
+
+ +

This is the complete list of members for type_caster< glm::mat< C, R, T, Q > >, including all inherited members.

+ + + + + + +
from_cpp(glm_type mat, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >inline
glm_type typedef (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
NB_TYPE_CASTER(glm_type, const_name(glm_name< glm_type >::name)) (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
numpy_type typedef (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html new file mode 100644 index 000000000..ba221d618 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< glm::mat< C, R, T, Q > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< glm::mat< C, R, T, Q > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::mat< C, R, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape< R, C > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (glm_type, const_name(glm_name< glm_type >::name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (glm_type mat, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html new file mode 100644 index 000000000..babbc0050 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< glm::vec< N, T, Q > > Member List
+
+
+ +

This is the complete list of members for type_caster< glm::vec< N, T, Q > >, including all inherited members.

+ + + + + +
from_cpp(glm_type vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >inline
glm_type typedef (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >
NB_TYPE_CASTER(glm_type, const_name(glm_name< glm_type >::name)) (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html new file mode 100644 index 000000000..8f3dc8f63 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html @@ -0,0 +1,139 @@ + + + + + + + +Manifold: type_caster< glm::vec< N, T, Q > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< glm::vec< N, T, Q > > Struct Template Reference
+
+
+ + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (glm_type, const_name(glm_name< glm_type >::name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (glm_type vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html new file mode 100644 index 000000000..fd1afda2e --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< manifold::VecView< glm::vec< N, T, Q > > > Member List
+
+
+ +

This is the complete list of members for type_caster< manifold::VecView< glm::vec< N, T, Q > > >, including all inherited members.

+ + + + + + +
from_cpp(Value vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >inline
glm_type typedef (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
NB_TYPE_CASTER(manifold::VecView< glm_type >, const_name(glm_name< glm_type >::multi_name)) (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
numpy_type typedef (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html new file mode 100644 index 000000000..a92851df0 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< manifold::VecView< glm::vec< N, T, Q > > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< manifold::VecView< glm::vec< N, T, Q > > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape<-1, N > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (manifold::VecView< glm_type >, const_name(glm_name< glm_type >::multi_name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (Value vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html new file mode 100644 index 000000000..a251cd96b --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< std::vector< glm::vec< N, T, Q > > > Member List
+
+
+ +

This is the complete list of members for type_caster< std::vector< glm::vec< N, T, Q > > >, including all inherited members.

+ + + + + + +
from_cpp(Value vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >inline
glm_type typedef (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
NB_TYPE_CASTER(std::vector< glm_type >, const_name(glm_name< glm_type >::multi_name)) (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
numpy_type typedef (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html new file mode 100644 index 000000000..b4e98d1db --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< std::vector< glm::vec< N, T, Q > > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< std::vector< glm::vec< N, T, Q > > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape<-1, N > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (std::vector< glm_type >, const_name(glm_name< glm_type >::multi_name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (Value vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4-members.html b/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4-members.html new file mode 100644 index 000000000..16bea1176 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hash< manifold::ivec4 > Member List
+
+
+ +

This is the complete list of members for hash< manifold::ivec4 >, including all inherited members.

+ + +
operator()(const manifold::ivec4 &p) const (defined in hash< manifold::ivec4 >)hash< manifold::ivec4 >inline
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html b/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html new file mode 100644 index 000000000..e01947531 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01manifold_1_1ivec4_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: hash< manifold::ivec4 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hash< manifold::ivec4 > Struct Reference
+
+
+ + + + +

+Public Member Functions

+size_t operator() (const manifold::ivec4 &p) const
 
+
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html new file mode 100644 index 000000000..39f43a3b4 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hash< std::pair< int, int > > Member List
+
+
+ +

This is the complete list of members for hash< std::pair< int, int > >, including all inherited members.

+ + +
operator()(const std::pair< int, int > &p) const (defined in hash< std::pair< int, int > >)hash< std::pair< int, int > >inline
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html new file mode 100644 index 000000000..e507ebec4 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: hash< std::pair< int, int > > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hash< std::pair< int, int > > Struct Reference
+
+
+ + + + +

+Public Member Functions

+size_t operator() (const std::pair< int, int > &p) const
 
+
+
+ + + + diff --git a/docs/html/svd_8h_source.html b/docs/html/svd_8h_source.html new file mode 100644 index 000000000..90d839320 --- /dev/null +++ b/docs/html/svd_8h_source.html @@ -0,0 +1,416 @@ + + + + + + + +Manifold: svd.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
svd.h
+
+
+
1// MIT License
+
2
+
3// Copyright (c) 2019 wi-re
+
4// Copyright 2023 The Manifold Authors.
+
5
+
6// Permission is hereby granted, free of charge, to any person obtaining a copy
+
7// of this software and associated documentation files (the "Software"), to deal
+
8// in the Software without restriction, including without limitation the rights
+
9// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+
10// copies of the Software, and to permit persons to whom the Software is
+
11// furnished to do so, subject to the following conditions:
+
12
+
13// The above copyright notice and this permission notice shall be included in
+
14// all copies or substantial portions of the Software.
+
15
+
16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
19// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
21// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
22// SOFTWARE.
+
23
+
24// Modified from https://github.com/wi-re/tbtSVD, removing CUDA dependence and
+
25// approximate inverse square roots.
+
26
+
27#include <cmath>
+
28
+
29#include "manifold/common.h"
+
30
+
31namespace {
+
32using manifold::mat3;
+
33using manifold::vec3;
+
34using manifold::vec4;
+
35
+
36// Constants used for calculation of Givens quaternions
+
37inline constexpr double _gamma = 5.82842712474619; // sqrt(8)+3;
+
38inline constexpr double _cStar = 0.9238795325112867; // cos(pi/8)
+
39inline constexpr double _sStar = 0.3826834323650898; // sin(pi/8)
+
40// Threshold value
+
41inline constexpr double _SVD_EPSILON = 1e-6;
+
42// Iteration counts for Jacobi Eigen Analysis, influences precision
+
43inline constexpr int JACOBI_STEPS = 12;
+
44
+
45// Helper function used to swap X with Y and Y with X if c == true
+
46inline void CondSwap(bool c, double& X, double& Y) {
+
47 double Z = X;
+
48 X = c ? Y : X;
+
49 Y = c ? Z : Y;
+
50}
+
51// Helper function used to swap X with Y and Y with -X if c == true
+
52inline void CondNegSwap(bool c, double& X, double& Y) {
+
53 double Z = -X;
+
54 X = c ? Y : X;
+
55 Y = c ? Z : Y;
+
56}
+
57// A simple symmetric 3x3 Matrix class (contains no storage for (0, 1) (0, 2)
+
58// and (1, 2)
+
59struct Symmetric3x3 {
+
60 double m_00 = 1.0;
+
61 double m_10 = 0.0, m_11 = 1.0;
+
62 double m_20 = 0.0, m_21 = 0.0, m_22 = 1.0;
+
63
+
64 Symmetric3x3(double a11 = 1.0, double a21 = 0.0, double a22 = 1.0,
+
65 double a31 = 0.0, double a32 = 0.0, double a33 = 1.0)
+
66 : m_00(a11), m_10(a21), m_11(a22), m_20(a31), m_21(a32), m_22(a33) {}
+
67 Symmetric3x3(mat3 o)
+
68 : m_00(o[0][0]),
+
69 m_10(o[0][1]),
+
70 m_11(o[1][1]),
+
71 m_20(o[0][2]),
+
72 m_21(o[1][2]),
+
73 m_22(o[2][2]) {}
+
74};
+
75// Helper struct to store 2 doubles to avoid OUT parameters on functions
+
76struct Givens {
+
77 double ch = _cStar;
+
78 double sh = _sStar;
+
79};
+
80// Helper struct to store 2 Matrices to avoid OUT parameters on functions
+
81struct QR {
+
82 mat3 Q, R;
+
83};
+
84// Calculates the squared norm of the vector.
+
85inline double Dist2(vec3 v) { return glm::dot(v, v); }
+
86// For an explanation of the math see
+
87// http://pages.cs.wisc.edu/~sifakis/papers/SVD_TR1690.pdf Computing the
+
88// Singular Value Decomposition of 3 x 3 matrices with minimal branching and
+
89// elementary floating point operations See Algorithm 2 in reference. Given a
+
90// matrix A this function returns the Givens quaternion (x and w component, y
+
91// and z are 0)
+
92inline Givens ApproximateGivensQuaternion(Symmetric3x3& A) {
+
93 Givens g{2.0 * (A.m_00 - A.m_11), A.m_10};
+
94 bool b = _gamma * g.sh * g.sh < g.ch * g.ch;
+
95 double w = 1.0 / hypot(g.ch, g.sh);
+
96 if (!std::isfinite(w)) b = 0;
+
97 return Givens{b ? w * g.ch : _cStar, b ? w * g.sh : _sStar};
+
98}
+
99// Function used to apply a Givens rotation S. Calculates the weights and
+
100// updates the quaternion to contain the cumulative rotation
+
101inline void JacobiConjugation(const int32_t x, const int32_t y, const int32_t z,
+
102 Symmetric3x3& S, vec4& q) {
+
103 auto g = ApproximateGivensQuaternion(S);
+
104 double scale = 1.0 / fma(g.ch, g.ch, g.sh * g.sh);
+
105 double a = fma(g.ch, g.ch, -g.sh * g.sh) * scale;
+
106 double b = 2.0 * g.sh * g.ch * scale;
+
107 Symmetric3x3 _S = S;
+
108 // perform conjugation S = Q'*S*Q
+
109 S.m_00 =
+
110 fma(a, fma(a, _S.m_00, b * _S.m_10), b * (fma(a, _S.m_10, b * _S.m_11)));
+
111 S.m_10 = fma(a, fma(-b, _S.m_00, a * _S.m_10),
+
112 b * (fma(-b, _S.m_10, a * _S.m_11)));
+
113 S.m_11 = fma(-b, fma(-b, _S.m_00, a * _S.m_10),
+
114 a * (fma(-b, _S.m_10, a * _S.m_11)));
+
115 S.m_20 = fma(a, _S.m_20, b * _S.m_21);
+
116 S.m_21 = fma(-b, _S.m_20, a * _S.m_21);
+
117 S.m_22 = _S.m_22;
+
118 // update cumulative rotation qV
+
119 vec3 tmp = g.sh * vec3(q);
+
120 g.sh *= q[3];
+
121 // (x,y,z) corresponds to ((0,1,2),(1,2,0),(2,0,1)) for (p,q) =
+
122 // ((0,1),(1,2),(0,2))
+
123 q[z] = fma(q[z], g.ch, g.sh);
+
124 q[3] = fma(q[3], g.ch, -tmp[z]); // w
+
125 q[x] = fma(q[x], g.ch, tmp[y]);
+
126 q[y] = fma(q[y], g.ch, -tmp[x]);
+
127 // re-arrange matrix for next iteration
+
128 _S.m_00 = S.m_11;
+
129 _S.m_10 = S.m_21;
+
130 _S.m_11 = S.m_22;
+
131 _S.m_20 = S.m_10;
+
132 _S.m_21 = S.m_20;
+
133 _S.m_22 = S.m_00;
+
134 S.m_00 = _S.m_00;
+
135 S.m_10 = _S.m_10;
+
136 S.m_11 = _S.m_11;
+
137 S.m_20 = _S.m_20;
+
138 S.m_21 = _S.m_21;
+
139 S.m_22 = _S.m_22;
+
140}
+
141// Function used to contain the Givens permutations and the loop of the jacobi
+
142// steps controlled by JACOBI_STEPS Returns the quaternion q containing the
+
143// cumulative result used to reconstruct S
+
144inline mat3 JacobiEigenAnalysis(Symmetric3x3 S) {
+
145 vec4 q(0, 0, 0, 1);
+
146 for (int32_t i = 0; i < JACOBI_STEPS; i++) {
+
147 JacobiConjugation(0, 1, 2, S, q);
+
148 JacobiConjugation(1, 2, 0, S, q);
+
149 JacobiConjugation(2, 0, 1, S, q);
+
150 }
+
151 return mat3(1.0 - 2.0 * (fma(q.y, q.y, q.z * q.z)), //
+
152 2.0 * fma(q.x, q.y, +q.w * q.z), //
+
153 2.0 * fma(q.x, q.z, -q.w * q.y), //
+
154 2 * fma(q.x, q.y, -q.w * q.z), //
+
155 1 - 2 * fma(q.x, q.x, q.z * q.z), //
+
156 2 * fma(q.y, q.z, q.w * q.x), //
+
157 2 * fma(q.x, q.z, q.w * q.y), //
+
158 2 * fma(q.y, q.z, -q.w * q.x), //
+
159 1 - 2 * fma(q.x, q.x, q.y * q.y));
+
160}
+
161// Implementation of Algorithm 3
+
162inline void SortSingularValues(mat3& B, mat3& V) {
+
163 double rho1 = Dist2(B[0]);
+
164 double rho2 = Dist2(B[1]);
+
165 double rho3 = Dist2(B[2]);
+
166 bool c;
+
167 c = rho1 < rho2;
+
168 CondNegSwap(c, B[0][0], B[1][0]);
+
169 CondNegSwap(c, V[0][0], V[1][0]);
+
170 CondNegSwap(c, B[0][1], B[1][1]);
+
171 CondNegSwap(c, V[0][1], V[1][1]);
+
172 CondNegSwap(c, B[0][2], B[1][2]);
+
173 CondNegSwap(c, V[0][2], V[1][2]);
+
174 CondSwap(c, rho1, rho2);
+
175 c = rho1 < rho3;
+
176 CondNegSwap(c, B[0][0], B[2][0]);
+
177 CondNegSwap(c, V[0][0], V[2][0]);
+
178 CondNegSwap(c, B[0][1], B[2][1]);
+
179 CondNegSwap(c, V[0][1], V[2][1]);
+
180 CondNegSwap(c, B[0][2], B[2][2]);
+
181 CondNegSwap(c, V[0][2], V[2][2]);
+
182 CondSwap(c, rho1, rho3);
+
183 c = rho2 < rho3;
+
184 CondNegSwap(c, B[1][0], B[2][0]);
+
185 CondNegSwap(c, V[1][0], V[2][0]);
+
186 CondNegSwap(c, B[1][1], B[2][1]);
+
187 CondNegSwap(c, V[1][1], V[2][1]);
+
188 CondNegSwap(c, B[1][2], B[2][2]);
+
189 CondNegSwap(c, V[1][2], V[2][2]);
+
190}
+
191// Implementation of Algorithm 4
+
192inline Givens QRGivensQuaternion(double a1, double a2) {
+
193 // a1 = pivot point on diagonal
+
194 // a2 = lower triangular entry we want to annihilate
+
195 double epsilon = _SVD_EPSILON;
+
196 double rho = hypot(a1, a2);
+
197 Givens g{fabs(a1) + fmax(rho, epsilon), rho > epsilon ? a2 : 0};
+
198 bool b = a1 < 0.0;
+
199 CondSwap(b, g.sh, g.ch);
+
200 double w = 1.0 / hypot(g.ch, g.sh);
+
201 g.ch *= w;
+
202 g.sh *= w;
+
203 return g;
+
204}
+
205// Implements a QR decomposition of a Matrix, see Sec 4.2
+
206inline QR QRDecomposition(mat3& B) {
+
207 mat3 Q, R;
+
208 // first Givens rotation (ch,0,0,sh)
+
209 auto g1 = QRGivensQuaternion(B[0][0], B[0][1]);
+
210 auto a = fma(-2.0, g1.sh * g1.sh, 1.0);
+
211 auto b = 2.0 * g1.ch * g1.sh;
+
212 // apply B = Q' * B
+
213 R[0][0] = fma(a, B[0][0], b * B[0][1]);
+
214 R[1][0] = fma(a, B[1][0], b * B[1][1]);
+
215 R[2][0] = fma(a, B[2][0], b * B[2][1]);
+
216 R[0][1] = fma(-b, B[0][0], a * B[0][1]);
+
217 R[1][1] = fma(-b, B[1][0], a * B[1][1]);
+
218 R[2][1] = fma(-b, B[2][0], a * B[2][1]);
+
219 R[0][2] = B[0][2];
+
220 R[1][2] = B[1][2];
+
221 R[2][2] = B[2][2];
+
222 // second Givens rotation (ch,0,-sh,0)
+
223 auto g2 = QRGivensQuaternion(R[0][0], R[0][2]);
+
224 a = fma(-2.0, g2.sh * g2.sh, 1.0);
+
225 b = 2.0 * g2.ch * g2.sh;
+
226 // apply B = Q' * B;
+
227 B[0][0] = fma(a, R[0][0], b * R[0][2]);
+
228 B[1][0] = fma(a, R[1][0], b * R[1][2]);
+
229 B[2][0] = fma(a, R[2][0], b * R[2][2]);
+
230 B[0][1] = R[0][1];
+
231 B[1][1] = R[1][1];
+
232 B[2][1] = R[2][1];
+
233 B[0][2] = fma(-b, R[0][0], a * R[0][2]);
+
234 B[1][2] = fma(-b, R[1][0], a * R[1][2]);
+
235 B[2][2] = fma(-b, R[2][0], a * R[2][2]);
+
236 // third Givens rotation (ch,sh,0,0)
+
237 auto g3 = QRGivensQuaternion(B[1][1], B[1][2]);
+
238 a = fma(-2.0, g3.sh * g3.sh, 1.0);
+
239 b = 2.0 * g3.ch * g3.sh;
+
240 // R is now set to desired value
+
241 R[0][0] = B[0][0];
+
242 R[1][0] = B[1][0];
+
243 R[2][0] = B[2][0];
+
244 R[0][1] = fma(a, B[0][1], b * B[0][2]);
+
245 R[1][1] = fma(a, B[1][1], b * B[1][2]);
+
246 R[2][1] = fma(a, B[2][1], b * B[2][2]);
+
247 R[0][2] = fma(-b, B[0][1], a * B[0][2]);
+
248 R[1][2] = fma(-b, B[1][1], a * B[1][2]);
+
249 R[2][2] = fma(-b, B[2][1], a * B[2][2]);
+
250 // construct the cumulative rotation Q=Q1 * Q2 * Q3
+
251 // the number of floating point operations for three quaternion
+
252 // multiplications is more or less comparable to the explicit form of the
+
253 // joined matrix. certainly more memory-efficient!
+
254 auto sh12 = 2.0 * fma(g1.sh, g1.sh, -0.5);
+
255 auto sh22 = 2.0 * fma(g2.sh, g2.sh, -0.5);
+
256 auto sh32 = 2.0 * fma(g3.sh, g3.sh, -0.5);
+
257 Q[0][0] = sh12 * sh22;
+
258 Q[1][0] = fma(4.0 * g2.ch * g3.ch, sh12 * g2.sh * g3.sh,
+
259 2.0 * g1.ch * g1.sh * sh32);
+
260 Q[2][0] = fma(4.0 * g1.ch * g3.ch, g1.sh * g3.sh,
+
261 -2.0 * g2.ch * sh12 * g2.sh * sh32);
+
262
+
263 Q[0][1] = -2.0 * g1.ch * g1.sh * sh22;
+
264 Q[1][1] =
+
265 fma(-8.0 * g1.ch * g2.ch * g3.ch, g1.sh * g2.sh * g3.sh, sh12 * sh32);
+
266 Q[2][1] = fma(
+
267 -2.0 * g3.ch, g3.sh,
+
268 4.0 * g1.sh * fma(g3.ch * g1.sh, g3.sh, g1.ch * g2.ch * g2.sh * sh32));
+
269
+
270 Q[0][2] = 2.0 * g2.ch * g2.sh;
+
271 Q[1][2] = -2.0 * g3.ch * sh22 * g3.sh;
+
272 Q[2][2] = sh22 * sh32;
+
273 return QR{Q, R};
+
274}
+
275} // namespace
+
276
+
277namespace manifold {
+
+
285struct SVDSet {
+
286 mat3 U, S, V;
+
287};
+
+
288
+
+
294inline SVDSet SVD(mat3 A) {
+
295 mat3 V = JacobiEigenAnalysis(glm::transpose(A) * A);
+
296 auto B = A * V;
+
297 SortSingularValues(B, V);
+
298 QR qr = QRDecomposition(B);
+
299 return SVDSet{qr.Q, qr.R, V};
+
300}
+
+
301
+
+
307inline double SpectralNorm(mat3 A) {
+
308 SVDSet usv = SVD(A);
+
309 return usv.S[0][0];
+
310}
+
+
312} // namespace manifold
+
double SpectralNorm(mat3 A)
Definition svd.h:307
+
SVDSet SVD(mat3 A)
Definition svd.h:294
+
Definition svd.h:285
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/sync_off.png b/docs/html/sync_off.png new file mode 100644 index 000000000..3b443fc62 Binary files /dev/null and b/docs/html/sync_off.png differ diff --git a/docs/html/sync_on.png b/docs/html/sync_on.png new file mode 100644 index 000000000..e08320fb6 Binary files /dev/null and b/docs/html/sync_on.png differ diff --git a/docs/html/tab_a.png b/docs/html/tab_a.png new file mode 100644 index 000000000..3b725c41c Binary files /dev/null and b/docs/html/tab_a.png differ diff --git a/docs/html/tab_ad.png b/docs/html/tab_ad.png new file mode 100644 index 000000000..e34850acf Binary files /dev/null and b/docs/html/tab_ad.png differ diff --git a/docs/html/tab_b.png b/docs/html/tab_b.png new file mode 100644 index 000000000..e2b4a8638 Binary files /dev/null and b/docs/html/tab_b.png differ diff --git a/docs/html/tab_bd.png b/docs/html/tab_bd.png new file mode 100644 index 000000000..91c252498 Binary files /dev/null and b/docs/html/tab_bd.png differ diff --git a/docs/html/tab_h.png b/docs/html/tab_h.png new file mode 100644 index 000000000..fd5cb7054 Binary files /dev/null and b/docs/html/tab_h.png differ diff --git a/docs/html/tab_hd.png b/docs/html/tab_hd.png new file mode 100644 index 000000000..2489273d4 Binary files /dev/null and b/docs/html/tab_hd.png differ diff --git a/docs/html/tab_s.png b/docs/html/tab_s.png new file mode 100644 index 000000000..ab478c95b Binary files /dev/null and b/docs/html/tab_s.png differ diff --git a/docs/html/tab_sd.png b/docs/html/tab_sd.png new file mode 100644 index 000000000..757a565ce Binary files /dev/null and b/docs/html/tab_sd.png differ diff --git a/docs/html/tabs.css b/docs/html/tabs.css new file mode 100644 index 000000000..71c8a4704 --- /dev/null +++ b/docs/html/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/docs/html/test_8h_source.html b/docs/html/test_8h_source.html new file mode 100644 index 000000000..e6a5c08ca --- /dev/null +++ b/docs/html/test_8h_source.html @@ -0,0 +1,196 @@ + + + + + + + +Manifold: test.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
test.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <ostream>
+
17
+
18#include "gtest/gtest.h"
+
19#include "manifold/common.h"
+
20#include "manifold/manifold.h"
+
21
+
22#ifdef MANIFOLD_EXPORT
+
23#include "manifold/meshIO.h"
+
24#endif
+
25
+
26// somehow gcc11 + gtest 1.11.0 is unable to print ivec3
+
27namespace glm {
+
28inline void PrintTo(const ivec3& point, std::ostream* os) {
+
29 *os << "(" << point.x << "," << point.y << "," << point.x << ")";
+
30}
+
31} // namespace glm
+
32
+
33using namespace manifold;
+
34
+
+
35struct Options {
+
36 bool exportModels = false;
+
37 manifold::ExecutionParams params = {};
+
38};
+
+
39
+
40extern Options options;
+
41
+
+
42struct MeshSize {
+
43 int numVert, numTri;
+
44 int numProp = 0;
+
45 int numPropVert = numVert;
+
46};
+
+
47
+
48Polygons SquareHole(double xOffset = 0.0);
+
49Mesh Csaszar();
+
50Mesh Tet();
+
51Manifold Gyroid();
+
52MeshGL TetGL();
+
53MeshGL CubeSTL();
+
54MeshGL CubeUV();
+
55MeshGL WithIndexColors(const MeshGL& in);
+
56MeshGL WithPositionColors(const Manifold& in);
+
57MeshGL WithNormals(const Manifold& in);
+
58float GetMaxProperty(const MeshGL& mesh, int channel);
+
59float GetMinProperty(const MeshGL& mesh, int channel);
+
60void CheckFinite(const MeshGL& mesh);
+
61void Identical(const Mesh& mesh1, const Mesh& mesh2);
+
62void RelatedGL(const Manifold& out, const std::vector<MeshGL>& originals,
+
63 bool checkNormals = false, bool updateNormals = false);
+
64void ExpectMeshes(const Manifold& manifold,
+
65 const std::vector<MeshSize>& meshSize);
+
66void CheckNormals(const Manifold& manifold);
+
67void CheckStrictly(const Manifold& manifold);
+
68void CheckGL(const Manifold& manifold);
+
69#ifdef MANIFOLD_EXPORT
+
70Manifold ReadMesh(const std::string& filename);
+
71#endif
+
72void RegisterPolygonTests();
+
Definition manifold.h:152
+
std::vector< SimplePolygon > Polygons
Definition common.h:153
+
Definition common.h:158
+
Definition common.h:645
+
Definition meshIO.h:20
+
Definition test.h:42
+
Definition test.h:35
+
Definition manifold.h:46
+
+
+ + + + diff --git a/docs/html/topics.html b/docs/html/topics.html new file mode 100644 index 000000000..7e1fc23eb --- /dev/null +++ b/docs/html/topics.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Topics + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Topics
+
+
+
Here is a list of all topics with brief descriptions:
+
[detail level 12]
+ + + + + + + + +
 MeshIO3D model file I/O based on Assimp
 SamplesExamples of usage and interesting designs
 CoreThe central classes of the library
 data structure definitionsAbstract away from glm. In the future the underlying data type can change
 ConnectionsMove data in and out of the Manifold class
 DebugDebugging features
 ExceptionsCustom Exceptions
 PrivateInternal classes of the library; not currently part of the public API
+
+
+
+ + + + diff --git a/docs/html/topics.js b/docs/html/topics.js new file mode 100644 index 000000000..dd11458f7 --- /dev/null +++ b/docs/html/topics.js @@ -0,0 +1,10 @@ +var topics = +[ + [ "MeshIO", "group___mesh_i_o.html", "group___mesh_i_o" ], + [ "Samples", "group___samples.html", "group___samples" ], + [ "Core", "group___core.html", "group___core" ], + [ "data structure definitions", "group___math.html", null ], + [ "Connections", "group___connections.html", "group___connections" ], + [ "Debug", "group___debug.html", "group___debug" ], + [ "Private", "group___private.html", "group___private" ] +]; \ No newline at end of file diff --git a/docs/html/tri__dist_8h_source.html b/docs/html/tri__dist_8h_source.html new file mode 100644 index 000000000..d6235f05e --- /dev/null +++ b/docs/html/tri__dist_8h_source.html @@ -0,0 +1,329 @@ + + + + + + + +Manifold: tri_dist.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
tri_dist.h
+
+
+
1// Copyright 2024 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include <array>
+
18#include <glm/glm.hpp>
+
19
+
20#include "manifold/common.h"
+
21
+
22namespace manifold {
+
23
+
24// From NVIDIA-Omniverse PhysX - BSD 3-Clause "New" or "Revised" License
+
25// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md
+
26// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/sweep/GuSweepCapsuleCapsule.cpp
+
27// With minor modifications
+
28
+
+
39inline void EdgeEdgeDist(vec3& x, vec3& y, // closest points
+
40 const vec3& p,
+
41 const vec3& a, // seg 1 origin, vector
+
42 const vec3& q,
+
43 const vec3& b) // seg 2 origin, vector
+
44{
+
45 const vec3 T = q - p;
+
46 const auto ADotA = glm::dot(a, a);
+
47 const auto BDotB = glm::dot(b, b);
+
48 const auto ADotB = glm::dot(a, b);
+
49 const auto ADotT = glm::dot(a, T);
+
50 const auto BDotT = glm::dot(b, T);
+
51
+
52 // t parameterizes ray (p, a)
+
53 // u parameterizes ray (q, b)
+
54
+
55 // Compute t for the closest point on ray (p, a) to ray (q, b)
+
56 const auto Denom = ADotA * BDotB - ADotB * ADotB;
+
57
+
58 double t; // We will clamp result so t is on the segment (p, a)
+
59 t = Denom != 0.0
+
60 ? glm::clamp((ADotT * BDotB - BDotT * ADotB) / Denom, 0.0, 1.0)
+
61 : 0.0;
+
62
+
63 // find u for point on ray (q, b) closest to point at t
+
64 double u;
+
65 if (BDotB != 0.0) {
+
66 u = (t * ADotB - BDotT) / BDotB;
+
67
+
68 // if u is on segment (q, b), t and u correspond to closest points,
+
69 // otherwise, clamp u, recompute and clamp t
+
70 if (u < 0.0) {
+
71 u = 0.0;
+
72 t = ADotA != 0.0 ? glm::clamp(ADotT / ADotA, 0.0, 1.0) : 0.0;
+
73 } else if (u > 1.0) {
+
74 u = 1.0;
+
75 t = ADotA != 0.0 ? glm::clamp((ADotB + ADotT) / ADotA, 0.0, 1.0) : 0.0;
+
76 }
+
77 } else {
+
78 u = 0.0;
+
79 t = ADotA != 0.0 ? glm::clamp(ADotT / ADotA, 0.0, 1.0) : 0.0;
+
80 }
+
81 x = p + a * t;
+
82 y = q + b * u;
+
83}
+
+
84
+
85// From NVIDIA-Omniverse PhysX - BSD 3-Clause "New" or "Revised" License
+
86// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md
+
87// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/distance/GuDistanceTriangleTriangle.cpp
+
88// With minor modifications
+
89
+
+
96inline auto DistanceTriangleTriangleSquared(const std::array<vec3, 3>& p,
+
97 const std::array<vec3, 3>& q) {
+
98 std::array<vec3, 3> Sv;
+
99 Sv[0] = p[1] - p[0];
+
100 Sv[1] = p[2] - p[1];
+
101 Sv[2] = p[0] - p[2];
+
102
+
103 std::array<vec3, 3> Tv;
+
104 Tv[0] = q[1] - q[0];
+
105 Tv[1] = q[2] - q[1];
+
106 Tv[2] = q[0] - q[2];
+
107
+
108 bool shown_disjoint = false;
+
109
+
110 auto mindd = std::numeric_limits<double>::max();
+
111
+
112 for (uint32_t i = 0; i < 3; i++) {
+
113 for (uint32_t j = 0; j < 3; j++) {
+
114 vec3 cp;
+
115 vec3 cq;
+
116 EdgeEdgeDist(cp, cq, p[i], Sv[i], q[j], Tv[j]);
+
117 const vec3 V = cq - cp;
+
118 const auto dd = glm::dot(V, V);
+
119
+
120 if (dd <= mindd) {
+
121 mindd = dd;
+
122
+
123 uint32_t id = i + 2;
+
124 if (id >= 3) id -= 3;
+
125 vec3 Z = p[id] - cp;
+
126 auto a = glm::dot(Z, V);
+
127 id = j + 2;
+
128 if (id >= 3) id -= 3;
+
129 Z = q[id] - cq;
+
130 auto b = glm::dot(Z, V);
+
131
+
132 if ((a <= 0.0) && (b >= 0.0)) {
+
133 return glm::dot(V, V);
+
134 };
+
135
+
136 if (a <= 0.0)
+
137 a = 0.0;
+
138 else if (b > 0.0)
+
139 b = 0.0;
+
140
+
141 if ((mindd - a + b) > 0.0) shown_disjoint = true;
+
142 }
+
143 }
+
144 }
+
145
+
146 vec3 Sn = glm::cross(Sv[0], Sv[1]);
+
147 auto Snl = glm::dot(Sn, Sn);
+
148
+
149 if (Snl > 1e-15) {
+
150 const vec3 Tp(glm::dot(p[0] - q[0], Sn), glm::dot(p[0] - q[1], Sn),
+
151 glm::dot(p[0] - q[2], Sn));
+
152
+
153 int index = -1;
+
154 if ((Tp[0] > 0.0) && (Tp[1] > 0.0) && (Tp[2] > 0.0)) {
+
155 index = Tp[0] < Tp[1] ? 0 : 1;
+
156 if (Tp[2] < Tp[index]) index = 2;
+
157 } else if ((Tp[0] < 0.0) && (Tp[1] < 0.0) && (Tp[2] < 0.0)) {
+
158 index = Tp[0] > Tp[1] ? 0 : 1;
+
159 if (Tp[2] > Tp[index]) index = 2;
+
160 }
+
161
+
162 if (index >= 0) {
+
163 shown_disjoint = true;
+
164
+
165 const vec3& qIndex = q[index];
+
166
+
167 vec3 V = qIndex - p[0];
+
168 vec3 Z = glm::cross(Sn, Sv[0]);
+
169 if (glm::dot(V, Z) > 0.0) {
+
170 V = qIndex - p[1];
+
171 Z = glm::cross(Sn, Sv[1]);
+
172 if (glm::dot(V, Z) > 0.0) {
+
173 V = qIndex - p[2];
+
174 Z = glm::cross(Sn, Sv[2]);
+
175 if (glm::dot(V, Z) > 0.0) {
+
176 vec3 cp = qIndex + Sn * Tp[index] / Snl;
+
177 vec3 cq = qIndex;
+
178 return glm::dot(cp - cq, cp - cq);
+
179 }
+
180 }
+
181 }
+
182 }
+
183 }
+
184
+
185 vec3 Tn = glm::cross(Tv[0], Tv[1]);
+
186 auto Tnl = glm::dot(Tn, Tn);
+
187
+
188 if (Tnl > 1e-15) {
+
189 const vec3 Sp(glm::dot(q[0] - p[0], Tn), glm::dot(q[0] - p[1], Tn),
+
190 glm::dot(q[0] - p[2], Tn));
+
191
+
192 int index = -1;
+
193 if ((Sp[0] > 0.0) && (Sp[1] > 0.0) && (Sp[2] > 0.0)) {
+
194 index = Sp[0] < Sp[1] ? 0 : 1;
+
195 if (Sp[2] < Sp[index]) index = 2;
+
196 } else if ((Sp[0] < 0.0) && (Sp[1] < 0.0) && (Sp[2] < 0.0)) {
+
197 index = Sp[0] > Sp[1] ? 0 : 1;
+
198 if (Sp[2] > Sp[index]) index = 2;
+
199 }
+
200
+
201 if (index >= 0) {
+
202 shown_disjoint = true;
+
203
+
204 const vec3& pIndex = p[index];
+
205
+
206 vec3 V = pIndex - q[0];
+
207 vec3 Z = glm::cross(Tn, Tv[0]);
+
208 if (glm::dot(V, Z) > 0.0) {
+
209 V = pIndex - q[1];
+
210 Z = glm::cross(Tn, Tv[1]);
+
211 if (glm::dot(V, Z) > 0.0) {
+
212 V = pIndex - q[2];
+
213 Z = glm::cross(Tn, Tv[2]);
+
214 if (glm::dot(V, Z) > 0.0) {
+
215 vec3 cp = pIndex;
+
216 vec3 cq = pIndex + Tn * Sp[index] / Tnl;
+
217 return glm::dot(cp - cq, cp - cq);
+
218 }
+
219 }
+
220 }
+
221 }
+
222 }
+
223
+
224 return shown_disjoint ? mindd : 0.0;
+
225};
+
+
226} // namespace manifold
+
Definition meshIO.h:20
+
void EdgeEdgeDist(vec3 &x, vec3 &y, const vec3 &p, const vec3 &a, const vec3 &q, const vec3 &b)
Definition tri_dist.h:39
+
auto DistanceTriangleTriangleSquared(const std::array< vec3, 3 > &p, const std::array< vec3, 3 > &q)
Definition tri_dist.h:96
+
+
+ + + + diff --git a/docs/html/types_8h_source.html b/docs/html/types_8h_source.html new file mode 100644 index 000000000..d5fe84852 --- /dev/null +++ b/docs/html/types_8h_source.html @@ -0,0 +1,236 @@ + + + + + + + +Manifold: types.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
types.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <stddef.h>
+
17
+
18// opaque pointers
+
19
+
20typedef struct ManifoldManifold ManifoldManifold;
+
21typedef struct ManifoldManifoldVec ManifoldManifoldVec;
+
22typedef struct ManifoldCrossSection ManifoldCrossSection;
+
23typedef struct ManifoldCrossSectionVec ManifoldCrossSectionVec;
+
24typedef struct ManifoldSimplePolygon ManifoldSimplePolygon;
+
25typedef struct ManifoldPolygons ManifoldPolygons;
+
26typedef struct ManifoldMesh ManifoldMesh;
+
27typedef struct ManifoldMeshGL ManifoldMeshGL;
+
28typedef struct ManifoldBox ManifoldBox;
+
29typedef struct ManifoldRect ManifoldRect;
+
30
+
31#ifdef MANIFOLD_EXPORT
+
32typedef struct ManifoldMaterial ManifoldMaterial;
+
33typedef struct ManifoldExportOptions ManifoldExportOptions;
+
34#endif
+
35
+
36// structs
+
37
+
+
38typedef struct ManifoldManifoldPair {
+
39 ManifoldManifold* first;
+
40 ManifoldManifold* second;
+ +
+
42
+
+
43typedef struct ManifoldVec2 {
+
44 double x;
+
45 double y;
+ +
+
47
+
+
48typedef struct ManifoldVec3 {
+
49 double x;
+
50 double y;
+
51 double z;
+ +
+
53
+
+
54typedef struct ManifoldIVec3 {
+
55 int x;
+
56 int y;
+
57 int z;
+ +
+
59
+
+
60typedef struct ManifoldVec4 {
+
61 double x;
+
62 double y;
+
63 double z;
+
64 double w;
+ +
+
66
+
+
67typedef struct ManifoldProperties {
+
68 double surface_area;
+
69 double volume;
+ +
+
71
+
72// enums
+
73
+
74typedef enum ManifoldOpType {
+
75 MANIFOLD_ADD,
+
76 MANIFOLD_SUBTRACT,
+
77 MANIFOLD_INTERSECT
+
78} ManifoldOpType;
+
79
+
80typedef enum ManifoldError {
+
81 MANIFOLD_NO_ERROR,
+
82 MANIFOLD_NON_FINITE_VERTEX,
+
83 MANIFOLD_NOT_MANIFOLD,
+
84 MANIFOLD_VERTEX_INDEX_OUT_OF_BOUNDS,
+
85 MANIFOLD_PROPERTIES_WRONG_LENGTH,
+
86 MANIFOLD_MISSING_POSITION_PROPERTIES,
+
87 MANIFOLD_MERGE_VECTORS_DIFFERENT_LENGTHS,
+
88 MANIFOLD_MERGE_INDEX_OUT_OF_BOUNDS,
+
89 MANIFOLD_TRANSFORM_WRONG_LENGTH,
+
90 MANIFOLD_RUN_INDEX_WRONG_LENGTH,
+
91 MANIFOLD_FACE_ID_WRONG_LENGTH,
+
92 MANIFOLD_INVALID_CONSTRUCTION,
+
93} ManifoldError;
+
94
+
95typedef enum ManifoldFillRule {
+
96 MANIFOLD_FILL_RULE_EVEN_ODD,
+
97 MANIFOLD_FILL_RULE_NON_ZERO,
+
98 MANIFOLD_FILL_RULE_POSITIVE,
+
99 MANIFOLD_FILL_RULE_NEGATIVE
+
100} ManifoldFillRule;
+
101
+
102typedef enum ManifoldJoinType {
+
103 MANIFOLD_JOIN_TYPE_SQUARE,
+
104 MANIFOLD_JOIN_TYPE_ROUND,
+
105 MANIFOLD_JOIN_TYPE_MITER,
+
106} ManifoldJoinType;
+
Definition types.h:54
+
Definition types.h:38
+
Definition types.h:67
+
Definition types.h:43
+
Definition types.h:48
+
Definition types.h:60
+
+
+ + + + diff --git a/docs/html/utils_8h_source.html b/docs/html/utils_8h_source.html new file mode 100644 index 000000000..d76ef46b6 --- /dev/null +++ b/docs/html/utils_8h_source.html @@ -0,0 +1,332 @@ + + + + + + + +Manifold: utils.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
utils.h
+
+
+
1// Copyright 2020 The Manifold Authors, Jared Hoberock and Nathan Bell of
+
2// NVIDIA Research
+
3//
+
4// Licensed under the Apache License, Version 2.0 (the "License");
+
5// you may not use this file except in compliance with the License.
+
6// You may obtain a copy of the License at
+
7//
+
8// http://www.apache.org/licenses/LICENSE-2.0
+
9//
+
10// Unless required by applicable law or agreed to in writing, software
+
11// distributed under the License is distributed on an "AS IS" BASIS,
+
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
13// See the License for the specific language governing permissions and
+
14// limitations under the License.
+
15
+
16#pragma once
+
17#include <atomic>
+
18#include <mutex>
+
19#include <unordered_map>
+
20
+
21#ifdef MANIFOLD_DEBUG
+
22#include <chrono>
+
23#include <iostream>
+
24#endif
+
25
+
26#include "manifold/parallel.h"
+
27#include "manifold/vec.h"
+
28
+
29#if __has_include(<tracy/Tracy.hpp>)
+
30#include <tracy/Tracy.hpp>
+
31#else
+
32#define FrameMarkStart(x)
+
33#define FrameMarkEnd(x)
+
34// putting ZoneScoped in a function will instrument the function execution when
+
35// TRACY_ENABLE is set, which allows the profiler to record more accurate
+
36// timing.
+
37#define ZoneScoped
+
38#define ZoneScopedN(name)
+
39#endif
+
40
+
41namespace manifold {
+
42
+
47#ifdef MANIFOLD_DEBUG
+
+
48struct Timer {
+
49 std::chrono::high_resolution_clock::time_point start, end;
+
50
+
51 void Start() { start = std::chrono::high_resolution_clock::now(); }
+
52
+
53 void Stop() { end = std::chrono::high_resolution_clock::now(); }
+
54
+
55 float Elapsed() {
+
56 return std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
+
57 .count();
+
58 }
+
59 void Print(std::string message) {
+
60 std::cout << "----------- " << std::round(Elapsed()) << " ms for "
+
61 << message << std::endl;
+
62 }
+
63};
+
+
64#endif
+
65
+
66inline int Next3(int i) {
+
67 constexpr ivec3 next3(1, 2, 0);
+
68 return next3[i];
+
69}
+
70
+
71inline int Prev3(int i) {
+
72 constexpr ivec3 prev3(2, 0, 1);
+
73 return prev3[i];
+
74}
+
75
+
76template <typename T, typename T1>
+
77void Permute(Vec<T>& inOut, const Vec<T1>& new2Old) {
+
78 Vec<T> tmp(std::move(inOut));
+
79 inOut.resize(new2Old.size());
+
80 gather(new2Old.begin(), new2Old.end(), tmp.begin(), inOut.begin());
+
81}
+
82
+
83template <typename T, typename T1>
+
84void Permute(std::vector<T>& inOut, const Vec<T1>& new2Old) {
+
85 std::vector<T> tmp(std::move(inOut));
+
86 inOut.resize(new2Old.size());
+
87 gather(new2Old.begin(), new2Old.end(), tmp.begin(), inOut.begin());
+
88}
+
89
+
90template <typename T>
+
91T AtomicAdd(T& target, T add) {
+
92 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
93 T old_val = tar.load();
+
94 while (!tar.compare_exchange_weak(old_val, old_val + add,
+
95 std::memory_order_seq_cst)) {
+
96 }
+
97 return old_val;
+
98}
+
99
+
100template <>
+
101inline int AtomicAdd(int& target, int add) {
+
102 std::atomic<int>& tar = reinterpret_cast<std::atomic<int>&>(target);
+
103 int old_val = tar.fetch_add(add, std::memory_order_seq_cst);
+
104 return old_val;
+
105}
+
106
+
107template <typename T>
+
+ +
109 public:
+
110 ConcurrentSharedPtr(T value) : impl(std::make_shared<T>(value)) {}
+ +
112 : impl(other.impl), mutex(other.mutex) {}
+
+ +
114 public:
+
115 SharedPtrGuard(std::recursive_mutex* mutex, T* content)
+
116 : mutex(mutex), content(content) {
+
117 mutex->lock();
+
118 }
+
119 ~SharedPtrGuard() { mutex->unlock(); }
+
120
+
121 T& operator*() { return *content; }
+
122 T* operator->() { return content; }
+
123
+
124 private:
+
125 std::recursive_mutex* mutex;
+
126 T* content;
+
127 };
+
+
128 SharedPtrGuard GetGuard() { return SharedPtrGuard(mutex.get(), impl.get()); };
+
129 unsigned int UseCount() { return impl.use_count(); };
+
130
+
131 private:
+
132 std::shared_ptr<T> impl;
+
133 std::shared_ptr<std::recursive_mutex> mutex =
+
134 std::make_shared<std::recursive_mutex>();
+
135};
+
+
136
+
137template <typename I = int, typename R = unsigned char>
+
+
138struct UnionFind {
+
139 Vec<I> parents;
+
140 // we do union by rank
+
141 // note that we shift rank by 1, rank 0 means it is not connected to anything
+
142 // else
+
143 Vec<R> ranks;
+
144
+
145 UnionFind(I numNodes) : parents(numNodes), ranks(numNodes, 0) {
+
146 sequence(parents.begin(), parents.end());
+
147 }
+
148
+
149 I find(I x) {
+
150 while (parents[x] != x) {
+
151 parents[x] = parents[parents[x]];
+
152 x = parents[x];
+
153 }
+
154 return x;
+
155 }
+
156
+
157 void unionXY(I x, I y) {
+
158 if (x == y) return;
+
159 if (ranks[x] == 0) ranks[x] = 1;
+
160 if (ranks[y] == 0) ranks[y] = 1;
+
161 x = find(x);
+
162 y = find(y);
+
163 if (x == y) return;
+
164 if (ranks[x] < ranks[y]) std::swap(x, y);
+
165 if (ranks[x] == ranks[y]) ranks[x]++;
+
166 parents[y] = x;
+
167 }
+
168
+
169 I connectedComponents(std::vector<I>& components) {
+
170 components.resize(parents.size());
+
171 I lonelyNodes = 0;
+
172 std::unordered_map<I, I> toLabel;
+
173 for (size_t i = 0; i < parents.size(); ++i) {
+
174 // we optimize for connected component of size 1
+
175 // no need to put them into the hashmap
+
176 if (ranks[i] == 0) {
+
177 components[i] = static_cast<I>(toLabel.size()) + lonelyNodes++;
+
178 continue;
+
179 }
+
180 parents[i] = find(i);
+
181 auto iter = toLabel.find(parents[i]);
+
182 if (iter == toLabel.end()) {
+
183 I s = static_cast<I>(toLabel.size()) + lonelyNodes;
+
184 toLabel.insert(std::make_pair(parents[i], s));
+
185 components[i] = s;
+
186 } else {
+
187 components[i] = iter->second;
+
188 }
+
189 }
+
190 return toLabel.size() + lonelyNodes;
+
191 }
+
192};
+
+
193
+
194template <typename T>
+
+
195struct Identity {
+
196 T operator()(T v) const { return v; }
+
197};
+
+
198
+
199template <typename T>
+
+
200struct Negate {
+
201 T operator()(T v) const { return -v; }
+
202};
+
+
203
+
205} // namespace manifold
+ +
Definition utils.h:108
+
Definition vec.h:43
+
Definition meshIO.h:20
+
Definition utils.h:195
+
Definition utils.h:200
+
Definition utils.h:48
+
Definition utils.h:138
+
+
+ + + + diff --git a/docs/html/vec_8h_source.html b/docs/html/vec_8h_source.html new file mode 100644 index 000000000..e55b09116 --- /dev/null +++ b/docs/html/vec_8h_source.html @@ -0,0 +1,357 @@ + + + + + + + +Manifold: vec.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vec.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#if TRACY_ENABLE && TRACY_MEMORY_USAGE
+
17#include "tracy/Tracy.hpp"
+
18#else
+
19#define TracyAllocS(ptr, size, n) (void)0
+
20#define TracyFreeS(ptr, n) (void)0
+
21#endif
+
22
+
23#include "manifold/parallel.h"
+
24#include "manifold/vec_view.h"
+
25
+
26namespace manifold {
+
27
+
31template <typename T>
+
32class Vec;
+
33
+
34/*
+
35 * Specialized vector implementation with multithreaded fill and uninitialized
+
36 * memory optimizations.
+
37 * Note that the constructor and resize function will not perform initialization
+
38 * if the parameter val is not set. Also, this implementation is a toy
+
39 * implementation that did not consider things like non-trivial
+
40 * constructor/destructor, please keep T trivial.
+
41 */
+
42template <typename T>
+
+
43class Vec : public VecView<T> {
+
44 public:
+
45 Vec() {}
+
46
+
47 // Note that the vector constructed with this constructor will contain
+
48 // uninitialized memory. Please specify `val` if you need to make sure that
+
49 // the data is initialized.
+
50 Vec(size_t size) {
+
51 reserve(size);
+
52 this->size_ = size;
+
53 }
+
54
+
55 Vec(size_t size, T val) { resize(size, val); }
+
56
+
57 Vec(const Vec<T> &vec) { *this = Vec(vec.view()); }
+
58
+
59 Vec(const VecView<const T> &vec) {
+
60 this->size_ = vec.size();
+
61 this->capacity_ = this->size_;
+
62 auto policy = autoPolicy(this->size_);
+
63 if (this->size_ != 0) {
+
64 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
65 ASSERT(this->ptr_ != nullptr, std::bad_alloc());
+
66 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
67 copy(policy, vec.begin(), vec.end(), this->ptr_);
+
68 }
+
69 }
+
70
+
71 Vec(const std::vector<T> &vec) {
+
72 this->size_ = vec.size();
+
73 this->capacity_ = this->size_;
+
74 auto policy = autoPolicy(this->size_);
+
75 if (this->size_ != 0) {
+
76 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
77 ASSERT(this->ptr_ != nullptr, std::bad_alloc());
+
78 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
79 copy(policy, vec.begin(), vec.end(), this->ptr_);
+
80 }
+
81 }
+
82
+
83 Vec(Vec<T> &&vec) {
+
84 this->ptr_ = vec.ptr_;
+
85 this->size_ = vec.size_;
+
86 capacity_ = vec.capacity_;
+
87 vec.ptr_ = nullptr;
+
88 vec.size_ = 0;
+
89 vec.capacity_ = 0;
+
90 }
+
91
+
92 operator VecView<T>() { return {this->ptr_, this->size_}; }
+
93 operator VecView<const T>() const { return {this->ptr_, this->size_}; }
+
94
+
95 ~Vec() {
+
96 if (this->ptr_ != nullptr) {
+
97 TracyFreeS(this->ptr_, 3);
+
98 free(this->ptr_);
+
99 }
+
100 this->ptr_ = nullptr;
+
101 this->size_ = 0;
+
102 capacity_ = 0;
+
103 }
+
104
+
105 Vec<T> &operator=(const Vec<T> &other) {
+
106 if (&other == this) return *this;
+
107 if (this->ptr_ != nullptr) {
+
108 TracyFreeS(this->ptr_, 3);
+
109 free(this->ptr_);
+
110 }
+
111 this->size_ = other.size_;
+
112 capacity_ = other.size_;
+
113 auto policy = autoPolicy(this->size_);
+
114 if (this->size_ != 0) {
+
115 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
116 ASSERT(this->ptr_ != nullptr, std::bad_alloc());
+
117 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
118 copy(policy, other.begin(), other.end(), this->ptr_);
+
119 }
+
120 return *this;
+
121 }
+
122
+
123 Vec<T> &operator=(Vec<T> &&other) {
+
124 if (&other == this) return *this;
+
125 if (this->ptr_ != nullptr) {
+
126 TracyFreeS(this->ptr_, 3);
+
127 free(this->ptr_);
+
128 }
+
129 this->size_ = other.size_;
+
130 capacity_ = other.capacity_;
+
131 this->ptr_ = other.ptr_;
+
132 other.ptr_ = nullptr;
+
133 other.size_ = 0;
+
134 other.capacity_ = 0;
+
135 return *this;
+
136 }
+
137
+
138 operator VecView<T>() const { return {this->ptr_, this->size_}; }
+
139
+
140 void swap(Vec<T> &other) {
+
141 std::swap(this->ptr_, other.ptr_);
+
142 std::swap(this->size_, other.size_);
+
143 std::swap(capacity_, other.capacity_);
+
144 }
+
145
+
146 inline void push_back(const T &val) {
+
147 if (this->size_ >= capacity_) {
+
148 // avoid dangling pointer in case val is a reference of our array
+
149 T val_copy = val;
+
150 reserve(capacity_ == 0 ? 128 : capacity_ * 2);
+
151 this->ptr_[this->size_++] = val_copy;
+
152 return;
+
153 }
+
154 this->ptr_[this->size_++] = val;
+
155 }
+
156
+
157 void reserve(size_t n) {
+
158 if (n > capacity_) {
+
159 T *newBuffer = reinterpret_cast<T *>(malloc(n * sizeof(T)));
+
160 ASSERT(newBuffer != nullptr, std::bad_alloc());
+
161 TracyAllocS(newBuffer, n * sizeof(T), 3);
+
162 if (this->size_ > 0)
+
163 copy(autoPolicy(this->size_), this->ptr_, this->ptr_ + this->size_,
+
164 newBuffer);
+
165 if (this->ptr_ != nullptr) {
+
166 TracyFreeS(this->ptr_, 3);
+
167 free(this->ptr_);
+
168 }
+
169 this->ptr_ = newBuffer;
+
170 capacity_ = n;
+
171 }
+
172 }
+
173
+
174 void resize(size_t newSize, T val = T()) {
+
175 bool shrink = this->size_ > 2 * newSize;
+
176 reserve(newSize);
+
177 if (this->size_ < newSize) {
+
178 fill(autoPolicy(newSize - this->size_), this->ptr_ + this->size_,
+
179 this->ptr_ + newSize, val);
+
180 }
+
181 this->size_ = newSize;
+
182 if (shrink) shrink_to_fit();
+
183 }
+
184
+
185 void pop_back() { resize(this->size_ - 1); }
+
186
+
187 void clear() { resize(0); }
+
188
+
189 void shrink_to_fit() {
+
190 T *newBuffer = nullptr;
+
191 if (this->size_ > 0) {
+
192 newBuffer = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
193 ASSERT(newBuffer != nullptr, std::bad_alloc());
+
194 TracyAllocS(newBuffer, this->size_ * sizeof(T), 3);
+
195 copy(autoPolicy(this->size_), this->ptr_, this->ptr_ + this->size_,
+
196 newBuffer);
+
197 }
+
198 if (this->ptr_ != nullptr) {
+
199 TracyFreeS(this->ptr_, 3);
+
200 free(this->ptr_);
+
201 }
+
202 this->ptr_ = newBuffer;
+
203 capacity_ = this->size_;
+
204 }
+
205
+
206 VecView<T> view(size_t offset = 0,
+
207 size_t length = std::numeric_limits<size_t>::max()) {
+
208 if (length == std::numeric_limits<size_t>::max())
+
209 length = this->size_ - offset;
+
210 ASSERT(length >= 0, std::out_of_range("Vec::view out of range"));
+
211 ASSERT(offset + length <= this->size_ && offset >= 0,
+
212 std::out_of_range("Vec::view out of range"));
+
213 return VecView<T>(this->ptr_ + offset, length);
+
214 }
+
215
+
216 VecView<const T> cview(
+
217 size_t offset = 0,
+
218 size_t length = std::numeric_limits<size_t>::max()) const {
+
219 if (length == std::numeric_limits<size_t>::max())
+
220 length = this->size_ - offset;
+
221 ASSERT(length >= 0, std::out_of_range("Vec::cview out of range"));
+
222 ASSERT(offset + length <= this->size_ && offset >= 0,
+
223 std::out_of_range("Vec::cview out of range"));
+
224 return VecView<const T>(this->ptr_ + offset, length);
+
225 }
+
226
+
227 VecView<const T> view(
+
228 size_t offset = 0,
+
229 size_t length = std::numeric_limits<size_t>::max()) const {
+
230 return cview(offset, length);
+
231 }
+
232
+
233 T *data() { return this->ptr_; }
+
234 const T *data() const { return this->ptr_; }
+
235
+
236 size_t capacity() const { return capacity_; }
+
237
+
238 private:
+
239 size_t capacity_ = 0;
+
240
+
241 static_assert(std::is_trivially_destructible<T>::value);
+
242};
+
+
244} // namespace manifold
+
Definition vec.h:43
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/vec__view_8h_source.html b/docs/html/vec__view_8h_source.html new file mode 100644 index 000000000..11c9eb68b --- /dev/null +++ b/docs/html/vec__view_8h_source.html @@ -0,0 +1,223 @@ + + + + + + + +Manifold: vec_view.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vec_view.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include "manifold/optional_assert.h"
+
18
+
19namespace manifold {
+
20
+
26template <typename T>
+
+
27class VecView {
+
28 public:
+
29 using Iter = T *;
+
30 using IterC = const T *;
+
31
+
32 VecView(T *ptr, size_t size) : ptr_(ptr), size_(size) {}
+
33
+
34 VecView(const VecView &other) {
+
35 ptr_ = other.ptr_;
+
36 size_ = other.size_;
+
37 }
+
38
+
39 VecView &operator=(const VecView &other) {
+
40 ptr_ = other.ptr_;
+
41 size_ = other.size_;
+
42 return *this;
+
43 }
+
44
+
45 // allows conversion to a const VecView
+
46 operator VecView<const T>() const { return {ptr_, size_}; }
+
47
+
48 inline const T &operator[](size_t i) const {
+
49 ASSERT(i < size_, std::out_of_range("Vec out of range"));
+
50 return ptr_[i];
+
51 }
+
52
+
53 inline T &operator[](size_t i) {
+
54 ASSERT(i < size_, std::out_of_range("Vec out of range"));
+
55 return ptr_[i];
+
56 }
+
57
+
58 IterC cbegin() const { return ptr_; }
+
59 IterC cend() const { return ptr_ + size_; }
+
60
+
61 IterC begin() const { return cbegin(); }
+
62 IterC end() const { return cend(); }
+
63
+
64 Iter begin() { return ptr_; }
+
65 Iter end() { return ptr_ + size_; }
+
66
+
67 const T &front() const {
+
68 ASSERT(size_ != 0,
+
69 std::out_of_range("Attempt to take the front of an empty vector"));
+
70 return ptr_[0];
+
71 }
+
72
+
73 const T &back() const {
+
74 ASSERT(size_ != 0,
+
75 std::out_of_range("Attempt to take the back of an empty vector"));
+
76 return ptr_[size_ - 1];
+
77 }
+
78
+
79 T &front() {
+
80 ASSERT(size_ != 0,
+
81 std::out_of_range("Attempt to take the front of an empty vector"));
+
82 return ptr_[0];
+
83 }
+
84
+
85 T &back() {
+
86 ASSERT(size_ != 0,
+
87 std::out_of_range("Attempt to take the back of an empty vector"));
+
88 return ptr_[size_ - 1];
+
89 }
+
90
+
91 size_t size() const { return size_; }
+
92
+
93 bool empty() const { return size_ == 0; }
+
94
+
95#ifdef MANIFOLD_DEBUG
+
96 void Dump() const {
+
97 std::cout << "Vec = " << std::endl;
+
98 for (size_t i = 0; i < size(); ++i) {
+
99 std::cout << i << ", " << ptr_[i] << ", " << std::endl;
+
100 }
+
101 std::cout << std::endl;
+
102 }
+
103#endif
+
104
+
105 protected:
+
106 T *ptr_ = nullptr;
+
107 size_t size_ = 0;
+
108
+
109 VecView() = default;
+
110};
+
+
111
+
112} // namespace manifold
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/editor.d.ts b/editor.d.ts new file mode 100644 index 000000000..bfc464b22 --- /dev/null +++ b/editor.d.ts @@ -0,0 +1,3290 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {Manifold, Mat4, Vec2, Vec3} from './manifold'; + +declare class GLTFNode { + manifold?: Manifold; + translation?: Vec3|((t: number) => Vec3); + rotation?: Vec3|((t: number) => Vec3); + scale?: Vec3|((t: number) => Vec3); + material?: GLTFMaterial; + name?: string; + constructor(parent?: GLTFNode); + clone(parent?: GLTFNode): GLTFNode; +} + +type Attribute = 'POSITION'|'NORMAL'|'TANGENT'|'TEXCOORD_0'|'TEXCOORD_1'| + 'COLOR_0'|'JOINTS_0'|'WEIGHTS_0'|'SKIP_1'|'SKIP_2'|'SKIP_3'|'SKIP_4'; + +declare class GLTFMaterial { + attributes?: Attribute[]; + roughness?: number; + metallic?: number; + baseColorFactor?: [number, number, number]; + alpha?: number; + unlit?: boolean; + name?: string; +} + +declare const globalDefaults: { + roughness: number, + metallic: number, + baseColorFactor: [number, number, number], + alpha: number, + unlit: boolean, + animationLength: number, + animationMode: 'loop'|'ping-pong'; +} + +/** + * Returns a shallow copy of the input manifold with the given material + * properties applied. They will be carried along through operations. + * + * @param manifold The input object. + * @param material A set of material properties to apply to this manifold. + */ +declare function setMaterial(manifold: Manifold, material: GLTFMaterial): + Manifold; + +/** + * Apply a morphing animation to the input manifold. Specify the start + * function which will be applied to the vertex positions of the first frame and + * linearly interpolated across the length of the overall animation. This + * animation will only be shown if this manifold is used directly on a GLTFNode. + * + * @param manifold The object to add morphing animation to. + * @param func A warping function to apply to the first animation frame. + */ +declare function setMorphStart( + manifold: Manifold, func: (v: Vec3) => void): void; + +/** + * Apply a morphing animation to the input manifold. Specify the end + * function which will be applied to the vertex positions of the last frame and + * linearly interpolated across the length of the overall animation. This + * animation will only be shown if this manifold is used directly on a GLTFNode. + * + * @param manifold The object to add morphing animation to. + * @param func A warping function to apply to the last animation frame. + */ +declare function setMorphEnd(manifold: Manifold, func: (v: Vec3) => void): void; + +/** + * Wrap any shape object with this method to display it and any copies in + * transparent red. This is particularly useful for debugging subtract() as it + * will allow you find the object even if it doesn't currently intersect the + * result. + * + * @param shape The object to show - returned for chaining. + */ +declare function show(shape: CrossSection|Manifold): Manifold; + +/** + * Wrap any shape object with this method to display it and any copies as the + * result, while ghosting out the final result in transparent gray. Helpful for + * debugging as it allows you to see objects that may be hidden in the interior + * of the result. Multiple objects marked only() will all be shown. + * + * @param shape The object to show - returned for chaining. + */ +declare function only(shape: CrossSection|Manifold): Manifold; + +// Type definitions for gl-matrix 3.4.3 Project: +// https://github.com/toji/gl-matrix +// +// Definitions by: Mattijs Kneppers , +// +// based on definitions by Tat +// +// Definitions by: Nikolay Babanov + +declare const glMatrix: GLMatrix; + +interface GLMatrix { + glMatrix: TopAPI; + vec2: Vec2API; + vec3: Vec3API; + vec4: Vec4API; + mat2: Mat2API; + mat2d: Mat2dAPI; + mat3: Mat3API; + mat4: Mat4API; + quat: QuatAPI; +} + +interface TopAPI { + // Configuration constants + EPSILON: number; + ARRAY_TYPE: any; + RANDOM(): number; + ENABLE_SIMD: boolean; + + // Compatibility detection + SIMD_AVAILABLE: boolean; + USE_SIMD: boolean; + + /** + * Sets the type of array used when creating new vectors and matrices + * + * @param {any} type - Array type, such as Float32Array or Array + */ + setMatrixArrayType(type: any): void; + + /** + * Convert Degree To Radian + * + * @param {number} a - Angle in Degrees + */ + toRadian(a: number): number; + + /** + * Tests whether or not the arguments have approximately the same value, + * within an absolute or relative tolerance of glMatrix.EPSILON (an absolute + * tolerance is used for values less than or equal to 1.0, and a relative + * tolerance is used for larger values) + * + * @param {number} a - The first number to test. + * @param {number} b - The second number to test. + * @returns {boolean} True if the numbers are approximately equal, false + * otherwise. + */ + equals(a: number, b: number): boolean; +} + +type Vec4 = [number, number, number, number]; +type Mat2 = [ + number, + number, + number, + number, +]; +type Mat2d = [ + number, + number, + number, + number, + number, + number, +]; +type Mat3 = [ + number, + number, + number, + number, + number, + number, + number, + number, + number, +]; +type Quat = [number, number, number, number]; + +interface Vec2API { + /** + * Creates a new, empty Vec2 + * + * @returns a new 2D vector + */ + create(): Vec2; + + /** + * Creates a new Vec2 initialized with values from an existing vector + * + * @param a a vector to clone + * @returns a new 2D vector + */ + clone(a: Vec2): Vec2; + + /** + * Creates a new Vec2 initialized with the given values + * + * @param x X component + * @param y Y component + * @returns a new 2D vector + */ + fromValues(x: number, y: number): Vec2; + + /** + * Copy the values from one Vec2 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec2, a: Vec2): Vec2; + + /** + * Set the components of a Vec2 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @returns out + */ + set(out: Vec2, x: number, y: number): Vec2; + + /** + * Adds two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Multiplies two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Multiplies two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Divides two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Divides two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Math.ceil the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to ceil + * @returns {Vec2} out + */ + ceil(out: Vec2, a: Vec2): Vec2; + + /** + * Math.floor the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to floor + * @returns {Vec2} out + */ + floor(out: Vec2, a: Vec2): Vec2; + + /** + * Returns the minimum of two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Returns the maximum of two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Rotates the 2D vector. + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to rotate + * @param {Vec2} b origin of the rotation + * @param {number} rad angle of rotation in radians + * @returns {Vec2} out + */ + rotate(out: Vec2, a: Vec2, b: Vec2, rad: number): Vec2; + + /** + * Math.round the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to round + * @returns {Vec2} out + */ + round(out: Vec2, a: Vec2): Vec2; + + /** + * Scales a Vec2 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec2, a: Vec2, b: number): Vec2; + + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec2, a: Vec2, b: Vec2, scale: number): Vec2; + + /** + * Calculates the euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec2, b: Vec2): number; + + /** + * Calculates the euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec2, b: Vec2): number; + + /** + * Calculates the squared euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec2, b: Vec2): number; + + /** + * Calculates the squared euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec2, b: Vec2): number; + + /** + * Calculates the length of a Vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec2): number; + + /** + * Calculates the length of a Vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec2): number; + + /** + * Calculates the squared length of a Vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec2): number; + + /** + * Calculates the squared length of a Vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec2): number; + + /** + * Negates the components of a Vec2 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec2, a: Vec2): Vec2; + + /** + * Returns the inverse of the components of a Vec2 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec2, a: Vec2): Vec2; + + /** + * Normalize a Vec2 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec2, a: Vec2): Vec2; + + /** + * Calculates the dot product of two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec2, b: Vec2): number; + + /** + * Computes the cross product of two Vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + cross(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Performs a linear interpolation between two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec2, a: Vec2, b: Vec2, t: number): Vec2; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec2): Vec2; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale Length of the resulting vector. If ommitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec2, scale: number): Vec2; + + /** + * Transforms the Vec2 with a Mat2 + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat2(out: Vec2, a: Vec2, m: Mat2): Vec2; + + /** + * Transforms the Vec2 with a Mat2d + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat2d(out: Vec2, a: Vec2, m: Mat2d): Vec2; + + /** + * Transforms the Vec2 with a Mat3 + * 3rd vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat3(out: Vec2, a: Vec2, m: Mat3): Vec2; + + /** + * Transforms the Vec2 with a Mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec2, a: Vec2, m: Mat4): Vec2; + + /** + * Perform some operation over an array of vec2Types. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec2. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2Types to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec2, b: Vec2, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec2Types. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec2. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2Types to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec2, b: Vec2) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec2): string; + + /** + * Returns whether or not the vectors exactly have the same elements in the + * same position (when compared with ===) + * + * @param {Vec2} a The first vector. + * @param {Vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec2, b: Vec2): boolean; + + /** + * Returns whether or not the vectors have approximately the same elements + * in the same position. + * + * @param {Vec2} a The first vector. + * @param {Vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec2, b: Vec2): boolean; +} + +// Vec3 +interface Vec3API { + /** + * Creates a new, empty Vec3 + * + * @returns a new 3D vector + */ + create(): Vec3; + + /** + * Creates a new Vec3 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 3D vector + */ + clone(a: Vec3): Vec3; + + /** + * Creates a new Vec3 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @returns a new 3D vector + */ + fromValues(x: number, y: number, z: number): Vec3; + + /** + * Copy the values from one Vec3 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec3, a: Vec3): Vec3; + + /** + * Set the components of a Vec3 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @returns out + */ + set(out: Vec3, x: number, y: number, z: number): Vec3; + + /** + * Adds two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec3, a: Vec3, b: Vec3): Vec3 + + /** + * Multiplies two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Multiplies two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Divides two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Divides two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Math.ceil the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to ceil + * @returns {Vec3} out + */ + ceil(out: Vec3, a: Vec3): Vec3; + + /** + * Math.floor the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to floor + * @returns {Vec3} out + */ + floor(out: Vec3, a: Vec3): Vec3; + + /** + * Returns the minimum of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Returns the maximum of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Math.round the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to round + * @returns {Vec3} out + */ + round(out: Vec3, a: Vec3): Vec3 + + /** + * Scales a Vec3 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec3, a: Vec3, b: number): Vec3; + + /** + * Adds two Vec3's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec3, a: Vec3, b: Vec3, scale: number): Vec3; + + /** + * Calculates the euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec3, b: Vec3): number; + + /** + * Calculates the euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec3, b: Vec3): number; + + /** + * Calculates the squared euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec3, b: Vec3): number; + + /** + * Calculates the squared euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec3, b: Vec3): number; + + /** + * Calculates the length of a Vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec3): number; + + /** + * Calculates the length of a Vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec3): number; + + /** + * Calculates the squared length of a Vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec3): number; + + /** + * Calculates the squared length of a Vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec3): number; + + /** + * Negates the components of a Vec3 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec3, a: Vec3): Vec3; + + /** + * Returns the inverse of the components of a Vec3 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec3, a: Vec3): Vec3; + + /** + * Normalize a Vec3 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec3, a: Vec3): Vec3; + + /** + * Calculates the dot product of two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec3, b: Vec3): number; + + /** + * Computes the cross product of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + cross(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Performs a linear interpolation between two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec3, a: Vec3, b: Vec3, t: number): Vec3; + + /** + * Performs a hermite interpolation with two control points + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a the first operand + * @param {Vec3} b the second operand + * @param {Vec3} c the third operand + * @param {Vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {Vec3} out + */ + hermite(out: Vec3, a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: number): Vec3; + + /** + * Performs a bezier interpolation with two control points + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a the first operand + * @param {Vec3} b the second operand + * @param {Vec3} c the third operand + * @param {Vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {Vec3} out + */ + bezier(out: Vec3, a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: number): Vec3; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec3): Vec3; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param [scale] Length of the resulting vector. If omitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec3, scale: number): Vec3; + + /** + * Transforms the Vec3 with a Mat3. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m the 3x3 matrix to transform with + * @returns out + */ + transformMat3(out: Vec3, a: Vec3, m: Mat3): Vec3; + + /** + * Transforms the Vec3 with a Mat4. + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec3, a: Vec3, m: Mat4): Vec3; + + /** + * Transforms the Vec3 with a Quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q Quaternion to transform with + * @returns out + */ + transformQuat(out: Vec3, a: Vec3, q: Quat): Vec3; + + + /** + * Rotate a 3D vector around the x-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateX(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Rotate a 3D vector around the y-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateY(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Rotate a 3D vector around the z-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateZ(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec3. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec3, b: Vec3, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec3. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec3, b: Vec3) => void): Float32Array; + + /** + * Get the angle between two 3D vectors + * @param a The first operand + * @param b The second operand + * @returns The angle in radians + */ + angle(a: Vec3, b: Vec3): number; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec3): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Vec3} a The first vector. + * @param {Vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec3, b: Vec3): boolean + + /** + * Returns whether or not the vectors have approximately the same + * elements in the same position. + * + * @param {Vec3} a The first vector. + * @param {Vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec3, b: Vec3): boolean +} + +// Vec4 +interface Vec4API { + /** + * Creates a new, empty Vec4 + * + * @returns a new 4D vector + */ + create(): Vec4; + + /** + * Creates a new Vec4 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 4D vector + */ + clone(a: Vec4): Vec4; + + /** + * Creates a new Vec4 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new 4D vector + */ + fromValues(x: number, y: number, z: number, w: number): Vec4; + + /** + * Copy the values from one Vec4 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec4, a: Vec4): Vec4; + + /** + * Set the components of a Vec4 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + */ + set(out: Vec4, x: number, y: number, z: number, w: number): Vec4; + + /** + * Adds two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Multiplies two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Multiplies two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Divides two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Divides two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Math.ceil the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to ceil + * @returns {Vec4} out + */ + ceil(out: Vec4, a: Vec4): Vec4; + + /** + * Math.floor the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to floor + * @returns {Vec4} out + */ + floor(out: Vec4, a: Vec4): Vec4; + + /** + * Returns the minimum of two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Returns the maximum of two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Math.round the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to round + * @returns {Vec4} out + */ + round(out: Vec4, a: Vec4): Vec4; + + /** + * Scales a Vec4 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec4, a: Vec4, b: number): Vec4; + + /** + * Adds two Vec4's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec4, a: Vec4, b: Vec4, scale: number): Vec4; + + /** + * Calculates the euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec4, b: Vec4): number; + + /** + * Calculates the euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec4, b: Vec4): number; + + /** + * Calculates the squared euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec4, b: Vec4): number; + + /** + * Calculates the squared euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec4, b: Vec4): number; + + /** + * Calculates the length of a Vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec4): number; + + /** + * Calculates the length of a Vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec4): number; + + /** + * Calculates the squared length of a Vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec4): number; + + /** + * Calculates the squared length of a Vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec4): number; + + /** + * Negates the components of a Vec4 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec4, a: Vec4): Vec4; + + /** + * Returns the inverse of the components of a Vec4 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec4, a: Vec4): Vec4; + + /** + * Normalize a Vec4 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec4, a: Vec4): Vec4; + + /** + * Calculates the dot product of two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec4, b: Vec4): number; + + /** + * Performs a linear interpolation between two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec4, a: Vec4, b: Vec4, t: number): Vec4; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec4): Vec4; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale length of the resulting vector. If ommitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec4, scale: number): Vec4; + + /** + * Transforms the Vec4 with a Mat4. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec4, a: Vec4, m: Mat4): Vec4; + + /** + * Transforms the Vec4 with a Quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q Quaternion to transform with + * @returns out + */ + + transformQuat(out: Vec4, a: Vec4, q: Quat): Vec4; + + /** + * Perform some operation over an array of Vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec4. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of Vec4s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec4, b: Vec4, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of Vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec4. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of Vec4s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec4, b: Vec4) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec4): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Vec4} a The first vector. + * @param {Vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec4, b: Vec4): boolean; + + /** + * Returns whether or not the vectors have approximately the same elements + * in the same position. + * + * @param {Vec4} a The first vector. + * @param {Vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec4, b: Vec4): boolean; +} + +// Mat2 +interface Mat2API { + /** + * Creates a new identity Mat2 + * + * @returns a new 2x2 matrix + */ + create(): Mat2; + + /** + * Creates a new Mat2 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x2 matrix + */ + clone(a: Mat2): Mat2; + + /** + * Copy the values from one Mat2 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat2, a: Mat2): Mat2; + + /** + * Set a Mat2 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat2): Mat2; + + /** + * Create a new Mat2 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {Mat2} out A new 2x2 matrix + */ + fromValues(m00: number, m01: number, m10: number, m11: number): Mat2; + + /** + * Set the components of a Mat2 to the given values + * + * @param {Mat2} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {Mat2} out + */ + set(out: Mat2, m00: number, m01: number, m10: number, m11: number): Mat2; + + /** + * Transpose the values of a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat2, a: Mat2): Mat2; + + /** + * Inverts a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat2, a: Mat2): Mat2|null; + + /** + * Calculates the adjugate of a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat2, a: Mat2): Mat2; + + /** + * Calculates the determinant of a Mat2 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat2): number; + + /** + * Multiplies two Mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Multiplies two Mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Rotates a Mat2 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat2, a: Mat2, rad: number): Mat2; + + /** + * Scales the Mat2 by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat2, a: Mat2, v: Vec2): Mat2; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat2.identity(dest); + * Mat2.rotate(dest, dest, rad); + * + * @param {Mat2} out Mat2 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat2} out + */ + fromRotation(out: Mat2, rad: number): Mat2; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2.identity(dest); + * Mat2.scale(dest, dest, vec); + * + * @param {Mat2} out Mat2 receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat2} out + */ + fromScaling(out: Mat2, v: Vec2): Mat2; + + /** + * Returns a string representation of a Mat2 + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + str(a: Mat2): string; + + /** + * Returns Frobenius norm of a Mat2 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat2): number; + + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper + * triangular) by factorizing the input matrix + * @param L the lower triangular matrix + * @param D the diagonal matrix + * @param U the upper triangular matrix + * @param a the input matrix to factorize + */ + LDU(L: Mat2, D: Mat2, U: Mat2, a: Mat2): Mat2; + + /** + * Adds two Mat2's + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + add(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + subtract(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + sub(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Returns whether or not the matrices have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Mat2} a The first matrix. + * @param {Mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat2, b: Mat2): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat2} a The first matrix. + * @param {Mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat2, b: Mat2): boolean; + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat2} out + */ + multiplyScalar(out: Mat2, a: Mat2, b: number): Mat2 + + /** + * Adds two Mat2's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat2} out the receiving vector + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat2} out + */ + multiplyScalarAndAdd(out: Mat2, a: Mat2, b: Mat2, scale: number): Mat2 +} + +// Mat2d +interface Mat2dAPI { + /** + * Creates a new identity Mat2d + * + * @returns a new 2x3 matrix + */ + create(): Mat2d; + + /** + * Creates a new Mat2d initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x3 matrix + */ + clone(a: Mat2d): Mat2d; + + /** + * Copy the values from one Mat2d to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat2d, a: Mat2d): Mat2d; + + /** + * Set a Mat2d to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat2d): Mat2d; + + /** + * Create a new Mat2d with the given values + * + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {Mat2d} A new Mat2d + */ + fromValues( + a: number, b: number, c: number, d: number, tx: number, ty: number): Mat2d + + + /** + * Set the components of a Mat2d to the given values + * + * @param {Mat2d} out the receiving matrix + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {Mat2d} out + */ + set(out: Mat2d, a: number, b: number, c: number, d: number, tx: number, + ty: number): Mat2d + + /** + * Inverts a Mat2d + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat2d, a: Mat2d): Mat2d|null; + + /** + * Calculates the determinant of a Mat2d + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat2d): number; + + /** + * Multiplies two Mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d; + + /** + * Multiplies two Mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d; + + /** + * Rotates a Mat2d by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat2d, a: Mat2d, rad: number): Mat2d; + + /** + * Scales the Mat2d by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat2d, a: Mat2d, v: Vec2): Mat2d; + + /** + * Translates the Mat2d by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the Vec2 to translate the matrix by + * @returns out + **/ + translate(out: Mat2d, a: Mat2d, v: Vec2): Mat2d; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat2d} out + */ + fromRotation(out: Mat2d, rad: number): Mat2d; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat2d} out + */ + fromScaling(out: Mat2d, v: Vec2): Mat2d; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {Vec2} v Translation vector + * @returns {Mat2d} out + */ + fromTranslation(out: Mat2d, v: Vec2): Mat2d + + /** + * Returns a string representation of a Mat2d + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + str(a: Mat2d): string; + + /** + * Returns Frobenius norm of a Mat2d + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat2d): number; + + /** + * Adds two Mat2d's + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + add(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + subtract(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + sub(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat2d} out + */ + multiplyScalar(out: Mat2d, a: Mat2d, b: number): Mat2d; + + /** + * Adds two Mat2d's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat2d} out the receiving vector + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {Mat2d} out + */ + multiplyScalarAndAdd(out: Mat2d, a: Mat2d, b: Mat2d, scale: number): Mat2d + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat2d} a The first matrix. + * @param {Mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat2d, b: Mat2d): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat2d} a The first matrix. + * @param {Mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat2d, b: Mat2d): boolean +} + +// Mat3 +interface Mat3API { + /** + * Creates a new identity Mat3 + * + * @returns a new 3x3 matrix + */ + create(): Mat3; + + /** + * Copies the upper-left 3x3 values into the given Mat3. + * + * @param {Mat3} out the receiving 3x3 matrix + * @param {Mat4} a the source 4x4 matrix + * @returns {Mat3} out + */ + fromMat4(out: Mat3, a: Mat4): Mat3 + + /** + * Creates a new Mat3 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 3x3 matrix + */ + clone(a: Mat3): Mat3; + + /** + * Copy the values from one Mat3 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat3, a: Mat3): Mat3; + + /** + * Create a new Mat3 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {Mat3} A new Mat3 + */ + fromValues( + m00: number, m01: number, m02: number, m10: number, m11: number, + m12: number, m20: number, m21: number, m22: number): Mat3; + + + /** + * Set the components of a Mat3 to the given values + * + * @param {Mat3} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {Mat3} out + */ + set(out: Mat3, m00: number, m01: number, m02: number, m10: number, + m11: number, m12: number, m20: number, m21: number, m22: number): Mat3 + + /** + * Set a Mat3 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat3): Mat3; + + /** + * Transpose the values of a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat3, a: Mat3): Mat3; + + /** + * Inverts a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat3, a: Mat3): Mat3|null; + + /** + * Calculates the adjugate of a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat3, a: Mat3): Mat3; + + /** + * Calculates the determinant of a Mat3 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat3): number; + + /** + * Multiplies two Mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat3, a: Mat3, b: Mat3): Mat3; + + /** + * Multiplies two Mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat3, a: Mat3, b: Mat3): Mat3; + + + /** + * Translate a Mat3 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + translate(out: Mat3, a: Mat3, v: Vec3): Mat3; + + /** + * Rotates a Mat3 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat3, a: Mat3, rad: number): Mat3; + + /** + * Scales the Mat3 by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat3, a: Mat3, v: Vec2): Mat3; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.translate(dest, dest, vec); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {Vec2} v Translation vector + * @returns {Mat3} out + */ + fromTranslation(out: Mat3, v: Vec2): Mat3 + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.rotate(dest, dest, rad); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat3} out + */ + fromRotation(out: Mat3, rad: number): Mat3 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.scale(dest, dest, vec); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat3} out + */ + fromScaling(out: Mat3, v: Vec2): Mat3 + + /** + * Copies the values from a Mat2d into a Mat3 + * + * @param out the receiving matrix + * @param {Mat2d} a the matrix to copy + * @returns out + **/ + fromMat2d(out: Mat3, a: Mat2d): Mat3; + + /** + * Calculates a 3x3 matrix from the given Quaternion + * + * @param out Mat3 receiving operation result + * @param q Quaternion to create matrix from + * + * @returns out + */ + fromQuat(out: Mat3, q: Quat): Mat3; + + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param out Mat3 receiving operation result + * @param a Mat4 to derive the normal matrix from + * + * @returns out + */ + normalFromMat4(out: Mat3, a: Mat4): Mat3|null; + + /** + * Returns a string representation of a Mat3 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + str(mat: Mat3): string; + + /** + * Returns Frobenius norm of a Mat3 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat3): number; + + /** + * Adds two Mat3's + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + add(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + subtract(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + sub(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat3} out + */ + multiplyScalar(out: Mat3, a: Mat3, b: number): Mat3 + + /** + * Adds two Mat3's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat3} out the receiving vector + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat3} out + */ + multiplyScalarAndAdd(out: Mat3, a: Mat3, b: Mat3, scale: number): Mat3 + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat3} a The first matrix. + * @param {Mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat3, b: Mat3): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat3} a The first matrix. + * @param {Mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat3, b: Mat3): boolean +} + +// Mat4 +interface Mat4API { + /** + * Creates a new identity Mat4 + * + * @returns a new 4x4 matrix + */ + create(): Mat4; + + /** + * Creates a new Mat4 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 4x4 matrix + */ + clone(a: Mat4): Mat4; + + /** + * Copy the values from one Mat4 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat4, a: Mat4): Mat4; + + + /** + * Create a new Mat4 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {Mat4} A new Mat4 + */ + fromValues( + m00: number, m01: number, m02: number, m03: number, m10: number, + m11: number, m12: number, m13: number, m20: number, m21: number, + m22: number, m23: number, m30: number, m31: number, m32: number, + m33: number): Mat4; + + /** + * Set the components of a Mat4 to the given values + * + * @param {Mat4} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {Mat4} out + */ + set(out: Mat4, m00: number, m01: number, m02: number, m03: number, + m10: number, m11: number, m12: number, m13: number, m20: number, + m21: number, m22: number, m23: number, m30: number, m31: number, + m32: number, m33: number): Mat4; + + /** + * Set a Mat4 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat4): Mat4; + + /** + * Transpose the values of a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat4, a: Mat4): Mat4; + + /** + * Inverts a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat4, a: Mat4): Mat4|null; + + /** + * Calculates the adjugate of a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat4, a: Mat4): Mat4; + + /** + * Calculates the determinant of a Mat4 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat4): number; + + /** + * Multiplies two Mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat4, a: Mat4, b: Mat4): Mat4; + + /** + * Multiplies two Mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat4, a: Mat4, b: Mat4): Mat4; + + /** + * Translate a Mat4 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + translate(out: Mat4, a: Mat4, v: Vec3): Mat4; + + /** + * Scales the Mat4 by the dimensions in the given Vec3 + * + * @param out the receiving matrix + * @param a the matrix to scale + * @param v the Vec3 to scale the matrix by + * @returns out + **/ + scale(out: Mat4, a: Mat4, v: Vec3): Mat4; + + /** + * Rotates a Mat4 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @param axis the axis to rotate around + * @returns out + */ + rotate(out: Mat4, a: Mat4, rad: number, axis: Vec3): Mat4; + + /** + * Rotates a matrix by the given angle around the X axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateX(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Rotates a matrix by the given angle around the Y axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateY(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Rotates a matrix by the given angle around the Z axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateZ(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, dest, vec); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Vec3} v Translation vector + * @returns {Mat4} out + */ + fromTranslation(out: Mat4, v: Vec3): Mat4 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.scale(dest, dest, vec); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Vec3} v Scaling vector + * @returns {Mat4} out + */ + fromScaling(out: Mat4, v: Vec3): Mat4 + + /** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotate(dest, dest, rad, axis); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @param {Vec3} axis the axis to rotate around + * @returns {Mat4} out + */ + fromRotation(out: Mat4, rad: number, axis: Vec3): Mat4 + + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateX(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromXRotation(out: Mat4, rad: number): Mat4 + + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateY(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromYRotation(out: Mat4, rad: number): Mat4 + + + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateZ(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromZRotation(out: Mat4, rad: number): Mat4 + + /** + * Creates a matrix from a Quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * + * @param out Mat4 receiving operation result + * @param q Rotation Quaternion + * @param v Translation vector + * @returns out + */ + fromRotationTranslation(out: Mat4, q: Quat, v: Vec3): Mat4; + + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {Vec3} out Vector to receive translation component + * @param {Mat4} mat Matrix to be decomposed (input) + * @return {Vec3} out + */ + getTranslation(out: Vec3, mat: Mat4): Vec3; + + /** + * Returns a Quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned Quaternion will be the + * same as the Quaternion originally supplied. + * @param {Quat} out Quaternion to receive the rotation component + * @param {Mat4} mat Matrix to be decomposed (input) + * @return {Quat} out + */ + getRotation(out: Quat, mat: Mat4): Quat; + + /** + * Creates a matrix from a Quaternion rotation, vector translation and + * vector scale This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * Mat4.scale(dest, scale) + * + * @param out Mat4 receiving operation result + * @param q Rotation Quaternion + * @param v Translation vector + * @param s Scaling vector + * @returns out + */ + fromRotationTranslationScale(out: Mat4, q: Quat, v: Vec3, s: Vec3): Mat4; + + /** + * Creates a matrix from a Quaternion rotation, vector translation and + * vector scale, rotating and scaling around the given origin This is + * equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * Mat4.translate(dest, origin); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * Mat4.scale(dest, scale) + * Mat4.translate(dest, negativeOrigin); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Quat} q Rotation Quaternion + * @param {Vec3} v Translation vector + * @param {Vec3} s Scaling vector + * @param {Vec3} o The origin vector around which to scale and rotate + * @returns {Mat4} out + */ + fromRotationTranslationScaleOrigin( + out: Mat4, q: Quat, v: Vec3, s: Vec3, o: Vec3): Mat4 + + /** + * Calculates a 4x4 matrix from the given Quaternion + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Quat} q Quaternion to create matrix from + * + * @returns {Mat4} out + */ + fromQuat(out: Mat4, q: Quat): Mat4 + + /** + * Generates a frustum matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + frustum( + out: Mat4, left: number, right: number, bottom: number, top: number, + near: number, far: number): Mat4; + + /** + * Generates a perspective projection matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param fovy Vertical field of view in radians + * @param aspect Aspect ratio. typically viewport width/height + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + perspective( + out: Mat4, fovy: number, aspect: number, near: number, far: number): Mat4; + + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experimental WebVR API. + * + * @param {Mat4} out Mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, + * downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {Mat4} out + */ + perspectiveFromFieldOfView( + out: Mat4, fov: { + upDegrees: number, + downDegrees: number, + leftDegrees: number, + rightDegrees: number + }, + near: number, far: number): Mat4 + + /** + * Generates a orthogonal projection matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + ortho( + out: Mat4, left: number, right: number, bottom: number, top: number, + near: number, far: number): Mat4; + + /** + * Generates a look-at matrix with the given eye position, focal point, and + * up axis + * + * @param out Mat4 frustum matrix will be written into + * @param eye Position of the viewer + * @param center Point the viewer is looking at + * @param up Vec3 pointing up + * @returns out + */ + lookAt(out: Mat4, eye: Vec3, center: Vec3, up: Vec3): Mat4; + + /** + * Returns a string representation of a Mat4 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + str(mat: Mat4): string; + + /** + * Returns Frobenius norm of a Mat4 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat4): number; + + /** + * Adds two Mat4's + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + add(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + subtract(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + sub(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat4} out + */ + multiplyScalar(out: Mat4, a: Mat4, b: number): Mat4 + + /** + * Adds two Mat4's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat4} out the receiving vector + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat4} out + */ + multiplyScalarAndAdd(out: Mat4, a: Mat4, b: Mat4, scale: number): Mat4 + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat4} a The first matrix. + * @param {Mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat4, b: Mat4): boolean + + /** + * Returns whether or not the matrices have approximately the same + * elements in the same position. + * + * @param {Mat4} a The first matrix. + * @param {Mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat4, b: Mat4): boolean +} + +// Quat +interface QuatAPI { + /** + * Creates a new identity Quat + * + * @returns a new Quaternion + */ + create(): Quat; + + /** + * Creates a new Quat initialized with values from an existing Quaternion + * + * @param a Quaternion to clone + * @returns a new Quaternion + * @function + */ + clone(a: Quat): Quat; + + /** + * Creates a new Quat initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new Quaternion + * @function + */ + fromValues(x: number, y: number, z: number, w: number): Quat; + + /** + * Copy the values from one Quat to another + * + * @param out the receiving Quaternion + * @param a the source Quaternion + * @returns out + * @function + */ + copy(out: Quat, a: Quat): Quat; + + /** + * Set the components of a Quat to the given values + * + * @param out the receiving Quaternion + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + * @function + */ + set(out: Quat, x: number, y: number, z: number, w: number): Quat; + + /** + * Set a Quat to the identity Quaternion + * + * @param out the receiving Quaternion + * @returns out + */ + identity(out: Quat): Quat; + + /** + * Sets a Quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {Quat} out the receiving Quaternion. + * @param {Vec3} a the initial vector + * @param {Vec3} b the destination vector + * @returns {Quat} out + */ + rotationTo(out: Quat, a: Vec3, b: Vec3): Quat; + + /** + * Sets the specified Quaternion with values corresponding to the given + * axes. Each axis is a Vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {Vec3} view the vector representing the viewing direction + * @param {Vec3} right the vector representing the local "right" direction + * @param {Vec3} up the vector representing the local "up" direction + * @returns {Quat} out + */ + setAxes(out: Quat, view: Vec3, right: Vec3, up: Vec3): Quat + + + + /** + * Sets a Quat from the given angle and rotation axis, + * then returns it. + * + * @param out the receiving Quaternion + * @param axis the axis around which to rotate + * @param rad the angle in radians + * @returns out + **/ + setAxisAngle(out: Quat, axis: Vec3, rad: number): Quat; + + /** + * Gets the rotation axis and angle for a given + * Quaternion. If a Quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The Quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the Quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {Vec3} out_axis Vector receiving the axis of rotation + * @param {Quat} q Quaternion to be decomposed + * @return {number} Angle, in radians, of the rotation + */ + getAxisAngle(out_axis: Vec3, q: Quat): number + + /** + * Adds two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + * @function + */ + add(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Multiplies two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Multiplies two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Scales a Quat by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + * @function + */ + scale(out: Quat, a: Quat, b: number): Quat; + + /** + * Calculates the length of a Quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + length(a: Quat): number; + + /** + * Calculates the length of a Quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + len(a: Quat): number; + + /** + * Calculates the squared length of a Quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + squaredLength(a: Quat): number; + + /** + * Calculates the squared length of a Quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + sqrLen(a: Quat): number; + + /** + * Normalize a Quat + * + * @param out the receiving Quaternion + * @param a Quaternion to normalize + * @returns out + * @function + */ + normalize(out: Quat, a: Quat): Quat; + + /** + * Calculates the dot product of two Quat's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + * @function + */ + dot(a: Quat, b: Quat): number; + + /** + * Performs a linear interpolation between two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + * @function + */ + lerp(out: Quat, a: Quat, b: Quat, t: number): Quat; + + /** + * Performs a spherical linear interpolation between two Quat + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + slerp(out: Quat, a: Quat, b: Quat, t: number): Quat; + + /** + * Performs a spherical linear interpolation with two control points + * + * @param {Quat} out the receiving Quaternion + * @param {Quat} a the first operand + * @param {Quat} b the second operand + * @param {Quat} c the third operand + * @param {Quat} d the fourth operand + * @param {number} t interpolation amount + * @returns {Quat} out + */ + sqlerp(out: Quat, a: Quat, b: Quat, c: Quat, d: Quat, t: number): Quat; + + /** + * Calculates the inverse of a Quat + * + * @param out the receiving Quaternion + * @param a Quat to calculate inverse of + * @returns out + */ + invert(out: Quat, a: Quat): Quat; + + /** + * Calculates the conjugate of a Quat + * If the Quaternion is normalized, this function is faster than + * Quat.inverse and produces the same result. + * + * @param out the receiving Quaternion + * @param a Quat to calculate conjugate of + * @returns out + */ + conjugate(out: Quat, a: Quat): Quat; + + /** + * Returns a string representation of a Quaternion + * + * @param a Quat to represent as a string + * @returns string representation of the Quat + */ + str(a: Quat): string; + + /** + * Rotates a Quaternion by the given angle about the X axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateX(out: Quat, a: Quat, rad: number): Quat; + + /** + * Rotates a Quaternion by the given angle about the Y axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateY(out: Quat, a: Quat, rad: number): Quat; + + /** + * Rotates a Quaternion by the given angle about the Z axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateZ(out: Quat, a: Quat, rad: number): Quat; + + /** + * Creates a Quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant Quaternion is not normalized, so you should be sure + * to renormalize the Quaternion yourself where necessary. + * + * @param out the receiving Quaternion + * @param m rotation matrix + * @returns out + * @function + */ + fromMat3(out: Quat, m: Mat3): Quat; + + /** + * Sets the specified Quaternion with values corresponding to the given + * axes. Each axis is a Vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param out the receiving Quat + * @param view the vector representing the viewing direction + * @param right the vector representing the local "right" direction + * @param up the vector representing the local "up" direction + * @returns out + */ + setAxes(out: Quat, view: Vec3, right: Vec3, up: Vec3): Quat; + + /** + * Sets a Quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param out the receiving Quaternion. + * @param a the initial vector + * @param b the destination vector + * @returns out + */ + rotationTo(out: Quat, a: Vec3, b: Vec3): Quat; + + /** + * Calculates the W component of a Quat from the X, Y, and Z components. + * Assumes that Quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param out the receiving Quaternion + * @param a Quat to calculate W component of + * @returns out + */ + calculateW(out: Quat, a: Quat): Quat; + + /** + * Returns whether or not the Quaternions have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Quat} a The first vector. + * @param {Quat} b The second vector. + * @returns {boolean} True if the Quaternions are equal, false otherwise. + */ + exactEquals(a: Quat, b: Quat): boolean; + + /** + * Returns whether or not the Quaternions have approximately the same + * elements in the same position. + * + * @param {Quat} a The first vector. + * @param {Quat} b The second vector. + * @returns {boolean} True if the Quaternions are equal, false otherwise. + */ + equals(a: Quat, b: Quat): boolean; +} diff --git a/examples.js b/examples.js new file mode 100644 index 000000000..dbe1c4bfc --- /dev/null +++ b/examples.js @@ -0,0 +1,574 @@ +// Copyright 2022 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** @type {import("../../manifold-encapsulated-types")["Manifold"]} */ +const Manifold = globalThis.Manifold; + +export const examples = { + functions: { + Intro: function() { + // Write code in JavaScript or TypeScript and this editor will show the + // API docs. Type e.g. "box." to see the Manifold API. Type + // "CrossSection." or "Manifold." to list the 2D and 3D constructors, + // respectively. Type "module." to see the static API - these functions + // can also be used bare. Use console.log() to print output (lower-right). + // This editor defines Z as up and units of mm. + const {cube, sphere} = Manifold; + const box = cube([100, 100, 100], true); + const ball = sphere(60, 100); + // You must name your final output "result", or create at least one + // GLTFNode - see Menger Sponge and Gyroid Module examples. + const result = box.subtract(ball); + + // For visual debug, wrap any shape with show() and it and all of its + // copies will be shown in transparent red, akin to # in OpenSCAD. Or try + // only() to ghost out everything else, akin to * in OpenSCAD. + + // All changes are automatically saved and restored between sessions. + // This PWA is purely local - there is no server communication. + // This means it will work equally well offline once loaded. + // Consider installing it (icon in the search bar) for easy access. + + // See the script drop-down above ("Intro") for usage examples. The + // gl-matrix package from npm is automatically imported for convenience - + // its API is available in the top-level glMatrix object. + + // Use GLTFNode for disjoint manifolds rather than compose(), as this will + // keep them better organized in the GLB. This will also allow you to + // specify material properties, and even vertex colors via + // setProperties(). See Tetrahedron Puzzle example. + return result; + }, + + TetrahedronPuzzle: function() { + // A tetrahedron cut into two identical halves that can screw together as + // a puzzle. This demonstrates how redundant points along a polygon can be + // used to make twisted extrusions smoother. It also showcases animated + // assemblies. Based on the screw puzzle by George Hart: + // https://www.thingiverse.com/thing:186372 + + const edgeLength = 50; // Length of each edge of the overall tetrahedron. + const gap = 0.2; // Spacing between the two halves to allow sliding. + const nDivisions = 50; // Divisions (both ways) in the screw surface. + + const scale = edgeLength / (2 * Math.sqrt(2)); + + const tet = Manifold.tetrahedron().intersect( + Manifold.tetrahedron().rotate([0, 0, 90]).scale(2.5)); + + const box = []; + box.push([2, -2], [2, 2]); + for (let i = 0; i <= nDivisions; ++i) { + box.push([gap / (2 * scale), 2 - i * 4 / nDivisions]); + } + + const cyan = [0, 1, 1]; + const magenta = [1, 0, 1]; + const fade = (color, pos) => { + for (let i = 0; i < 3; ++i) { + const x = pos[2] / 2; + color[i] = cyan[i] * x + magenta[i] * (1 - x); + } + }; + + // setProperties(3, fade) creates three channels of vertex properties + // according to the above fade function. setMaterial assigns these + // channels as colors, and sets the factor to white, since our default is + // yellow. + const screw = setMaterial( + Manifold.extrude(box, 2, nDivisions, 270).setProperties(3, fade), + {baseColorFactor: [1, 1, 1], attributes: ['COLOR_0']}); + + const result = + tet.intersect(screw.rotate([0, 0, -45]).translate([0, 0, -1])) + .scale(scale); + + // Assigned materials are only applied to a GLTFNode. Note that material + // definitions cascade, applying recursively to all child surfaces, but + // overridden by any materials defined lower down. The default material + // properties, as well as animation parameters can be set via + // globalDefaults. + + const layFlat = new GLTFNode(); + layFlat.rotation = + [45, -Math.atan(1 / Math.sqrt(2)) * 180 / Math.PI, 120]; + layFlat.translation = [0, 0, scale * Math.sqrt(3) / 3]; + + const fixed = new GLTFNode(layFlat); + fixed.manifold = result; + fixed.rotation = [0, 0, 180]; + + // For 3MF export, only top-level objects are independently arrangeable. + const layFlat2 = layFlat.clone(); + + const moving = new GLTFNode(layFlat2); + moving.manifold = result; + // Use functions to create animation, which runs from t=0 to t=1. + moving.translation = (t) => { + const a = 1 - t; + const x = a > 0.5 ? scale * 2 * (0.5 - a) : 0; + return [x, x, -2 * x + scale * 4 * (0.5 - Math.abs(0.5 - a))]; + }; + moving.rotation = (t) => [0, 0, 270 * 2 * (1 - t)]; + + globalDefaults.animationLength = 10; // seconds + globalDefaults.animationMode = 'ping-pong'; + return result; + }, + + RoundedFrame: function() { + // Demonstrates how at 90-degree intersections, the sphere and cylinder + // facets match up perfectly, for any choice of global resolution + // parameters. + const {sphere, cylinder, union, cube} = Manifold; + + function roundedFrame(edgeLength, radius, circularSegments = 0) { + const edge = cylinder(edgeLength, radius, -1, circularSegments); + const corner = sphere(radius, circularSegments); + + const edge1 = union(corner, edge).rotate([-90, 0, 0]).translate([ + -edgeLength / 2, -edgeLength / 2, 0 + ]); + + const edge2 = union( + union(edge1, edge1.rotate([0, 0, 180])), + edge.translate([-edgeLength / 2, -edgeLength / 2, 0])); + + const edge4 = union(edge2, edge2.rotate([0, 0, 90])).translate([ + 0, 0, -edgeLength / 2 + ]); + + return union(edge4, edge4.rotate([180, 0, 0])); + } + + setMinCircularAngle(3); + setMinCircularEdgeLength(0.5); + const result = roundedFrame(100, 10); + // Demonstrate how you can use the .split method to perform + // a subtraction and an intersection at once + const [inside, outside] = result.split(cube(100, true)); + + const outsideNode = new GLTFNode(); + outsideNode.manifold = outside; + + const insideNode = new GLTFNode(); + insideNode.manifold = inside; + insideNode.material = {baseColorFactor: [0, 1, 1]}; + + return result; + }, + + Heart: function() { + // Smooth, complex manifolds can be created using the warp() function. + // This example recreates the Exploitable Heart by Emmett Lalish: + // https://www.thingiverse.com/thing:6190 + // It also demonstrates the use of setMorph to animate a warping function. + + const func = (v) => { + const x2 = v[0] * v[0]; + const y2 = v[1] * v[1]; + const z = v[2]; + const z2 = z * z; + const a = x2 + 9 / 4 * y2 + z2; + const b = z * z2 * (x2 + 9 / 80 * y2); + const a2 = a * a; + const a3 = a * a2; + + const step = (r) => { + const r2 = r * r; + const r4 = r2 * r2; + // Taubin's function: https://mathworld.wolfram.com/HeartSurface.html + const f = a3 * r4 * r2 - b * r4 * r - 3 * a2 * r4 + 3 * a * r2 - 1; + // Derivative + const df = + 6 * a3 * r4 * r - 5 * b * r4 - 12 * a2 * r2 * r + 6 * a * r; + return f / df; + }; + // Newton's method for root finding + let r = 1.5; + let dr = 1; + while (Math.abs(dr) > 0.0001) { + dr = step(r); + r -= dr; + } + // Update radius + v[0] *= r; + v[1] *= r; + v[2] *= r; + }; + + const ball = Manifold.sphere(1, 200); + + const heart = ball.warp(func); + const box = heart.boundingBox(); + const scale = 100 / (box.max[0] - box.min[0]); + + setMorphStart(ball, func); + const node = new GLTFNode(); + node.manifold = ball; + node.scale = [scale, scale, scale]; + + globalDefaults.animationLength = 5; // seconds + globalDefaults.animationMode = 'ping-pong'; + + const result = heart.scale(scale); + return result; + }, + + Scallop: function() { + // A smoothed manifold demonstrating selective edge sharpening with + // smooth() and refine(), see more details at: + // https://elalish.blogspot.com/2022/03/smoothing-triangle-meshes.html + + const height = 10; + const radius = 30; + const offset = 20; + const wiggles = 12; + const sharpness = 0.8; + const n = 50; + + const positions = []; + const triangles = []; + positions.push(-offset, 0, height, -offset, 0, -height); + const sharpenedEdges = []; + + const delta = 3.14159 / wiggles; + for (let i = 0; i < 2 * wiggles; ++i) { + const theta = (i - wiggles) * delta; + const amp = 0.5 * height * Math.max(Math.cos(0.8 * theta), 0); + + positions.push( + radius * Math.cos(theta), radius * Math.sin(theta), + amp * (i % 2 == 0 ? 1 : -1)); + let j = i + 1; + if (j == 2 * wiggles) j = 0; + + const smoothness = 1 - sharpness * Math.cos((theta + delta / 2) / 2); + let halfedge = triangles.length + 1; + sharpenedEdges.push({halfedge, smoothness}); + triangles.push(0, 2 + i, 2 + j); + + halfedge = triangles.length + 1; + sharpenedEdges.push({halfedge, smoothness}); + triangles.push(1, 2 + j, 2 + i); + } + + const triVerts = Uint32Array.from(triangles); + const vertProperties = Float32Array.from(positions); + const scallop = new Mesh({numProp: 3, triVerts, vertProperties}); + + const colorCurvature = (color, pos, oldProp) => { + const a = Math.max(0, Math.min(1, oldProp[0] / 3 + 0.5)); + const b = a * a * (3 - 2 * a); + const red = [1, 0, 0]; + const blue = [0, 0, 1]; + for (let i = 0; i < 3; ++i) { + color[i] = (1 - b) * blue[i] + b * red[i]; + } + }; + const result = Manifold.smooth(scallop, sharpenedEdges) + .refine(n) + .calculateCurvature(-1, 0) + .setProperties(3, colorCurvature); + + const node = new GLTFNode(); + node.manifold = result; + node.material = { + baseColorFactor: [1, 1, 1], + metallic: 0, + attributes: ['COLOR_0'] + }; + return result; + }, + + TorusKnot: function() { + // Creates a classic torus knot, defined as a string wrapping periodically + // around the surface of an imaginary donut. If p and q have a common + // factor then you will get multiple separate, interwoven knots. This is + // an example of using the warp() method, thus avoiding any direct + // handling of triangles. + + // The number of times the thread passes through the donut hole. + const p = 1; + // The number of times the thread circles the donut. + const q = 3; + // Radius of the interior of the imaginary donut. + const majorRadius = 25; + // Radius of the small cross-section of the imaginary donut. + const minorRadius = 10; + // Radius of the small cross-section of the actual object. + const threadRadius = 3.75; + // Number of linear segments making up the threadRadius circle. Default is + // getCircularSegments(threadRadius). + const circularSegments = -1; + // Number of segments along the length of the knot. Default makes roughly + // square facets. + const linearSegments = -1; + + // These default values recreate Matlab Knot by Emmett Lalish: + // https://www.thingiverse.com/thing:7080 + + const {vec3} = glMatrix; + + function gcd(a, b) { + return b == 0 ? a : gcd(b, a % b); + } + + const kLoops = gcd(p, q); + const pk = p / kLoops; + const qk = q / kLoops; + const n = circularSegments > 2 ? circularSegments : + getCircularSegments(threadRadius); + const m = linearSegments > 2 ? linearSegments : + n * qk * majorRadius / threadRadius; + + const offset = 2 + const circle = CrossSection.circle(1, n).translate([offset, 0]); + + const func = (v) => { + const psi = qk * Math.atan2(v[0], v[1]); + const theta = psi * pk / qk; + const x1 = Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const phi = Math.atan2(x1 - offset, v[2]); + vec3.set( + v, threadRadius * Math.cos(phi), 0, threadRadius * Math.sin(phi)); + const center = vec3.fromValues(0, 0, 0); + const r = majorRadius + minorRadius * Math.cos(theta); + vec3.rotateX(v, v, center, -Math.atan2(pk * minorRadius, qk * r)); + v[0] += minorRadius; + vec3.rotateY(v, v, center, theta); + v[0] += majorRadius; + vec3.rotateZ(v, v, center, psi); + }; + + const result = Manifold.revolve(circle, m).warp(func); + + for (let k = 0; k < kLoops; ++k) { + const node = new GLTFNode(); + node.manifold = result; + node.rotation = [0, 0, 360 * (k / kLoops) * (qk / pk)]; + node.translation = [0, 0, result.boundingBox().min[2]]; + } + + return result; + }, + + MengerSponge: function() { + // This example demonstrates how symbolic perturbation correctly creates + // holes even though the subtracted objects are exactly coplanar. + const {vec2} = glMatrix; + + function fractal(holes, hole, w, position, depth, maxDepth) { + w /= 3; + holes.push( + hole.scale([w, w, 1.0]).translate([position[0], position[1], 0.0])); + if (depth == maxDepth) return; + const offsets = [ + vec2.fromValues(-w, -w), vec2.fromValues(-w, 0.0), + vec2.fromValues(-w, w), vec2.fromValues(0.0, w), + vec2.fromValues(w, w), vec2.fromValues(w, 0.0), + vec2.fromValues(w, -w), vec2.fromValues(0.0, -w) + ]; + for (let offset of offsets) + fractal( + holes, hole, w, vec2.add(offset, position, offset), depth + 1, + maxDepth); + } + + function mengerSponge(n) { + let result = Manifold.cube([1, 1, 1], true); + const holes = []; + fractal(holes, result, 1.0, [0.0, 0.0], 1, n); + + const hole = Manifold.compose(holes); + + result = Manifold.difference([ + result, + hole, + hole.rotate([90, 0, 0]), + hole.rotate([0, 90, 0]), + ]); + return result; + } + + const posColors = (newProp, pos) => { + for (let i = 0; i < 3; ++i) { + newProp[i] = (1 - pos[i]) / 2; + } + }; + + const result = mengerSponge(3) + .trimByPlane([1, 1, 1], 0) + .setProperties(3, posColors) + .scale(100); + + const node = new GLTFNode(); + node.manifold = result; + node.material = {baseColorFactor: [1, 1, 1], attributes: ['COLOR_0']}; + return result; + }, + + StretchyBracelet: function() { + // Recreates Stretchy Bracelet by Emmett Lalish: + // https://www.thingiverse.com/thing:13505 + const {vec2} = glMatrix; + + function base( + width, radius, decorRadius, twistRadius, nDecor, innerRadius, + outerRadius, cut, nCut, nDivision) { + let b = Manifold.cylinder(width, radius + twistRadius / 2); + const circle = []; + const dPhiDeg = 180 / nDivision; + for (let i = 0; i < 2 * nDivision; ++i) { + circle.push([ + decorRadius * Math.cos(dPhiDeg * i * Math.PI / 180) + twistRadius, + decorRadius * Math.sin(dPhiDeg * i * Math.PI / 180) + ]); + } + let decor = Manifold.extrude(circle, width, nDivision, 180) + .scale([1, 0.5, 1]) + .translate([0, radius, 0]); + for (let i = 0; i < nDecor; i++) + b = b.add(decor.rotate([0, 0, (360.0 / nDecor) * i])); + const stretch = []; + const dPhiRad = 2 * Math.PI / nCut; + + const o = vec2.fromValues(0, 0); + const p0 = vec2.fromValues(outerRadius, 0); + const p1 = vec2.fromValues(innerRadius, -cut); + const p2 = vec2.fromValues(innerRadius, cut); + for (let i = 0; i < nCut; ++i) { + stretch.push(vec2.rotate([0, 0], p0, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p1, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p2, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p0, o, dPhiRad * i)); + } + const result = + Manifold.intersection(Manifold.extrude(stretch, width), b); + return result; + } + + function stretchyBracelet( + radius = 30, height = 8, width = 15, thickness = 0.4, nDecor = 20, + nCut = 27, nDivision = 30) { + const twistRadius = Math.PI * radius / nDecor; + const decorRadius = twistRadius * 1.5; + const outerRadius = radius + (decorRadius + twistRadius) * 0.5; + const innerRadius = outerRadius - height; + const cut = 0.5 * (Math.PI * 2 * innerRadius / nCut - thickness); + const adjThickness = 0.5 * thickness * height / cut; + + return Manifold.difference( + base( + width, radius, decorRadius, twistRadius, nDecor, + innerRadius + thickness, outerRadius + adjThickness, + cut - adjThickness, nCut, nDivision), + base( + width, radius - thickness, decorRadius, twistRadius, nDecor, + innerRadius, outerRadius + 3 * adjThickness, cut, nCut, + nDivision)); + } + + const result = stretchyBracelet(); + return result; + }, + + GyroidModule: function() { + // Recreates Modular Gyroid Puzzle by Emmett Lalish: + // https://www.thingiverse.com/thing:25477. This sample demonstrates the + // use of a Signed Distance Function (SDF) to create smooth, complex + // manifolds. + const {vec3} = glMatrix; + + // number of modules along pyramid edge (use 1 for print orientation) + const m = 4; + // module size + const size = 20; + // SDF resolution + const n = 20; + + const pi = 3.14159; + + function gyroid(p) { + const x = p[0] - pi / 4; + const y = p[1] - pi / 4; + const z = p[2] - pi / 4; + return Math.cos(x) * Math.sin(y) + Math.cos(y) * Math.sin(z) + + Math.cos(z) * Math.sin(x); + } + + function gyroidOffset(level) { + const period = 2 * pi; + const box = { + min: vec3.fromValues(-period, -period, -period), + max: vec3.fromValues(period, period, period) + }; + return Manifold.levelSet(gyroid, box, period / n, level) + .scale(size / period); + }; + + function rhombicDodecahedron() { + const box = Manifold.cube([1, 1, 2], true).scale(size * Math.sqrt(2)); + const result = + box.rotate([90, 45, 0]).intersect(box.rotate([90, 45, 90])); + return result.intersect(box.rotate([0, 0, 45])); + } + + const gyroidModule = rhombicDodecahedron() + .intersect(gyroidOffset(-0.4)) + .subtract(gyroidOffset(0.4)); + + if (m > 1) { + for (let i = 0; i < m; ++i) { + for (let j = i; j < m; ++j) { + for (let k = j; k < m; ++k) { + const node = new GLTFNode(); + node.manifold = gyroidModule; + node.translation = + [(k + i - j) * size, (k - i) * size, (-j) * size]; + node.material = { + baseColorFactor: + [(k + i - j + 1) / m, (k - i + 1) / m, (j + 1) / m] + }; + } + } + } + } + + const result = gyroidModule.rotate([-45, 0, 90]).translate([ + 0, 0, size / Math.sqrt(2) + ]); + return result; + } + }, + + functionBodies: new Map() +}; + +for (const [func, code] of Object.entries(examples.functions)) { + const whole = code.toString(); + const lines = whole.split('\n'); + lines.splice(0, 1); // remove first line + lines.splice(-2, 2); // remove last two lines + // remove first six leading spaces + const body = '\n' + lines.map(l => l.slice(6)).join('\n'); + + const name = + func.replace(/([a-z])([A-Z])/g, '$1 $2'); // Add spaces between words + examples.functionBodies.set(name, body); +}; + +if (typeof self !== 'undefined') { + self.examples = examples; +} diff --git a/icons/close.png b/icons/close.png new file mode 100644 index 000000000..461cc3c94 Binary files /dev/null and b/icons/close.png differ diff --git a/icons/manifoldCAD.png b/icons/manifoldCAD.png new file mode 100644 index 000000000..4f7e5854d Binary files /dev/null and b/icons/manifoldCAD.png differ diff --git a/icons/manifoldCADonly.png b/icons/manifoldCADonly.png new file mode 100644 index 000000000..01d542cd6 Binary files /dev/null and b/icons/manifoldCADonly.png differ diff --git a/icons/mengerSponge192.png b/icons/mengerSponge192.png new file mode 100644 index 000000000..c53801c1f Binary files /dev/null and b/icons/mengerSponge192.png differ diff --git a/icons/mengerSponge512.png b/icons/mengerSponge512.png new file mode 100644 index 000000000..c1cc43349 Binary files /dev/null and b/icons/mengerSponge512.png differ diff --git a/icons/pause.png b/icons/pause.png new file mode 100644 index 000000000..c7cc4ca50 Binary files /dev/null and b/icons/pause.png differ diff --git a/icons/pencil.png b/icons/pencil.png new file mode 100644 index 000000000..faaa762ff Binary files /dev/null and b/icons/pencil.png differ diff --git a/icons/play.png b/icons/play.png new file mode 100644 index 000000000..06ff4a02d Binary files /dev/null and b/icons/play.png differ diff --git a/icons/redo.png b/icons/redo.png new file mode 100644 index 000000000..00b24a953 Binary files /dev/null and b/icons/redo.png differ diff --git a/icons/share.png b/icons/share.png new file mode 100644 index 000000000..e24c06044 Binary files /dev/null and b/icons/share.png differ diff --git a/icons/star.png b/icons/star.png new file mode 100644 index 000000000..320d8b8b0 Binary files /dev/null and b/icons/star.png differ diff --git a/icons/trash.png b/icons/trash.png new file mode 100644 index 000000000..2b5c0d7bf Binary files /dev/null and b/icons/trash.png differ diff --git a/icons/undo.png b/icons/undo.png new file mode 100644 index 000000000..6f6a4ed6e Binary files /dev/null and b/icons/undo.png differ diff --git a/index.html b/index.html new file mode 100644 index 000000000..55649168b --- /dev/null +++ b/index.html @@ -0,0 +1,103 @@ + + + + + ManifoldCAD + + + + + + + + + + + + + + + + + + + + + + +
+
+

ManifoldCAD +    + + + + + +

+
+ + +
+
+ +
+
+ + +
+ +
+
+
+
+
+
+ +
+

Loading...

+
+
+ + +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/jsdocs/.nojekyll b/jsdocs/.nojekyll new file mode 100644 index 000000000..e2ac6616a --- /dev/null +++ b/jsdocs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/jsdocs/assets/highlight.css b/jsdocs/assets/highlight.css new file mode 100644 index 000000000..e99f11167 --- /dev/null +++ b/jsdocs/assets/highlight.css @@ -0,0 +1,78 @@ +:root { + --light-hl-0: #795E26; + --dark-hl-0: #DCDCAA; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #A31515; + --dark-hl-2: #CE9178; + --light-hl-3: #AF00DB; + --dark-hl-3: #C586C0; + --light-hl-4: #001080; + --dark-hl-4: #9CDCFE; + --light-hl-5: #0000FF; + --dark-hl-5: #569CD6; + --light-hl-6: #0070C1; + --dark-hl-6: #4FC1FF; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +pre, code { background: var(--code-background); } diff --git a/jsdocs/assets/icons.js b/jsdocs/assets/icons.js new file mode 100644 index 000000000..e88e8ca77 --- /dev/null +++ b/jsdocs/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `""`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/jsdocs/assets/icons.svg b/jsdocs/assets/icons.svg new file mode 100644 index 000000000..e371b8b5d --- /dev/null +++ b/jsdocs/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/jsdocs/assets/main.js b/jsdocs/assets/main.js new file mode 100644 index 000000000..21a5d74d2 --- /dev/null +++ b/jsdocs/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/jsdocs/assets/navigation.js b/jsdocs/assets/navigation.js new file mode 100644 index 000000000..fab8e5d91 --- /dev/null +++ b/jsdocs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6XUXWvbMBQG4L8ydJ2urZNmWe76DWNho+52U0LQpBNbTJaMdAwJo/992I1jOU0lub32e54XCfk8/SMIGyRzcg/4KUVqEDgZkZJiTuaEa1YVoNCe3gOudp8/51hIMiJ/heJkPhvPZtOz2fNoLxVUibWW/AQUo6WtJEXgJ7gtwXZyoXklwZ624ZUbXjXhfk8yIiwXkhtQZP60L7s22toUGAqtOp1Jam1Adyf7VeeJe5zFzhimt1NeGWw+UAWbh8QfZX0i56qFQjBryiLs3ezBzV9MnYoM8FoYVklqUsiax9FVrSvV3Ke/6QjRb5xOnEIDFvBRtxM3sKaVHF76BuMpth8/6RHCX7gQqh24VJmEdxQeEtGFtzyD76AyzD/W2jmeajSCqqxRhrY5o68Klsf2UCb1HyqDG+glNmD3pEAl8DupKY6TS2Po1v/T9QpeD/v+upf0L6He3eTM+oqu9Kajm/k31Cu9OXDOvn45v0gc605I+VC5j9gHtumQ+k0L9bgtI9U2HVIXFMdxYp2M0CbR2iSk/dRym/VWuk9s00HV6BIMCoh19/mQ/AAM48w6GdJSUZQSdqeKY3sjQb/QGnMFNvIeunxI/g0siTPrZIQW+ULr5HFt+bz8D1ZBmpDyCQAA" \ No newline at end of file diff --git a/jsdocs/assets/search.js b/jsdocs/assets/search.js new file mode 100644 index 000000000..8386a236d --- /dev/null +++ b/jsdocs/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA82dW5PbNrLHv8op+VWZEACv85bLJpWtzXEq9snLlMtFjygN91CklpeJp1z+7luASKobaI5AgazkzeURmn+Cv240u0nwy6au/mw29w9fNv+fl7vNfSziOPTi7aZMj9nmfvNz1v7Puzat22y32W66utjcb3bVY3fMyrb59ues/dj/9e6pPRab7eaxSJsmazb3m83X7WCVj/aOaZnvq2L3TVY+pqemK9I2233TvpyyZrR/rHZdkTXfDr/9CH/7Uf321aOF/ni4ts7T8qBGjub3XfnY5lX5+gHASOJg280prbOyvXJGpKYma3/Nyx/y+rEr0vq78lDM1UZYWFXjP3aH7F9ZeWifnIRezCyvdjjGu+yg0JwvVLewsMaDs0bCwsIa66zJ2vfVcJQfs33aFbN1TlhZQivjl8j0Q101zbtMCRoV9sZf1QcHLiGKe/5FVfOfLq0zNz1vRiOzZSFjUxof8/qxcNU4GllHY1c6X9Y3g411FO7y/T6rs/LRdSaRoXW05mWb1c0SvvJGM7WO3qeuKBx1ShPf8PV8qDqeqsbZiUYr66is9r9VxcuhKhtHocjQYloDxsGElk1bd49tVTtPKrS0zsRmn9u627le/ouVdVTW2XNVPLuqvFhZR2Vbp2Wzr+qjo05oZ0Wl6F7CQWlvZ6UrX7XuMkcj62hsHlPnLGSwsY7CY17XzuFoNLKOxj/T+uSosDex1hK0b7LWefnpjaxEYn48Ffn+xRXGi5l1dKa7naPEs4WVZrH71Nbpo+u1BmZWToaXyoT/7mnwerdA2TJpMLSz0spdLZQII0MreXmdpa5ufjaxkv80/zieWtdgebGyjsqyO/6R1a4+frGymsofqrKtOtcsAxlaR+unqit3rv4zGlkrIhWZc947GllM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kHF9DSaP/ZdeD7MDfrswTf8lz7j7QCYyBm8qFGYBeV6q48G4EODCOBN4Y5O8+pu5IOCzF0Z2+MyXYrfd2VYHsyYBTS6w0VYmZ3rftPyoJ5BLGU98ZCO79q1IZR+/OGUel5Gy2Q8sKcS8yx2KkNvEyDEB9u57XN61UBEEwspy9rj3k5mEzLA55MWBu/wZ7MfszQACKwHTjNVNEhAJcktHPjRu3kdBr2fgJXAzqMsPNiZSzf47tb4CKWN2j9J+7AtMPoZClF7aqBAiecZ0u6lJFPL1SpHUgKLVkAO4TAyAtv1Pwha7W8Qz7brDq0/gUggISWSJ2eMtya8EH8tbx16T9BCYSAKY8sJ0na+PRyOn9/EZgCrhxZyvlPl+JzgpURy/lt01qrNIPJtQx644dNgVcAJUNxJbK7Het3KdH7drL9CjInu/tooraXwCWN20XNNmvr9Cnb1TiE+OAkfbuTaysqbRaARWHHEbmycpCE8f6+PBg6r5Z3K+Br98AwCLx8qF3axZi2ztPy0OkWYfZja+dI+Q2gIrK8mnXeb8cL1igQpJJ4SEns+O83RwVcGCU829JdV+qVWGhrmHg7Wc9qh0sAPrxJF3aT/qy2qgQ2UGHYjlQ51/RyHgFFyYCpZxe4jCsYwyontzy9fq8hWFyG4SGwO8M/0xqVaziI5bwveIcWij5sN6f8lBXyPu3+4cPXr/8Fttz5fVanAAA="; \ No newline at end of file diff --git a/jsdocs/assets/style.css b/jsdocs/assets/style.css new file mode 100644 index 000000000..9d619a641 --- /dev/null +++ b/jsdocs/assets/style.css @@ -0,0 +1,1448 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} +footer > p { + margin: 0 1em; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} +a.tsd-anchor-link { + color: var(--color-text); +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; +} + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; +} +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-navigation .tsd-nav-link { + display: none; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; +} +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; + vertical-align: text-top; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-literal { + color: var(--color-ts-type-literal); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/jsdocs/classes/manifold_encapsulated_types.CrossSection.html b/jsdocs/classes/manifold_encapsulated_types.CrossSection.html new file mode 100644 index 000000000..af23ac387 --- /dev/null +++ b/jsdocs/classes/manifold_encapsulated_types.CrossSection.html @@ -0,0 +1,154 @@ +CrossSection | manifold-3d

Constructors

  • Create a 2d cross-section from a set of contours (complex polygons). A +boolean union operation (with Positive filling rule by default) is +performed to combine overlapping polygons and ensure the resulting +CrossSection is free of intersections.

    +

    Parameters

    • contours: Polygons

      A set of closed paths describing zero or more complex +polygons.

      +
    • OptionalfillRule: FillRule

      The filling rule used to interpret polygon sub-regions in +contours.

      +

    Returns CrossSection

Methods

  • Constructs a manifold by extruding the cross-section along Z-axis.

    +

    Parameters

    • height: number

      Z-extent of extrusion.

      +
    • OptionalnDivisions: number

      Number of extra copies of the crossSection to insert into +the shape vertically; especially useful in combination with twistDegrees to +avoid interpolation artifacts. Default is none.

      +
    • OptionaltwistDegrees: number

      Amount to twist the top crossSection relative to the +bottom, interpolated linearly for the divisions in between.

      +
    • OptionalscaleTop: number | Vec2

      Amount to scale the top (independently in X and Y). If the +scale is {0, 0}, a pure cone is formed with only a single vertex at the +top. Default {1, 1}.

      +
    • Optionalcenter: boolean

      If true, the extrusion is centered on the z-axis through the +origin +as opposed to resting on the XY plane as is default.

      +

    Returns Manifold

  • Mirror this CrossSection over the arbitrary axis described by the unit form +of the given vector. If the length of the vector is zero, an empty +CrossSection is returned. This operation can be chained. Transforms are +combined and applied lazily.

    +

    Parameters

    • ax: Vec2

      the axis to be mirrored over

      +

    Returns CrossSection

  • Inflate the contours in CrossSection by the specified delta, handling +corners according to the given JoinType.

    +

    Parameters

    • delta: number

      Positive deltas will cause the expansion of outlining contours +to expand, and retraction of inner (hole) contours. Negative deltas will +have the opposite effect.

      +
    • OptionaljoinType: JoinType

      The join type specifying the treatment of contour joins +(corners).

      +
    • OptionalmiterLimit: number

      The maximum distance in multiples of delta that vertices +can be offset from their original positions with before squaring is +applied, when the join type is Miter (default is 2, which is the +minimum allowed). See the Clipper2 +MiterLimit +page for a visual example.

      +
    • OptionalcircularSegments: number

      Number of segments per 360 degrees of +JoinType::Round corners (roughly, the number of vertices that +will be added to each contour). Default is calculated by the static Quality +defaults according to the radius.

      +

    Returns CrossSection

  • Constructs a manifold by revolving this cross-section around its Y-axis and +then setting this as the Z-axis of the resulting manifold. If the contours +cross the Y-axis, only the part on the positive X side is used. +Geometrically valid input will result in geometrically valid output.

    +

    Parameters

    • OptionalcircularSegments: number

      Number of segments along its diameter. Default is +calculated by the static Defaults.

      +
    • OptionalrevolveDegrees: number

    Returns Manifold

  • Remove vertices from the contours in this CrossSection that are less than +the specified distance epsilon from an imaginary line that passes through +its two adjacent vertices. Near duplicate vertices and collinear points +will be removed at lower epsilons, with elimination of line segments +becoming increasingly aggressive with larger epsilons.

    +

    It is recommended to apply this function following Offset, in order to +clean up any spurious tiny line segments introduced that do not improve +quality in any meaningful way. This is particularly important if further +offseting operations are to be performed, which would compound the issue.

    +

    Parameters

    • Optionalepsilon: number

      minimum distance vertices must diverge from the hypothetical +outline without them in order to be included in the output (default +1e-6)

      +

    Returns CrossSection

  • Transform this CrossSection in space. Stored in column-major order. This +operation can be chained. Transforms are combined and applied lazily.

    +

    Parameters

    • m: Mat3

      The affine transformation matrix to apply to all the vertices. The +last row is ignored.

      +

    Returns CrossSection

  • Move the vertices of this CrossSection (creating a new one) according to +any arbitrary input function, followed by a union operation (with a +Positive fill rule) that ensures any introduced intersections are not +included in the result.

    +

    Parameters

    • warpFunc: ((vert: Vec2) => void)

      A function that modifies a given vertex position.

      +
        • (vert): void
        • Parameters

          Returns void

    Returns CrossSection

  • Constructs a circle of a given radius.

    +

    Parameters

    • radius: number

      Radius of the circle. Must be positive.

      +
    • OptionalcircularSegments: number

      Number of segments along its diameter. Default is +calculated by the static Quality defaults according to the radius.

      +

    Returns CrossSection

  • Create a 2d cross-section from a set of contours (complex polygons). A +boolean union operation (with Positive filling rule by default) is +performed to combine overlapping polygons and ensure the resulting +CrossSection is free of intersections.

    +

    Parameters

    • contours: Polygons

      A set of closed paths describing zero or more complex +polygons.

      +
    • OptionalfillRule: FillRule

      The filling rule used to interpret polygon sub-regions in +contours.

      +

    Returns CrossSection

  • Constructs a square with the given XY dimensions. By default it is +positioned in the first quadrant, touching the origin. If any dimensions in +size are negative, or if all are zero, an empty Manifold will be returned.

    +

    Parameters

    • Optionalsize: number | Vec2

      The X, and Y dimensions of the square.

      +
    • Optionalcenter: boolean

      Set to true to shift the center to the origin.

      +

    Returns CrossSection

diff --git a/jsdocs/classes/manifold_encapsulated_types.Manifold.html b/jsdocs/classes/manifold_encapsulated_types.Manifold.html new file mode 100644 index 000000000..5059c0788 --- /dev/null +++ b/jsdocs/classes/manifold_encapsulated_types.Manifold.html @@ -0,0 +1,376 @@ +Manifold | manifold-3d

This library's internal representation of an oriented, 2-manifold, triangle +mesh - a simple boundary-representation of a solid object. Use this class to +store and operate on solids, and use MeshGL for input and output, or +potentially Mesh if only basic geometry is required.

+

In addition to storing geometric data, a Manifold can also store an arbitrary +number of vertex properties. These could be anything, e.g. normals, UV +coordinates, colors, etc, but this library is completely agnostic. All +properties are merely float values indexed by channel number. It is up to the +user to associate channel numbers with meaning.

+

Manifold allows vertex properties to be shared for efficient storage, or to +have multiple property verts associated with a single geometric vertex, +allowing sudden property changes, e.g. at Boolean intersections, without +sacrificing manifoldness.

+

Manifolds also keep track of their relationships to their inputs, via +OriginalIDs and the faceIDs and transforms accessible through MeshGL. This +allows object-level properties to be re-associated with the output after many +operations, particularly useful for materials. Since separate object's +properties are not mixed, there is no requirement that channels have +consistent meaning between different inputs.

+

Constructors

  • Convert a Mesh into a Manifold, retaining its properties and merging only +the positions according to the merge vectors. Will throw an error if the +result is not an oriented 2-manifold. Will collapse degenerate triangles +and unnecessary vertices.

    +

    All fields are read, making this structure suitable for a lossless +round-trip of data from getMesh(). For multi-material input, use +reserveIDs() to set a unique originalID for each material, and sort the +materials into triangle runs.

    +

    Parameters

    Returns Manifold

Methods

  • If you copy a manifold, but you want this new copy to have new properties +(e.g. a different UV mapping), you can reset its IDs to a new original, +meaning it will now be referenced by its descendants instead of the meshes +it was built from, allowing you to differentiate the copies when applying +your properties to the final result.

    +

    This function also condenses all coplanar faces in the relation, and +collapses those edges. If you want to have inconsistent properties across +these faces, meaning you want to preserve some of these edges, you should +instead call GetMesh(), calculate your properties and use these to +construct a new manifold.

    +

    Returns Manifold

  • Curvature is the inverse of the radius of curvature, and signed such that +positive is convex and negative is concave. There are two orthogonal +principal curvatures at any point on a manifold, with one maximum and the +other minimum. Gaussian curvature is their product, while mean +curvature is their sum. This approximates them for every vertex and assigns +them as vertex properties on the given channels.

    +

    Parameters

    • gaussianIdx: number

      The property channel index in which to store the +Gaussian curvature. An index < 0 will be ignored (stores nothing). The +property set will be automatically expanded to include the channel +index specified.

      +
    • meanIdx: number

      The property channel index in which to store the mean +curvature. An index < 0 will be ignored (stores nothing). The property +set will be automatically expanded to include the channel index +specified.

      +

    Returns Manifold

  • Fills in vertex properties for normal vectors, calculated from the mesh +geometry. Flat faces composed of three or more triangles will remain flat.

    +

    Parameters

    • normalIdx: number

      The property channel in which to store the X +values of the normals. The X, Y, and Z channels will be sequential. The +property set will be automatically expanded to include up through normalIdx

      +
        +
      • +
          +
        1. +
        +
      • +
      +
    • minSharpAngle: number

      Any edges with angles greater than this value will +remain sharp, getting different normal vector properties on each side of +the edge. By default, no edges are sharp and all normals are shared. With a +value of zero, the model is faceted and all normals match their triangle +normals, but in this case it would be better not to calculate normals at +all.

      +

    Returns Manifold

  • This operation returns a vector of Manifolds that are topologically +disconnected. If everything is connected, the vector is length one, +containing a copy of the original. It is the inverse operation of +Compose().

    +

    Returns Manifold[]

  • The genus is a topological property of the manifold, representing the +number of "handles". A sphere is 0, torus 1, etc. It is only meaningful for +a single mesh, so it is best to call Decompose() first.

    +

    Returns number

  • Returns a Mesh that is designed to easily push into a renderer, including +all interleaved vertex properties that may have been input. It also +includes relations to all the input meshes that form a part of this result +and the transforms applied to each.

    +

    Parameters

    • OptionalnormalIdx: Vec3

      If the original Mesh inputs that formed this manifold had +properties corresponding to normal vectors, you can specify which property +channels these are (x, y, z), which will cause this output Mesh to +automatically update these normals according to the applied transforms and +front/back side. Each channel must be >= 3 and < numProp, and all original +Meshes must use the same channels for their normals.

      +

    Returns Mesh

  • Returns the surface area and volume of the manifold. These properties are +clamped to zero for a given face if they are within the Precision(). This +means degenerate manifolds can by identified by testing these properties as +== 0.

    +

    Returns Properties

  • Returns the minimum gap between two manifolds. Returns a float between +0 and searchLength.

    +

    Parameters

    Returns number

  • Mirror this Manifold over the plane described by the unit form of the given +normal vector. If the length of the normal is zero, an empty Manifold is +returned. This operation can be chained. Transforms are combined and +applied lazily.

    +

    Parameters

    • normal: Vec3

      The normal vector of the plane to be mirrored over

      +

    Returns Manifold

  • The number of property vertices in the Manifold. This will always be >= +numVert, as some physical vertices may be duplicated to account for +different properties on different neighboring triangles.

    +

    Returns number

  • If this mesh is an original, this returns its ID that can be referenced +by product manifolds. If this manifold is a product, this +returns -1.

    +

    Returns number

  • Returns the precision of this Manifold's vertices, which tracks the +approximate rounding error over all the transforms and operations that have +led to this state. Any triangles that are colinear within this precision +are considered degenerate and removed. This is the value of ε +defining +ε-valid.

    +

    Returns number

  • Increase the density of the mesh by splitting every edge into n pieces. For +instance, with n = 2, each triangle will be split into 4 triangles. These +will all be coplanar (and will not be immediately collapsed) unless the +Mesh/Manifold has halfedgeTangents specified (e.g. from the Smooth() +constructor), in which case the new vertices will be moved to the +interpolated surface according to their barycentric coordinates.

    +

    Parameters

    • n: number

      The number of pieces to split every edge into. Must be > 1.

      +

    Returns Manifold

  • Increase the density of the mesh by splitting each edge into pieces of +roughly the input length. Interior verts are added to keep the rest of the +triangulation edges also of roughly the same length. If halfedgeTangents +are present (e.g. from the Smooth() constructor), the new vertices will be +moved to the interpolated surface according to their barycentric +coordinates.

    +

    Parameters

    • length: number

      The length that edges will be broken down to.

      +

    Returns Manifold

  • Applies an Euler angle rotation to the manifold, first about the X axis, +then Y, then Z, in degrees. We use degrees so that we can minimize rounding +error, and eliminate it completely for any multiples of 90 degrees. +Additionally, more efficient code paths are used to update the manifold +when the transforms only rotate by multiples of 90 degrees. This operation +can be chained. Transforms are combined and applied lazily.

    +

    Parameters

    • v: Vec3

      [X, Y, Z] rotation in degrees.

      +

    Returns Manifold

  • Parameters

    • x: number
    • Optionaly: number
    • Optionalz: number

    Returns Manifold

  • Create a new copy of this manifold with updated vertex properties by +supplying a function that takes the existing position and properties as +input. You may specify any number of output properties, allowing creation +and removal of channels. Note: undefined behavior will result if you read +past the number of input properties or write past the number of output +properties.

    +

    Parameters

    • numProp: number

      The new number of properties per vertex.

      +
    • propFunc: ((newProp: number[], position: Vec3, oldProp: number[]) => void)

      A function that modifies the properties of a given vertex.

      +
        • (newProp, position, oldProp): void
        • Parameters

          • newProp: number[]
          • position: Vec3
          • oldProp: number[]

          Returns void

    Returns Manifold

  • Returns the cross section of this object parallel to the X-Y plane at the +specified height. Using a height equal to the bottom +of the bounding box will return the bottom faces, while using a height +equal to the top of the bounding box will return empty.

    +

    Parameters

    • height: number

      Z-level of slice.

      +

    Returns CrossSection

  • Smooths out the Manifold by filling in the halfedgeTangent vectors. The +geometry will remain unchanged until Refine or RefineToLength is called to +interpolate the surface. This version uses the supplied vertex normal +properties to define the tangent vectors.

    +

    Parameters

    • normalIdx: number

      The first property channel of the normals. NumProp must be +at least normalIdx + 3. Any vertex where multiple normals exist and don't +agree will result in a sharp edge.

      +

    Returns Manifold

  • Smooths out the Manifold by filling in the halfedgeTangent vectors. The +geometry will remain unchanged until Refine or RefineToLength is called to +interpolate the surface. This version uses the geometry of the triangles +and pseudo-normals to define the tangent vectors.

    +

    Parameters

    • OptionalminSharpAngle: number

      degrees, default 60. Any edges with angles greater +than this value will remain sharp. The rest will be smoothed to G1 +continuity, with the caveat that flat faces of three or more triangles will +always remain flat. With a value of zero, the model is faceted, but in this +case there is no point in smoothing.

      +
    • OptionalminSmoothness: number

      range: 0 - 1, default 0. The smoothness applied to +sharp angles. The default gives a hard edge, while values > 0 will give a +small fillet on these sharp edges. A value of 1 is equivalent to a +minSharpAngle of 180 - all edges will be smooth.

      +

    Returns Manifold

  • Convenient version of Split() for a half-space.

    +

    Parameters

    • normal: Vec3

      This vector is normal to the cutting plane and its length +does +not matter. The first result is in the direction of this vector, the second +result is on the opposite side.

      +
    • originOffset: number

      The distance of the plane from the origin in the +direction of the normal vector.

      +

    Returns Manifold[]

  • Transform this Manifold in space. Stored in column-major order. This +operation can be chained. Transforms are combined and applied lazily.

    +

    Parameters

    • m: Mat4

      The affine transformation matrix to apply to all the vertices. The +last row is ignored.

      +

    Returns Manifold

  • Removes everything behind the given half-space plane.

    +

    Parameters

    • normal: Vec3

      This vector is normal to the cutting plane and its length +does not matter. The result is in the direction of this vector from the +plane.

      +
    • originOffset: number

      The distance of the plane from the origin in the +direction of the normal vector.

      +

    Returns Manifold

  • This function does not change the topology, but allows the vertices to be +moved according to any arbitrary input function. It is easy to create a +function that warps a geometrically valid object into one which overlaps, +but that is not checked here, so it is up to the user to choose their +function with discretion.

    +

    Parameters

    • warpFunc: ((vert: Vec3) => void)

      A function that modifies a given vertex position.

      +
        • (vert): void
        • Parameters

          Returns void

    Returns Manifold

  • Constructs a new manifold from a list of other manifolds. This is a purely +topological operation, so care should be taken to avoid creating +overlapping results. It is the inverse operation of Decompose().

    +

    Parameters

    • manifolds: Manifold[]

      A list of Manifolds to lazy-union together.

      +

    Returns Manifold

  • Constructs a unit cube (edge lengths all one), by default in the first +octant, touching the origin.

    +

    Parameters

    • Optionalsize: number | Vec3

      The X, Y, and Z dimensions of the box.

      +
    • Optionalcenter: boolean

      Set to true to shift the center to the origin.

      +

    Returns Manifold

  • A convenience constructor for the common case of extruding a circle. Can +also form cones if both radii are specified.

    +

    Parameters

    • height: number

      Z-extent

      +
    • radiusLow: number

      Radius of bottom circle. Must be positive.

      +
    • OptionalradiusHigh: number

      Radius of top circle. Can equal zero. Default is equal to +radiusLow.

      +
    • OptionalcircularSegments: number

      How many line segments to use around the circle. +Default is calculated by the static Defaults.

      +
    • Optionalcenter: boolean

      Set to true to shift the center to the origin. Default is +origin at the bottom.

      +

    Returns Manifold

  • Constructs a manifold from a set of polygons/cross-section by extruding +them along the Z-axis.

    +

    Parameters

    • polygons: Polygons | CrossSection

      A set of non-overlapping polygons to extrude.

      +
    • height: number

      Z-extent of extrusion.

      +
    • OptionalnDivisions: number

      Number of extra copies of the crossSection to insert into +the shape vertically; especially useful in combination with twistDegrees to +avoid interpolation artifacts. Default is none.

      +
    • OptionaltwistDegrees: number

      Amount to twist the top crossSection relative to the +bottom, interpolated linearly for the divisions in between.

      +
    • OptionalscaleTop: number | Vec2

      Amount to scale the top (independently in X and Y). If the +scale is {0, 0}, a pure cone is formed with only a single vertex at the +top. Default {1, 1}.

      +
    • Optionalcenter: boolean

      If true, the extrusion is centered on the z-axis through the +origin +as opposed to resting on the XY plane as is default.

      +

    Returns Manifold

  • Constructs a level-set Mesh from the input Signed-Distance Function (SDF). +This uses a form of Marching Tetrahedra (akin to Marching Cubes, but better +for manifoldness). Instead of using a cubic grid, it uses a body-centered +cubic grid (two shifted cubic grids). This means if your function's +interior exceeds the given bounds, you will see a kind of egg-crate shape +closing off the manifold, which is due to the underlying grid.

    +

    Parameters

    • sdf: ((point: Vec3) => number)

      The signed-distance function which returns the signed distance +of +a given point in R^3. Positive values are inside, negative outside.

      +
        • (point): number
        • Parameters

          Returns number

    • bounds: Box

      An axis-aligned box that defines the extent of the grid.

      +
    • edgeLength: number

      Approximate maximum edge length of the triangles in the +final result. This affects grid spacing, and hence has a strong effect on +performance.

      +
    • Optionallevel: number

      You can inset your Mesh by using a positive value, or outset +it with a negative value.

      +
    • Optionalprecision: number

      Ensure each vertex is within this distance of the true +surface. Defaults to -1, which will return the interpolated +crossing-point based on the two nearest grid points. Small positive values +will require more sdf evaluations per output vertex.

      +

    Returns Manifold

  • Convert a Mesh into a Manifold, retaining its properties and merging only +the positions according to the merge vectors. Will throw an error if the +result is not an oriented 2-manifold. Will collapse degenerate triangles +and unnecessary vertices.

    +

    All fields are read, making this structure suitable for a lossless +round-trip of data from getMesh(). For multi-material input, use +reserveIDs() to set a unique originalID for each material, and sort the +materials into triangle runs.

    +

    Parameters

    Returns Manifold

  • Returns the first of n sequential new unique mesh IDs for marking sets of +triangles that can be looked up after further operations. Assign to +Mesh.runOriginalID vector.

    +

    Parameters

    • count: number

    Returns number

  • Constructs a manifold from a set of polygons/cross-section by revolving +them around the Y-axis and then setting this as the Z-axis of the resulting +manifold. If the polygons cross the Y-axis, only the part on the positive X +side is used. Geometrically valid input will result in geometrically valid +output.

    +

    Parameters

    • polygons: Polygons | CrossSection

      A set of non-overlapping polygons to revolve.

      +
    • OptionalcircularSegments: number

      Number of segments along its diameter. Default is +calculated by the static Defaults.

      +
    • OptionalrevolveDegrees: number

      Number of degrees to revolve. Default is 360 degrees.

      +

    Returns Manifold

  • Constructs a smooth version of the input mesh by creating tangents; this +method will throw if you have supplied tangents with your mesh already. The +actual triangle resolution is unchanged; use the Refine() method to +interpolate to a higher-resolution curve.

    +

    By default, every edge is calculated for maximum smoothness (very much +approximately), attempting to minimize the maximum mean Curvature +magnitude. No higher-order derivatives are considered, as the interpolation +is independent per triangle, only sharing constraints on their boundaries.

    +

    Parameters

    • mesh: Mesh

      input Mesh.

      +
    • OptionalsharpenedEdges: Smoothness[]

      If desired, you can supply a vector of sharpened +halfedges, which should in general be a small subset of all halfedges. +Order of entries doesn't matter, as each one specifies the desired +smoothness (between zero and one, with one the default for all unspecified +halfedges) and the halfedge index (3 * triangle index + [0,1,2] where 0 is +the edge between triVert 0 and 1, etc).

      +

      At a smoothness value of zero, a sharp crease is made. The smoothness is +interpolated along each edge, so the specified value should be thought of +as an average. Where exactly two sharpened edges meet at a vertex, their +tangents are rotated to be colinear so that the sharpened edge can be +continuous. Vertices with only one sharpened edge are completely smooth, +allowing sharpened edges to smoothly vanish at termination. A single vertex +can be sharpened by sharping all edges that are incident on it, allowing +cones to be formed.

      +

    Returns Manifold

  • Constructs a geodesic sphere of a given radius.

    +

    Parameters

    • radius: number

      Radius of the sphere. Must be positive.

      +
    • OptionalcircularSegments: number

      Number of segments along its +diameter. This number will always be rounded up to the nearest factor of +four, as this sphere is constructed by refining an octahedron. This means +there are a circle of vertices on all three of the axis planes. Default is +calculated by the static Defaults.

      +

    Returns Manifold

diff --git a/jsdocs/classes/manifold_encapsulated_types.Mesh.html b/jsdocs/classes/manifold_encapsulated_types.Mesh.html new file mode 100644 index 000000000..28ce1d20b --- /dev/null +++ b/jsdocs/classes/manifold_encapsulated_types.Mesh.html @@ -0,0 +1,90 @@ +Mesh | manifold-3d

An alternative to Mesh for output suitable for pushing into graphics +libraries directly. This may not be manifold since the verts are duplicated +along property boundaries that do not match. The additional merge vectors +store this missing information, allowing the manifold to be reconstructed.

+

Constructors

Properties

faceID: Uint32Array

Optional: Length NumTri, contains an ID of the source face this triangle +comes from. When auto-generated, this ID will be a triangle index into the +original mesh. All neighboring coplanar triangles from that input mesh +will refer to a single triangle of that group as the faceID. When +supplying faceIDs, ensure that triangles with the same ID are in fact +coplanar and have consistent properties (within some tolerance) or the +output will be surprising.

+
halfedgeTangent: Float32Array

Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If +non-empty, must be exactly four times as long as Mesh.triVerts. Indexed +as 4 * (3 * tri + i) + j, i < 3, j < 4, representing the tangent value +Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted.

+
mergeFromVert: Uint32Array

Optional: A list of only the vertex indicies that need to be merged to +reconstruct the manifold.

+
mergeToVert: Uint32Array

Optional: The same length as mergeFromVert, and the corresponding value +contains the vertex to merge with. It will have an identical position, but +the other properties may differ.

+
numProp: number

Number of properties per vertex, always >= 3.

+
runIndex: Uint32Array

Optional: Indicates runs of triangles that correspond to a particular +input mesh instance. The runs encompass all of triVerts and are sorted +by runOriginalID. Run i begins at triVerts[runIndex[i]] and ends at +triVerts[runIndex[i+1]]. All runIndex values are divisible by 3. Returned +runIndex will always be 1 longer than runOriginalID, but same length is +also allowed as input: triVerts.size() will be automatically appended in +this case.

+
runOriginalID: Uint32Array

Optional: The OriginalID of the mesh this triangle run came from. This ID +is ideal for reapplying materials to the output mesh. Multiple runs may +have the same ID, e.g. representing different copies of the same input +mesh. If you create an input MeshGL that you want to be able to reference +as one or more originals, be sure to set unique values from ReserveIDs().

+
runTransform: Float32Array

Optional: For each run, a 3x4 transform is stored representing how the +corresponding original mesh was transformed to create this triangle run. +This matrix is stored in column-major order and the length of the overall +vector is 12 * runOriginalID.size().

+
triVerts: Uint32Array

The vertex indices of the three triangle corners in CCW (from the outside) +order, for each triangle.

+
vertProperties: Float32Array

Flat, GL-style interleaved list of all vertex properties: propVal = +vertProperties[vert * numProp + propIdx]. The first three properties are +always the position x, y, z.

+

Accessors

  • get numRun(): number
  • Number of triangle runs. Each triangle run is a set of consecutive +triangles that all come from the same instance of the same input mesh.

    +

    Returns number

Methods

  • Gets any other properties associated with this vertex.

    +

    Parameters

    • vert: number

      vertex index.

      +

    Returns Float32Array

  • Updates the mergeFromVert and mergeToVert vectors in order to create a +manifold solid. If the MeshGL is already manifold, no change will occur and +the function will return false. Otherwise, this will merge verts along open +edges within precision (the maximum of the MeshGL precision and the +baseline bounding-box precision), keeping any from the existing merge +vectors.

    +

    There is no guarantee the result will be manifold - this is a best-effort +helper function designed primarily to aid in the case where a manifold +multi-material MeshGL was produced, but its merge vectors were lost due to +a round-trip through a file format. Constructing a Manifold from the result +will report a Status if it is not manifold.

    +

    Returns boolean

diff --git a/jsdocs/documents/Get_Started.html b/jsdocs/documents/Get_Started.html new file mode 100644 index 000000000..8ba3bd019 --- /dev/null +++ b/jsdocs/documents/Get_Started.html @@ -0,0 +1,14 @@ +Get Started | manifold-3d

Get Started

In your project root folder run:

+
npm i manifold-3d
+
+ +

To start using Manifold, import it and initialize it:

+
import Module from 'manifold-3d';

const wasm = await Module();
wasm.setup();
const { Manifold } = wasm; +
+ +

Intro example

+
const {cube, sphere} = Manifold;
const box = cube([100, 100, 100], true);
const ball = sphere(60, 100);
const result = box.subtract(ball); +
+ +

In order to visualize Manifold mesh using Three.js library please check out our example here

+
diff --git a/jsdocs/functions/manifold_encapsulated_types.getCircularSegments.html b/jsdocs/functions/manifold_encapsulated_types.getCircularSegments.html new file mode 100644 index 000000000..b5096f49b --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.getCircularSegments.html @@ -0,0 +1,5 @@ +getCircularSegments | manifold-3d
diff --git a/jsdocs/functions/manifold_encapsulated_types.resetToCircularDefaults.html b/jsdocs/functions/manifold_encapsulated_types.resetToCircularDefaults.html new file mode 100644 index 000000000..62aef6087 --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.resetToCircularDefaults.html @@ -0,0 +1,3 @@ +resetToCircularDefaults | manifold-3d
diff --git a/jsdocs/functions/manifold_encapsulated_types.setCircularSegments.html b/jsdocs/functions/manifold_encapsulated_types.setCircularSegments.html new file mode 100644 index 000000000..7cb427add --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.setCircularSegments.html @@ -0,0 +1,7 @@ +setCircularSegments | manifold-3d
diff --git a/jsdocs/functions/manifold_encapsulated_types.setMinCircularAngle.html b/jsdocs/functions/manifold_encapsulated_types.setMinCircularAngle.html new file mode 100644 index 000000000..828bf7c78 --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.setMinCircularAngle.html @@ -0,0 +1,8 @@ +setMinCircularAngle | manifold-3d
  • Sets an angle constraint the default number of circular segments for the +CrossSection.circle, Manifold.cylinder, Manifold.sphere, and +Manifold.revolve constructors. The number of segments will be rounded +up to the nearest factor of four.

    +

    Parameters

    • angle: number

      The minimum angle in degrees between consecutive segments. The +angle will increase if the the segments hit the minimum edge length. +Default is 10 degrees.

      +

    Returns void

diff --git a/jsdocs/functions/manifold_encapsulated_types.setMinCircularEdgeLength.html b/jsdocs/functions/manifold_encapsulated_types.setMinCircularEdgeLength.html new file mode 100644 index 000000000..1d1674b43 --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.setMinCircularEdgeLength.html @@ -0,0 +1,7 @@ +setMinCircularEdgeLength | manifold-3d
diff --git a/jsdocs/functions/manifold_encapsulated_types.triangulate.html b/jsdocs/functions/manifold_encapsulated_types.triangulate.html new file mode 100644 index 000000000..7b55db18c --- /dev/null +++ b/jsdocs/functions/manifold_encapsulated_types.triangulate.html @@ -0,0 +1,6 @@ +triangulate | manifold-3d
  • Triangulates a set of /epsilon-valid polygons.

    +

    Parameters

    • polygons: Polygons

      The set of polygons, wound CCW and representing multiple +polygons and/or holes.

      +
    • Optionalprecision: number

      The value of epsilon, bounding the uncertainty of the input

      +

    Returns Vec3[]

    The triangles, referencing the original polygon points in order.

    +
diff --git a/jsdocs/index.html b/jsdocs/index.html new file mode 100644 index 000000000..b5568d3a2 --- /dev/null +++ b/jsdocs/index.html @@ -0,0 +1,12 @@ +manifold-3d

manifold-3d

codecov +twitter

+

If you like OpenSCAD / OpenJSCAD, you might also like ManifoldCAD - our own solid modelling web app based on this package.

+

A metallic Menger sponge

+

Manifold

High-level Documentation | API Documentation | Algorithm Documentation | Web Examples

+

Manifold is a geometry library dedicated to creating and operating on manifold triangle meshes. A manifold mesh is a mesh that represents a solid object, and so is very important in manufacturing, CAD, structural analysis, etc. Further information can be found on the wiki.

+

This library is fast with guaranteed manifold output. As such you need manifold meshes as input, which this library can create using constructors inspired by the OpenSCAD API, as well as more advanced features like smoothing and signed-distance function (SDF) level sets. You can also pass in your own mesh data, but you'll get an error status if the imported mesh isn't manifold. Various automated repair tools exist online for fixing non manifold models, usually for 3D printing.

+

The most significant contribution here is a guaranteed-manifold mesh Boolean algorithm, which I believe is the first of its kind. If you know of another, please open a discussion - a mesh Boolean algorithm robust to edge cases has been an open problem for many years. Likewise, if the Boolean here ever fails you, please submit an issue! This Boolean forms the basis of a CAD kernel, as it allows simple shapes to be combined into more complex ones.

+

Since Manifold is a WASM module, it does not automatically garbage-collect like regular JavaScript. You must manually delete() each manifold object constructed by your scripts, see discussion.

+

Please see our usage examples to see how to interface this library with three.js, <model-viewer>, and glTF. Of particular note are the included libraries for lossless roundtrip of manifold meshes through glTF files, via a new extension: EXT_mesh_manifold.

+

This library was started by Emmett Lalish. I am currently a Google employee and this is my 20% project, not an official Google project. At my day job I'm the maintainer of <model-viewer>. I was the first employee at a 3D video startup, Omnivor, and before that I worked on 3D printing at Microsoft, including 3D Builder. Originally an aerospace engineer, I started at a small DARPA contractor doing seedling projects, one of which became Sea Hunter. I earned my doctorate from the University of Washington in control theory and published some papers.

+
diff --git a/jsdocs/interfaces/manifold_encapsulated_types.MeshOptions.html b/jsdocs/interfaces/manifold_encapsulated_types.MeshOptions.html new file mode 100644 index 000000000..e8a4a4436 --- /dev/null +++ b/jsdocs/interfaces/manifold_encapsulated_types.MeshOptions.html @@ -0,0 +1,11 @@ +MeshOptions | manifold-3d
interface MeshOptions {
    faceID?: Uint32Array;
    halfedgeTangent?: Float32Array;
    mergeFromVert?: Uint32Array;
    mergeToVert?: Uint32Array;
    numProp: number;
    runIndex?: Uint32Array;
    runOriginalID?: Uint32Array;
    runTransform?: Float32Array;
    triVerts: Uint32Array;
    vertProperties: Float32Array;
}

Properties

faceID?: Uint32Array
halfedgeTangent?: Float32Array
mergeFromVert?: Uint32Array
mergeToVert?: Uint32Array
numProp: number
runIndex?: Uint32Array
runOriginalID?: Uint32Array
runTransform?: Float32Array
triVerts: Uint32Array
vertProperties: Float32Array
diff --git a/jsdocs/interfaces/manifold_global_types.SealedFloat32Array.html b/jsdocs/interfaces/manifold_global_types.SealedFloat32Array.html new file mode 100644 index 000000000..7c395e8f9 --- /dev/null +++ b/jsdocs/interfaces/manifold_global_types.SealedFloat32Array.html @@ -0,0 +1,146 @@ +SealedFloat32Array | manifold-3d
interface SealedFloat32Array<N> {
    BYTES_PER_ELEMENT: number;
    buffer: ArrayBuffer;
    byteLength: number;
    byteOffset: number;
    length: N;
    copyWithin(target: number, start: number, end?: number): this;
    every(predicate: ((value: number, index: number, array: Float32Array) => unknown), thisArg?: any): boolean;
    fill(value: number, start?: number, end?: number): this;
    filter(predicate: ((value: number, index: number, array: Float32Array) => any), thisArg?: any): Float32Array;
    find(predicate: ((value: number, index: number, obj: Float32Array) => boolean), thisArg?: any): number;
    findIndex(predicate: ((value: number, index: number, obj: Float32Array) => boolean), thisArg?: any): number;
    forEach(callbackfn: ((value: number, index: number, array: Float32Array) => void), thisArg?: any): void;
    indexOf(searchElement: number, fromIndex?: number): number;
    join(separator?: string): string;
    lastIndexOf(searchElement: number, fromIndex?: number): number;
    map(callbackfn: ((value: number, index: number, array: Float32Array) => number), thisArg?: any): Float32Array;
    reduce(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)): number;
    reduce(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number), initialValue: number): number;
    reduce<U>(callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U), initialValue: U): U;
    reduceRight(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)): number;
    reduceRight(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number), initialValue: number): number;
    reduceRight<U>(callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U), initialValue: U): U;
    reverse(): Float32Array;
    set(array: ArrayLike<number>, offset?: number): void;
    slice(start?: number, end?: number): Float32Array;
    some(predicate: ((value: number, index: number, array: Float32Array) => unknown), thisArg?: any): boolean;
    sort(compareFn?: ((a: number, b: number) => number)): this;
    subarray(begin?: number, end?: number): Float32Array;
    toLocaleString(): string;
    toString(): string;
    valueOf(): Float32Array;
}

Type Parameters

  • N extends number

Hierarchy

  • Float32Array
    • SealedFloat32Array

Properties

BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.

+
buffer: ArrayBuffer

The ArrayBuffer instance referenced by the array.

+
byteLength: number

The length in bytes of the array.

+
byteOffset: number

The offset in bytes of the array.

+
length: N

The length of the array.

+

Methods

  • Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target

    +

    Parameters

    • target: number

      If target is negative, it is treated as length+target where length is the +length of the array.

      +
    • start: number

      If start is negative, it is treated as length+start. If end is negative, it +is treated as length+end.

      +
    • Optionalend: number

      If not specified, length of the this object is used as its default value.

      +

    Returns this

  • Determines whether all the members of an array satisfy the specified test.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Float32Array) => unknown)

      A function that accepts up to three arguments. The every method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value false, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Float32Array

          Returns unknown

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Changes all array elements from start to end index to a static value and returns the modified array

    +

    Parameters

    • value: number

      value to fill array section with

      +
    • Optionalstart: number

      index to start filling the array at. If start is negative, it is treated as +length+start where length is the length of the array.

      +
    • Optionalend: number

      index to stop filling the array at. If end is negative, it is treated as +length+end.

      +

    Returns this

  • Returns the elements of an array that meet the condition specified in a callback function.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Float32Array) => any)

      A function that accepts up to three arguments. The filter method calls +the predicate function one time for each element in the array.

      +
        • (value, index, array): any
        • Parameters

          • value: number
          • index: number
          • array: Float32Array

          Returns any

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Float32Array

  • Returns the value of the first element in the array where predicate is true, and undefined +otherwise.

    +

    Parameters

    • predicate: ((value: number, index: number, obj: Float32Array) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, find +immediately returns that element value. Otherwise, find returns undefined.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Float32Array

          Returns boolean

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns number

  • Returns the index of the first element in the array where predicate is true, and -1 +otherwise.

    +

    Parameters

    • predicate: ((value: number, index: number, obj: Float32Array) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, +findIndex immediately returns that element index. Otherwise, findIndex returns -1.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Float32Array

          Returns boolean

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns number

  • Performs the specified action for each element in an array.

    +

    Parameters

    • callbackfn: ((value: number, index: number, array: Float32Array) => void)

      A function that accepts up to three arguments. forEach calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): void
        • Parameters

          • value: number
          • index: number
          • array: Float32Array

          Returns void

    • OptionalthisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns void

  • Returns the index of the first occurrence of a value in an array.

    +

    Parameters

    • searchElement: number

      The value to locate in the array.

      +
    • OptionalfromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the +search starts at index 0.

      +

    Returns number

  • Adds all the elements of an array separated by the specified separator string.

    +

    Parameters

    • Optionalseparator: string

      A string used to separate one element of an array from the next in the +resulting String. If omitted, the array elements are separated with a comma.

      +

    Returns string

  • Returns the index of the last occurrence of a value in an array.

    +

    Parameters

    • searchElement: number

      The value to locate in the array.

      +
    • OptionalfromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the +search starts at index 0.

      +

    Returns number

  • Calls a defined callback function on each element of an array, and returns an array that +contains the results.

    +

    Parameters

    • callbackfn: ((value: number, index: number, array: Float32Array) => number)

      A function that accepts up to three arguments. The map method calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): number
        • Parameters

          • value: number
          • index: number
          • array: Float32Array

          Returns number

    • OptionalthisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Float32Array

  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Reverses the elements in an Array.

    +

    Returns Float32Array

  • Sets a value or an array of values.

    +

    Parameters

    • array: ArrayLike<number>

      A typed or untyped array of values to set.

      +
    • Optionaloffset: number

      The index in the current array at which the values are to be written.

      +

    Returns void

  • Returns a section of an array.

    +

    Parameters

    • Optionalstart: number

      The beginning of the specified portion of the array.

      +
    • Optionalend: number

      The end of the specified portion of the array. This is exclusive of the element at the index 'end'.

      +

    Returns Float32Array

  • Determines whether the specified callback function returns true for any element of an array.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Float32Array) => unknown)

      A function that accepts up to three arguments. The some method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value true, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Float32Array

          Returns unknown

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Sorts an array.

    +

    Parameters

    • OptionalcompareFn: ((a: number, b: number) => number)

      Function used to determine the order of the elements. It is expected to return +a negative value if first argument is less than second argument, zero if they're equal and a positive +value otherwise. If omitted, the elements are sorted in ascending order.

      +
      [11,2,22,1].sort((a, b) => a - b)
      +
      + +
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns this

  • Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements +at begin, inclusive, up to end, exclusive.

    +

    Parameters

    • Optionalbegin: number

      The index of the beginning of the array.

      +
    • Optionalend: number

      The index of the end of the array.

      +

    Returns Float32Array

  • Converts a number to a string by using the current locale.

    +

    Returns string

  • Returns a string representation of an array.

    +

    Returns string

  • Returns the primitive value of the specified object.

    +

    Returns Float32Array

diff --git a/jsdocs/interfaces/manifold_global_types.SealedUint32Array.html b/jsdocs/interfaces/manifold_global_types.SealedUint32Array.html new file mode 100644 index 000000000..d431ae533 --- /dev/null +++ b/jsdocs/interfaces/manifold_global_types.SealedUint32Array.html @@ -0,0 +1,146 @@ +SealedUint32Array | manifold-3d
interface SealedUint32Array<N> {
    BYTES_PER_ELEMENT: number;
    buffer: ArrayBuffer;
    byteLength: number;
    byteOffset: number;
    length: N;
    copyWithin(target: number, start: number, end?: number): this;
    every(predicate: ((value: number, index: number, array: Uint32Array) => unknown), thisArg?: any): boolean;
    fill(value: number, start?: number, end?: number): this;
    filter(predicate: ((value: number, index: number, array: Uint32Array) => any), thisArg?: any): Uint32Array;
    find(predicate: ((value: number, index: number, obj: Uint32Array) => boolean), thisArg?: any): number;
    findIndex(predicate: ((value: number, index: number, obj: Uint32Array) => boolean), thisArg?: any): number;
    forEach(callbackfn: ((value: number, index: number, array: Uint32Array) => void), thisArg?: any): void;
    indexOf(searchElement: number, fromIndex?: number): number;
    join(separator?: string): string;
    lastIndexOf(searchElement: number, fromIndex?: number): number;
    map(callbackfn: ((value: number, index: number, array: Uint32Array) => number), thisArg?: any): Uint32Array;
    reduce(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)): number;
    reduce(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number), initialValue: number): number;
    reduce<U>(callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U), initialValue: U): U;
    reduceRight(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)): number;
    reduceRight(callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number), initialValue: number): number;
    reduceRight<U>(callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U), initialValue: U): U;
    reverse(): Uint32Array;
    set(array: ArrayLike<number>, offset?: number): void;
    slice(start?: number, end?: number): Uint32Array;
    some(predicate: ((value: number, index: number, array: Uint32Array) => unknown), thisArg?: any): boolean;
    sort(compareFn?: ((a: number, b: number) => number)): this;
    subarray(begin?: number, end?: number): Uint32Array;
    toLocaleString(): string;
    toString(): string;
    valueOf(): Uint32Array;
}

Type Parameters

  • N extends number

Hierarchy

  • Uint32Array
    • SealedUint32Array

Properties

BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.

+
buffer: ArrayBuffer

The ArrayBuffer instance referenced by the array.

+
byteLength: number

The length in bytes of the array.

+
byteOffset: number

The offset in bytes of the array.

+
length: N

The length of the array.

+

Methods

  • Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target

    +

    Parameters

    • target: number

      If target is negative, it is treated as length+target where length is the +length of the array.

      +
    • start: number

      If start is negative, it is treated as length+start. If end is negative, it +is treated as length+end.

      +
    • Optionalend: number

      If not specified, length of the this object is used as its default value.

      +

    Returns this

  • Determines whether all the members of an array satisfy the specified test.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Uint32Array) => unknown)

      A function that accepts up to three arguments. The every method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value false, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Uint32Array

          Returns unknown

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Changes all array elements from start to end index to a static value and returns the modified array

    +

    Parameters

    • value: number

      value to fill array section with

      +
    • Optionalstart: number

      index to start filling the array at. If start is negative, it is treated as +length+start where length is the length of the array.

      +
    • Optionalend: number

      index to stop filling the array at. If end is negative, it is treated as +length+end.

      +

    Returns this

  • Returns the elements of an array that meet the condition specified in a callback function.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Uint32Array) => any)

      A function that accepts up to three arguments. The filter method calls +the predicate function one time for each element in the array.

      +
        • (value, index, array): any
        • Parameters

          • value: number
          • index: number
          • array: Uint32Array

          Returns any

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Uint32Array

  • Returns the value of the first element in the array where predicate is true, and undefined +otherwise.

    +

    Parameters

    • predicate: ((value: number, index: number, obj: Uint32Array) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, find +immediately returns that element value. Otherwise, find returns undefined.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Uint32Array

          Returns boolean

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns number

  • Returns the index of the first element in the array where predicate is true, and -1 +otherwise.

    +

    Parameters

    • predicate: ((value: number, index: number, obj: Uint32Array) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, +findIndex immediately returns that element index. Otherwise, findIndex returns -1.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Uint32Array

          Returns boolean

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns number

  • Performs the specified action for each element in an array.

    +

    Parameters

    • callbackfn: ((value: number, index: number, array: Uint32Array) => void)

      A function that accepts up to three arguments. forEach calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): void
        • Parameters

          • value: number
          • index: number
          • array: Uint32Array

          Returns void

    • OptionalthisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns void

  • Returns the index of the first occurrence of a value in an array.

    +

    Parameters

    • searchElement: number

      The value to locate in the array.

      +
    • OptionalfromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the +search starts at index 0.

      +

    Returns number

  • Adds all the elements of an array separated by the specified separator string.

    +

    Parameters

    • Optionalseparator: string

      A string used to separate one element of an array from the next in the +resulting String. If omitted, the array elements are separated with a comma.

      +

    Returns string

  • Returns the index of the last occurrence of a value in an array.

    +

    Parameters

    • searchElement: number

      The value to locate in the array.

      +
    • OptionalfromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the +search starts at index 0.

      +

    Returns number

  • Calls a defined callback function on each element of an array, and returns an array that +contains the results.

    +

    Parameters

    • callbackfn: ((value: number, index: number, array: Uint32Array) => number)

      A function that accepts up to three arguments. The map method calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): number
        • Parameters

          • value: number
          • index: number
          • array: Uint32Array

          Returns number

    • OptionalthisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Uint32Array

  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Uint32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Reverses the elements in an Array.

    +

    Returns Uint32Array

  • Sets a value or an array of values.

    +

    Parameters

    • array: ArrayLike<number>

      A typed or untyped array of values to set.

      +
    • Optionaloffset: number

      The index in the current array at which the values are to be written.

      +

    Returns void

  • Returns a section of an array.

    +

    Parameters

    • Optionalstart: number

      The beginning of the specified portion of the array.

      +
    • Optionalend: number

      The end of the specified portion of the array. This is exclusive of the element at the index 'end'.

      +

    Returns Uint32Array

  • Determines whether the specified callback function returns true for any element of an array.

    +

    Parameters

    • predicate: ((value: number, index: number, array: Uint32Array) => unknown)

      A function that accepts up to three arguments. The some method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value true, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Uint32Array

          Returns unknown

    • OptionalthisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Sorts an array.

    +

    Parameters

    • OptionalcompareFn: ((a: number, b: number) => number)

      Function used to determine the order of the elements. It is expected to return +a negative value if first argument is less than second argument, zero if they're equal and a positive +value otherwise. If omitted, the elements are sorted in ascending order.

      +
      [11,2,22,1].sort((a, b) => a - b)
      +
      + +
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns this

  • Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements +at begin, inclusive, up to end, exclusive.

    +

    Parameters

    • Optionalbegin: number

      The index of the beginning of the array.

      +
    • Optionalend: number

      The index of the end of the array.

      +

    Returns Uint32Array

  • Converts a number to a string by using the current locale.

    +

    Returns string

  • Returns a string representation of an array.

    +

    Returns string

  • Returns the primitive value of the specified object.

    +

    Returns Uint32Array

diff --git a/jsdocs/modules/manifold_encapsulated_types.html b/jsdocs/modules/manifold_encapsulated_types.html new file mode 100644 index 000000000..32183da2a --- /dev/null +++ b/jsdocs/modules/manifold_encapsulated_types.html @@ -0,0 +1,11 @@ +manifold-encapsulated-types | manifold-3d
diff --git a/jsdocs/modules/manifold_global_types.html b/jsdocs/modules/manifold_global_types.html new file mode 100644 index 000000000..f4d3dc91c --- /dev/null +++ b/jsdocs/modules/manifold_global_types.html @@ -0,0 +1,15 @@ +manifold-global-types | manifold-3d
diff --git a/jsdocs/types/manifold_global_types.Box.html b/jsdocs/types/manifold_global_types.Box.html new file mode 100644 index 000000000..c6ec34dd6 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Box.html @@ -0,0 +1 @@ +Box | manifold-3d
Box: {
    max: Vec3;
    min: Vec3;
}
diff --git a/jsdocs/types/manifold_global_types.FillRule.html b/jsdocs/types/manifold_global_types.FillRule.html new file mode 100644 index 000000000..1442eb37b --- /dev/null +++ b/jsdocs/types/manifold_global_types.FillRule.html @@ -0,0 +1 @@ +FillRule | manifold-3d
FillRule:
    | "EvenOdd"
    | "NonZero"
    | "Positive"
    | "Negative"
diff --git a/jsdocs/types/manifold_global_types.JoinType.html b/jsdocs/types/manifold_global_types.JoinType.html new file mode 100644 index 000000000..ea53a516d --- /dev/null +++ b/jsdocs/types/manifold_global_types.JoinType.html @@ -0,0 +1 @@ +JoinType | manifold-3d
JoinType: "Square" | "Round" | "Miter"
diff --git a/jsdocs/types/manifold_global_types.Mat3.html b/jsdocs/types/manifold_global_types.Mat3.html new file mode 100644 index 000000000..2bc56e2be --- /dev/null +++ b/jsdocs/types/manifold_global_types.Mat3.html @@ -0,0 +1 @@ +Mat3 | manifold-3d
Mat3: [number, number, number, number, number, number, number, number, number]
diff --git a/jsdocs/types/manifold_global_types.Mat4.html b/jsdocs/types/manifold_global_types.Mat4.html new file mode 100644 index 000000000..5bd83e852 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Mat4.html @@ -0,0 +1 @@ +Mat4 | manifold-3d
Mat4: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
diff --git a/jsdocs/types/manifold_global_types.Polygons.html b/jsdocs/types/manifold_global_types.Polygons.html new file mode 100644 index 000000000..842423d5c --- /dev/null +++ b/jsdocs/types/manifold_global_types.Polygons.html @@ -0,0 +1 @@ +Polygons | manifold-3d
diff --git a/jsdocs/types/manifold_global_types.Properties.html b/jsdocs/types/manifold_global_types.Properties.html new file mode 100644 index 000000000..f9082209d --- /dev/null +++ b/jsdocs/types/manifold_global_types.Properties.html @@ -0,0 +1 @@ +Properties | manifold-3d
Properties: {
    surfaceArea: number;
    volume: number;
}
diff --git a/jsdocs/types/manifold_global_types.Rect.html b/jsdocs/types/manifold_global_types.Rect.html new file mode 100644 index 000000000..f8fd432e5 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Rect.html @@ -0,0 +1 @@ +Rect | manifold-3d
Rect: {
    max: Vec2;
    min: Vec2;
}
diff --git a/jsdocs/types/manifold_global_types.SimplePolygon.html b/jsdocs/types/manifold_global_types.SimplePolygon.html new file mode 100644 index 000000000..6ae91bd32 --- /dev/null +++ b/jsdocs/types/manifold_global_types.SimplePolygon.html @@ -0,0 +1 @@ +SimplePolygon | manifold-3d
SimplePolygon: Vec2[]
diff --git a/jsdocs/types/manifold_global_types.Smoothness.html b/jsdocs/types/manifold_global_types.Smoothness.html new file mode 100644 index 000000000..cfbe74796 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Smoothness.html @@ -0,0 +1 @@ +Smoothness | manifold-3d
Smoothness: {
    halfedge: number;
    smoothness: number;
}
diff --git a/jsdocs/types/manifold_global_types.Vec2.html b/jsdocs/types/manifold_global_types.Vec2.html new file mode 100644 index 000000000..409a67fd0 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Vec2.html @@ -0,0 +1 @@ +Vec2 | manifold-3d
Vec2: [number, number]
diff --git a/jsdocs/types/manifold_global_types.Vec3.html b/jsdocs/types/manifold_global_types.Vec3.html new file mode 100644 index 000000000..dbc542a83 --- /dev/null +++ b/jsdocs/types/manifold_global_types.Vec3.html @@ -0,0 +1 @@ +Vec3 | manifold-3d
Vec3: [number, number, number]
diff --git a/make-manifold.html b/make-manifold.html new file mode 100644 index 000000000..2ccbe4c11 --- /dev/null +++ b/make-manifold.html @@ -0,0 +1,69 @@ + + + + + Make manifold glTF + + + + + + + + + + + +

Load a glTF/GLB model and our Manifold library will attempt to + merge it into a set of manifold objects. If the model is water-tight, you can download the new GLB which will have + our EXT_mesh_manifold extension, thus preserving the + manifold data without losing any mesh properties.

+

If the View Manifold GLB checkbox is enabled, then some meshes in the model have open edges and don't represent a + solid object. Check this box to see only the manifold parts, which will also enable them to be downloaded. If the + download button is still disabled, it means there were no manifold meshes found.

+ + + + + + Drop a GLB here + + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..c49420c67 --- /dev/null +++ b/manifest.json @@ -0,0 +1,42 @@ +{ + "name": "ManifoldCAD", + "icons": [ + { + "src": "/icons/mengerSponge192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/icons/mengerSponge512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "id": "/", + "start_url": "/", + "background_color": "#FFFFFF", + "display": "standalone", + "orientation": "landscape", + "scope": "/", + "theme_color": "#A288B3", + "description": "Fast, reliable, parametric solid modeling web app. Programmatic 3D design with JavaScript, inspired by and improving upon OpenSCAD & JSCAD. Demonstrates a new GPU-parallel, open-source geometry kernel: Manifold.", + "categories": [ + "design", + "developer", + "education", + "graphics", + "productivity" + ], + "screenshots": [ + { + "src": "/icons/manifoldCAD.png", + "type": "image/png", + "sizes": "2906x1980" + }, + { + "src": "/icons/manifoldCADonly.png", + "type": "image/png", + "sizes": "2906x1980" + } + ] +} \ No newline at end of file diff --git a/manifold-encapsulated-types.d.ts b/manifold-encapsulated-types.d.ts new file mode 100644 index 000000000..89267bd58 --- /dev/null +++ b/manifold-encapsulated-types.d.ts @@ -0,0 +1,1174 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {Box, FillRule, JoinType, Mat3, Mat4, Polygons, Properties, Rect, SealedFloat32Array, SealedUint32Array, SimplePolygon, Smoothness, Vec2, Vec3} from './manifold-global-types'; + +/** + * Triangulates a set of /epsilon-valid polygons. + * + * @param polygons The set of polygons, wound CCW and representing multiple + * polygons and/or holes. + * @param precision The value of epsilon, bounding the uncertainty of the input + * @return The triangles, referencing the original polygon points in order. + */ +export function triangulate(polygons: Polygons, precision?: number): Vec3[]; + +/** + * Sets an angle constraint the default number of circular segments for the + * {@link CrossSection.circle}, {@link Manifold.cylinder}, {@link + * Manifold.sphere}, and + * {@link Manifold.revolve} constructors. The number of segments will be rounded + * up to the nearest factor of four. + * + * @param angle The minimum angle in degrees between consecutive segments. The + * angle will increase if the the segments hit the minimum edge length. + * Default is 10 degrees. + */ +export function setMinCircularAngle(angle: number): void; + +/** + * Sets a length constraint the default number of circular segments for the + * {@link CrossSection.circle}, {@link Manifold.cylinder}, {@link + * Manifold.sphere}, and + * {@link Manifold.revolve} constructors. The number of segments will be rounded + * up to the nearest factor of four. + * + * @param length The minimum length of segments. The length will + * increase if the the segments hit the minimum angle. Default is 1.0. + */ +export function setMinCircularEdgeLength(length: number): void; + +/** + * Sets the default number of circular segments for the + * {@link CrossSection.circle}, {@link Manifold.cylinder}, {@link + * Manifold.sphere}, and + * {@link Manifold.revolve} constructors. Overrides the edge length and angle + * constraints and sets the number of segments to exactly this value. + * + * @param segments Number of circular segments. Default is 0, meaning no + * constraint is applied. + */ +export function setCircularSegments(segments: number): void; + +/** + * Determine the result of the {@link setMinCircularAngle}, + * {@link setMinCircularEdgeLength}, and {@link setCircularSegments} defaults. + * + * @param radius For a given radius of circle, determine how many default + * segments there will be. + */ +export function getCircularSegments(radius: number): number; + +/** + * Resets the circular construction parameters to their defaults if + * {@link setMinCircularAngle}, {@link setMinCircularEdgeLength}, or {@link + * setCircularSegments} have been called. + */ +export function resetToCircularDefaults(): void; +///@} + +export class CrossSection { + /** + * Create a 2d cross-section from a set of contours (complex polygons). A + * boolean union operation (with Positive filling rule by default) is + * performed to combine overlapping polygons and ensure the resulting + * CrossSection is free of intersections. + * + * @param contours A set of closed paths describing zero or more complex + * polygons. + * @param fillRule The filling rule used to interpret polygon sub-regions in + * contours. + */ + constructor(contours: Polygons, fillRule?: FillRule); + + // Shapes + + /** + * Constructs a square with the given XY dimensions. By default it is + * positioned in the first quadrant, touching the origin. If any dimensions in + * size are negative, or if all are zero, an empty Manifold will be returned. + * + * @param size The X, and Y dimensions of the square. + * @param center Set to true to shift the center to the origin. + */ + static square(size?: Vec2|number, center?: boolean): CrossSection; + + /** + * Constructs a circle of a given radius. + * + * @param radius Radius of the circle. Must be positive. + * @param circularSegments Number of segments along its diameter. Default is + * calculated by the static Quality defaults according to the radius. + */ + static circle(radius: number, circularSegments?: number): CrossSection; + + // Extrusions (2d to 3d manifold) + + /** + * Constructs a manifold by extruding the cross-section along Z-axis. + * + * @param height Z-extent of extrusion. + * @param nDivisions Number of extra copies of the crossSection to insert into + * the shape vertically; especially useful in combination with twistDegrees to + * avoid interpolation artifacts. Default is none. + * @param twistDegrees Amount to twist the top crossSection relative to the + * bottom, interpolated linearly for the divisions in between. + * @param scaleTop Amount to scale the top (independently in X and Y). If the + * scale is {0, 0}, a pure cone is formed with only a single vertex at the + * top. Default {1, 1}. + * @param center If true, the extrusion is centered on the z-axis through the + * origin + * as opposed to resting on the XY plane as is default. + */ + extrude( + height: number, nDivisions?: number, twistDegrees?: number, + scaleTop?: Vec2|number, center?: boolean): Manifold; + + /** + * Constructs a manifold by revolving this cross-section around its Y-axis and + * then setting this as the Z-axis of the resulting manifold. If the contours + * cross the Y-axis, only the part on the positive X side is used. + * Geometrically valid input will result in geometrically valid output. + * + * @param circularSegments Number of segments along its diameter. Default is + * calculated by the static Defaults. + */ + revolve(circularSegments?: number, revolveDegrees?: number): Manifold; + + // Transformations + + /** + * Transform this CrossSection in space. Stored in column-major order. This + * operation can be chained. Transforms are combined and applied lazily. + * + * @param m The affine transformation matrix to apply to all the vertices. The + * last row is ignored. + */ + transform(m: Mat3): CrossSection; + + /** + * Move this CrossSection in space. This operation can be chained. Transforms + * are combined and applied lazily. + * + * @param v The vector to add to every vertex. + */ + translate(v: Vec2): CrossSection; + translate(x: number, y?: number): CrossSection; + + /** + * Applies a (Z-axis) rotation to the CrossSection, in degrees. This operation + * can be chained. Transforms are combined and applied lazily. + * + * @param degrees degrees about the Z-axis to rotate. + */ + rotate(degrees: number): CrossSection; + + /** + * Scale this CrossSection in space. This operation can be chained. Transforms + * are combined and applied lazily. + * + * @param v The vector to multiply every vertex by per component. + */ + scale(v: Vec2|number): CrossSection; + + + /** + * Mirror this CrossSection over the arbitrary axis described by the unit form + * of the given vector. If the length of the vector is zero, an empty + * CrossSection is returned. This operation can be chained. Transforms are + * combined and applied lazily. + * + * @param ax the axis to be mirrored over + */ + mirror(ax: Vec2): CrossSection; + + /** + * Move the vertices of this CrossSection (creating a new one) according to + * any arbitrary input function, followed by a union operation (with a + * Positive fill rule) that ensures any introduced intersections are not + * included in the result. + * + * @param warpFunc A function that modifies a given vertex position. + */ + warp(warpFunc: (vert: Vec2) => void): CrossSection; + + /** + * Inflate the contours in CrossSection by the specified delta, handling + * corners according to the given JoinType. + * + * @param delta Positive deltas will cause the expansion of outlining contours + * to expand, and retraction of inner (hole) contours. Negative deltas will + * have the opposite effect. + * @param joinType The join type specifying the treatment of contour joins + * (corners). + * @param miterLimit The maximum distance in multiples of delta that vertices + * can be offset from their original positions with before squaring is + * applied, **when the join type is Miter** (default is 2, which is the + * minimum allowed). See the [Clipper2 + * MiterLimit](http://www.angusj.com/clipper2/Docs/Units/Clipper.Offset/Classes/ClipperOffset/Properties/MiterLimit.htm) + * page for a visual example. + * @param circularSegments Number of segments per 360 degrees of + * JoinType::Round corners (roughly, the number of vertices that + * will be added to each contour). Default is calculated by the static Quality + * defaults according to the radius. + */ + offset( + delta: number, joinType?: JoinType, miterLimit?: number, + circularSegments?: number): CrossSection; + + /** + * Remove vertices from the contours in this CrossSection that are less than + * the specified distance epsilon from an imaginary line that passes through + * its two adjacent vertices. Near duplicate vertices and collinear points + * will be removed at lower epsilons, with elimination of line segments + * becoming increasingly aggressive with larger epsilons. + * + * It is recommended to apply this function following Offset, in order to + * clean up any spurious tiny line segments introduced that do not improve + * quality in any meaningful way. This is particularly important if further + * offseting operations are to be performed, which would compound the issue. + * + * @param epsilon minimum distance vertices must diverge from the hypothetical + * outline without them in order to be included in the output (default + * 1e-6) + */ + simplify(epsilon?: number): CrossSection; + + // Clipping Operations + + /** + * Boolean union + */ + add(other: CrossSection|Polygons): CrossSection; + + /** + * Boolean difference + */ + subtract(other: CrossSection|Polygons): CrossSection; + + /** + * Boolean intersection + */ + intersect(other: CrossSection|Polygons): CrossSection; + + /** + * Boolean union of the cross-sections a and b + */ + static union(a: CrossSection|Polygons, b: CrossSection|Polygons): + CrossSection; + + /** + * Boolean difference of the cross-section b from the cross-section a + */ + static difference(a: CrossSection|Polygons, b: CrossSection|Polygons): + CrossSection; + + /** + * Boolean intersection of the cross-sections a and b + */ + static intersection(a: CrossSection|Polygons, b: CrossSection|Polygons): + CrossSection; + + /** + * Boolean union of a list of cross-sections + */ + static union(polygons: (CrossSection|Polygons)[]): CrossSection; + + /** + * Boolean difference of the tail of a list of cross-sections from its head + */ + static difference(polygons: (CrossSection|Polygons)[]): CrossSection; + + /** + * Boolean intersection of a list of cross-sections + */ + static intersection(polygons: (CrossSection|Polygons)[]): CrossSection; + + // Convex Hulls + + /** + * Compute the convex hull of the contours in this CrossSection. + */ + hull(): CrossSection; + + /** + * Compute the convex hull of all points in a list of polygons/cross-sections. + */ + static hull(polygons: (CrossSection|Polygons)[]): CrossSection; + + // Topological Operations + + /** + * Construct a CrossSection from a vector of other Polygons (batch + * boolean union). + */ + static compose(polygons: (CrossSection|Polygons)[]): CrossSection; + + /** + * This operation returns a vector of CrossSections that are topologically + * disconnected, each containing one outline contour with zero or more + * holes. + */ + decompose(): CrossSection[]; + + // Polygon Conversion + + /** + * Create a 2d cross-section from a set of contours (complex polygons). A + * boolean union operation (with Positive filling rule by default) is + * performed to combine overlapping polygons and ensure the resulting + * CrossSection is free of intersections. + * + * @param contours A set of closed paths describing zero or more complex + * polygons. + * @param fillRule The filling rule used to interpret polygon sub-regions in + * contours. + */ + static ofPolygons(contours: Polygons, fillRule?: FillRule): CrossSection; + + /** + * Return the contours of this CrossSection as a list of simple polygons. + */ + toPolygons(): SimplePolygon[]; + + // Properties + + /** + * Return the total area covered by complex polygons making up the + * CrossSection. + */ + area(): number; + + /** + * Does the CrossSection (not) have any contours? + */ + isEmpty(): boolean; + + /** + * The number of vertices in the CrossSection. + */ + numVert(): number; + + /** + * The number of contours in the CrossSection. + */ + numContour(): number; + + /** + * Returns the axis-aligned bounding rectangle of all the CrossSection's + * vertices. + */ + bounds(): Rect; + + // Memory + + /** + * Frees the WASM memory of this CrossSection, since these cannot be + * garbage-collected automatically. + */ + delete(): void; +} + +/** + * This library's internal representation of an oriented, 2-manifold, triangle + * mesh - a simple boundary-representation of a solid object. Use this class to + * store and operate on solids, and use MeshGL for input and output, or + * potentially Mesh if only basic geometry is required. + * + * In addition to storing geometric data, a Manifold can also store an arbitrary + * number of vertex properties. These could be anything, e.g. normals, UV + * coordinates, colors, etc, but this library is completely agnostic. All + * properties are merely float values indexed by channel number. It is up to the + * user to associate channel numbers with meaning. + * + * Manifold allows vertex properties to be shared for efficient storage, or to + * have multiple property verts associated with a single geometric vertex, + * allowing sudden property changes, e.g. at Boolean intersections, without + * sacrificing manifoldness. + * + * Manifolds also keep track of their relationships to their inputs, via + * OriginalIDs and the faceIDs and transforms accessible through MeshGL. This + * allows object-level properties to be re-associated with the output after many + * operations, particularly useful for materials. Since separate object's + * properties are not mixed, there is no requirement that channels have + * consistent meaning between different inputs. + */ +export class Manifold { + /** + * Convert a Mesh into a Manifold, retaining its properties and merging only + * the positions according to the merge vectors. Will throw an error if the + * result is not an oriented 2-manifold. Will collapse degenerate triangles + * and unnecessary vertices. + * + * All fields are read, making this structure suitable for a lossless + * round-trip of data from getMesh(). For multi-material input, use + * reserveIDs() to set a unique originalID for each material, and sort the + * materials into triangle runs. + */ + constructor(mesh: Mesh); + + // Shapes + + /** + * Constructs a tetrahedron centered at the origin with one vertex at (1,1,1) + * and the rest at similarly symmetric points. + */ + static tetrahedron(): Manifold; + + /** + * Constructs a unit cube (edge lengths all one), by default in the first + * octant, touching the origin. + * + * @param size The X, Y, and Z dimensions of the box. + * @param center Set to true to shift the center to the origin. + */ + static cube(size?: Vec3|number, center?: boolean): Manifold; + + /** + * A convenience constructor for the common case of extruding a circle. Can + * also form cones if both radii are specified. + * + * @param height Z-extent + * @param radiusLow Radius of bottom circle. Must be positive. + * @param radiusHigh Radius of top circle. Can equal zero. Default is equal to + * radiusLow. + * @param circularSegments How many line segments to use around the circle. + * Default is calculated by the static Defaults. + * @param center Set to true to shift the center to the origin. Default is + * origin at the bottom. + */ + static cylinder( + height: number, radiusLow: number, radiusHigh?: number, + circularSegments?: number, center?: boolean): Manifold; + + /** + * Constructs a geodesic sphere of a given radius. + * + * @param radius Radius of the sphere. Must be positive. + * @param circularSegments Number of segments along its + * diameter. This number will always be rounded up to the nearest factor of + * four, as this sphere is constructed by refining an octahedron. This means + * there are a circle of vertices on all three of the axis planes. Default is + * calculated by the static Defaults. + */ + static sphere(radius: number, circularSegments?: number): Manifold; + + // Extrusions from 2d shapes + + /** + * Constructs a manifold from a set of polygons/cross-section by extruding + * them along the Z-axis. + * + * @param polygons A set of non-overlapping polygons to extrude. + * @param height Z-extent of extrusion. + * @param nDivisions Number of extra copies of the crossSection to insert into + * the shape vertically; especially useful in combination with twistDegrees to + * avoid interpolation artifacts. Default is none. + * @param twistDegrees Amount to twist the top crossSection relative to the + * bottom, interpolated linearly for the divisions in between. + * @param scaleTop Amount to scale the top (independently in X and Y). If the + * scale is {0, 0}, a pure cone is formed with only a single vertex at the + * top. Default {1, 1}. + * @param center If true, the extrusion is centered on the z-axis through the + * origin + * as opposed to resting on the XY plane as is default. + */ + static extrude( + polygons: CrossSection|Polygons, height: number, nDivisions?: number, + twistDegrees?: number, scaleTop?: Vec2|number, + center?: boolean): Manifold; + + /** + * Constructs a manifold from a set of polygons/cross-section by revolving + * them around the Y-axis and then setting this as the Z-axis of the resulting + * manifold. If the polygons cross the Y-axis, only the part on the positive X + * side is used. Geometrically valid input will result in geometrically valid + * output. + * + * @param polygons A set of non-overlapping polygons to revolve. + * @param circularSegments Number of segments along its diameter. Default is + * calculated by the static Defaults. + * @param revolveDegrees Number of degrees to revolve. Default is 360 degrees. + */ + static revolve( + polygons: CrossSection|Polygons, circularSegments?: number, + revolveDegrees?: number): Manifold; + + // Mesh Conversion + + /** + * Convert a Mesh into a Manifold, retaining its properties and merging only + * the positions according to the merge vectors. Will throw an error if the + * result is not an oriented 2-manifold. Will collapse degenerate triangles + * and unnecessary vertices. + * + * All fields are read, making this structure suitable for a lossless + * round-trip of data from getMesh(). For multi-material input, use + * reserveIDs() to set a unique originalID for each material, and sort the + * materials into triangle runs. + */ + static ofMesh(mesh: Mesh): Manifold; + + /** + * Constructs a smooth version of the input mesh by creating tangents; this + * method will throw if you have supplied tangents with your mesh already. The + * actual triangle resolution is unchanged; use the Refine() method to + * interpolate to a higher-resolution curve. + * + * By default, every edge is calculated for maximum smoothness (very much + * approximately), attempting to minimize the maximum mean Curvature + * magnitude. No higher-order derivatives are considered, as the interpolation + * is independent per triangle, only sharing constraints on their boundaries. + * + * @param mesh input Mesh. + * @param sharpenedEdges If desired, you can supply a vector of sharpened + * halfedges, which should in general be a small subset of all halfedges. + * Order of entries doesn't matter, as each one specifies the desired + * smoothness (between zero and one, with one the default for all unspecified + * halfedges) and the halfedge index (3 * triangle index + [0,1,2] where 0 is + * the edge between triVert 0 and 1, etc). + * + * At a smoothness value of zero, a sharp crease is made. The smoothness is + * interpolated along each edge, so the specified value should be thought of + * as an average. Where exactly two sharpened edges meet at a vertex, their + * tangents are rotated to be colinear so that the sharpened edge can be + * continuous. Vertices with only one sharpened edge are completely smooth, + * allowing sharpened edges to smoothly vanish at termination. A single vertex + * can be sharpened by sharping all edges that are incident on it, allowing + * cones to be formed. + */ + static smooth(mesh: Mesh, sharpenedEdges?: Smoothness[]): Manifold; + + // Signed Distance Functions + + /** + * Constructs a level-set Mesh from the input Signed-Distance Function (SDF). + * This uses a form of Marching Tetrahedra (akin to Marching Cubes, but better + * for manifoldness). Instead of using a cubic grid, it uses a body-centered + * cubic grid (two shifted cubic grids). This means if your function's + * interior exceeds the given bounds, you will see a kind of egg-crate shape + * closing off the manifold, which is due to the underlying grid. + * + * @param sdf The signed-distance function which returns the signed distance + * of + * a given point in R^3. Positive values are inside, negative outside. + * @param bounds An axis-aligned box that defines the extent of the grid. + * @param edgeLength Approximate maximum edge length of the triangles in the + * final result. This affects grid spacing, and hence has a strong effect on + * performance. + * @param level You can inset your Mesh by using a positive value, or outset + * it with a negative value. + * @param precision Ensure each vertex is within this distance of the true + * surface. Defaults to -1, which will return the interpolated + * crossing-point based on the two nearest grid points. Small positive values + * will require more sdf evaluations per output vertex. + */ + static levelSet( + sdf: (point: Vec3) => number, bounds: Box, edgeLength: number, + level?: number, precision?: number): Manifold; + + // Transformations + + /** + * Transform this Manifold in space. Stored in column-major order. This + * operation can be chained. Transforms are combined and applied lazily. + * + * @param m The affine transformation matrix to apply to all the vertices. The + * last row is ignored. + */ + transform(m: Mat4): Manifold; + + /** + * Move this Manifold in space. This operation can be chained. Transforms are + * combined and applied lazily. + * + * @param v The vector to add to every vertex. + */ + translate(v: Vec3): Manifold; + translate(x: number, y?: number, z?: number): Manifold; + + /** + * Applies an Euler angle rotation to the manifold, first about the X axis, + * then Y, then Z, in degrees. We use degrees so that we can minimize rounding + * error, and eliminate it completely for any multiples of 90 degrees. + * Additionally, more efficient code paths are used to update the manifold + * when the transforms only rotate by multiples of 90 degrees. This operation + * can be chained. Transforms are combined and applied lazily. + * + * @param v [X, Y, Z] rotation in degrees. + */ + rotate(v: Vec3): Manifold; + rotate(x: number, y?: number, z?: number): Manifold; + + /** + * Scale this Manifold in space. This operation can be chained. Transforms are + * combined and applied lazily. + * + * @param v The vector to multiply every vertex by per component. + */ + scale(v: Vec3|number): Manifold; + + /** + * Mirror this Manifold over the plane described by the unit form of the given + * normal vector. If the length of the normal is zero, an empty Manifold is + * returned. This operation can be chained. Transforms are combined and + * applied lazily. + * + * @param normal The normal vector of the plane to be mirrored over + */ + mirror(normal: Vec3): Manifold; + + /** + * This function does not change the topology, but allows the vertices to be + * moved according to any arbitrary input function. It is easy to create a + * function that warps a geometrically valid object into one which overlaps, + * but that is not checked here, so it is up to the user to choose their + * function with discretion. + * + * @param warpFunc A function that modifies a given vertex position. + */ + warp(warpFunc: (vert: Vec3) => void): Manifold; + + /** + * Smooths out the Manifold by filling in the halfedgeTangent vectors. The + * geometry will remain unchanged until Refine or RefineToLength is called to + * interpolate the surface. This version uses the supplied vertex normal + * properties to define the tangent vectors. + * + * @param normalIdx The first property channel of the normals. NumProp must be + * at least normalIdx + 3. Any vertex where multiple normals exist and don't + * agree will result in a sharp edge. + */ + smoothByNormals(normalIdx: number): Manifold; + + /** + * Smooths out the Manifold by filling in the halfedgeTangent vectors. The + * geometry will remain unchanged until Refine or RefineToLength is called to + * interpolate the surface. This version uses the geometry of the triangles + * and pseudo-normals to define the tangent vectors. + * + * @param minSharpAngle degrees, default 60. Any edges with angles greater + * than this value will remain sharp. The rest will be smoothed to G1 + * continuity, with the caveat that flat faces of three or more triangles will + * always remain flat. With a value of zero, the model is faceted, but in this + * case there is no point in smoothing. + * + * @param minSmoothness range: 0 - 1, default 0. The smoothness applied to + * sharp angles. The default gives a hard edge, while values > 0 will give a + * small fillet on these sharp edges. A value of 1 is equivalent to a + * minSharpAngle of 180 - all edges will be smooth. + */ + smoothOut(minSharpAngle?: number, minSmoothness?: number): Manifold; + + /** + * Increase the density of the mesh by splitting every edge into n pieces. For + * instance, with n = 2, each triangle will be split into 4 triangles. These + * will all be coplanar (and will not be immediately collapsed) unless the + * Mesh/Manifold has halfedgeTangents specified (e.g. from the Smooth() + * constructor), in which case the new vertices will be moved to the + * interpolated surface according to their barycentric coordinates. + * + * @param n The number of pieces to split every edge into. Must be > 1. + */ + refine(n: number): Manifold; + + /** + * Increase the density of the mesh by splitting each edge into pieces of + * roughly the input length. Interior verts are added to keep the rest of the + * triangulation edges also of roughly the same length. If halfedgeTangents + * are present (e.g. from the Smooth() constructor), the new vertices will be + * moved to the interpolated surface according to their barycentric + * coordinates. + * + * @param length The length that edges will be broken down to. + */ + refineToLength(length: number): Manifold; + + /** + * Create a new copy of this manifold with updated vertex properties by + * supplying a function that takes the existing position and properties as + * input. You may specify any number of output properties, allowing creation + * and removal of channels. Note: undefined behavior will result if you read + * past the number of input properties or write past the number of output + * properties. + * + * @param numProp The new number of properties per vertex. + * @param propFunc A function that modifies the properties of a given vertex. + */ + setProperties( + numProp: number, + propFunc: (newProp: number[], position: Vec3, oldProp: number[]) => void): + Manifold; + + /** + * Curvature is the inverse of the radius of curvature, and signed such that + * positive is convex and negative is concave. There are two orthogonal + * principal curvatures at any point on a manifold, with one maximum and the + * other minimum. Gaussian curvature is their product, while mean + * curvature is their sum. This approximates them for every vertex and assigns + * them as vertex properties on the given channels. + * + * @param gaussianIdx The property channel index in which to store the + * Gaussian curvature. An index < 0 will be ignored (stores nothing). The + * property set will be automatically expanded to include the channel + * index specified. + * @param meanIdx The property channel index in which to store the mean + * curvature. An index < 0 will be ignored (stores nothing). The property + * set will be automatically expanded to include the channel index + * specified. + */ + calculateCurvature(gaussianIdx: number, meanIdx: number): Manifold; + + /** + * Fills in vertex properties for normal vectors, calculated from the mesh + * geometry. Flat faces composed of three or more triangles will remain flat. + * + * @param normalIdx The property channel in which to store the X + * values of the normals. The X, Y, and Z channels will be sequential. The + * property set will be automatically expanded to include up through normalIdx + * + 2. + * + * @param minSharpAngle Any edges with angles greater than this value will + * remain sharp, getting different normal vector properties on each side of + * the edge. By default, no edges are sharp and all normals are shared. With a + * value of zero, the model is faceted and all normals match their triangle + * normals, but in this case it would be better not to calculate normals at + * all. + */ + calculateNormals(normalIdx: number, minSharpAngle: number): Manifold; + + // Boolean Operations + + /** + * Boolean union + */ + add(other: Manifold): Manifold; + + /** + * Boolean difference + */ + subtract(other: Manifold): Manifold; + + /** + * Boolean intersection + */ + intersect(other: Manifold): Manifold; + + /** + * Boolean union of the manifolds a and b + */ + static union(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean difference of the manifold b from the manifold a + */ + static difference(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean intersection of the manifolds a and b + */ + static intersection(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean union of a list of manifolds + */ + static union(manifolds: Manifold[]): Manifold; + + /** + * Boolean difference of the tail of a list of manifolds from its head + */ + static difference(manifolds: Manifold[]): Manifold; + + /** + * Boolean intersection of a list of manifolds + */ + static intersection(manifolds: Manifold[]): Manifold; + + /** + * Split cuts this manifold in two using the cutter manifold. The first result + * is the intersection, second is the difference. This is more efficient than + * doing them separately. + * + * @param cutter + */ + split(cutter: Manifold): Manifold[]; + + /** + * Convenient version of Split() for a half-space. + * + * @param normal This vector is normal to the cutting plane and its length + * does + * not matter. The first result is in the direction of this vector, the second + * result is on the opposite side. + * @param originOffset The distance of the plane from the origin in the + * direction of the normal vector. + */ + splitByPlane(normal: Vec3, originOffset: number): Manifold[]; + + /** + * Removes everything behind the given half-space plane. + * + * @param normal This vector is normal to the cutting plane and its length + * does not matter. The result is in the direction of this vector from the + * plane. + * @param originOffset The distance of the plane from the origin in the + * direction of the normal vector. + */ + trimByPlane(normal: Vec3, originOffset: number): Manifold; + + /** + * Returns the cross section of this object parallel to the X-Y plane at the + * specified height. Using a height equal to the bottom + * of the bounding box will return the bottom faces, while using a height + * equal to the top of the bounding box will return empty. + * + * @param height Z-level of slice. + */ + slice(height: number): CrossSection; + + /** + * Returns a cross section representing the projected outline of this object + * onto the X-Y plane. + */ + project(): CrossSection; + + // Convex Hulls + + /** + * Compute the convex hull of all points in this Manifold. + */ + hull(): Manifold; + + /** + * Compute the convex hull of all points contained within a set of Manifolds + * and point vectors. + */ + static hull(points: (Manifold|Vec3)[]): Manifold; + + // Topological Operations + + /** + * Constructs a new manifold from a list of other manifolds. This is a purely + * topological operation, so care should be taken to avoid creating + * overlapping results. It is the inverse operation of Decompose(). + * + * @param manifolds A list of Manifolds to lazy-union together. + */ + static compose(manifolds: Manifold[]): Manifold; + + /** + * This operation returns a vector of Manifolds that are topologically + * disconnected. If everything is connected, the vector is length one, + * containing a copy of the original. It is the inverse operation of + * Compose(). + */ + decompose(): Manifold[]; + + // Property Access + + /** + * Does the Manifold have any triangles? + */ + isEmpty(): boolean; + + /** + * The number of vertices in the Manifold. + */ + numVert(): number; + + /** + * The number of triangles in the Manifold. + */ + numTri(): number; + + /** + * The number of edges in the Manifold. + */ + numEdge(): number; + + /** + * The number of properties per vertex in the Manifold. + */ + numProp(): number; + + /** + * The number of property vertices in the Manifold. This will always be >= + * numVert, as some physical vertices may be duplicated to account for + * different properties on different neighboring triangles. + */ + numPropVert(): number + + /** + * Returns the axis-aligned bounding box of all the Manifold's vertices. + */ + boundingBox(): Box; + + /** + * Returns the precision of this Manifold's vertices, which tracks the + * approximate rounding error over all the transforms and operations that have + * led to this state. Any triangles that are colinear within this precision + * are considered degenerate and removed. This is the value of ε + * defining + * [ε-valid](https://github.com/elalish/manifold/wiki/Manifold-Library#definition-of-%CE%B5-valid). + */ + precision(): number; + + /** + * The genus is a topological property of the manifold, representing the + * number of "handles". A sphere is 0, torus 1, etc. It is only meaningful for + * a single mesh, so it is best to call Decompose() first. + */ + genus(): number; + + /** + * Returns the surface area and volume of the manifold. These properties are + * clamped to zero for a given face if they are within the Precision(). This + * means degenerate manifolds can by identified by testing these properties as + * == 0. + */ + getProperties(): Properties; + + + /** + * Returns the minimum gap between two manifolds. Returns a float between + * 0 and searchLength. + */ + minGap(other: Manifold, searchLength: number): number; + + // Export + + /** + * Returns a Mesh that is designed to easily push into a renderer, including + * all interleaved vertex properties that may have been input. It also + * includes relations to all the input meshes that form a part of this result + * and the transforms applied to each. + * + * @param normalIdx If the original Mesh inputs that formed this manifold had + * properties corresponding to normal vectors, you can specify which property + * channels these are (x, y, z), which will cause this output Mesh to + * automatically update these normals according to the applied transforms and + * front/back side. Each channel must be >= 3 and < numProp, and all original + * Meshes must use the same channels for their normals. + */ + getMesh(normalIdx?: Vec3): Mesh; + + // ID Management + + /** + * If you copy a manifold, but you want this new copy to have new properties + * (e.g. a different UV mapping), you can reset its IDs to a new original, + * meaning it will now be referenced by its descendants instead of the meshes + * it was built from, allowing you to differentiate the copies when applying + * your properties to the final result. + * + * This function also condenses all coplanar faces in the relation, and + * collapses those edges. If you want to have inconsistent properties across + * these faces, meaning you want to preserve some of these edges, you should + * instead call GetMesh(), calculate your properties and use these to + * construct a new manifold. + */ + asOriginal(): Manifold; + + /** + * If this mesh is an original, this returns its ID that can be referenced + * by product manifolds. If this manifold is a product, this + * returns -1. + */ + originalID(): number; + + /** + * Returns the first of n sequential new unique mesh IDs for marking sets of + * triangles that can be looked up after further operations. Assign to + * Mesh.runOriginalID vector. + */ + static reserveIDs(count: number): number; + + // Memory + + /** + * Frees the WASM memory of this Manifold, since these cannot be + * garbage-collected automatically. + */ + delete(): void; +} + +export interface MeshOptions { + numProp: number; + vertProperties: Float32Array; + triVerts: Uint32Array; + mergeFromVert?: Uint32Array; + mergeToVert?: Uint32Array; + runIndex?: Uint32Array; + runOriginalID?: Uint32Array; + runTransform?: Float32Array; + faceID?: Uint32Array; + halfedgeTangent?: Float32Array; +} + +/** + * An alternative to Mesh for output suitable for pushing into graphics + * libraries directly. This may not be manifold since the verts are duplicated + * along property boundaries that do not match. The additional merge vectors + * store this missing information, allowing the manifold to be reconstructed. + */ +export class Mesh { + constructor(options: MeshOptions); + + /** + * Number of properties per vertex, always >= 3. + */ + numProp: number; + + /** + * Flat, GL-style interleaved list of all vertex properties: propVal = + * vertProperties[vert * numProp + propIdx]. The first three properties are + * always the position x, y, z. + */ + vertProperties: Float32Array; + + /** + * The vertex indices of the three triangle corners in CCW (from the outside) + * order, for each triangle. + */ + triVerts: Uint32Array; + + /** + * Optional: A list of only the vertex indicies that need to be merged to + * reconstruct the manifold. + */ + mergeFromVert: Uint32Array; + + /** + * Optional: The same length as mergeFromVert, and the corresponding value + * contains the vertex to merge with. It will have an identical position, but + * the other properties may differ. + */ + mergeToVert: Uint32Array; + + /** + * Optional: Indicates runs of triangles that correspond to a particular + * input mesh instance. The runs encompass all of triVerts and are sorted + * by runOriginalID. Run i begins at triVerts[runIndex[i]] and ends at + * triVerts[runIndex[i+1]]. All runIndex values are divisible by 3. Returned + * runIndex will always be 1 longer than runOriginalID, but same length is + * also allowed as input: triVerts.size() will be automatically appended in + * this case. + */ + runIndex: Uint32Array; + + /** + * Optional: The OriginalID of the mesh this triangle run came from. This ID + * is ideal for reapplying materials to the output mesh. Multiple runs may + * have the same ID, e.g. representing different copies of the same input + * mesh. If you create an input MeshGL that you want to be able to reference + * as one or more originals, be sure to set unique values from ReserveIDs(). + */ + runOriginalID: Uint32Array; + + /** + * Optional: For each run, a 3x4 transform is stored representing how the + * corresponding original mesh was transformed to create this triangle run. + * This matrix is stored in column-major order and the length of the overall + * vector is 12 * runOriginalID.size(). + */ + runTransform: Float32Array; + + /** + * Optional: Length NumTri, contains an ID of the source face this triangle + * comes from. When auto-generated, this ID will be a triangle index into the + * original mesh. All neighboring coplanar triangles from that input mesh + * will refer to a single triangle of that group as the faceID. When + * supplying faceIDs, ensure that triangles with the same ID are in fact + * coplanar and have consistent properties (within some tolerance) or the + * output will be surprising. + */ + faceID: Uint32Array; + + /** + * Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If + * non-empty, must be exactly four times as long as Mesh.triVerts. Indexed + * as 4 * (3 * tri + i) + j, i < 3, j < 4, representing the tangent value + * Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted. + */ + halfedgeTangent: Float32Array; + + /** + * Number of triangles + */ + get numTri(): number; + + /** + * Number of property vertices + */ + get numVert(): number; + + /** + * Number of triangle runs. Each triangle run is a set of consecutive + * triangles that all come from the same instance of the same input mesh. + */ + get numRun(): number; + + /** + * Updates the mergeFromVert and mergeToVert vectors in order to create a + * manifold solid. If the MeshGL is already manifold, no change will occur and + * the function will return false. Otherwise, this will merge verts along open + * edges within precision (the maximum of the MeshGL precision and the + * baseline bounding-box precision), keeping any from the existing merge + * vectors. + * + * There is no guarantee the result will be manifold - this is a best-effort + * helper function designed primarily to aid in the case where a manifold + * multi-material MeshGL was produced, but its merge vectors were lost due to + * a round-trip through a file format. Constructing a Manifold from the result + * will report a Status if it is not manifold. + */ + merge(): boolean; + + /** + * Gets the three vertex indices of this triangle in CCW order. + * + * @param tri triangle index. + */ + verts(tri: number): SealedUint32Array<3>; + + /** + * Gets the x, y, z position of this vertex. + * + * @param vert vertex index. + */ + position(vert: number): SealedFloat32Array<3>; + + /** + * Gets any other properties associated with this vertex. + * + * @param vert vertex index. + */ + extras(vert: number): Float32Array; + + /** + * Gets the tangent vector starting at verts(tri)[j] pointing to the next + * Bezier point along the CCW edge. The fourth value is its weight. + * + * @param halfedge halfedge index: 3 * tri + j, where j is 0, 1, or 2. + */ + tangent(halfedge: number): SealedFloat32Array<4>; + + /** + * Gets the column-major 4x4 matrix transform from the original mesh to these + * related triangles. + * + * @param run triangle run index. + */ + transform(run: number): Mat4; +} diff --git a/manifold-global-types.d.ts b/manifold-global-types.d.ts new file mode 100644 index 000000000..bca938746 --- /dev/null +++ b/manifold-global-types.d.ts @@ -0,0 +1,75 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export interface SealedUint32Array extends Uint32Array { + length: N; +} + +export interface SealedFloat32Array extends Float32Array { + length: N; +} + +export type Vec2 = [number, number]; +export type Vec3 = [number, number, number]; +// 3x3 matrix stored in column-major order +export type Mat3 = [ + number, + number, + number, + number, + number, + number, + number, + number, + number, +]; +// 4x4 matrix stored in column-major order +export type Mat4 = [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, +]; +export type SimplePolygon = Vec2[]; +export type Polygons = SimplePolygon|SimplePolygon[]; +export type Rect = { + min: Vec2, + max: Vec2 +}; +export type Box = { + min: Vec3, + max: Vec3 +}; +export type Smoothness = { + halfedge: number, + smoothness: number +}; +export type Properties = { + surfaceArea: number, + volume: number +}; +export type FillRule = 'EvenOdd'|'NonZero'|'Positive'|'Negative' +export type JoinType = 'Square'|'Round'|'Miter' diff --git a/manifold.d.ts b/manifold.d.ts new file mode 100644 index 000000000..22ddc7314 --- /dev/null +++ b/manifold.d.ts @@ -0,0 +1,36 @@ +// Copyright 2022 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as T from './manifold-encapsulated-types'; +export * from './manifold-global-types'; + +export type CrossSection = T.CrossSection; +export type Manifold = T.Manifold; +export type Mesh = T.Mesh; + +export interface ManifoldToplevel { + CrossSection: typeof T.CrossSection; + Manifold: typeof T.Manifold; + Mesh: typeof T.Mesh; + triangulate: typeof T.triangulate; + setMinCircularAngle: typeof T.setMinCircularAngle; + setMinCircularEdgeLength: typeof T.setMinCircularEdgeLength; + setCircularSegments: typeof T.setCircularSegments; + getCircularSegments: typeof T.getCircularSegments; + resetToCircularDefaults: typeof T.resetToCircularDefaults; + setup: () => void; +} + +export default function Module(config?: {locateFile: () => string}): + Promise; diff --git a/manifold.js b/manifold.js new file mode 100644 index 000000000..b8f373c8a --- /dev/null +++ b/manifold.js @@ -0,0 +1,16 @@ + +var Module = (() => { + var _scriptName = import.meta.url; + + return ( +async function(moduleArg = {}) { + var moduleRtn; + +var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){const{createRequire:createRequire}=await import("module");var require=createRequire(import.meta.url)}var _ManifoldInitialized=false;Module.setup=function(){if(_ManifoldInitialized)return;_ManifoldInitialized=true;function toVec(vec,list,f=(x=>x)){if(list){for(let x of list){vec.push_back(f(x))}}return vec}function fromVec(vec,f=(x=>x)){const result=[];const size=vec.size();for(let i=0;ix)){const result=[];const nPoly=vec.size();for(let i=0;itoVec(new Module.Vector_vec2,poly,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p}))}function disposePolygons(polygonsVec){for(let i=0;iresult.min[f]),max:["x","y"].map(f=>result.max[f])}};Module.CrossSection.prototype.offset=function(delta,joinType="Square",miterLimit=2,circularSegments=0){return this._Offset(delta,joinTypeToInt(joinType),miterLimit,circularSegments)};Module.CrossSection.prototype.extrude=function(height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){scaleTop=vararg2vec2([scaleTop]);const man=Module._Extrude(this._ToPolygons(),height,nDivisions,twistDegrees,scaleTop);return center?man.translate([0,0,-height/2]):man};Module.CrossSection.prototype.revolve=function(circularSegments=0,revolveDegrees=360){return Module._Revolve(this._ToPolygons(),circularSegments,revolveDegrees)};Module.CrossSection.prototype.add=function(other){return this._add(cross(other))};Module.CrossSection.prototype.subtract=function(other){return this._subtract(cross(other))};Module.CrossSection.prototype.intersect=function(other){return this._intersect(cross(other))};Module.CrossSection.prototype.toPolygons=function(){const vec=this._ToPolygons();const result=vec2polygons(vec);vec.delete();return result};Module.Manifold.prototype.smoothOut=function(minSharpAngle=60,minSmoothness=0){return this._SmoothOut(minSharpAngle,minSmoothness)};Module.Manifold.prototype.warp=function(func){const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"double");const y=getValue(vec3Ptr+8,"double");const z=getValue(vec3Ptr+16,"double");const vert=[x,y,z];func(vert);setValue(vec3Ptr,vert[0],"double");setValue(vec3Ptr+8,vert[1],"double");setValue(vec3Ptr+16,vert[2],"double")},"vi");const out=this._Warp(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return out};Module.Manifold.prototype.calculateNormals=function(normalIdx,minSharpAngle=60){return this._CalculateNormals(normalIdx,minSharpAngle)};Module.Manifold.prototype.setProperties=function(numProp,func){const oldNumProp=this.numProp();const wasmFuncPtr=addFunction(function(newPtr,vec3Ptr,oldPtr){const newProp=[];for(let i=0;iresult.min[f]),max:["x","y","z"].map(f=>result.max[f])}};class Mesh{constructor({numProp:numProp=3,triVerts:triVerts=new Uint32Array,vertProperties:vertProperties=new Float32Array,mergeFromVert:mergeFromVert,mergeToVert:mergeToVert,runIndex:runIndex,runOriginalID:runOriginalID,faceID:faceID,halfedgeTangent:halfedgeTangent,runTransform:runTransform}={}){this.numProp=numProp;this.triVerts=triVerts;this.vertProperties=vertProperties;this.mergeFromVert=mergeFromVert;this.mergeToVert=mergeToVert;this.runIndex=runIndex;this.runOriginalID=runOriginalID;this.faceID=faceID;this.halfedgeTangent=halfedgeTangent;this.runTransform=runTransform}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:changed,mesh:mesh}=Module._Merge(this);Object.assign(this,{...mesh});return changed}verts(tri){return this.triVerts.subarray(3*tri,3*(tri+1))}position(vert){return this.vertProperties.subarray(this.numProp*vert,this.numProp*vert+3)}extras(vert){return this.vertProperties.subarray(this.numProp*vert+3,this.numProp*(vert+1))}tangent(halfedge){return this.halfedgeTangent.subarray(4*halfedge,4*(halfedge+1))}transform(run){const mat4=new Array(16);for(const col of[0,1,2,3]){for(const row of[0,1,2]){mat4[4*col+row]=this.runTransform[12*run+3*col+row]}}mat4[15]=1;return mat4}}Module.Mesh=Mesh;Module.Manifold.prototype.getMesh=function(normalIdx=[0,0,0]){if(normalIdx instanceof Array)normalIdx={0:normalIdx[0],1:normalIdx[1],2:normalIdx[2]};return new Mesh(this._GetMeshJS(normalIdx))};Module.ManifoldError=function ManifoldError(code,...args){let message="Unknown error";switch(code){case Module.status.NonFiniteVertex.value:message="Non-finite vertex";break;case Module.status.NotManifold.value:message="Not manifold";break;case Module.status.VertexOutOfBounds.value:message="Vertex index out of bounds";break;case Module.status.PropertiesWrongLength.value:message="Properties have wrong length";break;case Module.status.MissingPositionProperties.value:message="Less than three properties";break;case Module.status.MergeVectorsDifferentLengths.value:message="Merge vectors have different lengths";break;case Module.status.MergeIndexOutOfBounds.value:message="Merge index out of bounds";break;case Module.status.TransformWrongLength.value:message="Transform vector has wrong length";break;case Module.status.RunIndexWrongLength.value:message="Run index vector has wrong length";break;case Module.status.FaceIDWrongLength.value:message="Face ID vector has wrong length";case Module.status.InvalidConstruction.value:message="Manifold constructed with invalid parameters"}const base=Error.apply(this,[message,...args]);base.name=this.name="ManifoldError";this.message=base.message;this.stack=base.stack;this.code=code};Module.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:Module.ManifoldError,writable:true,configurable:true}});Module.CrossSection=function(polygons,fillRule="Positive"){const polygonsVec=polygons2vec(polygons);const cs=new CrossSectionCtor(polygonsVec,fillRuleToInt(fillRule));disposePolygons(polygonsVec);return cs};Module.CrossSection.ofPolygons=function(polygons,fillRule="Positive"){return new Module.CrossSection(polygons,fillRule)};Module.CrossSection.square=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1};else if(typeof args[0]=="number")size={x:args[0],y:args[0]};else size=vararg2vec2(args);const center=args[1]||false;return Module._Square(size,center)};Module.CrossSection.circle=function(radius,circularSegments=0){return Module._Circle(radius,circularSegments)};function crossSectionBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_crossSection;for(const cs of args)v.push_back(cross(cs));const result=Module["_crossSection"+name](v);v.delete();return result}}Module.CrossSection.compose=crossSectionBatchbool("Compose");Module.CrossSection.union=crossSectionBatchbool("UnionN");Module.CrossSection.difference=crossSectionBatchbool("DifferenceN");Module.CrossSection.intersection=crossSectionBatchbool("IntersectionN");function pushVec2(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p})}Module.CrossSection.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec2;for(const cs of args){if(cs instanceof CrossSectionCtor){Module._crossSectionCollectVertices(pts,cs)}else if(cs instanceof Array&&cs.length==2&&typeof cs[0]=="number"){pts.push_back({x:cs[0],y:cs[1]})}else if(cs.x){pts.push_back(cs)}else{const wrap=cs[0].length==2&&typeof cs[0][0]=="number"||cs[0].x;const polys=wrap?[cs]:cs;for(const poly of polys)pushVec2(pts,poly)}}const result=Module._crossSectionHullPoints(pts);pts.delete();return result};Module.CrossSection.prototype=Object.create(CrossSectionCtor.prototype);Object.defineProperty(Module.CrossSection,Symbol.hasInstance,{get:()=>t=>t instanceof CrossSectionCtor});const ManifoldCtor=Module.Manifold;Module.Manifold=function(mesh){const manifold=new ManifoldCtor(mesh);const status=manifold.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return manifold};Module.Manifold.ofMesh=function(mesh){return new Module.Manifold(mesh)};Module.Manifold.tetrahedron=function(){return Module._Tetrahedron()};Module.Manifold.cube=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1,z:1};else if(typeof args[0]=="number")size={x:args[0],y:args[0],z:args[0]};else size=vararg2vec3(args);const center=args[1]||false;return Module._Cube(size,center)};Module.Manifold.cylinder=function(height,radiusLow,radiusHigh=-1,circularSegments=0,center=false){return Module._Cylinder(height,radiusLow,radiusHigh,circularSegments,center)};Module.Manifold.sphere=function(radius,circularSegments=0){return Module._Sphere(radius,circularSegments)};Module.Manifold.smooth=function(mesh,sharpenedEdges=[]){const sharp=new Module.Vector_smoothness;toVec(sharp,sharpenedEdges);const result=Module._Smooth(mesh,sharp);sharp.delete();return result};Module.Manifold.extrude=function(polygons,height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.extrude(height,nDivisions,twistDegrees,scaleTop,center)};Module.Manifold.revolve=function(polygons,circularSegments=0,revolveDegrees=360){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.revolve(circularSegments,revolveDegrees)};Module.Manifold.reserveIDs=function(n){return Module._ReserveIDs(n)};Module.Manifold.compose=function(manifolds){const vec=new Module.Vector_manifold;toVec(vec,manifolds);const result=Module._manifoldCompose(vec);vec.delete();return result};function manifoldBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_manifold;for(const m of args)v.push_back(m);const result=Module["_manifold"+name+"N"](v);v.delete();return result}}Module.Manifold.union=manifoldBatchbool("Union");Module.Manifold.difference=manifoldBatchbool("Difference");Module.Manifold.intersection=manifoldBatchbool("Intersection");Module.Manifold.levelSet=function(sdf,bounds,edgeLength,level=0,precision=-1){const bounds2={min:{x:bounds.min[0],y:bounds.min[1],z:bounds.min[2]},max:{x:bounds.max[0],y:bounds.max[1],z:bounds.max[2]}};const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"double");const y=getValue(vec3Ptr+8,"double");const z=getValue(vec3Ptr+16,"double");const vert=[x,y,z];return sdf(vert)},"di");const out=Module._LevelSet(wasmFuncPtr,bounds2,edgeLength,level,precision);removeFunction(wasmFuncPtr);return out};function pushVec3(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1],z:p[2]};return p})}Module.Manifold.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec3;for(const m of args){if(m instanceof ManifoldCtor){Module._manifoldCollectVertices(pts,m)}else if(m instanceof Array&&m.length==3&&typeof m[0]=="number"){pts.push_back({x:m[0],y:m[1],z:m[2]})}else if(m.x){pts.push_back(m)}else{pushVec3(pts,m)}}const result=Module._manifoldHullPoints(pts);pts.delete();return result};Module.Manifold.prototype=Object.create(ManifoldCtor.prototype);Object.defineProperty(Module.Manifold,Symbol.hasInstance,{get:()=>t=>t instanceof ManifoldCtor});Module.triangulate=function(polygons,precision=-1){const polygonsVec=polygons2vec(polygons);const result=fromVec(Module._Triangulate(polygonsVec,precision),x=>[x[0],x[1],x[2]]);disposePolygons(polygonsVec);return result}};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");scriptDirectory=require("url").fileURLToPath(new URL("./",import.meta.url));read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith("blob:")){scriptDirectory=""}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{if(isFileURI(url)){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null);return}fetch(url,{credentials:"same-origin"}).then(response=>{if(response.ok){return response.arrayBuffer()}return Promise.reject(new Error(response.status+" : "+response.url))}).then(onload,onerror)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var wasmMemory;var ABORT=false;var EXITSTATUS;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");function findWasmBinary(){if(Module["locateFile"]){var f="manifold.wasm";if(!isDataURI(f)){return locateFile(f)}return f}return new URL("manifold.wasm",import.meta.url).href}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),error=>{try{resolve(getBinarySync(binaryFile))}catch(e){reject(e)}})})}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function getWasmImports(){return{a:wasmImports}}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["xa"];updateMemoryViews();wasmTable=wasmExports["Aa"];addOnInit(wasmExports["ya"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw exceptionLast};var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var __abort_js=()=>{abort("")};var structRegistrations={};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function readPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError;var throwInternalError=message=>{throw new InternalError(message)};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_finalize_value_object=structType=>{var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>getterReturnType["fromWireType"](getter(getterContext,ptr)),write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,fromWireType:ptr=>{var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},toWireType:(destructors,o)=>{for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError(`Missing field: "${fieldName}"`)}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:rawDestructor}]})};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{};var embind_init_charCodes=()=>{var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes};var embind_charCodes;var readLatin1String=ptr=>{var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret};var BindingError;var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type "${name}" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}return sharedRegisterType(rawType,registeredInstance,options)}var GenericWireTypeSize=8;var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(pointer){return this["fromWireType"](HEAPU8[pointer])},destructorFunction:null})};var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredPointers={};var getInheritedInstanceCount=()=>Object.keys(registeredInstances).length;var getLiveInheritedInstances=()=>{var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}};var delayFunction;var setDelayFunction=fn=>{delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}};var init_embind=()=>{Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var attachFinalizer=handle=>{if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}})};function ClassHandle(){}var createNamedFunction=(name,body)=>Object.defineProperty(body,"name",{value:name});var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle["delete"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistent public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var dynCallLegacy=(sig,ptr,args)=>{sig=sig.replace(/p/g,"i");var f=Module["dynCall_"+sig];return f(ptr,...args)};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args=[])=>{if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr)(...args);return rtn};var getDynCaller=(sig,ptr)=>(...args)=>dynCall(sig,ptr,args);var embind__requireFunction=(signature,rawFunction)=>{signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};var extendError=(baseErrorType,errorName)=>{var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return`${this.name}: ${this.message}`}};return errorClass};var UnboundTypeError;var getTypeName=type=>{var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i>2])}return array};function usesDestructorStack(argTypes){for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns||isAsync?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf("(");if(argsIndex!==-1){return signature.substr(0,argsIndex)}else{return signature}};var __embind_register_class_function=(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);methodName=getFunctionName(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};var emval_freelist=[];var emval_handles=[];var __emval_decref=handle=>{if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}};var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length;var init_emval=()=>{emval_handles.push(0,1,undefined,1,null,1,true,1,false,1);Module["count_emval_handles"]=count_emval_handles};var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:"emscripten::val",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};var __embind_register_emval=rawType=>registerType(rawType,EmValType);var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this["fromWireType"](HEAP8[pointer])}:function(pointer){return this["fromWireType"](HEAPU8[pointer])};case 2:return signed?function(pointer){return this["fromWireType"](HEAP16[pointer>>1])}:function(pointer){return this["fromWireType"](HEAPU16[pointer>>1])};case 4:return signed?function(pointer){return this["fromWireType"](HEAP32[pointer>>2])}:function(pointer){return this["fromWireType"](HEAPU32[pointer>>2])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_enum=(rawType,name,size,isSigned)=>{name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,fromWireType:function(c){return this.constructor.values[c]},toWireType:(destructors,c)=>c.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};var __embind_register_enum_value=(rawEnumType,name,enumValue)=>{var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value};var embindRepr=v=>{if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}};var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 8:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:value=>value,toWireType:(destructors,value)=>value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,fromWireType:fromWireType,toWireType:toWireType,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,fromWireType:decodeMemoryView,argPackAdvance:GenericWireTypeSize,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})};var __embind_register_optional=(rawOptionalType,rawType)=>{__embind_register_emval(rawOptionalType)};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var __embind_register_std_string=(rawType,name)=>{name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,fromWireType(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i{var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead)=>{var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=readLatin1String(name);var decodeString,encodeString,readCharAt,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;readCharAt=pointer=>HEAPU16[pointer>>1]}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;readCharAt=pointer=>HEAPU32[pointer>>2]}registerType(rawType,{name:name,fromWireType:value=>{var length=HEAPU32[value>>2];var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||readCharAt(currentBytePtr)==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value=="string")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var __embind_register_value_object=(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor)=>{structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}};var __embind_register_value_object_field=(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})};var __embind_register_void=(rawType,name)=>{name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,argPackAdvance:0,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var emval_returnValue=(returnType,destructorsRef,handle)=>{var destructors=[];var result=returnType["toWireType"](destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors)}return result};var __emval_as=(handle,returnType,destructorsRef)=>{handle=Emval.toValue(handle);returnType=requireRegisteredType(returnType,"emval::as");return emval_returnValue(returnType,destructorsRef,handle)};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol};var emval_methodCallers=[];var __emval_call_method=(caller,objHandle,methodName,destructorsRef,args)=>{caller=emval_methodCallers[caller];objHandle=Emval.toValue(objHandle);methodName=getStringOrSymbol(methodName);return caller(objHandle,objHandle[methodName],destructorsRef,args)};var __emval_equals=(first,second)=>{first=Emval.toValue(first);second=Emval.toValue(second);return first==second};var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i>2],"parameter "+i)}return a};var reflectConstruct=Reflect.construct;var __emval_get_method_caller=(argCount,argTypes,kind)=>{var types=emval_lookupTypes(argCount,argTypes);var retType=types.shift();argCount--;var functionBody=`return function (obj, func, destructorsRef, args) {\n`;var offset=0;var argsList=[];if(kind===0){argsList.push("obj")}var params=["retType"];var args=[retType];for(var i=0;it.name).join(", ")}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};var __emval_get_property=(handle,key)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>9){emval_handles[handle+1]+=1}};var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_new_object=()=>Emval.toHandle({});var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __emval_set_property=(handle,key,value)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value};var __emval_take_value=(type,arg)=>{type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)};var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _llvm_eh_typeid_for=type=>type;var uleb128Encode=(n,target)=>{if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}};var sigToWasmTypes=sig=>{var typeNames={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i{var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={i:127,p:127,j:126,f:125,d:124,e:111};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i{if(typeof WebAssembly.Function=="function"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push(...typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{e:{f:func}});var wrappedFunc=instance.exports["f"];return wrappedFunc};var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1};var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));setWasmTableEntry(index,null);freeTableIndexes.push(index)};InternalError=Module["InternalError"]=class InternalError extends Error{constructor(message){super(message);this.name="InternalError"}};embind_init_charCodes();BindingError=Module["BindingError"]=class BindingError extends Error{constructor(message){super(message);this.name="BindingError"}};init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var wasmImports={K:___cxa_begin_catch,aa:___cxa_end_catch,a:___cxa_find_matching_catch_2,k:___cxa_find_matching_catch_3,h:___cxa_throw,d:___resumeException,Z:__abort_js,oa:__embind_finalize_value_object,Y:__embind_register_bigint,la:__embind_register_bool,x:__embind_register_class,w:__embind_register_class_constructor,i:__embind_register_class_function,ka:__embind_register_emval,N:__embind_register_enum,t:__embind_register_enum_value,U:__embind_register_float,o:__embind_register_function,z:__embind_register_integer,s:__embind_register_memory_view,A:__embind_register_optional,T:__embind_register_std_string,M:__embind_register_std_wstring,B:__embind_register_value_object,pa:__embind_register_value_object_field,na:__embind_register_void,$:__emscripten_memcpy_js,ta:__emval_as,ia:__emval_call_method,va:__emval_decref,sa:__emval_equals,ma:__emval_get_method_caller,ua:__emval_get_property,ra:__emval_incref,F:__emval_new_cstring,V:__emval_new_object,W:__emval_run_destructors,wa:__emval_set_property,E:__emval_take_value,_:_emscripten_resize_heap,y:invoke_dd,H:invoke_dii,fa:invoke_diid,J:invoke_diii,u:invoke_diiiii,I:invoke_i,e:invoke_ii,b:invoke_iii,m:invoke_iiii,n:invoke_iiiii,D:invoke_iiiiii,X:invoke_iiij,j:invoke_v,f:invoke_vi,ea:invoke_vid,ca:invoke_vidi,g:invoke_vii,r:invoke_viid,ha:invoke_viidd,ga:invoke_viiddd,G:invoke_viiddi,O:invoke_viidi,ja:invoke_viididi,da:invoke_viidiidid,c:invoke_viii,L:invoke_viiid,qa:invoke_viiidddi,l:invoke_viiii,v:invoke_viiiii,S:invoke_viiiiid,p:invoke_viiiiii,Q:invoke_viiiiiii,P:invoke_viiiiiiiii,C:invoke_viiiiiiiiidiii,q:invoke_viiiiiiiiii,R:invoke_viiiiiiiiiiiiiiiiii,ba:_llvm_eh_typeid_for};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["ya"])();var ___getTypeName=a0=>(___getTypeName=wasmExports["za"])(a0);var _free=a0=>(_free=wasmExports["Ba"])(a0);var _malloc=a0=>(_malloc=wasmExports["Ca"])(a0);var _setThrew=(a0,a1)=>(_setThrew=wasmExports["Da"])(a0,a1);var __emscripten_tempret_set=a0=>(__emscripten_tempret_set=wasmExports["Ea"])(a0);var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports["Fa"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports["Ga"])();var ___cxa_decrement_exception_refcount=a0=>(___cxa_decrement_exception_refcount=wasmExports["Ha"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports["Ia"])(a0);var ___cxa_can_catch=(a0,a1,a2)=>(___cxa_can_catch=wasmExports["Ja"])(a0,a1,a2);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports["Ka"])(a0);var dynCall_iiij=Module["dynCall_iiij"]=(a0,a1,a2,a3,a4)=>(dynCall_iiij=Module["dynCall_iiij"]=wasmExports["La"])(a0,a1,a2,a3,a4);function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiidddi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dd(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viididi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiid(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidd(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddd(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diid(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidiidid(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vidi(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["addFunction"]=addFunction;Module["removeFunction"]=removeFunction;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();moduleRtn=readyPromise; + + + return moduleRtn; +} +); +})(); +export default Module; diff --git a/manifold.wasm b/manifold.wasm new file mode 100644 index 000000000..38c5112d6 Binary files /dev/null and b/manifold.wasm differ diff --git a/model-viewer.html b/model-viewer.html new file mode 100644 index 000000000..44c646951 --- /dev/null +++ b/model-viewer.html @@ -0,0 +1,62 @@ + + + + + Manifold - <code></code><model-viewer></code> Example + + + + + + + + + + + +

This example demonstrates reading and writing glTF models using gltf-transform and using this to feed Manifold's + output into <model-viewer>. It also shows how to pass mesh properties + like UV coordinates through Manifold and how to re-associate textures and materials after operations, made simple + using our `gltf-io.ts` library. The resulting glTF includes the EXT_mesh_manifold extension, using our + `manifold-gltf.ts` extension to gltf-transform, which ensures lossless data transfer.

+

Please open dev tools to inspect our source code - everything is source mapped back to our TS files and commented + thoroughly. A more basic three.js example is here.

+ + + + + + + + \ No newline at end of file diff --git a/models/moon.glb b/models/moon.glb new file mode 100644 index 000000000..d8b4ab05f Binary files /dev/null and b/models/moon.glb differ diff --git a/models/space.glb b/models/space.glb new file mode 100644 index 000000000..a0af95f43 Binary files /dev/null and b/models/space.glb differ diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 000000000..ca455831e --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright 2020 The Manifold Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project(samples) + +add_library(samples src/menger_sponge.cpp + src/rounded_frame.cpp src/scallop.cpp src/tet_puzzle.cpp + src/gyroid_module.cpp src/condensed_matter.cpp) +if(MANIFOLD_CROSS_SECTION) + target_sources(samples PUBLIC src/bracelet.cpp src/knot.cpp) +endif() + +target_include_directories(samples + PUBLIC ${PROJECT_SOURCE_DIR}/include +) + +target_link_libraries(samples PUBLIC manifold) +if(MANIFOLD_CROSS_SECTION) + target_link_libraries(${PROJECT_NAME} PUBLIC cross_section) +endif() + +target_compile_options(samples PRIVATE ${MANIFOLD_FLAGS}) +target_compile_features(samples PUBLIC cxx_std_17) diff --git a/samples/include/samples.h b/samples/include/samples.h new file mode 100644 index 000000000..51317a15f --- /dev/null +++ b/samples/include/samples.h @@ -0,0 +1,58 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once +#include "manifold/manifold.h" + +namespace manifold { + +/** @defgroup Samples + * @brief Examples of usage and interesting designs + * + * These are mostly 3D-printable designs I've invented over the years, + * translated from their original OpenSCAD to C++ to demonstrate the usage of + * this library. You can find the originals here: + * http://www.thingiverse.com/emmett These also each have tests you can find in + * test/samples_test.cpp, which have nice parameter choices for making some of + * the specific designs I print. While the source code is under the Apache + * License above, I license all of my designs (the output of those tests if you + * uncomment the export lines) under CC-BY-SA: + * https://creativecommons.org/licenses/by-sa/2.0/, which means you're welcome + * to print and sell them, so long as you attribute the design to Emmett Lalish + * and share any derivative works under the same license. + * @{ + */ + +Manifold TorusKnot(int p, int q, double majorRadius, double minorRadius, + double threadRadius, int circularSegments = 0, + int linearSegments = 0); + +Manifold StretchyBracelet(double radius = 30.0, double height = 8.0, + double width = 15.0, double thickness = 0.4, + int nDecor = 20, int nCut = 27, int nDivision = 30); + +Manifold MengerSponge(int n = 3); + +Manifold RoundedFrame(double edgeLength, double radius, + int circularSegments = 0); + +Manifold TetPuzzle(double edgeLength, double gap, int nDivisions); + +Manifold Scallop(); + +Manifold GyroidModule(double size = 20, int n = 20); + +Manifold CondensedMatter(int fn = 16); +/** @} */ // end of Samples +} // namespace manifold diff --git a/samples/models/apollo.png b/samples/models/apollo.png new file mode 100644 index 000000000..f0161697f Binary files /dev/null and b/samples/models/apollo.png differ diff --git a/samples/models/apollo.webp b/samples/models/apollo.webp new file mode 100644 index 000000000..7c2feba2c Binary files /dev/null and b/samples/models/apollo.webp differ diff --git a/samples/models/apolloPan.webp b/samples/models/apolloPan.webp new file mode 100644 index 000000000..fec5faf37 Binary files /dev/null and b/samples/models/apolloPan.webp differ diff --git a/samples/models/apollo_exterior-150k-4096.glb b/samples/models/apollo_exterior-150k-4096.glb new file mode 100644 index 000000000..f5239ee82 Binary files /dev/null and b/samples/models/apollo_exterior-150k-4096.glb differ diff --git a/samples/models/favicon.png b/samples/models/favicon.png new file mode 100644 index 000000000..ad3b1d4b4 Binary files /dev/null and b/samples/models/favicon.png differ diff --git a/samples/models/mengerSponge3.glb b/samples/models/mengerSponge3.glb new file mode 100644 index 000000000..07dac3d6f Binary files /dev/null and b/samples/models/mengerSponge3.glb differ diff --git a/samples/models/mengerSponge3.png b/samples/models/mengerSponge3.png new file mode 100644 index 000000000..d79c6bb28 Binary files /dev/null and b/samples/models/mengerSponge3.png differ diff --git a/samples/models/mengerSponge3.webp b/samples/models/mengerSponge3.webp new file mode 100644 index 000000000..1c40becf4 Binary files /dev/null and b/samples/models/mengerSponge3.webp differ diff --git a/samples/models/mengerSponge4.glb b/samples/models/mengerSponge4.glb new file mode 100644 index 000000000..25e385b31 Binary files /dev/null and b/samples/models/mengerSponge4.glb differ diff --git a/samples/models/mengerSpongeSquare.png b/samples/models/mengerSpongeSquare.png new file mode 100644 index 000000000..ca8fe7396 Binary files /dev/null and b/samples/models/mengerSpongeSquare.png differ diff --git a/samples/models/perf.glb b/samples/models/perf.glb new file mode 100644 index 000000000..ce999f5f2 Binary files /dev/null and b/samples/models/perf.glb differ diff --git a/samples/models/perf.png b/samples/models/perf.png new file mode 100644 index 000000000..0fb3ff379 Binary files /dev/null and b/samples/models/perf.png differ diff --git a/samples/models/perf.webp b/samples/models/perf.webp new file mode 100644 index 000000000..54dbd1a30 Binary files /dev/null and b/samples/models/perf.webp differ diff --git a/samples/models/rounding.glb b/samples/models/rounding.glb new file mode 100644 index 000000000..01bb9ead9 Binary files /dev/null and b/samples/models/rounding.glb differ diff --git a/samples/models/rounding.webp b/samples/models/rounding.webp new file mode 100644 index 000000000..27329bb7b Binary files /dev/null and b/samples/models/rounding.webp differ diff --git a/samples/models/scallop.glb b/samples/models/scallop.glb new file mode 100644 index 000000000..32f926134 Binary files /dev/null and b/samples/models/scallop.glb differ diff --git a/samples/models/scallop.png b/samples/models/scallop.png new file mode 100644 index 000000000..2d14936ee Binary files /dev/null and b/samples/models/scallop.png differ diff --git a/samples/models/scallop.webp b/samples/models/scallop.webp new file mode 100644 index 000000000..0c65e937e Binary files /dev/null and b/samples/models/scallop.webp differ diff --git a/samples/models/scallopFacets.glb b/samples/models/scallopFacets.glb new file mode 100644 index 000000000..608d0272a Binary files /dev/null and b/samples/models/scallopFacets.glb differ diff --git a/samples/models/scallopFacets.webp b/samples/models/scallopFacets.webp new file mode 100644 index 000000000..832363860 Binary files /dev/null and b/samples/models/scallopFacets.webp differ diff --git a/samples/src/bracelet.cpp b/samples/src/bracelet.cpp new file mode 100644 index 000000000..5138b0654 --- /dev/null +++ b/samples/src/bracelet.cpp @@ -0,0 +1,92 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "manifold/cross_section.h" +#include "samples.h" + +namespace { + +using namespace manifold; + +Manifold Base(double width, double radius, double decorRadius, + double twistRadius, int nDecor, double innerRadius, + double outerRadius, double cut, int nCut, int nDivision) { + Manifold base = Manifold::Cylinder(width, radius + twistRadius / 2); + + CrossSection circle = + CrossSection::Circle(decorRadius, nDivision).Translate({twistRadius, 0}); + Manifold decor = Manifold::Extrude(circle.ToPolygons(), width, nDivision, 180) + .Scale({1.0, 0.5, 1.0}) + .Translate({0.0, radius, 0.0}); + + for (int i = 0; i < nDecor; ++i) { + base += decor.Rotate(0, 0, (360.0 / nDecor) * i); + } + + Polygons stretch(1); + double dPhiRad = 2 * glm::pi() / nCut; + vec2 p0(outerRadius, 0.0); + vec2 p1(innerRadius, -cut); + vec2 p2(innerRadius, cut); + for (int i = 0; i < nCut; ++i) { + stretch[0].push_back(glm::rotate(p0, dPhiRad * i)); + stretch[0].push_back(glm::rotate(p1, dPhiRad * i)); + stretch[0].push_back(glm::rotate(p2, dPhiRad * i)); + stretch[0].push_back(glm::rotate(p0, dPhiRad * i)); + } + + base = Manifold::Extrude(stretch, width) ^ base; + // Remove extra edges in coplanar faces + base = base.AsOriginal(); + + return base; +} +} // namespace + +namespace manifold { + +/** + * My Stretchy Bracelet: this is one of my most popular designs, largely because + * it's quick and easy to 3D print. The defaults are picked to work well; change + * the radius to fit your wrist. Changing the other values too much may break + * the design. + * + * @param radius The overall size; the radius left for your wrist is roughly + * radius - height. + * @param height Thickness of the bracelet around your wrist. + * @param width The length along your arm (the height of the print). + * @param thickness The width of the material, which should be equal to your + * printer's nozzle diameter. + * @param nDecor The number of twisty shapes around the outside. + * @param nCut The number of cuts that enable stretching. + * @param nDivision the number of divisions along the width. + */ +Manifold StretchyBracelet(double radius, double height, double width, + double thickness, int nDecor, int nCut, + int nDivision) { + double twistRadius = glm::pi() * radius / nDecor; + double decorRadius = twistRadius * 1.5; + double outerRadius = radius + (decorRadius + twistRadius) * 0.5; + double innerRadius = outerRadius - height; + double cut = 0.5 * (glm::pi() * 2 * innerRadius / nCut - thickness); + double adjThickness = 0.5 * thickness * height / cut; + + return Base(width, radius, decorRadius, twistRadius, nDecor, + innerRadius + thickness, outerRadius + adjThickness, + cut - adjThickness, nCut, nDivision) - + Base(width, radius - thickness, decorRadius, twistRadius, nDecor, + innerRadius, outerRadius + 3 * adjThickness, cut, nCut, + nDivision); +} +} // namespace manifold diff --git a/samples/src/condensed_matter.cpp b/samples/src/condensed_matter.cpp new file mode 100644 index 000000000..3c883f823 --- /dev/null +++ b/samples/src/condensed_matter.cpp @@ -0,0 +1,150 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// From +// https://gist.github.com/ochafik/70a6b15e982b7ccd5a79ff9afd99dbcf#file-condensed-matter-scad + +#include "samples.h" + +namespace { +using namespace manifold; +using namespace glm; +using manifold::vec3; + +constexpr double AtomicRadiusN2 = 0.65; +constexpr double BondPairN2 = 1.197; +constexpr double AtomicRadiusSi = 1.1; +constexpr double LatticeCellSizeSi = 5.4309; +constexpr double fccOffset = 0.25; +constexpr double AtomicRadiusC = 0.7; +constexpr double LatticeCellSizeC = 3.65; +constexpr double cellLenA = 2.464; +constexpr double cellLenB = cellLenA; +constexpr double cellLenC = 6.711; +constexpr double cellAngleA = 90; +constexpr double cellAngleB = cellAngleA; +constexpr double cellAngleC = 120; +constexpr double LayerSeperationC = 3.364; + +Manifold bond(int fn, vec3 p1 = {0, 0, 0}, vec3 p2 = {1, 1, 1}, + double ar1 = 1.0, double ar2 = 2.0) { + double cyR = std::min(ar1, ar2) / 5.0; + double dist = length(p1 - p2); + vec3 cyC = (p1 + p2) / 2.0; + double beta = degrees(acos((p1.z - p2.z) / dist)); + double gamma = degrees(atan2(p1.y - p2.y, p1.x - p2.x)); + vec3 rot = {0.0, beta, gamma}; + return Manifold::Cylinder(dist, cyR, -1, fn, true) + .Rotate(rot.x, rot.y, rot.z) + .Translate(cyC); +} + +Manifold bondPair(int fn, double d = 0.0, double ar = 1.0) { + double axD = pow(d, 1.0 / 3.0); + vec3 p1 = {+axD, -axD, -axD}; + vec3 p2 = {-axD, +axD, +axD}; + Manifold sphere = Manifold::Sphere(ar, fn); + return sphere.Translate(p1) + sphere.Translate(p2) + bond(fn, p1, p2, ar, ar); +} + +Manifold hexagonalClosePacked(int fn, vec3 dst = {1.0, 1.0, 1.0}, + double ar = 1.0) { + std::vector parts; + vec3 p1 = {0, 0, 0}; + parts.push_back(Manifold::Sphere(ar, fn)); + double baseAg = 30; + vec3 ag = {baseAg, baseAg + 120, baseAg + 240}; + vec3 points[] = {{cosd(ag.x) * dst.x, sind(ag.x) * dst.x, 0}, + {cosd(ag.y) * dst.y, sind(ag.y) * dst.y, 0}, + {cosd(ag.z) * dst.z, sind(ag.z) * dst.z, 0}}; + for (vec3 p2 : points) { + parts.push_back(Manifold::Sphere(ar, fn).Translate(p2)); + parts.push_back(bond(fn, p1, p2, ar, ar)); + } + return Manifold::BatchBoolean(parts, OpType::Add); +} + +Manifold fccDiamond(int fn, double ar = 1.0, double unitCell = 2.0, + double fccOffset = 0.25) { + std::vector parts; + double huc = unitCell / 2.0; + double od = fccOffset * unitCell; + vec3 interstitial[] = { + {+od, +od, +od}, {+od, -od, -od}, {-od, +od, -od}, {-od, -od, +od}}; + vec3 corners[] = {{+huc, +huc, +huc}, + {+huc, -huc, -huc}, + {-huc, +huc, -huc}, + {-huc, -huc, +huc}}; + vec3 fcc[] = {{+huc, 0, 0}, {-huc, 0, 0}, {0, +huc, 0}, + {0, -huc, 0}, {0, 0, +huc}, {0, 0, -huc}}; + for (auto p : corners) parts.push_back(Manifold::Sphere(ar, fn).Translate(p)); + + for (auto p : fcc) parts.push_back(Manifold::Sphere(ar, fn).Translate(p)); + for (auto p : interstitial) + parts.push_back(Manifold::Sphere(ar, fn).Translate(p)); + + vec3 bonds[][2] = {{interstitial[0], corners[0]}, {interstitial[0], fcc[0]}, + {interstitial[0], fcc[2]}, {interstitial[0], fcc[4]}, + {interstitial[1], corners[1]}, {interstitial[1], fcc[0]}, + {interstitial[1], fcc[3]}, {interstitial[1], fcc[5]}, + {interstitial[2], corners[2]}, {interstitial[2], fcc[1]}, + {interstitial[2], fcc[2]}, {interstitial[2], fcc[5]}, + {interstitial[3], corners[3]}, {interstitial[3], fcc[1]}, + {interstitial[3], fcc[3]}, {interstitial[3], fcc[4]}}; + for (auto b : bonds) parts.push_back(bond(fn, b[0], b[1], ar, ar)); + + return Manifold::BatchBoolean(parts, OpType::Add); +} + +Manifold SiCell(int fn, double x = 1.0, double y = 1.0, double z = 1.0) { + return fccDiamond(fn, AtomicRadiusSi, LatticeCellSizeSi, fccOffset) + .Translate({LatticeCellSizeSi * x, LatticeCellSizeSi * y, + LatticeCellSizeSi * z}); +} + +Manifold SiN2Cell(int fn, double x = 1.0, double y = 1.0, double z = 1.0) { + double n2Offset = LatticeCellSizeSi / 8; + return bondPair(fn, BondPairN2, AtomicRadiusN2) + .Translate({LatticeCellSizeSi * x - n2Offset, + LatticeCellSizeSi * y + n2Offset, + LatticeCellSizeSi * z + n2Offset}) + + SiCell(fn, x, y, z); +} + +Manifold GraphiteCell(int fn, vec3 xyz = {1.0, 1.0, 1.0}) { + vec3 loc = {(cellLenA * xyz.x * cosd(30) * 2), + ((cellLenB * sind(30)) + cellLenC) * xyz.y, xyz.z}; + return hexagonalClosePacked(fn, {cellLenA, cellLenB, cellLenC}, AtomicRadiusC) + .Translate(loc); +} + +} // namespace + +namespace manifold { +Manifold CondensedMatter(int fn) { + std::vector parts; + double siOffset = 3.0 * LatticeCellSizeSi / 8.0; + for (int x = -3; x <= 3; x++) + for (int y = -1; y <= 2; y++) + parts.push_back( + GraphiteCell(fn, {x + (y % 2 == 0 ? 0.0 : 0.5), y, + LayerSeperationC * 0.5 + LatticeCellSizeSi * 1.5}) + .Translate({0, -siOffset, 0}) + .Rotate(0, 0, 45)); + + double xyPlane[] = {-2, -1, 0, +1, +2}; + for (double x : xyPlane) + for (double y : xyPlane) parts.push_back(SiN2Cell(fn, x, y, 1)); + return Manifold::BatchBoolean(parts, OpType::Add); +} +} // namespace manifold diff --git a/samples/src/gyroid_module.cpp b/samples/src/gyroid_module.cpp new file mode 100644 index 000000000..98350fe7a --- /dev/null +++ b/samples/src/gyroid_module.cpp @@ -0,0 +1,57 @@ +// Copyright 2022 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "manifold/manifold.h" +#include "samples.h" + +namespace { +using namespace manifold; + +struct Gyroid { + double operator()(vec3 p) const { + p -= glm::pi() / 4; + return cos(p.x) * sin(p.y) + cos(p.y) * sin(p.z) + cos(p.z) * sin(p.x); + } +}; + +Manifold RhombicDodecahedron(double size) { + Manifold box = Manifold::Cube(size * glm::sqrt(2.0) * vec3(1, 1, 2), true); + Manifold result = box.Rotate(90, 45) ^ box.Rotate(90, 45, 90); + return result ^ box.Rotate(0, 0, 45); +} + +} // namespace + +namespace manifold { + +/** + * Creates a rhombic dodecahedral module of a gyroid manifold, which can be + * assembled together to tile space continuously. This one is designed to be + * 3D-printable, as it is oriented with minimal overhangs. This sample + * demonstrates the use of a Signed Distance Function (SDF) to create smooth, + * complex manifolds. + */ +Manifold GyroidModule(double size, int n) { + auto gyroid = [&](double level) { + const double period = glm::two_pi(); + return Manifold::LevelSet(Gyroid(), {vec3(-period), vec3(period)}, + period / n, level) + .Scale(vec3(size / period)); + }; + + Manifold result = (RhombicDodecahedron(size) ^ gyroid(-0.4)) - gyroid(0.4); + + return result.Rotate(-45, 0, 90).Translate({0, 0, size / glm::sqrt(2.0)}); +} +} // namespace manifold diff --git a/samples/src/knot.cpp b/samples/src/knot.cpp new file mode 100644 index 000000000..09d6e4350 --- /dev/null +++ b/samples/src/knot.cpp @@ -0,0 +1,82 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "manifold/cross_section.h" +#include "samples.h" + +namespace { + +int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } +} // namespace + +namespace manifold { + +/** + * Creates a classic torus knot, defined as a string wrapping periodically + * around the surface of an imaginary donut. If p and q have a common factor + * then you will get multiple separate, interwoven knots. This is an example of + * using the Manifold.Warp() method, thus avoiding any handling of triangles. + * + * @param p The number of times the thread passes through the donut hole. + * @param q The number of times the thread circles the donut. + * @param majorRadius Radius of the interior of the imaginary donut. + * @param minorRadius Radius of the small cross-section of the imaginary donut. + * @param threadRadius Radius of the small cross-section of the actual object. + * @param circularSegments Number of linear segments making up the threadRadius + * circle. Default is Quality.GetCircularSegments(). + * @param linearSegments Number of segments along the length of the knot. + * Default makes roughly square facets. + */ +Manifold TorusKnot(int p, int q, double majorRadius, double minorRadius, + double threadRadius, int circularSegments, + int linearSegments) { + int kLoops = gcd(p, q); + p /= kLoops; + q /= kLoops; + int n = circularSegments > 2 ? circularSegments + : Quality::GetCircularSegments(threadRadius); + int m = + linearSegments > 2 ? linearSegments : n * q * majorRadius / threadRadius; + + CrossSection circle = CrossSection::Circle(1., n).Translate({2, 0}); + Manifold knot = Manifold::Revolve(circle.ToPolygons(), m); + + knot = knot.Warp([p, q, majorRadius, minorRadius, threadRadius](vec3& v) { + double psi = q * atan2(v.x, v.y); + double theta = psi * p / q; + vec2 xy = vec2(v); + double x1 = sqrt(glm::dot(xy, xy)); + double phi = atan2(x1 - 2, v.z); + v = vec3(cos(phi), 0.0, sin(phi)); + v *= threadRadius; + double r = majorRadius + minorRadius * cos(theta); + v = glm::rotateX(v, -double(atan2(p * minorRadius, q * r))); + v.x += minorRadius; + v = glm::rotateY(v, theta); + v.x += majorRadius; + v = glm::rotateZ(v, psi); + }); + + if (kLoops > 1) { + std::vector knots; + for (double k = 0; k < kLoops; ++k) { + knots.push_back( + knot.Rotate(0, 0, 360.0 * (k / kLoops) * (q / double(p)))); + } + knot = Manifold::Compose(knots); + } + + return knot; +} +} // namespace manifold diff --git a/samples/src/menger_sponge.cpp b/samples/src/menger_sponge.cpp new file mode 100644 index 000000000..8170e63fb --- /dev/null +++ b/samples/src/menger_sponge.cpp @@ -0,0 +1,64 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "samples.h" + +namespace { + +using namespace manifold; + +void Fractal(std::vector& holes, Manifold& hole, double w, + vec2 position, int depth, int maxDepth) { + w /= 3; + holes.push_back(hole.Scale({w, w, 1.0}).Translate(vec3(position, 0.0))); + if (depth == maxDepth) return; + + vec2 offsets[8] = {{-w, -w}, {-w, 0.0}, {-w, w}, {0.0, w}, + {w, w}, {w, 0.0}, {w, -w}, {0.0, -w}}; + for (int i = 0; i < 8; ++i) { + Fractal(holes, hole, w, position + offsets[i], depth + 1, maxDepth); + } +} +} // namespace + +namespace manifold { + +/** + * The classic cubic fractal. + * + * @param n Fractal depth. Warning: scales exponentially, n = 4 has almost + * 400,000 triangles! + */ +Manifold MengerSponge(int n) { + Manifold result = Manifold::Cube(vec3(1.0), true); + + std::vector holes; + Fractal(holes, result, 1.0, {0.0, 0.0}, 1, n); + + Manifold hole = Manifold::Compose(holes); + + result -= hole; + hole = hole.Rotate(90); + result -= hole; + hole = hole.Rotate(0, 0, 90); + result -= hole; + + // Alternative order causes degenerate triangles + // Manifold tmp1 = hole.Rotate(90) + hole.Rotate(90).Rotate(0, 0, 90); + // Manifold tmp2 = hole + tmp1; + // result = result - tmp2; + + return result; +} +} // namespace manifold diff --git a/samples/src/rounded_frame.cpp b/samples/src/rounded_frame.cpp new file mode 100644 index 000000000..0d3d91240 --- /dev/null +++ b/samples/src/rounded_frame.cpp @@ -0,0 +1,48 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "samples.h" + +namespace manifold { + +/** + * A cubic frame with cylinders for edges and spheres at the corners. + * Demonstrates how at 90-degree intersections, the sphere and cylinder facets + * match up perfectly. + * + * @param edgeLength Distance between the corners. + * @param radius Radius of the frame members. + * @param circularSegments Number of segments in the cylinders and spheres. + * Defaults to Quality.GetCircularSegments(). + */ +Manifold RoundedFrame(double edgeLength, double radius, int circularSegments) { + Manifold edge = Manifold::Cylinder(edgeLength, radius, -1, circularSegments); + Manifold corner = Manifold::Sphere(radius, circularSegments); + + Manifold edge1 = corner + edge; + edge1 = edge1.Rotate(-90).Translate({-edgeLength / 2, -edgeLength / 2, 0}); + + Manifold edge2 = edge1.Rotate(0, 0, 180); + edge2 += edge1; + edge2 += edge.Translate({-edgeLength / 2, -edgeLength / 2, 0}); + + Manifold edge4 = edge2.Rotate(0, 0, 90); + edge4 += edge2; + + Manifold frame = edge4.Translate({0, 0, -edgeLength / 2}); + frame += frame.Rotate(180); + + return frame; +} +} // namespace manifold diff --git a/samples/src/scallop.cpp b/samples/src/scallop.cpp new file mode 100644 index 000000000..562fa8bb3 --- /dev/null +++ b/samples/src/scallop.cpp @@ -0,0 +1,57 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "samples.h" + +namespace manifold { + +/** + * A smoothed manifold demonstrating selective edge sharpening with + * Manifold.Smooth(). Use Manifold.Refine() before export to see the curvature. + */ +Manifold Scallop() { + constexpr double height = 1; + constexpr double radius = 3; + constexpr double offset = 2; + constexpr int wiggles = 12; + constexpr double sharpness = 0.8; + + Mesh scallop; + std::vector sharpenedEdges; + scallop.vertPos = {{-offset, 0, height}, {-offset, 0, -height}}; + + const double delta = glm::pi() / wiggles; + for (int i = 0; i < 2 * wiggles; ++i) { + double theta = (i - wiggles) * delta; + double amp = 0.5 * height * glm::max(glm::cos(0.8 * theta), 0.0); + + scallop.vertPos.push_back({radius * glm::cos(theta), + radius * glm::sin(theta), + amp * (i % 2 == 0 ? 1 : -1)}); + int j = i + 1; + if (j == 2 * wiggles) j = 0; + + double smoothness = 1 - sharpness * glm::cos((theta + delta / 2) / 2); + size_t halfedge = 3 * scallop.triVerts.size() + 1; + sharpenedEdges.push_back({halfedge, smoothness}); + scallop.triVerts.push_back({0, 2 + i, 2 + j}); + + halfedge = 3 * scallop.triVerts.size() + 1; + sharpenedEdges.push_back({halfedge, smoothness}); + scallop.triVerts.push_back({1, 2 + j, 2 + i}); + } + + return Manifold::Smooth(scallop, sharpenedEdges); +} +} // namespace manifold diff --git a/samples/src/tet_puzzle.cpp b/samples/src/tet_puzzle.cpp new file mode 100644 index 000000000..bd6966cf5 --- /dev/null +++ b/samples/src/tet_puzzle.cpp @@ -0,0 +1,47 @@ +// Copyright 2021 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "samples.h" + +namespace manifold { + +/** + * A tetrahedron cut into two identical halves that can screw together as a + * puzzle. This only outputs one of the halves. This demonstrates how redundant + * points along a polygon can be used to make twisted extrusions smoother. + * + * @param edgeLength Length of each edge of the overall tetrahedron. + * @param gap Spacing between the two halves to allow sliding. + * @param nDivisions Number of divisions (both ways) in the screw surface. + */ +Manifold TetPuzzle(double edgeLength, double gap, int nDivisions) { + const vec3 scale(edgeLength / (2 * sqrt(2))); + + Manifold tet = Manifold::Tetrahedron().Scale(scale); + + Polygons box; + box.push_back({{2, -2}, {2, 2}}); + + for (int i = 0; i <= nDivisions; ++i) { + box[0].push_back({gap / 2, 2 - i * 4.0 / nDivisions}); + } + + Manifold screw = Manifold::Extrude(box, 2, nDivisions, 270) + .Rotate(0, 0, -45) + .Translate({0, 0, -1}) + .Scale(scale); + + return tet ^ screw; +} +} // namespace manifold diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 000000000..5f4def620 --- /dev/null +++ b/service-worker.js @@ -0,0 +1,41 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Increment version when updating CDN URLs to clean up cache. +const cacheName = 'manifoldCAD-cache-v1'; + +self.addEventListener('activate', e => { + e.waitUntil(caches.keys().then((keyList) => { + return Promise.all(keyList.map((key) => { + if (key !== cacheName) { + return caches.delete(key); + } + })); + })); +}); + +// Serves from cache, then updates the cache in the background from the network, +// if available. Update available on refresh. +self.addEventListener( + 'fetch', + e => {e.respondWith(caches.match(e.request).then(cachedResponse => { + const networkFetch = fetch(e.request).then(response => { + const clone = response.clone(); + caches.open(cacheName).then(cache => { + cache.put(e.request, clone); + }); + return response; + }); + return cachedResponse || networkFetch; + }))}); diff --git a/three.html b/three.html new file mode 100644 index 000000000..02aad12b5 --- /dev/null +++ b/three.html @@ -0,0 +1,58 @@ + + + + + Manifold - three.js Example + + + + + + + + + + +

This example demonstrates interop between Manifold and Three.js with minimal code - please open dev tools to + inspect the source. Here we generate two multi-material Three.js meshes and convert them to Manifolds while building + a mapping from material to Manifold ID. Then Boolean operations are performed on the Manifolds and the result is + converted back to a Three.js mesh using the material mapping. The input cube has half red faces and half + normal-shaded, while the icosahedron has half blue faces and half normal-shaded. The resulting mesh has three + materials, since one (normal-shaded) was common between the input models.

+

A slightly more complex example involving our library for GLTF import/export and <model-viewer> can be found + here.

+
+ + + + + \ No newline at end of file