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..8b1378917 --- /dev/null +++ b/assets/__vite-browser-external-4ed993c7.js @@ -0,0 +1 @@ + diff --git a/assets/__vite-browser-external.js b/assets/__vite-browser-external.js new file mode 100644 index 000000000..b480ffe6c --- /dev/null +++ b/assets/__vite-browser-external.js @@ -0,0 +1 @@ +const e={};export{e as default}; diff --git a/assets/gltf-io.js b/assets/gltf-io.js new file mode 100644 index 000000000..6373e8d05 --- /dev/null +++ b/assets/gltf-io.js @@ -0,0 +1,20 @@ +class mt{constructor(){this._listeners={}}addEventListener(e,t){const r=this._listeners;return r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[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 r=this._listeners[e.type];if(r!==void 0){const i=r.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 r=this.listParentEdges(e);return t&&(r=r.filter(i=>t(i.getParent()))),r.forEach(i=>i.dispose()),this}createEdge(e,t,r,i){return this._registerEdge(new fe(e,t,r,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 r=e.getChild();return this._childEdges.has(r)||this._childEdges.set(r,new Set),this._childEdges.get(r).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(s){for(var e=1;ei.dispose()),this[le].add(r),t[r]=n}else t[r]=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 r in this[L]){const i=this[L][r];if(ot(i)){const n=i;n.getChild()===e&&this.setRef(r,t,n.getAttributes())}else if(Te(i)){const a=i.find(c=>c.getChild()===e);if(a){const c=a.getAttributes();this.removeRef(r,e).addRef(r,t,c)}}else if(be(i)){const n=i;for(const a in n){const c=n[a];c.getChild()===e&&this.setRefMap(r,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,r){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,r);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(r=>r.getChild())}addRef(e,t,r){const i=this.graph.createEdge(e,this,t,r),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 r=this[L][e];return r[t]?r[t].getChild():null}setRefMap(e,t,r,i){const n=this[L][e],a=n[t];if(a&&a.dispose(),!r)return this;i=Object.assign(i||{},{key:t});const c=this.graph.createEdge(e,this,r,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,re;(function(s){s.ACCESSOR="Accessor",s.ANIMATION="Animation",s.ANIMATION_CHANNEL="AnimationChannel",s.ANIMATION_SAMPLER="AnimationSampler",s.BUFFER="Buffer",s.CAMERA="Camera",s.MATERIAL="Material",s.MESH="Mesh",s.PRIMITIVE="Primitive",s.PRIMITIVE_TARGET="PrimitiveTarget",s.NODE="Node",s.ROOT="Root",s.SCENE="Scene",s.SKIN="Skin",s.TEXTURE="Texture",s.TEXTURE_INFO="TextureInfo"})(M||(M={})),function(s){s.INTERLEAVED="interleaved",s.SEPARATE="separate"}(ze||(ze={})),function(s){s.ARRAY_BUFFER="ARRAY_BUFFER",s.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",s.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",s.OTHER="OTHER",s.SPARSE="SPARSE"}($||($={})),function(s){s[s.R=4096]="R",s[s.G=256]="G",s[s.B=16]="B",s[s.A=1]="A"}(ct||(ct={})),function(s){s.GLTF="GLTF",s.GLB="GLB"}(re||(re={}));const $e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var Pe,ut=typeof Float32Array<"u"?Float32Array:Array;function st(s){return Math.hypot(s[0],s[1],s[2])}function ws(s,e,t){var r=e[0],i=e[1],n=e[2],a=t[3]*r+t[7]*i+t[11]*n+t[15];return s[0]=(t[0]*r+t[4]*i+t[8]*n+t[12])/(a=a||1),s[1]=(t[1]*r+t[5]*i+t[9]*n+t[13])/a,s[2]=(t[2]*r+t[6]*i+t[10]*n+t[14])/a,s}function Jr(s){const e={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]},t=s.propertyType===M.NODE?[s]:s.listChildren();for(const r of t)r.traverse(i=>{const n=i.getMesh();if(!n)return;const a=Rs(n,i.getWorldMatrix());lt(a.min,e),lt(a.max,e)});return e}Math.hypot||(Math.hypot=function(){for(var s=0,e=arguments.length;e--;)s+=arguments[e]*arguments[e];return Math.sqrt(s)}),Pe=new ut(3),ut!=Float32Array&&(Pe[0]=0,Pe[1]=0,Pe[2]=0);function Rs(s,e){const t={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]};for(const r of s.listPrimitives()){const i=r.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]),r=new Uint8Array(t.length);for(let i=0;i=0;return Buffer.from(t,r?"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 r=new Uint8Array(t);let i=0;for(const n of e)r.set(n,i),i+=n.byteLength;return r}static pad(e,t=0){const r=this.padNumber(e.byteLength);if(r===e.byteLength)return e;const i=new Uint8Array(r);if(i.set(e),t!==0)for(let n=e.byteLength;n>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,this.convertSRGBToLinear(t,t)}static factorToHex(e){const t=[...e],[r,i,n]=this.convertLinearToSRGB(e,t);return 255*r<<16^255*i<<8^255*n<<0}static convertSRGBToLinear(e,t){const r=e,i=t;for(let n=0;n<3;n++)i[n]=r[n]<.04045?.0773993808*r[n]:Math.pow(.9478672986*r[n]+.0521327014,2.4);return t}static convertLinearToSRGB(e,t){const r=e,i=t;for(let n=0;n<3;n++)i[n]=r[n]<.0031308?12.92*r[n]:1.055*Math.pow(r[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 r=0;const i=this.getSize(e,t);if(!i)return null;for(;i[0]>1||i[1]>1;)r+=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 r+=4,r}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}}function Is(s,e){if(e>s.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(s.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return s}ne.impls={"image/jpeg":new class{match(s){return s.length>=3&&s[0]===255&&s[1]===216&&s[2]===255}getSize(s){let e,t,r=new DataView(s.buffer,s.byteOffset+4);for(;r.byteLength;){if(e=r.getUint16(0,!1),Is(r,e),t=r.getUint8(e+1),t===192||t===193||t===194)return[r.getUint16(e+7,!1),r.getUint16(e+5,!1)];r=new DataView(s.buffer,r.byteOffset+e+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(s){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(s){return Object.prototype.toString.call(s)==="[object Object]"}function se(s){if(At(s)===!1)return!1;const e=s.constructor;if(e===void 0)return!0;const t=e.prototype;return At(t)!==!1&&Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")!==!1}var rt,ht;(function(s){s[s.SILENT=4]="SILENT",s[s.ERROR=3]="ERROR",s[s.WARN=2]="WARN",s[s.INFO=1]="INFO",s[s.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 xs(s,e,t){var r=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 s[0]=h*r+f*c+d*T+E*I,s[1]=h*i+f*o+d*p+E*l,s[2]=h*n+f*g+d*y+E*b,s[3]=h*a+f*m+d*A+E*u,s[4]=(h=t[4])*r+(f=t[5])*c+(d=t[6])*T+(E=t[7])*I,s[5]=h*i+f*o+d*p+E*l,s[6]=h*n+f*g+d*y+E*b,s[7]=h*a+f*m+d*A+E*u,s[8]=(h=t[8])*r+(f=t[9])*c+(d=t[10])*T+(E=t[11])*I,s[9]=h*i+f*o+d*p+E*l,s[10]=h*n+f*g+d*y+E*b,s[11]=h*a+f*m+d*A+E*u,s[12]=(h=t[12])*r+(f=t[13])*c+(d=t[14])*T+(E=t[15])*I,s[13]=h*i+f*o+d*p+E*l,s[14]=h*n+f*g+d*y+E*b,s[15]=h*a+f*m+d*A+E*u,s}rt=ie,ie.Verbosity=ht,ie.DEFAULT_INSTANCE=new rt(rt.Verbosity.INFO);class B{static identity(e){return e}static eq(e,t,r=1e-5){if(e.length!==t.length)return!1;for(let i=0;ir)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,r,i){let n=st([e[0],e[1],e[2]]);const a=st([e[4],e[5],e[6]]),c=st([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 ps=J[4],ds=J[5],ms=J[6],ys=J[8],Es=J[9],Ts=J[10];tt[0]=Math.hypot(J[0],J[1],J[2]),tt[1]=Math.hypot(ps,ds,ms),tt[2]=Math.hypot(ys,Es,Ts)})(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)}(r,v),i[0]=n,i[1]=a,i[2]=c}static compose(e,t,r,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=r[0],x=r[1],N=r[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 Ms(s,e){if(!!s!=!!e)return!1;const t=s.getChild(),r=e.getChild();return t===r||t.equals(r)}function _s(s,e){if(!!s!=!!e||s.length!==e.length)return!1;for(let t=0;ts,Os=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 r in this[L]){const i=this[L][r];if(i instanceof fe)this[le].has(r)||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 r in e[L]){const i=this[L][r],n=e[L][r];if(n instanceof fe)this[le].has(r)?i.getChild().copy(t(n.getChild()),t):this.setRef(r,t(n.getChild()),n.getAttributes());else if(Te(n))for(const a of n)this.addRef(r,t(a.getChild()),a.getAttributes());else if(be(n))for(const a in n){const c=n[a];this.setRefMap(r,a,t(c.getChild()),c.getAttributes())}else this[L][r]=se(n)?JSON.parse(JSON.stringify(n)):Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.slice():n}return this}equals(e,t=Os){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const r in this[L]){if(t.has(r))continue;const i=this[L][r],n=e[L][r];if(ot(i)||ot(n)){if(!Ms(i,n))return!1}else if(Te(i)||Te(n)){if(!_s(i,n))return!1}else if(be(i)||be(n)){if(!Ns(i,n))return!1}else if(se(i)||se(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 r=0;rB.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 r=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 es=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(s){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 ts 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}},ss=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 r of e.listRefMapKeys("extensions")){const i=e.getExtension(r);this.setExtension(r,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 ts?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 bs,this.S=new ss(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,r=new Map;t.add(e.S),r.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),r.set(a,c),t.add(a)}const i=n=>{const a=r.get(n);if(!a)throw new Error("Could resolve property.");return a};for(const n of t){const a=r.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(r=>r.name);for(const r of e)await r(this,{stack:t});return this}createExtension(e){const t=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(r=>r.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 ts(this.T,e)}createMesh(e=""){return new Kt(this.T,e)}createPrimitive(){return new de(this.T)}createPrimitiveTarget(e=""){return new es(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 rs{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=r=>{const i=r,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}}rs.EXTENSION_NAME=void 0;let Ps=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 r=this.jsonDoc.json.textures[t.index];if(r.sampler===void 0)return;const i=this.jsonDoc.json.samplers[r.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 Fs=class{static read(e,t=It){const r=G({},It,t),{json:i}=e,n=new Qe().setLogger(r.logger);this.validate(e,r);const a=new Ps(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 r.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,r.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(r.extensionsUsed)for(const i of r.extensionsUsed)t.extensions.find(n=>n.EXTENSION_NAME===i)||t.logger.warn(`Missing optional extension, "${i}".`)}};function Be(s,e){const t=e.bufferViews[s.bufferView],r=e.jsonDoc.json.bufferViews[s.bufferView],i=$e[s.componentType],n=C.getElementSize(s.type),a=i.BYTES_PER_ELEMENT;if(r.byteStride!==void 0&&r.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,()=>r.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)||r.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,t){const r={magFilter:t.getMagFilter()||void 0,minFilter:t.getMinFilter()||void 0,wrapS:t.getWrapS(),wrapT:t.getWrapT()},i=JSON.stringify(r);this.samplerDefIndexMap.has(i)||(this.samplerDefIndexMap.set(i,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(r));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(r=>r.getName()==="attributes"&&r.getAttributes().key==="POSITION"||r.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,r){if(this.options.format===re.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(r.getMimeType());e.uri=this.imageURIGenerator.createURI(r,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 r of this.C.getGraph().listParentEdges(e)){const{usage:i}=r.getAttributes();if(i)return i;r.getParent().propertyType!==M.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${r.getName()}".`)}return $.OTHER}addAccessorToUsageGroup(e,t){const r=this.F.get(e);if(r&&r!==t)throw new Error(`Accessor with usage "${r}" cannot be reused as "${t}".`);return this.F.set(e,t),this}listAccessorUsageGroups(){const e={};for(const[t,r]of Array.from(this.F.entries()))e[r]=e[r]||[],e[r].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 r=this.basename(e);return this.counter[r]=this.counter[r]||1,`${r}_${this.counter[r]++}.${t}`}return`${this.basename(e)}.${t}`}};const{BufferViewUsage:Ue}=te,{UNSIGNED_INT:Ls,UNSIGNED_SHORT:js,UNSIGNED_BYTE:Bs}=C.ComponentType;let Us=class{static write(e,t){const r=e.getRoot(),i={asset:G({generator:`glTF-Transform ${$t}`},r.getAsset()),extras:G({},r.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?Bs:E<65535?js:Ls,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()===r)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=r.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)),r.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)),(r.listAccessors().length>0||r.listTextures().length>0||a.otherBufferViews.size>0)&&r.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");i.buffers=[],r.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=r.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=r.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=r.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=r.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=r.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}),r.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=r.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=r.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=r.getDefaultScene();return I&&(i.scene=r.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(s){s[s.JSON=1313821514]="JSON",s[s.BIN=5130562]="BIN"})(We||(We={}));let Ds=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 r=Mt(t)?this.L(t):{json:JSON.parse(F.decodeText(t)),resources:{}};return await this.j(r,this.dirname(e)),this.D(r),r}async readJSON(e){return e=this._(e),this.D(e),Fs.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 r=t.json;if(r.buffers&&r.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(r.images&&r.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===re.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return Us.write(e,{format:t.format||re.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:r}=await this.writeJSON(e,{format:re.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(r)[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 r=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 r.readURI(r.resolve(t,a),"view"),r.lastReadBytes+=e.resources[a].byteLength});await Promise.all(i)}D(e){function t(r){if(r.uri){if(r.uri in e.resources)F.assertView(e.resources[r.uri]);else if(r.uri.match(/data:/)){const i=`__${Cs()}.${ge.extension(r.uri)}`;e.resources[i]=F.createBufferFromDataURI(r.uri),r.uri=i}}}(e.json.images||[]).forEach(r=>{if(r.bufferView===void 0&&r.uri===void 0)throw new Error("Missing resource URI or buffer view.");t(r)}),(e.json.buffers||[]).forEach(t)}_(e){const{images:t,buffers:r}=e.json;return e={json:G({},e.json),resources:G({},e.resources)},t&&(e.json.images=t.map(i=>G({},i))),r&&(e.json.buffers=r.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 r=t[0],i=F.decodeText(F.toView(e,20,r)),n=JSON.parse(i),a=20+r;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(s){if(s.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(s.buffer,s.byteOffset,3);return e[0]===1179937895&&e[1]===2}let hn=class extends Ds{constructor(e=Re.DEFAULT_INIT){super(),this.J=void 0,this.J=e}async readURI(e,t){const r=await fetch(e,this.J);switch(t){case"view":return new Uint8Array(await r.arrayBuffer());case"text":return r.text()}}resolve(e,t){return Re.resolve(e,t)}dirname(e){return Re.dirname(e)}};function ks(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Gs(s){for(var e=new Array(s),t=0;t + * @license MIT + */var $s=function(s){return s!=null&&(ns(s)||qs(s)||!!s._isBuffer)};function ns(s){return!!s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function qs(s){return typeof s.readFloatLE=="function"&&typeof s.slice=="function"&&ns(s.slice(0,0))}var Ws=zs,Ys=$s,Hs=typeof Float64Array<"u";function Xs(s,e){return s[0]-e[0]}function Js(){var s=this.stride,e=new Array(s.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){"),r?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+t+"_get("+a.join(",")+"){"),r?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[s],Js)}function Zs(s){if(Ys(s))return"buffer";if(Hs)switch(Object.prototype.toString.call(s)){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(s)?"array":"generic"}var Ye={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function Qs(s,e,t,r){if(s===void 0){var g=Ye.array[0];return g([])}else typeof s=="number"&&(s=[s]);e===void 0&&(e=[s.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(r===void 0){r=0;for(var n=0;n0,a=[],c=[],o=0,g=0,m,T;for(m=0;m0&&a.push("var "+c.join(",")),m=r-1;m>=0;--m)o=s[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 cr(s,e,t,r){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[r]===e[r-1])}return t?e[0]:e.join("")}function hr(s,e){for(var t=e[1].length-Math.abs(s.arrayBlockIndices[0])|0,r=new Array(s.arrayArgs.length),i=new Array(s.arrayArgs.length),n=0;n0&&I.push("shape=SS.slice(0)"),s.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(s.pre,s,i));var f=nt(s.body,s,i),d=ur(m);d3&&A.push(nt(s.post,s,i)),s.debug&&console.log("-----Generated cwise routine for ",e,`: +`+A.join(` +`)+` +----------`);var E=[s.funcName||"unnamed","_cwise_loop_",r[0].join("s"),"m",d,lr(i)].join(""),x=new Function(["function ",E,"(",y.join(","),"){",A.join(` +`),"} return ",E].join(""));return x()}var fr=hr,gr=fr;function pr(s){var e=["'use strict'","var CACHED={}"],t=[],r=s.funcName+"_cwise_thunk";e.push(["return function ",r,"(",s.shimArgs.join(","),"){"].join(""));for(var i=[],n=[],a=[["array",s.arrayArgs[0],".shape.slice(",Math.max(0,s.arrayBlockIndices[0]),s.arrayBlockIndices[0]<0?","+s.arrayBlockIndices[0]+")":")"].join("")],c=[],o=[],g=0;g0&&(c.push("array"+s.arrayArgs[0]+".shape.length===array"+m+".shape.length+"+(Math.abs(s.arrayBlockIndices[0])-Math.abs(s.arrayBlockIndices[g]))),o.push("array"+s.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,s.arrayBlockIndices[0])+"]===array"+m+".shape[shapeIndex+"+Math.max(0,s.arrayBlockIndices[g])+"]"))}s.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"+s.arrayArgs[0]+".shape.length-"+Math.abs(s.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(r0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(r),e.shimArgs.push("scalar"+r);else if(i==="index"){if(e.indexArgs.push(r),r0)throw new Error("cwise: pre() block may not reference array index");if(r0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(r),rt.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=!!s.printCode||!!s.debug,e.funcName=s.funcName||"cwise",e.blockSize=s.blockSize||64,mr(e)}var Tr=Er;(function(s){var e=Tr,t={body:"",args:[],thisVars:[],localVars:[]};function r(p){if(!p)return t;for(var y=0;y>",rrshift:">>>"};(function(){for(var p in a){var y=a[p];s[p]=n({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+y+"c"},funcName:p}),s[p+"eq"]=n({args:["array","array"],body:{args:["a","b"],body:"a"+y+"=b"},rvalue:!0,funcName:p+"eq"}),s[p+"s"]=n({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+y+"s"},funcName:p+"s"}),s[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];s[p]=n({args:["array","array"],body:{args:["a","b"],body:"a="+y+"b"},funcName:p}),s[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];s[p]=n({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+y+"c"},funcName:p}),s[p+"s"]=n({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+y+"s"},funcName:p+"s"}),s[p+"eq"]=n({args:["array","array"],body:{args:["a","b"],body:"a=a"+y+"b"},rvalue:!0,count:2,funcName:p+"eq"}),s[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"}),s.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"}),s.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:[]}}),s.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:[]}}),s.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"}),s.assign=n({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),s.assigns=n({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),s.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"})})(sr);function br(s,e){if(!(s instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");const t=new Blob([s],{type:e}),r=URL.createObjectURL(t);return new Promise((i,n)=>{const a=new Image;a.crossOrigin="anonymous",a.onload=function(){URL.revokeObjectURL(r);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(tr(new Uint8Array(g.data),[a.width,a.height,4],[4,4*a.width,1],0))},a.onerror=c=>{URL.revokeObjectURL(r),n(c)},a.src=r})}async function vr(s,e){return br(s,e)}function me(){return me=Object.assign?Object.assign.bind():function(s){for(var e=1;er?"–":"+")+(Math.abs(t-r)/t*100).toFixed(i)+"%"}(s,e)})`}function wr(s){const e=[];for(const t of s.listAttributes())e.push(t);for(const t of s.listTargets())for(const r of t.listAttributes())e.push(r);return Array.from(new Set(e))}function ce(s,e=s){const t=e<=65534?new Uint16Array(s):new Uint32Array(s);for(let r=0;ri instanceof Ze)}function Ir(s){const e=Rr(s),t=s.getParentNode();if(!t)return s;s.setMatrix(s.getWorldMatrix()),t.removeChild(s);for(const r of e)r.addChild(s);return s}var ye=typeof Float32Array<"u"?Float32Array:Array;function xr(s,e,t){var r=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 s[0]=h*r+f*c+d*T+E*I,s[1]=h*i+f*o+d*p+E*l,s[2]=h*n+f*g+d*y+E*b,s[3]=h*a+f*m+d*A+E*u,s[4]=(h=t[4])*r+(f=t[5])*c+(d=t[6])*T+(E=t[7])*I,s[5]=h*i+f*o+d*p+E*l,s[6]=h*n+f*g+d*y+E*b,s[7]=h*a+f*m+d*A+E*u,s[8]=(h=t[8])*r+(f=t[9])*c+(d=t[10])*T+(E=t[11])*I,s[9]=h*i+f*o+d*p+E*l,s[10]=h*n+f*g+d*y+E*b,s[11]=h*a+f*m+d*A+E*u,s[12]=(h=t[12])*r+(f=t[13])*c+(d=t[14])*T+(E=t[15])*I,s[13]=h*i+f*o+d*p+E*l,s[14]=h*n+f*g+d*y+E*b,s[15]=h*a+f*m+d*A+E*u,s}function et(){var s=new ye(3);return ye!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0),s}function os(s,e){var t=e[0],r=e[1],i=e[2],n=t*t+r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),s[0]=e[0]*n,s[1]=e[1]*n,s[2]=e[2]*n,s}function Mr(s,e,t){var r=e[0],i=e[1],n=e[2],a=t[3]*r+t[7]*i+t[11]*n+t[15];return s[0]=(t[0]*r+t[4]*i+t[8]*n+t[12])/(a=a||1),s[1]=(t[1]*r+t[5]*i+t[9]*n+t[13])/a,s[2]=(t[2]*r+t[6]*i+t[10]*n+t[14])/a,s}function _r(s,e,t){var r=e[0],i=e[1],n=e[2];return s[0]=r*t[0]+i*t[3]+n*t[6],s[1]=r*t[1]+i*t[4]+n*t[7],s[2]=r*t[2]+i*t[5]+n*t[8],s}Math.hypot||(Math.hypot=function(){for(var s=0,e=arguments.length;e--;)s+=arguments[e]*arguments[e];return Math.sqrt(s)});var Nr=function(s,e,t){return s[0]=e[0]*t[0],s[1]=e[1]*t[1],s[2]=e[2]*t[2],s};function Tt(){var s=new ye(4);return ye!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0,s[3]=0),s}et();var cs=function(s,e,t){return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],s[3]=e[3]-t[3],s},Sr=function(s,e,t){return s[0]=e[0]*t[0],s[1]=e[1]*t[1],s[2]=e[2]*t[2],s[3]=e[3]*t[3],s},us=function(s){return Math.hypot(s[0],s[1],s[2],s[3])};Tt();M.ACCESSOR,M.MESH,M.TEXTURE,M.MATERIAL,M.SKIN;const Cr=/color|emissive|diffuse/i;function Or(s){return s.getGraph().listParentEdges(s).some(e=>e.getAttributes().isColor||Cr.test(e.getName()))?"srgb":null}function Vr(s){const e=s.getGraph(),t=new Set,r=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())?r.add(o):o instanceof Ce&&i(o))}}(s),Array.from(r)}function Pr(s){const e=Qe.fromGraph(s.getGraph()).getRoot(),t=s.getGraph().listParentEdges(s).filter(r=>r.getParent()!==e).map(r=>r.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 Fr(s=Nt){const e=me({},Nt,s),t=new Set(e.propertyTypes);return as(ue,async r=>{const i=r.getLogger(),n=r.getRoot(),a=r.getGraph(),c=new Lr;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())ls(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=jr(m,hs(r,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)Br(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 vr(_.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;Or(A)==="srgb"&&ve.convertSRGBToLinear(l,l);const b=A.getName()||A.getURI(),u=(I=A.getSize())==null?void 0:I.join("x"),h=Pr(A);for(const f of T.listParentEdges(A)){const d=f.getParent();d!==m&&Ur(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)}(r,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 Lr{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(s,e){s.listParents().filter(t=>!(t instanceof ss||t instanceof Ke)).length||e.dispose(s)}function St(s,e,t){for(const r of s.listEdges()){const i=r.getParent();i.propertyType===e&&W(i,t)}}function ls(s,e,t){if(e.listChildren().forEach(i=>ls(s,i,t)),e instanceof Ze)return;const r=s.listParentEdges(e).some(i=>{const n=i.getParent().propertyType;return n!==M.ROOT&&n!==M.SCENE&&n!==M.NODE});s.listChildren(e).length===0&&!r&&t.dispose(e)}function Ct(s,e){for(const t of e)s.setAttribute(t,null)}function jr(s,e){const t=[];for(const r of s.listSemantics())r!=="TANGENT"||e.has(r)?(r.startsWith("TEXCOORD_")&&!e.has(r)||r.startsWith("COLOR_")&&r!=="COLOR_0")&&t.push(r):t.push(r);return t}function hs(s,e,t=new Set){if(!e)return t;const r=s.getGraph().listChildEdges(e),i=new Set;for(const n of r)n.getChild()instanceof _e&&i.add(n.getName());for(const n of r){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&&hs(s,c,t)}return t}function Br(s,e){const t=Vr(s),r=new Set(t.map(o=>o.getTexCoord())),i=Array.from(r).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 Ur(s,e,t,r){if(s instanceof pe)switch(t){case"baseColorTexture":return s.setBaseColorFactor(Sr(e,e,s.getBaseColorFactor())),!0;case"emissiveTexture":return s.setEmissiveFactor(Nr([0,0,0],e.slice(0,3),s.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(e[0]-1)<=gt;case"metallicRoughnessTexture":return s.setRoughnessFactor(e[1]*s.getRoughnessFactor()),s.setMetallicFactor(e[2]*s.getMetallicFactor()),!0;case"normalTexture":return us(cs(Tt(),e,[.5,.5,1,1]))<=gt}return r.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 Dr(s,e=pt,t=pt){let r,i,n;if(s instanceof de){const a=s.getGraph();r=Qe.fromGraph(a),i=s,n=Pt(e)}else r=s,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)}(r,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]=kr(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}: ${Ar(d,E)} vertices.`);const x=T.getCount(),N=ce(x,p.length);for(let v=0;vn-xe[a]),i=Math.max(...r);return t.tolerance*i}function Vt(s,e,t,r,i){s.getElement(e,xe),s.getElement(t,Me);for(let n=0,a=s.getElementSize();nr)return!1;return!0}const it=[0,-1,1];function Gr(s,e){const t=[],r=[0,0,0];for(const i of it)for(const n of it)for(const a of it)r[0]=s[0]+i*e,r[1]=s[1]+n*e,r[2]=s[2]+a*e,t.push(dt(r,e));return t}function dt(s,e){return Math.round(s[0]/e)+":"+Math.round(s[1]/e)+":"+Math.round(s[2]/e)}function Pt(s){const e=me({},pt,s);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 zr(s,e,t=new Set){var r;const i=s.getAttribute("POSITION"),n=((r=s.getIndices())==null?void 0:r.getArray())||ce(i.getCount());i&&Ft(e,i,n,new Set(t));const a=s.getAttribute("NORMAL");a&&Lt(e,a,n,new Set(t));const c=s.getAttribute("TANGENT");c&&jt(e,c,n,new Set(t));for(const v of s.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()||Dr(v,{tolerance:0});const w=v.getIndices();for(let R=0,O=w.getCount();Ra.propertyType===M.MESH&&a!==s)){const a=n.clone();s.swap(n,a);for(const c of a.listTargets()){const o=c.clone();a.swap(c,o)}}if(!t){const n=new Set([...s.listPrimitives(),...s.listPrimitives().flatMap(c=>c.listTargets())]),a=new Map;for(const c of s.listPrimitives())for(const o of wr(c))o.listParents().some(g=>(g instanceof de||g instanceof es)&&!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 s.listPrimitives()){const a=n.getAttribute("POSITION");let c;r?c=r:i.has(a)?c=i.get(a):i.set(a,c=new Set),zr(n,e,c)}}const Bt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function gn(s){const e=s.getMesh(),t=s.getMatrix();e&&!B.eq(t,Bt)&&$r(e,t);for(const r of s.listChildren()){const i=r.getMatrix();xr(i,i,t),r.setMatrix(i)}return s.setMatrix(Bt)}const at="flatten",Ut={};function pn(s=Ut){return me({},Ut,s),as(at,async e=>{const t=e.getRoot(),r=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)||Ir(g)});n.size&&r.debug(`${at}: Flattening node hierarchies with TRS animation not yet supported.`),await e.transform(Fr({propertyTypes:[M.NODE],keepLeaves:!1})),r.debug(`${at}: Complete.`)})}Ke.TargetPath;const qr={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0};me({level:"high"},qr);var Dt;function Ee(s,e,t){for(let r=0,i=t.length;rt)return!1;return!0}function Wr(s,e,t){return s*(1-t)+e*t}function Yr(s,e,t,r){for(let i=0;i1e-6?(i=Math.acos(n),a=Math.sin(i),c=Math.sin((1-r)*i)/a,o=Math.sin(r*i)/a):(c=1-r,o=r),s[0]=c*g+o*y,s[1]=c*m+o*A,s[2]=c*T+o*I,s[3]=c*p+o*l,s}function Gt(s,e){const t=function(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]+r[3]*i[3]}(s,e);return Math.acos(2*t*t-1)}(function(s){s[s.STEP=0]="STEP",s[s.LERP=1]="LERP",s[s.SLERP=2]="SLERP"})(Dt||(Dt={}));Promise.resolve();var Xe;(function(s){s.LANCZOS3="lanczos3",s.LANCZOS2="lanczos2"})(Xe||(Xe={}));Xe.LANCZOS3;Xe.LANCZOS3;const Y="EXT_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 fs extends rs{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=[];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 r=t.getExtension(Y);if(!r)return;const i=r.getIndices();e.addAccessorToUsageGroup(i,te.BufferViewUsage.ELEMENT_ARRAY_BUFFER);const n=r.getMergeIndices(),a=r.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(r=>{const i=r.getExtension(Y);if(!i)return;const n=e.meshIndexMap.get(r),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=r;return r+=X[u].components,h})),n=s.getExtension("EXT_manifold");let a=[],c=[];const o=[0],g=[],m=[],T=[];if(n!=null){const u=t[0].getAttribute("POSITION").getCount(),h=e.map(x=>X[x].type==null);a=new Array(r*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);gs(a,S,r,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/r;a=[...a,...Xr(u,r,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:r,triVerts:y,vertProperties:p,runIndex:A,mergeFromVert:I,mergeToVert:l},runProperties:T}}function yn(s,e,t){s.getRoot().listBuffers().length===0&&s.createBuffer();const r=s.getRoot().listBuffers()[0],i=s.createExtension(fs),n=s.createMesh(),a=[],c=[],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_manifold",A);const I=s.createAccessor("manifold indices").setBuffer(r).setType(C.Type.SCALAR).setArray(e.triVerts);A.setIndices(I),A.setRunIndex(a);const l=[...Array(e.numVert).keys()],b=[],u=[];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=s.createAccessor("merge from").setBuffer(r).setType(C.Type.SCALAR).setArray(new Uint32Array(b)),f=s.createAccessor("merge to").setBuffer(r).setType(C.Type.SCALAR).setArray(new Uint32Array(u));A.setMerge(h,f)}return n}function En(s){if(!s)return;const e=s.listPrimitives();for(const r of e){r.getIndices()?.dispose();for(const i of r.listAttributes())i.dispose()}const t=s.getExtension("EXT_manifold");t&&(t.getIndices()?.dispose(),t.getMergeIndices()?.dispose(),t.getMergeValues()?.dispose()),s.dispose()}function gs(s,e,t,r){const i=e.getArray(),n=e.getElementSize(),a=e.getCount();for(let c=0;c{if(!t.extensions||!t.extensions[Me])return;const r=t.extensions[Me],o=this.createInstancedMesh();for(const s in r.attributes)o.setAttribute(s,e.accessors[r.attributes[s]]);e.nodes[n].setExtension(Me,o)}),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 o=e.nodeIndexMap.get(n),s=t.json.nodes[o],a={attributes:{}};r.listSemantics().forEach(f=>{const d=r.getAttribute(f);a.attributes[f]=e.accessorIndexMap.get(d)}),s.extensions=s.extensions||{},s.extensions[Me]=a}}),this}};function Re(){return Re=Object.assign?Object.assign.bind():function(i){for(var e=1;e8?8:4,s.componentType=o>8?En:vi,s.normalized=!0,a=i.getElementSize()===3?function(f){const d=new Float32Array(4*f.length/3);for(let p=0,m=f.length/3;pNt(f,i.getComponentType())),s.max=s.max.map(f=>Nt(f,i.getComponentType()))),s.normalized&&(s.min=s.min.map(f=>In(f,s.componentType)),s.max=s.max.map(f=>In(f,s.componentType)))}else s.byteStride%4&&(s.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(),o=n.getAttributes().key||"",s=n.getParent().propertyType===j.PRIMITIVE_TARGET;if(r==="indices")return{filter:Q.NONE};if(r==="attributes"){if(o==="POSITION")return{filter:Q.NONE};if(o==="TEXCOORD_0")return{filter:Q.NONE};if(o.startsWith("JOINTS_"))return{filter:Q.NONE};if(o.startsWith("WEIGHTS_"))return{filter:Q.NONE};if(o==="NORMAL"||o==="TANGENT")return s?{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 o=n.extensions[fe],s=o.byteOffset||0,a=o.byteLength||0,f=o.count,d=o.byteStride,p=new Uint8Array(f*d),m=t.json.buffers[o.buffer],w=Te.toView(m.uri?t.resources[m.uri]:t.resources[er],s,a);this._decoder.decodeGltfBuffer(p,f,d,w,o.mode,o.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,o=this.document.createBuffer(),s=this.document.getRoot().listBuffers().indexOf(o);this._encoderFallbackBuffer=o,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=Ai(a,f),p=r.method===at.FILTER?Si(a,this.document):{filter:Q.NONE},m=Ni(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:s,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],o=this._encoderBufferViewData[n],s=this.document.getRoot().listBuffers()[r.extensions[fe].buffer],a=e.otherBufferViews.get(s)||[],{count:f,byteStride:d,mode:p}=r.extensions[fe],m=Te.concat(o),w=t.encodeGltfBuffer(m,f,d,p),b=Te.pad(w);r.extensions[fe].byteLength=w.byteLength,o.length=0,o.push(b),a.push(b),e.otherBufferViews.set(s,a)}}write(e){let t=0;for(const s in this._encoderBufferViews){const a=this._encoderBufferViews[s],f=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[s][0]),d=this._encoderBufferViewAccessors[s];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),o=e.jsonDoc.json.buffers[r];return o.byteLength=t,o.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(o=>{o.source===r&&(o.extensions=o.extensions||{},o.extensions[rt]={source:o.source},delete o.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 o=12;for(;o>6)]}o+=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(o=>{o.source===r&&(o.extensions=o.extensions||{},o.extensions[it]={source:o.source},delete o.source)})}}),this}};or.EXTENSION_NAME=it;const Nn=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(`[${Nn}] Unknown geometry type.`);const n=new re.Mesh;if(!i.DecodeBufferToMesh(t,n).ok()||n.ptr===0)throw new Error(`[${Nn}] 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 o=t*Uint16Array.BYTES_PER_ELEMENT;n=re._malloc(o),i.GetTrianglesUInt16Array(e,o,n),r=new Uint16Array(re.HEAPU16.buffer,n,t).slice()}else{const o=t*Uint32Array.BYTES_PER_ELEMENT;n=re._malloc(o),i.GetTrianglesUInt32Array(e,o,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],o=ar[n.componentType],s=t.num_components(),a=e.num_points()*s,f=a*o.BYTES_PER_ELEMENT,d=re._malloc(f);i.GetAttributeDataArrayForAllPoints(e,t,r,f,d);const p=new o(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},An={decodeSpeed:5,encodeSpeed:5,method:ct.EDGEBREAKER,quantizationBits:ur,quantizationVolume:"mesh"};function Oi(i,e=An){const t=Re({},An,e);t.quantizationBits=Re({},ur,e.quantizationBits);const n=new xe.MeshBuilder,r=new xe.Mesh,o=new xe.ExpertEncoder(r),s={},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(s[_]=x,t.quantizationVolume==="mesh"||_!=="POSITION")o.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]);o.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()),o.SetSpeedOptions(t.encodeSpeed,t.decodeSpeed),o.SetTrackEncodedProperties(!0),o.SetEncodingMethod(t.method===ct.SEQUENTIAL||f||d?xe.MESH_SEQUENTIAL_ENCODING:xe.MESH_EDGEBREAKER_ENCODING);const m=o.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),o=new Map;let s="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?n.warn(`[${Y}]: quantizationVolume=scene requires exactly 1 scene.`):s=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(o.has(f)){o.set(f,o.get(f));continue}const d=a.getIndices(),p=e.jsonDoc.json.accessors;let m;try{m=Oi(a,Re({},this._encoderOptions,{quantizationVolume:s}))}catch(l){if(l instanceof Ft){n.warn(`[${Y}]: ${l.message} Skipping primitive compression.`);continue}throw l}o.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:o},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 o=0;or!==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 o,s;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),((o=r.spot)==null?void 0:o.innerConeAngle)!==void 0&&a.setInnerConeAngle(r.spot.innerConeAngle),((s=r.spot)==null?void 0:s.outerConeAngle)!==void 0&&a.setOuterConeAngle(r.spot.outerConeAngle),a});return t.json.nodes.forEach((r,o)=>{r.extensions&&r.extensions[we]&&e.nodes[o].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 o of this.properties){const s=o,a={type:s.getType()};ut.eq(s.getColor(),[1,1,1])||(a.color=s.getColor()),s.getIntensity()!==1&&(a.intensity=s.getIntensity()),s.getRange()!=null&&(a.range=s.getRange()),s.getName()&&(a.name=s.getName()),s.getType()===Tt.Type.SPOT&&(a.spot={innerConeAngle:s.getInnerConeAngle(),outerConeAngle:s.getOuterConeAngle()}),n.push(a),r.set(s,n.length-1)}return this.document.getRoot().listNodes().forEach(o=>{const s=o.getExtension(we);if(s){const a=e.nodeIndexMap.get(o),f=t.json.nodes[a];f.extensions=f.extensions||{},f.extensions[we]={light:r.get(s)}}}),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,o)=>{if(r.extensions&&r.extensions[ke]){const s=this.createAnisotropy();e.materials[o].setExtension(ke,s);const a=r.extensions[ke];if(a.anisotropyStrength!==void 0&&s.setAnisotropyStrength(a.anisotropyStrength),a.anisotropyRotation!==void 0&&s.setAnisotropyRotation(a.anisotropyRotation),a.anisotropyTexture!==void 0){const f=a.anisotropyTexture;s.setAnisotropyTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getAnisotropyTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(ke);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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,o)=>{if(r.extensions&&r.extensions[Ce]){const s=this.createClearcoat();e.materials[o].setExtension(Ce,s);const a=r.extensions[Ce];if(a.clearcoatFactor!==void 0&&s.setClearcoatFactor(a.clearcoatFactor),a.clearcoatRoughnessFactor!==void 0&&s.setClearcoatRoughnessFactor(a.clearcoatRoughnessFactor),a.clearcoatTexture!==void 0){const f=a.clearcoatTexture;s.setClearcoatTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getClearcoatTextureInfo(),f)}if(a.clearcoatRoughnessTexture!==void 0){const f=a.clearcoatRoughnessTexture;s.setClearcoatRoughnessTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getClearcoatRoughnessTextureInfo(),f)}if(a.clearcoatNormalTexture!==void 0){const f=a.clearcoatNormalTexture;s.setClearcoatNormalTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getClearcoatNormalTextureInfo(),f),f.scale!==void 0&&s.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 o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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 o=t.extensions[Ue];o.emissiveStrength!==void 0&&r.setEmissiveStrength(o.emissiveStrength)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Ue);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{},s.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 o=t.extensions[Oe];o.ior!==void 0&&r.setIOR(o.ior)}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Oe);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{},s.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,o)=>{if(r.extensions&&r.extensions[Fe]){const s=this.createIridescence();e.materials[o].setExtension(Fe,s);const a=r.extensions[Fe];if(a.iridescenceFactor!==void 0&&s.setIridescenceFactor(a.iridescenceFactor),a.iridescenceIor!==void 0&&s.setIridescenceIOR(a.iridescenceIor),a.iridescenceThicknessMinimum!==void 0&&s.setIridescenceThicknessMinimum(a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&s.setIridescenceThicknessMaximum(a.iridescenceThicknessMaximum),a.iridescenceTexture!==void 0){const f=a.iridescenceTexture;s.setIridescenceTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getIridescenceTextureInfo(),f)}if(a.iridescenceThicknessTexture!==void 0){const f=a.iridescenceThicknessTexture;s.setIridescenceThicknessTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getIridescenceThicknessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Fe);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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,o)=>{if(r.extensions&&r.extensions[Be]){const s=this.createPBRSpecularGlossiness();e.materials[o].setExtension(Be,s);const a=r.extensions[Be];if(a.diffuseFactor!==void 0&&s.setDiffuseFactor(a.diffuseFactor),a.specularFactor!==void 0&&s.setSpecularFactor(a.specularFactor),a.glossinessFactor!==void 0&&s.setGlossinessFactor(a.glossinessFactor),a.diffuseTexture!==void 0){const f=a.diffuseTexture;s.setDiffuseTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getDiffuseTextureInfo(),f)}if(a.specularGlossinessTexture!==void 0){const f=a.specularGlossinessTexture;s.setSpecularGlossinessTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getSpecularGlossinessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Be);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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,o)=>{if(r.extensions&&r.extensions[Le]){const s=this.createSheen();e.materials[o].setExtension(Le,s);const a=r.extensions[Le];if(a.sheenColorFactor!==void 0&&s.setSheenColorFactor(a.sheenColorFactor),a.sheenRoughnessFactor!==void 0&&s.setSheenRoughnessFactor(a.sheenRoughnessFactor),a.sheenColorTexture!==void 0){const f=a.sheenColorTexture;s.setSheenColorTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getSheenColorTextureInfo(),f)}if(a.sheenRoughnessTexture!==void 0){const f=a.sheenRoughnessTexture;s.setSheenRoughnessTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getSheenRoughnessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Le);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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 Nr 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,o)=>{if(r.extensions&&r.extensions[je]){const s=this.createSpecular();e.materials[o].setExtension(je,s);const a=r.extensions[je];if(a.specularFactor!==void 0&&s.setSpecularFactor(a.specularFactor),a.specularColorFactor!==void 0&&s.setSpecularColorFactor(a.specularColorFactor),a.specularTexture!==void 0){const f=a.specularTexture;s.setSpecularTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getSpecularTextureInfo(),f)}if(a.specularColorTexture!==void 0){const f=a.specularColorTexture;s.setSpecularColorTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getSpecularColorTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(je);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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}}Nr.EXTENSION_NAME=je;const{R:Qi}=De;class Ar 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})}}Ar.EXTENSION_NAME=cn;const ze=cn;class Sr extends Z{constructor(...e){super(...e),this.extensionName=ze}createTransmission(){return new Ar(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.textures||[];return(t.json.materials||[]).forEach((r,o)=>{if(r.extensions&&r.extensions[ze]){const s=this.createTransmission();e.materials[o].setExtension(ze,s);const a=r.extensions[ze];if(a.transmissionFactor!==void 0&&s.setTransmissionFactor(a.transmissionFactor),a.transmissionTexture!==void 0){const f=a.transmissionTexture;s.setTransmissionTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getTransmissionTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(ze);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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),o=t.json.materials[r];o.extensions=o.extensions||{},o.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,o)=>{const s=e.meshes[o];(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)}s.listPrimitives()[f].setExtension(be,d)})}),this}write(e){const t=e.jsonDoc,n=this.listVariants();if(!n.length)return this;const r=[],o=new Map;for(const s of n)o.set(s,r.length),r.push(e.createPropertyDef(s));for(const s of this.document.getRoot().listMeshes()){const a=e.meshIndexMap.get(s);s.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=>o.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,o)=>{if(r.extensions&&r.extensions[Pe]){const s=this.createVolume();e.materials[o].setExtension(Pe,s);const a=r.extensions[Pe];if(a.thicknessFactor!==void 0&&s.setThicknessFactor(a.thicknessFactor),a.attenuationDistance!==void 0&&s.setAttenuationDistance(a.attenuationDistance),a.attenuationColor!==void 0&&s.setAttenuationColor(a.attenuationColor),a.thicknessTexture!==void 0){const f=a.thicknessTexture;s.setThicknessTexture(e.textures[n[f.index].source]),e.setTextureInfo(s.getThicknessTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const r=n.getExtension(Pe);if(r){const o=e.materialIndexMap.get(n),s=t.json.materials[o];s.extensions=s.extensions||{};const a=s.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 o=0;o{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(o=>{o.source===r&&(o.extensions=o.extensions||{},o.extensions[st]={source:o.source},delete o.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(),o=n.extensions[Ge];o.offset!==void 0&&r.setOffset(o.offset),o.rotation!==void 0&&r.setRotation(o.rotation),o.scale!==void 0&&r.setScale(o.scale),o.texCoord!==void 0&&r.setTexCoord(o.texCoord),t.setExtension(Ge,r)}return this}write(e){const t=Array.from(e.textureInfoDefMap.entries());for(const[n,r]of t){const o=n.getExtension(Ge);if(!o)continue;r.extensions=r.extensions||{};const s={},a=ut.eq;a(o.getOffset(),[0,0])||(s.offset=o.getOffset()),o.getRotation()!==0&&(s.rotation=o.getRotation()),a(o.getScale(),[1,1])||(s.scale=o.getScale()),o.getTexCoord()!=null&&(s.texCoord=o.getTexCoord()),r.extensions[Ge]=s}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":At(this.get("context"))},At(this.get("properties")))}fromJSONLD(e){const t=(e=At(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 At(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,o=this.document.getRoot(),s=n.packets.map(d=>this.createPacket().fromJSONLD(d)),a=[[r.asset],r.scenes,r.nodes,r.meshes,r.materials,r.images,r.animations],f=[[o],o.listScenes(),o.listNodes(),o.listMeshes(),o.listMaterials(),o.listTextures(),o.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,Nr,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,o,s=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(s,n);o=f;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(s,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,s[2*o]=s[2*n]+s[2*r],t.depth[o]=Math.max(t.depth[n],t.depth[r])+1,s[2*n+1]=s[2*r+1]=o,t.heap[1]=o++,t.pqdownheap(s,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[_]++,_))}(s,i.max_code,t.bl_count)}}function ce(i,e,t,n,r){var o=this;o.static_tree=i,o.extra_bits=e,o.extra_base=t,o.elems=n,o.max_length=r}function ye(i,e,t,n,r){var o=this;o.good_length=i,o.max_lazy=e,o.nice_length=t,o.max_chain=n,o.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],o=i[2*t];return r>>8&255)}function ue(D,A){var k,M=A;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,A){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&A,ne++,D===0?B[2*A]++:(ie++,D--,B[2*(q._length_code[A]+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,A,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,A)}function Ne(D){(function(A,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&&A!=-1?yn(A,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,A,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 A=65535&p[--k],p[k]=A>=r?A-r:0;while(--D!=0);k=D=r;do A=65535&d[--k],d[k]=A>=r?A-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 A,k,M=N,S=h,L=T,G=h>r-262?h-(r-262):0,V=C,X=s,J=h+258,ee=a[S+L-1],Ae=a[S+L];T>=I&&(M>>=2),V>y&&(V=y);do if(a[(A=D)+L]==Ae&&a[A+L-1]==ee&&a[A]==a[S]&&a[++A]==a[S+1]){S+=2,A++;do;while(a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&a[++S]==a[++A]&&SL){if(E=D,L=k,k>=V)break;ee=a[S+L-1],Ae=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,A){for(var k=P.heap,M=k[A],S=A<<1;S<=P.heap_len&&(S9||M!=8||k<9||k>15||A<0||A>9||L<0||L>2?-2:(D.dstate=P,s=(r=1<<(o=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[A].func&&D.total_in!==0&&(M=D.deflate(1)),R!=A&&(O=me[R=A].max_lazy,I=me[R].good_length,C=me[R].nice_length,N=me[R].max_chain),v=k,M)},P.deflateSetDictionary=function(D,A,k){var M,S=k,L=0;if(!A||e!=42)return-2;if(S<3)return 0;for(S>r-262&&(L=k-(S=r-262)),a.set(A.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&s]=p[m=(m<<_^255&a[M+2])&l],p[m]=M;return 0},P.deflate=function(D,A){var k,M,S,L,G,V;if(A>4||A<0)return-2;if(!D.next_out||!D.next_in&&D.avail_in!==0||e==666&&A!=4)return D.msg=lt[4],-2;if(D.avail_out===0)return D.msg=lt[7],-5;if(i=D,L=n,n=A,e==42&&(M=8+(o-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&&A<=L&&A!=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||A!=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,Ne(!1),i.avail_out===0)||h-c>=r-262&&(Ne(!1),i.avail_out===0))return 0}return Ne(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(A);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&s]=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&s]=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&&(Ne(!1),i.avail_out===0))return 0}return Ne(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(A);break;case 2:G=function(X){for(var J,ee,Ae=0;;){if(y<262){if(vt(),y<262&&X==0)return 0;if(y===0)break}if(y>=3&&(Ae=65535&p[m=(m<<_^255&a[h+2])&l],d[h&s]=p[m],p[m]=h),T=u,x=E,u=2,Ae!==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&&(Ae=65535&p[m=(m<<_^255&a[h+2])&l],d[h&s]=p[m],p[m]=h);while(--T!=0);if(g=0,u=2,h++,J&&(Ne(!1),i.avail_out===0))return 0}else if(g!==0){if((J=et(0,255&a[h-1]))&&Ne(!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),Ne(X==4),i.avail_out===0?X==4?2:0:X==4?3:1}(A)}if(G!=2&&G!=3||(e=666),G==0||G==2)return i.avail_out===0&&(n=-1),0;if(G==1){if(A==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),A==3)for(k=0;k0&&e.next_in_index!=d&&(s(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 o,s,a=[],f=0,d=0;do{if(e.next_out_index=0,e.avail_out=t,(o=e.deflate(4))!=1&&o!=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(),s=new Uint8Array(d),a.forEach(function(p){s.set(p,f),f+=p.length}),s}}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,o;function s(f,d,p,m,w,b,l,_,c,u,x){var g,h,E,y,T,N,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],N=1;N<=15&&t[N]===0;N++);for(O=N,RT&&(R=T),_[0]=R,U=1<B+R;){if(y++,W=(W=E-(B+=R))>R?R:W,(h=1<<(N=O-B))>g+1&&(h-=g+1,z=O,N1440)return-3;r[y]=C=u[0],u[0]+=W,y!==0?(o[y]=T,n[0]=N,n[1]=R,n[2]=C-r[y-1]-(N=T>>>B-R),c.set(n,3*(r[y-1]+N))):l[0]=C}for(n[1]=O-B,I>=p?n[0]=192:x[I]>>B;N>>=1)T^=N;for(T^=N,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,o=0,s=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 N,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;N+=O[H+2],v=O[H=3*(R+(N+=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(N+=O[H+2],(v=O[H=3*(R+(N+=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,N,O,R=0,v=0,I=0;for(I=u.next_in_index,y=u.avail_in,R=c.bitb,v=c.bitk,N=(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,N=(T=c.write)>>=e[1+(h=3*(s+(R&pe[g])))],v-=e[h+1],(E=e[h])===0){f=e[h+2],i=6;break}if(16&E){d=15&E,o=e[h+2],i=2;break}if(!(64&E)){a=E,s=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,s=l,i=3;case 3:for(g=a;v>=e[1+(h=3*(s+(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,s=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(;o!==0;){if(N===0&&(T==c.end&&c.read!==0&&(N=(T=0)7&&(v-=8,y++,I--),c.write=T,x=c.inflate_flush(u,x),N=(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 N=[],O=[],R=[[]],v=[[]];jt.inflate_trees_fixed(N,O,R,v),p.init(N[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,_);o=65535&u,u=x=0,r=o!==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,(o-=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+(s>>>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=s))+(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=s))+(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=s)),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++,o=255&t.read_byte(t.next_in_index++),((t.istate.method<<8)+o)%31!=0){t.istate.mode=13,t.msg="incorrect header check",t.istate.marker=5;break}if(!(32&o)){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 o=0,s=r;return t&&t.istate&&t.istate.mode==6?(s>=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 s=new Uint8Array(p),a.forEach(function(m){s.set(m,d),d+=m.length}),s}},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 o=new Blob([i],{type:"text/plain"});(e=new yt(o)).init(function(){t.size=e.size,n()},r)},t.readUint8Array=function(n,r,o,s){e.readUint8Array(n,r,o,s)}}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,o){var s,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(s=m;sa.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){o(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 o=new FileReader;o.onload=function(s){n(s.target.result)},o.onerror=r,o.readAsText(e,i)}}function Vt(i){var e=this,t="",n="";e.init=function(r){t+="data:"+(i||"")+";base64,",r()},e.writeUint8Array=function(r,o){var s,a=n.length,f=n;for(n="",s=0;s<3*Math.floor((a+r.length)/3)-a;s++)f+=String.fromCharCode(r[s]);for(;s2?t+=self.btoa(f):n=f,o()},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,o,s,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":s&&s(p+g.loaded,o);break;case"importScripts":case"newTask":case"echo":break;default:console.warn("zip.js:launchWorkerProcess: unknown message: ",g)}}function u(){(p=524288*b)<=o?t.readUint8Array(r+p,Math.min(524288,o-p),function(x){s&&s(p,o);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,o,s,a,f,d){var p,m=0,w=0,b=o==="input",l=o==="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&o;try{return new Date(1980+((65024&s)>>9),((480&s)>>5)-1,31&s,(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,o;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,o=document.createElement("a"),n=r.map(function(f){return o.href=f,o.href})}else(n=hs[i].slice(0))[0]=(K.workerScriptsPath||"")+n[0];var s=new Worker(n[0]);s.codecTime=s.crcTime=0,s.postMessage({type:"importScripts",scripts:n.slice(1)}),s.addEventListener("message",function f(d){var p=d.data;if(p.error)return s.terminate(),void t(p.error);p.type==="importScripts"&&(s.removeEventListener("message",f),s.removeEventListener("error",a),e(s))}),s.addEventListener("error",a)}else t(new Error("Either zip.workerScripts or zip.workerScriptsPath may be set, not both."));function a(f){s.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,o){var s=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)?o("CRC failed."):d.getData(function(g){p(g)})}function _(u){o(u||"Error while reading file data.")}function c(u){o(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,o),x=b.offset+30+b.filenameLength+b.extraFieldLength,d.init(function(){b.compressionMethod===0?zn(b._worker,s++,n,d,x,b.compressedSize,w,l,m,_,c):function(h,E,y,T,N,O,R,v,I,C,B){var z=R?"output":"none";K.useWebWorkers?Xt(h,{sn:E,codecClass:"_zipjs_Inflater",crcType:z},y,T,N,O,I,v,C,B):Wt(new Kr,y,T,N,O,z,I,v,C,B)}(b._worker,s++,n,d,x,b.compressedSize,w,l,m,_,c)},c)):o(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(){o(jn)})}n.size<22?o(nt):w(22,function(){w(Math.min(65558,n.size),function(){o(nt)})})})(function(m){var w,b;w=m.getUint32(16,!0),b=m.getUint16(8,!0),w<0||w>=n.size?o(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 o=r.map(function(s){return s.webkitGetAsEntry()}).filter(function(s){return s!==null});o.length>0&&(o[0].name.match(/\.zip$/)?this._loadZip(r[0].getAsFile()):this._loadNextEntry(new Map,o))}else n.length===1&&n[0].name.match(/\.zip$/)&&this._loadZip(n[0]),this._emit("drop",{files:new Map(n.map(function(s){return[s.name,s]}))});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(o){return r.set(o.webkitRelativePath||o.name,o)}),this._emit("drop",{files:r})}},e._loadNextEntry=function(t,n){var r=this,o=n.pop();if(o)if(o.isFile)o.file(function(a){t.set(o.fullPath,a),r._loadNextEntry(t,n)},function(){return console.error("Could not load file: %s",o.fullPath)});else if(o.isDirectory){var s=o.createReader();s.readEntries(function a(f){f.length?(n=n.concat(f),s.readEntries(a)):r._loadNextEntry(t,n)})}else console.warn("Unknown asset type: "+o.fullPath),this._loadNextEntry(t,n);else this._emit("drop",{files:t})},e._loadZip=function(t){var n=this,r=[],o=new Map,s=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,o.set(d.getFullname(),m),p()})}))};s.importBlob(t,function(){a(s.root),Promise.all(r).then(function(){n._emit("drop",{files:o,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=null,bt=null,_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=function(){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 o=ai(r);o.mesh.runOriginalID=[];const s=new Map,a=o.runProperties.length,f=Jn.reserveIDs(a);for(let p=0;p{if(N=Yo(N),N in Ft)return;Ft[N]=!0;const q=N.endsWith(".css"),Se=q?'[rel="stylesheet"]':"";if(!!Ue)for(let Q=fe.length-1;Q>=0;Q--){const I=fe[Q];if(I.href===N&&(!q||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${N}"]${Se}`))return;const Y=document.createElement("link");if(Y.rel=q?"stylesheet":No,q||(Y.as="script",Y.crossOrigin=""),Y.href=N,document.head.appendChild(Y),q)return new Promise((Q,I)=>{Y.addEventListener("load",Q),Y.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${N}`)))})})).then(()=>Ce()).catch(N=>{const q=new Event("vite:preloadError",{cancelable:!0});if(q.payload=N,window.dispatchEvent(q),!q.defaultPrevented)throw N})};var Xo=(()=>{var Pe=import.meta.url;return async function(Ce={}){var f=Ce,Ue,fe;f.ready=new Promise((e,r)=>{Ue=e,fe=r});var N=!1;f.setup=function(){if(N)return;N=!0;function e(c,l,h=p=>p){if(l)for(let p of l)c.push_back(h(p));return c}function r(c,l=h=>h){const h=[],p=c.size();for(let w=0;wh){const h=[],p=c.size();for(let w=0;we(new f.Vector_vec2,l,h=>h instanceof Array?{x:h[0],y:h[1]}:h))}function i(c){for(let l=0;lc.min[l]),max:["x","y"].map(l=>c.max[l])}},f.CrossSection.prototype.offset=function(c,l="Square",h=2,p=0){return this._Offset(c,d(l),h,p)},f.CrossSection.prototype.extrude=function(c,l=0,h=0,p=[1,1],w=!1){p=o([p]);const M=f._Extrude(this,c,l,h,p);return w?M.translate([0,0,-c/2]):M},f.CrossSection.prototype.revolve=function(c=0,l=360){return f._Revolve(this,c,l)},f.CrossSection.prototype.add=function(c){return this._add(m(c))},f.CrossSection.prototype.subtract=function(c){return this._subtract(m(c))},f.CrossSection.prototype.intersect=function(c){return this._intersect(m(c))},f.CrossSection.prototype.toPolygons=function(){const c=this._ToPolygons(),l=t(c);return c.delete(),l},f.Manifold.prototype.warp=function(c){const l=ze(function(w){const M=J(w,"float"),F=J(w+4,"float"),X=J(w+8,"float"),B=[M,F,X];c(B),_e(w,B[0],"float"),_e(w+4,B[1],"float"),_e(w+8,B[2],"float")},"vi"),h=this._Warp(l);Le(l);const p=h.status();if(p.value!==0)throw new f.ManifoldError(p.value);return h},f.Manifold.prototype.setProperties=function(c,l){const h=this.numProp(),p=ze(function(M,F,X){const B=[];for(let L=0;Lc.min[l]),max:["x","y","z"].map(l=>c.max[l])}};class g{constructor({numProp:l=3,triVerts:h=new Uint32Array,vertProperties:p=new Float32Array,mergeFromVert:w,mergeToVert:M,runIndex:F,runOriginalID:X,faceID:B,halfedgeTangent:be,runTransform:ke}={}){this.numProp=l,this.triVerts=h,this.vertProperties=p,this.mergeFromVert=w,this.mergeToVert=M,this.runIndex=F,this.runOriginalID=X,this.faceID=B,this.halfedgeTangent=be,this.runTransform=ke}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:l,mesh:h}=f._Merge(this);return Object.assign(this,{...h}),l}verts(l){return this.triVerts.subarray(3*l,3*(l+1))}position(l){return this.vertProperties.subarray(numProp*l,numProp*l+3)}extras(l){return this.vertProperties.subarray(numProp*l+3,numProp*(l+1))}tangent(l){return this.halfedgeTangent.subarray(4*l,4*(l+1))}transform(l){const h=new Array(16);for(const p of[0,1,2,3])for(const w of[0,1,2])h[4*p+w]=this.runTransform[12*l+3*p+w];return h[15]=1,h}}f.Mesh=g,f.Manifold.prototype.getMesh=function(c=[0,0,0]){return c instanceof Array&&(c={0:c[0],1:c[1],2:c[2]}),new g(this._GetMeshJS(c))},f.ManifoldError=function(l,...h){let p="Unknown error";switch(l){case f.status.NonFiniteVertex.value:p="Non-finite vertex";break;case f.status.NotManifold.value:p="Not manifold";break;case f.status.VertexOutOfBounds.value:p="Vertex index out of bounds";break;case f.status.PropertiesWrongLength.value:p="Properties have wrong length";break;case f.status.MissingPositionProperties.value:p="Less than three properties";break;case f.status.MergeVectorsDifferentLengths.value:p="Merge vectors have different lengths";break;case f.status.MergeIndexOutOfBounds.value:p="Merge index out of bounds";break;case f.status.TransformWrongLength.value:p="Transform vector has wrong length";break;case f.status.RunIndexWrongLength.value:p="Run index vector has wrong length";break;case f.status.FaceIDWrongLength.value:p="Face ID vector has wrong length";case f.status.InvalidConstruction.value:p="Manifold constructed with invalid parameters"}const w=Error.apply(this,[p,...h]);w.name=this.name="ManifoldError",this.message=w.message,this.stack=w.stack,this.code=l},f.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:f.ManifoldError,writable:!0,configurable:!0}}),f.CrossSection=function(c,l="Positive"){const h=n(c),p=new v(h,u(l));return i(h),p},f.CrossSection.ofPolygons=function(c,l="Positive"){return new f.CrossSection(c,l)},f.CrossSection.square=function(...c){let l;c.length==0?l={x:1,y:1}:typeof c[0]=="number"?l={x:c[0],y:c[0]}:l=o(c);const h=c[1]||!1;return f._Square(l,h)},f.CrossSection.circle=function(c,l=0){return f._Circle(c,l)};function y(c){return function(...l){l.length==1&&(l=l[0]);const h=new f.Vector_crossSection;for(const w of l)h.push_back(m(w));const p=f["_crossSection"+c](h);return h.delete(),p}}f.CrossSection.compose=y("Compose"),f.CrossSection.union=y("UnionN"),f.CrossSection.difference=y("DifferenceN"),f.CrossSection.intersection=y("IntersectionN");function _(c,l){e(c,l,h=>h instanceof Array?{x:h[0],y:h[1]}:h)}f.CrossSection.hull=function(...c){c.length==1&&(c=c[0]);let l=new f.Vector_vec2;for(const p of c)if(p instanceof v)f._crossSectionCollectVertices(l,p);else if(p instanceof Array&&p.length==2&&typeof p[0]=="number")l.push_back({x:p[0],y:p[1]});else if(p.x)l.push_back(p);else{const M=p[0].length==2&&typeof p[0][0]=="number"||p[0].x?[p]:p;for(const F of M)_(l,F)}const h=f._crossSectionHullPoints(l);return l.delete(),h},f.CrossSection.prototype=Object.create(v.prototype),Object.defineProperty(f.CrossSection,Symbol.hasInstance,{get:()=>c=>c instanceof v});const E=f.Manifold;f.Manifold=function(c){const l=new E(c),h=l.status();if(h.value!==0)throw new f.ManifoldError(h.value);return l},f.Manifold.ofMesh=function(c){return new f.Manifold(c)},f.Manifold.tetrahedron=function(){return f._Tetrahedron()},f.Manifold.cube=function(...c){let l;c.length==0?l={x:1,y:1,z:1}:typeof c[0]=="number"?l={x:c[0],y:c[0],z:c[0]}:l=s(c);const h=c[1]||!1;return f._Cube(l,h)},f.Manifold.cylinder=function(c,l,h=-1,p=0,w=!1){return f._Cylinder(c,l,h,p,w)},f.Manifold.sphere=function(c,l=0){return f._Sphere(c,l)},f.Manifold.smooth=function(c,l=[]){const h=new f.Vector_smoothness;e(h,l);const p=f._Smooth(c,h);return h.delete(),p},f.Manifold.extrude=function(c,l,h=0,p=0,w=[1,1],M=!1){return(c instanceof v?c:f.CrossSection(c,"Positive")).extrude(l,h,p,w,M)},f.Manifold.revolve=function(c,l=0,h=360){return(c instanceof v?c:f.CrossSection(c,"Positive")).revolve(l,h)},f.Manifold.reserveIDs=function(c){return f._ReserveIDs(c)},f.Manifold.compose=function(c){const l=new f.Vector_manifold;e(l,c);const h=f._manifoldCompose(l);return l.delete(),h};function A(c){return function(...l){l.length==1&&(l=l[0]);const h=new f.Vector_manifold;for(const w of l)h.push_back(w);const p=f["_manifold"+c+"N"](h);return h.delete(),p}}f.Manifold.union=A("Union"),f.Manifold.difference=A("Difference"),f.Manifold.intersection=A("Intersection"),f.Manifold.levelSet=function(c,l,h,p=0){const w={min:{x:l.min[0],y:l.min[1],z:l.min[2]},max:{x:l.max[0],y:l.max[1],z:l.max[2]}},M=ze(function(X){const B=J(X,"float"),be=J(X+4,"float"),ke=J(X+8,"float");return c([B,be,ke])},"fi"),F=f._LevelSet(M,w,h,p);return Le(M),F};function R(c,l){e(c,l,h=>h instanceof Array?{x:h[0],y:h[1],z:h[2]}:h)}f.Manifold.hull=function(...c){c.length==1&&(c=c[0]);let l=new f.Vector_vec3;for(const p of c)p instanceof E?f._manifoldCollectVertices(l,p):p instanceof Array&&p.length==3&&typeof p[0]=="number"?l.push_back({x:p[0],y:p[1],z:p[2]}):p.x?l.push_back(p):R(l,p);const h=f._manifoldHullPoints(l);return l.delete(),h},f.Manifold.prototype=Object.create(E.prototype),Object.defineProperty(f.Manifold,Symbol.hasInstance,{get:()=>c=>c instanceof E}),f.triangulate=function(c,l=-1){const h=n(c),p=r(f._Triangulate(h,l),w=>[w[0],w[1],w[2]]);return i(h),p}};var q=Object.assign({},f),Se="./this.program",dr=typeof window=="object",Y=typeof importScripts=="function",Q=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",I="";function $t(e){return f.locateFile?f.locateFile(e,I):I+e}var Te,Fe,Ve;if(Q){const{createRequire:e}=await qo(()=>import("./__vite-browser-external.js"),[]);var He=e(import.meta.url),vr=He("fs"),hr=He("path");Y?I=hr.dirname(I)+"/":I=He("url").fileURLToPath(new URL("./",self.location)),Te=(r,t)=>(r=Ge(r)?new URL(r):hr.normalize(r),vr.readFileSync(r,t?void 0:"utf8")),Ve=r=>{var t=Te(r,!0);return t.buffer||(t=new Uint8Array(t)),t},Fe=(r,t,n,i=!0)=>{r=Ge(r)?new URL(r):hr.normalize(r),vr.readFile(r,i?void 0:"utf8",(o,s)=>{o?n(o):t(i?s.buffer:s)})},!f.thisProgram&&process.argv.length>1&&(Se=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),f.inspect=()=>"[Emscripten Module object]"}else(dr||Y)&&(Y?I=self.location.href:typeof document<"u"&&document.currentScript&&(I=document.currentScript.src),Pe&&(I=Pe),I.indexOf("blob:")!==0?I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1):I="",Te=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},Y&&(Ve=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Fe=(e,r,t)=>{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)});var pr=f.print||console.log.bind(console),ae=f.printErr||console.error.bind(console);Object.assign(f,q),q=null,f.arguments&&f.arguments,f.thisProgram&&(Se=f.thisProgram),f.quit&&f.quit;var $e;f.wasmBinary&&($e=f.wasmBinary),f.noExitRuntime,typeof WebAssembly!="object"&&K("no native wasm support detected");var Be,zr=!1;function At(e,r){e||K(r)}var W,H,se,Ae,T,$,Ne,Ye;function Lr(){var e=Be.buffer;f.HEAP8=W=new Int8Array(e),f.HEAP16=se=new Int16Array(e),f.HEAPU8=H=new Uint8Array(e),f.HEAPU16=Ae=new Uint16Array(e),f.HEAP32=T=new Int32Array(e),f.HEAPU32=$=new Uint32Array(e),f.HEAPF32=Ne=new Float32Array(e),f.HEAPF64=Ye=new Float64Array(e)}var ce,Ir=[],Ur=[],Vr=[];function Dt(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)xt(f.preRun.shift());yr(Ir)}function Mt(){!f.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,yr(Ur)}function Rt(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)Ot(f.postRun.shift());yr(Vr)}function xt(e){Ir.unshift(e)}function jt(e){Ur.unshift(e)}function Ot(e){Vr.unshift(e)}var de=0,De=null;function Go(e){return e}function mr(e){de++,f.monitorRunDependencies&&f.monitorRunDependencies(de)}function qe(e){if(de--,f.monitorRunDependencies&&f.monitorRunDependencies(de),de==0&&De){var r=De;De=null,r()}}function K(e){f.onAbort&&f.onAbort(e),e="Aborted("+e+")",ae(e),zr=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw fe(r),r}var Wt="data:application/octet-stream;base64,";function Hr(e){return e.startsWith(Wt)}function Ge(e){return e.startsWith("file://")}var ve;f.locateFile?(ve="manifold.wasm",Hr(ve)||(ve=$t(ve))):ve=new URL("/assets/manifold.wasm",self.location).href;function Br(e){if(e==ve&&$e)return new Uint8Array($e);if(Ve)return Ve(e);throw"both async and sync fetching of the wasm failed"}function zt(e){if(!$e&&(dr||Y)){if(typeof fetch=="function"&&!Ge(e))return fetch(e,{credentials:"same-origin"}).then(r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(()=>Br(e));if(Fe)return new Promise((r,t)=>{Fe(e,n=>r(new Uint8Array(n)),t)})}return Promise.resolve().then(()=>Br(e))}function Nr(e,r,t){return zt(e).then(n=>WebAssembly.instantiate(n,r)).then(n=>n).then(t,n=>{ae(`failed to asynchronously prepare wasm: ${n}`),K(n)})}function Lt(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Hr(r)&&!Ge(r)&&!Q&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(i=>{var o=WebAssembly.instantiateStreaming(i,t);return o.then(n,function(s){return ae(`wasm streaming compile failed: ${s}`),ae("falling back to ArrayBuffer instantiation"),Nr(r,t,n)})}):Nr(r,t,n)}function It(){var e={a:ro};function r(n,i){var o=n.exports;return O=o,Be=O.Ma,Lr(),ce=O.Oa,jt(O.Na),qe(),o}mr();function t(n){r(n.instance)}if(f.instantiateWasm)try{return f.instantiateWasm(e,r)}catch(n){ae(`Module.instantiateWasm callback failed with error: ${n}`),fe(n)}return Lt($e,ve,e,t).catch(fe),{}}var D,U,yr=e=>{for(;e.length>0;)e.shift()(f)};function J(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return W[e>>0];case"i8":return W[e>>0];case"i16":return se[e>>1];case"i32":return T[e>>2];case"i64":K("to do getValue(i64) use WASM_BIGINT");case"float":return Ne[e>>2];case"double":return Ye[e>>3];case"*":return $[e>>2];default:K(`invalid type for getValue: ${r}`)}}function _e(e,r,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":W[e>>0]=r;break;case"i8":W[e>>0]=r;break;case"i16":se[e>>1]=r;break;case"i32":T[e>>2]=r;break;case"i64":K("to do setValue(i64) use WASM_BIGINT");case"float":Ne[e>>2]=r;break;case"double":Ye[e>>3]=r;break;case"*":$[e>>2]=r;break;default:K(`invalid type for setValue: ${t}`)}}var Xe=[],Ke=0,Ut=e=>{var r=new _r(e);return r.get_caught()||(r.set_caught(!0),Ke--),r.set_rethrown(!1),Xe.push(r),_t(r.excPtr),r.get_exception_ptr()},te=0,Vt=()=>{b(0,0);var e=Xe.pop();yt(e.excPtr),te=0};function _r(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){$[this.ptr+4>>2]=r},this.get_type=function(){return $[this.ptr+4>>2]},this.set_destructor=function(r){$[this.ptr+8>>2]=r},this.get_destructor=function(){return $[this.ptr+8>>2]},this.set_caught=function(r){r=r?1:0,W[this.ptr+12>>0]=r},this.get_caught=function(){return W[this.ptr+12>>0]!=0},this.set_rethrown=function(r){r=r?1:0,W[this.ptr+13>>0]=r},this.get_rethrown=function(){return W[this.ptr+13>>0]!=0},this.init=function(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)},this.set_adjusted_ptr=function(r){$[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return $[this.ptr+16>>2]},this.get_exception_ptr=function(){var r=wt(this.get_type());if(r)return $[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Ht=e=>{throw te||(te=e),te},Yr=e=>{var r=te;if(!r)return Ie(0),0;var t=new _r(r);t.set_adjusted_ptr(r);var n=t.get_type();if(!n)return Ie(0),r;for(var i in e){var o=e[i];if(o===0||o===n)break;var s=t.ptr+16;if(gt(o,n,s))return Ie(o),r}return Ie(n),r},Bt=()=>Yr([]),Nt=e=>Yr([e]),Yt=()=>{var e=Xe.pop();e||K("no exception to throw");var r=e.excPtr;throw e.get_rethrown()||(Xe.push(e),e.set_rethrown(!0),e.set_caught(!1),Ke++),te=r,te},qt=(e,r,t)=>{var n=new _r(e);throw n.init(r,t),te=e,Ke++,te},Gt=()=>Ke,Je={},gr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function wr(e){return this.fromWireType(T[e>>2])}var ge={},he={},Ze={},qr=void 0,Qe=e=>{throw new qr(e)},pe=(e,r,t)=>{e.forEach(function(u){Ze[u]=r});function n(u){var d=t(u);d.length!==e.length&&Qe("Mismatched type converter count");for(var v=0;v{he.hasOwnProperty(u)?i[d]=he[u]:(o.push(u),ge.hasOwnProperty(u)||(ge[u]=[]),ge[u].push(()=>{i[d]=he[u],++s,s===o.length&&n(i)}))}),o.length===0&&n(i)},Xt=e=>{var r=Je[e];delete Je[e];var t=r.rawConstructor,n=r.rawDestructor,i=r.fields,o=i.map(s=>s.getterReturnType).concat(i.map(s=>s.setterArgumentType));pe([e],o,s=>{var u={};return i.forEach((d,v)=>{var m=d.fieldName,g=s[v],y=d.getter,_=d.getterContext,E=s[v+i.length],A=d.setter,R=d.setterContext;u[m]={read:c=>g.fromWireType(y(_,c)),write:(c,l)=>{var h=[];A(R,c,E.toWireType(h,l)),gr(h)}}}),[{name:r.name,fromWireType:d=>{var v={};for(var m in u)v[m]=u[m].read(d);return n(d),v},toWireType:(d,v)=>{for(var m in u)if(!(m in v))throw new TypeError(`Missing field: "${m}"`);var g=t();for(m in u)u[m].write(g,v[m]);return d!==null&&d.push(n,g),g},argPackAdvance:re,readValueFromPointer:wr,destructorFunction:n}]})},Kt=(e,r,t,n,i)=>{},Jt=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Gr=e},Gr=void 0,V=e=>{for(var r="",t=e;H[t];)r+=Gr[H[t++]];return r},we=void 0,x=e=>{throw new we(e)};function Zt(e,r,t={}){var n=r.name;if(e||x(`type "${n}" must have a positive integer typeid pointer`),he.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;x(`Cannot register type '${n}' twice`)}if(he[e]=r,delete Ze[e],ge.hasOwnProperty(e)){var i=ge[e];delete ge[e],i.forEach(o=>o())}}function ee(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Zt(e,r,t)}var re=8,Qt=(e,r,t,n)=>{r=V(r),ee(e,{name:r,fromWireType:function(i){return!!i},toWireType:function(i,o){return o?t:n},argPackAdvance:re,readValueFromPointer:function(i){return this.fromWireType(H[i])},destructorFunction:null})};function en(e){if(!(this instanceof ue)||!(e instanceof ue))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,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}var rn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Er=e=>{function r(t){return t.$$.ptrType.registeredClass.name}x(r(e)+" instance already deleted")},br=!1,Xr=e=>{},tn=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&&tn(e)},Jr=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=Jr(e,r,t.baseClass);return n===null?null:t.downcast(n)},Zr={},nn=()=>Object.keys(xe).length,on=()=>{var e=[];for(var r in xe)xe.hasOwnProperty(r)&&e.push(xe[r]);return e},Me=[],kr=()=>{for(;Me.length;){var e=Me.pop();e.$$.deleteScheduled=!1,e.delete()}},Re=void 0,an=e=>{Re=e,Me.length&&Re&&Re(kr)},sn=()=>{f.getInheritedInstanceCount=nn,f.getLiveInheritedInstances=on,f.flushPendingDeletes=kr,f.setDelayFunction=an},xe={},un=(e,r)=>{for(r===void 0&&x("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},ln=(e,r)=>(r=un(e,r),xe[r]),er=(e,r)=>{(!r.ptrType||!r.ptr)&&Qe("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Qe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},je(Object.create(e,{$$:{value:r}}))};function fn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=ln(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?er(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):er(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(r),s=Zr[o];if(!s)return i.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var d=Jr(r,this.registeredClass,u.registeredClass);return d===null?i.call(this):this.isSmartPointer?er(u.registeredClass.instancePrototype,{ptrType:u,ptr:d,smartPtrType:this,smartPtr:e}):er(u.registeredClass.instancePrototype,{ptrType:u,ptr:d})}var je=e=>typeof FinalizationRegistry>"u"?(je=r=>r,e):(br=new FinalizationRegistry(r=>{Kr(r.$$)}),je=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t};br.register(r,i,r)}return r},Xr=r=>br.unregister(r),je(e));function cn(){if(this.$$.ptr||Er(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=je(Object.create(Object.getPrototypeOf(this),{$$:{value:rn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function dn(){this.$$.ptr||Er(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&x("Object already scheduled for deletion"),Xr(this),Kr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function vn(){return!this.$$.ptr}function hn(){return this.$$.ptr||Er(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&x("Object already scheduled for deletion"),Me.push(this),Me.length===1&&Re&&Re(kr),this.$$.deleteScheduled=!0,this}var pn=()=>{ue.prototype.isAliasOf=en,ue.prototype.clone=cn,ue.prototype.delete=dn,ue.prototype.isDeleted=vn,ue.prototype.deleteLater=hn};function ue(){}var mn=48,yn=57,rr=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=mn&&r<=yn?`_${e}`:e};function tr(e,r){return e=rr(e),{[e]:function(){return r.apply(this,arguments)}}[e]}var Qr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||x(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},Pr=(e,r,t)=>{f.hasOwnProperty(e)?((t===void 0||f[e].overloadTable!==void 0&&f[e].overloadTable[t]!==void 0)&&x(`Cannot register public name '${e}' twice`),Qr(f,e,e),f.hasOwnProperty(t)&&x(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),f[e].overloadTable[t]=r):(f[e]=r,t!==void 0&&(f[e].numArguments=t))};function _n(e,r,t,n,i,o,s,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=i,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Cr=(e,r,t)=>{for(;r!==t;)r.upcast||x(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function gn(e,r){if(r===null)return this.isReference&&x(`null is not a valid ${this.name}`),0;r.$$||x(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||x(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Cr(r.$$.ptr,t,this.registeredClass);return n}function wn(e,r){var t;if(r===null)return this.isReference&&x(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;r.$$||x(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||x(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&x(`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=Cr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&x("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:x(`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,z.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:x("Unsupporting sharing policy")}return t}function En(e,r){if(r===null)return this.isReference&&x(`null is not a valid ${this.name}`),0;r.$$||x(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||x(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&x(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Cr(r.$$.ptr,t,this.registeredClass);return n}function et(e){return this.fromWireType($[e>>2])}function bn(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function kn(e){this.rawDestructor&&this.rawDestructor(e)}var Pn=e=>{e!==null&&e.delete()},Cn=()=>{ne.prototype.getPointee=bn,ne.prototype.destructor=kn,ne.prototype.argPackAdvance=re,ne.prototype.readValueFromPointer=et,ne.prototype.deleteObject=Pn,ne.prototype.fromWireType=fn};function ne(e,r,t,n,i,o,s,u,d,v,m){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=d,this.rawShare=v,this.rawDestructor=m,!i&&r.baseClass===void 0?n?(this.toWireType=gn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=wn}var rt=(e,r,t)=>{f.hasOwnProperty(e)||Qe("Replacing nonexistant public symbol"),f[e].overloadTable!==void 0&&t!==void 0?f[e].overloadTable[t]=r:(f[e]=r,f[e].argCount=t)},Sn=(e,r,t)=>{var n=f["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)},Oe=[],S=e=>{var r=Oe[e];return r||(e>=Oe.length&&(Oe.length=e+1),Oe[e]=r=ce.get(e)),r},Tn=(e,r,t)=>{if(e.includes("j"))return Sn(e,r,t);var n=S(r).apply(null,t);return n},Fn=(e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),Tn(e,r,t)}},Z=(e,r)=>{e=V(e);function t(){return e.includes("j")?Fn(e,r):S(r)}var n=t();return typeof n!="function"&&x(`unknown function pointer with signature ${e}: ${r}`),n},$n=(e,r)=>{var t=tr(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},tt=void 0,nt=e=>{var r=mt(e),t=V(r);return oe(r),t},nr=(e,r)=>{var t=[],n={};function i(o){if(!n[o]&&!he[o]){if(Ze[o]){Ze[o].forEach(i);return}t.push(o),n[o]=!0}}throw r.forEach(i),new tt(`${e}: `+t.map(nt).join([", "]))},An=(e,r,t,n,i,o,s,u,d,v,m,g,y)=>{m=V(m),o=Z(i,o),u&&(u=Z(s,u)),v&&(v=Z(d,v)),y=Z(g,y);var _=rr(m);Pr(_,function(){nr(`Cannot construct ${m} due to unbound types`,[n])}),pe([e,r,t],n?[n]:[],function(E){E=E[0];var A,R;n?(A=E.registeredClass,R=A.instancePrototype):R=ue.prototype;var c=tr(_,function(){if(Object.getPrototypeOf(this)!==l)throw new we("Use 'new' to construct "+m);if(h.constructor_body===void 0)throw new we(m+" has no accessible constructor");var F=h.constructor_body[arguments.length];if(F===void 0)throw new we(`Tried to invoke ctor of ${m} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.constructor_body).toString()}) parameters instead!`);return F.apply(this,arguments)}),l=Object.create(R,{constructor:{value:c}});c.prototype=l;var h=new _n(m,c,l,y,A,o,u,v);h.baseClass&&(h.baseClass.__derivedClasses===void 0&&(h.baseClass.__derivedClasses=[]),h.baseClass.__derivedClasses.push(h));var p=new ne(m,h,!0,!1,!1),w=new ne(m+"*",h,!1,!1,!1),M=new ne(m+" const*",h,!1,!0,!1);return Zr[e]={pointerType:w,constPointerType:M},rt(_,c),[p,w,M]})},Sr=(e,r)=>{for(var t=[],n=0;n>2]);return t};function it(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=tr(e.name||"unknownFunctionName",function(){});t.prototype=e.prototype;var n=new t,i=e.apply(n,r);return i instanceof Object?i:n}function Tr(e,r,t,n,i,o){var s=r.length;s<2&&x("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=r[1]!==null&&t!==null,d=!1,v=1;v0?", ":"")+y),_+=(m||o?"var rv = ":"")+"invoker(fn"+(y.length>0?", ":"")+y+`); +`,d)_+=`runDestructors(destructors); +`;else for(var v=u?1:2;v{var s=Sr(r,t);i=Z(n,i),pe([],[e],function(u){u=u[0];var d=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[r-1]!==void 0)throw new we(`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]=()=>{nr(`Cannot construct ${u.name} due to unbound types`,s)},pe([],s,v=>(v.splice(1,0,null),u.registeredClass.constructor_body[r-1]=Tr(d,v,null,i,o),[])),[]})},Mn=(e,r,t,n,i,o,s,u,d)=>{var v=Sr(t,n);r=V(r),o=Z(i,o),pe([],[e],function(m){m=m[0];var g=`${m.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),u&&m.registeredClass.pureVirtualFunctions.push(r);function y(){nr(`Cannot call ${g} due to unbound types`,v)}var _=m.registeredClass.instancePrototype,E=_[r];return E===void 0||E.overloadTable===void 0&&E.className!==m.name&&E.argCount===t-2?(y.argCount=t-2,y.className=m.name,_[r]=y):(Qr(_,r,g),_[r].overloadTable[t-2]=y),pe([],v,function(A){var R=Tr(g,A,m,o,s,d);return _[r].overloadTable===void 0?(R.argCount=t-2,_[r]=R):_[r].overloadTable[t-2]=R,[]}),[]})};function Rn(){Object.assign(ot.prototype,{get(e){return this.allocated[e]},has(e){return this.allocated[e]!==void 0},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}})}function ot(){this.allocated=[void 0],this.freelist=[]}var G=new ot,Fr=e=>{e>=G.reserved&&--G.get(e).refcount===0&&G.free(e)},xn=()=>{for(var e=0,r=G.reserved;r{G.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),G.reserved=G.allocated.length,f.count_emval_handles=xn},z={toValue:e=>(e||x("Cannot use deleted val. handle = "+e),G.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return G.allocate({refcount:1,value:e})}}},On=(e,r)=>{r=V(r),ee(e,{name:r,fromWireType:t=>{var n=z.toValue(t);return Fr(t),n},toWireType:(t,n)=>z.toHandle(n),argPackAdvance:re,readValueFromPointer:wr,destructorFunction:null})},Wn=(e,r,t)=>{switch(r){case 1:return t?function(n){return this.fromWireType(W[n>>0])}:function(n){return this.fromWireType(H[n>>0])};case 2:return t?function(n){return this.fromWireType(se[n>>1])}:function(n){return this.fromWireType(Ae[n>>1])};case 4:return t?function(n){return this.fromWireType(T[n>>2])}:function(n){return this.fromWireType($[n>>2])};default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},zn=(e,r,t,n)=>{r=V(r);function i(){}i.values={},ee(e,{name:r,constructor:i,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:re,readValueFromPointer:Wn(r,t,n),destructorFunction:null}),Pr(r,i)},ir=(e,r)=>{var t=he[e];return t===void 0&&x(r+" has unknown type "+nt(e)),t},Ln=(e,r,t)=>{var n=ir(e,"enum");r=V(r);var i=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:tr(`${n.name}_${r}`,function(){})}});i.values[t]=o,i[r]=o},$r=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},In=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Ne[t>>2])};case 8:return function(t){return this.fromWireType(Ye[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Un=(e,r,t)=>{r=V(r),ee(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:re,readValueFromPointer:In(r,t),destructorFunction:null})},Vn=(e,r,t,n,i,o,s)=>{var u=Sr(r,t);e=V(e),i=Z(n,i),Pr(e,function(){nr(`Cannot call ${e} due to unbound types`,u)},r-1),pe([],u,function(d){var v=[d[0],null].concat(d.slice(1));return rt(e,Tr(e,v,null,i,o,s),r-1),[]})},Hn=(e,r,t)=>{switch(r){case 1:return t?n=>W[n>>0]:n=>H[n>>0];case 2:return t?n=>se[n>>1]:n=>Ae[n>>1];case 4:return t?n=>T[n>>2]:n=>$[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Bn=(e,r,t,n,i)=>{r=V(r);var o=m=>m;if(n===0){var s=32-8*t;o=m=>m<>>s}var u=r.includes("unsigned"),d=(m,g)=>{},v;u?v=function(m,g){return d(g,this.name),g>>>0}:v=function(m,g){return d(g,this.name),g},ee(e,{name:r,fromWireType:o,toWireType:v,argPackAdvance:re,readValueFromPointer:Hn(r,t,n!==0),destructorFunction:null})},Nn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[r];function o(s){var u=$[s>>2],d=$[s+4>>2];return new i(W.buffer,d,u)}t=V(t),ee(e,{name:t,fromWireType:o,argPackAdvance:re,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ar=(e,r,t,n)=>{if(!(n>0))return 0;for(var i=t,o=t+n-1,s=0;s=55296&&u<=57343){var d=e.charCodeAt(++s);u=65536+((u&1023)<<10)|d&1023}if(u<=127){if(t>=o)break;r[t++]=u}else if(u<=2047){if(t+1>=o)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(u<=65535){if(t+2>=o)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=o)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},Yn=(e,r,t)=>Ar(e,H,r,t),Dr=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},at=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ee=(e,r,t)=>{for(var n=r+t,i=r;e[i]&&!(i>=n);)++i;if(i-r>16&&e.buffer&&at)return at.decode(e.subarray(r,i));for(var o="";r>10,56320|v&1023)}}return o},or=(e,r)=>e?Ee(H,e,r):"",qn=(e,r)=>{r=V(r);var t=r==="std::string";ee(e,{name:r,fromWireType:n=>{var i=$[n>>2],o=n+4,s;if(t)for(var u=o,d=0;d<=i;++d){var v=o+d;if(d==i||H[v]==0){var m=v-u,g=or(u,m);s===void 0?s=g:(s+=String.fromCharCode(0),s+=g),u=v+1}}else{for(var y=new Array(i),d=0;d{i instanceof ArrayBuffer&&(i=new Uint8Array(i));var o,s=typeof i=="string";s||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||x("Cannot pass non-string to std::string"),t&&s?o=Dr(i):o=i.length;var u=Wr(4+o+1),d=u+4;if($[u>>2]=o,t&&s)Yn(i,d,o+1);else if(s)for(var v=0;v255&&(oe(d),x("String has UTF-16 code units that do not fit in 8 bits")),H[d+v]=m}else for(var v=0;voe(n)})},st=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Gn=(e,r)=>{for(var t=e,n=t>>1,i=n+r/2;!(n>=i)&&Ae[n];)++n;if(t=n<<1,t-e>32&&st)return st.decode(H.subarray(e,t));for(var o="",s=0;!(s>=r/2);++s){var u=se[e+s*2>>1];if(u==0)break;o+=String.fromCharCode(u)}return o},Xn=(e,r,t)=>{if(t===void 0&&(t=2147483647),t<2)return 0;t-=2;for(var n=r,i=t>1]=s,r+=2}return se[r>>1]=0,r-n},Kn=e=>e.length*2,Jn=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var i=T[e+t*4>>2];if(i==0)break;if(++t,i>=65536){var o=i-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(i)}return n},Zn=(e,r,t)=>{if(t===void 0&&(t=2147483647),t<4)return 0;for(var n=r,i=n+t-4,o=0;o=55296&&s<=57343){var u=e.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023}if(T[r>>2]=s,r+=4,r+4>i)break}return T[r>>2]=0,r-n},Qn=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},ei=(e,r,t)=>{t=V(t);var n,i,o,s,u;r===2?(n=Gn,i=Xn,s=Kn,o=()=>Ae,u=1):r===4&&(n=Jn,i=Zn,s=Qn,o=()=>$,u=2),ee(e,{name:t,fromWireType:d=>{for(var v=$[d>>2],m=o(),g,y=d+4,_=0;_<=v;++_){var E=d+4+_*r;if(_==v||m[E>>u]==0){var A=E-y,R=n(y,A);g===void 0?g=R:(g+=String.fromCharCode(0),g+=R),y=E+r}}return oe(d),g},toWireType:(d,v)=>{typeof v!="string"&&x(`Cannot pass non-string to C++ string type ${t}`);var m=s(v),g=Wr(4+m+r);return $[g>>2]=m>>u,i(v,g+4,m+r),d!==null&&d.push(oe,g),g},argPackAdvance:re,readValueFromPointer:wr,destructorFunction:d=>oe(d)})},ri=(e,r,t,n,i,o)=>{Je[e]={name:V(r),rawConstructor:Z(t,n),rawDestructor:Z(i,o),fields:[]}},ti=(e,r,t,n,i,o,s,u,d,v)=>{Je[e].fields.push({fieldName:V(r),getterReturnType:t,getter:Z(n,i),getterContext:o,setterArgumentType:s,setter:Z(u,d),setterContext:v})},ni=(e,r)=>{r=V(r),ee(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},ii=(e,r,t)=>{e=z.toValue(e),r=ir(r,"emval::as");var n=[],i=z.toHandle(n);return $[t>>2]=i,r.toWireType(n,e)},oi=e=>{var r=[];return $[e>>2]=z.toHandle(r),r},ai={},Mr=e=>{var r=ai[e];return r===void 0?V(e):r},ar=[],si=(e,r,t,n,i)=>(e=ar[e],r=z.toValue(r),t=Mr(t),e(r,t,oi(n),i)),ui=(e,r,t,n)=>{e=ar[e],r=z.toValue(r),t=Mr(t),e(r,t,null,n)},li=(e,r)=>(e=z.toValue(e),r=z.toValue(r),e==r),fi=e=>{var r=ar.length;return ar.push(e),r},ci=(e,r)=>{for(var t=new Array(e),n=0;n>2],"parameter "+n);return t},ut=[],di=(e,r)=>{var t=ci(e,r),n=t[0],i=n.name+"_$"+t.slice(1).map(function(E){return E.name}).join("_")+"$",o=ut[i];if(o!==void 0)return o;for(var s=["retType"],u=[n],d="",v=0;v(e=z.toValue(e),r=z.toValue(r),z.toHandle(e[r])),hi=e=>{e>4&&(G.get(e).refcount+=1)},pi=e=>z.toHandle(Mr(e)),mi=()=>z.toHandle({}),yi=e=>{var r=z.toValue(e);gr(r),Fr(e)},_i=(e,r,t)=>{e=z.toValue(e),r=z.toValue(r),t=z.toValue(t),e[r]=t},gi=(e,r)=>{e=ir(e,"_emval_take_value");var t=e.readValueFromPointer(r);return z.toHandle(t)},wi=()=>{K("")},Ei=(e,r,t)=>H.copyWithin(e,r,r+t),bi=()=>2147483648,ki=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),Lr(),1}catch{}},Pi=e=>{var r=H.length;e>>>=0;var t=bi();if(e>t)return!1;for(var n=(d,v)=>d+(v-d%v)%v,i=1;i<=4;i*=2){var o=r*(1+.2/i);o=Math.min(o,e+100663296);var s=Math.min(t,n(Math.max(e,o),65536)),u=ki(s);if(u)return!0}return!1},Rr={},Ci=()=>Se||"./this.program",We=()=>{if(!We.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Ci()};for(var t in Rr)Rr[t]===void 0?delete r[t]:r[t]=Rr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);We.strings=n}return We.strings},Si=(e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);W[r>>0]=0},j={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=j.isAbs(e),t=e.substr(-1)==="/";return e=j.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=j.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=j.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return j.normalize(e.join("/"))},join2:(e,r)=>j.normalize(e+"/"+r)},Ti=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(Q)try{var e=He("crypto"),r=e.randomFillSync;if(r)return n=>e.randomFillSync(n);var t=e.randomBytes;return n=>(n.set(t(n.byteLength)),n)}catch{}K("initRandomDevice")},lt=e=>(lt=Ti())(e),ie={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:a.cwd();if(typeof n!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=j.isAbs(n)}return e=j.normalizeArray(e.split("/").filter(i=>!!i),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{e=ie.resolve(e).substr(1),r=ie.resolve(r).substr(1);function t(v){for(var m=0;m=0&&v[g]==="";g--);return m>g?[]:v.slice(m,g-m+1)}for(var n=t(e.split("/")),i=t(r.split("/")),o=Math.min(n.length,i.length),s=o,u=0;u0?t:Dr(e)+1,i=new Array(n),o=Ar(e,i,0,i.length);return r&&(i.length=o),i}var Fi=()=>{if(!xr.length){var e=null;if(Q){var r=256,t=Buffer.alloc(r),n=0,i=process.stdin.fd;try{n=vr.readSync(i,t)}catch(o){if(o.toString().includes("EOF"))n=0;else throw o}n>0?e=t.slice(0,n).toString("utf-8"):e=null}else typeof window<"u"&&typeof window.prompt=="function"?(e=window.prompt("Input: "),e!==null&&(e+=` +`)):typeof readline=="function"&&(e=readline(),e!==null&&(e+=` +`));if(!e)return null;xr=sr(e,!0)}return xr.shift()},me={ttys:[],init(){},shutdown(){},register(e,r){me.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,me.stream_ops)},stream_ops:{open(e){var r=me.ttys[e.node.rdev];if(!r)throw new a.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,i){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var o=0,s=0;s0&&(pr(Ee(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(ae(Ee(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(Ee(e.output,0)),e.output=[])}}},ft=e=>{K()},C={ops_table:null,mount(e){return C.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);C.ops_table||(C.ops_table={dir:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,lookup:C.node_ops.lookup,mknod:C.node_ops.mknod,rename:C.node_ops.rename,unlink:C.node_ops.unlink,rmdir:C.node_ops.rmdir,readdir:C.node_ops.readdir,symlink:C.node_ops.symlink},stream:{llseek:C.stream_ops.llseek}},file:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:{llseek:C.stream_ops.llseek,read:C.stream_ops.read,write:C.stream_ops.write,allocate:C.stream_ops.allocate,mmap:C.stream_ops.mmap,msync:C.stream_ops.msync}},link:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,readlink:C.node_ops.readlink},stream:{}},chrdev:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:a.chrdev_stream_ops}});var i=a.createNode(e,r,t,n);return a.isDir(i.mode)?(i.node_ops=C.ops_table.dir.node,i.stream_ops=C.ops_table.dir.stream,i.contents={}):a.isFile(i.mode)?(i.node_ops=C.ops_table.file.node,i.stream_ops=C.ops_table.file.stream,i.usedBytes=0,i.contents=null):a.isLink(i.mode)?(i.node_ops=C.ops_table.link.node,i.stream_ops=C.ops_table.link.stream):a.isChrdev(i.mode)&&(i.node_ops=C.ops_table.chrdev.node,i.stream_ops=C.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[r]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t>>0),t!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=a.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&C.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return C.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch{}if(n)for(var i in n.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=C.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,i){var o=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(s>8&&o.subarray)r.set(o.subarray(i,i+s),t);else for(var u=0;u0||t+r{var i=n?"":`al ${e}`;Fe(e,o=>{At(o,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(o)),i&&qe()},o=>{if(t)t();else throw`Loading data file "${e}" failed.`}),i&&mr()},Ai=f.preloadPlugins||[],Di=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var i=!1;return Ai.forEach(o=>{i||o.canHandle(r)&&(o.handle(e,r,t,n),i=!0)}),i},Mi=(e,r,t,n,i,o,s,u,d,v)=>{var m=r?ie.resolve(j.join2(e,r)):e;function g(y){function _(E){v&&v(),u||a.createDataFile(e,r,E,n,i,d),o&&o(),qe()}Di(y,m,_,()=>{s&&s(),qe()})||_(y)}mr(),typeof t=="string"?$i(t,y=>g(y),s):g(t)},Ri=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},jr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(e=ie.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(g=>!!g),i=a.root,o="/",s=0;s40)throw new a.ErrnoError(32)}}return{path:o,node:i}},getPath(e){for(var r;;){if(a.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t,e);for(var n=a.hashName(e.id,r),i=a.nameTable[n];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===r)return i}return a.lookup(e,r)},createNode(e,r,t,n){var i=new a.FSNode(e,r,t,n);return a.hashAddNode(i),i},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch{}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(o){return o.errno}var i=a.nodePermissions(e,"wx");if(i)return i;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return a.FSStream||(a.FSStream=function(){this.shared={}},a.FSStream.prototype={},Object.defineProperties(a.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},chrdev_stream_ops:{open(e){var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&ae(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function i(s){return a.syncFSRequests--,r(s)}function o(s){if(s)return o.errored?void 0:(o.errored=!0,i(s));++n>=t.length&&i(null)}t.forEach(s=>{if(!s.type.syncfs)return o(null);s.type.syncfs(s,e,o)})},mount(e,r,t){var n=t==="/",i=!t,o;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!i){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,o=s.node,a.isMountpoint(o))throw new a.ErrnoError(10);if(!a.isDir(o.mode))throw new a.ErrnoError(54)}var u={type:e,opts:r,mountpoint:t,mounts:[]},d=e.mount(u);return d.mount=u,u.root=d,n?a.root=d:o&&(o.mounted=u,o.mount&&o.mount.mounts.push(u)),d},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,i=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var u=a.nameTable[s];u;){var d=u.name_next;i.includes(u.mount)&&a.destroyNode(u),u=d}}),t.mounted=null;var o=t.mount.mounts.indexOf(n);t.mount.mounts.splice(o,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),i=n.node,o=j.basename(e);if(!o||o==="."||o==="..")throw new a.ErrnoError(28);var s=a.mayCreate(i,o);if(s)throw new a.ErrnoError(s);if(!i.node_ops.mknod)throw new a.ErrnoError(63);return i.node_ops.mknod(i,o,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",i=0;i"u"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!ie.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var i=j.basename(r),o=a.mayCreate(n,i);if(o)throw new a.ErrnoError(o);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,i,e)},rename(e,r){var t=j.dirname(e),n=j.dirname(r),i=j.basename(e),o=j.basename(r),s,u,d;if(s=a.lookupPath(e,{parent:!0}),u=s.node,s=a.lookupPath(r,{parent:!0}),d=s.node,!u||!d)throw new a.ErrnoError(44);if(u.mount!==d.mount)throw new a.ErrnoError(75);var v=a.lookupNode(u,i),m=ie.relative(e,n);if(m.charAt(0)!==".")throw new a.ErrnoError(28);if(m=ie.relative(r,t),m.charAt(0)!==".")throw new a.ErrnoError(55);var g;try{g=a.lookupNode(d,o)}catch{}if(v!==g){var y=a.isDir(v.mode),_=a.mayDelete(u,i,y);if(_)throw new a.ErrnoError(_);if(_=g?a.mayDelete(d,o,y):a.mayCreate(d,o),_)throw new a.ErrnoError(_);if(!u.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(v)||g&&a.isMountpoint(g))throw new a.ErrnoError(10);if(d!==u&&(_=a.nodePermissions(u,"w"),_))throw new a.ErrnoError(_);a.hashRemoveNode(v);try{u.node_ops.rename(v,d,o)}catch(E){throw E}finally{a.hashAddNode(v)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=j.basename(e),i=a.lookupNode(t,n),o=a.mayDelete(t,n,!0);if(o)throw new a.ErrnoError(o);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(i))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(i)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=j.basename(e),i=a.lookupNode(t,n),o=a.mayDelete(t,n,!1);if(o)throw new a.ErrnoError(o);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(i))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(i)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return ie.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!t});n=i.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var i;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!n});i=o.node}else i=e;if(!i.node_ops.setattr)throw new a.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var i=a.nodePermissions(t,"w");if(i)throw new a.ErrnoError(i);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),i=n.node;i.node_ops.setattr(i,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?Ri(r):r,t=typeof t>"u"?438:t,r&64?t=t&4095|32768:t=0;var n;if(typeof e=="object")n=e;else{e=j.normalize(e);try{var i=a.lookupPath(e,{follow:!(r&131072)});n=i.node}catch{}}var o=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),o=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!o){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!o&&a.truncate(n,0),r&=-131713;var u=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),f.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),u},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,i){if(n<0||i<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var o=typeof i<"u";if(!o)i=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,i);return o||(e.position+=s),s},write(e,r,t,n,i,o){if(n<0||i<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof i<"u";if(!s)i=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var u=e.stream_ops.write(e,r,t,n,i,o);return s||(e.position+=u),u},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,i){if(n&2&&!(i&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,i)},msync(e,r,t,n,i){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),i=a.stat(e),o=i.size,s=new Uint8Array(o);return a.read(n,s,0,o,0),r.encoding==="utf8"?t=Ee(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var i=new Uint8Array(Dr(r)+1),o=Ar(r,i,0,i.length);a.write(n,i,0,o,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,i,o,s,u)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),me.register(a.makedev(5,0),me.default_tty_ops),me.register(a.makedev(6,0),me.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=lt(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var i=+n,o=a.getStreamChecked(i),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){f.stdin?a.createDevice("/dev","stdin",f.stdin):a.symlink("/dev/tty","/dev/stdin"),f.stdout?a.createDevice("/dev","stdout",null,f.stdout):a.symlink("/dev/tty","/dev/stdout"),f.stderr?a.createDevice("/dev","stderr",null,f.stderr):a.symlink("/dev/tty1","/dev/stderr"),a.open("/dev/stdin",0),a.open("/dev/stdout",1),a.open("/dev/stderr",1)},ensureErrnoError(){a.ErrnoError||(a.ErrnoError=function(r,t){this.name="ErrnoError",this.node=t,this.setErrno=function(n){this.errno=n},this.setErrno(r),this.message="FS error"},a.ErrnoError.prototype=new Error,a.ErrnoError.prototype.constructor=a.ErrnoError,[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack=""}))},staticInit(){a.ensureErrnoError(),a.nameTable=new Array(4096),a.mount(C,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:C}},init(e,r,t){a.init.initialized=!0,a.ensureErrnoError(),f.stdin=e||f.stdin,f.stdout=r||f.stdout,f.stderr=t||f.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;ethis.length-1||_<0)){var E=_%this.chunkSize,A=_/this.chunkSize|0;return this.getter(A)[E]}},o.prototype.setDataGetter=function(_){this.getter=_},o.prototype.cacheLength=function(){var _=new XMLHttpRequest;if(_.open("HEAD",t,!1),_.send(null),!(_.status>=200&&_.status<300||_.status===304))throw new Error("Couldn't load "+t+". Status: "+_.status);var E=Number(_.getResponseHeader("Content-length")),A,R=(A=_.getResponseHeader("Accept-Ranges"))&&A==="bytes",c=(A=_.getResponseHeader("Content-Encoding"))&&A==="gzip",l=1024*1024;R||(l=E);var h=(w,M)=>{if(w>M)throw new Error("invalid range ("+w+", "+M+") or no bytes requested!");if(M>E-1)throw new Error("only "+E+" bytes available! programmer error!");var F=new XMLHttpRequest;if(F.open("GET",t,!1),E!==l&&F.setRequestHeader("Range","bytes="+w+"-"+M),F.responseType="arraybuffer",F.overrideMimeType&&F.overrideMimeType("text/plain; charset=x-user-defined"),F.send(null),!(F.status>=200&&F.status<300||F.status===304))throw new Error("Couldn't load "+t+". Status: "+F.status);return F.response!==void 0?new Uint8Array(F.response||[]):sr(F.responseText||"",!0)},p=this;p.setDataGetter(w=>{var M=w*l,F=(w+1)*l-1;if(F=Math.min(F,E-1),typeof p.chunks[w]>"u"&&(p.chunks[w]=h(M,F)),typeof p.chunks[w]>"u")throw new Error("doXHR failed!");return p.chunks[w]}),(c||!E)&&(l=E=1,E=this.getter(0).length,l=E,pr("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=E,this._chunkSize=l,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!Y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new o;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:s}}else var u={isDevice:!1,url:t};var d=a.createFile(e,r,u,n,i);u.contents?d.contents=u.contents:u.url&&(d.contents=null,d.url=u.url),Object.defineProperties(d,{usedBytes:{get:function(){return this.contents.length}}});var v={},m=Object.keys(d.stream_ops);m.forEach(y=>{var _=d.stream_ops[y];v[y]=function(){return a.forceLoadFile(d),_.apply(null,arguments)}});function g(y,_,E,A,R){var c=y.node.contents;if(R>=c.length)return 0;var l=Math.min(c.length-R,A);if(c.slice)for(var h=0;h(a.forceLoadFile(d),g(y,_,E,A,R)),v.mmap=(y,_,E,A,R)=>{a.forceLoadFile(d);var c=ft();if(!c)throw new a.ErrnoError(48);return g(y,W,c,_,E),{ptr:c,allocated:!0}},d.stream_ops=v,d}},le={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(j.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var i=le.getStreamFromFD(e);n=i.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return j.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(u){if(u&&u.node&&j.normalize(r)!==j.normalize(a.getPath(u.node)))return-54;throw u}T[t>>2]=n.dev,T[t+4>>2]=n.mode,$[t+8>>2]=n.nlink,T[t+12>>2]=n.uid,T[t+16>>2]=n.gid,T[t+20>>2]=n.rdev,U=[n.size>>>0,(D=n.size,+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[t+24>>2]=U[0],T[t+28>>2]=U[1],T[t+32>>2]=4096,T[t+36>>2]=n.blocks;var i=n.atime.getTime(),o=n.mtime.getTime(),s=n.ctime.getTime();return U=[Math.floor(i/1e3)>>>0,(D=Math.floor(i/1e3),+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[t+40>>2]=U[0],T[t+44>>2]=U[1],$[t+48>>2]=i%1e3*1e3,U=[Math.floor(o/1e3)>>>0,(D=Math.floor(o/1e3),+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[t+56>>2]=U[0],T[t+60>>2]=U[1],$[t+64>>2]=o%1e3*1e3,U=[Math.floor(s/1e3)>>>0,(D=Math.floor(s/1e3),+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[t+72>>2]=U[0],T[t+76>>2]=U[1],$[t+80>>2]=s%1e3*1e3,U=[n.ino>>>0,(D=n.ino,+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[t+88>>2]=U[0],T[t+92>>2]=U[1],0},doMsync(e,r,t,n,i){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var o=H.slice(e,e+t);a.msync(r,o,i,t,n)},varargs:void 0,get(){var e=T[le.varargs>>2];return le.varargs+=4,e},getp(){return le.get()},getStr(e){var r=or(e);return r},getStreamFromFD(e){var r=a.getStreamChecked(e);return r}},xi=(e,r)=>{var t=0;return We().forEach((n,i)=>{var o=r+t;$[e+i*4>>2]=o,Si(n,o),t+=n.length+1}),0},ji=(e,r)=>{var t=We();$[e>>2]=t.length;var n=0;return t.forEach(i=>n+=i.length+1),$[r>>2]=n,0};function Oi(e){try{var r=le.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var Wi=(e,r,t,n)=>{for(var i=0,o=0;o>2],u=$[r+4>>2];r+=8;var d=a.read(e,W,s,u,n);if(d<0)return-1;if(i+=d,d>2]=o,0}catch(s){if(typeof a>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Li=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Ii(e,r,t,n,i){var o=Li(r,t);try{if(isNaN(o))return 61;var s=le.getStreamFromFD(e);return a.llseek(s,o,n),U=[s.position>>>0,(D=s.position,+Math.abs(D)>=1?D>0?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)],T[i>>2]=U[0],T[i+4>>2]=U[1],s.getdents&&o===0&&n===0&&(s.getdents=null),0}catch(u){if(typeof a>"u"||u.name!=="ErrnoError")throw u;return u.errno}}var Ui=(e,r,t,n)=>{for(var i=0,o=0;o>2],u=$[r+4>>2];r+=8;var d=a.write(e,W,s,u,n);if(d<0)return-1;i+=d,typeof n<"u"&&(n+=d)}return i};function Vi(e,r,t,n){try{var i=le.getStreamFromFD(e),o=Ui(i,r,t);return $[n>>2]=o,0}catch(s){if(typeof a>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Hi=e=>e,ur=e=>e%4===0&&(e%100!==0||e%400===0),Bi=(e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t},ct=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31],Ni=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=ur(t.getFullYear()),i=t.getMonth(),o=(n?ct:dt)[i];if(r>o-t.getDate())r-=o-t.getDate()+1,t.setDate(1),i<11?t.setMonth(i+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else return t.setDate(t.getDate()+r),t}return t},Yi=(e,r)=>{W.set(e,r)},qi=(e,r,t,n)=>{var i=$[n+40>>2],o={tm_sec:T[n>>2],tm_min:T[n+4>>2],tm_hour:T[n+8>>2],tm_mday:T[n+12>>2],tm_mon:T[n+16>>2],tm_year:T[n+20>>2],tm_wday:T[n+24>>2],tm_yday:T[n+28>>2],tm_isdst:T[n+32>>2],tm_gmtoff:T[n+36>>2],tm_zone:i?or(i):""},s=or(t),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in u)s=s.replace(new RegExp(d,"g"),u[d]);var v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function g(l,h,p){for(var w=typeof l=="number"?l.toString():l||"";w.length0?1:0}var w;return(w=p(l.getFullYear()-h.getFullYear()))===0&&(w=p(l.getMonth()-h.getMonth()))===0&&(w=p(l.getDate()-h.getDate())),w}function E(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function A(l){var h=Ni(new Date(l.tm_year+1900,0,1),l.tm_yday),p=new Date(h.getFullYear(),0,4),w=new Date(h.getFullYear()+1,0,4),M=E(p),F=E(w);return _(M,h)<=0?_(F,h)<=0?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var R={"%a":l=>v[l.tm_wday].substring(0,3),"%A":l=>v[l.tm_wday],"%b":l=>m[l.tm_mon].substring(0,3),"%B":l=>m[l.tm_mon],"%C":l=>{var h=l.tm_year+1900;return y(h/100|0,2)},"%d":l=>y(l.tm_mday,2),"%e":l=>g(l.tm_mday,2," "),"%g":l=>A(l).toString().substring(2),"%G":l=>A(l),"%H":l=>y(l.tm_hour,2),"%I":l=>{var h=l.tm_hour;return h==0?h=12:h>12&&(h-=12),y(h,2)},"%j":l=>y(l.tm_mday+Bi(ur(l.tm_year+1900)?ct:dt,l.tm_mon-1),3),"%m":l=>y(l.tm_mon+1,2),"%M":l=>y(l.tm_min,2),"%n":()=>` +`,"%p":l=>l.tm_hour>=0&&l.tm_hour<12?"AM":"PM","%S":l=>y(l.tm_sec,2),"%t":()=>" ","%u":l=>l.tm_wday||7,"%U":l=>{var h=l.tm_yday+7-l.tm_wday;return y(Math.floor(h/7),2)},"%V":l=>{var h=Math.floor((l.tm_yday+7-(l.tm_wday+6)%7)/7);if((l.tm_wday+371-l.tm_yday-2)%7<=2&&h++,h){if(h==53){var w=(l.tm_wday+371-l.tm_yday)%7;w!=4&&(w!=3||!ur(l.tm_year))&&(h=1)}}else{h=52;var p=(l.tm_wday+7-l.tm_yday-1)%7;(p==4||p==5&&ur(l.tm_year%400-1))&&h++}return y(h,2)},"%w":l=>l.tm_wday,"%W":l=>{var h=l.tm_yday+7-(l.tm_wday+6)%7;return y(Math.floor(h/7),2)},"%y":l=>(l.tm_year+1900).toString().substring(2),"%Y":l=>l.tm_year+1900,"%z":l=>{var h=l.tm_gmtoff,p=h>=0;return h=Math.abs(h)/60,h=h/60*100+h%60,(p?"+":"-")+("0000"+h).slice(-4)},"%Z":l=>l.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var d in R)s.includes(d)&&(s=s.replace(new RegExp(d,"g"),R[d](o)));s=s.replace(/\0\0/g,"%");var c=sr(s,!1);return c.length>r?0:(Yi(c,e),c.length-1)},Gi=(e,r,t,n,i)=>qi(e,r,t,n),vt=(e,r)=>{e<128?r.push(e):r.push(e%128|128,e>>7)},Xi=e=>{for(var r={i:"i32",j:"i64",f:"f32",d:"f64",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};r.push(96),vt(n.length,r);for(var o=0;o{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Xi(r),e);var t=[1];Ki(r,t);var n=[0,97,115,109,1,0,0,0,1];vt(t.length,n),n.push.apply(n,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)),o=new WebAssembly.Instance(i,{e:{f:e}}),s=o.exports.f;return s},Zi=(e,r)=>{if(ye)for(var t=e;t(ye||(ye=new WeakMap,Zi(0,ce.length)),ye.get(e)||0),Or=[],eo=()=>{if(Or.length)return Or.pop();try{ce.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return ce.length-1},ht=(e,r)=>{ce.set(e,r),Oe[e]=ce.get(e)},ze=(e,r)=>{var t=Qi(e);if(t)return t;var n=eo();try{ht(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var i=Ji(e,r);ht(n,i)}return ye.set(e,n),n},Le=e=>{ye.delete(S(e)),Or.push(e)};qr=f.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Jt(),we=f.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},pn(),sn(),Cn(),tt=f.UnboundTypeError=$n(Error,"UnboundTypeError"),Rn(),jn();var pt=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},lr=365,fr=146;Object.defineProperties(pt.prototype,{read:{get:function(){return(this.mode&lr)===lr},set:function(e){e?this.mode|=lr:this.mode&=~lr}},write:{get:function(){return(this.mode&fr)===fr},set:function(e){e?this.mode|=fr:this.mode&=~fr}},isFolder:{get:function(){return a.isDir(this.mode)}},isDevice:{get:function(){return a.isChrdev(this.mode)}}}),a.FSNode=pt,a.createPreloadedFile=Mi,a.staticInit();var ro={B:Ut,K:Vt,a:Bt,j:Nt,S:Yt,h:qt,na:Gt,d:Ht,Ca:Xt,ca:Kt,sa:Qt,x:An,w:Dn,i:Mn,ra:On,O:zn,t:Ln,U:Un,o:Vn,z:Bn,s:Nn,T:qn,M:ei,E:ri,Da:ti,ta:ni,Ia:ii,ya:si,Fa:ui,Ka:Fr,Ha:li,Aa:di,Ja:vi,Ga:hi,F:pi,$:mi,oa:yi,La:_i,y:gi,L:wi,qa:Ei,pa:Pi,ja:xi,ka:ji,la:Oi,ma:zi,ba:Ii,R:Vi,H:so,A:io,W:$o,P:Oo,r:Co,c:ao,b:no,n:co,l:fo,N:_o,D:xo,Q:jo,J:Wo,aa:Bo,k:mo,f:oo,va:Ro,g:uo,G:Mo,V:Ao,wa:Do,u:yo,za:So,Ba:po,e:to,X:Fo,Ea:vo,m:lo,q:wo,xa:To,_:Eo,C:go,v:ko,Y:Po,p:ho,I:zo,Z:bo,ga:Io,da:Ho,ha:Lo,ea:Vo,fa:Uo,ua:Hi,ia:Gi},O=It(),oe=e=>(oe=O.Pa)(e),Wr=e=>(Wr=O.Qa)(e),mt=e=>(mt=O.Ra)(e);f.__embind_initialize_bindings=()=>(f.__embind_initialize_bindings=O.Sa)();var b=(e,r)=>(b=O.Ta)(e,r),Ie=e=>(Ie=O.Ua)(e),k=()=>(k=O.Va)(),P=e=>(P=O.Wa)(e),yt=e=>(yt=O.Xa)(e),_t=e=>(_t=O.Ya)(e),gt=(e,r,t)=>(gt=O.Za)(e,r,t),wt=e=>(wt=O._a)(e),Et=f.dynCall_viijii=(e,r,t,n,i,o,s)=>(Et=f.dynCall_viijii=O.$a)(e,r,t,n,i,o,s),bt=f.dynCall_viiij=(e,r,t,n,i,o)=>(bt=f.dynCall_viiij=O.ab)(e,r,t,n,i,o),kt=f.dynCall_vijiii=(e,r,t,n,i,o,s)=>(kt=f.dynCall_vijiii=O.bb)(e,r,t,n,i,o,s),Pt=f.dynCall_vijii=(e,r,t,n,i,o)=>(Pt=f.dynCall_vijii=O.cb)(e,r,t,n,i,o),Ct=f.dynCall_viiji=(e,r,t,n,i,o)=>(Ct=f.dynCall_viiji=O.db)(e,r,t,n,i,o);f.dynCall_jiji=(e,r,t,n,i)=>(f.dynCall_jiji=O.eb)(e,r,t,n,i);var St=f.dynCall_jiiii=(e,r,t,n,i)=>(St=f.dynCall_jiiii=O.fb)(e,r,t,n,i);f.dynCall_iiiiij=(e,r,t,n,i,o,s)=>(f.dynCall_iiiiij=O.gb)(e,r,t,n,i,o,s),f.dynCall_iiiiijj=(e,r,t,n,i,o,s,u,d)=>(f.dynCall_iiiiijj=O.hb)(e,r,t,n,i,o,s,u,d),f.dynCall_iiiiiijj=(e,r,t,n,i,o,s,u,d,v)=>(f.dynCall_iiiiiijj=O.ib)(e,r,t,n,i,o,s,u,d,v);function to(e,r,t,n){var i=k();try{S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function no(e,r,t){var n=k();try{return S(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function io(e,r,t,n,i,o){var s=k();try{return S(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function oo(e,r){var t=k();try{S(e)(r)}catch(n){if(P(t),n!==n+0)throw n;b(1,0)}}function ao(e,r){var t=k();try{return S(e)(r)}catch(n){if(P(t),n!==n+0)throw n;b(1,0)}}function so(e,r,t,n){var i=k();try{return S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function uo(e,r,t){var n=k();try{S(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function lo(e,r,t,n,i){var o=k();try{S(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function fo(e,r,t,n,i){var o=k();try{return S(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function co(e,r,t,n){var i=k();try{return S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function vo(e,r,t,n,i,o,s){var u=k();try{S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function ho(e,r,t,n,i,o,s,u,d,v,m){var g=k();try{S(e)(r,t,n,i,o,s,u,d,v,m)}catch(y){if(P(g),y!==y+0)throw y;b(1,0)}}function po(e,r,t,n,i,o,s){var u=k();try{S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function mo(e){var r=k();try{S(e)()}catch(t){if(P(r),t!==t+0)throw t;b(1,0)}}function yo(e,r,t,n){var i=k();try{S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function _o(e,r,t,n,i,o){var s=k();try{return S(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function go(e,r,t,n,i,o,s){var u=k();try{S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function wo(e,r,t,n,i,o){var s=k();try{S(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Eo(e,r,t,n,i,o,s){var u=k();try{S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function bo(e,r,t,n,i,o,s,u,d,v,m,g,y,_,E,A,R,c,l){var h=k();try{S(e)(r,t,n,i,o,s,u,d,v,m,g,y,_,E,A,R,c,l)}catch(p){if(P(h),p!==p+0)throw p;b(1,0)}}function ko(e,r,t,n,i,o,s,u){var d=k();try{S(e)(r,t,n,i,o,s,u)}catch(v){if(P(d),v!==v+0)throw v;b(1,0)}}function Po(e,r,t,n,i,o,s,u,d,v){var m=k();try{S(e)(r,t,n,i,o,s,u,d,v)}catch(g){if(P(m),g!==g+0)throw g;b(1,0)}}function Co(e){var r=k();try{return S(e)()}catch(t){if(P(r),t!==t+0)throw t;b(1,0)}}function So(e,r,t,n,i,o){var s=k();try{S(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function To(e,r,t,n,i,o,s){var u=k();try{S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Fo(e,r,t,n,i){var o=k();try{S(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function $o(e,r,t){var n=k();try{return S(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function Ao(e,r,t,n,i){var o=k();try{S(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function Do(e,r,t,n,i,o,s,u,d){var v=k();try{S(e)(r,t,n,i,o,s,u,d)}catch(m){if(P(v),m!==m+0)throw m;b(1,0)}}function Mo(e,r,t,n,i,o){var s=k();try{S(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Ro(e,r,t,n){var i=k();try{S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function xo(e,r,t,n,i,o,s){var u=k();try{return S(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function jo(e,r,t,n,i,o,s,u){var d=k();try{return S(e)(r,t,n,i,o,s,u)}catch(v){if(P(d),v!==v+0)throw v;b(1,0)}}function Oo(e,r,t,n){var i=k();try{return S(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function Wo(e,r,t,n,i,o,s,u,d,v,m,g){var y=k();try{return S(e)(r,t,n,i,o,s,u,d,v,m,g)}catch(_){if(P(y),_!==_+0)throw _;b(1,0)}}function zo(e,r,t,n,i,o,s,u,d,v,m,g,y,_,E,A){var R=k();try{S(e)(r,t,n,i,o,s,u,d,v,m,g,y,_,E,A)}catch(c){if(P(R),c!==c+0)throw c;b(1,0)}}function Lo(e,r,t,n,i,o,s){var u=k();try{Et(e,r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Io(e,r,t,n,i,o){var s=k();try{bt(e,r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Uo(e,r,t,n,i,o,s){var u=k();try{kt(e,r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Vo(e,r,t,n,i,o){var s=k();try{Pt(e,r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Ho(e,r,t,n,i,o){var s=k();try{Ct(e,r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Bo(e,r,t,n,i){var o=k();try{return St(e,r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}f.addFunction=ze,f.removeFunction=Le;var cr;De=function e(){cr||Tt(),cr||(De=e)};function Tt(){if(de>0||(Dt(),de>0))return;function e(){cr||(cr=!0,f.calledRun=!0,!zr&&(Mt(),Ue(f),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Rt()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),e()},1)):e()}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();return Tt(),Ce.ready}})();export{Xo as M}; diff --git a/assets/manifold.wasm b/assets/manifold.wasm new file mode 100644 index 000000000..b605a976a 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..22b1b762a --- /dev/null +++ b/assets/manifoldCAD.js @@ -0,0 +1,19 @@ +import"./modulepreload-polyfill.js";function Y(){return new Worker("/assets/worker-355a5c16.js",{type:"module"})}const g=self.examples.functionBodies;navigator.serviceWorker&&navigator.serviceWorker.register("/service-worker.js",{scope:"./index.html"});let l;const Z=document.querySelector("#file"),f=document.querySelector("#current"),j=document.querySelector("#file .uparrow"),R=document.querySelector("#fileDropdown"),F=document.querySelector("#save"),p=document.querySelector("#saveDropdown"),v=document.querySelector("#save .uparrow"),_=function(){R.classList.remove("show"),p.classList.remove("show"),j.classList.remove("down"),v.classList.remove("down")},ee=function(e){e.stopPropagation(),R.classList.toggle("show"),j.classList.toggle("down")},te=function(e){e.stopPropagation(),p.classList.toggle("show"),v.classList.toggle("down")};Z.onclick=ee;v.parentElement.onclick=te;document.body.onclick=_;const w="ManifoldCAD";function h(e){return window.localStorage.getItem(w+e)}function m(e,t){window.localStorage.setItem(w+e,t)}function A(e){window.localStorage.removeItem(w+e)}function ne(e){if(e>=window.localStorage.length)return;const t=window.localStorage.key(e);if(t.startsWith(w))return t.slice(w.length)}function S(){if(l){const e=f.textContent;g.get(e)||m(e,l.getValue())}}window.onpagehide=S;window.beforeunload=S;let x=!1,P=!0;function U(e){if(l){x=!0,f.textContent=e,m("currentName",e);const t=g.get(e)??h(e)??"";P=g.get(e)!=null,l.setValue(t)}}function k(e){const t=document.createElement("div");t.classList.add("item");const n=document.createElement("button");t.appendChild(n),n.type="button",n.classList.add("blue","item");const o=document.createElement("span");return n.appendChild(o),o.textContent=e,n.onclick=function(){S(),U(o.textContent)},n.onkeyup=function(c){c.preventDefault()},n}function B(e){const t=document.createElement("button");return t.classList.add("icon"),e.parentElement.appendChild(t),t}function $(e){let t=1,n=e;for(;h(n)!=null||g.get(n)!=null;)n=e+" "+t++;return n}function N(e){const t=e.firstChild,n=B(e);n.classList.add("edit"),n.onclick=function(d){d.stopPropagation();const s=t.textContent,Q=h(s),C=document.createElement("form"),u=document.createElement("input");u.value=s,t.textContent="",e.appendChild(C),C.appendChild(u),u.focus(),u.setSelectionRange(0,s.length);function X(){const y=u.value;if(u.blur(),!y)return;const b=$(y);t.textContent=b,f.textContent==s&&(f.textContent=b),A(s),m(b,Q)}C.onsubmit=X,u.onclick=function(y){y.stopPropagation()},u.onblur=function(){e.removeChild(C),t.textContent=s}};const o=B(e);o.classList.add("trash");let c=0;o.onclick=function(d){if(d.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){A(t.textContent),f.textContent==t.textContent&&U("Intro");const s=e.parentElement;s.parentElement.removeChild(s)}}}const q=document.querySelector("#new");function O(e){const t=$("New Script");m(t,e);const n=k(t);q.insertAdjacentElement("afterend",n.parentElement),N(n),n.click()}q.onclick=function(){O("")};const i=document.querySelector("#compile"),z=document.querySelector("#poster");let E=!1,V=!0;function H(){i.disabled=!1,V?i.click():z.textContent="Auto-run disabled due to prior failure"}let T;async function oe(){const e=await fetch("/manifold-global-types.d.ts").then(n=>n.text()),t=await fetch("/manifold-encapsulated-types.d.ts").then(n=>n.text());return` +${e.replaceAll("export","")} +${t.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; + setup: () => void; +} +declare const module: ManifoldToplevel; +`}async function le(){return`${(await fetch("/editor.d.ts").then(t=>t.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 oe()),monaco.languages.typescript.typescriptDefaults.addExtraLib(await le()),l=monaco.editor.create(document.getElementById("editor"),{language:"typescript",automaticLayout:!0}),T=await(await monaco.languages.typescript.getTypeScriptWorker())(l.getModel().uri),l.getModel().updateOptions({tabSize:2});for(const[n]of g){const o=k(n);R.appendChild(o.parentElement)}let t=f.textContent;for(let n=0;n{if(i.disabled=!1,x){x=!1;return}if(P){const o=l.getPosition();O(l.getValue()),l.setPosition(o)}}),window.onresize=()=>{l.layout({})}});const a=document.querySelector("#console"),ce=console.log;console.log=function(e){a.textContent+=e+`\r +`,a.scrollTop=a.scrollHeight,ce(e)};function re(){a.textContent=""}function ie(){i.firstChild.style.visibility="hidden",i.classList.add("red","cancel")}function se(){i.firstChild.style.visibility="visible",i.classList.remove("red","cancel")}let K=performance.now();function G(){se();const e=performance.now(),t=a.textContent;a.textContent=t.substring(t.indexOf(` +`)+1),console.log(`Took ${(Math.round((e-K)/10)/100).toLocaleString()} seconds`)}const W=document.querySelector("model-viewer"),r={glbURL:null,threeMFURL:null};let L=null;function D(){L=new Y,L.onmessage=function(e){if(e.data==null){T!=null&&!E&&H(),E=!0;return}if(e.data.log!=null){a.textContent+=e.data.log+`\r +`,a.scrollTop=a.scrollHeight;return}G(),i.disabled=!0,r.threeMFURL!=null&&(URL.revokeObjectURL(r.threeMFURL),r.threeMFURL=null),URL.revokeObjectURL(r.glbURL),r.glbURL=e.data.glbURL,r.threeMFURL=e.data.threeMFURL,M.disabled=r.threeMFURL==null,W.src=r.glbURL,r.glbURL==null?(W.showPoster(),z.textContent="Error",D()):m("safe","true")}}D();async function ae(){S(),m("safe","false"),ie(),re(),console.log("Running...");const e=await T.getEmitOutput(l.getModel().uri.toString());L.postMessage(e.outputFiles[0].text),K=performance.now()}function ue(){L.terminate(),D(),G(),console.log("Run canceled")}i.onclick=function(){i.classList.contains("cancel")?ue():ae()};function J(e,t,n){const o=e.parentElement;return()=>{const c=F.firstElementChild;c!==o&&(p.insertBefore(c,p.firstElementChild),F.insertBefore(o,p),o.appendChild(v.parentElement));const d=document.createElement("a");d.download=t,d.href=r[n],d.click()}}const I=document.querySelector("#glb");I.onclick=J(I,"manifold.glb","glbURL");const M=document.querySelector("#threemf");M.onclick=J(M,"manifold.3mf","threeMFURL"); diff --git a/assets/modelViewer.js b/assets/modelViewer.js new file mode 100644 index 000000000..77cf87449 --- /dev/null +++ b/assets/modelViewer.js @@ -0,0 +1 @@ +import"./modulepreload-polyfill.js";import{s as b,_ as I,j as y,M as L,k,r as v,g as B,w as D,z as O}from"./gltf-io.js";import{M as S}from"./manifold.js";const p=b(new I),t=new y,g=await S();g.setup();const{Manifold:l,Mesh:U}=g,f=new Map;async function w(e){const c=[],a=await p.read(e);await a.transform(L());const m=a.getRoot().listNodes(),r=[];for(const o of m){k(o);const s=v(o.getMesh());s.mesh.runOriginalID=[];const i=s.runProperties.length,u=l.reserveIDs(i);for(let n=0;no.dispose()),t.getRoot().listBuffers().forEach(o=>o.dispose()),t.getRoot().listAccessors().forEach(o=>o.dispose());for(const[o,s]of r.entries()){const i=t.getRoot().listMaterials()[R+o];f.get(s).material=i}return l.union(c)}const j=await w("/models/space.glb"),E=await w("/models/moon.glb"),h=t.createNode();t.createScene().addChild(h);function M(e){N(l[e](j,E))}document.querySelector("select").onchange=function(e){M(e.target.value)};M("difference");const q=document.querySelector("model-viewer");let d=null;const z=document.querySelector("#download");z.onclick=function(){const e=document.createElement("a");e.download="manifold.glb",e.href=d,e.click()};async function N(e){const c=e.rotate([-90,0,0]).getMesh();B(h.getMesh());const a=D(t,c,f);h.setMesh(a),await t.transform(O());const m=await p.writeBinary(t),r=new Blob([m],{type:"application/octet-stream"});URL.revokeObjectURL(d),d=URL.createObjectURL(r),q.src=d} diff --git a/assets/modulepreload-polyfill.js b/assets/modulepreload-polyfill.js new file mode 100644 index 000000000..3e0a78a5c --- /dev/null +++ b/assets/modulepreload-polyfill.js @@ -0,0 +1 @@ +(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)}})(); diff --git a/assets/three.js b/assets/three.js new file mode 100644 index 000000000..9add46ceb --- /dev/null +++ b/assets/three.js @@ -0,0 +1,3589 @@ +import"./modulepreload-polyfill.js";import{M as lo}from"./manifold.js";/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const Gr="158",co=0,ts=1,uo=2,Ea=1,ho=2,qt=3,cn=0,vt=1,Yt=2,an=0,Vn=1,ns=2,is=3,rs=4,fo=5,vn=100,po=101,mo=102,ss=103,as=104,_o=200,go=201,vo=202,xo=203,Cr=204,Lr=205,Mo=206,So=207,Eo=208,To=209,yo=210,Ao=211,bo=212,Ro=213,wo=214,Co=0,Lo=1,Po=2,Bi=3,Uo=4,Do=5,Io=6,No=7,Ta=0,Fo=1,Oo=2,on=0,Bo=1,zo=2,Go=3,Ho=4,Vo=5,ya=300,Wn=301,Xn=302,Pr=303,Ur=304,Wi=306,Dr=1e3,Nt=1001,Ir=1002,mt=1003,os=1004,Ji=1005,wt=1006,ko=1007,ri=1008,ln=1009,Wo=1010,Xo=1011,Hr=1012,Aa=1013,rn=1014,sn=1015,si=1016,ba=1017,Ra=1018,Mn=1020,qo=1021,Ft=1023,Yo=1024,Ko=1025,Sn=1026,qn=1027,jo=1028,wa=1029,Zo=1030,Ca=1031,La=1033,Qi=33776,er=33777,tr=33778,nr=33779,ls=35840,cs=35841,us=35842,hs=35843,$o=36196,fs=37492,ds=37496,ps=37808,ms=37809,_s=37810,gs=37811,vs=37812,xs=37813,Ms=37814,Ss=37815,Es=37816,Ts=37817,ys=37818,As=37819,bs=37820,Rs=37821,ir=36492,ws=36494,Cs=36495,Jo=36283,Ls=36284,Ps=36285,Us=36286,Pa=3e3,En=3001,Qo=3200,el=3201,Ua=0,tl=1,Lt="",st="srgb",Zt="srgb-linear",Vr="display-p3",Xi="display-p3-linear",zi="linear",qe="srgb",Gi="rec709",Hi="p3",An=7680,Ds=519,nl=512,il=513,rl=514,sl=515,al=516,ol=517,ll=518,cl=519,Is=35044,Ns="300 es",Nr=1035,Kt=2e3,Vi=2001;class Kn{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,o=r.length;s>8&255]+ct[i>>16&255]+ct[i>>24&255]+"-"+ct[e&255]+ct[e>>8&255]+"-"+ct[e>>16&15|64]+ct[e>>24&255]+"-"+ct[t&63|128]+ct[t>>8&255]+"-"+ct[t>>16&255]+ct[t>>24&255]+ct[n&255]+ct[n>>8&255]+ct[n>>16&255]+ct[n>>24&255]).toLowerCase()}function gt(i,e,t){return Math.max(e,Math.min(t,i))}function ul(i,e){return(i%e+e)%e}function sr(i,e,t){return(1-t)*i+t*e}function Fs(i){return(i&i-1)===0&&i!==0}function Or(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function $n(i,e){switch(e.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 _t(i,e){switch(e.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 Ge{constructor(e=0,t=0){Ge.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(gt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*r+e.x,this.y=s*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ie{constructor(e,t,n,r,s,o,a,l,c){Ie.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c)}set(e,t,n,r,s,o,a,l,c){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],d=n[7],f=n[2],m=n[5],x=n[8],S=r[0],p=r[3],u=r[6],E=r[1],_=r[4],A=r[7],b=r[2],w=r[5],R=r[8];return s[0]=o*S+a*E+l*b,s[3]=o*p+a*_+l*w,s[6]=o*u+a*A+l*R,s[1]=c*S+h*E+d*b,s[4]=c*p+h*_+d*w,s[7]=c*u+h*A+d*R,s[2]=f*S+m*E+x*b,s[5]=f*p+m*_+x*w,s[8]=f*u+m*A+x*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8];return t*o*h-t*a*c-n*s*h+n*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],d=h*o-a*c,f=a*l-h*s,m=c*s-o*l,x=t*d+n*f+r*m;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/x;return e[0]=d*S,e[1]=(r*c-h*n)*S,e[2]=(a*n-r*o)*S,e[3]=f*S,e[4]=(h*t-r*l)*S,e[5]=(r*s-a*t)*S,e[6]=m*S,e[7]=(n*l-c*t)*S,e[8]=(o*t-n*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ar.makeScale(e,t)),this}rotate(e){return this.premultiply(ar.makeRotation(-e)),this}translate(e,t){return this.premultiply(ar.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ar=new Ie;function Da(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function ki(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function hl(){const i=ki("canvas");return i.style.display="block",i}const Os={};function ii(i){i in Os||(Os[i]=!0,console.warn(i))}const Bs=new Ie().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),zs=new Ie().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),pi={[Zt]:{transfer:zi,primaries:Gi,toReference:i=>i,fromReference:i=>i},[st]:{transfer:qe,primaries:Gi,toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[Xi]:{transfer:zi,primaries:Hi,toReference:i=>i.applyMatrix3(zs),fromReference:i=>i.applyMatrix3(Bs)},[Vr]:{transfer:qe,primaries:Hi,toReference:i=>i.convertSRGBToLinear().applyMatrix3(zs),fromReference:i=>i.applyMatrix3(Bs).convertLinearToSRGB()}},fl=new Set([Zt,Xi]),Ve={enabled:!0,_workingColorSpace:Zt,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(i){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!i},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!fl.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,e,t){if(this.enabled===!1||e===t||!e||!t)return i;const n=pi[e].toReference,r=pi[t].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,e){return this.convert(i,this._workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this._workingColorSpace)},getPrimaries:function(i){return pi[i].primaries},getTransfer:function(i){return i===Lt?zi:pi[i].transfer}};function kn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function or(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let bn;class Ia{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{bn===void 0&&(bn=ki("canvas")),bn.width=e.width,bn.height=e.height;const n=bn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=bn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ki("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ya)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Dr:e.x=e.x-Math.floor(e.x);break;case Nt:e.x=e.x<0?0:1;break;case Ir:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Dr:e.y=e.y-Math.floor(e.y);break;case Nt:e.y=e.y<0?0:1;break;case Ir:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return ii("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===st?En:Pa}set encoding(e){ii("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===En?st:Lt}}yt.DEFAULT_IMAGE=null;yt.DEFAULT_MAPPING=ya;yt.DEFAULT_ANISOTROPY=1;class at{constructor(e=0,t=0,n=0,r=1){at.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],h=l[4],d=l[8],f=l[1],m=l[5],x=l[9],S=l[2],p=l[6],u=l[10];if(Math.abs(h-f)<.01&&Math.abs(d-S)<.01&&Math.abs(x-p)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+S)<.1&&Math.abs(x+p)<.1&&Math.abs(c+m+u-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(c+1)/2,A=(m+1)/2,b=(u+1)/2,w=(h+f)/4,R=(d+S)/4,N=(x+p)/4;return _>A&&_>b?_<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(_),r=w/n,s=R/n):A>b?A<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),n=w/r,s=N/r):b<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),n=R/s,r=N/s),this.set(n,r,s,t),this}let E=Math.sqrt((p-x)*(p-x)+(d-S)*(d-S)+(f-h)*(f-h));return Math.abs(E)<.001&&(E=1),this.x=(p-x)/E,this.y=(d-S)/E,this.z=(f-h)/E,this.w=Math.acos((c+m+u-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 ml extends Kn{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new at(0,0,e,t),this.scissorTest=!1,this.viewport=new at(0,0,e,t);const r={width:e,height:t,depth:1};n.encoding!==void 0&&(ii("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===En?st:Lt),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wt,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new yt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Na(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Tn extends ml{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Fa extends yt{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=mt,this.minFilter=mt,this.wrapR=Nt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class _l extends yt{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=mt,this.minFilter=mt,this.wrapR=Nt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class li{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,o,a){let l=n[r+0],c=n[r+1],h=n[r+2],d=n[r+3];const f=s[o+0],m=s[o+1],x=s[o+2],S=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d;return}if(a===1){e[t+0]=f,e[t+1]=m,e[t+2]=x,e[t+3]=S;return}if(d!==S||l!==f||c!==m||h!==x){let p=1-a;const u=l*f+c*m+h*x+d*S,E=u>=0?1:-1,_=1-u*u;if(_>Number.EPSILON){const b=Math.sqrt(_),w=Math.atan2(b,u*E);p=Math.sin(p*w)/b,a=Math.sin(a*w)/b}const A=a*E;if(l=l*p+f*A,c=c*p+m*A,h=h*p+x*A,d=d*p+S*A,p===1-a){const b=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=b,c*=b,h*=b,d*=b}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,s,o){const a=n[r],l=n[r+1],c=n[r+2],h=n[r+3],d=s[o],f=s[o+1],m=s[o+2],x=s[o+3];return e[t]=a*x+h*d+l*m-c*f,e[t+1]=l*x+h*f+c*d-a*m,e[t+2]=c*x+h*m+a*f-l*d,e[t+3]=h*x-a*d-l*f-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(r/2),d=a(s/2),f=l(n/2),m=l(r/2),x=l(s/2);switch(o){case"XYZ":this._x=f*h*d+c*m*x,this._y=c*m*d-f*h*x,this._z=c*h*x+f*m*d,this._w=c*h*d-f*m*x;break;case"YXZ":this._x=f*h*d+c*m*x,this._y=c*m*d-f*h*x,this._z=c*h*x-f*m*d,this._w=c*h*d+f*m*x;break;case"ZXY":this._x=f*h*d-c*m*x,this._y=c*m*d+f*h*x,this._z=c*h*x+f*m*d,this._w=c*h*d-f*m*x;break;case"ZYX":this._x=f*h*d-c*m*x,this._y=c*m*d+f*h*x,this._z=c*h*x-f*m*d,this._w=c*h*d+f*m*x;break;case"YZX":this._x=f*h*d+c*m*x,this._y=c*m*d+f*h*x,this._z=c*h*x-f*m*d,this._w=c*h*d-f*m*x;break;case"XZY":this._x=f*h*d-c*m*x,this._y=c*m*d-f*h*x,this._z=c*h*x+f*m*d,this._w=c*h*d+f*m*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],h=t[6],d=t[10],f=n+a+d;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=(o-r)*m}else if(n>a&&n>d){const m=2*Math.sqrt(1+n-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+c)/m}else if(a>d){const m=2*Math.sqrt(1+a-n-d);this._w=(s-c)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-a);this._w=(o-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+o*a+r*c-s*l,this._y=r*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-r*a,this._w=o*h-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*n+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),h=Math.atan2(c,a),d=Math.sin((1-t)*h)/c,f=Math.sin(t*h)/c;return this._w=o*d+this._w*f,this._x=n*d+this._x*f,this._y=r*d+this._y*f,this._z=s*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(s),n*Math.cos(s),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class D{constructor(e=0,t=0,n=0){D.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Gs.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Gs.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*n),h=2*(a*t-s*r),d=2*(s*n-o*t);return this.x=t+l*c+o*d-a*h,this.y=n+l*h+a*c-s*d,this.z=r+l*d+s*h-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return cr.copy(this).projectOnVector(e),this.sub(cr)}reflect(e){return this.sub(cr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(gt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cr=new D,Gs=new li;class ci{constructor(e=new D(1/0,1/0,1/0),t=new D(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Pt),Pt.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Jn),_i.subVectors(this.max,Jn),Rn.subVectors(e.a,Jn),wn.subVectors(e.b,Jn),Cn.subVectors(e.c,Jn),Jt.subVectors(wn,Rn),Qt.subVectors(Cn,wn),fn.subVectors(Rn,Cn);let t=[0,-Jt.z,Jt.y,0,-Qt.z,Qt.y,0,-fn.z,fn.y,Jt.z,0,-Jt.x,Qt.z,0,-Qt.x,fn.z,0,-fn.x,-Jt.y,Jt.x,0,-Qt.y,Qt.x,0,-fn.y,fn.x,0];return!ur(t,Rn,wn,Cn,_i)||(t=[1,0,0,0,1,0,0,0,1],!ur(t,Rn,wn,Cn,_i))?!1:(gi.crossVectors(Jt,Qt),t=[gi.x,gi.y,gi.z],ur(t,Rn,wn,Cn,_i))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Pt).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Pt).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ht[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ht[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ht[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ht[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ht[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ht[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ht[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ht[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ht),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ht=[new D,new D,new D,new D,new D,new D,new D,new D],Pt=new D,mi=new ci,Rn=new D,wn=new D,Cn=new D,Jt=new D,Qt=new D,fn=new D,Jn=new D,_i=new D,gi=new D,dn=new D;function ur(i,e,t,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){dn.fromArray(i,s);const a=r.x*Math.abs(dn.x)+r.y*Math.abs(dn.y)+r.z*Math.abs(dn.z),l=e.dot(dn),c=t.dot(dn),h=n.dot(dn);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}const gl=new ci,Qn=new D,hr=new D;class kr{constructor(e=new D,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):gl.setFromPoints(e).getCenter(n);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Qn.subVectors(e,this.center);const t=Qn.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(Qn,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(hr.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Qn.copy(e.center).add(hr)),this.expandByPoint(Qn.copy(e.center).sub(hr))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Vt=new D,fr=new D,vi=new D,en=new D,dr=new D,xi=new D,pr=new D;class vl{constructor(e=new D,t=new D(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Vt)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Vt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Vt.copy(this.origin).addScaledVector(this.direction,t),Vt.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){fr.copy(e).add(t).multiplyScalar(.5),vi.copy(t).sub(e).normalize(),en.copy(this.origin).sub(fr);const s=e.distanceTo(t)*.5,o=-this.direction.dot(vi),a=en.dot(this.direction),l=-en.dot(vi),c=en.lengthSq(),h=Math.abs(1-o*o);let d,f,m,x;if(h>0)if(d=o*l-a,f=o*a-l,x=s*h,d>=0)if(f>=-x)if(f<=x){const S=1/h;d*=S,f*=S,m=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),m=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),m=-d*d+f*(f+2*l)+c;else f<=-x?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+f*(f+2*l)+c):f<=x?(d=0,f=Math.min(Math.max(-s,-l),s),m=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),m=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(fr).addScaledVector(vi,f),m}intersectSphere(e,t){Vt.subVectors(e.center,this.origin);const n=Vt.dot(this.direction),r=Vt.dot(Vt)-n*n,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,o,a,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),h>=0?(s=(e.min.y-f.y)*h,o=(e.max.y-f.y)*h):(s=(e.max.y-f.y)*h,o=(e.min.y-f.y)*h),n>o||s>r||((s>n||isNaN(n))&&(n=s),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),n>l||a>r)||((a>n||n!==n)&&(n=a),(l=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Vt)!==null}intersectTriangle(e,t,n,r,s){dr.subVectors(t,e),xi.subVectors(n,e),pr.crossVectors(dr,xi);let o=this.direction.dot(pr),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;en.subVectors(this.origin,e);const l=a*this.direction.dot(xi.crossVectors(en,xi));if(l<0)return null;const c=a*this.direction.dot(dr.cross(en));if(c<0||l+c>o)return null;const h=-a*en.dot(pr);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ot{constructor(e,t,n,r,s,o,a,l,c,h,d,f,m,x,S,p){ot.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c,h,d,f,m,x,S,p)}set(e,t,n,r,s,o,a,l,c,h,d,f,m,x,S,p){const u=this.elements;return u[0]=e,u[4]=t,u[8]=n,u[12]=r,u[1]=s,u[5]=o,u[9]=a,u[13]=l,u[2]=c,u[6]=h,u[10]=d,u[14]=f,u[3]=m,u[7]=x,u[11]=S,u[15]=p,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 ot().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Ln.setFromMatrixColumn(e,0).length(),s=1/Ln.setFromMatrixColumn(e,1).length(),o=1/Ln.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=o*h,m=o*d,x=a*h,S=a*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=m+x*c,t[5]=f-S*c,t[9]=-a*l,t[2]=S-f*c,t[6]=x+m*c,t[10]=o*l}else if(e.order==="YXZ"){const f=l*h,m=l*d,x=c*h,S=c*d;t[0]=f+S*a,t[4]=x*a-m,t[8]=o*c,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-x,t[6]=S+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*h,m=l*d,x=c*h,S=c*d;t[0]=f-S*a,t[4]=-o*d,t[8]=x+m*a,t[1]=m+x*a,t[5]=o*h,t[9]=S-f*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*h,m=o*d,x=a*h,S=a*d;t[0]=l*h,t[4]=x*c-m,t[8]=f*c+S,t[1]=l*d,t[5]=S*c+f,t[9]=m*c-x,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,m=o*c,x=a*l,S=a*c;t[0]=l*h,t[4]=S-f*d,t[8]=x*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-c*h,t[6]=m*d+x,t[10]=f-S*d}else if(e.order==="XZY"){const f=o*l,m=o*c,x=a*l,S=a*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=f*d+S,t[5]=o*h,t[9]=m*d-x,t[2]=x*d-m,t[6]=a*h,t[10]=S*d+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xl,e,Ml)}lookAt(e,t,n){const r=this.elements;return Et.subVectors(e,t),Et.lengthSq()===0&&(Et.z=1),Et.normalize(),tn.crossVectors(n,Et),tn.lengthSq()===0&&(Math.abs(n.z)===1?Et.x+=1e-4:Et.z+=1e-4,Et.normalize(),tn.crossVectors(n,Et)),tn.normalize(),Mi.crossVectors(Et,tn),r[0]=tn.x,r[4]=Mi.x,r[8]=Et.x,r[1]=tn.y,r[5]=Mi.y,r[9]=Et.y,r[2]=tn.z,r[6]=Mi.z,r[10]=Et.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],d=n[5],f=n[9],m=n[13],x=n[2],S=n[6],p=n[10],u=n[14],E=n[3],_=n[7],A=n[11],b=n[15],w=r[0],R=r[4],N=r[8],v=r[12],y=r[1],H=r[5],Y=r[9],Z=r[13],L=r[2],G=r[6],X=r[10],W=r[14],ee=r[3],q=r[7],K=r[11],P=r[15];return s[0]=o*w+a*y+l*L+c*ee,s[4]=o*R+a*H+l*G+c*q,s[8]=o*N+a*Y+l*X+c*K,s[12]=o*v+a*Z+l*W+c*P,s[1]=h*w+d*y+f*L+m*ee,s[5]=h*R+d*H+f*G+m*q,s[9]=h*N+d*Y+f*X+m*K,s[13]=h*v+d*Z+f*W+m*P,s[2]=x*w+S*y+p*L+u*ee,s[6]=x*R+S*H+p*G+u*q,s[10]=x*N+S*Y+p*X+u*K,s[14]=x*v+S*Z+p*W+u*P,s[3]=E*w+_*y+A*L+b*ee,s[7]=E*R+_*H+A*G+b*q,s[11]=E*N+_*Y+A*X+b*K,s[15]=E*v+_*Z+A*W+b*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],h=e[2],d=e[6],f=e[10],m=e[14],x=e[3],S=e[7],p=e[11],u=e[15];return x*(+s*l*d-r*c*d-s*a*f+n*c*f+r*a*m-n*l*m)+S*(+t*l*m-t*c*f+s*o*f-r*o*m+r*c*h-s*l*h)+p*(+t*c*d-t*a*m-s*o*d+n*o*m+s*a*h-n*c*h)+u*(-r*a*h-t*l*d+t*a*f+r*o*d-n*o*f+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],m=e[11],x=e[12],S=e[13],p=e[14],u=e[15],E=d*p*c-S*f*c+S*l*m-a*p*m-d*l*u+a*f*u,_=x*f*c-h*p*c-x*l*m+o*p*m+h*l*u-o*f*u,A=h*S*c-x*d*c+x*a*m-o*S*m-h*a*u+o*d*u,b=x*d*l-h*S*l-x*a*f+o*S*f+h*a*p-o*d*p,w=t*E+n*_+r*A+s*b;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/w;return e[0]=E*R,e[1]=(S*f*s-d*p*s-S*r*m+n*p*m+d*r*u-n*f*u)*R,e[2]=(a*p*s-S*l*s+S*r*c-n*p*c-a*r*u+n*l*u)*R,e[3]=(d*l*s-a*f*s-d*r*c+n*f*c+a*r*m-n*l*m)*R,e[4]=_*R,e[5]=(h*p*s-x*f*s+x*r*m-t*p*m-h*r*u+t*f*u)*R,e[6]=(x*l*s-o*p*s-x*r*c+t*p*c+o*r*u-t*l*u)*R,e[7]=(o*f*s-h*l*s+h*r*c-t*f*c-o*r*m+t*l*m)*R,e[8]=A*R,e[9]=(x*d*s-h*S*s-x*n*m+t*S*m+h*n*u-t*d*u)*R,e[10]=(o*S*s-x*a*s+x*n*c-t*S*c-o*n*u+t*a*u)*R,e[11]=(h*a*s-o*d*s-h*n*c+t*d*c+o*n*m-t*a*m)*R,e[12]=b*R,e[13]=(h*S*r-x*d*r+x*n*f-t*S*f-h*n*p+t*d*p)*R,e[14]=(x*a*r-o*S*r-x*n*l+t*S*l+o*n*p-t*a*p)*R,e[15]=(o*d*r-h*a*r+h*n*l-t*d*l-o*n*f+t*a*f)*R,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-r*l,c*l+r*a,0,c*a+r*l,h*a+n,h*l-r*o,0,c*l-r*a,h*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,o){return this.set(1,n,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,h=o+o,d=a+a,f=s*c,m=s*h,x=s*d,S=o*h,p=o*d,u=a*d,E=l*c,_=l*h,A=l*d,b=n.x,w=n.y,R=n.z;return r[0]=(1-(S+u))*b,r[1]=(m+A)*b,r[2]=(x-_)*b,r[3]=0,r[4]=(m-A)*w,r[5]=(1-(f+u))*w,r[6]=(p+E)*w,r[7]=0,r[8]=(x+_)*R,r[9]=(p-E)*R,r[10]=(1-(f+S))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=Ln.set(r[0],r[1],r[2]).length();const o=Ln.set(r[4],r[5],r[6]).length(),a=Ln.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ut.copy(this);const c=1/s,h=1/o,d=1/a;return Ut.elements[0]*=c,Ut.elements[1]*=c,Ut.elements[2]*=c,Ut.elements[4]*=h,Ut.elements[5]*=h,Ut.elements[6]*=h,Ut.elements[8]*=d,Ut.elements[9]*=d,Ut.elements[10]*=d,t.setFromRotationMatrix(Ut),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,r,s,o,a=Kt){const l=this.elements,c=2*s/(t-e),h=2*s/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r);let m,x;if(a===Kt)m=-(o+s)/(o-s),x=-2*o*s/(o-s);else if(a===Vi)m=-o/(o-s),x=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,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]=x,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,r,s,o,a=Kt){const l=this.elements,c=1/(t-e),h=1/(n-r),d=1/(o-s),f=(t+e)*c,m=(n+r)*h;let x,S;if(a===Kt)x=(o+s)*d,S=-2*d;else if(a===Vi)x=s*d,S=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);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]=-x,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Ln=new D,Ut=new ot,xl=new D(0,0,0),Ml=new D(1,1,1),tn=new D,Mi=new D,Et=new D,Hs=new ot,Vs=new li;class qi{constructor(e=0,t=0,n=0,r=qi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],d=r[2],f=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(gt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-gt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(gt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(gt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-gt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Hs.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Hs,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Vs.setFromEuler(this),this.setFromQuaternion(Vs,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}qi.DEFAULT_ORDER="XYZ";class Oa{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(n=n.concat(o))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ei,e,El),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ei,Tl,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;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()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m),x.length>0&&(n.nodes=x)}return n.object=r,n;function o(a){const l=[];for(const c in a){const h=a[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Dt.subVectors(r,t),Wt.subVectors(n,t),mr.subVectors(e,t);const o=Dt.dot(Dt),a=Dt.dot(Wt),l=Dt.dot(mr),c=Wt.dot(Wt),h=Wt.dot(mr),d=o*c-a*a;if(d===0)return s.set(-2,-1,-1);const f=1/d,m=(c*l-a*h)*f,x=(o*h-a*l)*f;return s.set(1-m-x,x,m)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Xt),Xt.x>=0&&Xt.y>=0&&Xt.x+Xt.y<=1}static getUV(e,t,n,r,s,o,a,l){return Ei===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Ei=!0),this.getInterpolation(e,t,n,r,s,o,a,l)}static getInterpolation(e,t,n,r,s,o,a,l){return this.getBarycoord(e,t,n,r,Xt),l.setScalar(0),l.addScaledVector(s,Xt.x),l.addScaledVector(o,Xt.y),l.addScaledVector(a,Xt.z),l}static isFrontFacing(e,t,n,r){return Dt.subVectors(n,t),Wt.subVectors(e,t),Dt.cross(Wt).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Dt.subVectors(this.c,this.b),Wt.subVectors(this.a,this.b),Dt.cross(Wt).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return It.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return It.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,s){return Ei===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Ei=!0),It.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}getInterpolation(e,t,n,r,s){return It.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return It.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return It.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let o,a;Un.subVectors(r,n),Dn.subVectors(s,n),_r.subVectors(e,n);const l=Un.dot(_r),c=Dn.dot(_r);if(l<=0&&c<=0)return t.copy(n);gr.subVectors(e,r);const h=Un.dot(gr),d=Dn.dot(gr);if(h>=0&&d<=h)return t.copy(r);const f=l*d-h*c;if(f<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(n).addScaledVector(Un,o);vr.subVectors(e,s);const m=Un.dot(vr),x=Dn.dot(vr);if(x>=0&&m<=x)return t.copy(s);const S=m*c-l*x;if(S<=0&&c>=0&&x<=0)return a=c/(c-x),t.copy(n).addScaledVector(Dn,a);const p=h*x-m*d;if(p<=0&&d-h>=0&&m-x>=0)return Ys.subVectors(s,r),a=(d-h)/(d-h+(m-x)),t.copy(r).addScaledVector(Ys,a);const u=1/(p+S+f);return o=S*u,a=f*u,t.copy(n).addScaledVector(Un,o).addScaledVector(Dn,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ba={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},nn={h:0,s:0,l:0},Ti={h:0,s:0,l:0};function xr(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class ke{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=st){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ve.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=Ve.workingColorSpace){return this.r=e,this.g=t,this.b=n,Ve.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=Ve.workingColorSpace){if(e=ul(e,1),t=gt(t,0,1),n=gt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=xr(o,s,e+1/3),this.g=xr(o,s,e),this.b=xr(o,s,e-1/3)}return Ve.toWorkingColorSpace(this,r),this}setStyle(e,t=st){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=st){const n=Ba[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=kn(e.r),this.g=kn(e.g),this.b=kn(e.b),this}copyLinearToSRGB(e){return this.r=or(e.r),this.g=or(e.g),this.b=or(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=st){return Ve.fromWorkingColorSpace(ut.copy(this),e),Math.round(gt(ut.r*255,0,255))*65536+Math.round(gt(ut.g*255,0,255))*256+Math.round(gt(ut.b*255,0,255))}getHexString(e=st){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ve.workingColorSpace){Ve.fromWorkingColorSpace(ut.copy(this),t);const n=ut.r,r=ut.g,s=ut.b,o=Math.max(n,r,s),a=Math.min(n,r,s);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=h<=.5?d/(o+a):d/(2-o-a),o){case n:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' 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[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={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&&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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==cn&&(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!==Cr&&(n.blendSrc=this.blendSrc),this.blendDst!==Lr&&(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!==Bi&&(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!==Ds&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==An&&(n.stencilFail=this.stencilFail),this.stencilZFail!==An&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==An&&(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 o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class za extends ui{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ke(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.combine=Ta,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Qe=new D,yi=new Ge;class ht{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Is,this.updateRange={offset:0,count:-1},this.gpuType=sn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,f=c.length;d0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const r=e.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],d=s[c];for(let f=0,m=d.length;f0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(Ks.copy(s).invert(),pn.copy(e.ray).applyMatrix4(Ks),!(n.boundingBox!==null&&pn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,pn)))}_computeIntersections(e,t,n){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,f=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let x=0,S=f.length;xt.far?null:{distance:c,point:Pi.clone(),object:i}}function Ui(i,e,t,n,r,s,o,a,l,c){i.getVertexPosition(a,Nn),i.getVertexPosition(l,Fn),i.getVertexPosition(c,On);const h=wl(i,e,t,n,Nn,Fn,On,Li);if(h){r&&(Ri.fromBufferAttribute(r,a),wi.fromBufferAttribute(r,l),Ci.fromBufferAttribute(r,c),h.uv=It.getInterpolation(Li,Nn,Fn,On,Ri,wi,Ci,new Ge)),s&&(Ri.fromBufferAttribute(s,a),wi.fromBufferAttribute(s,l),Ci.fromBufferAttribute(s,c),h.uv1=It.getInterpolation(Li,Nn,Fn,On,Ri,wi,Ci,new Ge),h.uv2=h.uv1),o&&(Zs.fromBufferAttribute(o,a),$s.fromBufferAttribute(o,l),Js.fromBufferAttribute(o,c),h.normal=It.getInterpolation(Li,Nn,Fn,On,Zs,$s,Js,new D),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new D,materialIndex:0};It.getNormal(Nn,Fn,On,d.normal),h.face=d}return h}class hi extends $t{constructor(e=1,t=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],h=[],d=[];let f=0,m=0;x("z","y","x",-1,-1,n,t,e,o,s,0),x("z","y","x",1,-1,n,t,-e,o,s,1),x("x","z","y",1,1,e,n,t,r,o,2),x("x","z","y",1,-1,e,n,-t,r,o,3),x("x","y","z",1,-1,e,t,n,r,s,4),x("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new zt(c,3)),this.setAttribute("normal",new zt(h,3)),this.setAttribute("uv",new zt(d,2));function x(S,p,u,E,_,A,b,w,R,N,v){const y=A/R,H=b/N,Y=A/2,Z=b/2,L=w/2,G=R+1,X=N+1;let W=0,ee=0;const q=new D;for(let K=0;K0?1:-1,h.push(q.x,q.y,q.z),d.push(k/R),d.push(1-K/N),W+=1}}for(let K=0;K0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ka extends At{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ot,this.projectionMatrix=new ot,this.projectionMatrixInverse=new ot,this.coordinateSystem=Kt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Ct extends ka{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Fr*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(rr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Fr*2*Math.atan(Math.tan(rr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,s,o){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(rr*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*n/c,r*=o.width/l,n*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Bn=-90,zn=1;class Dl extends At{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Ct(Bn,zn,e,t);r.layers=this.layers,this.add(r);const s=new Ct(Bn,zn,e,t);s.layers=this.layers,this.add(s);const o=new Ct(Bn,zn,e,t);o.layers=this.layers,this.add(o);const a=new Ct(Bn,zn,e,t);a.layers=this.layers,this.add(a);const l=new Ct(Bn,zn,e,t);l.layers=this.layers,this.add(l);const c=new Ct(Bn,zn,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Kt)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),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Vi)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),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.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: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,h]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const S=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,s),e.setRenderTarget(n,1,r),e.render(t,o),e.setRenderTarget(n,2,r),e.render(t,a),e.setRenderTarget(n,3,r),e.render(t,l),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=S,e.setRenderTarget(n,5,r),e.render(t,h),e.setRenderTarget(d,f,m),e.xr.enabled=x,n.texture.needsPMREMUpdate=!0}}class Wa extends yt{constructor(e,t,n,r,s,o,a,l,c,h){e=e!==void 0?e:[],t=t!==void 0?t:Wn,super(e,t,n,r,s,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Il extends Tn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];t.encoding!==void 0&&(ii("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===En?st:Lt),this.texture=new Wa(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:wt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.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 hi(5,5,5),s=new yn({name:"CubemapFromEquirect",uniforms:Yn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:vt,blending:an});s.uniforms.tEquirect.value=t;const o=new jt(r,s),a=t.minFilter;return t.minFilter===ri&&(t.minFilter=wt),new Dl(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(s)}}const Er=new D,Nl=new D,Fl=new Ie;class _n{constructor(e=new D(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Er.subVectors(n,t).cross(Nl.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Er),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Fl.getNormalMatrix(e),r=this.coplanarPoint(Er).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const mn=new kr,Di=new D;class Xa{constructor(e=new _n,t=new _n,n=new _n,r=new _n,s=new _n,o=new _n){this.planes=[e,t,n,r,s,o]}set(e,t,n,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Kt){const n=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],d=r[6],f=r[7],m=r[8],x=r[9],S=r[10],p=r[11],u=r[12],E=r[13],_=r[14],A=r[15];if(n[0].setComponents(l-s,f-c,p-m,A-u).normalize(),n[1].setComponents(l+s,f+c,p+m,A+u).normalize(),n[2].setComponents(l+o,f+h,p+x,A+E).normalize(),n[3].setComponents(l-o,f-h,p-x,A-E).normalize(),n[4].setComponents(l-a,f-d,p-S,A-_).normalize(),t===Kt)n[5].setComponents(l+a,f+d,p+S,A+_).normalize();else if(t===Vi)n[5].setComponents(a,d,S,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),mn.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),mn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(mn)}intersectsSprite(e){return mn.center.set(0,0,0),mn.radius=.7071067811865476,mn.applyMatrix4(e.matrixWorld),this.intersectsSphere(mn)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Di.y=r.normal.y>0?e.max.y:e.min.y,Di.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Di)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function qa(){let i=null,e=!1,t=null,n=null;function r(s,o){t(s,o),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function Ol(i,e){const t=e.isWebGL2,n=new WeakMap;function r(c,h){const d=c.array,f=c.usage,m=i.createBuffer();i.bindBuffer(h,m),i.bufferData(h,d,f),c.onUploadCallback();let x;if(d instanceof Float32Array)x=i.FLOAT;else if(d instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(t)x=i.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=i.UNSIGNED_SHORT;else if(d instanceof Int16Array)x=i.SHORT;else if(d instanceof Uint32Array)x=i.UNSIGNED_INT;else if(d instanceof Int32Array)x=i.INT;else if(d instanceof Int8Array)x=i.BYTE;else if(d instanceof Uint8Array)x=i.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)x=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:m,type:x,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version}}function s(c,h,d){const f=h.array,m=h.updateRange;i.bindBuffer(d,c),m.count===-1?i.bufferSubData(d,0,f):(t?i.bufferSubData(d,m.offset*f.BYTES_PER_ELEMENT,f,m.offset,m.count):i.bufferSubData(d,m.offset*f.BYTES_PER_ELEMENT,f.subarray(m.offset,m.offset+m.count)),m.count=-1),h.onUploadCallback()}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=n.get(c);h&&(i.deleteBuffer(h.buffer),n.delete(c))}function l(c,h){if(c.isGLBufferAttribute){const f=n.get(c);(!f||f.version 0 + vec4 plane; + #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`,Jl=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Ql=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,ec=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,tc=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,nc=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,ic=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,rc=`#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`,sc=`#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`,ac=`#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_v0 0.339 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_v1 0.276 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_v4 0.046 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_v5 0.016 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_v6 0.0038 + #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`,oc=`vec3 transformedNormal = objectNormal; +#ifdef USE_INSTANCING + mat3 m = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); + transformedNormal = m * transformedNormal; +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,lc=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,cc=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,uc=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,hc=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,fc="gl_FragColor = linearToOutputTexel( gl_FragColor );",dc=` +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 ); +}`,pc=`#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, 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`,mc=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,_c=`#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`,gc=`#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`,vc=`#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`,xc=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Mc=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Sc=`#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`,Ec=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Tc=`#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 +}`,yc=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,Ac=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,bc=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Rc=`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`,wc=`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`,Cc=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, 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, 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`,Lc=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Pc=`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`,Uc=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,Dc=`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`,Ic=`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_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 ); + 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`,Nc=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #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 ); +}`,Fc=` +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`,Oc=`#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`,Bc=`#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`,zc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,Gc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Hc=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,Vc=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,kc=`#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`,Wc=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Xc=`#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`,qc=`#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`,Yc=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Kc=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,jc=`#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`,Zc=`#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`,$c=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + 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`,Jc=`#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`,Qc=`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;`,eu=`#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`,tu=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,nu=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,iu=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,ru=`#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`,su=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,au=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,ou=`#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`,lu=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,cu=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,uu=`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 ); +}`,hu=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,fu=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,du=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,pu=`#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`,mu=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,_u=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,gu=`#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 ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + 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 + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,vu=`#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`,xu=`#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`,Mu=`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; +}`,Su=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Eu=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + uniform int boneTextureSize; + mat4 getBoneMatrix( const in float i ) { + float j = i * 4.0; + float x = mod( j, float( boneTextureSize ) ); + float y = floor( j / float( boneTextureSize ) ); + float dx = 1.0 / float( boneTextureSize ); + float dy = 1.0 / float( boneTextureSize ); + y = dy * ( y + 0.5 ); + vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); + vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); + vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); + vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); + mat4 bone = mat4( v1, v2, v3, v4 ); + return bone; + } +#endif`,Tu=`#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`,yu=`#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`,Au=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,bu=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Ru=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,wu=`#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 ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,Cu=`#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.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,Lu=`#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 ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + 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; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + 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`,Pu=`#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`,Uu=`#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`,Du=`#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`,Iu=`#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_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 ); +}`,Fu=`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 +}`,Ou=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Bu=`#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; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,zu=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Gu=`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 +}`,Hu=`#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Vu=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #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 +}`,ku=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,Wu=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Xu=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,qu=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,Yu=`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 +}`,Ku=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,ju=`#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #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 +}`,Zu=`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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,$u=`#define LAMBERT +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Ju=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,Qu=`#define MATCAP +varying vec3 vViewPosition; +#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 + vViewPosition = - mvPosition.xyz; +}`,eh=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,th=`#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 +void main() { + #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 +}`,nh=`#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() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,ih=`#define PHONG +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,rh=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,sh=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,ah=`#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_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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,oh=`#define TOON +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,lh=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,ch=`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 + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,uh=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,hh=`#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,fh=`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 +}`,dh=`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 +}`,ph=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Ce={alphahash_fragment:Bl,alphahash_pars_fragment:zl,alphamap_fragment:Gl,alphamap_pars_fragment:Hl,alphatest_fragment:Vl,alphatest_pars_fragment:kl,aomap_fragment:Wl,aomap_pars_fragment:Xl,begin_vertex:ql,beginnormal_vertex:Yl,bsdfs:Kl,iridescence_fragment:jl,bumpmap_pars_fragment:Zl,clipping_planes_fragment:$l,clipping_planes_pars_fragment:Jl,clipping_planes_pars_vertex:Ql,clipping_planes_vertex:ec,color_fragment:tc,color_pars_fragment:nc,color_pars_vertex:ic,color_vertex:rc,common:sc,cube_uv_reflection_fragment:ac,defaultnormal_vertex:oc,displacementmap_pars_vertex:lc,displacementmap_vertex:cc,emissivemap_fragment:uc,emissivemap_pars_fragment:hc,colorspace_fragment:fc,colorspace_pars_fragment:dc,envmap_fragment:pc,envmap_common_pars_fragment:mc,envmap_pars_fragment:_c,envmap_pars_vertex:gc,envmap_physical_pars_fragment:Cc,envmap_vertex:vc,fog_vertex:xc,fog_pars_vertex:Mc,fog_fragment:Sc,fog_pars_fragment:Ec,gradientmap_pars_fragment:Tc,lightmap_fragment:yc,lightmap_pars_fragment:Ac,lights_lambert_fragment:bc,lights_lambert_pars_fragment:Rc,lights_pars_begin:wc,lights_toon_fragment:Lc,lights_toon_pars_fragment:Pc,lights_phong_fragment:Uc,lights_phong_pars_fragment:Dc,lights_physical_fragment:Ic,lights_physical_pars_fragment:Nc,lights_fragment_begin:Fc,lights_fragment_maps:Oc,lights_fragment_end:Bc,logdepthbuf_fragment:zc,logdepthbuf_pars_fragment:Gc,logdepthbuf_pars_vertex:Hc,logdepthbuf_vertex:Vc,map_fragment:kc,map_pars_fragment:Wc,map_particle_fragment:Xc,map_particle_pars_fragment:qc,metalnessmap_fragment:Yc,metalnessmap_pars_fragment:Kc,morphcolor_vertex:jc,morphnormal_vertex:Zc,morphtarget_pars_vertex:$c,morphtarget_vertex:Jc,normal_fragment_begin:Qc,normal_fragment_maps:eu,normal_pars_fragment:tu,normal_pars_vertex:nu,normal_vertex:iu,normalmap_pars_fragment:ru,clearcoat_normal_fragment_begin:su,clearcoat_normal_fragment_maps:au,clearcoat_pars_fragment:ou,iridescence_pars_fragment:lu,opaque_fragment:cu,packing:uu,premultiplied_alpha_fragment:hu,project_vertex:fu,dithering_fragment:du,dithering_pars_fragment:pu,roughnessmap_fragment:mu,roughnessmap_pars_fragment:_u,shadowmap_pars_fragment:gu,shadowmap_pars_vertex:vu,shadowmap_vertex:xu,shadowmask_pars_fragment:Mu,skinbase_vertex:Su,skinning_pars_vertex:Eu,skinning_vertex:Tu,skinnormal_vertex:yu,specularmap_fragment:Au,specularmap_pars_fragment:bu,tonemapping_fragment:Ru,tonemapping_pars_fragment:wu,transmission_fragment:Cu,transmission_pars_fragment:Lu,uv_pars_fragment:Pu,uv_pars_vertex:Uu,uv_vertex:Du,worldpos_vertex:Iu,background_vert:Nu,background_frag:Fu,backgroundCube_vert:Ou,backgroundCube_frag:Bu,cube_vert:zu,cube_frag:Gu,depth_vert:Hu,depth_frag:Vu,distanceRGBA_vert:ku,distanceRGBA_frag:Wu,equirect_vert:Xu,equirect_frag:qu,linedashed_vert:Yu,linedashed_frag:Ku,meshbasic_vert:ju,meshbasic_frag:Zu,meshlambert_vert:$u,meshlambert_frag:Ju,meshmatcap_vert:Qu,meshmatcap_frag:eh,meshnormal_vert:th,meshnormal_frag:nh,meshphong_vert:ih,meshphong_frag:rh,meshphysical_vert:sh,meshphysical_frag:ah,meshtoon_vert:oh,meshtoon_frag:lh,points_vert:ch,points_frag:uh,shadow_vert:hh,shadow_frag:fh,sprite_vert:dh,sprite_frag:ph},re={common:{diffuse:{value:new ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ie},alphaMap:{value:null},alphaMapTransform:{value:new Ie},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ie}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ie}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ie}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ie},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ie},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ie},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ie}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ie}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ie}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ke(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 ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ie},alphaTest:{value:0},uvTransform:{value:new Ie}},sprite:{diffuse:{value:new ke(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ie},alphaMap:{value:null},alphaMapTransform:{value:new Ie},alphaTest:{value:0}}},Bt={basic:{uniforms:pt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.fog]),vertexShader:Ce.meshbasic_vert,fragmentShader:Ce.meshbasic_frag},lambert:{uniforms:pt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.fog,re.lights,{emissive:{value:new ke(0)}}]),vertexShader:Ce.meshlambert_vert,fragmentShader:Ce.meshlambert_frag},phong:{uniforms:pt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.fog,re.lights,{emissive:{value:new ke(0)},specular:{value:new ke(1118481)},shininess:{value:30}}]),vertexShader:Ce.meshphong_vert,fragmentShader:Ce.meshphong_frag},standard:{uniforms:pt([re.common,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.roughnessmap,re.metalnessmap,re.fog,re.lights,{emissive:{value:new ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ce.meshphysical_vert,fragmentShader:Ce.meshphysical_frag},toon:{uniforms:pt([re.common,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.gradientmap,re.fog,re.lights,{emissive:{value:new ke(0)}}]),vertexShader:Ce.meshtoon_vert,fragmentShader:Ce.meshtoon_frag},matcap:{uniforms:pt([re.common,re.bumpmap,re.normalmap,re.displacementmap,re.fog,{matcap:{value:null}}]),vertexShader:Ce.meshmatcap_vert,fragmentShader:Ce.meshmatcap_frag},points:{uniforms:pt([re.points,re.fog]),vertexShader:Ce.points_vert,fragmentShader:Ce.points_frag},dashed:{uniforms:pt([re.common,re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ce.linedashed_vert,fragmentShader:Ce.linedashed_frag},depth:{uniforms:pt([re.common,re.displacementmap]),vertexShader:Ce.depth_vert,fragmentShader:Ce.depth_frag},normal:{uniforms:pt([re.common,re.bumpmap,re.normalmap,re.displacementmap,{opacity:{value:1}}]),vertexShader:Ce.meshnormal_vert,fragmentShader:Ce.meshnormal_frag},sprite:{uniforms:pt([re.sprite,re.fog]),vertexShader:Ce.sprite_vert,fragmentShader:Ce.sprite_frag},background:{uniforms:{uvTransform:{value:new Ie},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ce.background_vert,fragmentShader:Ce.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Ce.backgroundCube_vert,fragmentShader:Ce.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ce.cube_vert,fragmentShader:Ce.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ce.equirect_vert,fragmentShader:Ce.equirect_frag},distanceRGBA:{uniforms:pt([re.common,re.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ce.distanceRGBA_vert,fragmentShader:Ce.distanceRGBA_frag},shadow:{uniforms:pt([re.lights,re.fog,{color:{value:new ke(0)},opacity:{value:1}}]),vertexShader:Ce.shadow_vert,fragmentShader:Ce.shadow_frag}};Bt.physical={uniforms:pt([Bt.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ie},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ie},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ie},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ie},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ie},sheen:{value:0},sheenColor:{value:new ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ie},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ie},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ie},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ie},attenuationDistance:{value:0},attenuationColor:{value:new ke(0)},specularColor:{value:new ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ie},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ie},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ie}}]),vertexShader:Ce.meshphysical_vert,fragmentShader:Ce.meshphysical_frag};const Ii={r:0,b:0,g:0};function mh(i,e,t,n,r,s,o){const a=new ke(0);let l=s===!0?0:1,c,h,d=null,f=0,m=null;function x(p,u){let E=!1,_=u.isScene===!0?u.background:null;_&&_.isTexture&&(_=(u.backgroundBlurriness>0?t:e).get(_)),_===null?S(a,l):_&&_.isColor&&(S(_,1),E=!0);const A=i.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(i.autoClear||E)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Wi)?(h===void 0&&(h=new jt(new hi(1,1,1),new yn({name:"BackgroundCubeMaterial",uniforms:Yn(Bt.backgroundCube.uniforms),vertexShader:Bt.backgroundCube.vertexShader,fragmentShader:Bt.backgroundCube.fragmentShader,side:vt,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(b,w,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=_,h.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=u.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,h.material.toneMapped=Ve.getTransfer(_.colorSpace)!==qe,(d!==_||f!==_.version||m!==i.toneMapping)&&(h.material.needsUpdate=!0,d=_,f=_.version,m=i.toneMapping),h.layers.enableAll(),p.unshift(h,h.geometry,h.material,0,0,null)):_&&_.isTexture&&(c===void 0&&(c=new jt(new Wr(2,2),new yn({name:"BackgroundMaterial",uniforms:Yn(Bt.background.uniforms),vertexShader:Bt.background.vertexShader,fragmentShader:Bt.background.fragmentShader,side:cn,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=_,c.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,c.material.toneMapped=Ve.getTransfer(_.colorSpace)!==qe,_.matrixAutoUpdate===!0&&_.updateMatrix(),c.material.uniforms.uvTransform.value.copy(_.matrix),(d!==_||f!==_.version||m!==i.toneMapping)&&(c.material.needsUpdate=!0,d=_,f=_.version,m=i.toneMapping),c.layers.enableAll(),p.unshift(c,c.geometry,c.material,0,0,null))}function S(p,u){p.getRGB(Ii,Va(i)),n.buffers.color.setClear(Ii.r,Ii.g,Ii.b,u,o)}return{getClearColor:function(){return a},setClearColor:function(p,u=1){a.set(p),l=u,S(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(p){l=p,S(a,l)},render:x}}function _h(i,e,t,n){const r=i.getParameter(i.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=p(null);let c=l,h=!1;function d(L,G,X,W,ee){let q=!1;if(o){const K=S(W,X,G);c!==K&&(c=K,m(c.object)),q=u(L,W,X,ee),q&&E(L,W,X,ee)}else{const K=G.wireframe===!0;(c.geometry!==W.id||c.program!==X.id||c.wireframe!==K)&&(c.geometry=W.id,c.program=X.id,c.wireframe=K,q=!0)}ee!==null&&t.update(ee,i.ELEMENT_ARRAY_BUFFER),(q||h)&&(h=!1,N(L,G,X,W),ee!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(ee).buffer))}function f(){return n.isWebGL2?i.createVertexArray():s.createVertexArrayOES()}function m(L){return n.isWebGL2?i.bindVertexArray(L):s.bindVertexArrayOES(L)}function x(L){return n.isWebGL2?i.deleteVertexArray(L):s.deleteVertexArrayOES(L)}function S(L,G,X){const W=X.wireframe===!0;let ee=a[L.id];ee===void 0&&(ee={},a[L.id]=ee);let q=ee[G.id];q===void 0&&(q={},ee[G.id]=q);let K=q[W];return K===void 0&&(K=p(f()),q[W]=K),K}function p(L){const G=[],X=[],W=[];for(let ee=0;ee=0){const ce=ee[k];let he=q[k];if(he===void 0&&(k==="instanceMatrix"&&L.instanceMatrix&&(he=L.instanceMatrix),k==="instanceColor"&&L.instanceColor&&(he=L.instanceColor)),ce===void 0||ce.attribute!==he||he&&ce.data!==he.data)return!0;K++}return c.attributesNum!==K||c.index!==W}function E(L,G,X,W){const ee={},q=G.attributes;let K=0;const P=X.getAttributes();for(const k in P)if(P[k].location>=0){let ce=q[k];ce===void 0&&(k==="instanceMatrix"&&L.instanceMatrix&&(ce=L.instanceMatrix),k==="instanceColor"&&L.instanceColor&&(ce=L.instanceColor));const he={};he.attribute=ce,ce&&ce.data&&(he.data=ce.data),ee[k]=he,K++}c.attributes=ee,c.attributesNum=K,c.index=W}function _(){const L=c.newAttributes;for(let G=0,X=L.length;G=0){let ae=ee[P];if(ae===void 0&&(P==="instanceMatrix"&&L.instanceMatrix&&(ae=L.instanceMatrix),P==="instanceColor"&&L.instanceColor&&(ae=L.instanceColor)),ae!==void 0){const ce=ae.normalized,he=ae.itemSize,ve=t.get(ae);if(ve===void 0)continue;const Fe=ve.buffer,Te=ve.type,we=ve.bytesPerElement,Ye=n.isWebGL2===!0&&(Te===i.INT||Te===i.UNSIGNED_INT||ae.gpuType===Aa);if(ae.isInterleavedBufferAttribute){const Pe=ae.data,I=Pe.stride,xt=ae.offset;if(Pe.isInstancedInterleavedBuffer){for(let pe=0;pe0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&i.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),f=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_TEXTURE_SIZE),x=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),S=i.getParameter(i.MAX_VERTEX_ATTRIBS),p=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),u=i.getParameter(i.MAX_VARYING_VECTORS),E=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),_=f>0,A=o||e.has("OES_texture_float"),b=_&&A,w=o?i.getParameter(i.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:f,maxTextureSize:m,maxCubemapSize:x,maxAttributes:S,maxVertexUniforms:p,maxVaryings:u,maxFragmentUniforms:E,vertexTextures:_,floatFragmentTextures:A,floatVertexTextures:b,maxSamples:w}}function xh(i){const e=this;let t=null,n=0,r=!1,s=!1;const o=new _n,a=new Ie,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const m=d.length!==0||f||n!==0||r;return r=f,n=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){t=h(d,f,0)},this.setState=function(d,f,m){const x=d.clippingPlanes,S=d.clipIntersection,p=d.clipShadows,u=i.get(d);if(!r||x===null||x.length===0||s&&!p)s?h(null):c();else{const E=s?0:n,_=E*4;let A=u.clippingState||null;l.value=A,A=h(x,f,_,m);for(let b=0;b!==_;++b)A[b]=t[b];u.clippingState=A,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(d,f,m,x){const S=d!==null?d.length:0;let p=null;if(S!==0){if(p=l.value,x!==!0||p===null){const u=m+S*4,E=f.matrixWorldInverse;a.getNormalMatrix(E),(p===null||p.length0){const c=new Il(l.height/2);return c.fromEquirectangularTexture(i,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class Sh extends ka{constructor(e=-1,t=1,n=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,s,o){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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,o=n+e,a=r+t,l=r-t;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,o=s+c*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Hn=4,Qs=[.125,.215,.35,.446,.526,.582],xn=20,Tr=new Sh,ea=new ke;let yr=null,Ar=0,br=0;const gn=(1+Math.sqrt(5))/2,Gn=1/gn,ta=[new D(1,1,1),new D(-1,1,1),new D(1,1,-1),new D(-1,1,-1),new D(0,gn,Gn),new D(0,gn,-Gn),new D(Gn,0,gn),new D(-Gn,0,gn),new D(gn,Gn,0),new D(-gn,Gn,0)];class na{constructor(e){this._renderer=e,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(e,t=0,n=.1,r=100){yr=this._renderer.getRenderTarget(),Ar=this._renderer.getActiveCubeFace(),br=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sa(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ra(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?_:0,_,_),h.setRenderTarget(r),S&&h.render(x,a),h.render(e,a)}x.geometry.dispose(),x.material.dispose(),h.toneMapping=f,h.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===Wn||e.mapping===Xn;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=sa()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ra());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new jt(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Ni(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(o,Tr)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;rxn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${xn}`);const u=[];let E=0;for(let R=0;R_-Hn?r-_+Hn:0),w=4*(this._cubeSize-A);Ni(t,b,w,3*A,2*A),l.setRenderTarget(t),l.render(d,Tr)}}function Eh(i){const e=[],t=[],n=[];let r=i;const s=i-Hn+1+Qs.length;for(let o=0;oi-Hn?l=Qs[o-i+Hn-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),h=-c,d=1+c,f=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,x=6,S=3,p=2,u=1,E=new Float32Array(S*x*m),_=new Float32Array(p*x*m),A=new Float32Array(u*x*m);for(let w=0;w2?0:-1,v=[R,N,0,R+2/3,N,0,R+2/3,N+1,0,R,N,0,R+2/3,N+1,0,R,N+1,0];E.set(v,S*x*w),_.set(f,p*x*w);const y=[w,w,w,w,w,w];A.set(y,u*x*w)}const b=new $t;b.setAttribute("position",new ht(E,S)),b.setAttribute("uv",new ht(_,p)),b.setAttribute("faceIndex",new ht(A,u)),e.push(b),r>Hn&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function ia(i,e,t){const n=new Tn(i,e,t);return n.texture.mapping=Wi,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ni(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function Th(i,e,t){const n=new Float32Array(xn),r=new D(0,1,0);return new yn({name:"SphericalGaussianBlur",defines:{n:xn,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,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:Xr(),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:an,depthTest:!1,depthWrite:!1})}function ra(){return new yn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Xr(),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:an,depthTest:!1,depthWrite:!1})}function sa(){return new yn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Xr(),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:an,depthTest:!1,depthWrite:!1})}function Xr(){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 yh(i){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){const l=a.mapping,c=l===Pr||l===Ur,h=l===Wn||l===Xn;if(c||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new na(i)),d=c?t.fromEquirectangular(a,d):t.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(c&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new na(i));const f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function r(a){let l=0;const c=6;for(let h=0;he.maxTextureSize&&(y=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const H=new Float32Array(v*y*4*x),Y=new Fa(H,v,y,x);Y.type=sn,Y.needsUpdate=!0;const Z=N*4;for(let G=0;G0)return i;const r=e*t;let s=aa[r];if(s===void 0&&(s=new Float32Array(r),aa[r]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(s,a)}return s}function et(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t":" "} ${a}: ${t[o]}`)}return n.join(` +`)}function Rf(i){const e=Ve.getPrimaries(Ve.workingColorSpace),t=Ve.getPrimaries(i);let n;switch(e===t?n="":e===Hi&&t===Gi?n="LinearDisplayP3ToLinearSRGB":e===Gi&&t===Hi&&(n="LinearSRGBToLinearDisplayP3"),i){case Zt:case Xi:return[n,"LinearTransferOETF"];case st:case Vr:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",i),[n,"LinearTransferOETF"]}}function da(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+r+` + +`+bf(i.getShaderSource(e),o)}else return r}function wf(i,e){const t=Rf(e);return`vec4 ${i}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function Cf(i,e){let t;switch(e){case Bo:t="Linear";break;case zo:t="Reinhard";break;case Go:t="OptimizedCineon";break;case Ho:t="ACESFilmic";break;case Vo:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function Lf(i){return[i.extensionDerivatives||i.envMapCubeUVHeight||i.bumpMap||i.normalMapTangentSpace||i.clearcoatNormalMap||i.flatShading||i.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ni).join(` +`)}function Pf(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` +`)}function Uf(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function Br(i){return i.replace(Df,Nf)}const If=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Nf(i,e){let t=Ce[e];if(t===void 0){const n=If.get(e);if(n!==void 0)t=Ce[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Br(t)}const Ff=/#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 _a(i){return i.replace(Ff,Of)}function Of(i,e,t,n){let r="";for(let s=parseInt(e);s0&&(p+=` +`),u=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(ni).join(` +`),u.length>0&&(u+=` +`)):(p=[ga(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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(ni).join(` +`),u=[m,ga(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==on?"#define TONE_MAPPING":"",t.toneMapping!==on?Ce.tonemapping_pars_fragment:"",t.toneMapping!==on?Cf("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Ce.colorspace_pars_fragment,wf("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(ni).join(` +`)),o=Br(o),o=pa(o,t),o=ma(o,t),a=Br(a),a=pa(a,t),a=ma(a,t),o=_a(o),a=_a(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(E=`#version 300 es +`,p=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+p,u=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Ns?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Ns?"":"#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 _=E+p+o,A=E+u+a,b=fa(r,r.VERTEX_SHADER,_),w=fa(r,r.FRAGMENT_SHADER,A);r.attachShader(S,b),r.attachShader(S,w),t.index0AttributeName!==void 0?r.bindAttribLocation(S,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function R(H){if(i.debug.checkShaderErrors){const Y=r.getProgramInfoLog(S).trim(),Z=r.getShaderInfoLog(b).trim(),L=r.getShaderInfoLog(w).trim();let G=!0,X=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(G=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,S,b,w);else{const W=da(r,b,"vertex"),ee=da(r,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` + +Program Info Log: `+Y+` +`+W+` +`+ee)}else Y!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Y):(Z===""||L==="")&&(X=!1);X&&(H.diagnostics={runnable:G,programLog:Y,vertexShader:{log:Z,prefix:p},fragmentShader:{log:L,prefix:u}})}r.deleteShader(b),r.deleteShader(w),N=new Oi(r,S),v=Uf(r,S)}let N;this.getUniforms=function(){return N===void 0&&R(this),N};let v;this.getAttributes=function(){return v===void 0&&R(this),v};let y=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=r.getProgramParameter(S,yf)),y},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Af++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=b,this.fragmentShader=w,this}let Wf=0;class Xf{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new qf(e),t.set(e,n)),n}}class qf{constructor(e){this.id=Wf++,this.code=e,this.usedTimes=0}}function Yf(i,e,t,n,r,s,o){const a=new Oa,l=new Xf,c=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,f=r.vertexTextures;let m=r.precision;const x={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(v){return v===0?"uv":`uv${v}`}function p(v,y,H,Y,Z){const L=Y.fog,G=Z.geometry,X=v.isMeshStandardMaterial?Y.environment:null,W=(v.isMeshStandardMaterial?t:e).get(v.envMap||X),ee=W&&W.mapping===Wi?W.image.height:null,q=x[v.type];v.precision!==null&&(m=r.getMaxPrecision(v.precision),m!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",m,"instead."));const K=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,P=K!==void 0?K.length:0;let k=0;G.morphAttributes.position!==void 0&&(k=1),G.morphAttributes.normal!==void 0&&(k=2),G.morphAttributes.color!==void 0&&(k=3);let ae,ce,he,ve;if(q){const $e=Bt[q];ae=$e.vertexShader,ce=$e.fragmentShader}else ae=v.vertexShader,ce=v.fragmentShader,l.update(v),he=l.getVertexShaderID(v),ve=l.getFragmentShaderID(v);const Fe=i.getRenderTarget(),Te=Z.isInstancedMesh===!0,we=!!v.map,Ye=!!v.matcap,Pe=!!W,I=!!v.aoMap,xt=!!v.lightMap,pe=!!v.bumpMap,ye=!!v.normalMap,Ee=!!v.displacementMap,Ke=!!v.emissiveMap,Ue=!!v.metalnessMap,De=!!v.roughnessMap,We=v.anisotropy>0,nt=v.clearcoat>0,lt=v.iridescence>0,T=v.sheen>0,g=v.transmission>0,F=We&&!!v.anisotropyMap,J=nt&&!!v.clearcoatMap,j=nt&&!!v.clearcoatNormalMap,Q=nt&&!!v.clearcoatRoughnessMap,fe=lt&&!!v.iridescenceMap,ie=lt&&!!v.iridescenceThicknessMap,oe=T&&!!v.sheenColorMap,xe=T&&!!v.sheenRoughnessMap,Be=!!v.specularMap,$=!!v.specularColorMap,He=!!v.specularIntensityMap,Ae=g&&!!v.transmissionMap,Me=g&&!!v.thicknessMap,me=!!v.gradientMap,ue=!!v.alphaMap,Oe=v.alphaTest>0,C=!!v.alphaHash,se=!!v.extensions,te=!!G.attributes.uv1,V=!!G.attributes.uv2,ne=!!G.attributes.uv3;let _e=on;return v.toneMapped&&(Fe===null||Fe.isXRRenderTarget===!0)&&(_e=i.toneMapping),{isWebGL2:h,shaderID:q,shaderType:v.type,shaderName:v.name,vertexShader:ae,fragmentShader:ce,defines:v.defines,customVertexShaderID:he,customFragmentShaderID:ve,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:m,instancing:Te,instancingColor:Te&&Z.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:Fe===null?i.outputColorSpace:Fe.isXRRenderTarget===!0?Fe.texture.colorSpace:Zt,map:we,matcap:Ye,envMap:Pe,envMapMode:Pe&&W.mapping,envMapCubeUVHeight:ee,aoMap:I,lightMap:xt,bumpMap:pe,normalMap:ye,displacementMap:f&&Ee,emissiveMap:Ke,normalMapObjectSpace:ye&&v.normalMapType===tl,normalMapTangentSpace:ye&&v.normalMapType===Ua,metalnessMap:Ue,roughnessMap:De,anisotropy:We,anisotropyMap:F,clearcoat:nt,clearcoatMap:J,clearcoatNormalMap:j,clearcoatRoughnessMap:Q,iridescence:lt,iridescenceMap:fe,iridescenceThicknessMap:ie,sheen:T,sheenColorMap:oe,sheenRoughnessMap:xe,specularMap:Be,specularColorMap:$,specularIntensityMap:He,transmission:g,transmissionMap:Ae,thicknessMap:Me,gradientMap:me,opaque:v.transparent===!1&&v.blending===Vn,alphaMap:ue,alphaTest:Oe,alphaHash:C,combine:v.combine,mapUv:we&&S(v.map.channel),aoMapUv:I&&S(v.aoMap.channel),lightMapUv:xt&&S(v.lightMap.channel),bumpMapUv:pe&&S(v.bumpMap.channel),normalMapUv:ye&&S(v.normalMap.channel),displacementMapUv:Ee&&S(v.displacementMap.channel),emissiveMapUv:Ke&&S(v.emissiveMap.channel),metalnessMapUv:Ue&&S(v.metalnessMap.channel),roughnessMapUv:De&&S(v.roughnessMap.channel),anisotropyMapUv:F&&S(v.anisotropyMap.channel),clearcoatMapUv:J&&S(v.clearcoatMap.channel),clearcoatNormalMapUv:j&&S(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Q&&S(v.clearcoatRoughnessMap.channel),iridescenceMapUv:fe&&S(v.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&S(v.iridescenceThicknessMap.channel),sheenColorMapUv:oe&&S(v.sheenColorMap.channel),sheenRoughnessMapUv:xe&&S(v.sheenRoughnessMap.channel),specularMapUv:Be&&S(v.specularMap.channel),specularColorMapUv:$&&S(v.specularColorMap.channel),specularIntensityMapUv:He&&S(v.specularIntensityMap.channel),transmissionMapUv:Ae&&S(v.transmissionMap.channel),thicknessMapUv:Me&&S(v.thicknessMap.channel),alphaMapUv:ue&&S(v.alphaMap.channel),vertexTangents:!!G.attributes.tangent&&(ye||We),vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!G.attributes.color&&G.attributes.color.itemSize===4,vertexUv1s:te,vertexUv2s:V,vertexUv3s:ne,pointsUvs:Z.isPoints===!0&&!!G.attributes.uv&&(we||ue),fog:!!L,useFog:v.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:v.flatShading===!0,sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:Z.isSkinnedMesh===!0,morphTargets:G.morphAttributes.position!==void 0,morphNormals:G.morphAttributes.normal!==void 0,morphColors:G.morphAttributes.color!==void 0,morphTargetsCount:P,morphTextureStride:k,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:i.shadowMap.enabled&&H.length>0,shadowMapType:i.shadowMap.type,toneMapping:_e,useLegacyLights:i._useLegacyLights,decodeVideoTexture:we&&v.map.isVideoTexture===!0&&Ve.getTransfer(v.map.colorSpace)===qe,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Yt,flipSided:v.side===vt,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionDerivatives:se&&v.extensions.derivatives===!0,extensionFragDepth:se&&v.extensions.fragDepth===!0,extensionDrawBuffers:se&&v.extensions.drawBuffers===!0,extensionShaderTextureLOD:se&&v.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()}}function u(v){const y=[];if(v.shaderID?y.push(v.shaderID):(y.push(v.customVertexShaderID),y.push(v.customFragmentShaderID)),v.defines!==void 0)for(const H in v.defines)y.push(H),y.push(v.defines[H]);return v.isRawShaderMaterial===!1&&(E(y,v),_(y,v),y.push(i.outputColorSpace)),y.push(v.customProgramCacheKey),y.join()}function E(v,y){v.push(y.precision),v.push(y.outputColorSpace),v.push(y.envMapMode),v.push(y.envMapCubeUVHeight),v.push(y.mapUv),v.push(y.alphaMapUv),v.push(y.lightMapUv),v.push(y.aoMapUv),v.push(y.bumpMapUv),v.push(y.normalMapUv),v.push(y.displacementMapUv),v.push(y.emissiveMapUv),v.push(y.metalnessMapUv),v.push(y.roughnessMapUv),v.push(y.anisotropyMapUv),v.push(y.clearcoatMapUv),v.push(y.clearcoatNormalMapUv),v.push(y.clearcoatRoughnessMapUv),v.push(y.iridescenceMapUv),v.push(y.iridescenceThicknessMapUv),v.push(y.sheenColorMapUv),v.push(y.sheenRoughnessMapUv),v.push(y.specularMapUv),v.push(y.specularColorMapUv),v.push(y.specularIntensityMapUv),v.push(y.transmissionMapUv),v.push(y.thicknessMapUv),v.push(y.combine),v.push(y.fogExp2),v.push(y.sizeAttenuation),v.push(y.morphTargetsCount),v.push(y.morphAttributeCount),v.push(y.numDirLights),v.push(y.numPointLights),v.push(y.numSpotLights),v.push(y.numSpotLightMaps),v.push(y.numHemiLights),v.push(y.numRectAreaLights),v.push(y.numDirLightShadows),v.push(y.numPointLightShadows),v.push(y.numSpotLightShadows),v.push(y.numSpotLightShadowsWithMaps),v.push(y.numLightProbes),v.push(y.shadowMapType),v.push(y.toneMapping),v.push(y.numClippingPlanes),v.push(y.numClipIntersection),v.push(y.depthPacking)}function _(v,y){a.disableAll(),y.isWebGL2&&a.enable(0),y.supportsVertexTextures&&a.enable(1),y.instancing&&a.enable(2),y.instancingColor&&a.enable(3),y.matcap&&a.enable(4),y.envMap&&a.enable(5),y.normalMapObjectSpace&&a.enable(6),y.normalMapTangentSpace&&a.enable(7),y.clearcoat&&a.enable(8),y.iridescence&&a.enable(9),y.alphaTest&&a.enable(10),y.vertexColors&&a.enable(11),y.vertexAlphas&&a.enable(12),y.vertexUv1s&&a.enable(13),y.vertexUv2s&&a.enable(14),y.vertexUv3s&&a.enable(15),y.vertexTangents&&a.enable(16),y.anisotropy&&a.enable(17),y.alphaHash&&a.enable(18),v.push(a.mask),a.disableAll(),y.fog&&a.enable(0),y.useFog&&a.enable(1),y.flatShading&&a.enable(2),y.logarithmicDepthBuffer&&a.enable(3),y.skinning&&a.enable(4),y.morphTargets&&a.enable(5),y.morphNormals&&a.enable(6),y.morphColors&&a.enable(7),y.premultipliedAlpha&&a.enable(8),y.shadowMapEnabled&&a.enable(9),y.useLegacyLights&&a.enable(10),y.doubleSided&&a.enable(11),y.flipSided&&a.enable(12),y.useDepthPacking&&a.enable(13),y.dithering&&a.enable(14),y.transmission&&a.enable(15),y.sheen&&a.enable(16),y.opaque&&a.enable(17),y.pointsUvs&&a.enable(18),y.decodeVideoTexture&&a.enable(19),v.push(a.mask)}function A(v){const y=x[v.type];let H;if(y){const Y=Bt[y];H=Ll.clone(Y.uniforms)}else H=v.uniforms;return H}function b(v,y){let H;for(let Y=0,Z=c.length;Y0?n.push(u):m.transparent===!0?r.push(u):t.push(u)}function l(d,f,m,x,S,p){const u=o(d,f,m,x,S,p);m.transmission>0?n.unshift(u):m.transparent===!0?r.unshift(u):t.unshift(u)}function c(d,f){t.length>1&&t.sort(d||jf),n.length>1&&n.sort(f||va),r.length>1&&r.sort(f||va)}function h(){for(let d=e,f=i.length;d=s.length?(o=new xa,s.push(o)):o=s[r],o}function t(){i=new WeakMap}return{get:e,dispose:t}}function $f(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new D,color:new ke};break;case"SpotLight":t={position:new D,direction:new D,color:new ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new D,color:new ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new D,skyColor:new ke,groundColor:new ke};break;case"RectAreaLight":t={color:new ke,position:new D,halfWidth:new D,halfHeight:new D};break}return i[e.id]=t,t}}}function Jf(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let Qf=0;function ed(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function td(i,e){const t=new $f,n=Jf(),r={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 h=0;h<9;h++)r.probe.push(new D);const s=new D,o=new ot,a=new ot;function l(h,d){let f=0,m=0,x=0;for(let Y=0;Y<9;Y++)r.probe[Y].set(0,0,0);let S=0,p=0,u=0,E=0,_=0,A=0,b=0,w=0,R=0,N=0,v=0;h.sort(ed);const y=d===!0?Math.PI:1;for(let Y=0,Z=h.length;Y0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=re.LTC_FLOAT_1,r.rectAreaLTC2=re.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=re.LTC_HALF_1,r.rectAreaLTC2=re.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=f,r.ambient[1]=m,r.ambient[2]=x;const H=r.hash;(H.directionalLength!==S||H.pointLength!==p||H.spotLength!==u||H.rectAreaLength!==E||H.hemiLength!==_||H.numDirectionalShadows!==A||H.numPointShadows!==b||H.numSpotShadows!==w||H.numSpotMaps!==R||H.numLightProbes!==v)&&(r.directional.length=S,r.spot.length=u,r.rectArea.length=E,r.point.length=p,r.hemi.length=_,r.directionalShadow.length=A,r.directionalShadowMap.length=A,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=w,r.spotShadowMap.length=w,r.directionalShadowMatrix.length=A,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=w+R-N,r.spotLightMap.length=R,r.numSpotLightShadowsWithMaps=N,r.numLightProbes=v,H.directionalLength=S,H.pointLength=p,H.spotLength=u,H.rectAreaLength=E,H.hemiLength=_,H.numDirectionalShadows=A,H.numPointShadows=b,H.numSpotShadows=w,H.numSpotMaps=R,H.numLightProbes=v,r.version=Qf++)}function c(h,d){let f=0,m=0,x=0,S=0,p=0;const u=d.matrixWorldInverse;for(let E=0,_=h.length;E<_;E++){const A=h[E];if(A.isDirectionalLight){const b=r.directional[f];b.direction.setFromMatrixPosition(A.matrixWorld),s.setFromMatrixPosition(A.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(u),f++}else if(A.isSpotLight){const b=r.spot[x];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(u),b.direction.setFromMatrixPosition(A.matrixWorld),s.setFromMatrixPosition(A.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(u),x++}else if(A.isRectAreaLight){const b=r.rectArea[S];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(u),a.identity(),o.copy(A.matrixWorld),o.premultiply(u),a.extractRotation(o),b.halfWidth.set(A.width*.5,0,0),b.halfHeight.set(0,A.height*.5,0),b.halfWidth.applyMatrix4(a),b.halfHeight.applyMatrix4(a),S++}else if(A.isPointLight){const b=r.point[m];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(u),m++}else if(A.isHemisphereLight){const b=r.hemi[p];b.direction.setFromMatrixPosition(A.matrixWorld),b.direction.transformDirection(u),p++}}}return{setup:l,setupView:c,state:r}}function Ma(i,e){const t=new td(i,e),n=[],r=[];function s(){n.length=0,r.length=0}function o(d){n.push(d)}function a(d){r.push(d)}function l(d){t.setup(n,d)}function c(d){t.setupView(n,d)}return{init:s,state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:l,setupLightsView:c,pushLight:o,pushShadow:a}}function nd(i,e){let t=new WeakMap;function n(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new Ma(i,e),t.set(s,[l])):o>=a.length?(l=new Ma(i,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:n,dispose:r}}class id extends ui{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Qo,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class rd extends ui{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const sd=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,ad=`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 od(i,e,t){let n=new Xa;const r=new Ge,s=new Ge,o=new at,a=new id({depthPacking:el}),l=new rd,c={},h=t.maxTextureSize,d={[cn]:vt,[vt]:cn,[Yt]:Yt},f=new yn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:sd,fragmentShader:ad}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const x=new $t;x.setAttribute("position",new ht(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new jt(x,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ea;let u=this.type;this.render=function(b,w,R){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||b.length===0)return;const N=i.getRenderTarget(),v=i.getActiveCubeFace(),y=i.getActiveMipmapLevel(),H=i.state;H.setBlending(an),H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const Y=u!==qt&&this.type===qt,Z=u===qt&&this.type!==qt;for(let L=0,G=b.length;Lh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/ee.x),r.x=s.x*ee.x,W.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/ee.y),r.y=s.y*ee.y,W.mapSize.y=s.y)),W.map===null||Y===!0||Z===!0){const K=this.type!==qt?{minFilter:mt,magFilter:mt}:{};W.map!==null&&W.map.dispose(),W.map=new Tn(r.x,r.y,K),W.map.texture.name=X.name+".shadowMap",W.camera.updateProjectionMatrix()}i.setRenderTarget(W.map),i.clear();const q=W.getViewportCount();for(let K=0;K0||w.map&&w.alphaTest>0){const H=v.uuid,Y=w.uuid;let Z=c[H];Z===void 0&&(Z={},c[H]=Z);let L=Z[Y];L===void 0&&(L=v.clone(),Z[Y]=L),v=L}if(v.visible=w.visible,v.wireframe=w.wireframe,N===qt?v.side=w.shadowSide!==null?w.shadowSide:w.side:v.side=w.shadowSide!==null?w.shadowSide:d[w.side],v.alphaMap=w.alphaMap,v.alphaTest=w.alphaTest,v.map=w.map,v.clipShadows=w.clipShadows,v.clippingPlanes=w.clippingPlanes,v.clipIntersection=w.clipIntersection,v.displacementMap=w.displacementMap,v.displacementScale=w.displacementScale,v.displacementBias=w.displacementBias,v.wireframeLinewidth=w.wireframeLinewidth,v.linewidth=w.linewidth,R.isPointLight===!0&&v.isMeshDistanceMaterial===!0){const H=i.properties.get(v);H.light=R}return v}function A(b,w,R,N,v){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&v===qt)&&(!b.frustumCulled||n.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,b.matrixWorld);const Y=e.update(b),Z=b.material;if(Array.isArray(Z)){const L=Y.groups;for(let G=0,X=L.length;G=1):K.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),ee=q>=2);let P=null,k={};const ae=i.getParameter(i.SCISSOR_BOX),ce=i.getParameter(i.VIEWPORT),he=new at().fromArray(ae),ve=new at().fromArray(ce);function Fe(C,se,te,V){const ne=new Uint8Array(4),_e=i.createTexture();i.bindTexture(C,_e),i.texParameteri(C,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(C,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let ze=0;ze"u"?!1:/OculusBrowser/g.test(navigator.userAgent),x=new WeakMap;let S;const p=new WeakMap;let u=!1;try{u=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(T,g){return u?new OffscreenCanvas(T,g):ki("canvas")}function _(T,g,F,J){let j=1;if((T.width>J||T.height>J)&&(j=J/Math.max(T.width,T.height)),j<1||g===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const Q=g?Or:Math.floor,fe=Q(j*T.width),ie=Q(j*T.height);S===void 0&&(S=E(fe,ie));const oe=F?E(fe,ie):S;return oe.width=fe,oe.height=ie,oe.getContext("2d").drawImage(T,0,0,fe,ie),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+fe+"x"+ie+")."),oe}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function A(T){return Fs(T.width)&&Fs(T.height)}function b(T){return a?!1:T.wrapS!==Nt||T.wrapT!==Nt||T.minFilter!==mt&&T.minFilter!==wt}function w(T,g){return T.generateMipmaps&&g&&T.minFilter!==mt&&T.minFilter!==wt}function R(T){i.generateMipmap(T)}function N(T,g,F,J,j=!1){if(a===!1)return g;if(T!==null){if(i[T]!==void 0)return i[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let Q=g;if(g===i.RED&&(F===i.FLOAT&&(Q=i.R32F),F===i.HALF_FLOAT&&(Q=i.R16F),F===i.UNSIGNED_BYTE&&(Q=i.R8)),g===i.RED_INTEGER&&(F===i.UNSIGNED_BYTE&&(Q=i.R8UI),F===i.UNSIGNED_SHORT&&(Q=i.R16UI),F===i.UNSIGNED_INT&&(Q=i.R32UI),F===i.BYTE&&(Q=i.R8I),F===i.SHORT&&(Q=i.R16I),F===i.INT&&(Q=i.R32I)),g===i.RG&&(F===i.FLOAT&&(Q=i.RG32F),F===i.HALF_FLOAT&&(Q=i.RG16F),F===i.UNSIGNED_BYTE&&(Q=i.RG8)),g===i.RGBA){const fe=j?zi:Ve.getTransfer(J);F===i.FLOAT&&(Q=i.RGBA32F),F===i.HALF_FLOAT&&(Q=i.RGBA16F),F===i.UNSIGNED_BYTE&&(Q=fe===qe?i.SRGB8_ALPHA8:i.RGBA8),F===i.UNSIGNED_SHORT_4_4_4_4&&(Q=i.RGBA4),F===i.UNSIGNED_SHORT_5_5_5_1&&(Q=i.RGB5_A1)}return(Q===i.R16F||Q===i.R32F||Q===i.RG16F||Q===i.RG32F||Q===i.RGBA16F||Q===i.RGBA32F)&&e.get("EXT_color_buffer_float"),Q}function v(T,g,F){return w(T,F)===!0||T.isFramebufferTexture&&T.minFilter!==mt&&T.minFilter!==wt?Math.log2(Math.max(g.width,g.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?g.mipmaps.length:1}function y(T){return T===mt||T===os||T===Ji?i.NEAREST:i.LINEAR}function H(T){const g=T.target;g.removeEventListener("dispose",H),Z(g),g.isVideoTexture&&x.delete(g)}function Y(T){const g=T.target;g.removeEventListener("dispose",Y),G(g)}function Z(T){const g=n.get(T);if(g.__webglInit===void 0)return;const F=T.source,J=p.get(F);if(J){const j=J[g.__cacheKey];j.usedTimes--,j.usedTimes===0&&L(T),Object.keys(J).length===0&&p.delete(F)}n.remove(T)}function L(T){const g=n.get(T);i.deleteTexture(g.__webglTexture);const F=T.source,J=p.get(F);delete J[g.__cacheKey],o.memory.textures--}function G(T){const g=T.texture,F=n.get(T),J=n.get(g);if(J.__webglTexture!==void 0&&(i.deleteTexture(J.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(F.__webglFramebuffer[j]))for(let Q=0;Q=l&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+l),X+=1,T}function q(T){const g=[];return g.push(T.wrapS),g.push(T.wrapT),g.push(T.wrapR||0),g.push(T.magFilter),g.push(T.minFilter),g.push(T.anisotropy),g.push(T.internalFormat),g.push(T.format),g.push(T.type),g.push(T.generateMipmaps),g.push(T.premultiplyAlpha),g.push(T.flipY),g.push(T.unpackAlignment),g.push(T.colorSpace),g.join()}function K(T,g){const F=n.get(T);if(T.isVideoTexture&&nt(T),T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){const J=T.image;if(J===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{we(F,T,g);return}}t.bindTexture(i.TEXTURE_2D,F.__webglTexture,i.TEXTURE0+g)}function P(T,g){const F=n.get(T);if(T.version>0&&F.__version!==T.version){we(F,T,g);return}t.bindTexture(i.TEXTURE_2D_ARRAY,F.__webglTexture,i.TEXTURE0+g)}function k(T,g){const F=n.get(T);if(T.version>0&&F.__version!==T.version){we(F,T,g);return}t.bindTexture(i.TEXTURE_3D,F.__webglTexture,i.TEXTURE0+g)}function ae(T,g){const F=n.get(T);if(T.version>0&&F.__version!==T.version){Ye(F,T,g);return}t.bindTexture(i.TEXTURE_CUBE_MAP,F.__webglTexture,i.TEXTURE0+g)}const ce={[Dr]:i.REPEAT,[Nt]:i.CLAMP_TO_EDGE,[Ir]:i.MIRRORED_REPEAT},he={[mt]:i.NEAREST,[os]:i.NEAREST_MIPMAP_NEAREST,[Ji]:i.NEAREST_MIPMAP_LINEAR,[wt]:i.LINEAR,[ko]:i.LINEAR_MIPMAP_NEAREST,[ri]:i.LINEAR_MIPMAP_LINEAR},ve={[nl]:i.NEVER,[cl]:i.ALWAYS,[il]:i.LESS,[sl]:i.LEQUAL,[rl]:i.EQUAL,[ll]:i.GEQUAL,[al]:i.GREATER,[ol]:i.NOTEQUAL};function Fe(T,g,F){if(F?(i.texParameteri(T,i.TEXTURE_WRAP_S,ce[g.wrapS]),i.texParameteri(T,i.TEXTURE_WRAP_T,ce[g.wrapT]),(T===i.TEXTURE_3D||T===i.TEXTURE_2D_ARRAY)&&i.texParameteri(T,i.TEXTURE_WRAP_R,ce[g.wrapR]),i.texParameteri(T,i.TEXTURE_MAG_FILTER,he[g.magFilter]),i.texParameteri(T,i.TEXTURE_MIN_FILTER,he[g.minFilter])):(i.texParameteri(T,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(T,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(T===i.TEXTURE_3D||T===i.TEXTURE_2D_ARRAY)&&i.texParameteri(T,i.TEXTURE_WRAP_R,i.CLAMP_TO_EDGE),(g.wrapS!==Nt||g.wrapT!==Nt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(T,i.TEXTURE_MAG_FILTER,y(g.magFilter)),i.texParameteri(T,i.TEXTURE_MIN_FILTER,y(g.minFilter)),g.minFilter!==mt&&g.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),g.compareFunction&&(i.texParameteri(T,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(T,i.TEXTURE_COMPARE_FUNC,ve[g.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const J=e.get("EXT_texture_filter_anisotropic");if(g.magFilter===mt||g.minFilter!==Ji&&g.minFilter!==ri||g.type===sn&&e.has("OES_texture_float_linear")===!1||a===!1&&g.type===si&&e.has("OES_texture_half_float_linear")===!1)return;(g.anisotropy>1||n.get(g).__currentAnisotropy)&&(i.texParameterf(T,J.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,r.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy)}}function Te(T,g){let F=!1;T.__webglInit===void 0&&(T.__webglInit=!0,g.addEventListener("dispose",H));const J=g.source;let j=p.get(J);j===void 0&&(j={},p.set(J,j));const Q=q(g);if(Q!==T.__cacheKey){j[Q]===void 0&&(j[Q]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,F=!0),j[Q].usedTimes++;const fe=j[T.__cacheKey];fe!==void 0&&(j[T.__cacheKey].usedTimes--,fe.usedTimes===0&&L(g)),T.__cacheKey=Q,T.__webglTexture=j[Q].texture}return F}function we(T,g,F){let J=i.TEXTURE_2D;(g.isDataArrayTexture||g.isCompressedArrayTexture)&&(J=i.TEXTURE_2D_ARRAY),g.isData3DTexture&&(J=i.TEXTURE_3D);const j=Te(T,g),Q=g.source;t.bindTexture(J,T.__webglTexture,i.TEXTURE0+F);const fe=n.get(Q);if(Q.version!==fe.__version||j===!0){t.activeTexture(i.TEXTURE0+F);const ie=Ve.getPrimaries(Ve.workingColorSpace),oe=g.colorSpace===Lt?null:Ve.getPrimaries(g.colorSpace),xe=g.colorSpace===Lt||ie===oe?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,xe);const Be=b(g)&&A(g.image)===!1;let $=_(g.image,Be,!1,h);$=lt(g,$);const He=A($)||a,Ae=s.convert(g.format,g.colorSpace);let Me=s.convert(g.type),me=N(g.internalFormat,Ae,Me,g.colorSpace,g.isVideoTexture);Fe(J,g,He);let ue;const Oe=g.mipmaps,C=a&&g.isVideoTexture!==!0,se=fe.__version===void 0||j===!0,te=v(g,$,He);if(g.isDepthTexture)me=i.DEPTH_COMPONENT,a?g.type===sn?me=i.DEPTH_COMPONENT32F:g.type===rn?me=i.DEPTH_COMPONENT24:g.type===Mn?me=i.DEPTH24_STENCIL8:me=i.DEPTH_COMPONENT16:g.type===sn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),g.format===Sn&&me===i.DEPTH_COMPONENT&&g.type!==Hr&&g.type!==rn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),g.type=rn,Me=s.convert(g.type)),g.format===qn&&me===i.DEPTH_COMPONENT&&(me=i.DEPTH_STENCIL,g.type!==Mn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),g.type=Mn,Me=s.convert(g.type))),se&&(C?t.texStorage2D(i.TEXTURE_2D,1,me,$.width,$.height):t.texImage2D(i.TEXTURE_2D,0,me,$.width,$.height,0,Ae,Me,null));else if(g.isDataTexture)if(Oe.length>0&&He){C&&se&&t.texStorage2D(i.TEXTURE_2D,te,me,Oe[0].width,Oe[0].height);for(let V=0,ne=Oe.length;V>=1,ne>>=1}}else if(Oe.length>0&&He){C&&se&&t.texStorage2D(i.TEXTURE_2D,te,me,Oe[0].width,Oe[0].height);for(let V=0,ne=Oe.length;V0&&se++,t.texStorage2D(i.TEXTURE_CUBE_MAP,se,ue,$[0].width,$[0].height));for(let V=0;V<6;V++)if(Be){Oe?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+V,0,0,0,$[V].width,$[V].height,Me,me,$[V].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+V,0,ue,$[V].width,$[V].height,0,Me,me,$[V].data);for(let ne=0;ne>Q),$=Math.max(1,g.height>>Q);j===i.TEXTURE_3D||j===i.TEXTURE_2D_ARRAY?t.texImage3D(j,Q,oe,Be,$,g.depth,0,fe,ie,null):t.texImage2D(j,Q,oe,Be,$,0,fe,ie,null)}t.bindFramebuffer(i.FRAMEBUFFER,T),We(g)?f.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,J,j,n.get(F).__webglTexture,0,De(g)):(j===i.TEXTURE_2D||j>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,J,j,n.get(F).__webglTexture,Q),t.bindFramebuffer(i.FRAMEBUFFER,null)}function I(T,g,F){if(i.bindRenderbuffer(i.RENDERBUFFER,T),g.depthBuffer&&!g.stencilBuffer){let J=a===!0?i.DEPTH_COMPONENT24:i.DEPTH_COMPONENT16;if(F||We(g)){const j=g.depthTexture;j&&j.isDepthTexture&&(j.type===sn?J=i.DEPTH_COMPONENT32F:j.type===rn&&(J=i.DEPTH_COMPONENT24));const Q=De(g);We(g)?f.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Q,J,g.width,g.height):i.renderbufferStorageMultisample(i.RENDERBUFFER,Q,J,g.width,g.height)}else i.renderbufferStorage(i.RENDERBUFFER,J,g.width,g.height);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,T)}else if(g.depthBuffer&&g.stencilBuffer){const J=De(g);F&&We(g)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,J,i.DEPTH24_STENCIL8,g.width,g.height):We(g)?f.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,J,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,T)}else{const J=g.isWebGLMultipleRenderTargets===!0?g.texture:[g.texture];for(let j=0;j0){F.__webglFramebuffer[ie]=[];for(let oe=0;oe0){F.__webglFramebuffer=[];for(let ie=0;ie0&&We(T)===!1){const ie=Q?g:[g];F.__webglMultisampledFramebuffer=i.createFramebuffer(),F.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let oe=0;oe0)for(let oe=0;oe0)for(let oe=0;oe0&&We(T)===!1){const g=T.isWebGLMultipleRenderTargets?T.texture:[T.texture],F=T.width,J=T.height;let j=i.COLOR_BUFFER_BIT;const Q=[],fe=T.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ie=n.get(T),oe=T.isWebGLMultipleRenderTargets===!0;if(oe)for(let xe=0;xe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function nt(T){const g=o.render.frame;x.get(T)!==g&&(x.set(T,g),T.update())}function lt(T,g){const F=T.colorSpace,J=T.format,j=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||T.format===Nr||F!==Zt&&F!==Lt&&(Ve.getTransfer(F)===qe?a===!1?e.has("EXT_sRGB")===!0&&J===Ft?(T.format=Nr,T.minFilter=wt,T.generateMipmaps=!1):g=Ia.sRGBToLinear(g):(J!==Ft||j!==ln)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),g}this.allocateTextureUnit=ee,this.resetTextureUnits=W,this.setTexture2D=K,this.setTexture2DArray=P,this.setTexture3D=k,this.setTextureCube=ae,this.rebindTextures=ye,this.setupRenderTarget=Ee,this.updateRenderTargetMipmap=Ke,this.updateMultisampleRenderTarget=Ue,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=Pe,this.useMultisampledRTT=We}function ud(i,e,t){const n=t.isWebGL2;function r(s,o=Lt){let a;const l=Ve.getTransfer(o);if(s===ln)return i.UNSIGNED_BYTE;if(s===ba)return i.UNSIGNED_SHORT_4_4_4_4;if(s===Ra)return i.UNSIGNED_SHORT_5_5_5_1;if(s===Wo)return i.BYTE;if(s===Xo)return i.SHORT;if(s===Hr)return i.UNSIGNED_SHORT;if(s===Aa)return i.INT;if(s===rn)return i.UNSIGNED_INT;if(s===sn)return i.FLOAT;if(s===si)return n?i.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===qo)return i.ALPHA;if(s===Ft)return i.RGBA;if(s===Yo)return i.LUMINANCE;if(s===Ko)return i.LUMINANCE_ALPHA;if(s===Sn)return i.DEPTH_COMPONENT;if(s===qn)return i.DEPTH_STENCIL;if(s===Nr)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===jo)return i.RED;if(s===wa)return i.RED_INTEGER;if(s===Zo)return i.RG;if(s===Ca)return i.RG_INTEGER;if(s===La)return i.RGBA_INTEGER;if(s===Qi||s===er||s===tr||s===nr)if(l===qe)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Qi)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===er)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===tr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===nr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Qi)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===er)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===tr)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===nr)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===ls||s===cs||s===us||s===hs)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===ls)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===cs)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===us)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===hs)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===$o)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===fs||s===ds)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===fs)return l===qe?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===ds)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===ps||s===ms||s===_s||s===gs||s===vs||s===xs||s===Ms||s===Ss||s===Es||s===Ts||s===ys||s===As||s===bs||s===Rs)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===ps)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===ms)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===_s)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===gs)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===vs)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===xs)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Ms)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Ss)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Es)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Ts)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===ys)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===As)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===bs)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Rs)return l===qe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===ir||s===ws||s===Cs)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===ir)return l===qe?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===ws)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Cs)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Jo||s===Ls||s===Ps||s===Us)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===ir)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Ls)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Ps)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Us)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Mn?n?i.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):i[s]!==void 0?i[s]:null}return{convert:r}}class hd extends Ct{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Fi extends At{constructor(){super(),this.isGroup=!0,this.type="Group"}}const fd={type:"move"};class wr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Fi,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 Fi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Fi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const S of e.hand.values()){const p=t.getJointPose(S,n),u=this._getHandJoint(c,S);p!==null&&(u.matrix.fromArray(p.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=p.radius),u.visible=p!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=h.position.distanceTo(d.position),m=.02,x=.005;c.inputState.pinching&&f>m+x?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=m-x&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.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));a!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(fd)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Fi;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class dd extends yt{constructor(e,t,n,r,s,o,a,l,c,h){if(h=h!==void 0?h:Sn,h!==Sn&&h!==qn)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Sn&&(n=rn),n===void 0&&h===qn&&(n=Mn),super(null,r,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:mt,this.minFilter=l!==void 0?l:mt,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class pd extends Kn{constructor(e,t){super();const n=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,d=null,f=null,m=null,x=null;const S=t.getContextAttributes();let p=null,u=null;const E=[],_=[],A=new Ct;A.layers.enable(1),A.viewport=new at;const b=new Ct;b.layers.enable(2),b.viewport=new at;const w=[A,b],R=new hd;R.layers.enable(1),R.layers.enable(2);let N=null,v=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(P){let k=E[P];return k===void 0&&(k=new wr,E[P]=k),k.getTargetRaySpace()},this.getControllerGrip=function(P){let k=E[P];return k===void 0&&(k=new wr,E[P]=k),k.getGripSpace()},this.getHand=function(P){let k=E[P];return k===void 0&&(k=new wr,E[P]=k),k.getHandSpace()};function y(P){const k=_.indexOf(P.inputSource);if(k===-1)return;const ae=E[k];ae!==void 0&&(ae.update(P.inputSource,P.frame,c||o),ae.dispatchEvent({type:P.type,data:P.inputSource}))}function H(){r.removeEventListener("select",y),r.removeEventListener("selectstart",y),r.removeEventListener("selectend",y),r.removeEventListener("squeeze",y),r.removeEventListener("squeezestart",y),r.removeEventListener("squeezeend",y),r.removeEventListener("end",H),r.removeEventListener("inputsourceschange",Y);for(let P=0;P=0&&(_[ce]=null,E[ce].disconnect(ae))}for(let k=0;k=_.length){_.push(ae),ce=ve;break}else if(_[ve]===null){_[ve]=ae,ce=ve;break}if(ce===-1)break}const he=E[ce];he&&he.connect(ae)}}const Z=new D,L=new D;function G(P,k,ae){Z.setFromMatrixPosition(k.matrixWorld),L.setFromMatrixPosition(ae.matrixWorld);const ce=Z.distanceTo(L),he=k.projectionMatrix.elements,ve=ae.projectionMatrix.elements,Fe=he[14]/(he[10]-1),Te=he[14]/(he[10]+1),we=(he[9]+1)/he[5],Ye=(he[9]-1)/he[5],Pe=(he[8]-1)/he[0],I=(ve[8]+1)/ve[0],xt=Fe*Pe,pe=Fe*I,ye=ce/(-Pe+I),Ee=ye*-Pe;k.matrixWorld.decompose(P.position,P.quaternion,P.scale),P.translateX(Ee),P.translateZ(ye),P.matrixWorld.compose(P.position,P.quaternion,P.scale),P.matrixWorldInverse.copy(P.matrixWorld).invert();const Ke=Fe+ye,Ue=Te+ye,De=xt-Ee,We=pe+(ce-Ee),nt=we*Te/Ue*Ke,lt=Ye*Te/Ue*Ke;P.projectionMatrix.makePerspective(De,We,nt,lt,Ke,Ue),P.projectionMatrixInverse.copy(P.projectionMatrix).invert()}function X(P,k){k===null?P.matrixWorld.copy(P.matrix):P.matrixWorld.multiplyMatrices(k.matrixWorld,P.matrix),P.matrixWorldInverse.copy(P.matrixWorld).invert()}this.updateCamera=function(P){if(r===null)return;R.near=b.near=A.near=P.near,R.far=b.far=A.far=P.far,(N!==R.near||v!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),N=R.near,v=R.far);const k=P.parent,ae=R.cameras;X(R,k);for(let ce=0;ce0&&(p.alphaTest.value=u.alphaTest);const E=e.get(u).envMap;if(E&&(p.envMap.value=E,p.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=u.reflectivity,p.ior.value=u.ior,p.refractionRatio.value=u.refractionRatio),u.lightMap){p.lightMap.value=u.lightMap;const _=i._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=u.lightMapIntensity*_,t(u.lightMap,p.lightMapTransform)}u.aoMap&&(p.aoMap.value=u.aoMap,p.aoMapIntensity.value=u.aoMapIntensity,t(u.aoMap,p.aoMapTransform))}function o(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,u.map&&(p.map.value=u.map,t(u.map,p.mapTransform))}function a(p,u){p.dashSize.value=u.dashSize,p.totalSize.value=u.dashSize+u.gapSize,p.scale.value=u.scale}function l(p,u,E,_){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.size.value=u.size*E,p.scale.value=_*.5,u.map&&(p.map.value=u.map,t(u.map,p.uvTransform)),u.alphaMap&&(p.alphaMap.value=u.alphaMap,t(u.alphaMap,p.alphaMapTransform)),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest)}function c(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.rotation.value=u.rotation,u.map&&(p.map.value=u.map,t(u.map,p.mapTransform)),u.alphaMap&&(p.alphaMap.value=u.alphaMap,t(u.alphaMap,p.alphaMapTransform)),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest)}function h(p,u){p.specular.value.copy(u.specular),p.shininess.value=Math.max(u.shininess,1e-4)}function d(p,u){u.gradientMap&&(p.gradientMap.value=u.gradientMap)}function f(p,u){p.metalness.value=u.metalness,u.metalnessMap&&(p.metalnessMap.value=u.metalnessMap,t(u.metalnessMap,p.metalnessMapTransform)),p.roughness.value=u.roughness,u.roughnessMap&&(p.roughnessMap.value=u.roughnessMap,t(u.roughnessMap,p.roughnessMapTransform)),e.get(u).envMap&&(p.envMapIntensity.value=u.envMapIntensity)}function m(p,u,E){p.ior.value=u.ior,u.sheen>0&&(p.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),p.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(p.sheenColorMap.value=u.sheenColorMap,t(u.sheenColorMap,p.sheenColorMapTransform)),u.sheenRoughnessMap&&(p.sheenRoughnessMap.value=u.sheenRoughnessMap,t(u.sheenRoughnessMap,p.sheenRoughnessMapTransform))),u.clearcoat>0&&(p.clearcoat.value=u.clearcoat,p.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(p.clearcoatMap.value=u.clearcoatMap,t(u.clearcoatMap,p.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,t(u.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(p.clearcoatNormalMap.value=u.clearcoatNormalMap,t(u.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===vt&&p.clearcoatNormalScale.value.negate())),u.iridescence>0&&(p.iridescence.value=u.iridescence,p.iridescenceIOR.value=u.iridescenceIOR,p.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(p.iridescenceMap.value=u.iridescenceMap,t(u.iridescenceMap,p.iridescenceMapTransform)),u.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=u.iridescenceThicknessMap,t(u.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),u.transmission>0&&(p.transmission.value=u.transmission,p.transmissionSamplerMap.value=E.texture,p.transmissionSamplerSize.value.set(E.width,E.height),u.transmissionMap&&(p.transmissionMap.value=u.transmissionMap,t(u.transmissionMap,p.transmissionMapTransform)),p.thickness.value=u.thickness,u.thicknessMap&&(p.thicknessMap.value=u.thicknessMap,t(u.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=u.attenuationDistance,p.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(p.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(p.anisotropyMap.value=u.anisotropyMap,t(u.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=u.specularIntensity,p.specularColor.value.copy(u.specularColor),u.specularColorMap&&(p.specularColorMap.value=u.specularColorMap,t(u.specularColorMap,p.specularColorMapTransform)),u.specularIntensityMap&&(p.specularIntensityMap.value=u.specularIntensityMap,t(u.specularIntensityMap,p.specularIntensityMapTransform))}function x(p,u){u.matcap&&(p.matcap.value=u.matcap)}function S(p,u){const E=e.get(u).light;p.referencePosition.value.setFromMatrixPosition(E.matrixWorld),p.nearDistance.value=E.shadow.camera.near,p.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function _d(i,e,t,n){let r={},s={},o=[];const a=t.isWebGL2?i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(E,_){const A=_.program;n.uniformBlockBinding(E,A)}function c(E,_){let A=r[E.id];A===void 0&&(x(E),A=h(E),r[E.id]=A,E.addEventListener("dispose",p));const b=_.program;n.updateUBOMapping(E,b);const w=e.render.frame;s[E.id]!==w&&(f(E),s[E.id]=w)}function h(E){const _=d();E.__bindingPointIndex=_;const A=i.createBuffer(),b=E.__size,w=E.usage;return i.bindBuffer(i.UNIFORM_BUFFER,A),i.bufferData(i.UNIFORM_BUFFER,b,w),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,_,A),A}function d(){for(let E=0;E0){w=A%b;const Y=b-w;w!==0&&Y-y.boundary<0&&(A+=b-w,v.__offset=A)}A+=y.storage}return w=A%b,w>0&&(A+=b-w),E.__size=A,E.__cache={},this}function S(E){const _={boundary:0,storage:0};return typeof E=="number"?(_.boundary=4,_.storage=4):E.isVector2?(_.boundary=8,_.storage=8):E.isVector3||E.isColor?(_.boundary=16,_.storage=12):E.isVector4?(_.boundary=16,_.storage=16):E.isMatrix3?(_.boundary=48,_.storage=48):E.isMatrix4?(_.boundary=64,_.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),_}function p(E){const _=E.target;_.removeEventListener("dispose",p);const A=o.indexOf(_.__bindingPointIndex);o.splice(A,1),i.deleteBuffer(r[_.id]),delete r[_.id],delete s[_.id]}function u(){for(const E in r)i.deleteBuffer(r[E]);o=[],r={},s={}}return{bind:l,update:c,dispose:u}}class $a{constructor(e={}){const{canvas:t=hl(),context:n=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;n!==null?f=n.getContextAttributes().alpha:f=o;const m=new Uint32Array(4),x=new Int32Array(4);let S=null,p=null;const u=[],E=[];this.domElement=t,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=st,this._useLegacyLights=!1,this.toneMapping=on,this.toneMappingExposure=1;const _=this;let A=!1,b=0,w=0,R=null,N=-1,v=null;const y=new at,H=new at;let Y=null;const Z=new ke(0);let L=0,G=t.width,X=t.height,W=1,ee=null,q=null;const K=new at(0,0,G,X),P=new at(0,0,G,X);let k=!1;const ae=new Xa;let ce=!1,he=!1,ve=null;const Fe=new ot,Te=new Ge,we=new D,Ye={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Pe(){return R===null?W:1}let I=n;function xt(M,U){for(let O=0;O{function le(){if(B.forEach(function(de){Ue.get(de).currentProgram.isReady()&&B.delete(de)}),B.size===0){z(M);return}setTimeout(le,10)}pe.get("KHR_parallel_shader_compile")!==null?le():setTimeout(le,10)})};let ze=null;function $e(M){ze&&ze(M)}function bt(){ft.stop()}function Xe(){ft.start()}const ft=new qa;ft.setAnimationLoop($e),typeof self<"u"&&ft.setContext(self),this.setAnimationLoop=function(M){ze=M,ue.setAnimationLoop(M),M===null?ft.stop():ft.start()},ue.addEventListener("sessionstart",bt),ue.addEventListener("sessionend",Xe),this.render=function(M,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(A===!0)return;M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),ue.enabled===!0&&ue.isPresenting===!0&&(ue.cameraAutoUpdate===!0&&ue.updateCamera(U),U=ue.getCamera()),M.isScene===!0&&M.onBeforeRender(_,M,U,R),p=Q.get(M,E.length),p.init(),E.push(p),Fe.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),ae.setFromProjectionMatrix(Fe),he=this.localClippingEnabled,ce=fe.init(this.clippingPlanes,he),S=j.get(M,u.length),S.init(),u.push(S),Ot(M,U,0,_.sortObjects),S.finish(),_.sortObjects===!0&&S.sort(ee,q),this.info.render.frame++,ce===!0&&fe.beginShadows();const O=p.state.shadowsArray;if(ie.render(O,M,U),ce===!0&&fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),oe.render(S,M),p.setupLights(_._useLegacyLights),U.isArrayCamera){const B=U.cameras;for(let z=0,le=B.length;z0?p=E[E.length-1]:p=null,u.pop(),u.length>0?S=u[u.length-1]:S=null};function Ot(M,U,O,B){if(M.visible===!1)return;if(M.layers.test(U.layers)){if(M.isGroup)O=M.renderOrder;else if(M.isLOD)M.autoUpdate===!0&&M.update(U);else if(M.isLight)p.pushLight(M),M.castShadow&&p.pushShadow(M);else if(M.isSprite){if(!M.frustumCulled||ae.intersectsSprite(M)){B&&we.setFromMatrixPosition(M.matrixWorld).applyMatrix4(Fe);const de=g.update(M),ge=M.material;ge.visible&&S.push(M,de,ge,O,we.z,null)}}else if((M.isMesh||M.isLine||M.isPoints)&&(!M.frustumCulled||ae.intersectsObject(M))){const de=g.update(M),ge=M.material;if(B&&(M.boundingSphere!==void 0?(M.boundingSphere===null&&M.computeBoundingSphere(),we.copy(M.boundingSphere.center)):(de.boundingSphere===null&&de.computeBoundingSphere(),we.copy(de.boundingSphere.center)),we.applyMatrix4(M.matrixWorld).applyMatrix4(Fe)),Array.isArray(ge)){const Se=de.groups;for(let Le=0,be=Se.length;Le0&&io(z,le,U,O),B&&Ee.viewport(y.copy(B)),z.length>0&&fi(z,U,O),le.length>0&&fi(le,U,O),de.length>0&&fi(de,U,O),Ee.buffers.depth.setTest(!0),Ee.buffers.depth.setMask(!0),Ee.buffers.color.setMask(!0),Ee.setPolygonOffset(!1)}function io(M,U,O,B){if((O.isScene===!0?O.overrideMaterial:null)!==null)return;const le=ye.isWebGL2;ve===null&&(ve=new Tn(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?si:ln,minFilter:ri,samples:le?4:0})),_.getDrawingBufferSize(Te),le?ve.setSize(Te.x,Te.y):ve.setSize(Or(Te.x),Or(Te.y));const de=_.getRenderTarget();_.setRenderTarget(ve),_.getClearColor(Z),L=_.getClearAlpha(),L<1&&_.setClearColor(16777215,.5),_.clear();const ge=_.toneMapping;_.toneMapping=on,fi(M,O,B),De.updateMultisampleRenderTarget(ve),De.updateRenderTargetMipmap(ve);let Se=!1;for(let Le=0,be=U.length;Le0),Re=!!O.morphAttributes.position,Ze=!!O.morphAttributes.normal,Mt=!!O.morphAttributes.color;let it=on;B.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(it=_.toneMapping);const Gt=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,je=Gt!==void 0?Gt.length:0,Ne=Ue.get(B),Ki=p.state.lights;if(ce===!0&&(he===!0||M!==v)){const St=M===v&&B.id===N;fe.setState(B,M,St)}let Je=!1;B.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==Ki.state.version||Ne.outputColorSpace!==ge||z.isInstancedMesh&&Ne.instancing===!1||!z.isInstancedMesh&&Ne.instancing===!0||z.isSkinnedMesh&&Ne.skinning===!1||!z.isSkinnedMesh&&Ne.skinning===!0||z.isInstancedMesh&&Ne.instancingColor===!0&&z.instanceColor===null||z.isInstancedMesh&&Ne.instancingColor===!1&&z.instanceColor!==null||Ne.envMap!==Se||B.fog===!0&&Ne.fog!==le||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==fe.numPlanes||Ne.numIntersection!==fe.numIntersection)||Ne.vertexAlphas!==Le||Ne.vertexTangents!==be||Ne.morphTargets!==Re||Ne.morphNormals!==Ze||Ne.morphColors!==Mt||Ne.toneMapping!==it||ye.isWebGL2===!0&&Ne.morphTargetsCount!==je)&&(Je=!0):(Je=!0,Ne.__version=B.version);let un=Ne.currentProgram;Je===!0&&(un=di(B,U,z));let Qr=!1,Zn=!1,ji=!1;const dt=un.getUniforms(),hn=Ne.uniforms;if(Ee.useProgram(un.program)&&(Qr=!0,Zn=!0,ji=!0),B.id!==N&&(N=B.id,Zn=!0),Qr||v!==M){dt.setValue(I,"projectionMatrix",M.projectionMatrix),dt.setValue(I,"viewMatrix",M.matrixWorldInverse);const St=dt.map.cameraPosition;St!==void 0&&St.setValue(I,we.setFromMatrixPosition(M.matrixWorld)),ye.logarithmicDepthBuffer&&dt.setValue(I,"logDepthBufFC",2/(Math.log(M.far+1)/Math.LN2)),(B.isMeshPhongMaterial||B.isMeshToonMaterial||B.isMeshLambertMaterial||B.isMeshBasicMaterial||B.isMeshStandardMaterial||B.isShaderMaterial)&&dt.setValue(I,"isOrthographic",M.isOrthographicCamera===!0),v!==M&&(v=M,Zn=!0,ji=!0)}if(z.isSkinnedMesh){dt.setOptional(I,z,"bindMatrix"),dt.setOptional(I,z,"bindMatrixInverse");const St=z.skeleton;St&&(ye.floatVertexTextures?(St.boneTexture===null&&St.computeBoneTexture(),dt.setValue(I,"boneTexture",St.boneTexture,De),dt.setValue(I,"boneTextureSize",St.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Zi=O.morphAttributes;if((Zi.position!==void 0||Zi.normal!==void 0||Zi.color!==void 0&&ye.isWebGL2===!0)&&xe.update(z,O,un),(Zn||Ne.receiveShadow!==z.receiveShadow)&&(Ne.receiveShadow=z.receiveShadow,dt.setValue(I,"receiveShadow",z.receiveShadow)),B.isMeshGouraudMaterial&&B.envMap!==null&&(hn.envMap.value=Se,hn.flipEnvMap.value=Se.isCubeTexture&&Se.isRenderTargetTexture===!1?-1:1),Zn&&(dt.setValue(I,"toneMappingExposure",_.toneMappingExposure),Ne.needsLights&&so(hn,ji),le&&B.fog===!0&&J.refreshFogUniforms(hn,le),J.refreshMaterialUniforms(hn,B,W,X,ve),Oi.upload(I,$r(Ne),hn,De)),B.isShaderMaterial&&B.uniformsNeedUpdate===!0&&(Oi.upload(I,$r(Ne),hn,De),B.uniformsNeedUpdate=!1),B.isSpriteMaterial&&dt.setValue(I,"center",z.center),dt.setValue(I,"modelViewMatrix",z.modelViewMatrix),dt.setValue(I,"normalMatrix",z.normalMatrix),dt.setValue(I,"modelMatrix",z.matrixWorld),B.isShaderMaterial||B.isRawShaderMaterial){const St=B.uniformsGroups;for(let $i=0,oo=St.length;$i0&&De.useMultisampledRTT(M)===!1?z=Ue.get(M).__webglMultisampledFramebuffer:Array.isArray(be)?z=be[O]:z=be,y.copy(M.viewport),H.copy(M.scissor),Y=M.scissorTest}else y.copy(K).multiplyScalar(W).floor(),H.copy(P).multiplyScalar(W).floor(),Y=k;if(Ee.bindFramebuffer(I.FRAMEBUFFER,z)&&ye.drawBuffers&&B&&Ee.drawBuffers(M,z),Ee.viewport(y),Ee.scissor(H),Ee.setScissorTest(Y),le){const Se=Ue.get(M.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+U,Se.__webglTexture,O)}else if(de){const Se=Ue.get(M.texture),Le=U||0;I.framebufferTextureLayer(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,Se.__webglTexture,O||0,Le)}N=-1},this.readRenderTargetPixels=function(M,U,O,B,z,le,de){if(!(M&&M.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ue.get(M).__webglFramebuffer;if(M.isWebGLCubeRenderTarget&&de!==void 0&&(ge=ge[de]),ge){Ee.bindFramebuffer(I.FRAMEBUFFER,ge);try{const Se=M.texture,Le=Se.format,be=Se.type;if(Le!==Ft&&He.convert(Le)!==I.getParameter(I.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Re=be===si&&(pe.has("EXT_color_buffer_half_float")||ye.isWebGL2&&pe.has("EXT_color_buffer_float"));if(be!==ln&&He.convert(be)!==I.getParameter(I.IMPLEMENTATION_COLOR_READ_TYPE)&&!(be===sn&&(ye.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=M.width-B&&O>=0&&O<=M.height-z&&I.readPixels(U,O,B,z,He.convert(Le),He.convert(be),le)}finally{const Se=R!==null?Ue.get(R).__webglFramebuffer:null;Ee.bindFramebuffer(I.FRAMEBUFFER,Se)}}},this.copyFramebufferToTexture=function(M,U,O=0){const B=Math.pow(2,-O),z=Math.floor(U.image.width*B),le=Math.floor(U.image.height*B);De.setTexture2D(U,0),I.copyTexSubImage2D(I.TEXTURE_2D,O,0,0,M.x,M.y,z,le),Ee.unbindTexture()},this.copyTextureToTexture=function(M,U,O,B=0){const z=U.image.width,le=U.image.height,de=He.convert(O.format),ge=He.convert(O.type);De.setTexture2D(O,0),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,O.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,O.unpackAlignment),U.isDataTexture?I.texSubImage2D(I.TEXTURE_2D,B,M.x,M.y,z,le,de,ge,U.image.data):U.isCompressedTexture?I.compressedTexSubImage2D(I.TEXTURE_2D,B,M.x,M.y,U.mipmaps[0].width,U.mipmaps[0].height,de,U.mipmaps[0].data):I.texSubImage2D(I.TEXTURE_2D,B,M.x,M.y,de,ge,U.image),B===0&&O.generateMipmaps&&I.generateMipmap(I.TEXTURE_2D),Ee.unbindTexture()},this.copyTextureToTexture3D=function(M,U,O,B,z=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const le=M.max.x-M.min.x+1,de=M.max.y-M.min.y+1,ge=M.max.z-M.min.z+1,Se=He.convert(B.format),Le=He.convert(B.type);let be;if(B.isData3DTexture)De.setTexture3D(B,0),be=I.TEXTURE_3D;else if(B.isDataArrayTexture)De.setTexture2DArray(B,0),be=I.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,B.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,B.unpackAlignment);const Re=I.getParameter(I.UNPACK_ROW_LENGTH),Ze=I.getParameter(I.UNPACK_IMAGE_HEIGHT),Mt=I.getParameter(I.UNPACK_SKIP_PIXELS),it=I.getParameter(I.UNPACK_SKIP_ROWS),Gt=I.getParameter(I.UNPACK_SKIP_IMAGES),je=O.isCompressedTexture?O.mipmaps[0]:O.image;I.pixelStorei(I.UNPACK_ROW_LENGTH,je.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,je.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,M.min.x),I.pixelStorei(I.UNPACK_SKIP_ROWS,M.min.y),I.pixelStorei(I.UNPACK_SKIP_IMAGES,M.min.z),O.isDataTexture||O.isData3DTexture?I.texSubImage3D(be,z,U.x,U.y,U.z,le,de,ge,Se,Le,je.data):O.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),I.compressedTexSubImage3D(be,z,U.x,U.y,U.z,le,de,ge,Se,je.data)):I.texSubImage3D(be,z,U.x,U.y,U.z,le,de,ge,Se,Le,je),I.pixelStorei(I.UNPACK_ROW_LENGTH,Re),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,Ze),I.pixelStorei(I.UNPACK_SKIP_PIXELS,Mt),I.pixelStorei(I.UNPACK_SKIP_ROWS,it),I.pixelStorei(I.UNPACK_SKIP_IMAGES,Gt),z===0&&B.generateMipmaps&&I.generateMipmap(be),Ee.unbindTexture()},this.initTexture=function(M){M.isCubeTexture?De.setTextureCube(M,0):M.isData3DTexture?De.setTexture3D(M,0):M.isDataArrayTexture||M.isCompressedArrayTexture?De.setTexture2DArray(M,0):De.setTexture2D(M,0),Ee.unbindTexture()},this.resetState=function(){b=0,w=0,R=null,Ee.reset(),Ae.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Kt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Vr?"display-p3":"srgb",t.unpackColorSpace=Ve.workingColorSpace===Xi?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===st?En:Pa}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===En?st:Zt}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(e){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=e}}class gd extends $a{}gd.prototype.isWebGL1Renderer=!0;class vd extends At{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class qr extends $t{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const s=[],o=[];a(r),c(n),h(),this.setAttribute("position",new zt(s,3)),this.setAttribute("normal",new zt(s.slice(),3)),this.setAttribute("uv",new zt(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(E){const _=new D,A=new D,b=new D;for(let w=0;w.9&&R<.1&&(_<.2&&(o[E+0]+=1),A<.2&&(o[E+2]+=1),b<.2&&(o[E+4]+=1))}}function f(E){s.push(E.x,E.y,E.z)}function m(E,_){const A=E*3;_.x=e[A+0],_.y=e[A+1],_.z=e[A+2]}function x(){const E=new D,_=new D,A=new D,b=new D,w=new Ge,R=new Ge,N=new Ge;for(let v=0,y=0;vr.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 pr(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 Ur(){return Ur=Object.assign||function(t){for(var e=1;es.dispose()),this[ur].add(n),r[n]=a}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[we]){const s=this[we][n];if(us(s)){const a=s;a.getChild()===e&&this.setRef(n,r,a.getAttributes())}else if(Or(s)){const c=s.find(f=>f.getChild()===e);if(c){const f=c.getAttributes();this.removeRef(n,e).addRef(n,r,f)}}else if(Fr(s)){const a=s;for(const c in a){const f=a[c];f.getChild()===e&&this.setRefMap(n,c,r,f.getAttributes())}}}return this}get(e){return this[we][e]}set(e,r){return this[we][e]=r,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const r=this[we][e];return r?r.getChild():null}setRef(e,r,n){if(this[ur].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const s=this[we][e];if(s&&s.dispose(),!r)return this;const a=this.graph.createEdge(e,this,r,n);return a.addEventListener("dispose",()=>{delete this[we][e],this.dispatchEvent({type:"change",attribute:e})}),this[we][e]=a,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this[we][e].map(n=>n.getChild())}addRef(e,r,n){const s=this.graph.createEdge(e,this,r,n),a=this[we][e];return a.push(s),s.addEventListener("dispose",()=>{let c;for(;(c=a.indexOf(s))!==-1;)a.splice(c,1);this.dispatchEvent({type:"change",attribute:e})}),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,r){return this[we][e].filter(a=>a.getChild()===r).forEach(a=>a.dispose()),this}listRefMapKeys(e){return Object.keys(this[we][e])}listRefMapValues(e){return Object.values(this[we][e]).map(r=>r.getChild())}getRefMap(e,r){const n=this[we][e];return n[r]?n[r].getChild():null}setRefMap(e,r,n,s){const a=this[we][e],c=a[r];if(c&&c.dispose(),!n)return this;s=Object.assign(s||{},{key:r});const f=this.graph.createEdge(e,this,n,Ur({},s,{key:r}));return f.addEventListener("dispose",()=>{delete a[r],this.dispatchEvent({type:"change",attribute:e,key:r})}),a[r]=f,this.dispatchEvent({type:"change",attribute:e,key:r})}dispatchEvent(e){return super.dispatchEvent(Ur({},e,{target:this})),this.graph.dispatchEvent(Ur({},e,{target:this,type:`node:${e.type}`})),this}}const _a="v3.8.0",gr="@glb.bin";var X,wn,tt,ht,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"})(X||(X={})),function(t){t.INTERLEAVED="interleaved",t.SEPARATE="separate"}(wn||(wn={})),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"}(tt||(tt={})),function(t){t[t.R=4096]="R",t[t.G=256]="G",t[t.B=16]="B",t[t.A=1]="A"}(ht||(ht={})),function(t){t.GLTF="GLTF",t.GLB="GLB"}(Zt||(Zt={}));const Mn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var hn,hs=typeof Float32Array<"u"?Float32Array:Array;function is(t){return Math.hypot(t[0],t[1],t[2])}function ph(t,e,r){var n=e[0],s=e[1],a=e[2],c=r[3]*n+r[7]*s+r[11]*a+r[15];return t[0]=(r[0]*n+r[4]*s+r[8]*a+r[12])/(c=c||1),t[1]=(r[1]*n+r[5]*s+r[9]*a+r[13])/c,t[2]=(r[2]*n+r[6]*s+r[10]*a+r[14])/c,t}function gh(t){const e={min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]},r=t.propertyType===X.NODE?[t]:t.listChildren();for(const n of r)n.traverse(s=>{const a=s.getMesh();if(!a)return;const c=mh(a,s.getWorldMatrix());ds(c.min,e),ds(c.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)}),hn=new hs(3),hs!=Float32Array&&(hn[0]=0,hn[1]=0,hn[2]=0);function mh(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 a=[0,0,0],c=[0,0,0];for(let f=0;f"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 a of e)r+=a.byteLength;const n=new Uint8Array(r);let s=0;for(const a of e)n.set(a,s),s+=a.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 a=e.byteLength;a>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,a]=this.convertLinearToSRGB(e,r);return 255*n<<16^255*s<<8^255*a<<0}static convertSRGBToLinear(e,r){const n=e,s=r;for(let a=0;a<3;a++)s[a]=n[a]<.04045?.0773993808*n[a]:Math.pow(.9478672986*n[a]+.0521327014,2.4);return r}static convertLinearToSRGB(e,r){const n=e,s=r;for(let a=0;a<3;a++)s[a]=n[a]<.0031308?12.92*n[a]:1.055*Math.pow(n[a],.41666)-.055;return r}},Ra=class ba{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 ae.decodeText(e.slice(12,16))===ba.PNG_FRIED_CHUNK_NAME?[r.getUint32(32,!1),r.getUint32(36,!1)]:[r.getUint32(16,!1),r.getUint32(20,!1)]}getChannels(e){return 4}};Ra.PNG_FRIED_CHUNK_NAME="CgBI";let yt=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 vh(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}yt.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),vh(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 Ra};let mr=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 yt.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 Wi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Kt(t){if(Wi(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return Wi(r)!==!1&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")!==!1}var as,ps;(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"})(ps||(ps={}));let Qt=class Dr{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=Dr.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=Dr.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=Dr.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=Dr.Verbosity.ERROR&&console.error(e)}};function yh(t,e,r){var n=e[0],s=e[1],a=e[2],c=e[3],f=e[4],h=e[5],d=e[6],g=e[7],x=e[8],w=e[9],M=e[10],A=e[11],N=e[12],m=e[13],C=e[14],T=e[15],R=r[0],b=r[1],O=r[2],P=r[3];return t[0]=R*n+b*f+O*x+P*N,t[1]=R*s+b*h+O*w+P*m,t[2]=R*a+b*d+O*M+P*C,t[3]=R*c+b*g+O*A+P*T,t[4]=(R=r[4])*n+(b=r[5])*f+(O=r[6])*x+(P=r[7])*N,t[5]=R*s+b*h+O*w+P*m,t[6]=R*a+b*d+O*M+P*C,t[7]=R*c+b*g+O*A+P*T,t[8]=(R=r[8])*n+(b=r[9])*f+(O=r[10])*x+(P=r[11])*N,t[9]=R*s+b*h+O*w+P*m,t[10]=R*a+b*d+O*M+P*C,t[11]=R*c+b*g+O*A+P*T,t[12]=(R=r[12])*n+(b=r[13])*f+(O=r[14])*x+(P=r[15])*N,t[13]=R*s+b*h+O*w+P*m,t[14]=R*a+b*d+O*M+P*C,t[15]=R*c+b*g+O*A+P*T,t}as=Qt,Qt.Verbosity=ps,Qt.DEFAULT_INSTANCE=new as(as.Verbosity.INFO);let Ne=class gs{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 gs.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 gs.encodeNormalizedInt(e,r)}static decompose(e,r,n,s){let a=is([e[0],e[1],e[2]]);const c=is([e[4],e[5],e[6]]),f=is([e[8],e[9],e[10]]);var h,d,g,x,w,M,A,N,m,C,T,R,b,O,P,V,B;((d=(h=e)[0])*(A=h[5])-(g=h[1])*(M=h[4]))*((R=h[10])*(B=h[15])-(b=h[11])*(V=h[14]))-(d*(N=h[6])-(x=h[2])*M)*((T=h[9])*B-b*(P=h[13]))+(d*(m=h[7])-(w=h[3])*M)*(T*V-R*P)+(g*N-x*A)*((C=h[8])*B-b*(O=h[12]))-(g*m-w*A)*(C*V-R*O)+(x*m-w*N)*(C*P-T*O)<0&&(a=-a),r[0]=e[12],r[1]=e[13],r[2]=e[14];const k=e.slice(),G=1/a,H=1/c,K=1/f;k[0]*=G,k[1]*=G,k[2]*=G,k[4]*=H,k[5]*=H,k[6]*=H,k[8]*=K,k[9]*=K,k[10]*=K,function(L,U){var ee=new hs(3);(function(Ot,He){var xt=He[4],ze=He[5],Ft=He[6],Wr=He[8],nr=He[9],Tt=He[10];Ot[0]=Math.hypot(He[0],He[1],He[2]),Ot[1]=Math.hypot(xt,ze,Ft),Ot[2]=Math.hypot(Wr,nr,Tt)})(ee,U);var fe=1/ee[0],re=1/ee[1],ge=1/ee[2],ve=U[0]*fe,xe=U[1]*re,Te=U[2]*ge,Re=U[4]*fe,Ue=U[5]*re,Ae=U[6]*ge,Ce=U[8]*fe,Qe=U[9]*re,ot=U[10]*ge,Je=ve+Ue+ot,Me=0;Je>0?(Me=2*Math.sqrt(Je+1),L[3]=.25*Me,L[0]=(Ae-Qe)/Me,L[1]=(Ce-Te)/Me,L[2]=(xe-Re)/Me):ve>Ue&&ve>ot?(Me=2*Math.sqrt(1+ve-Ue-ot),L[3]=(Ae-Qe)/Me,L[0]=.25*Me,L[1]=(xe+Re)/Me,L[2]=(Ce+Te)/Me):Ue>ot?(Me=2*Math.sqrt(1+Ue-ve-ot),L[3]=(Ce-Te)/Me,L[0]=(xe+Re)/Me,L[1]=.25*Me,L[2]=(Ae+Qe)/Me):(Me=2*Math.sqrt(1+ot-ve-Ue),L[3]=(xe-Re)/Me,L[0]=(Ce+Te)/Me,L[1]=(Ae+Qe)/Me,L[2]=.25*Me)}(n,k),s[0]=a,s[1]=c,s[2]=f}static compose(e,r,n,s){const a=s,c=r[0],f=r[1],h=r[2],d=r[3],g=c+c,x=f+f,w=h+h,M=c*g,A=c*x,N=c*w,m=f*x,C=f*w,T=h*w,R=d*g,b=d*x,O=d*w,P=n[0],V=n[1],B=n[2];return a[0]=(1-(m+T))*P,a[1]=(A+O)*P,a[2]=(N-b)*P,a[3]=0,a[4]=(A-O)*V,a[5]=(1-(M+T))*V,a[6]=(C+R)*V,a[7]=0,a[8]=(N+b)*B,a[9]=(C-R)*B,a[10]=(1-(M+m))*B,a[11]=0,a[12]=e[0],a[13]=e[1],a[14]=e[2],a[15]=1,a}};function xh(t,e){if(!!t!=!!e)return!1;const r=t.getChild(),n=e.getChild();return r===n||r.equals(n)}function Th(t,e){if(!!t!=!!e||t.length!==e.length)return!1;for(let r=0;rt,_h=new Set;let Cs=class extends Ss{constructor(e,r=""){super(e),this[we].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,It)}copy(e,r=It){for(const n in this[we]){const s=this[we][n];if(s instanceof pr)this[ur].has(n)||s.dispose();else if(Or(s))for(const a of s)a.dispose();else if(Fr(s))for(const a in s)s[a].dispose()}for(const n in e[we]){const s=this[we][n],a=e[we][n];if(a instanceof pr)this[ur].has(n)?s.getChild().copy(r(a.getChild()),r):this.setRef(n,r(a.getChild()),a.getAttributes());else if(Or(a))for(const c of a)this.addRef(n,r(c.getChild()),c.getAttributes());else if(Fr(a))for(const c in a){const f=a[c];this.setRefMap(n,c,r(f.getChild()),f.getAttributes())}else this[we][n]=Kt(a)?JSON.parse(JSON.stringify(a)):Array.isArray(a)||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a.slice():a}return this}equals(e,r=_h){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const n in this[we]){if(r.has(n))continue;const s=this[we][n],a=e[we][n];if(us(s)||us(a)){if(!xh(s,a))return!1}else if(Or(s)||Or(a)){if(!Th(s,a))return!1}else if(Fr(s)||Fr(a)){if(!Eh(s,a))return!1}else if(Kt(s)||Kt(a)){if(!Ia(s,a))return!1}else if(_n(s)||_n(a)){if(!Aa(s,a))return!1}else if(s!==a)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}},Ke=class extends Cs{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")}},te=class Ie extends Ke{constructor(...e){super(...e),this.i=Ne.identity,this.o=Ne.identity}init(){this.propertyType=X.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:Ie.Type.SCALAR,componentType:Ie.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}copy(e,r=It){return super.copy(e,r),this.i=e.i,this.o=e.o,this}static getElementSize(e){switch(e){case Ie.Type.SCALAR:return 1;case Ie.Type.VEC2:return 2;case Ie.Type.VEC3:return 3;case Ie.Type.VEC4:case Ie.Type.MAT2:return 4;case Ie.Type.MAT3:return 9;case Ie.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case Ie.ComponentType.BYTE:case Ie.ComponentType.UNSIGNED_BYTE:return 1;case Ie.ComponentType.SHORT:case Ie.ComponentType.UNSIGNED_SHORT:return 2;case Ie.ComponentType.UNSIGNED_INT:case Ie.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;nNe.decodeNormalizedInt(r,this.get("componentType")),this.i=r=>Ne.encodeNormalizedInt(r,this.get("componentType"))):(this.o=Ne.identity,this.i=Ne.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 a=0;ae.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===X.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}},zr=class Pa extends Ke{init(){this.propertyType=X.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:Pa.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:tt.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:tt.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)}};zr.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};let bh=class extends Cs{init(){this.propertyType=X.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:tt.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}};function Ye(){return Ye=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}},Ua=class extends Ke{init(){this.propertyType=X.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:tt.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}},La=class extends Ke{init(){this.propertyType=X.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||yt.extensionToMimeType(mr.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const r=yt.extensionToMimeType(mr.extension(e));return r&&this.set("mimeType",r),this}getImage(){return this.get("image")}setImage(e){return this.set("image",ae.assertView(e))}getSize(){const e=this.get("image");return e?yt.getSize(e,this.getMimeType()):null}},ja=class extends Ke{init(){this.propertyType=X.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${_a}`,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=It){if(r===It)throw new Error("Root cannot be copied.");this.set("asset",Ye({},e.get("asset"))),this.setName(e.getName()),this.setExtras(Ye({},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 ka?this.addRef("scenes",e):e instanceof $a?this.addRef("nodes",e):e instanceof qr?this.addRef("cameras",e):e instanceof Ua?this.addRef("skins",e):e instanceof Da?this.addRef("meshes",e):e instanceof vr?this.addRef("materials",e):e instanceof La?this.addRef("textures",e):e instanceof Sa?this.addRef("animations",e):e instanceof te?this.addRef("accessors",e):e instanceof Na&&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")}},Os=class yn{static fromGraph(e){return yn.v.get(e)||null}constructor(){this.T=new uh,this.S=new ja(this.T),this.M=Qt.DEFAULT_INSTANCE,yn.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 yn().setLogger(this.M).merge(this)}merge(e){for(const a of e.getRoot().listExtensionsUsed()){const c=this.createExtension(a.constructor);a.isRequired()&&c.setRequired(!0)}const r=new Set,n=new Map;r.add(e.S),n.set(e.S,this.S);for(const a of e.T.listEdges())for(const c of[a.getParent(),a.getChild()]){if(r.has(c))continue;let f;f=c.propertyType===X.TEXTURE_INFO?c:new c.constructor(this.T),n.set(c,f),r.add(c)}const s=a=>{const c=n.get(a);if(!c)throw new Error("Could resolve property.");return c};for(const a of r){const c=n.get(a);if(!c)throw new Error("Could resolve property.");c.propertyType!==X.TEXTURE_INFO&&c.copy(a,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 ka(this.T,e)}createNode(e=""){return new $a(this.T,e)}createCamera(e=""){return new qr(this.T,e)}createSkin(e=""){return new Ua(this.T,e)}createMesh(e=""){return new Da(this.T,e)}createPrimitive(){return new zr(this.T)}createPrimitiveTarget(e=""){return new bh(this.T,e)}createMaterial(e=""){return new vr(this.T,e)}createTexture(e=""){return new La(this.T,e)}createAnimation(e=""){return new Sa(this.T,e)}createAnimationChannel(e=""){return new Ns(this.T,e)}createAnimationSampler(e=""){return new Dn(this.T,e)}createAccessor(e="",r=null){return r||(r=this.getRoot().listBuffers()[0]),new te(this.T,e).setBuffer(r)}createBuffer(e=""){return new Na(this.T,e)}};Os.v=new WeakMap;let Se=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,a=s.target;a instanceof $e&&a.extensionName===this.extensionName&&(s.type==="node:create"&&this.N(a),s.type==="node:dispose"&&this.O(a))};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}};Se.EXTENSION_NAME=void 0;let Ah=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 Ki={logger:Qt.DEFAULT_INSTANCE,extensions:[],dependencies:{}};let Ih=class{static read(e,r=Ki){const n=Ye({},Ki,r),{json:s}=e,a=new Os().setLogger(n.logger);this.validate(e,n);const c=new Ah(e),f=s.asset,h=a.getRoot().getAsset();f.copyright&&(h.copyright=f.copyright),f.extras&&(h.extras=f.extras),s.extras!==void 0&&a.getRoot().setExtras(Ye({},s.extras));const d=s.extensionsUsed||[],g=s.extensionsRequired||[];for(const T of n.extensions)if(d.includes(T.EXTENSION_NAME)){const R=a.createExtension(T).setRequired(g.includes(T.EXTENSION_NAME));for(const b of R.readDependencies)R.install(b,n.dependencies[b])}const x=s.buffers||[];a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.BUFFER)).forEach(T=>T.preread(c,X.BUFFER)),c.buffers=x.map(T=>{const R=a.createBuffer(T.name);return T.extras&&R.setExtras(T.extras),T.uri&&T.uri.indexOf("__")!==0&&R.setURI(T.uri),R}),c.bufferViewBuffers=(s.bufferViews||[]).map((T,R)=>{if(!c.bufferViews[R]){const b=e.json.buffers[T.buffer];c.bufferViews[R]=ae.toView(b.uri?e.resources[b.uri]:e.resources[gr],T.byteOffset||0,T.byteLength)}return c.buffers[T.buffer]});const w=s.accessors||[];c.accessors=w.map(T=>{const R=a.createAccessor(T.name,c.bufferViewBuffers[T.bufferView]).setType(T.type);return T.extras&&R.setExtras(T.extras),T.normalized!==void 0&&R.setNormalized(T.normalized),T.bufferView===void 0||R.setArray(mn(T,c)),R});const M=s.images||[],A=s.textures||[];a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.TEXTURE)).forEach(T=>T.preread(c,X.TEXTURE)),c.textures=M.map(T=>{const R=a.createTexture(T.name);if(T.extras&&R.setExtras(T.extras),T.bufferView!==void 0){const b=s.bufferViews[T.bufferView],O=e.json.buffers[b.buffer],P=b.byteOffset||0,V=(O.uri?e.resources[O.uri]:e.resources[gr]).slice(P,P+b.byteLength);R.setImage(V)}else T.uri!==void 0&&(R.setImage(e.resources[T.uri]),T.uri.indexOf("__")!==0&&R.setURI(T.uri));if(T.mimeType!==void 0)R.setMimeType(T.mimeType);else if(T.uri){const b=mr.extension(T.uri);R.setMimeType(yt.extensionToMimeType(b))}return R}),c.materials=(s.materials||[]).map(T=>{const R=a.createMaterial(T.name);T.extras&&R.setExtras(T.extras),T.alphaMode!==void 0&&R.setAlphaMode(T.alphaMode),T.alphaCutoff!==void 0&&R.setAlphaCutoff(T.alphaCutoff),T.doubleSided!==void 0&&R.setDoubleSided(T.doubleSided);const b=T.pbrMetallicRoughness||{};if(b.baseColorFactor!==void 0&&R.setBaseColorFactor(b.baseColorFactor),T.emissiveFactor!==void 0&&R.setEmissiveFactor(T.emissiveFactor),b.metallicFactor!==void 0&&R.setMetallicFactor(b.metallicFactor),b.roughnessFactor!==void 0&&R.setRoughnessFactor(b.roughnessFactor),b.baseColorTexture!==void 0){const O=b.baseColorTexture;R.setBaseColorTexture(c.textures[A[O.index].source]),c.setTextureInfo(R.getBaseColorTextureInfo(),O)}if(T.emissiveTexture!==void 0){const O=T.emissiveTexture;R.setEmissiveTexture(c.textures[A[O.index].source]),c.setTextureInfo(R.getEmissiveTextureInfo(),O)}if(T.normalTexture!==void 0){const O=T.normalTexture;R.setNormalTexture(c.textures[A[O.index].source]),c.setTextureInfo(R.getNormalTextureInfo(),O),T.normalTexture.scale!==void 0&&R.setNormalScale(T.normalTexture.scale)}if(T.occlusionTexture!==void 0){const O=T.occlusionTexture;R.setOcclusionTexture(c.textures[A[O.index].source]),c.setTextureInfo(R.getOcclusionTextureInfo(),O),T.occlusionTexture.strength!==void 0&&R.setOcclusionStrength(T.occlusionTexture.strength)}if(b.metallicRoughnessTexture!==void 0){const O=b.metallicRoughnessTexture;R.setMetallicRoughnessTexture(c.textures[A[O.index].source]),c.setTextureInfo(R.getMetallicRoughnessTextureInfo(),O)}return R});const N=s.meshes||[];a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.PRIMITIVE)).forEach(T=>T.preread(c,X.PRIMITIVE)),c.meshes=N.map(T=>{const R=a.createMesh(T.name);return T.extras&&R.setExtras(T.extras),T.weights!==void 0&&R.setWeights(T.weights),(T.primitives||[]).forEach(b=>{const O=a.createPrimitive();b.extras&&O.setExtras(b.extras),b.material!==void 0&&O.setMaterial(c.materials[b.material]),b.mode!==void 0&&O.setMode(b.mode);for(const[V,B]of Object.entries(b.attributes||{}))O.setAttribute(V,c.accessors[B]);b.indices!==void 0&&O.setIndices(c.accessors[b.indices]);const P=T.extras&&T.extras.targetNames||[];(b.targets||[]).forEach((V,B)=>{const k=P[B]||B.toString(),G=a.createPrimitiveTarget(k);for(const[H,K]of Object.entries(V))G.setAttribute(H,c.accessors[K]);O.addTarget(G)}),R.addPrimitive(O)}),R}),c.cameras=(s.cameras||[]).map(T=>{const R=a.createCamera(T.name).setType(T.type);if(T.extras&&R.setExtras(T.extras),T.type===qr.Type.PERSPECTIVE){const b=T.perspective;R.setYFov(b.yfov),R.setZNear(b.znear),b.zfar!==void 0&&R.setZFar(b.zfar),b.aspectRatio!==void 0&&R.setAspectRatio(b.aspectRatio)}else{const b=T.orthographic;R.setZNear(b.znear).setZFar(b.zfar).setXMag(b.xmag).setYMag(b.ymag)}return R});const m=s.nodes||[];a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.NODE)).forEach(T=>T.preread(c,X.NODE)),c.nodes=m.map(T=>{const R=a.createNode(T.name);if(T.extras&&R.setExtras(T.extras),T.translation!==void 0&&R.setTranslation(T.translation),T.rotation!==void 0&&R.setRotation(T.rotation),T.scale!==void 0&&R.setScale(T.scale),T.matrix!==void 0){const b=[0,0,0],O=[0,0,0,1],P=[1,1,1];Ne.decompose(T.matrix,b,O,P),R.setTranslation(b),R.setRotation(O),R.setScale(P)}return T.weights!==void 0&&R.setWeights(T.weights),R}),c.skins=(s.skins||[]).map(T=>{const R=a.createSkin(T.name);T.extras&&R.setExtras(T.extras),T.inverseBindMatrices!==void 0&&R.setInverseBindMatrices(c.accessors[T.inverseBindMatrices]),T.skeleton!==void 0&&R.setSkeleton(c.nodes[T.skeleton]);for(const b of T.joints)R.addJoint(c.nodes[b]);return R}),m.map((T,R)=>{const b=c.nodes[R];(T.children||[]).forEach(O=>b.addChild(c.nodes[O])),T.mesh!==void 0&&b.setMesh(c.meshes[T.mesh]),T.camera!==void 0&&b.setCamera(c.cameras[T.camera]),T.skin!==void 0&&b.setSkin(c.skins[T.skin])}),c.animations=(s.animations||[]).map(T=>{const R=a.createAnimation(T.name);T.extras&&R.setExtras(T.extras);const b=(T.samplers||[]).map(O=>{const P=a.createAnimationSampler().setInput(c.accessors[O.input]).setOutput(c.accessors[O.output]).setInterpolation(O.interpolation||Dn.Interpolation.LINEAR);return O.extras&&P.setExtras(O.extras),R.addSampler(P),P});return(T.channels||[]).forEach(O=>{const P=a.createAnimationChannel().setSampler(b[O.sampler]).setTargetPath(O.target.path);O.target.node!==void 0&&P.setTargetNode(c.nodes[O.target.node]),O.extras&&P.setExtras(O.extras),R.addChannel(P)}),R});const C=s.scenes||[];return a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.SCENE)).forEach(T=>T.preread(c,X.SCENE)),c.scenes=C.map(T=>{const R=a.createScene(T.name);return T.extras&&R.setExtras(T.extras),(T.nodes||[]).map(b=>c.nodes[b]).forEach(b=>R.addChild(b)),R}),s.scene!==void 0&&a.getRoot().setDefaultScene(c.scenes[s.scene]),a.getRoot().listExtensionsUsed().forEach(T=>T.read(c)),w.forEach((T,R)=>{const b=c.accessors[R],O=!!T.sparse,P=!T.bufferView&&!b.getArray();(O||P)&&b.setSparse(!0).setArray(function(V,B){const k=Mn[V.componentType],G=te.getElementSize(V.type);let H;H=V.bufferView!==void 0?mn(V,B):new k(V.count*G);const K=V.sparse;if(!K)return H;const L=K.count,U=Ye({},V,K.indices,{count:L,type:"SCALAR"}),ee=Ye({},V,K.values,{count:L}),fe=mn(U,B),re=mn(ee,B);for(let ge=0;gea.EXTENSION_NAME===s))throw new Error(`Missing required extension, "${s}".`)}if(n.extensionsUsed)for(const s of n.extensionsUsed)r.extensions.find(a=>a.EXTENSION_NAME===s)||r.logger.warn(`Missing optional extension, "${s}".`)}};function mn(t,e){const r=e.bufferViews[t.bufferView],n=e.jsonDoc.json.bufferViews[t.bufferView],s=Mn[t.componentType],a=te.getElementSize(t.type),c=s.BYTES_PER_ELEMENT;if(n.byteStride!==void 0&&n.byteStride!==a*c)return function(h,d){const g=d.bufferViews[h.bufferView],x=d.jsonDoc.json.bufferViews[h.bufferView],w=Mn[h.componentType],M=te.getElementSize(h.type),A=w.BYTES_PER_ELEMENT,N=h.byteOffset||0,m=new w(h.count*M),C=new DataView(g.buffer,g.byteOffset,g.byteLength),T=x.byteStride;for(let R=0;R1,()=>n.basename||"buffer"),this.imageURIGenerator=new Ji(c>1,f=>function(h,d){const g=h.getGraph().listParentEdges(d).find(x=>x.getParent()!==h.getRoot());return g?g.getName().replace(/texture$/i,""):""}(e,f)||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 a={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(s)},c=JSON.stringify(a);this.textureDefIndexMap.has(c)||(this.textureDefIndexMap.set(c,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(a));const f={index:this.textureDefIndexMap.get(c)};return r.getTexCoord()!==0&&(f.texCoord=r.getTexCoord()),Object.keys(r.getExtras()).length>0&&(f.extras=r.getExtras()),this.textureInfoDefMap.set(r,f),f}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=yt.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 tt.SPARSE;for(const n of this.C.getGraph().listParentEdges(e)){const{usage:s}=n.getAttributes();if(s)return s;n.getParent().propertyType!==X.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${n.getName()}".`)}return tt.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}};ut.BufferViewTarget=jr,ut.BufferViewUsage=tt,ut.USAGE_TO_TARGET={[tt.ARRAY_BUFFER]:jr.ARRAY_BUFFER,[tt.ELEMENT_ARRAY_BUFFER]:jr.ELEMENT_ARRAY_BUFFER};let Ji=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:vn}=ut,{UNSIGNED_INT:Sh,UNSIGNED_SHORT:Ch,UNSIGNED_BYTE:Nh}=te.ComponentType;let Oh=class{static write(e,r){const n=e.getRoot(),s={asset:Ye({generator:`glTF-Transform ${_a}`},n.getAsset()),extras:Ye({},n.getExtras())},a={json:s,resources:{}},c=new ut(e,a,r),f=r.logger||Qt.DEFAULT_INSTANCE,h=new Set(r.extensions.map(m=>m.EXTENSION_NAME)),d=e.getRoot().listExtensionsUsed().filter(m=>h.has(m.extensionName)),g=e.getRoot().listExtensionsRequired().filter(m=>h.has(m.extensionName));d.lengthL.getCount()/3){const Re=(100*ee.length/L.getCount()).toFixed(1);f.warn(`Sparse accessor with many non-zero elements (${Re}%) may increase file size.`)}const Te=Mn[L.getComponentType()];xe.indices=ee,xe.values=new Te(fe)}if(!Number.isFinite(P))return{buffers:R,byteLength:b};const V=P<255?Uint8Array:P<65535?Uint16Array:Uint32Array,B=P<255?Nh:P<65535?Ch:Sh,k={buffer:C,byteOffset:T+b,byteLength:0};for(const L of m){const U=O.get(L);if(U.count===0)continue;U.indicesByteOffset=k.byteLength;const ee=ae.pad(ae.toView(new V(U.indices)));R.push(ee),b+=ee.byteLength,k.byteLength+=ee.byteLength}s.bufferViews.push(k);const G=s.bufferViews.length-1,H={buffer:C,byteOffset:T+b,byteLength:0};for(const L of m){const U=O.get(L);if(U.count===0)continue;U.valuesByteOffset=H.byteLength;const ee=ae.pad(ae.toView(U.values));R.push(ee),b+=ee.byteLength,H.byteLength+=ee.byteLength}s.bufferViews.push(H);const K=s.bufferViews.length-1;for(const L of m){const U=O.get(L);U.count!==0&&(U.accessorDef.sparse={count:U.count,indices:{bufferView:G,byteOffset:U.indicesByteOffset,componentType:B},values:{bufferView:K,byteOffset:U.valuesByteOffset}})}return{buffers:R,byteLength:b}}const A=new Map;for(const m of e.getGraph().listEdges()){if(m.getParent()===n)continue;const C=m.getChild();if(C instanceof te){const T=A.get(C)||[];T.push(m),A.set(C,T)}}if(s.accessors=[],s.bufferViews=[],s.samplers=[],s.textures=[],s.images=n.listTextures().map((m,C)=>{const T=c.createPropertyDef(m);m.getMimeType()&&(T.mimeType=m.getMimeType());const R=m.getImage();return R&&c.createImageData(T,R,m),c.imageIndexMap.set(m,C),T}),d.filter(m=>m.prewriteTypes.includes(X.ACCESSOR)).forEach(m=>m.prewrite(c,X.ACCESSOR)),n.listAccessors().forEach(m=>{const C=c.accessorUsageGroupedByParent,T=c.accessorParents;if(c.accessorIndexMap.has(m))return;const R=A.get(m)||[],b=c.getAccessorUsage(m);if(c.addAccessorToUsageGroup(m,b),C.has(b)){const O=R[0].getParent(),P=T.get(O)||new Set;P.add(m),T.set(O,P)}}),d.filter(m=>m.prewriteTypes.includes(X.BUFFER)).forEach(m=>m.prewrite(c,X.BUFFER)),(n.listAccessors().length>0||n.listTextures().length>0||c.otherBufferViews.size>0)&&n.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");s.buffers=[],n.listBuffers().forEach((m,C)=>{const T=c.createPropertyDef(m),R=c.accessorUsageGroupedByParent,b=c.accessorParents,O=m.listParents().filter(H=>H instanceof te),P=new Set(O),V=[],B=s.buffers.length;let k=0;const G=c.listAccessorUsageGroups();for(const H in G)if(R.has(H))for(const K of Array.from(b.values())){const L=Array.from(K).filter(U=>P.has(U)).filter(U=>c.getAccessorUsage(U)===H);if(L.length)if(H!==vn.ARRAY_BUFFER||r.vertexLayout===wn.INTERLEAVED){const U=H===vn.ARRAY_BUFFER?w(L,B,k):x(L,B,k);k+=U.byteLength,V.push(...U.buffers)}else for(const U of L){const ee=w([U],B,k);k+=ee.byteLength,V.push(...ee.buffers)}}else{const K=G[H].filter(ee=>P.has(ee));if(!K.length)continue;const L=H===vn.ELEMENT_ARRAY_BUFFER?ut.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,U=H===vn.SPARSE?M(K,B,k):x(K,B,k,L);k+=U.byteLength,V.push(...U.buffers)}if(c.imageBufferViews.length&&C===0){for(let H=0;H!m.getBuffer())&&f.warn("Skipped writing one or more Accessors: no Buffer assigned."),s.materials=n.listMaterials().map((m,C)=>{const T=c.createPropertyDef(m);if(m.getAlphaMode()!==vr.AlphaMode.OPAQUE&&(T.alphaMode=m.getAlphaMode()),m.getAlphaMode()===vr.AlphaMode.MASK&&(T.alphaCutoff=m.getAlphaCutoff()),m.getDoubleSided()&&(T.doubleSided=!0),T.pbrMetallicRoughness={},Ne.eq(m.getBaseColorFactor(),[1,1,1,1])||(T.pbrMetallicRoughness.baseColorFactor=m.getBaseColorFactor()),Ne.eq(m.getEmissiveFactor(),[0,0,0])||(T.emissiveFactor=m.getEmissiveFactor()),m.getRoughnessFactor()!==1&&(T.pbrMetallicRoughness.roughnessFactor=m.getRoughnessFactor()),m.getMetallicFactor()!==1&&(T.pbrMetallicRoughness.metallicFactor=m.getMetallicFactor()),m.getBaseColorTexture()){const R=m.getBaseColorTexture(),b=m.getBaseColorTextureInfo();T.pbrMetallicRoughness.baseColorTexture=c.createTextureInfoDef(R,b)}if(m.getEmissiveTexture()){const R=m.getEmissiveTexture(),b=m.getEmissiveTextureInfo();T.emissiveTexture=c.createTextureInfoDef(R,b)}if(m.getNormalTexture()){const R=m.getNormalTexture(),b=m.getNormalTextureInfo(),O=c.createTextureInfoDef(R,b);m.getNormalScale()!==1&&(O.scale=m.getNormalScale()),T.normalTexture=O}if(m.getOcclusionTexture()){const R=m.getOcclusionTexture(),b=m.getOcclusionTextureInfo(),O=c.createTextureInfoDef(R,b);m.getOcclusionStrength()!==1&&(O.strength=m.getOcclusionStrength()),T.occlusionTexture=O}if(m.getMetallicRoughnessTexture()){const R=m.getMetallicRoughnessTexture(),b=m.getMetallicRoughnessTextureInfo();T.pbrMetallicRoughness.metallicRoughnessTexture=c.createTextureInfoDef(R,b)}return c.materialIndexMap.set(m,C),T}),s.meshes=n.listMeshes().map((m,C)=>{const T=c.createPropertyDef(m);let R=null;return T.primitives=m.listPrimitives().map(b=>{const O={attributes:{}};O.mode=b.getMode();const P=b.getMaterial();P&&(O.material=c.materialIndexMap.get(P)),Object.keys(b.getExtras()).length&&(O.extras=b.getExtras());const V=b.getIndices();V&&(O.indices=c.accessorIndexMap.get(V));for(const B of b.listSemantics())O.attributes[B]=c.accessorIndexMap.get(b.getAttribute(B));for(const B of b.listTargets()){const k={};for(const G of B.listSemantics())k[G]=c.accessorIndexMap.get(B.getAttribute(G));O.targets=O.targets||[],O.targets.push(k)}return b.listTargets().length&&!R&&(R=b.listTargets().map(B=>B.getName())),O}),m.getWeights().length&&(T.weights=m.getWeights()),R&&(T.extras=T.extras||{},T.extras.targetNames=R),c.meshIndexMap.set(m,C),T}),s.cameras=n.listCameras().map((m,C)=>{const T=c.createPropertyDef(m);if(T.type=m.getType(),T.type===qr.Type.PERSPECTIVE){T.perspective={znear:m.getZNear(),zfar:m.getZFar(),yfov:m.getYFov()};const R=m.getAspectRatio();R!==null&&(T.perspective.aspectRatio=R)}else T.orthographic={znear:m.getZNear(),zfar:m.getZFar(),xmag:m.getXMag(),ymag:m.getYMag()};return c.cameraIndexMap.set(m,C),T}),s.nodes=n.listNodes().map((m,C)=>{const T=c.createPropertyDef(m);return Ne.eq(m.getTranslation(),[0,0,0])||(T.translation=m.getTranslation()),Ne.eq(m.getRotation(),[0,0,0,1])||(T.rotation=m.getRotation()),Ne.eq(m.getScale(),[1,1,1])||(T.scale=m.getScale()),m.getWeights().length&&(T.weights=m.getWeights()),c.nodeIndexMap.set(m,C),T}),s.skins=n.listSkins().map((m,C)=>{const T=c.createPropertyDef(m),R=m.getInverseBindMatrices();R&&(T.inverseBindMatrices=c.accessorIndexMap.get(R));const b=m.getSkeleton();return b&&(T.skeleton=c.nodeIndexMap.get(b)),T.joints=m.listJoints().map(O=>c.nodeIndexMap.get(O)),c.skinIndexMap.set(m,C),T}),n.listNodes().forEach((m,C)=>{const T=s.nodes[C],R=m.getMesh();R&&(T.mesh=c.meshIndexMap.get(R));const b=m.getCamera();b&&(T.camera=c.cameraIndexMap.get(b));const O=m.getSkin();O&&(T.skin=c.skinIndexMap.get(O)),m.listChildren().length>0&&(T.children=m.listChildren().map(P=>c.nodeIndexMap.get(P)))}),s.animations=n.listAnimations().map((m,C)=>{const T=c.createPropertyDef(m),R=new Map;return T.samplers=m.listSamplers().map((b,O)=>{const P=c.createPropertyDef(b);return P.input=c.accessorIndexMap.get(b.getInput()),P.output=c.accessorIndexMap.get(b.getOutput()),P.interpolation=b.getInterpolation(),R.set(b,O),P}),T.channels=m.listChannels().map(b=>{const O=c.createPropertyDef(b);return O.sampler=R.get(b.getSampler()),O.target={node:c.nodeIndexMap.get(b.getTargetNode()),path:b.getTargetPath()},O}),c.animationIndexMap.set(m,C),T}),s.scenes=n.listScenes().map((m,C)=>{const T=c.createPropertyDef(m);return T.nodes=m.listChildren().map(R=>c.nodeIndexMap.get(R)),c.sceneIndexMap.set(m,C),T});const N=n.getDefaultScene();return N&&(s.scene=n.listScenes().indexOf(N)),s.extensionsUsed=d.map(m=>m.extensionName),s.extensionsRequired=g.map(m=>m.extensionName),d.forEach(m=>m.write(c)),function(m){const C=[];for(const T in m){const R=m[T];(Array.isArray(R)&&R.length===0||R===null||R===""||R&&typeof R=="object"&&Object.keys(R).length===0)&&C.push(T)}for(const T of C)delete m[T]}(s),a}};var Rn;(function(t){t[t.JSON=1313821514]="JSON",t[t.BIN=5130562]="BIN"})(Rn||(Rn={}));let Fh=class{constructor(){this.M=Qt.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=wn.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=Zi(r)?this.L(r):{json:JSON.parse(ae.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),Ih.read(e,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(e){const r=this.L(ae.assertView(e));this.D(r);const n=r.json;if(n.buffers&&n.buffers.some(s=>function(a,c){return c.uri!==void 0&&!(c.uri in a.resources)}(r,s)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(n.images&&n.images.some(s=>function(a,c){return c.uri!==void 0&&!(c.uri in a.resources)&&c.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(ae.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 Oh.write(e,{format:r.format||Zt.GLTF,basename:r.basename||"",logger:this.M,vertexLayout:this.P,dependencies:Ye({},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]),a=JSON.stringify(r),c=ae.pad(ae.encodeText(a),32),f=ae.toView(new Uint32Array([c.byteLength,1313821514])),h=ae.concat([f,c]);s[s.length-1]+=h.byteLength;const d=Object.values(n)[0];if(!d||!d.byteLength)return ae.concat([ae.toView(s),h]);const g=ae.pad(d,0),x=ae.toView(new Uint32Array([g.byteLength,5130562])),w=ae.concat([x,g]);return s[s.length-1]+=w.byteLength,ae.concat([ae.toView(s),h,w])}async j(e,r){var n=this;const s=[...e.json.images||[],...e.json.buffers||[]].map(async function(a){const c=a.uri;if(!c||c.match(/data:/))return Promise.resolve();e.resources[c]=await n.readURI(n.resolve(r,c),"view"),n.lastReadBytes+=e.resources[c].byteLength});await Promise.all(s)}D(e){function r(n){if(n.uri){if(n.uri in e.resources)ae.assertView(e.resources[n.uri]);else if(n.uri.match(/data:/)){const s=`__${Mh()}.${mr.extension(n.uri)}`;e.resources[s]=ae.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:Ye({},e.json),resources:Ye({},e.resources)},r&&(e.json.images=r.map(s=>Ye({},s))),n&&(e.json.buffers=n.map(s=>Ye({},s))),e}L(e){if(!Zi(e))throw new Error("Invalid glTF 2.0 binary.");const r=new Uint32Array(e.buffer,e.byteOffset+12,2);if(r[1]!==Rn.JSON)throw new Error("Missing required GLB JSON chunk.");const n=r[0],s=ae.decodeText(ae.toView(e,20,n)),a=JSON.parse(s),c=20+n;if(e.byteLength<=c)return{json:a,resources:{}};const f=new Uint32Array(e.buffer,e.byteOffset+c,2);if(f[1]!==Rn.BIN)throw new Error("Expected GLB BIN in second chunk.");const h=ae.toView(e,c+8,f[0]);return{json:a,resources:{[gr]:h}}}};function Zi(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 Dh=class extends Fh{constructor(e=Lr.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 Lr.resolve(e,r)}dirname(e){return Lr.dirname(e)}};const $h=0,Ph=0,kh=0,Uh=2,Lh=0,jh=163,Bh=166,zh=0,Vh=2,Gh=1,Hh=64,qh=0;class Wh{constructor(){this.vkFormat=qh,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=$h,this.levels=[],this.dataFormatDescriptor=[{vendorId:kh,descriptorType:Ph,descriptorBlockSize:0,versionNumber:Uh,colorModel:Lh,colorPrimaries:Gh,transferFunction:Vh,flags:zh,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Ir{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[Ut])return;const s=r.extensions[Ut],a=this.createInstancedMesh();for(const c in s.attributes)a.setAttribute(c,e.accessors[s.attributes[c]]);e.nodes[n].setExtension(Ut,a)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(ys);for(const r of this.properties)for(const n of r.listAttributes())e.addAccessorToUsageGroup(n,ys);return this}write(e){const r=e.jsonDoc;return this.document.getRoot().listNodes().forEach(n=>{const s=n.getExtension(Ut);if(s){const a=e.nodeIndexMap.get(n),c=r.json.nodes[a],f={attributes:{}};s.listSemantics().forEach(h=>{const d=s.getAttribute(h);f.attributes[h]=e.accessorIndexMap.get(d)}),c.extensions=c.extensions||{},c.extensions[Ut]=f}}),this}}function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e8?8:4,c.componentType=a>8?ea:Xh,c.normalized=!0,f=t.getElementSize()===3?function(h){const d=new Float32Array(4*h.length/3);for(let g=0,x=h.length/3;gcs(h,t.getComponentType())),c.max=c.max.map(h=>cs(h,t.getComponentType()))),c.normalized&&(c.min=c.min.map(h=>ta(h,c.componentType)),c.max=c.max.map(h=>ta(h,c.componentType)))}else c.byteStride%4&&(c.array=function(f,h){const d=ae.padNumber(f.BYTES_PER_ELEMENT*h)/f.BYTES_PER_ELEMENT,g=new f.constructor(f.length/h*d);for(let x=0;x*hr instanceof zr&&r.getMode()===zr.Mode.TRIANGLES)?dr.TRIANGLES:dr.INDICES:dr.ATTRIBUTES}function Zh(t,e){const r=e.getGraph().listParentEdges(t).filter(n=>!(n.getParent()instanceof ja));for(const n of r){const s=n.getName(),a=n.getAttributes().key||"",c=n.getParent().propertyType===X.PRIMITIVE_TARGET;if(s==="indices")return{filter:De.NONE};if(s==="attributes"){if(a==="POSITION")return{filter:De.NONE};if(a==="TEXCOORD_0")return{filter:De.NONE};if(a.startsWith("JOINTS_"))return{filter:De.NONE};if(a.startsWith("WEIGHTS_"))return{filter:De.NONE};if(a==="NORMAL"||a==="TANGENT")return c?{filter:De.NONE}:{filter:De.OCTAHEDRAL,bits:8}}if(s==="output"){const f=Ga(t);return f==="rotation"?{filter:De.QUATERNION,bits:16}:f==="translation"||f==="scale"?{filter:De.EXPONENTIAL,bits:12}:{filter:De.NONE}}if(s==="input")return{filter:De.NONE};if(s==="inverseBindMatrices")return{filter:De.NONE}}return{filter:De.NONE}}function Ga(t){for(const e of t.listParents())if(e instanceof Dn){for(const r of e.listParents())if(r instanceof Ns)return r.getTargetPath()}return null}const Xe=vs,ra={method:Vr.QUANTIZE};class xs extends Se{constructor(...e){super(...e),this.extensionName=Xe,this.prereadTypes=[X.BUFFER,X.PRIMITIVE],this.prewriteTypes=[X.BUFFER,X.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=ra,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=At({},ra,e),this}preread(e,r){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${Xe}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${Xe}]: Missing WASM support.`)}return r===X.BUFFER?this._prereadBuffers(e):r===X.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const r=e.jsonDoc;(r.json.bufferViews||[]).forEach((n,s)=>{if(!n.extensions||!n.extensions[Xe])return;const a=n.extensions[Xe],c=a.byteOffset||0,f=a.byteLength||0,h=a.count,d=a.byteStride,g=new Uint8Array(h*d),x=r.json.buffers[a.buffer],w=ae.toView(x.uri?r.resources[x.uri]:r.resources[gr],c,f);this._decoder.decodeGltfBuffer(g,h,d,w,a.mode,a.filter),e.bufferViews[s]=g})}_prereadPrimitives(e){const r=e.jsonDoc;(r.json.bufferViews||[]).forEach(n=>{var s;n.extensions&&n.extensions[Xe]&&(s=r.json.buffers[n.buffer]).extensions&&s.extensions[vs]&&s.extensions[vs].fallback&&this._decoderFallbackBufferMap.set(e.buffers[n.buffer],e.buffers[n.extensions[Xe].buffer])})}read(e){if(!this.isRequired())return this;for(const[r,n]of this._decoderFallbackBufferMap){for(const s of r.listParents())s instanceof te&&s.swap(r,n);r.dispose()}return this}prewrite(e,r){return r===X.ACCESSOR?this._prewriteAccessors(e):r===X.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const r=e.jsonDoc.json,n=this._encoder,s=this._encoderOptions,a=this.document.createBuffer(),c=this.document.getRoot().listBuffers().indexOf(a);this._encoderFallbackBuffer=a,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const f of this.document.getRoot().listAccessors()){if(Ga(f)==="weights"||f.getSparse())continue;const h=e.getAccessorUsage(f),d=Jh(f,h),g=s.method===Vr.FILTER?Zh(f,this.document):{filter:De.NONE},x=Kh(f,n,d,g),{array:w,byteStride:M}=x,A=f.getBuffer();if(!A)throw new Error(`${Xe}: Missing buffer for accessor.`);const N=this.document.getRoot().listBuffers().indexOf(A),m=[h,d,g.filter,M,N].join(":");let C=this._encoderBufferViews[m],T=this._encoderBufferViewData[m],R=this._encoderBufferViewAccessors[m];C&&T||(R=this._encoderBufferViewAccessors[m]=[],T=this._encoderBufferViewData[m]=[],C=this._encoderBufferViews[m]={buffer:c,target:ut.USAGE_TO_TARGET[h],byteOffset:0,byteLength:0,byteStride:h===ut.BufferViewUsage.ARRAY_BUFFER?M:void 0,extensions:{[Xe]:{buffer:N,byteOffset:0,byteLength:0,mode:d,filter:g.filter!==De.NONE?g.filter:void 0,byteStride:M,count:0}}});const b=e.createAccessorDef(f);b.componentType=x.componentType,b.normalized=x.normalized,b.byteOffset=C.byteLength,b.min&&x.min&&(b.min=x.min),b.max&&x.max&&(b.max=x.max),e.accessorIndexMap.set(f,r.accessors.length),r.accessors.push(b),R.push(b),T.push(new Uint8Array(w.buffer,w.byteOffset,w.byteLength)),C.byteLength+=w.byteLength,C.extensions.EXT_meshopt_compression.count+=f.getCount()}}_prewriteBuffers(e){const r=this._encoder;for(const n in this._encoderBufferViews){const s=this._encoderBufferViews[n],a=this._encoderBufferViewData[n],c=this.document.getRoot().listBuffers()[s.extensions[Xe].buffer],f=e.otherBufferViews.get(c)||[],{count:h,byteStride:d,mode:g}=s.extensions[Xe],x=ae.concat(a),w=r.encodeGltfBuffer(x,h,d,g),M=ae.pad(w);s.extensions[Xe].byteLength=w.byteLength,a.length=0,a.push(M),f.push(M),e.otherBufferViews.set(c,f)}}write(e){let r=0;for(const c in this._encoderBufferViews){const f=this._encoderBufferViews[c],h=e.otherBufferViewsIndexMap.get(this._encoderBufferViewData[c][0]),d=this._encoderBufferViewAccessors[c];for(const w of d)w.bufferView=h;const g=e.jsonDoc.json.bufferViews[h],x=g.byteOffset||0;Object.assign(g,f),g.byteOffset=r,g.extensions[Xe].byteOffset=x,r+=ae.padNumber(f.byteLength)}const n=this._encoderFallbackBuffer,s=e.bufferIndexMap.get(n),a=e.jsonDoc.json.buffers[s];return a.byteLength=r,a.extensions={[Xe]:{fallback:!0}},n.dispose(),this}}xs.EXTENSION_NAME=Xe,xs.EncoderMethod=Vr;const $r="EXT_texture_avif";class Qh{match(e){return e.length>=12&&ae.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=na(r,0);if(!n)return null;let s=n.end;for(;n=na(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 Ha extends Se{constructor(...e){super(...e),this.extensionName=$r,this.prereadTypes=[X.TEXTURE]}static register(){yt.registerFormat("image/avif",new Qh)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[$r]&&(r.source=r.extensions[$r].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(a=>{a.source===s&&(a.extensions=a.extensions||{},a.extensions[$r]={source:a.source},delete a.source)})}}),this}}function na(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=ae.decodeText(e.slice(0,4)),n=ae.decodeText(e.slice(8,12));if(r!=="RIFF"||n!=="WEBP")return null;const s=new DataView(e.buffer,e.byteOffset);let a=12;for(;a>6)]}a+=8+f+f%2}return null}getChannels(e){return 4}}class qa extends Se{constructor(...e){super(...e),this.extensionName=Pr,this.prereadTypes=[X.TEXTURE]}static register(){yt.registerFormat("image/webp",new ed)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[Pr]&&(r.source=r.extensions[Pr].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(a=>{a.source===s&&(a.extensions=a.extensions||{},a.extensions[Pr]={source:a.source},delete a.source)})}}),this}}qa.EXTENSION_NAME=Pr;const sa=Ba;let Le,Wa,Xa,st;function td(t,e){const r=new Le.DecoderBuffer;try{if(r.Init(e,e.length),t.GetEncodedGeometryType(r)!==Le.TRIANGULAR_MESH)throw new Error(`[${sa}] Unknown geometry type.`);const n=new Le.Mesh;if(!t.DecodeBufferToMesh(r,n).ok()||n.ptr===0)throw new Error(`[${sa}] Decoding failure.`);return n}finally{Le.destroy(r)}}function rd(t,e){const r=3*e.num_faces();let n,s;if(e.num_points()<=65534){const a=r*Uint16Array.BYTES_PER_ELEMENT;n=Le._malloc(a),t.GetTrianglesUInt16Array(e,a,n),s=new Uint16Array(Le.HEAPU16.buffer,n,r).slice()}else{const a=r*Uint32Array.BYTES_PER_ELEMENT;n=Le._malloc(a),t.GetTrianglesUInt32Array(e,a,n),s=new Uint32Array(Le.HEAPU32.buffer,n,r).slice()}return Le._free(n),s}function nd(t,e,r,n){const s=Xa[n.componentType],a=Wa[n.componentType],c=r.num_components(),f=e.num_points()*c,h=f*a.BYTES_PER_ELEMENT,d=Le._malloc(h);t.GetAttributeDataArrayForAllPoints(e,r,s,h,d);const g=new a(Le.HEAPF32.buffer,d,f).slice();return Le._free(d),g}var Gr,it;(function(t){t[t.EDGEBREAKER=1]="EDGEBREAKER",t[t.SEQUENTIAL=0]="SEQUENTIAL"})(Gr||(Gr={})),function(t){t.POSITION="POSITION",t.NORMAL="NORMAL",t.COLOR="COLOR",t.TEX_COORD="TEX_COORD",t.GENERIC="GENERIC"}(it||(it={}));const Ya={[it.POSITION]:14,[it.NORMAL]:10,[it.COLOR]:8,[it.TEX_COORD]:12,[it.GENERIC]:12},ia={decodeSpeed:5,encodeSpeed:5,method:Gr.EDGEBREAKER,quantizationBits:Ya,quantizationVolume:"mesh"};function sd(t,e=ia){const r=At({},ia,e);r.quantizationBits=At({},Ya,e.quantizationBits);const n=new st.MeshBuilder,s=new st.Mesh,a=new st.ExpertEncoder(s),c={},f=new st.DracoInt8Array,h=t.listTargets().length>0;let d=!1;for(const N of t.listSemantics()){const m=t.getAttribute(N);if(m.getSparse()){d=!0;continue}const C=id(N),T=ad(n,m.getComponentType(),s,st[C],m.getCount(),m.getElementSize(),m.getArray());if(T===-1)throw new Error(`Error compressing "${N}" attribute.`);if(c[N]=T,r.quantizationVolume==="mesh"||N!=="POSITION")a.SetAttributeQuantization(T,r.quantizationBits[C]);else{if(typeof r.quantizationVolume!="object")throw new Error("Invalid quantization volume state.");{const{quantizationVolume:R}=r,b=Math.max(R.max[0]-R.min[0],R.max[1]-R.min[1],R.max[2]-R.min[2]);a.SetAttributeExplicitQuantization(T,r.quantizationBits[C],m.getElementSize(),R.min,b)}}}const g=t.getIndices();if(!g)throw new Ts("Primitive must have indices.");n.AddFacesToMesh(s,g.getCount()/3,g.getArray()),a.SetSpeedOptions(r.encodeSpeed,r.decodeSpeed),a.SetTrackEncodedProperties(!0),a.SetEncodingMethod(r.method===Gr.SEQUENTIAL||h||d?st.MESH_SEQUENTIAL_ENCODING:st.MESH_EDGEBREAKER_ENCODING);const x=a.EncodeToDracoBuffer(!(h||d),f);if(x<=0)throw new Ts("Error applying Draco compression.");const w=new Uint8Array(x);for(let N=0;NT.propertyType));if(C.size!==2||!C.has(X.PRIMITIVE)||!C.has(X.ROOT))throw new Error(`[${Fe}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const m of Array.from(d)){const C=N.get(m),T=m.getIndices();if(M.get(T)!==C||m.listAttributes().some(R=>M.get(R)!==C))throw new Error(`[${Fe}] Draco primitives must share all, or no, accessors.`)}for(const m of Array.from(g)){const C=m.getIndices();if(M.has(C)||m.listAttributes().some(T=>M.has(T)))throw new Error(`[${Fe}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return N}(this.document),a=new Map;let c="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?n.warn(`[${Fe}]: quantizationVolume=scene requires exactly 1 scene.`):c=gh(this.document.getRoot().listScenes().pop()));for(const f of Array.from(s.keys())){const h=s.get(f);if(!h)throw new Error("Unexpected primitive.");if(a.has(h)){a.set(h,a.get(h));continue}const d=f.getIndices(),g=e.jsonDoc.json.accessors;let x;try{x=sd(f,At({},this._encoderOptions,{quantizationVolume:c}))}catch(A){if(A instanceof Ts){n.warn(`[${Fe}]: ${A.message} Skipping primitive compression.`);continue}throw A}a.set(h,x);const w=e.createAccessorDef(d);w.count=x.numIndices,e.accessorIndexMap.set(d,g.length),g.push(w);for(const A of f.listSemantics()){const N=f.getAttribute(A);if(x.attributeIDs[A]===void 0)continue;const m=e.createAccessorDef(N);m.count=x.numVertices,e.accessorIndexMap.set(N,g.length),g.push(m)}const M=f.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(M)||e.otherBufferViews.set(M,[]),e.otherBufferViews.get(M).push(x.data)}return n.debug(`[${Fe}] Compressed ${s.size} primitives.`),e.extensionData[Fe]={primitiveHashMap:s,primitiveEncodingMap:a},this}write(e){const r=e.extensionData[Fe];for(const n of this.document.getRoot().listMeshes()){const s=e.jsonDoc.json.meshes[e.meshIndexMap.get(n)];for(let a=0;as!==Fe),n.extensionsRequired=(n.extensionsRequired||[]).filter(s=>s!==Fe)}return this}}function aa(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("|")}Es.EXTENSION_NAME=Fe,Es.EncoderMethod=Gr;class yr extends $e{init(){this.extensionName=Ds,this.propertyType="Light",this.parentTypes=[X.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:yr.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getColorHex(){return Ze.factorToHex(this.getColor())}setColorHex(e){const r=this.getColor().slice();return Ze.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)}}yr.EXTENSION_NAME=Ds,yr.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};const gt=Ds;class Ka extends Se{constructor(...e){super(...e),this.extensionName=gt}createLight(e=""){return new yr(this.document.getGraph(),e)}read(e){const r=e.jsonDoc;if(!r.json.extensions||!r.json.extensions[gt])return this;const n=(r.json.extensions[gt].lights||[]).map(s=>{var a,c;const f=this.createLight().setName(s.name||"").setType(s.type);return s.color!==void 0&&f.setColor(s.color),s.intensity!==void 0&&f.setIntensity(s.intensity),s.range!==void 0&&f.setRange(s.range),((a=s.spot)==null?void 0:a.innerConeAngle)!==void 0&&f.setInnerConeAngle(s.spot.innerConeAngle),((c=s.spot)==null?void 0:c.outerConeAngle)!==void 0&&f.setOuterConeAngle(s.spot.outerConeAngle),f});return r.json.nodes.forEach((s,a)=>{s.extensions&&s.extensions[gt]&&e.nodes[a].setExtension(gt,n[s.extensions[gt].light])}),this}write(e){const r=e.jsonDoc;if(this.properties.size===0)return this;const n=[],s=new Map;for(const a of this.properties){const c=a,f={type:c.getType()};Ne.eq(c.getColor(),[1,1,1])||(f.color=c.getColor()),c.getIntensity()!==1&&(f.intensity=c.getIntensity()),c.getRange()!=null&&(f.range=c.getRange()),c.getName()&&(f.name=c.getName()),c.getType()===yr.Type.SPOT&&(f.spot={innerConeAngle:c.getInnerConeAngle(),outerConeAngle:c.getOuterConeAngle()}),n.push(f),s.set(c,n.length-1)}return this.document.getRoot().listNodes().forEach(a=>{const c=a.getExtension(gt);if(c){const f=e.nodeIndexMap.get(a),h=r.json.nodes[f];h.extensions=h.extensions||{},h.extensions[gt]={light:s.get(c)}}}),r.json.extensions=r.json.extensions||{},r.json.extensions[gt]={lights:n},this}}Ka.EXTENSION_NAME=gt;const{R:od,G:cd,B:ld}=ht;class Ja extends $e{init(){this.extensionName=$s,this.propertyType="Anisotropy",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new Oe(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:od|cd|ld})}}Ja.EXTENSION_NAME=$s;const Lt=$s;class Za extends Se{constructor(...e){super(...e),this.extensionName=Lt}createAnisotropy(){return new Ja(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Lt]){const c=this.createAnisotropy();e.materials[a].setExtension(Lt,c);const f=s.extensions[Lt];if(f.anisotropyStrength!==void 0&&c.setAnisotropyStrength(f.anisotropyStrength),f.anisotropyRotation!==void 0&&c.setAnisotropyRotation(f.anisotropyRotation),f.anisotropyTexture!==void 0){const h=f.anisotropyTexture;c.setAnisotropyTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getAnisotropyTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Lt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Lt]={};if(s.getAnisotropyStrength()>0&&(f.anisotropyStrength=s.getAnisotropyStrength()),s.getAnisotropyRotation()!==0&&(f.anisotropyRotation=s.getAnisotropyRotation()),s.getAnisotropyTexture()){const h=s.getAnisotropyTexture(),d=s.getAnisotropyTextureInfo();f.anisotropyTexture=e.createTextureInfoDef(h,d)}}}),this}}Za.EXTENSION_NAME=Lt;const{R:oa,G:ca,B:fd}=ht;class Qa extends $e{init(){this.extensionName=Ps,this.propertyType="Clearcoat",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new Oe(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new Oe(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new Oe(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:oa})}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:ca})}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:oa|ca|fd})}}Qa.EXTENSION_NAME=Ps;const jt=Ps;class eo extends Se{constructor(...e){super(...e),this.extensionName=jt}createClearcoat(){return new Qa(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[jt]){const c=this.createClearcoat();e.materials[a].setExtension(jt,c);const f=s.extensions[jt];if(f.clearcoatFactor!==void 0&&c.setClearcoatFactor(f.clearcoatFactor),f.clearcoatRoughnessFactor!==void 0&&c.setClearcoatRoughnessFactor(f.clearcoatRoughnessFactor),f.clearcoatTexture!==void 0){const h=f.clearcoatTexture;c.setClearcoatTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getClearcoatTextureInfo(),h)}if(f.clearcoatRoughnessTexture!==void 0){const h=f.clearcoatRoughnessTexture;c.setClearcoatRoughnessTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getClearcoatRoughnessTextureInfo(),h)}if(f.clearcoatNormalTexture!==void 0){const h=f.clearcoatNormalTexture;c.setClearcoatNormalTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getClearcoatNormalTextureInfo(),h),h.scale!==void 0&&c.setClearcoatNormalScale(h.scale)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(jt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[jt]={clearcoatFactor:s.getClearcoatFactor(),clearcoatRoughnessFactor:s.getClearcoatRoughnessFactor()};if(s.getClearcoatTexture()){const h=s.getClearcoatTexture(),d=s.getClearcoatTextureInfo();f.clearcoatTexture=e.createTextureInfoDef(h,d)}if(s.getClearcoatRoughnessTexture()){const h=s.getClearcoatRoughnessTexture(),d=s.getClearcoatRoughnessTextureInfo();f.clearcoatRoughnessTexture=e.createTextureInfoDef(h,d)}if(s.getClearcoatNormalTexture()){const h=s.getClearcoatNormalTexture(),d=s.getClearcoatNormalTextureInfo();f.clearcoatNormalTexture=e.createTextureInfoDef(h,d),s.getClearcoatNormalScale()!==1&&(f.clearcoatNormalTexture.scale=s.getClearcoatNormalScale())}}}),this}}eo.EXTENSION_NAME=jt;class to extends $e{init(){this.extensionName=ks,this.propertyType="EmissiveStrength",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(e){return this.set("emissiveStrength",e)}}to.EXTENSION_NAME=ks;const Bt=ks;class ro extends Se{constructor(...e){super(...e),this.extensionName=Bt}createEmissiveStrength(){return new to(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{if(r.extensions&&r.extensions[Bt]){const s=this.createEmissiveStrength();e.materials[n].setExtension(Bt,s);const a=r.extensions[Bt];a.emissiveStrength!==void 0&&s.setEmissiveStrength(a.emissiveStrength)}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Bt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{},c.extensions[Bt]={emissiveStrength:s.getEmissiveStrength()}}}),this}}ro.EXTENSION_NAME=Bt;class no extends $e{init(){this.extensionName=Us,this.propertyType="IOR",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(e){return this.set("ior",e)}}no.EXTENSION_NAME=Us;const zt=Us;class so extends Se{constructor(...e){super(...e),this.extensionName=zt}createIOR(){return new no(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{if(r.extensions&&r.extensions[zt]){const s=this.createIOR();e.materials[n].setExtension(zt,s);const a=r.extensions[zt];a.ior!==void 0&&s.setIOR(a.ior)}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(zt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{},c.extensions[zt]={ior:s.getIOR()}}}),this}}so.EXTENSION_NAME=zt;const{R:ud,G:hd}=ht;class io extends $e{init(){this.extensionName=Ls,this.propertyType="Iridescence",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new Oe(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new Oe(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:ud})}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:hd})}}io.EXTENSION_NAME=Ls;const Vt=Ls;class ao extends Se{constructor(...e){super(...e),this.extensionName=Vt}createIridescence(){return new io(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Vt]){const c=this.createIridescence();e.materials[a].setExtension(Vt,c);const f=s.extensions[Vt];if(f.iridescenceFactor!==void 0&&c.setIridescenceFactor(f.iridescenceFactor),f.iridescenceIor!==void 0&&c.setIridescenceIOR(f.iridescenceIor),f.iridescenceThicknessMinimum!==void 0&&c.setIridescenceThicknessMinimum(f.iridescenceThicknessMinimum),f.iridescenceThicknessMaximum!==void 0&&c.setIridescenceThicknessMaximum(f.iridescenceThicknessMaximum),f.iridescenceTexture!==void 0){const h=f.iridescenceTexture;c.setIridescenceTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getIridescenceTextureInfo(),h)}if(f.iridescenceThicknessTexture!==void 0){const h=f.iridescenceThicknessTexture;c.setIridescenceThicknessTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getIridescenceThicknessTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Vt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Vt]={};if(s.getIridescenceFactor()>0&&(f.iridescenceFactor=s.getIridescenceFactor()),s.getIridescenceIOR()!==1.3&&(f.iridescenceIor=s.getIridescenceIOR()),s.getIridescenceThicknessMinimum()!==100&&(f.iridescenceThicknessMinimum=s.getIridescenceThicknessMinimum()),s.getIridescenceThicknessMaximum()!==400&&(f.iridescenceThicknessMaximum=s.getIridescenceThicknessMaximum()),s.getIridescenceTexture()){const h=s.getIridescenceTexture(),d=s.getIridescenceTextureInfo();f.iridescenceTexture=e.createTextureInfoDef(h,d)}if(s.getIridescenceThicknessTexture()){const h=s.getIridescenceThicknessTexture(),d=s.getIridescenceThicknessTextureInfo();f.iridescenceThicknessTexture=e.createTextureInfoDef(h,d)}}}),this}}ao.EXTENSION_NAME=Vt;const{R:la,G:fa,B:ua,A:ha}=ht;class oo extends $e{init(){this.extensionName=js,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new Oe(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new Oe(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(e){return this.set("diffuseFactor",e)}getDiffuseHex(){return Ze.factorToHex(this.getDiffuseFactor())}setDiffuseHex(e){const r=this.getDiffuseFactor().slice();return this.setDiffuseFactor(Ze.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:la|fa|ua|ha,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:la|fa|ua|ha})}}oo.EXTENSION_NAME=js;const Gt=js;class co extends Se{constructor(...e){super(...e),this.extensionName=Gt}createPBRSpecularGlossiness(){return new oo(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Gt]){const c=this.createPBRSpecularGlossiness();e.materials[a].setExtension(Gt,c);const f=s.extensions[Gt];if(f.diffuseFactor!==void 0&&c.setDiffuseFactor(f.diffuseFactor),f.specularFactor!==void 0&&c.setSpecularFactor(f.specularFactor),f.glossinessFactor!==void 0&&c.setGlossinessFactor(f.glossinessFactor),f.diffuseTexture!==void 0){const h=f.diffuseTexture;c.setDiffuseTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getDiffuseTextureInfo(),h)}if(f.specularGlossinessTexture!==void 0){const h=f.specularGlossinessTexture;c.setSpecularGlossinessTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getSpecularGlossinessTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Gt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Gt]={diffuseFactor:s.getDiffuseFactor(),specularFactor:s.getSpecularFactor(),glossinessFactor:s.getGlossinessFactor()};if(s.getDiffuseTexture()){const h=s.getDiffuseTexture(),d=s.getDiffuseTextureInfo();f.diffuseTexture=e.createTextureInfoDef(h,d)}if(s.getSpecularGlossinessTexture()){const h=s.getSpecularGlossinessTexture(),d=s.getSpecularGlossinessTextureInfo();f.specularGlossinessTexture=e.createTextureInfoDef(h,d)}}}),this}}co.EXTENSION_NAME=Gt;const{R:dd,G:pd,B:gd,A:md}=ht;class lo extends $e{init(){this.extensionName=Bs,this.propertyType="Sheen",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new Oe(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new Oe(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}getSheenColorHex(){return Ze.factorToHex(this.getSheenColorFactor())}setSheenColorFactor(e){return this.set("sheenColorFactor",e)}setSheenColorHex(e){const r=this.getSheenColorFactor().slice();return this.set("sheenColorFactor",Ze.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:dd|pd|gd,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:md})}}lo.EXTENSION_NAME=Bs;const Ht=Bs;class fo extends Se{constructor(...e){super(...e),this.extensionName=Ht}createSheen(){return new lo(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Ht]){const c=this.createSheen();e.materials[a].setExtension(Ht,c);const f=s.extensions[Ht];if(f.sheenColorFactor!==void 0&&c.setSheenColorFactor(f.sheenColorFactor),f.sheenRoughnessFactor!==void 0&&c.setSheenRoughnessFactor(f.sheenRoughnessFactor),f.sheenColorTexture!==void 0){const h=f.sheenColorTexture;c.setSheenColorTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getSheenColorTextureInfo(),h)}if(f.sheenRoughnessTexture!==void 0){const h=f.sheenRoughnessTexture;c.setSheenRoughnessTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getSheenRoughnessTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ht);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Ht]={sheenColorFactor:s.getSheenColorFactor(),sheenRoughnessFactor:s.getSheenRoughnessFactor()};if(s.getSheenColorTexture()){const h=s.getSheenColorTexture(),d=s.getSheenColorTextureInfo();f.sheenColorTexture=e.createTextureInfoDef(h,d)}if(s.getSheenRoughnessTexture()){const h=s.getSheenRoughnessTexture(),d=s.getSheenRoughnessTextureInfo();f.sheenRoughnessTexture=e.createTextureInfoDef(h,d)}}}),this}}fo.EXTENSION_NAME=Ht;const{R:vd,G:yd,B:xd,A:Td}=ht;class uo extends $e{init(){this.extensionName=zs,this.propertyType="Specular",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new Oe(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new Oe(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 Ze.factorToHex(this.getSpecularColorFactor())}setSpecularColorHex(e){const r=this.getSpecularColorFactor().slice();return this.set("specularColorFactor",Ze.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:Td})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(e){return this.setRef("specularColorTexture",e,{channels:vd|yd|xd,isColor:!0})}}uo.EXTENSION_NAME=zs;const qt=zs;class ho extends Se{constructor(...e){super(...e),this.extensionName=qt}createSpecular(){return new uo(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[qt]){const c=this.createSpecular();e.materials[a].setExtension(qt,c);const f=s.extensions[qt];if(f.specularFactor!==void 0&&c.setSpecularFactor(f.specularFactor),f.specularColorFactor!==void 0&&c.setSpecularColorFactor(f.specularColorFactor),f.specularTexture!==void 0){const h=f.specularTexture;c.setSpecularTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getSpecularTextureInfo(),h)}if(f.specularColorTexture!==void 0){const h=f.specularColorTexture;c.setSpecularColorTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getSpecularColorTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(qt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[qt]={};if(s.getSpecularFactor()!==1&&(f.specularFactor=s.getSpecularFactor()),Ne.eq(s.getSpecularColorFactor(),[1,1,1])||(f.specularColorFactor=s.getSpecularColorFactor()),s.getSpecularTexture()){const h=s.getSpecularTexture(),d=s.getSpecularTextureInfo();f.specularTexture=e.createTextureInfoDef(h,d)}if(s.getSpecularColorTexture()){const h=s.getSpecularColorTexture(),d=s.getSpecularColorTextureInfo();f.specularColorTexture=e.createTextureInfoDef(h,d)}}}),this}}ho.EXTENSION_NAME=qt;const{R:Ed}=ht;class po extends $e{init(){this.extensionName=Vs,this.propertyType="Transmission",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new Oe(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:Ed})}}po.EXTENSION_NAME=Vs;const Wt=Vs;class go extends Se{constructor(...e){super(...e),this.extensionName=Wt}createTransmission(){return new po(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Wt]){const c=this.createTransmission();e.materials[a].setExtension(Wt,c);const f=s.extensions[Wt];if(f.transmissionFactor!==void 0&&c.setTransmissionFactor(f.transmissionFactor),f.transmissionTexture!==void 0){const h=f.transmissionTexture;c.setTransmissionTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getTransmissionTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Wt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Wt]={transmissionFactor:s.getTransmissionFactor()};if(s.getTransmissionTexture()){const h=s.getTransmissionTexture(),d=s.getTransmissionTextureInfo();f.transmissionTexture=e.createTextureInfoDef(h,d)}}}),this}}go.EXTENSION_NAME=Wt;class mo extends $e{init(){this.extensionName=Gs,this.propertyType="Unlit",this.parentTypes=[X.MATERIAL]}}mo.EXTENSION_NAME=Gs;const fr=Gs;class Ws extends Se{constructor(...e){super(...e),this.extensionName=fr}createUnlit(){return new mo(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{r.extensions&&r.extensions[fr]&&e.materials[n].setExtension(fr,this.createUnlit())}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{if(n.getExtension(fr)){const s=e.materialIndexMap.get(n),a=r.json.materials[s];a.extensions=a.extensions||{},a.extensions[fr]={}}}),this}}Ws.EXTENSION_NAME=fr;class vo extends $e{init(){this.extensionName=rr,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")}}vo.EXTENSION_NAME=rr;class yo extends $e{init(){this.extensionName=rr,this.propertyType="MappingList",this.parentTypes=[X.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")}}yo.EXTENSION_NAME=rr;class ws extends $e{init(){this.extensionName=rr,this.propertyType="Variant",this.parentTypes=["MappingList"]}}ws.EXTENSION_NAME=rr;const mt=rr;class xo extends Se{constructor(...e){super(...e),this.extensionName=mt}createMappingList(){return new yo(this.document.getGraph())}createVariant(e=""){return new ws(this.document.getGraph(),e)}createMapping(){return new vo(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof ws)}read(e){const r=e.jsonDoc;if(!r.json.extensions||!r.json.extensions[mt])return this;const n=(r.json.extensions[mt].variants||[]).map(s=>this.createVariant().setName(s.name||""));return(r.json.meshes||[]).forEach((s,a)=>{const c=e.meshes[a];(s.primitives||[]).forEach((f,h)=>{if(!f.extensions||!f.extensions[mt])return;const d=this.createMappingList(),g=f.extensions[mt];for(const x of g.mappings){const w=this.createMapping();x.material!==void 0&&w.setMaterial(e.materials[x.material]);for(const M of x.variants||[])w.addVariant(n[M]);d.addMapping(w)}c.listPrimitives()[h].setExtension(mt,d)})}),this}write(e){const r=e.jsonDoc,n=this.listVariants();if(!n.length)return this;const s=[],a=new Map;for(const c of n)a.set(c,s.length),s.push(e.createPropertyDef(c));for(const c of this.document.getRoot().listMeshes()){const f=e.meshIndexMap.get(c);c.listPrimitives().forEach((h,d)=>{const g=h.getExtension(mt);if(!g)return;const x=e.jsonDoc.json.meshes[f].primitives[d],w=g.listMappings().map(M=>{const A=e.createPropertyDef(M),N=M.getMaterial();return N&&(A.material=e.materialIndexMap.get(N)),A.variants=M.listVariants().map(m=>a.get(m)),A});x.extensions=x.extensions||{},x.extensions[mt]={mappings:w}})}return r.json.extensions=r.json.extensions||{},r.json.extensions[mt]={variants:s},this}}xo.EXTENSION_NAME=mt;const{G:wd}=ht;class To extends $e{init(){this.extensionName=Hs,this.propertyType="Volume",this.parentTypes=[X.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new Oe(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:wd})}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 Ze.factorToHex(this.getAttenuationColor())}setAttenuationColorHex(e){const r=this.getAttenuationColor().slice();return this.set("attenuationColor",Ze.hexToFactor(e,r))}}To.EXTENSION_NAME=Hs;const Xt=Hs;class Eo extends Se{constructor(...e){super(...e),this.extensionName=Xt}createVolume(){return new To(this.document.getGraph())}read(e){const r=e.jsonDoc,n=r.json.textures||[];return(r.json.materials||[]).forEach((s,a)=>{if(s.extensions&&s.extensions[Xt]){const c=this.createVolume();e.materials[a].setExtension(Xt,c);const f=s.extensions[Xt];if(f.thicknessFactor!==void 0&&c.setThicknessFactor(f.thicknessFactor),f.attenuationDistance!==void 0&&c.setAttenuationDistance(f.attenuationDistance),f.attenuationColor!==void 0&&c.setAttenuationColor(f.attenuationColor),f.thicknessTexture!==void 0){const h=f.thicknessTexture;c.setThicknessTexture(e.textures[n[h.index].source]),e.setTextureInfo(c.getThicknessTextureInfo(),h)}}}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Xt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[Xt]={};if(s.getThicknessFactor()>0&&(f.thicknessFactor=s.getThicknessFactor()),Number.isFinite(s.getAttenuationDistance())&&(f.attenuationDistance=s.getAttenuationDistance()),Ne.eq(s.getAttenuationColor(),[1,1,1])||(f.attenuationColor=s.getAttenuationColor()),s.getThicknessTexture()){const h=s.getThicknessTexture(),d=s.getThicknessTextureInfo();f.thicknessTexture=e.createTextureInfoDef(h,d)}}}),this}}Eo.EXTENSION_NAME=Xt;const wo="KHR_mesh_quantization";class Mo extends Se{constructor(...e){super(...e),this.extensionName=wo}read(e){return this}write(e){return this}}Mo.EXTENSION_NAME=wo;const kr="KHR_texture_basisu";class Md{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=os(e);return[r.pixelWidth,r.pixelHeight]}getChannels(e){const r=os(e).dataFormatDescriptor[0];if(r.colorModel===jh)return r.samples.length===2&&(15&r.samples[1].channelType)==15?4:3;if(r.colorModel===Bh)return(15&r.samples[0].channelType)==3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${r.colorModel}".`)}getVRAMByteLength(e){const r=os(e),n=this.getChannels(e)>3;let s=0;for(let a=0;a{r.extensions&&r.extensions[kr]&&(r.source=r.extensions[kr].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(a=>{a.source===s&&(a.extensions=a.extensions||{},a.extensions[kr]={source:a.source},delete a.source)})}}),this}}_o.EXTENSION_NAME=kr;class Ro extends $e{init(){this.extensionName=qs,this.propertyType="Transform",this.parentTypes=[X.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)}}Ro.EXTENSION_NAME=qs;const Yt=qs;class bo extends Se{constructor(...e){super(...e),this.extensionName=Yt}createTransform(){return new Ro(this.document.getGraph())}read(e){for(const[r,n]of Array.from(e.textureInfos.entries())){if(!n.extensions||!n.extensions[Yt])continue;const s=this.createTransform(),a=n.extensions[Yt];a.offset!==void 0&&s.setOffset(a.offset),a.rotation!==void 0&&s.setRotation(a.rotation),a.scale!==void 0&&s.setScale(a.scale),a.texCoord!==void 0&&s.setTexCoord(a.texCoord),r.setExtension(Yt,s)}return this}write(e){const r=Array.from(e.textureInfoDefMap.entries());for(const[n,s]of r){const a=n.getExtension(Yt);if(!a)continue;s.extensions=s.extensions||{};const c={},f=Ne.eq;f(a.getOffset(),[0,0])||(c.offset=a.getOffset()),a.getRotation()!==0&&(c.rotation=a.getRotation()),f(a.getScale(),[1,1])||(c.scale=a.getScale()),a.getTexCoord()!=null&&(c.texCoord=a.getTexCoord()),s.extensions[Yt]=c}return this}}bo.EXTENSION_NAME=Yt;const _d=[X.ROOT,X.SCENE,X.NODE,X.MESH,X.MATERIAL,X.TEXTURE,X.ANIMATION];class Ao extends $e{init(){this.extensionName=bn,this.propertyType="Packet",this.parentTypes=_d}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(e){return this.set("context",At({},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=At({},this.get("properties"));return r?n[e]=r:delete n[e],this.set("properties",n)}toJSONLD(){return At({"@context":ls(this.get("context"))},ls(this.get("properties")))}fromJSONLD(e){const r=(e=ls(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(`${bn}: Missing context for term, "${e}".`)}}function ls(t){return JSON.parse(JSON.stringify(t))}Ao.EXTENSION_NAME=bn;const bt=bn;class Io extends Se{constructor(...e){super(...e),this.extensionName=bt}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[bt];if(!n||!n.packets)return this;const s=e.jsonDoc.json,a=this.document.getRoot(),c=n.packets.map(d=>this.createPacket().fromJSONLD(d)),f=[[s.asset],s.scenes,s.nodes,s.meshes,s.materials,s.images,s.animations],h=[[a],a.listScenes(),a.listNodes(),a.listMeshes(),a.listMaterials(),a.listTextures(),a.listAnimations()];for(let d=0;d0&&(r.extensions=r.extensions||{},r.extensions[bt]={packets:n}),this}}Io.EXTENSION_NAME=bt;const So=[Es,Ka,Za,eo,ro,so,ao,co,ho,fo,go,Ws,xo,Eo,Mo,_o,bo,Io];[...So];const Co=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],No=t=>{let e="";for(let r=0;r<16;r++)r%4!=3&&(r>0&&(e+=" "),e+=t[r]||0);return e},Rd=(t=0,e=Co)=>` +`,da=t=>t?t.toISOString().substring(0,10):"";function bd(t,{unit:e="millimeter",title:r="jscad model",author:n="",description:s="",application:a="jscad",creationDate:c=new Date,license:f="",modificationDate:h}={}){t.push(` + + 1 + ${r} + ${n} + ${s||r} + + ${f} + + ${da(c)} + ${da(h||c)} + ${a} + `)}function Ad(t,e,r,n){t.push(` +`),t.push(` +`),r.forEach(({objectID:s,transform:a})=>{Id(t,s,a)}),t.push(` +`),t.push(` +`)}const Id=(t,e=0,r=Co)=>{t.push(` +`)};function Sd(t,e,r,n,s,a){t.push(` + + +`);for(let c=0;c +`);t.push(` + +`);for(let c=0;c +`);return t.push(` + + +`),t}const pa={name:"[Content_Types].xml",content:` + + + + +`};function Cd({meshes:t=[],components:e=[],items:r=[],precision:n=17,header:s}){const a=[];return bd(a,s),a.push(` +`),r.length==0&&console.error("3MF empty build! Include items or simple."),t.forEach(({id:c,vertices:f,indices:h,name:d})=>Sd(a,c,f,h,n,d)),e.forEach(({id:c,children:f,name:h})=>{Ad(a,c,f,h)}),a.push(` +`),a.push(` +`),r.forEach(({objectID:c,transform:f})=>{a.push(Rd(c,f))}),a.push(` +`),a.push(` +`),a.join("")}var Ge=Uint8Array,et=Uint16Array,Xs=Int32Array,Ys=new Ge([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]),Ks=new Ge([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]),ga=new Ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oo=function(t,e){for(var r=new et(31),n=0;n<31;++n)r[n]=e+=1<>1|(be&21845)<<1;Nt=(Nt&52428)>>2|(Nt&13107)<<2,Nt=(Nt&61680)>>4|(Nt&3855)<<4,_s[be]=((Nt&65280)>>8|(Nt&255)<<8)>>1}var Br=function(t,e,r){for(var n=t.length,s=0,a=new et(e);s>h]=d}else for(f=new et(n),s=0;s>15-t[s]);return f},tr=new Ge(288);for(var be=0;be<144;++be)tr[be]=8;for(var be=144;be<256;++be)tr[be]=9;for(var be=256;be<280;++be)tr[be]=7;for(var be=280;be<288;++be)tr[be]=8;var An=new Ge(32);for(var be=0;be<32;++be)An[be]=5;var Fd=Br(tr,9,0),Dd=Br(An,5,0),Do=function(t){return(t+7)/8|0},$o=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var n=new Ge(r-e);return n.set(t.subarray(e,r)),n},$d=["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"],$n=function(t,e,r){var n=new Error(e||$d[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,$n),!r)throw n;return n},Rt=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},Sr=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},fs=function(t,e){for(var r=[],n=0;nw&&(w=a[n].s);var M=new et(w+1),A=Rs(r[g-1],M,0);if(A>e){var n=0,N=0,m=A-e,C=1<e)N+=C-(1<>=m;N>0;){var R=a[n].s;M[R]=0&&N;--n){var b=a[n].s;M[b]==e&&(--M[b],++N)}A=e}return{t:new Ge(M),l:A}},Rs=function(t,e,r){return t.s==-1?Math.max(Rs(t.l,e,r+1),Rs(t.r,e,r+1)):e[t.s]=r},va=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new et(++e),n=0,s=t[0],a=1,c=function(h){r[n++]=h},f=1;f<=e;++f)if(t[f]==s&&f!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=t[f]}return{c:r.subarray(0,n),n:e}},Cr=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 a=0;a4&&!G[ga[K-1]];--K);var L=d+5<<3,U=Cr(s,tr)+Cr(a,An)+c,ee=Cr(s,w)+Cr(a,N)+c+14+3*K+Cr(V,G)+2*V[16]+3*V[17]+7*V[18];if(h>=0&&L<=U&&L<=ee)return Po(e,g,t.subarray(h,h+d));var fe,re,ge,ve;if(Rt(e,g,1+(ee15&&(Rt(e,g,Ue[B]>>5&127),g+=Ue[B]>>12)}}else fe=Fd,re=tr,ge=Dd,ve=An;for(var B=0;B255){var Ae=Ce>>18&31;Sr(e,g,fe[Ae+257]),g+=re[Ae+257],Ae>7&&(Rt(e,g,Ce>>23&31),g+=Ys[Ae]);var Qe=Ce&31;Sr(e,g,ge[Qe]),g+=ve[Qe],Qe>3&&(Sr(e,g,Ce>>5&8191),g+=Ks[Qe])}else Sr(e,g,fe[Ce]),g+=re[Ce]}return Sr(e,g,fe[256]),g+re[256]},Pd=new Xs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ko=new Ge(0),kd=function(t,e,r,n,s,a){var c=a.z||t.length,f=new Ge(n+c+5*(1+Math.ceil(c/7e3))+s),h=f.subarray(n,f.length-s),d=a.l,g=(a.r||0)&7;if(e){g&&(h[0]=a.r>>3);for(var x=Pd[e-1],w=x>>13,M=x&8191,A=(1<7e3||G>24576)&&(fe>423||!d)){g=ya(t,h,0,b,O,P,B,G,K,k-K,g),G=V=B=0,K=k;for(var re=0;re<286;++re)O[re]=0;for(var re=0;re<30;++re)P[re]=0}var ge=2,ve=0,xe=M,Te=U-ee&32767;if(fe>2&&L==R(k-Te))for(var Re=Math.min(w,fe)-1,Ue=Math.min(32767,k),Ae=Math.min(258,fe);Te<=Ue&&--xe&&U!=ee;){if(t[k+ge]==t[k+ge-Te]){for(var Ce=0;Cege){if(ge=Ce,ve=Te,Ce>Re)break;for(var Qe=Math.min(Te,Ce-2),ot=0,re=0;reot&&(ot=Ot,ee=Je)}}}U=ee,ee=N[U],Te+=U-ee&32767}if(ve){b[G++]=268435456|Ms[ge]<<18|ma[ve];var He=Ms[ge]&31,xt=ma[ve]&31;B+=Ys[He]+Ks[xt],++O[257+He],++P[xt],H=k+ge,++V}else b[G++]=t[k],++O[t[k]]}}for(k=Math.max(k,H);k=c&&(h[g/8|0]=d,ze=c),g=Po(h,g+1,t.subarray(k,ze))}a.i=c}return $o(f,0,n+Do(g)+s)},Ud=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}(),Ld=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n>>8;t=r},d:function(){return~t}}},jd=function(t,e,r,n,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new Ge(a.length+t.length);c.set(a),c.set(t,a.length),t=c,s.w=a.length}return kd(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,r,n,s)},Uo=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},Ve=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Bd(t,e){return jd(t,e||{},0,0)}var Lo=function(t,e,r,n){for(var s in t){var a=t[s],c=e+s,f=n;Array.isArray(a)&&(f=Uo(n,a[1]),a=a[0]),a instanceof Ge?r[c]=[a,f]:(r[c+="/"]=[new Ge(0),f],Lo(a,c,r,n))}},xa=typeof TextEncoder<"u"&&new TextEncoder,zd=typeof TextDecoder<"u"&&new TextDecoder,Vd=0;try{zd.decode(ko,{stream:!0}),Vd=1}catch{}function In(t,e){if(e){for(var r=new Ge(t.length),n=0;n>1)),c=0,f=function(g){a[c++]=g},n=0;na.length){var h=new Ge(c+8+(s-n<<1));h.set(a),a=h}var d=t.charCodeAt(n);d<128||e?f(d):d<2048?(f(192|d>>6),f(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|t.charCodeAt(++n)&1023,f(240|d>>18),f(128|d>>12&63),f(128|d>>6&63),f(128|d&63)):(f(224|d>>12),f(128|d>>6&63),f(128|d&63))}return $o(a,0,c)}var bs=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&$n(9),e+=n+4}return e},Ta=function(t,e,r,n,s,a,c,f){var h=n.length,d=r.extra,g=f&&f.length,x=bs(d);Ve(t,e,c!=null?33639248:67324752),e+=4,c!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(a<0&&8),t[e++]=s&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var w=new Date(r.mtime==null?Date.now():r.mtime),M=w.getFullYear()-1980;if((M<0||M>119)&&$n(10),Ve(t,e,M<<25|w.getMonth()+1<<21|w.getDate()<<16|w.getHours()<<11|w.getMinutes()<<5|w.getSeconds()>>1),e+=4,a!=-1&&(Ve(t,e,r.crc),Ve(t,e+4,a<0?-a-2:a),Ve(t,e+8,r.size)),Ve(t,e+12,h),Ve(t,e+14,x),e+=16,c!=null&&(Ve(t,e,g),Ve(t,e+6,r.attrs),Ve(t,e+10,c),e+=14),t.set(n,e),e+=h,x)for(var A in d){var N=d[A],m=N.length;Ve(t,e,+A),Ve(t,e+2,m),t.set(N,e+4),e+=4+m}return g&&(t.set(f,e),e+=g),e},Gd=function(t,e,r,n,s){Ve(t,e,101010256),Ve(t,e+8,r),Ve(t,e+10,r),Ve(t,e+12,n),Ve(t,e+16,s)};function Hd(t,e){e||(e={});var r={},n=[];Lo(t,"",r,e);var s=0,a=0;for(var c in r){var f=r[c],h=f[0],d=f[1],g=d.level==0?0:8,x=In(c),w=x.length,M=d.comment,A=M&&In(M),N=A&&A.length,m=bs(d.extra);w>65535&&$n(11);var C=g?Bd(h,d):h,T=C.length,R=Ld();R.p(h),n.push(Uo(d,{size:h.length,crc:R.d(),c:C,f:x,m:A,u:w!=c.length||A&&M.length!=N,o:s,compression:g})),s+=30+w+m+T,a+=76+2*(w+m)+(N||0)+T}for(var b=new Ge(a+22),O=s,P=a-s,V=0;V0?(r[0]=(f*c+g*n+h*a-d*s)*2/x,r[1]=(h*c+g*s+d*n-f*a)*2/x,r[2]=(d*c+g*a+f*s-h*n)*2/x):(r[0]=(f*c+g*n+h*a-d*s)*2,r[1]=(h*c+g*s+d*n-f*a)*2,r[2]=(d*c+g*a+f*s-h*n)*2),Ko(t,e,r),t}function Jo(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Zo(t,e){var r=e[0],n=e[1],s=e[2],a=e[4],c=e[5],f=e[6],h=e[8],d=e[9],g=e[10];return t[0]=Math.hypot(r,n,s),t[1]=Math.hypot(a,c,f),t[2]=Math.hypot(h,d,g),t}function Qo(t,e){var r=new le(3);Zo(r,e);var n=1/r[0],s=1/r[1],a=1/r[2],c=e[0]*n,f=e[1]*s,h=e[2]*a,d=e[4]*n,g=e[5]*s,x=e[6]*a,w=e[8]*n,M=e[9]*s,A=e[10]*a,N=c+g+A,m=0;return N>0?(m=Math.sqrt(N+1)*2,t[3]=.25*m,t[0]=(x-M)/m,t[1]=(w-h)/m,t[2]=(f-d)/m):c>g&&c>A?(m=Math.sqrt(1+c-g-A)*2,t[3]=(x-M)/m,t[0]=.25*m,t[1]=(f+d)/m,t[2]=(w+h)/m):g>A?(m=Math.sqrt(1+g-c-A)*2,t[3]=(w-h)/m,t[0]=(f+d)/m,t[1]=.25*m,t[2]=(x+M)/m):(m=Math.sqrt(1+A-c-g)*2,t[3]=(f-d)/m,t[0]=(w+h)/m,t[1]=(x+M)/m,t[2]=.25*m),t}function Vg(t,e,r,n){var s=e[0],a=e[1],c=e[2],f=e[3],h=s+s,d=a+a,g=c+c,x=s*h,w=s*d,M=s*g,A=a*d,N=a*g,m=c*g,C=f*h,T=f*d,R=f*g,b=n[0],O=n[1],P=n[2];return t[0]=(1-(A+m))*b,t[1]=(w+R)*b,t[2]=(M-T)*b,t[3]=0,t[4]=(w-R)*O,t[5]=(1-(x+m))*O,t[6]=(N+C)*O,t[7]=0,t[8]=(M+T)*P,t[9]=(N-C)*P,t[10]=(1-(x+A))*P,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Gg(t,e,r,n,s){var a=e[0],c=e[1],f=e[2],h=e[3],d=a+a,g=c+c,x=f+f,w=a*d,M=a*g,A=a*x,N=c*g,m=c*x,C=f*x,T=h*d,R=h*g,b=h*x,O=n[0],P=n[1],V=n[2],B=s[0],k=s[1],G=s[2],H=(1-(N+C))*O,K=(M+b)*O,L=(A-R)*O,U=(M-b)*P,ee=(1-(w+C))*P,fe=(m+T)*P,re=(A+R)*V,ge=(m-T)*V,ve=(1-(w+N))*V;return t[0]=H,t[1]=K,t[2]=L,t[3]=0,t[4]=U,t[5]=ee,t[6]=fe,t[7]=0,t[8]=re,t[9]=ge,t[10]=ve,t[11]=0,t[12]=r[0]+B-(H*B+U*k+re*G),t[13]=r[1]+k-(K*B+ee*k+ge*G),t[14]=r[2]+G-(L*B+fe*k+ve*G),t[15]=1,t}function Hg(t,e){var r=e[0],n=e[1],s=e[2],a=e[3],c=r+r,f=n+n,h=s+s,d=r*c,g=n*c,x=n*f,w=s*c,M=s*f,A=s*h,N=a*c,m=a*f,C=a*h;return t[0]=1-x-A,t[1]=g+C,t[2]=w-m,t[3]=0,t[4]=g-C,t[5]=1-d-A,t[6]=M+N,t[7]=0,t[8]=w+m,t[9]=M-N,t[10]=1-d-x,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function qg(t,e,r,n,s,a,c){var f=1/(r-e),h=1/(s-n),d=1/(a-c);return t[0]=a*2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*h,t[6]=0,t[7]=0,t[8]=(r+e)*f,t[9]=(s+n)*h,t[10]=(c+a)*d,t[11]=-1,t[12]=0,t[13]=0,t[14]=c*a*2*d,t[15]=0,t}function ec(t,e,r,n,s){var a=1/Math.tan(e/2),c;return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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?(c=1/(n-s),t[10]=(s+n)*c,t[14]=2*s*n*c):(t[10]=-1,t[14]=-2*n),t}var Wg=ec;function Xg(t,e,r,n,s){var a=1/Math.tan(e/2),c;return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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?(c=1/(n-s),t[10]=s*c,t[14]=s*n*c):(t[10]=-1,t[14]=-n),t}function Yg(t,e,r,n){var s=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),c=Math.tan(e.leftDegrees*Math.PI/180),f=Math.tan(e.rightDegrees*Math.PI/180),h=2/(c+f),d=2/(s+a);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=-((c-f)*h*.5),t[9]=(s-a)*d*.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 tc(t,e,r,n,s,a,c){var f=1/(e-r),h=1/(n-s),d=1/(a-c);return t[0]=-2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*d,t[11]=0,t[12]=(e+r)*f,t[13]=(s+n)*h,t[14]=(c+a)*d,t[15]=1,t}var Kg=tc;function Jg(t,e,r,n,s,a,c){var f=1/(e-r),h=1/(n-s),d=1/(a-c);return t[0]=-2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=d,t[11]=0,t[12]=(e+r)*f,t[13]=(s+n)*h,t[14]=a*d,t[15]=1,t}function Zg(t,e,r,n){var s,a,c,f,h,d,g,x,w,M,A=e[0],N=e[1],m=e[2],C=n[0],T=n[1],R=n[2],b=r[0],O=r[1],P=r[2];return Math.abs(A-b)0&&(M=1/Math.sqrt(M),g*=M,x*=M,w*=M);var A=h*w-d*x,N=d*g-f*w,m=f*x-h*g;return M=A*A+N*N+m*m,M>0&&(M=1/Math.sqrt(M),A*=M,N*=M,m*=M),t[0]=A,t[1]=N,t[2]=m,t[3]=0,t[4]=x*m-w*N,t[5]=w*A-g*m,t[6]=g*N-x*A,t[7]=0,t[8]=g,t[9]=x,t[10]=w,t[11]=0,t[12]=s,t[13]=a,t[14]=c,t[15]=1,t}function e1(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 t1(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 r1(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 rc(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 n1(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 s1(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 i1(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 a1(t,e){var r=t[0],n=t[1],s=t[2],a=t[3],c=t[4],f=t[5],h=t[6],d=t[7],g=t[8],x=t[9],w=t[10],M=t[11],A=t[12],N=t[13],m=t[14],C=t[15],T=e[0],R=e[1],b=e[2],O=e[3],P=e[4],V=e[5],B=e[6],k=e[7],G=e[8],H=e[9],K=e[10],L=e[11],U=e[12],ee=e[13],fe=e[14],re=e[15];return Math.abs(r-T)<=Q*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(n-R)<=Q*Math.max(1,Math.abs(n),Math.abs(R))&&Math.abs(s-b)<=Q*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-O)<=Q*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(c-P)<=Q*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(f-V)<=Q*Math.max(1,Math.abs(f),Math.abs(V))&&Math.abs(h-B)<=Q*Math.max(1,Math.abs(h),Math.abs(B))&&Math.abs(d-k)<=Q*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(g-G)<=Q*Math.max(1,Math.abs(g),Math.abs(G))&&Math.abs(x-H)<=Q*Math.max(1,Math.abs(x),Math.abs(H))&&Math.abs(w-K)<=Q*Math.max(1,Math.abs(w),Math.abs(K))&&Math.abs(M-L)<=Q*Math.max(1,Math.abs(M),Math.abs(L))&&Math.abs(A-U)<=Q*Math.max(1,Math.abs(A),Math.abs(U))&&Math.abs(N-ee)<=Q*Math.max(1,Math.abs(N),Math.abs(ee))&&Math.abs(m-fe)<=Q*Math.max(1,Math.abs(m),Math.abs(fe))&&Math.abs(C-re)<=Q*Math.max(1,Math.abs(C),Math.abs(re))}var o1=Yo,c1=rc,l1=Object.freeze({__proto__:null,add:r1,adjoint:Ig,clone:wg,copy:Mg,create:Eg,determinant:Sg,equals:a1,exactEquals:i1,frob:t1,fromQuat:Hg,fromQuat2:zg,fromRotation:Ug,fromRotationTranslation:Ko,fromRotationTranslationScale:Vg,fromRotationTranslationScaleOrigin:Gg,fromScaling:kg,fromTranslation:Pg,fromValues:_g,fromXRotation:Lg,fromYRotation:jg,fromZRotation:Bg,frustum:qg,getRotation:Qo,getScaling:Zo,getTranslation:Jo,identity:Xo,invert:Ag,lookAt:Zg,mul:o1,multiply:Yo,multiplyScalar:n1,multiplyScalarAndAdd:s1,ortho:Kg,orthoNO:tc,orthoZO:Jg,perspective:Wg,perspectiveFromFieldOfView:Yg,perspectiveNO:ec,perspectiveZO:Xg,rotate:Og,rotateX:Fg,rotateY:Dg,rotateZ:$g,scale:Ng,set:Rg,str:e1,sub:c1,subtract:rc,targetTo:Qg,translate:Cg,transpose:bg});function Js(){var t=new le(3);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function f1(t){var e=new le(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function nc(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function As(t,e,r){var n=new le(3);return n[0]=t,n[1]=e,n[2]=r,n}function u1(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function h1(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function d1(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function sc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function ic(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function ac(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p1(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function g1(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function m1(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 v1(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 y1(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function x1(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function T1(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 oc(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 cc(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 lc(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function E1(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function w1(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function fc(t,e){var r=e[0],n=e[1],s=e[2],a=r*r+n*n+s*s;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function Zs(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xn(t,e,r){var n=e[0],s=e[1],a=e[2],c=r[0],f=r[1],h=r[2];return t[0]=s*h-a*f,t[1]=a*c-n*h,t[2]=n*f-s*c,t}function M1(t,e,r,n){var s=e[0],a=e[1],c=e[2];return t[0]=s+n*(r[0]-s),t[1]=a+n*(r[1]-a),t[2]=c+n*(r[2]-c),t}function _1(t,e,r,n,s,a){var c=a*a,f=c*(2*a-3)+1,h=c*(a-2)+a,d=c*(a-1),g=c*(3-2*a);return t[0]=e[0]*f+r[0]*h+n[0]*d+s[0]*g,t[1]=e[1]*f+r[1]*h+n[1]*d+s[1]*g,t[2]=e[2]*f+r[2]*h+n[2]*d+s[2]*g,t}function R1(t,e,r,n,s,a){var c=1-a,f=c*c,h=a*a,d=f*c,g=3*a*f,x=3*h*c,w=h*a;return t[0]=e[0]*d+r[0]*g+n[0]*x+s[0]*w,t[1]=e[1]*d+r[1]*g+n[1]*x+s[1]*w,t[2]=e[2]*d+r[2]*g+n[2]*x+s[2]*w,t}function b1(t,e){e=e||1;var r=ft()*2*Math.PI,n=ft()*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 A1(t,e,r){var n=e[0],s=e[1],a=e[2],c=r[3]*n+r[7]*s+r[11]*a+r[15];return c=c||1,t[0]=(r[0]*n+r[4]*s+r[8]*a+r[12])/c,t[1]=(r[1]*n+r[5]*s+r[9]*a+r[13])/c,t[2]=(r[2]*n+r[6]*s+r[10]*a+r[14])/c,t}function I1(t,e,r){var n=e[0],s=e[1],a=e[2];return t[0]=n*r[0]+s*r[3]+a*r[6],t[1]=n*r[1]+s*r[4]+a*r[7],t[2]=n*r[2]+s*r[5]+a*r[8],t}function S1(t,e,r){var n=r[0],s=r[1],a=r[2],c=r[3],f=e[0],h=e[1],d=e[2],g=s*d-a*h,x=a*f-n*d,w=n*h-s*f,M=s*w-a*x,A=a*g-n*w,N=n*x-s*g,m=c*2;return g*=m,x*=m,w*=m,M*=2,A*=2,N*=2,t[0]=f+g+M,t[1]=h+x+A,t[2]=d+w+N,t}function C1(t,e,r,n){var s=[],a=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],a[0]=s[0],a[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),a[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function N1(t,e,r,n){var s=[],a=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],a[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),a[1]=s[1],a[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function O1(t,e,r,n){var s=[],a=[];return s[0]=e[0]-r[0],s[1]=e[1]-r[1],s[2]=e[2]-r[2],a[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),a[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),a[2]=s[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function F1(t,e){var r=t[0],n=t[1],s=t[2],a=e[0],c=e[1],f=e[2],h=Math.sqrt(r*r+n*n+s*s),d=Math.sqrt(a*a+c*c+f*f),g=h*d,x=g&&Zs(t,e)/g;return Math.acos(Math.min(Math.max(x,-1),1))}function D1(t){return t[0]=0,t[1]=0,t[2]=0,t}function $1(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function P1(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function k1(t,e){var r=t[0],n=t[1],s=t[2],a=e[0],c=e[1],f=e[2];return Math.abs(r-a)<=Q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-c)<=Q*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(s-f)<=Q*Math.max(1,Math.abs(s),Math.abs(f))}var U1=sc,L1=ic,j1=ac,B1=oc,z1=cc,uc=nc,V1=lc,G1=function(){var t=Js();return function(e,r,n,s,a,c){var f,h;for(r||(r=3),n||(n=0),s?h=Math.min(s*r+n,e.length):h=e.length,f=n;f0&&(c=1/Math.sqrt(c)),t[0]=r*c,t[1]=n*c,t[2]=s*c,t[3]=a*c,t}function Rc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function e0(t,e,r,n){var s=r[0]*n[1]-r[1]*n[0],a=r[0]*n[2]-r[2]*n[0],c=r[0]*n[3]-r[3]*n[0],f=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],d=r[2]*n[3]-r[3]*n[2],g=e[0],x=e[1],w=e[2],M=e[3];return t[0]=x*d-w*h+M*f,t[1]=-(g*d)+w*c-M*a,t[2]=g*h-x*c+M*s,t[3]=-(g*f)+x*a-w*s,t}function bc(t,e,r,n){var s=e[0],a=e[1],c=e[2],f=e[3];return t[0]=s+n*(r[0]-s),t[1]=a+n*(r[1]-a),t[2]=c+n*(r[2]-c),t[3]=f+n*(r[3]-f),t}function t0(t,e){e=e||1;var r,n,s,a,c,f;do r=ft()*2-1,n=ft()*2-1,c=r*r+n*n;while(c>=1);do s=ft()*2-1,a=ft()*2-1,f=s*s+a*a;while(f>=1);var h=Math.sqrt((1-c)/f);return t[0]=e*r,t[1]=e*n,t[2]=e*s*h,t[3]=e*a*h,t}function r0(t,e,r){var n=e[0],s=e[1],a=e[2],c=e[3];return t[0]=r[0]*n+r[4]*s+r[8]*a+r[12]*c,t[1]=r[1]*n+r[5]*s+r[9]*a+r[13]*c,t[2]=r[2]*n+r[6]*s+r[10]*a+r[14]*c,t[3]=r[3]*n+r[7]*s+r[11]*a+r[15]*c,t}function n0(t,e,r){var n=e[0],s=e[1],a=e[2],c=r[0],f=r[1],h=r[2],d=r[3],g=d*n+f*a-h*s,x=d*s+h*n-c*a,w=d*a+c*s-f*n,M=-c*n-f*s-h*a;return t[0]=g*d+M*-c+x*-h-w*-f,t[1]=x*d+M*-f+w*-c-g*-h,t[2]=w*d+M*-h+g*-f-x*-c,t[3]=e[3],t}function s0(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function i0(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Ac(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Ic(t,e){var r=t[0],n=t[1],s=t[2],a=t[3],c=e[0],f=e[1],h=e[2],d=e[3];return Math.abs(r-c)<=Q*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-f)<=Q*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(s-h)<=Q*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(a-d)<=Q*Math.max(1,Math.abs(a),Math.abs(d))}var a0=yc,o0=xc,c0=Tc,l0=wc,f0=Mc,u0=Qs,h0=ei,d0=function(){var t=hc();return function(e,r,n,s,a,c){var f,h;for(r||(r=4),n||(n=0),s?h=Math.min(s*r+n,e.length):h=e.length,f=n;fQ?(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 v0(t,e){var r=ri(t,e);return Math.acos(2*r*r-1)}function Cc(t,e,r){var n=e[0],s=e[1],a=e[2],c=e[3],f=r[0],h=r[1],d=r[2],g=r[3];return t[0]=n*g+c*f+s*d-a*h,t[1]=s*g+c*h+a*f-n*d,t[2]=a*g+c*d+n*h-s*f,t[3]=c*g-n*f-s*h-a*d,t}function Nc(t,e,r){r*=.5;var n=e[0],s=e[1],a=e[2],c=e[3],f=Math.sin(r),h=Math.cos(r);return t[0]=n*h+c*f,t[1]=s*h+a*f,t[2]=a*h-s*f,t[3]=c*h-n*f,t}function Oc(t,e,r){r*=.5;var n=e[0],s=e[1],a=e[2],c=e[3],f=Math.sin(r),h=Math.cos(r);return t[0]=n*h-a*f,t[1]=s*h+c*f,t[2]=a*h+n*f,t[3]=c*h-s*f,t}function Fc(t,e,r){r*=.5;var n=e[0],s=e[1],a=e[2],c=e[3],f=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*f,t[1]=s*h-n*f,t[2]=a*h+c*f,t[3]=c*h-a*f,t}function y0(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],a=e[3],c=Math.sqrt(r*r+n*n+s*s),f=Math.exp(a),h=c>0?f*Math.sin(c)/c:0;return t[0]=r*h,t[1]=n*h,t[2]=s*h,t[3]=f*Math.cos(c),t}function $c(t,e){var r=e[0],n=e[1],s=e[2],a=e[3],c=Math.sqrt(r*r+n*n+s*s),f=c>0?Math.atan2(c,a)/c:0;return t[0]=r*f,t[1]=n*f,t[2]=s*f,t[3]=.5*Math.log(r*r+n*n+s*s+a*a),t}function x0(t,e,r){return $c(t,e),kc(t,t,r),Dc(t,t),t}function Tn(t,e,r,n){var s=e[0],a=e[1],c=e[2],f=e[3],h=r[0],d=r[1],g=r[2],x=r[3],w,M,A,N,m;return M=s*h+a*d+c*g+f*x,M<0&&(M=-M,h=-h,d=-d,g=-g,x=-x),1-M>Q?(w=Math.acos(M),A=Math.sin(w),N=Math.sin((1-n)*w)/A,m=Math.sin(n*w)/A):(N=1-n,m=n),t[0]=N*s+m*h,t[1]=N*a+m*d,t[2]=N*c+m*g,t[3]=N*f+m*x,t}function T0(t){var e=ft(),r=ft(),n=ft(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=a*Math.sin(2*Math.PI*n),t[3]=a*Math.cos(2*Math.PI*n),t}function E0(t,e){var r=e[0],n=e[1],s=e[2],a=e[3],c=r*r+n*n+s*s+a*a,f=c?1/c:0;return t[0]=-r*f,t[1]=-n*f,t[2]=-s*f,t[3]=a*f,t}function w0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Pc(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 a=(s+1)%3,c=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[a*3+a]-e[c*3+c]+1),t[s]=.5*n,n=.5/n,t[3]=(e[a*3+c]-e[c*3+a])*n,t[a]=(e[a*3+s]+e[s*3+a])*n,t[c]=(e[c*3+s]+e[s*3+c])*n}return t}function M0(t,e,r,n){var s=.5*Math.PI/180;e*=s,r*=s,n*=s;var a=Math.sin(e),c=Math.cos(e),f=Math.sin(r),h=Math.cos(r),d=Math.sin(n),g=Math.cos(n);return t[0]=a*h*g-c*f*d,t[1]=c*f*g+a*h*d,t[2]=c*h*d-a*f*g,t[3]=c*h*g+a*f*d,t}function _0(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var R0=dc,b0=pc,ti=gc,A0=mc,I0=vc,S0=Cc,kc=Ec,ri=Rc,C0=bc,ni=Qs,N0=ni,si=ei,O0=si,ii=_c,F0=Ac,D0=Ic,$0=function(){var t=Js(),e=As(1,0,0),r=As(0,1,0);return function(n,s,a){var c=Zs(s,a);return c<-.999999?(xn(t,e,s),uc(t)<1e-6&&xn(t,r,s),fc(t,t),Sc(n,t,Math.PI),n):c>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(xn(t,s,a),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+c,ii(n,n))}}(),P0=function(){var t=Sn(),e=Sn();return function(r,n,s,a,c,f){return Tn(t,n,c,f),Tn(e,s,a,f),Tn(r,t,e,2*f*(1-f)),r}}(),k0=function(){var t=Ho();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],ii(e,Pc(e,t))}}(),U0=Object.freeze({__proto__:null,add:I0,calculateW:y0,clone:R0,conjugate:w0,copy:ti,create:Sn,dot:ri,equals:D0,exactEquals:F0,exp:Dc,fromEuler:M0,fromMat3:Pc,fromValues:b0,getAngle:v0,getAxisAngle:m0,identity:g0,invert:E0,len:N0,length:ni,lerp:C0,ln:$c,mul:S0,multiply:Cc,normalize:ii,pow:x0,random:T0,rotateX:Nc,rotateY:Oc,rotateZ:Fc,rotationTo:$0,scale:kc,set:A0,setAxes:k0,setAxisAngle:Sc,slerp:Tn,sqlerp:P0,sqrLen:O0,squaredLength:si,str:_0});function L0(){var t=new le(8);return le!=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 j0(t){var e=new le(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 B0(t,e,r,n,s,a,c,f){var h=new le(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=s,h[5]=a,h[6]=c,h[7]=f,h}function z0(t,e,r,n,s,a,c){var f=new le(8);f[0]=t,f[1]=e,f[2]=r,f[3]=n;var h=s*.5,d=a*.5,g=c*.5;return f[4]=h*n+d*r-g*e,f[5]=d*n+g*t-h*r,f[6]=g*n+h*e-d*t,f[7]=-h*t-d*e-g*r,f}function Uc(t,e,r){var n=r[0]*.5,s=r[1]*.5,a=r[2]*.5,c=e[0],f=e[1],h=e[2],d=e[3];return t[0]=c,t[1]=f,t[2]=h,t[3]=d,t[4]=n*d+s*h-a*f,t[5]=s*d+a*c-n*h,t[6]=a*d+n*f-s*c,t[7]=-n*c-s*f-a*h,t}function V0(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 G0(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 H0(t,e){var r=Sn();Qo(r,e);var n=new le(3);return Jo(n,e),Uc(t,r,n),t}function Lc(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 q0(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 W0(t,e,r,n,s,a,c,f,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=s,t[4]=a,t[5]=c,t[6]=f,t[7]=h,t}var X0=ti;function Y0(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var K0=ti;function J0(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Z0(t,e){var r=e[4],n=e[5],s=e[6],a=e[7],c=-e[0],f=-e[1],h=-e[2],d=e[3];return t[0]=(r*d+a*c+n*h-s*f)*2,t[1]=(n*d+a*f+s*c-r*h)*2,t[2]=(s*d+a*h+r*f-n*c)*2,t}function Q0(t,e,r){var n=e[0],s=e[1],a=e[2],c=e[3],f=r[0]*.5,h=r[1]*.5,d=r[2]*.5,g=e[4],x=e[5],w=e[6],M=e[7];return t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=c*f+s*d-a*h+g,t[5]=c*h+a*f-n*d+x,t[6]=c*d+n*h-s*f+w,t[7]=-n*f-s*h-a*d+M,t}function em(t,e,r){var n=-e[0],s=-e[1],a=-e[2],c=e[3],f=e[4],h=e[5],d=e[6],g=e[7],x=f*c+g*n+h*a-d*s,w=h*c+g*s+d*n-f*a,M=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return Nc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-M*s,t[5]=w*c+A*s+M*n-x*a,t[6]=M*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-M*a,t}function tm(t,e,r){var n=-e[0],s=-e[1],a=-e[2],c=e[3],f=e[4],h=e[5],d=e[6],g=e[7],x=f*c+g*n+h*a-d*s,w=h*c+g*s+d*n-f*a,M=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return Oc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-M*s,t[5]=w*c+A*s+M*n-x*a,t[6]=M*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-M*a,t}function rm(t,e,r){var n=-e[0],s=-e[1],a=-e[2],c=e[3],f=e[4],h=e[5],d=e[6],g=e[7],x=f*c+g*n+h*a-d*s,w=h*c+g*s+d*n-f*a,M=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return Fc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-M*s,t[5]=w*c+A*s+M*n-x*a,t[6]=M*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-M*a,t}function nm(t,e,r){var n=r[0],s=r[1],a=r[2],c=r[3],f=e[0],h=e[1],d=e[2],g=e[3];return t[0]=f*c+g*n+h*a-d*s,t[1]=h*c+g*s+d*n-f*a,t[2]=d*c+g*a+f*s-h*n,t[3]=g*c-f*n-h*s-d*a,f=e[4],h=e[5],d=e[6],g=e[7],t[4]=f*c+g*n+h*a-d*s,t[5]=h*c+g*s+d*n-f*a,t[6]=d*c+g*a+f*s-h*n,t[7]=g*c-f*n-h*s-d*a,t}function sm(t,e,r){var n=e[0],s=e[1],a=e[2],c=e[3],f=r[0],h=r[1],d=r[2],g=r[3];return t[0]=n*g+c*f+s*d-a*h,t[1]=s*g+c*h+a*f-n*d,t[2]=a*g+c*d+n*h-s*f,t[3]=c*g-n*f-s*h-a*d,f=r[4],h=r[5],d=r[6],g=r[7],t[4]=n*g+c*f+s*d-a*h,t[5]=s*g+c*h+a*f-n*d,t[6]=a*g+c*d+n*h-s*f,t[7]=c*g-n*f-s*h-a*d,t}function im(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,s=e[1]/r,a=e[2]/r,c=e[3]/r,f=e[4],h=e[5],d=e[6],g=e[7],x=n*f+s*h+a*d+c*g;t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=(f-n*x)/r,t[5]=(h-s*x)/r,t[6]=(d-a*x)/r,t[7]=(g-c*x)/r}return t}function gm(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function mm(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 vm(t,e){var r=t[0],n=t[1],s=t[2],a=t[3],c=t[4],f=t[5],h=t[6],d=t[7],g=e[0],x=e[1],w=e[2],M=e[3],A=e[4],N=e[5],m=e[6],C=e[7];return Math.abs(r-g)<=Q*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(n-x)<=Q*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(s-w)<=Q*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(a-M)<=Q*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-A)<=Q*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-N)<=Q*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(h-m)<=Q*Math.max(1,Math.abs(h),Math.abs(m))&&Math.abs(d-C)<=Q*Math.max(1,Math.abs(d),Math.abs(C))}var ym=Object.freeze({__proto__:null,add:am,clone:j0,conjugate:um,copy:Lc,create:L0,dot:Bc,equals:vm,exactEquals:mm,fromMat4:H0,fromRotation:G0,fromRotationTranslation:Uc,fromRotationTranslationValues:z0,fromTranslation:V0,fromValues:B0,getDual:Y0,getReal:X0,getTranslation:Z0,identity:q0,invert:fm,len:hm,length:zc,lerp:lm,mul:om,multiply:jc,normalize:pm,rotateAroundAxis:im,rotateByQuatAppend:nm,rotateByQuatPrepend:sm,rotateX:em,rotateY:tm,rotateZ:rm,scale:cm,set:W0,setDual:J0,setReal:K0,sqrLen:dm,squaredLength:Pn,str:gm,translate:Q0});function Vc(){var t=new le(2);return le!=Float32Array&&(t[0]=0,t[1]=0),t}function xm(t){var e=new le(2);return e[0]=t[0],e[1]=t[1],e}function Tm(t,e){var r=new le(2);return r[0]=t,r[1]=e,r}function Em(t,e){return t[0]=e[0],t[1]=e[1],t}function wm(t,e,r){return t[0]=e,t[1]=r,t}function Mm(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Gc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function Hc(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function qc(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function _m(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function Rm(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function bm(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Am(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Im(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function Sm(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Cm(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function Wc(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function Xc(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function Yc(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function Kc(t){var e=t[0],r=t[1];return e*e+r*r}function Nm(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Om(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Fm(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 Dm(t,e){return t[0]*e[0]+t[1]*e[1]}function $m(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Pm(t,e,r,n){var s=e[0],a=e[1];return t[0]=s+n*(r[0]-s),t[1]=a+n*(r[1]-a),t}function km(t,e){e=e||1;var r=ft()*2*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Um(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 Lm(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 jm(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 Bm(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 zm(t,e,r,n){var s=e[0]-r[0],a=e[1]-r[1],c=Math.sin(n),f=Math.cos(n);return t[0]=s*f-a*c+r[0],t[1]=s*c+a*f+r[1],t}function Vm(t,e){var r=t[0],n=t[1],s=e[0],a=e[1],c=Math.sqrt(r*r+n*n)*Math.sqrt(s*s+a*a),f=c&&(r*s+n*a)/c;return Math.acos(Math.min(Math.max(f,-1),1))}function Gm(t){return t[0]=0,t[1]=0,t}function Hm(t){return"vec2("+t[0]+", "+t[1]+")"}function qm(t,e){return t[0]===e[0]&&t[1]===e[1]}function Wm(t,e){var r=t[0],n=t[1],s=e[0],a=e[1];return Math.abs(r-s)<=Q*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=Q*Math.max(1,Math.abs(n),Math.abs(a))}var Xm=Yc,Ym=Gc,Km=Hc,Jm=qc,Zm=Wc,Qm=Xc,ev=Kc,tv=function(){var t=Vc();return function(e,r,n,s,a,c){var f,h;for(r||(r=2),n||(n=0),s?h=Math.min(s*r+n,e.length):h=e.length,f=n;f{var t=import.meta.url;return async function(e={}){var r=e,n,s;r.ready=new Promise((i,o)=>{n=i,s=o});var a=!1;r.setup=function(){if(a)return;a=!0;function i(S,I,$=j=>j){if(I)for(let j of I)S.push_back($(j));return S}function o(S,I=$=>$){const $=[],j=S.size();for(let J=0;J$){const $=[],j=S.size();for(let J=0;Ji(new r.Vector_vec2,I,$=>$ instanceof Array?{x:$[0],y:$[1]}:$))}function p(S){for(let I=0;IS.min[I]),max:["x","y"].map(I=>S.max[I])}},r.CrossSection.prototype.offset=function(S,I="Square",$=2,j=0){return this._Offset(S,F(I),$,j)},r.CrossSection.prototype.extrude=function(S,I=0,$=0,j=[1,1],J=!1){j=v([j]);const pe=r._Extrude(this,S,I,$,j);return J?pe.translate([0,0,-S/2]):pe},r.CrossSection.prototype.revolve=function(S=0,I=360){return r._Revolve(this,S,I)},r.CrossSection.prototype.add=function(S){return this._add(z(S))},r.CrossSection.prototype.subtract=function(S){return this._subtract(z(S))},r.CrossSection.prototype.intersect=function(S){return this._intersect(z(S))},r.CrossSection.prototype.toPolygons=function(){const S=this._ToPolygons(),I=l(S);return S.delete(),I},r.Manifold.prototype.warp=function(S){const I=Rr(function(J){const pe=ct(J,"float"),ue=ct(J+4,"float"),nt=ct(J+8,"float"),qe=[pe,ue,nt];S(qe),sr(J,qe[0],"float"),sr(J+4,qe[1],"float"),sr(J+8,qe[2],"float")},"vi"),$=this._Warp(I);br(I);const j=$.status();if(j.value!==0)throw new r.ManifoldError(j.value);return $},r.Manifold.prototype.setProperties=function(S,I){const $=this.numProp(),j=Rr(function(pe,ue,nt){const qe=[];for(let ke=0;keS.min[I]),max:["x","y","z"].map(I=>S.max[I])}};class Y{constructor({numProp:I=3,triVerts:$=new Uint32Array,vertProperties:j=new Float32Array,mergeFromVert:J,mergeToVert:pe,runIndex:ue,runOriginalID:nt,faceID:qe,halfedgeTangent:cr,runTransform:lr}={}){this.numProp=I,this.triVerts=$,this.vertProperties=j,this.mergeFromVert=J,this.mergeToVert=pe,this.runIndex=ue,this.runOriginalID=nt,this.faceID=qe,this.halfedgeTangent=cr,this.runTransform=lr}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:I,mesh:$}=r._Merge(this);return Object.assign(this,{...$}),I}verts(I){return this.triVerts.subarray(3*I,3*(I+1))}position(I){return this.vertProperties.subarray(numProp*I,numProp*I+3)}extras(I){return this.vertProperties.subarray(numProp*I+3,numProp*(I+1))}tangent(I){return this.halfedgeTangent.subarray(4*I,4*(I+1))}transform(I){const $=new Array(16);for(const j of[0,1,2,3])for(const J of[0,1,2])$[4*j+J]=this.runTransform[12*I+3*j+J];return $[15]=1,$}}r.Mesh=Y,r.Manifold.prototype.getMesh=function(S=[0,0,0]){return S instanceof Array&&(S={0:S[0],1:S[1],2:S[2]}),new Y(this._GetMeshJS(S))},r.ManifoldError=function(I,...$){let j="Unknown error";switch(I){case r.status.NonFiniteVertex.value:j="Non-finite vertex";break;case r.status.NotManifold.value:j="Not manifold";break;case r.status.VertexOutOfBounds.value:j="Vertex index out of bounds";break;case r.status.PropertiesWrongLength.value:j="Properties have wrong length";break;case r.status.MissingPositionProperties.value:j="Less than three properties";break;case r.status.MergeVectorsDifferentLengths.value:j="Merge vectors have different lengths";break;case r.status.MergeIndexOutOfBounds.value:j="Merge index out of bounds";break;case r.status.TransformWrongLength.value:j="Transform vector has wrong length";break;case r.status.RunIndexWrongLength.value:j="Run index vector has wrong length";break;case r.status.FaceIDWrongLength.value:j="Face ID vector has wrong length";case r.status.InvalidConstruction.value:j="Manifold constructed with invalid parameters"}const J=Error.apply(this,[j,...$]);J.name=this.name="ManifoldError",this.message=J.message,this.stack=J.stack,this.code=I},r.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:r.ManifoldError,writable:!0,configurable:!0}}),r.CrossSection=function(S,I="Positive"){const $=u(S),j=new D($,_(I));return p($),j},r.CrossSection.ofPolygons=function(S,I="Positive"){return new r.CrossSection(S,I)},r.CrossSection.square=function(...S){let I;S.length==0?I={x:1,y:1}:typeof S[0]=="number"?I={x:S[0],y:S[0]}:I=v(S);const $=S[1]||!1;return r._Square(I,$)},r.CrossSection.circle=function(S,I=0){return r._Circle(S,I)};function q(S){return function(...I){I.length==1&&(I=I[0]);const $=new r.Vector_crossSection;for(const J of I)$.push_back(z(J));const j=r["_crossSection"+S]($);return $.delete(),j}}r.CrossSection.compose=q("Compose"),r.CrossSection.union=q("UnionN"),r.CrossSection.difference=q("DifferenceN"),r.CrossSection.intersection=q("IntersectionN");function W(S,I){i(S,I,$=>$ instanceof Array?{x:$[0],y:$[1]}:$)}r.CrossSection.hull=function(...S){S.length==1&&(S=S[0]);let I=new r.Vector_vec2;for(const j of S)if(j instanceof D)r._crossSectionCollectVertices(I,j);else if(j instanceof Array&&j.length==2&&typeof j[0]=="number")I.push_back({x:j[0],y:j[1]});else if(j.x)I.push_back(j);else{const pe=j[0].length==2&&typeof j[0][0]=="number"||j[0].x?[j]:j;for(const ue of pe)W(I,ue)}const $=r._crossSectionHullPoints(I);return I.delete(),$},r.CrossSection.prototype=Object.create(D.prototype),Object.defineProperty(r.CrossSection,Symbol.hasInstance,{get:()=>S=>S instanceof D});const Z=r.Manifold;r.Manifold=function(S){const I=new Z(S),$=I.status();if($.value!==0)throw new r.ManifoldError($.value);return I},r.Manifold.ofMesh=function(S){return new r.Manifold(S)},r.Manifold.tetrahedron=function(){return r._Tetrahedron()},r.Manifold.cube=function(...S){let I;S.length==0?I={x:1,y:1,z:1}:typeof S[0]=="number"?I={x:S[0],y:S[0],z:S[0]}:I=E(S);const $=S[1]||!1;return r._Cube(I,$)},r.Manifold.cylinder=function(S,I,$=-1,j=0,J=!1){return r._Cylinder(S,I,$,j,J)},r.Manifold.sphere=function(S,I=0){return r._Sphere(S,I)},r.Manifold.smooth=function(S,I=[]){const $=new r.Vector_smoothness;i($,I);const j=r._Smooth(S,$);return $.delete(),j},r.Manifold.extrude=function(S,I,$=0,j=0,J=[1,1],pe=!1){return(S instanceof D?S:r.CrossSection(S,"Positive")).extrude(I,$,j,J,pe)},r.Manifold.revolve=function(S,I=0,$=360){return(S instanceof D?S:r.CrossSection(S,"Positive")).revolve(I,$)},r.Manifold.reserveIDs=function(S){return r._ReserveIDs(S)},r.Manifold.compose=function(S){const I=new r.Vector_manifold;i(I,S);const $=r._manifoldCompose(I);return I.delete(),$};function he(S){return function(...I){I.length==1&&(I=I[0]);const $=new r.Vector_manifold;for(const J of I)$.push_back(J);const j=r["_manifold"+S+"N"]($);return $.delete(),j}}r.Manifold.union=he("Union"),r.Manifold.difference=he("Difference"),r.Manifold.intersection=he("Intersection"),r.Manifold.levelSet=function(S,I,$,j=0){const J={min:{x:I.min[0],y:I.min[1],z:I.min[2]},max:{x:I.max[0],y:I.max[1],z:I.max[2]}},pe=Rr(function(nt){const qe=ct(nt,"float"),cr=ct(nt+4,"float"),lr=ct(nt+8,"float");return S([qe,cr,lr])},"fi"),ue=r._LevelSet(pe,J,$,j);return br(pe),ue};function me(S,I){i(S,I,$=>$ instanceof Array?{x:$[0],y:$[1],z:$[2]}:$)}r.Manifold.hull=function(...S){S.length==1&&(S=S[0]);let I=new r.Vector_vec3;for(const j of S)j instanceof Z?r._manifoldCollectVertices(I,j):j instanceof Array&&j.length==3&&typeof j[0]=="number"?I.push_back({x:j[0],y:j[1],z:j[2]}):j.x?I.push_back(j):me(I,j);const $=r._manifoldHullPoints(I);return I.delete(),$},r.Manifold.prototype=Object.create(Z.prototype),Object.defineProperty(r.Manifold,Symbol.hasInstance,{get:()=>S=>S instanceof Z}),r.triangulate=function(S,I=-1){const $=u(S),j=o(r._Triangulate($,I),J=>[J[0],J[1],J[2]]);return p($),j}};var c=Object.assign({},r),f="./this.program",h=typeof window=="object",d=typeof importScripts=="function",g=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",x="";function w(i){return r.locateFile?r.locateFile(i,x):x+i}var M,A,N;if(g){const{createRequire:i}=await import("./__vite-browser-external-4ed993c7.js");var m=i(import.meta.url),C=m("fs"),T=m("path");d?x=T.dirname(x)+"/":x=m("url").fileURLToPath(new URL("./",self.location)),M=(o,l)=>(o=nr(o)?new URL(o):T.normalize(o),C.readFileSync(o,l?void 0:"utf8")),N=o=>{var l=M(o,!0);return l.buffer||(l=new Uint8Array(l)),l},A=(o,l,u,p=!0)=>{o=nr(o)?new URL(o):T.normalize(o),C.readFile(o,p?void 0:"utf8",(v,E)=>{v?u(v):l(p?E.buffer:E)})},!r.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),r.inspect=()=>"[Emscripten Module object]"}else(h||d)&&(d?x=self.location.href:typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),t&&(x=t),x.indexOf("blob:")!==0?x=x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1):x="",M=i=>{var o=new XMLHttpRequest;return o.open("GET",i,!1),o.send(null),o.responseText},d&&(N=i=>{var o=new XMLHttpRequest;return o.open("GET",i,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}),A=(i,o,l)=>{var u=new XMLHttpRequest;u.open("GET",i,!0),u.responseType="arraybuffer",u.onload=()=>{if(u.status==200||u.status==0&&u.response){o(u.response);return}l()},u.onerror=l,u.send(null)});var R=r.print||console.log.bind(console),b=r.printErr||console.error.bind(console);Object.assign(r,c),c=null,r.arguments&&r.arguments,r.thisProgram&&(f=r.thisProgram),r.quit&&r.quit;var O;r.wasmBinary&&(O=r.wasmBinary),r.noExitRuntime,typeof WebAssembly!="object"&&ze("no native wasm support detected");var P,V=!1;function B(i,o){i||ze(o)}var k,G,H,K,L,U,ee,fe;function re(){var i=P.buffer;r.HEAP8=k=new Int8Array(i),r.HEAP16=H=new Int16Array(i),r.HEAPU8=G=new Uint8Array(i),r.HEAPU16=K=new Uint16Array(i),r.HEAP32=L=new Int32Array(i),r.HEAPU32=U=new Uint32Array(i),r.HEAPF32=ee=new Float32Array(i),r.HEAPF64=fe=new Float64Array(i)}var ge,ve=[],xe=[],Te=[];function Re(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Ce(r.preRun.shift());Un(ve)}function Ue(){!r.noFSInit&&!y.init.initialized&&y.init(),y.ignorePermissions=!1,Un(xe)}function Ae(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)ot(r.postRun.shift());Un(Te)}function Ce(i){ve.unshift(i)}function Qe(i){xe.unshift(i)}function ot(i){Te.unshift(i)}var Je=0,Me=null;function Ot(i){return i}function He(i){Je++,r.monitorRunDependencies&&r.monitorRunDependencies(Je)}function xt(i){if(Je--,r.monitorRunDependencies&&r.monitorRunDependencies(Je),Je==0&&Me){var o=Me;Me=null,o()}}function ze(i){r.onAbort&&r.onAbort(i),i="Aborted("+i+")",b(i),V=!0,i+=". Build with -sASSERTIONS for more info.";var o=new WebAssembly.RuntimeError(i);throw s(o),o}var Ft="data:application/octet-stream;base64,";function Wr(i){return i.startsWith(Ft)}function nr(i){return i.startsWith("file://")}var Tt;r.locateFile?(Tt="manifold.wasm",Wr(Tt)||(Tt=w(Tt))):Tt=new URL("/assets/manifold-7312ee51.wasm",self.location).href;function li(i){if(i==Tt&&O)return new Uint8Array(O);if(N)return N(i);throw"both async and sync fetching of the wasm failed"}function il(i){if(!O&&(h||d)){if(typeof fetch=="function"&&!nr(i))return fetch(i,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw"failed to load wasm binary file at '"+i+"'";return o.arrayBuffer()}).catch(()=>li(i));if(A)return new Promise((o,l)=>{A(i,u=>o(new Uint8Array(u)),l)})}return Promise.resolve().then(()=>li(i))}function fi(i,o,l){return il(i).then(u=>WebAssembly.instantiate(u,o)).then(u=>u).then(l,u=>{b(`failed to asynchronously prepare wasm: ${u}`),ze(u)})}function al(i,o,l,u){return!i&&typeof WebAssembly.instantiateStreaming=="function"&&!Wr(o)&&!nr(o)&&!g&&typeof fetch=="function"?fetch(o,{credentials:"same-origin"}).then(p=>{var v=WebAssembly.instantiateStreaming(p,l);return v.then(u,function(E){return b(`wasm streaming compile failed: ${E}`),b("falling back to ArrayBuffer instantiation"),fi(o,l,u)})}):fi(o,l,u)}function ol(){var i={a:wu};function o(u,p){var v=u.exports;return _e=v,P=_e.Ma,re(),ge=_e.Oa,Qe(_e.Na),xt(),v}He();function l(u){o(u.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(i,o)}catch(u){b(`Module.instantiateWasm callback failed with error: ${u}`),s(u)}return al(O,Tt,i,l).catch(s),{}}var de,je,Un=i=>{for(;i.length>0;)i.shift()(r)};function ct(i,o="i8"){switch(o.endsWith("*")&&(o="*"),o){case"i1":return k[i>>0];case"i8":return k[i>>0];case"i16":return H[i>>1];case"i32":return L[i>>2];case"i64":ze("to do getValue(i64) use WASM_BIGINT");case"float":return ee[i>>2];case"double":return fe[i>>3];case"*":return U[i>>2];default:ze(`invalid type for getValue: ${o}`)}}function sr(i,o,l="i8"){switch(l.endsWith("*")&&(l="*"),l){case"i1":k[i>>0]=o;break;case"i8":k[i>>0]=o;break;case"i16":H[i>>1]=o;break;case"i32":L[i>>2]=o;break;case"i64":ze("to do setValue(i64) use WASM_BIGINT");case"float":ee[i>>2]=o;break;case"double":fe[i>>3]=o;break;case"*":U[i>>2]=o;break;default:ze(`invalid type for setValue: ${l}`)}}var Xr=[],Yr=0,cl=i=>{var o=new Ln(i);return o.get_caught()||(o.set_caught(!0),Yr--),o.set_rethrown(!1),Xr.push(o),ki(o.excPtr),o.get_exception_ptr()},Et=0,ll=()=>{ne(0,0);var i=Xr.pop();Pi(i.excPtr),Et=0};function Ln(i){this.excPtr=i,this.ptr=i-24,this.set_type=function(o){U[this.ptr+4>>2]=o},this.get_type=function(){return U[this.ptr+4>>2]},this.set_destructor=function(o){U[this.ptr+8>>2]=o},this.get_destructor=function(){return U[this.ptr+8>>2]},this.set_caught=function(o){o=o?1:0,k[this.ptr+12>>0]=o},this.get_caught=function(){return k[this.ptr+12>>0]!=0},this.set_rethrown=function(o){o=o?1:0,k[this.ptr+13>>0]=o},this.get_rethrown=function(){return k[this.ptr+13>>0]!=0},this.init=function(o,l){this.set_adjusted_ptr(0),this.set_type(o),this.set_destructor(l)},this.set_adjusted_ptr=function(o){U[this.ptr+16>>2]=o},this.get_adjusted_ptr=function(){return U[this.ptr+16>>2]},this.get_exception_ptr=function(){var o=Li(this.get_type());if(o)return U[this.excPtr>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}var fl=i=>{throw Et||(Et=i),Et},ui=i=>{var o=Et;if(!o)return Ar(0),0;var l=new Ln(o);l.set_adjusted_ptr(o);var u=l.get_type();if(!u)return Ar(0),o;for(var p in i){var v=i[p];if(v===0||v===u)break;var E=l.ptr+16;if(Ui(v,u,E))return Ar(v),o}return Ar(u),o},ul=()=>ui([]),hl=i=>ui([i]),dl=()=>{var i=Xr.pop();i||ze("no exception to throw");var o=i.excPtr;throw i.get_rethrown()||(Xr.push(i),i.set_rethrown(!0),i.set_caught(!1),Yr++),Et=o,Et},pl=(i,o,l)=>{var u=new Ln(i);throw u.init(o,l),Et=i,Yr++,Et},gl=()=>Yr,Kr={},jn=i=>{for(;i.length;){var o=i.pop(),l=i.pop();l(o)}};function Bn(i){return this.fromWireType(L[i>>2])}var ir={},Dt={},Jr={},hi=void 0,Zr=i=>{throw new hi(i)},$t=(i,o,l)=>{i.forEach(function(_){Jr[_]=o});function u(_){var F=l(_);F.length!==i.length&&Zr("Mismatched type converter count");for(var D=0;D{Dt.hasOwnProperty(_)?p[F]=Dt[_]:(v.push(_),ir.hasOwnProperty(_)||(ir[_]=[]),ir[_].push(()=>{p[F]=Dt[_],++E,E===v.length&&u(p)}))}),v.length===0&&u(p)},ml=i=>{var o=Kr[i];delete Kr[i];var l=o.rawConstructor,u=o.rawDestructor,p=o.fields,v=p.map(E=>E.getterReturnType).concat(p.map(E=>E.setterArgumentType));$t([i],v,E=>{var _={};return p.forEach((F,D)=>{var z=F.fieldName,Y=E[D],q=F.getter,W=F.getterContext,Z=E[D+p.length],he=F.setter,me=F.setterContext;_[z]={read:S=>Y.fromWireType(q(W,S)),write:(S,I)=>{var $=[];he(me,S,Z.toWireType($,I)),jn($)}}}),[{name:o.name,fromWireType:F=>{var D={};for(var z in _)D[z]=_[z].read(F);return u(F),D},toWireType:(F,D)=>{for(var z in _)if(!(z in D))throw new TypeError(`Missing field: "${z}"`);var Y=l();for(z in _)_[z].write(Y,D[z]);return F!==null&&F.push(u,Y),Y},argPackAdvance:pt,readValueFromPointer:Bn,destructorFunction:u}]})},vl=(i,o,l,u,p)=>{},yl=()=>{for(var i=new Array(256),o=0;o<256;++o)i[o]=String.fromCharCode(o);di=i},di=void 0,Be=i=>{for(var o="",l=i;G[l];)o+=di[G[l++]];return o},ar=void 0,ye=i=>{throw new ar(i)};function xl(i,o,l={}){var u=o.name;if(i||ye(`type "${u}" must have a positive integer typeid pointer`),Dt.hasOwnProperty(i)){if(l.ignoreDuplicateRegistrations)return;ye(`Cannot register type '${u}' twice`)}if(Dt[i]=o,delete Jr[i],ir.hasOwnProperty(i)){var p=ir[i];delete ir[i],p.forEach(v=>v())}}function dt(i,o,l={}){if(!("argPackAdvance"in o))throw new TypeError("registerType registeredInstance requires argPackAdvance");return xl(i,o,l)}var pt=8,Tl=(i,o,l,u)=>{o=Be(o),dt(i,{name:o,fromWireType:function(p){return!!p},toWireType:function(p,v){return v?l:u},argPackAdvance:pt,readValueFromPointer:function(p){return this.fromWireType(G[p])},destructorFunction:null})};function El(i){if(!(this instanceof St)||!(i instanceof St))return!1;for(var o=this.$$.ptrType.registeredClass,l=this.$$.ptr,u=i.$$.ptrType.registeredClass,p=i.$$.ptr;o.baseClass;)l=o.upcast(l),o=o.baseClass;for(;u.baseClass;)p=u.upcast(p),u=u.baseClass;return o===u&&l===p}var wl=i=>({count:i.count,deleteScheduled:i.deleteScheduled,preservePointerOnDelete:i.preservePointerOnDelete,ptr:i.ptr,ptrType:i.ptrType,smartPtr:i.smartPtr,smartPtrType:i.smartPtrType}),zn=i=>{function o(l){return l.$$.ptrType.registeredClass.name}ye(o(i)+" instance already deleted")},Vn=!1,pi=i=>{},Ml=i=>{i.smartPtr?i.smartPtrType.rawDestructor(i.smartPtr):i.ptrType.registeredClass.rawDestructor(i.ptr)},gi=i=>{i.count.value-=1;var o=i.count.value===0;o&&Ml(i)},mi=(i,o,l)=>{if(o===l)return i;if(l.baseClass===void 0)return null;var u=mi(i,o,l.baseClass);return u===null?null:l.downcast(u)},vi={},_l=()=>Object.keys(Er).length,Rl=()=>{var i=[];for(var o in Er)Er.hasOwnProperty(o)&&i.push(Er[o]);return i},xr=[],Gn=()=>{for(;xr.length;){var i=xr.pop();i.$$.deleteScheduled=!1,i.delete()}},Tr=void 0,bl=i=>{Tr=i,xr.length&&Tr&&Tr(Gn)},Al=()=>{r.getInheritedInstanceCount=_l,r.getLiveInheritedInstances=Rl,r.flushPendingDeletes=Gn,r.setDelayFunction=bl},Er={},Il=(i,o)=>{for(o===void 0&&ye("ptr should not be undefined");i.baseClass;)o=i.upcast(o),i=i.baseClass;return o},Sl=(i,o)=>(o=Il(i,o),Er[o]),Qr=(i,o)=>{(!o.ptrType||!o.ptr)&&Zr("makeClassHandle requires ptr and ptrType");var l=!!o.smartPtrType,u=!!o.smartPtr;return l!==u&&Zr("Both smartPtrType and smartPtr must be specified"),o.count={value:1},wr(Object.create(i,{$$:{value:o}}))};function Cl(i){var o=this.getPointee(i);if(!o)return this.destructor(i),null;var l=Sl(this.registeredClass,o);if(l!==void 0){if(l.$$.count.value===0)return l.$$.ptr=o,l.$$.smartPtr=i,l.clone();var u=l.clone();return this.destructor(i),u}function p(){return this.isSmartPointer?Qr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:o,smartPtrType:this,smartPtr:i}):Qr(this.registeredClass.instancePrototype,{ptrType:this,ptr:i})}var v=this.registeredClass.getActualType(o),E=vi[v];if(!E)return p.call(this);var _;this.isConst?_=E.constPointerType:_=E.pointerType;var F=mi(o,this.registeredClass,_.registeredClass);return F===null?p.call(this):this.isSmartPointer?Qr(_.registeredClass.instancePrototype,{ptrType:_,ptr:F,smartPtrType:this,smartPtr:i}):Qr(_.registeredClass.instancePrototype,{ptrType:_,ptr:F})}var wr=i=>typeof FinalizationRegistry>"u"?(wr=o=>o,i):(Vn=new FinalizationRegistry(o=>{gi(o.$$)}),wr=o=>{var l=o.$$,u=!!l.smartPtr;if(u){var p={$$:l};Vn.register(o,p,o)}return o},pi=o=>Vn.unregister(o),wr(i));function Nl(){if(this.$$.ptr||zn(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var i=wr(Object.create(Object.getPrototypeOf(this),{$$:{value:wl(this.$$)}}));return i.$$.count.value+=1,i.$$.deleteScheduled=!1,i}function Ol(){this.$$.ptr||zn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ye("Object already scheduled for deletion"),pi(this),gi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Fl(){return!this.$$.ptr}function Dl(){return this.$$.ptr||zn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ye("Object already scheduled for deletion"),xr.push(this),xr.length===1&&Tr&&Tr(Gn),this.$$.deleteScheduled=!0,this}var $l=()=>{St.prototype.isAliasOf=El,St.prototype.clone=Nl,St.prototype.delete=Ol,St.prototype.isDeleted=Fl,St.prototype.deleteLater=Dl};function St(){}var Pl=48,kl=57,en=i=>{if(i===void 0)return"_unknown";i=i.replace(/[^a-zA-Z0-9_]/g,"$");var o=i.charCodeAt(0);return o>=Pl&&o<=kl?`_${i}`:i};function tn(i,o){return i=en(i),{[i]:function(){return o.apply(this,arguments)}}[i]}var yi=(i,o,l)=>{if(i[o].overloadTable===void 0){var u=i[o];i[o]=function(){return i[o].overloadTable.hasOwnProperty(arguments.length)||ye(`Function '${l}' called with an invalid number of arguments (${arguments.length}) - expects one of (${i[o].overloadTable})!`),i[o].overloadTable[arguments.length].apply(this,arguments)},i[o].overloadTable=[],i[o].overloadTable[u.argCount]=u}},Hn=(i,o,l)=>{r.hasOwnProperty(i)?((l===void 0||r[i].overloadTable!==void 0&&r[i].overloadTable[l]!==void 0)&&ye(`Cannot register public name '${i}' twice`),yi(r,i,i),r.hasOwnProperty(l)&&ye(`Cannot register multiple overloads of a function with the same number of arguments (${l})!`),r[i].overloadTable[l]=o):(r[i]=o,l!==void 0&&(r[i].numArguments=l))};function Ul(i,o,l,u,p,v,E,_){this.name=i,this.constructor=o,this.instancePrototype=l,this.rawDestructor=u,this.baseClass=p,this.getActualType=v,this.upcast=E,this.downcast=_,this.pureVirtualFunctions=[]}var qn=(i,o,l)=>{for(;o!==l;)o.upcast||ye(`Expected null or instance of ${l.name}, got an instance of ${o.name}`),i=o.upcast(i),o=o.baseClass;return i};function Ll(i,o){if(o===null)return this.isReference&&ye(`null is not a valid ${this.name}`),0;o.$$||ye(`Cannot pass "${Kn(o)}" as a ${this.name}`),o.$$.ptr||ye(`Cannot pass deleted object as a pointer of type ${this.name}`);var l=o.$$.ptrType.registeredClass,u=qn(o.$$.ptr,l,this.registeredClass);return u}function jl(i,o){var l;if(o===null)return this.isReference&&ye(`null is not a valid ${this.name}`),this.isSmartPointer?(l=this.rawConstructor(),i!==null&&i.push(this.rawDestructor,l),l):0;o.$$||ye(`Cannot pass "${Kn(o)}" as a ${this.name}`),o.$$.ptr||ye(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&o.$$.ptrType.isConst&&ye(`Cannot convert argument of type ${o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name} to parameter type ${this.name}`);var u=o.$$.ptrType.registeredClass;if(l=qn(o.$$.ptr,u,this.registeredClass),this.isSmartPointer)switch(o.$$.smartPtr===void 0&&ye("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:o.$$.smartPtrType===this?l=o.$$.smartPtr:ye(`Cannot convert argument of type ${o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:l=o.$$.smartPtr;break;case 2:if(o.$$.smartPtrType===this)l=o.$$.smartPtr;else{var p=o.clone();l=this.rawShare(l,Pe.toHandle(()=>p.delete())),i!==null&&i.push(this.rawDestructor,l)}break;default:ye("Unsupporting sharing policy")}return l}function Bl(i,o){if(o===null)return this.isReference&&ye(`null is not a valid ${this.name}`),0;o.$$||ye(`Cannot pass "${Kn(o)}" as a ${this.name}`),o.$$.ptr||ye(`Cannot pass deleted object as a pointer of type ${this.name}`),o.$$.ptrType.isConst&&ye(`Cannot convert argument of type ${o.$$.ptrType.name} to parameter type ${this.name}`);var l=o.$$.ptrType.registeredClass,u=qn(o.$$.ptr,l,this.registeredClass);return u}function xi(i){return this.fromWireType(U[i>>2])}function zl(i){return this.rawGetPointee&&(i=this.rawGetPointee(i)),i}function Vl(i){this.rawDestructor&&this.rawDestructor(i)}var Gl=i=>{i!==null&&i.delete()},Hl=()=>{wt.prototype.getPointee=zl,wt.prototype.destructor=Vl,wt.prototype.argPackAdvance=pt,wt.prototype.readValueFromPointer=xi,wt.prototype.deleteObject=Gl,wt.prototype.fromWireType=Cl};function wt(i,o,l,u,p,v,E,_,F,D,z){this.name=i,this.registeredClass=o,this.isReference=l,this.isConst=u,this.isSmartPointer=p,this.pointeeType=v,this.sharingPolicy=E,this.rawGetPointee=_,this.rawConstructor=F,this.rawShare=D,this.rawDestructor=z,!p&&o.baseClass===void 0?u?(this.toWireType=Ll,this.destructorFunction=null):(this.toWireType=Bl,this.destructorFunction=null):this.toWireType=jl}var Ti=(i,o,l)=>{r.hasOwnProperty(i)||Zr("Replacing nonexistant public symbol"),r[i].overloadTable!==void 0&&l!==void 0?r[i].overloadTable[l]=o:(r[i]=o,r[i].argCount=l)},ql=(i,o,l)=>{var u=r["dynCall_"+i];return l&&l.length?u.apply(null,[o].concat(l)):u.call(null,o)},Mr=[],ce=i=>{var o=Mr[i];return o||(i>=Mr.length&&(Mr.length=i+1),Mr[i]=o=ge.get(i)),o},Wl=(i,o,l)=>{if(i.includes("j"))return ql(i,o,l);var u=ce(o).apply(null,l);return u},Xl=(i,o)=>{var l=[];return function(){return l.length=0,Object.assign(l,arguments),Wl(i,o,l)}},lt=(i,o)=>{i=Be(i);function l(){return i.includes("j")?Xl(i,o):ce(o)}var u=l();return typeof u!="function"&&ye(`unknown function pointer with signature ${i}: ${o}`),u},Yl=(i,o)=>{var l=tn(o,function(u){this.name=o,this.message=u;var p=new Error(u).stack;p!==void 0&&(this.stack=this.toString()+` +`+p.replace(/^Error(:[^\n]*)?\n/,""))});return l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},l},Ei=void 0,wi=i=>{var o=$i(i),l=Be(o);return _t(o),l},rn=(i,o)=>{var l=[],u={};function p(v){if(!u[v]&&!Dt[v]){if(Jr[v]){Jr[v].forEach(p);return}l.push(v),u[v]=!0}}throw o.forEach(p),new Ei(`${i}: `+l.map(wi).join([", "]))},Kl=(i,o,l,u,p,v,E,_,F,D,z,Y,q)=>{z=Be(z),v=lt(p,v),_&&(_=lt(E,_)),D&&(D=lt(F,D)),q=lt(Y,q);var W=en(z);Hn(W,function(){rn(`Cannot construct ${z} due to unbound types`,[u])}),$t([i,o,l],u?[u]:[],function(Z){Z=Z[0];var he,me;u?(he=Z.registeredClass,me=he.instancePrototype):me=St.prototype;var S=tn(W,function(){if(Object.getPrototypeOf(this)!==I)throw new ar("Use 'new' to construct "+z);if($.constructor_body===void 0)throw new ar(z+" has no accessible constructor");var ue=$.constructor_body[arguments.length];if(ue===void 0)throw new ar(`Tried to invoke ctor of ${z} with invalid number of parameters (${arguments.length}) - expected (${Object.keys($.constructor_body).toString()}) parameters instead!`);return ue.apply(this,arguments)}),I=Object.create(me,{constructor:{value:S}});S.prototype=I;var $=new Ul(z,S,I,q,he,v,_,D);$.baseClass&&($.baseClass.__derivedClasses===void 0&&($.baseClass.__derivedClasses=[]),$.baseClass.__derivedClasses.push($));var j=new wt(z,$,!0,!1,!1),J=new wt(z+"*",$,!1,!1,!1),pe=new wt(z+" const*",$,!1,!0,!1);return vi[i]={pointerType:J,constPointerType:pe},Ti(W,S),[j,J,pe]})},Wn=(i,o)=>{for(var l=[],u=0;u>2]);return l};function Mi(i,o){if(!(i instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof i} which is not a function`);var l=tn(i.name||"unknownFunctionName",function(){});l.prototype=i.prototype;var u=new l,p=i.apply(u,o);return p instanceof Object?p:u}function Xn(i,o,l,u,p,v){var E=o.length;E<2&&ye("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var _=o[1]!==null&&l!==null,F=!1,D=1;D0?", ":"")+q),W+=(z||v?"var rv = ":"")+"invoker(fn"+(q.length>0?", ":"")+q+`); +`,F)W+=`runDestructors(destructors); +`;else for(var D=_?1:2;D{var E=Wn(o,l);p=lt(u,p),$t([],[i],function(_){_=_[0];var F=`constructor ${_.name}`;if(_.registeredClass.constructor_body===void 0&&(_.registeredClass.constructor_body=[]),_.registeredClass.constructor_body[o-1]!==void 0)throw new ar(`Cannot register multiple constructors with identical number of parameters (${o-1}) for class '${_.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return _.registeredClass.constructor_body[o-1]=()=>{rn(`Cannot construct ${_.name} due to unbound types`,E)},$t([],E,D=>(D.splice(1,0,null),_.registeredClass.constructor_body[o-1]=Xn(F,D,null,p,v),[])),[]})},Zl=(i,o,l,u,p,v,E,_,F)=>{var D=Wn(l,u);o=Be(o),v=lt(p,v),$t([],[i],function(z){z=z[0];var Y=`${z.name}.${o}`;o.startsWith("@@")&&(o=Symbol[o.substring(2)]),_&&z.registeredClass.pureVirtualFunctions.push(o);function q(){rn(`Cannot call ${Y} due to unbound types`,D)}var W=z.registeredClass.instancePrototype,Z=W[o];return Z===void 0||Z.overloadTable===void 0&&Z.className!==z.name&&Z.argCount===l-2?(q.argCount=l-2,q.className=z.name,W[o]=q):(yi(W,o,Y),W[o].overloadTable[l-2]=q),$t([],D,function(he){var me=Xn(Y,he,z,v,E,F);return W[o].overloadTable===void 0?(me.argCount=l-2,W[o]=me):W[o].overloadTable[l-2]=me,[]}),[]})};function Ql(){Object.assign(_i.prototype,{get(i){return this.allocated[i]},has(i){return this.allocated[i]!==void 0},allocate(i){var o=this.freelist.pop()||this.allocated.length;return this.allocated[o]=i,o},free(i){this.allocated[i]=void 0,this.freelist.push(i)}})}function _i(){this.allocated=[void 0],this.freelist=[]}var rt=new _i,Yn=i=>{i>=rt.reserved&&--rt.get(i).refcount===0&&rt.free(i)},ef=()=>{for(var i=0,o=rt.reserved;o{rt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),rt.reserved=rt.allocated.length,r.count_emval_handles=ef},Pe={toValue:i=>(i||ye("Cannot use deleted val. handle = "+i),rt.get(i).value),toHandle:i=>{switch(i){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return rt.allocate({refcount:1,value:i})}}},rf=(i,o)=>{o=Be(o),dt(i,{name:o,fromWireType:l=>{var u=Pe.toValue(l);return Yn(l),u},toWireType:(l,u)=>Pe.toHandle(u),argPackAdvance:pt,readValueFromPointer:Bn,destructorFunction:null})},nf=(i,o,l)=>{switch(o){case 1:return l?function(u){return this.fromWireType(k[u>>0])}:function(u){return this.fromWireType(G[u>>0])};case 2:return l?function(u){return this.fromWireType(H[u>>1])}:function(u){return this.fromWireType(K[u>>1])};case 4:return l?function(u){return this.fromWireType(L[u>>2])}:function(u){return this.fromWireType(U[u>>2])};default:throw new TypeError(`invalid integer width (${o}): ${i}`)}},sf=(i,o,l,u)=>{o=Be(o);function p(){}p.values={},dt(i,{name:o,constructor:p,fromWireType:function(v){return this.constructor.values[v]},toWireType:(v,E)=>E.value,argPackAdvance:pt,readValueFromPointer:nf(o,l,u),destructorFunction:null}),Hn(o,p)},nn=(i,o)=>{var l=Dt[i];return l===void 0&&ye(o+" has unknown type "+wi(i)),l},af=(i,o,l)=>{var u=nn(i,"enum");o=Be(o);var p=u.constructor,v=Object.create(u.constructor.prototype,{value:{value:l},constructor:{value:tn(`${u.name}_${o}`,function(){})}});p.values[l]=v,p[o]=v},Kn=i=>{if(i===null)return"null";var o=typeof i;return o==="object"||o==="array"||o==="function"?i.toString():""+i},of=(i,o)=>{switch(o){case 4:return function(l){return this.fromWireType(ee[l>>2])};case 8:return function(l){return this.fromWireType(fe[l>>3])};default:throw new TypeError(`invalid float width (${o}): ${i}`)}},cf=(i,o,l)=>{o=Be(o),dt(i,{name:o,fromWireType:u=>u,toWireType:(u,p)=>p,argPackAdvance:pt,readValueFromPointer:of(o,l),destructorFunction:null})},lf=(i,o,l,u,p,v,E)=>{var _=Wn(o,l);i=Be(i),p=lt(u,p),Hn(i,function(){rn(`Cannot call ${i} due to unbound types`,_)},o-1),$t([],_,function(F){var D=[F[0],null].concat(F.slice(1));return Ti(i,Xn(i,D,null,p,v,E),o-1),[]})},ff=(i,o,l)=>{switch(o){case 1:return l?u=>k[u>>0]:u=>G[u>>0];case 2:return l?u=>H[u>>1]:u=>K[u>>1];case 4:return l?u=>L[u>>2]:u=>U[u>>2];default:throw new TypeError(`invalid integer width (${o}): ${i}`)}},uf=(i,o,l,u,p)=>{o=Be(o);var v=z=>z;if(u===0){var E=32-8*l;v=z=>z<>>E}var _=o.includes("unsigned"),F=(z,Y)=>{},D;_?D=function(z,Y){return F(Y,this.name),Y>>>0}:D=function(z,Y){return F(Y,this.name),Y},dt(i,{name:o,fromWireType:v,toWireType:D,argPackAdvance:pt,readValueFromPointer:ff(o,l,u!==0),destructorFunction:null})},hf=(i,o,l)=>{var u=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],p=u[o];function v(E){var _=U[E>>2],F=U[E+4>>2];return new p(k.buffer,F,_)}l=Be(l),dt(i,{name:l,fromWireType:v,argPackAdvance:pt,readValueFromPointer:v},{ignoreDuplicateRegistrations:!0})},Jn=(i,o,l,u)=>{if(!(u>0))return 0;for(var p=l,v=l+u-1,E=0;E=55296&&_<=57343){var F=i.charCodeAt(++E);_=65536+((_&1023)<<10)|F&1023}if(_<=127){if(l>=v)break;o[l++]=_}else if(_<=2047){if(l+1>=v)break;o[l++]=192|_>>6,o[l++]=128|_&63}else if(_<=65535){if(l+2>=v)break;o[l++]=224|_>>12,o[l++]=128|_>>6&63,o[l++]=128|_&63}else{if(l+3>=v)break;o[l++]=240|_>>18,o[l++]=128|_>>12&63,o[l++]=128|_>>6&63,o[l++]=128|_&63}}return o[l]=0,l-p},df=(i,o,l)=>Jn(i,G,o,l),Zn=i=>{for(var o=0,l=0;l=55296&&u<=57343?(o+=4,++l):o+=3}return o},Ri=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,or=(i,o,l)=>{for(var u=o+l,p=o;i[p]&&!(p>=u);)++p;if(p-o>16&&i.buffer&&Ri)return Ri.decode(i.subarray(o,p));for(var v="";o>10,56320|D&1023)}}return v},sn=(i,o)=>i?or(G,i,o):"",pf=(i,o)=>{o=Be(o);var l=o==="std::string";dt(i,{name:o,fromWireType:u=>{var p=U[u>>2],v=u+4,E;if(l)for(var _=v,F=0;F<=p;++F){var D=v+F;if(F==p||G[D]==0){var z=D-_,Y=sn(_,z);E===void 0?E=Y:(E+=String.fromCharCode(0),E+=Y),_=D+1}}else{for(var q=new Array(p),F=0;F{p instanceof ArrayBuffer&&(p=new Uint8Array(p));var v,E=typeof p=="string";E||p instanceof Uint8Array||p instanceof Uint8ClampedArray||p instanceof Int8Array||ye("Cannot pass non-string to std::string"),l&&E?v=Zn(p):v=p.length;var _=ss(4+v+1),F=_+4;if(U[_>>2]=v,l&&E)df(p,F,v+1);else if(E)for(var D=0;D255&&(_t(F),ye("String has UTF-16 code units that do not fit in 8 bits")),G[F+D]=z}else for(var D=0;D_t(u)})},bi=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,gf=(i,o)=>{for(var l=i,u=l>>1,p=u+o/2;!(u>=p)&&K[u];)++u;if(l=u<<1,l-i>32&&bi)return bi.decode(G.subarray(i,l));for(var v="",E=0;!(E>=o/2);++E){var _=H[i+E*2>>1];if(_==0)break;v+=String.fromCharCode(_)}return v},mf=(i,o,l)=>{if(l===void 0&&(l=2147483647),l<2)return 0;l-=2;for(var u=o,p=l>1]=E,o+=2}return H[o>>1]=0,o-u},vf=i=>i.length*2,yf=(i,o)=>{for(var l=0,u="";!(l>=o/4);){var p=L[i+l*4>>2];if(p==0)break;if(++l,p>=65536){var v=p-65536;u+=String.fromCharCode(55296|v>>10,56320|v&1023)}else u+=String.fromCharCode(p)}return u},xf=(i,o,l)=>{if(l===void 0&&(l=2147483647),l<4)return 0;for(var u=o,p=u+l-4,v=0;v=55296&&E<=57343){var _=i.charCodeAt(++v);E=65536+((E&1023)<<10)|_&1023}if(L[o>>2]=E,o+=4,o+4>p)break}return L[o>>2]=0,o-u},Tf=i=>{for(var o=0,l=0;l=55296&&u<=57343&&++l,o+=4}return o},Ef=(i,o,l)=>{l=Be(l);var u,p,v,E,_;o===2?(u=gf,p=mf,E=vf,v=()=>K,_=1):o===4&&(u=yf,p=xf,E=Tf,v=()=>U,_=2),dt(i,{name:l,fromWireType:F=>{for(var D=U[F>>2],z=v(),Y,q=F+4,W=0;W<=D;++W){var Z=F+4+W*o;if(W==D||z[Z>>_]==0){var he=Z-q,me=u(q,he);Y===void 0?Y=me:(Y+=String.fromCharCode(0),Y+=me),q=Z+o}}return _t(F),Y},toWireType:(F,D)=>{typeof D!="string"&&ye(`Cannot pass non-string to C++ string type ${l}`);var z=E(D),Y=ss(4+z+o);return U[Y>>2]=z>>_,p(D,Y+4,z+o),F!==null&&F.push(_t,Y),Y},argPackAdvance:pt,readValueFromPointer:Bn,destructorFunction:F=>_t(F)})},wf=(i,o,l,u,p,v)=>{Kr[i]={name:Be(o),rawConstructor:lt(l,u),rawDestructor:lt(p,v),fields:[]}},Mf=(i,o,l,u,p,v,E,_,F,D)=>{Kr[i].fields.push({fieldName:Be(o),getterReturnType:l,getter:lt(u,p),getterContext:v,setterArgumentType:E,setter:lt(_,F),setterContext:D})},_f=(i,o)=>{o=Be(o),dt(i,{isVoid:!0,name:o,argPackAdvance:0,fromWireType:()=>{},toWireType:(l,u)=>{}})},Rf=(i,o,l)=>{i=Pe.toValue(i),o=nn(o,"emval::as");var u=[],p=Pe.toHandle(u);return U[l>>2]=p,o.toWireType(u,i)},bf=i=>{var o=[];return U[i>>2]=Pe.toHandle(o),o},Af={},Qn=i=>{var o=Af[i];return o===void 0?Be(i):o},an=[],If=(i,o,l,u,p)=>(i=an[i],o=Pe.toValue(o),l=Qn(l),i(o,l,bf(u),p)),Sf=(i,o,l,u)=>{i=an[i],o=Pe.toValue(o),l=Qn(l),i(o,l,null,u)},Cf=(i,o)=>(i=Pe.toValue(i),o=Pe.toValue(o),i==o),Nf=i=>{var o=an.length;return an.push(i),o},Of=(i,o)=>{for(var l=new Array(i),u=0;u>2],"parameter "+u);return l},Ai=[],Ff=(i,o)=>{var l=Of(i,o),u=l[0],p=u.name+"_$"+l.slice(1).map(function(Z){return Z.name}).join("_")+"$",v=Ai[p];if(v!==void 0)return v;for(var E=["retType"],_=[u],F="",D=0;D(i=Pe.toValue(i),o=Pe.toValue(o),Pe.toHandle(i[o])),$f=i=>{i>4&&(rt.get(i).refcount+=1)},Pf=i=>Pe.toHandle(Qn(i)),kf=()=>Pe.toHandle({}),Uf=i=>{var o=Pe.toValue(i);jn(o),Yn(i)},Lf=(i,o,l)=>{i=Pe.toValue(i),o=Pe.toValue(o),l=Pe.toValue(l),i[o]=l},jf=(i,o)=>{i=nn(i,"_emval_take_value");var l=i.readValueFromPointer(o);return Pe.toHandle(l)},Bf=()=>{ze("")},zf=(i,o,l)=>G.copyWithin(i,o,o+l),Vf=()=>2147483648,Gf=i=>{var o=P.buffer,l=(i-o.byteLength+65535)/65536;try{return P.grow(l),re(),1}catch{}},Hf=i=>{var o=G.length;i>>>=0;var l=Vf();if(i>l)return!1;for(var u=(F,D)=>F+(D-F%D)%D,p=1;p<=4;p*=2){var v=o*(1+.2/p);v=Math.min(v,i+100663296);var E=Math.min(l,u(Math.max(i,v),65536)),_=Gf(E);if(_)return!0}return!1},es={},qf=()=>f||"./this.program",_r=()=>{if(!_r.strings){var i=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:i,_:qf()};for(var l in es)es[l]===void 0?delete o[l]:o[l]=es[l];var u=[];for(var l in o)u.push(`${l}=${o[l]}`);_r.strings=u}return _r.strings},Wf=(i,o)=>{for(var l=0;l>0]=i.charCodeAt(l);k[o>>0]=0},Ee={isAbs:i=>i.charAt(0)==="/",splitPath:i=>{var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return o.exec(i).slice(1)},normalizeArray:(i,o)=>{for(var l=0,u=i.length-1;u>=0;u--){var p=i[u];p==="."?i.splice(u,1):p===".."?(i.splice(u,1),l++):l&&(i.splice(u,1),l--)}if(o)for(;l;l--)i.unshift("..");return i},normalize:i=>{var o=Ee.isAbs(i),l=i.substr(-1)==="/";return i=Ee.normalizeArray(i.split("/").filter(u=>!!u),!o).join("/"),!i&&!o&&(i="."),i&&l&&(i+="/"),(o?"/":"")+i},dirname:i=>{var o=Ee.splitPath(i),l=o[0],u=o[1];return!l&&!u?".":(u&&(u=u.substr(0,u.length-1)),l+u)},basename:i=>{if(i==="/")return"/";i=Ee.normalize(i),i=i.replace(/\/$/,"");var o=i.lastIndexOf("/");return o===-1?i:i.substr(o+1)},join:function(){var i=Array.prototype.slice.call(arguments);return Ee.normalize(i.join("/"))},join2:(i,o)=>Ee.normalize(i+"/"+o)},Xf=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return u=>crypto.getRandomValues(u);if(g)try{var i=m("crypto"),o=i.randomFillSync;if(o)return u=>i.randomFillSync(u);var l=i.randomBytes;return u=>(u.set(l(u.byteLength)),u)}catch{}ze("initRandomDevice")},Ii=i=>(Ii=Xf())(i),Mt={resolve:function(){for(var i="",o=!1,l=arguments.length-1;l>=-1&&!o;l--){var u=l>=0?arguments[l]:y.cwd();if(typeof u!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!u)return"";i=u+"/"+i,o=Ee.isAbs(u)}return i=Ee.normalizeArray(i.split("/").filter(p=>!!p),!o).join("/"),(o?"/":"")+i||"."},relative:(i,o)=>{i=Mt.resolve(i).substr(1),o=Mt.resolve(o).substr(1);function l(D){for(var z=0;z=0&&D[Y]==="";Y--);return z>Y?[]:D.slice(z,Y-z+1)}for(var u=l(i.split("/")),p=l(o.split("/")),v=Math.min(u.length,p.length),E=v,_=0;_0?l:Zn(i)+1,p=new Array(u),v=Jn(i,p,0,p.length);return o&&(p.length=v),p}var Yf=()=>{if(!ts.length){var i=null;if(g){var o=256,l=Buffer.alloc(o),u=0,p=process.stdin.fd;try{u=C.readSync(p,l)}catch(v){if(v.toString().includes("EOF"))u=0;else throw v}u>0?i=l.slice(0,u).toString("utf-8"):i=null}else typeof window<"u"&&typeof window.prompt=="function"?(i=window.prompt("Input: "),i!==null&&(i+=` +`)):typeof readline=="function"&&(i=readline(),i!==null&&(i+=` +`));if(!i)return null;ts=on(i,!0)}return ts.shift()},Pt={ttys:[],init(){},shutdown(){},register(i,o){Pt.ttys[i]={input:[],output:[],ops:o},y.registerDevice(i,Pt.stream_ops)},stream_ops:{open(i){var o=Pt.ttys[i.node.rdev];if(!o)throw new y.ErrnoError(43);i.tty=o,i.seekable=!1},close(i){i.tty.ops.fsync(i.tty)},fsync(i){i.tty.ops.fsync(i.tty)},read(i,o,l,u,p){if(!i.tty||!i.tty.ops.get_char)throw new y.ErrnoError(60);for(var v=0,E=0;E0&&(R(or(i.output,0)),i.output=[])},ioctl_tcgets(i){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(i,o,l){return 0},ioctl_tiocgwinsz(i){return[24,80]}},default_tty1_ops:{put_char(i,o){o===null||o===10?(b(or(i.output,0)),i.output=[]):o!=0&&i.output.push(o)},fsync(i){i.output&&i.output.length>0&&(b(or(i.output,0)),i.output=[])}}},Si=i=>{ze()},oe={ops_table:null,mount(i){return oe.createNode(null,"/",16895,0)},createNode(i,o,l,u){if(y.isBlkdev(l)||y.isFIFO(l))throw new y.ErrnoError(63);oe.ops_table||(oe.ops_table={dir:{node:{getattr:oe.node_ops.getattr,setattr:oe.node_ops.setattr,lookup:oe.node_ops.lookup,mknod:oe.node_ops.mknod,rename:oe.node_ops.rename,unlink:oe.node_ops.unlink,rmdir:oe.node_ops.rmdir,readdir:oe.node_ops.readdir,symlink:oe.node_ops.symlink},stream:{llseek:oe.stream_ops.llseek}},file:{node:{getattr:oe.node_ops.getattr,setattr:oe.node_ops.setattr},stream:{llseek:oe.stream_ops.llseek,read:oe.stream_ops.read,write:oe.stream_ops.write,allocate:oe.stream_ops.allocate,mmap:oe.stream_ops.mmap,msync:oe.stream_ops.msync}},link:{node:{getattr:oe.node_ops.getattr,setattr:oe.node_ops.setattr,readlink:oe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:oe.node_ops.getattr,setattr:oe.node_ops.setattr},stream:y.chrdev_stream_ops}});var p=y.createNode(i,o,l,u);return y.isDir(p.mode)?(p.node_ops=oe.ops_table.dir.node,p.stream_ops=oe.ops_table.dir.stream,p.contents={}):y.isFile(p.mode)?(p.node_ops=oe.ops_table.file.node,p.stream_ops=oe.ops_table.file.stream,p.usedBytes=0,p.contents=null):y.isLink(p.mode)?(p.node_ops=oe.ops_table.link.node,p.stream_ops=oe.ops_table.link.stream):y.isChrdev(p.mode)&&(p.node_ops=oe.ops_table.chrdev.node,p.stream_ops=oe.ops_table.chrdev.stream),p.timestamp=Date.now(),i&&(i.contents[o]=p,i.timestamp=p.timestamp),p},getFileDataAsTypedArray(i){return i.contents?i.contents.subarray?i.contents.subarray(0,i.usedBytes):new Uint8Array(i.contents):new Uint8Array(0)},expandFileStorage(i,o){var l=i.contents?i.contents.length:0;if(!(l>=o)){var u=1024*1024;o=Math.max(o,l*(l>>0),l!=0&&(o=Math.max(o,256));var p=i.contents;i.contents=new Uint8Array(o),i.usedBytes>0&&i.contents.set(p.subarray(0,i.usedBytes),0)}},resizeFileStorage(i,o){if(i.usedBytes!=o)if(o==0)i.contents=null,i.usedBytes=0;else{var l=i.contents;i.contents=new Uint8Array(o),l&&i.contents.set(l.subarray(0,Math.min(o,i.usedBytes))),i.usedBytes=o}},node_ops:{getattr(i){var o={};return o.dev=y.isChrdev(i.mode)?i.id:1,o.ino=i.id,o.mode=i.mode,o.nlink=1,o.uid=0,o.gid=0,o.rdev=i.rdev,y.isDir(i.mode)?o.size=4096:y.isFile(i.mode)?o.size=i.usedBytes:y.isLink(i.mode)?o.size=i.link.length:o.size=0,o.atime=new Date(i.timestamp),o.mtime=new Date(i.timestamp),o.ctime=new Date(i.timestamp),o.blksize=4096,o.blocks=Math.ceil(o.size/o.blksize),o},setattr(i,o){o.mode!==void 0&&(i.mode=o.mode),o.timestamp!==void 0&&(i.timestamp=o.timestamp),o.size!==void 0&&oe.resizeFileStorage(i,o.size)},lookup(i,o){throw y.genericErrors[44]},mknod(i,o,l,u){return oe.createNode(i,o,l,u)},rename(i,o,l){if(y.isDir(i.mode)){var u;try{u=y.lookupNode(o,l)}catch{}if(u)for(var p in u.contents)throw new y.ErrnoError(55)}delete i.parent.contents[i.name],i.parent.timestamp=Date.now(),i.name=l,o.contents[l]=i,o.timestamp=i.parent.timestamp,i.parent=o},unlink(i,o){delete i.contents[o],i.timestamp=Date.now()},rmdir(i,o){var l=y.lookupNode(i,o);for(var u in l.contents)throw new y.ErrnoError(55);delete i.contents[o],i.timestamp=Date.now()},readdir(i){var o=[".",".."];for(var l in i.contents)i.contents.hasOwnProperty(l)&&o.push(l);return o},symlink(i,o,l){var u=oe.createNode(i,o,41471,0);return u.link=l,u},readlink(i){if(!y.isLink(i.mode))throw new y.ErrnoError(28);return i.link}},stream_ops:{read(i,o,l,u,p){var v=i.node.contents;if(p>=i.node.usedBytes)return 0;var E=Math.min(i.node.usedBytes-p,u);if(E>8&&v.subarray)o.set(v.subarray(p,p+E),l);else for(var _=0;_0||l+o<_.length)&&(_.subarray?_=_.subarray(l,l+o):_=Array.prototype.slice.call(_,l,l+o)),E=!0,v=Si(),!v)throw new y.ErrnoError(48);k.set(_,v)}return{ptr:v,allocated:E}},msync(i,o,l,u,p){return oe.stream_ops.write(i,o,0,u,l,!1),0}}},Kf=(i,o,l,u)=>{var p=u?"":`al ${i}`;A(i,v=>{B(v,`Loading data file "${i}" failed (no arrayBuffer).`),o(new Uint8Array(v)),p&&xt()},v=>{if(l)l();else throw`Loading data file "${i}" failed.`}),p&&He()},Jf=r.preloadPlugins||[],Zf=(i,o,l,u)=>{typeof Browser<"u"&&Browser.init();var p=!1;return Jf.forEach(v=>{p||v.canHandle(o)&&(v.handle(i,o,l,u),p=!0)}),p},Qf=(i,o,l,u,p,v,E,_,F,D)=>{var z=o?Mt.resolve(Ee.join2(i,o)):i;function Y(q){function W(Z){D&&D(),_||y.createDataFile(i,o,Z,u,p,F),v&&v(),xt()}Zf(q,z,W,()=>{E&&E(),xt()})||W(q)}He(),typeof l=="string"?Kf(l,q=>Y(q),E):Y(l)},eu=i=>{var o={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},l=o[i];if(typeof l>"u")throw new Error(`Unknown file open mode: ${i}`);return l},rs=(i,o)=>{var l=0;return i&&(l|=365),o&&(l|=146),l},y={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(i,o={}){if(i=Mt.resolve(i),!i)return{path:"",node:null};var l={follow_mount:!0,recurse_count:0};if(o=Object.assign(l,o),o.recurse_count>8)throw new y.ErrnoError(32);for(var u=i.split("/").filter(Y=>!!Y),p=y.root,v="/",E=0;E40)throw new y.ErrnoError(32)}}return{path:v,node:p}},getPath(i){for(var o;;){if(y.isRoot(i)){var l=i.mount.mountpoint;return o?l[l.length-1]!=="/"?`${l}/${o}`:l+o:l}o=o?`${i.name}/${o}`:i.name,i=i.parent}},hashName(i,o){for(var l=0,u=0;u>>0)%y.nameTable.length},hashAddNode(i){var o=y.hashName(i.parent.id,i.name);i.name_next=y.nameTable[o],y.nameTable[o]=i},hashRemoveNode(i){var o=y.hashName(i.parent.id,i.name);if(y.nameTable[o]===i)y.nameTable[o]=i.name_next;else for(var l=y.nameTable[o];l;){if(l.name_next===i){l.name_next=i.name_next;break}l=l.name_next}},lookupNode(i,o){var l=y.mayLookup(i);if(l)throw new y.ErrnoError(l,i);for(var u=y.hashName(i.id,o),p=y.nameTable[u];p;p=p.name_next){var v=p.name;if(p.parent.id===i.id&&v===o)return p}return y.lookup(i,o)},createNode(i,o,l,u){var p=new y.FSNode(i,o,l,u);return y.hashAddNode(p),p},destroyNode(i){y.hashRemoveNode(i)},isRoot(i){return i===i.parent},isMountpoint(i){return!!i.mounted},isFile(i){return(i&61440)===32768},isDir(i){return(i&61440)===16384},isLink(i){return(i&61440)===40960},isChrdev(i){return(i&61440)===8192},isBlkdev(i){return(i&61440)===24576},isFIFO(i){return(i&61440)===4096},isSocket(i){return(i&49152)===49152},flagsToPermissionString(i){var o=["r","w","rw"][i&3];return i&512&&(o+="w"),o},nodePermissions(i,o){return y.ignorePermissions?0:o.includes("r")&&!(i.mode&292)||o.includes("w")&&!(i.mode&146)||o.includes("x")&&!(i.mode&73)?2:0},mayLookup(i){var o=y.nodePermissions(i,"x");return o||(i.node_ops.lookup?0:2)},mayCreate(i,o){try{var l=y.lookupNode(i,o);return 20}catch{}return y.nodePermissions(i,"wx")},mayDelete(i,o,l){var u;try{u=y.lookupNode(i,o)}catch(v){return v.errno}var p=y.nodePermissions(i,"wx");if(p)return p;if(l){if(!y.isDir(u.mode))return 54;if(y.isRoot(u)||y.getPath(u)===y.cwd())return 10}else if(y.isDir(u.mode))return 31;return 0},mayOpen(i,o){return i?y.isLink(i.mode)?32:y.isDir(i.mode)&&(y.flagsToPermissionString(o)!=="r"||o&512)?31:y.nodePermissions(i,y.flagsToPermissionString(o)):44},MAX_OPEN_FDS:4096,nextfd(){for(var i=0;i<=y.MAX_OPEN_FDS;i++)if(!y.streams[i])return i;throw new y.ErrnoError(33)},getStreamChecked(i){var o=y.getStream(i);if(!o)throw new y.ErrnoError(8);return o},getStream:i=>y.streams[i],createStream(i,o=-1){return y.FSStream||(y.FSStream=function(){this.shared={}},y.FSStream.prototype={},Object.defineProperties(y.FSStream.prototype,{object:{get(){return this.node},set(l){this.node=l}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(l){this.shared.flags=l}},position:{get(){return this.shared.position},set(l){this.shared.position=l}}})),i=Object.assign(new y.FSStream,i),o==-1&&(o=y.nextfd()),i.fd=o,y.streams[o]=i,i},closeStream(i){y.streams[i]=null},chrdev_stream_ops:{open(i){var o=y.getDevice(i.node.rdev);i.stream_ops=o.stream_ops,i.stream_ops.open&&i.stream_ops.open(i)},llseek(){throw new y.ErrnoError(70)}},major:i=>i>>8,minor:i=>i&255,makedev:(i,o)=>i<<8|o,registerDevice(i,o){y.devices[i]={stream_ops:o}},getDevice:i=>y.devices[i],getMounts(i){for(var o=[],l=[i];l.length;){var u=l.pop();o.push(u),l.push.apply(l,u.mounts)}return o},syncfs(i,o){typeof i=="function"&&(o=i,i=!1),y.syncFSRequests++,y.syncFSRequests>1&&b(`warning: ${y.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var l=y.getMounts(y.root.mount),u=0;function p(E){return y.syncFSRequests--,o(E)}function v(E){if(E)return v.errored?void 0:(v.errored=!0,p(E));++u>=l.length&&p(null)}l.forEach(E=>{if(!E.type.syncfs)return v(null);E.type.syncfs(E,i,v)})},mount(i,o,l){var u=l==="/",p=!l,v;if(u&&y.root)throw new y.ErrnoError(10);if(!u&&!p){var E=y.lookupPath(l,{follow_mount:!1});if(l=E.path,v=E.node,y.isMountpoint(v))throw new y.ErrnoError(10);if(!y.isDir(v.mode))throw new y.ErrnoError(54)}var _={type:i,opts:o,mountpoint:l,mounts:[]},F=i.mount(_);return F.mount=_,_.root=F,u?y.root=F:v&&(v.mounted=_,v.mount&&v.mount.mounts.push(_)),F},unmount(i){var o=y.lookupPath(i,{follow_mount:!1});if(!y.isMountpoint(o.node))throw new y.ErrnoError(28);var l=o.node,u=l.mounted,p=y.getMounts(u);Object.keys(y.nameTable).forEach(E=>{for(var _=y.nameTable[E];_;){var F=_.name_next;p.includes(_.mount)&&y.destroyNode(_),_=F}}),l.mounted=null;var v=l.mount.mounts.indexOf(u);l.mount.mounts.splice(v,1)},lookup(i,o){return i.node_ops.lookup(i,o)},mknod(i,o,l){var u=y.lookupPath(i,{parent:!0}),p=u.node,v=Ee.basename(i);if(!v||v==="."||v==="..")throw new y.ErrnoError(28);var E=y.mayCreate(p,v);if(E)throw new y.ErrnoError(E);if(!p.node_ops.mknod)throw new y.ErrnoError(63);return p.node_ops.mknod(p,v,o,l)},create(i,o){return o=o!==void 0?o:438,o&=4095,o|=32768,y.mknod(i,o,0)},mkdir(i,o){return o=o!==void 0?o:511,o&=1023,o|=16384,y.mknod(i,o,0)},mkdirTree(i,o){for(var l=i.split("/"),u="",p=0;p"u"&&(l=o,o=438),o|=8192,y.mknod(i,o,l)},symlink(i,o){if(!Mt.resolve(i))throw new y.ErrnoError(44);var l=y.lookupPath(o,{parent:!0}),u=l.node;if(!u)throw new y.ErrnoError(44);var p=Ee.basename(o),v=y.mayCreate(u,p);if(v)throw new y.ErrnoError(v);if(!u.node_ops.symlink)throw new y.ErrnoError(63);return u.node_ops.symlink(u,p,i)},rename(i,o){var l=Ee.dirname(i),u=Ee.dirname(o),p=Ee.basename(i),v=Ee.basename(o),E,_,F;if(E=y.lookupPath(i,{parent:!0}),_=E.node,E=y.lookupPath(o,{parent:!0}),F=E.node,!_||!F)throw new y.ErrnoError(44);if(_.mount!==F.mount)throw new y.ErrnoError(75);var D=y.lookupNode(_,p),z=Mt.relative(i,u);if(z.charAt(0)!==".")throw new y.ErrnoError(28);if(z=Mt.relative(o,l),z.charAt(0)!==".")throw new y.ErrnoError(55);var Y;try{Y=y.lookupNode(F,v)}catch{}if(D!==Y){var q=y.isDir(D.mode),W=y.mayDelete(_,p,q);if(W)throw new y.ErrnoError(W);if(W=Y?y.mayDelete(F,v,q):y.mayCreate(F,v),W)throw new y.ErrnoError(W);if(!_.node_ops.rename)throw new y.ErrnoError(63);if(y.isMountpoint(D)||Y&&y.isMountpoint(Y))throw new y.ErrnoError(10);if(F!==_&&(W=y.nodePermissions(_,"w"),W))throw new y.ErrnoError(W);y.hashRemoveNode(D);try{_.node_ops.rename(D,F,v)}catch(Z){throw Z}finally{y.hashAddNode(D)}}},rmdir(i){var o=y.lookupPath(i,{parent:!0}),l=o.node,u=Ee.basename(i),p=y.lookupNode(l,u),v=y.mayDelete(l,u,!0);if(v)throw new y.ErrnoError(v);if(!l.node_ops.rmdir)throw new y.ErrnoError(63);if(y.isMountpoint(p))throw new y.ErrnoError(10);l.node_ops.rmdir(l,u),y.destroyNode(p)},readdir(i){var o=y.lookupPath(i,{follow:!0}),l=o.node;if(!l.node_ops.readdir)throw new y.ErrnoError(54);return l.node_ops.readdir(l)},unlink(i){var o=y.lookupPath(i,{parent:!0}),l=o.node;if(!l)throw new y.ErrnoError(44);var u=Ee.basename(i),p=y.lookupNode(l,u),v=y.mayDelete(l,u,!1);if(v)throw new y.ErrnoError(v);if(!l.node_ops.unlink)throw new y.ErrnoError(63);if(y.isMountpoint(p))throw new y.ErrnoError(10);l.node_ops.unlink(l,u),y.destroyNode(p)},readlink(i){var o=y.lookupPath(i),l=o.node;if(!l)throw new y.ErrnoError(44);if(!l.node_ops.readlink)throw new y.ErrnoError(28);return Mt.resolve(y.getPath(l.parent),l.node_ops.readlink(l))},stat(i,o){var l=y.lookupPath(i,{follow:!o}),u=l.node;if(!u)throw new y.ErrnoError(44);if(!u.node_ops.getattr)throw new y.ErrnoError(63);return u.node_ops.getattr(u)},lstat(i){return y.stat(i,!0)},chmod(i,o,l){var u;if(typeof i=="string"){var p=y.lookupPath(i,{follow:!l});u=p.node}else u=i;if(!u.node_ops.setattr)throw new y.ErrnoError(63);u.node_ops.setattr(u,{mode:o&4095|u.mode&-4096,timestamp:Date.now()})},lchmod(i,o){y.chmod(i,o,!0)},fchmod(i,o){var l=y.getStreamChecked(i);y.chmod(l.node,o)},chown(i,o,l,u){var p;if(typeof i=="string"){var v=y.lookupPath(i,{follow:!u});p=v.node}else p=i;if(!p.node_ops.setattr)throw new y.ErrnoError(63);p.node_ops.setattr(p,{timestamp:Date.now()})},lchown(i,o,l){y.chown(i,o,l,!0)},fchown(i,o,l){var u=y.getStreamChecked(i);y.chown(u.node,o,l)},truncate(i,o){if(o<0)throw new y.ErrnoError(28);var l;if(typeof i=="string"){var u=y.lookupPath(i,{follow:!0});l=u.node}else l=i;if(!l.node_ops.setattr)throw new y.ErrnoError(63);if(y.isDir(l.mode))throw new y.ErrnoError(31);if(!y.isFile(l.mode))throw new y.ErrnoError(28);var p=y.nodePermissions(l,"w");if(p)throw new y.ErrnoError(p);l.node_ops.setattr(l,{size:o,timestamp:Date.now()})},ftruncate(i,o){var l=y.getStreamChecked(i);if(!(l.flags&2097155))throw new y.ErrnoError(28);y.truncate(l.node,o)},utime(i,o,l){var u=y.lookupPath(i,{follow:!0}),p=u.node;p.node_ops.setattr(p,{timestamp:Math.max(o,l)})},open(i,o,l){if(i==="")throw new y.ErrnoError(44);o=typeof o=="string"?eu(o):o,l=typeof l>"u"?438:l,o&64?l=l&4095|32768:l=0;var u;if(typeof i=="object")u=i;else{i=Ee.normalize(i);try{var p=y.lookupPath(i,{follow:!(o&131072)});u=p.node}catch{}}var v=!1;if(o&64)if(u){if(o&128)throw new y.ErrnoError(20)}else u=y.mknod(i,l,0),v=!0;if(!u)throw new y.ErrnoError(44);if(y.isChrdev(u.mode)&&(o&=-513),o&65536&&!y.isDir(u.mode))throw new y.ErrnoError(54);if(!v){var E=y.mayOpen(u,o);if(E)throw new y.ErrnoError(E)}o&512&&!v&&y.truncate(u,0),o&=-131713;var _=y.createStream({node:u,path:y.getPath(u),flags:o,seekable:!0,position:0,stream_ops:u.stream_ops,ungotten:[],error:!1});return _.stream_ops.open&&_.stream_ops.open(_),r.logReadFiles&&!(o&1)&&(y.readFiles||(y.readFiles={}),i in y.readFiles||(y.readFiles[i]=1)),_},close(i){if(y.isClosed(i))throw new y.ErrnoError(8);i.getdents&&(i.getdents=null);try{i.stream_ops.close&&i.stream_ops.close(i)}catch(o){throw o}finally{y.closeStream(i.fd)}i.fd=null},isClosed(i){return i.fd===null},llseek(i,o,l){if(y.isClosed(i))throw new y.ErrnoError(8);if(!i.seekable||!i.stream_ops.llseek)throw new y.ErrnoError(70);if(l!=0&&l!=1&&l!=2)throw new y.ErrnoError(28);return i.position=i.stream_ops.llseek(i,o,l),i.ungotten=[],i.position},read(i,o,l,u,p){if(u<0||p<0)throw new y.ErrnoError(28);if(y.isClosed(i))throw new y.ErrnoError(8);if((i.flags&2097155)===1)throw new y.ErrnoError(8);if(y.isDir(i.node.mode))throw new y.ErrnoError(31);if(!i.stream_ops.read)throw new y.ErrnoError(28);var v=typeof p<"u";if(!v)p=i.position;else if(!i.seekable)throw new y.ErrnoError(70);var E=i.stream_ops.read(i,o,l,u,p);return v||(i.position+=E),E},write(i,o,l,u,p,v){if(u<0||p<0)throw new y.ErrnoError(28);if(y.isClosed(i))throw new y.ErrnoError(8);if(!(i.flags&2097155))throw new y.ErrnoError(8);if(y.isDir(i.node.mode))throw new y.ErrnoError(31);if(!i.stream_ops.write)throw new y.ErrnoError(28);i.seekable&&i.flags&1024&&y.llseek(i,0,2);var E=typeof p<"u";if(!E)p=i.position;else if(!i.seekable)throw new y.ErrnoError(70);var _=i.stream_ops.write(i,o,l,u,p,v);return E||(i.position+=_),_},allocate(i,o,l){if(y.isClosed(i))throw new y.ErrnoError(8);if(o<0||l<=0)throw new y.ErrnoError(28);if(!(i.flags&2097155))throw new y.ErrnoError(8);if(!y.isFile(i.node.mode)&&!y.isDir(i.node.mode))throw new y.ErrnoError(43);if(!i.stream_ops.allocate)throw new y.ErrnoError(138);i.stream_ops.allocate(i,o,l)},mmap(i,o,l,u,p){if(u&2&&!(p&2)&&(i.flags&2097155)!==2)throw new y.ErrnoError(2);if((i.flags&2097155)===1)throw new y.ErrnoError(2);if(!i.stream_ops.mmap)throw new y.ErrnoError(43);return i.stream_ops.mmap(i,o,l,u,p)},msync(i,o,l,u,p){return i.stream_ops.msync?i.stream_ops.msync(i,o,l,u,p):0},munmap:i=>0,ioctl(i,o,l){if(!i.stream_ops.ioctl)throw new y.ErrnoError(59);return i.stream_ops.ioctl(i,o,l)},readFile(i,o={}){if(o.flags=o.flags||0,o.encoding=o.encoding||"binary",o.encoding!=="utf8"&&o.encoding!=="binary")throw new Error(`Invalid encoding type "${o.encoding}"`);var l,u=y.open(i,o.flags),p=y.stat(i),v=p.size,E=new Uint8Array(v);return y.read(u,E,0,v,0),o.encoding==="utf8"?l=or(E,0):o.encoding==="binary"&&(l=E),y.close(u),l},writeFile(i,o,l={}){l.flags=l.flags||577;var u=y.open(i,l.flags,l.mode);if(typeof o=="string"){var p=new Uint8Array(Zn(o)+1),v=Jn(o,p,0,p.length);y.write(u,p,0,v,void 0,l.canOwn)}else if(ArrayBuffer.isView(o))y.write(u,o,0,o.byteLength,void 0,l.canOwn);else throw new Error("Unsupported data type");y.close(u)},cwd:()=>y.currentPath,chdir(i){var o=y.lookupPath(i,{follow:!0});if(o.node===null)throw new y.ErrnoError(44);if(!y.isDir(o.node.mode))throw new y.ErrnoError(54);var l=y.nodePermissions(o.node,"x");if(l)throw new y.ErrnoError(l);y.currentPath=o.path},createDefaultDirectories(){y.mkdir("/tmp"),y.mkdir("/home"),y.mkdir("/home/web_user")},createDefaultDevices(){y.mkdir("/dev"),y.registerDevice(y.makedev(1,3),{read:()=>0,write:(u,p,v,E,_)=>E}),y.mkdev("/dev/null",y.makedev(1,3)),Pt.register(y.makedev(5,0),Pt.default_tty_ops),Pt.register(y.makedev(6,0),Pt.default_tty1_ops),y.mkdev("/dev/tty",y.makedev(5,0)),y.mkdev("/dev/tty1",y.makedev(6,0));var i=new Uint8Array(1024),o=0,l=()=>(o===0&&(o=Ii(i).byteLength),i[--o]);y.createDevice("/dev","random",l),y.createDevice("/dev","urandom",l),y.mkdir("/dev/shm"),y.mkdir("/dev/shm/tmp")},createSpecialDirectories(){y.mkdir("/proc");var i=y.mkdir("/proc/self");y.mkdir("/proc/self/fd"),y.mount({mount(){var o=y.createNode(i,"fd",16895,73);return o.node_ops={lookup(l,u){var p=+u,v=y.getStreamChecked(p),E={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>v.path}};return E.parent=E,E}},o}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?y.createDevice("/dev","stdin",r.stdin):y.symlink("/dev/tty","/dev/stdin"),r.stdout?y.createDevice("/dev","stdout",null,r.stdout):y.symlink("/dev/tty","/dev/stdout"),r.stderr?y.createDevice("/dev","stderr",null,r.stderr):y.symlink("/dev/tty1","/dev/stderr"),y.open("/dev/stdin",0),y.open("/dev/stdout",1),y.open("/dev/stderr",1)},ensureErrnoError(){y.ErrnoError||(y.ErrnoError=function(o,l){this.name="ErrnoError",this.node=l,this.setErrno=function(u){this.errno=u},this.setErrno(o),this.message="FS error"},y.ErrnoError.prototype=new Error,y.ErrnoError.prototype.constructor=y.ErrnoError,[44].forEach(i=>{y.genericErrors[i]=new y.ErrnoError(i),y.genericErrors[i].stack=""}))},staticInit(){y.ensureErrnoError(),y.nameTable=new Array(4096),y.mount(oe,{},"/"),y.createDefaultDirectories(),y.createDefaultDevices(),y.createSpecialDirectories(),y.filesystems={MEMFS:oe}},init(i,o,l){y.init.initialized=!0,y.ensureErrnoError(),r.stdin=i||r.stdin,r.stdout=o||r.stdout,r.stderr=l||r.stderr,y.createStandardStreams()},quit(){y.init.initialized=!1;for(var i=0;ithis.length-1||W<0)){var Z=W%this.chunkSize,he=W/this.chunkSize|0;return this.getter(he)[Z]}},v.prototype.setDataGetter=function(W){this.getter=W},v.prototype.cacheLength=function(){var W=new XMLHttpRequest;if(W.open("HEAD",l,!1),W.send(null),!(W.status>=200&&W.status<300||W.status===304))throw new Error("Couldn't load "+l+". Status: "+W.status);var Z=Number(W.getResponseHeader("Content-length")),he,me=(he=W.getResponseHeader("Accept-Ranges"))&&he==="bytes",S=(he=W.getResponseHeader("Content-Encoding"))&&he==="gzip",I=1024*1024;me||(I=Z);var $=(J,pe)=>{if(J>pe)throw new Error("invalid range ("+J+", "+pe+") or no bytes requested!");if(pe>Z-1)throw new Error("only "+Z+" bytes available! programmer error!");var ue=new XMLHttpRequest;if(ue.open("GET",l,!1),Z!==I&&ue.setRequestHeader("Range","bytes="+J+"-"+pe),ue.responseType="arraybuffer",ue.overrideMimeType&&ue.overrideMimeType("text/plain; charset=x-user-defined"),ue.send(null),!(ue.status>=200&&ue.status<300||ue.status===304))throw new Error("Couldn't load "+l+". Status: "+ue.status);return ue.response!==void 0?new Uint8Array(ue.response||[]):on(ue.responseText||"",!0)},j=this;j.setDataGetter(J=>{var pe=J*I,ue=(J+1)*I-1;if(ue=Math.min(ue,Z-1),typeof j.chunks[J]>"u"&&(j.chunks[J]=$(pe,ue)),typeof j.chunks[J]>"u")throw new Error("doXHR failed!");return j.chunks[J]}),(S||!Z)&&(I=Z=1,Z=this.getter(0).length,I=Z,R("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=Z,this._chunkSize=I,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!d)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var E=new v;Object.defineProperties(E,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var _={isDevice:!1,contents:E}}else var _={isDevice:!1,url:l};var F=y.createFile(i,o,_,u,p);_.contents?F.contents=_.contents:_.url&&(F.contents=null,F.url=_.url),Object.defineProperties(F,{usedBytes:{get:function(){return this.contents.length}}});var D={},z=Object.keys(F.stream_ops);z.forEach(q=>{var W=F.stream_ops[q];D[q]=function(){return y.forceLoadFile(F),W.apply(null,arguments)}});function Y(q,W,Z,he,me){var S=q.node.contents;if(me>=S.length)return 0;var I=Math.min(S.length-me,he);if(S.slice)for(var $=0;$(y.forceLoadFile(F),Y(q,W,Z,he,me)),D.mmap=(q,W,Z,he,me)=>{y.forceLoadFile(F);var S=Si();if(!S)throw new y.ErrnoError(48);return Y(q,k,S,W,Z),{ptr:S,allocated:!0}},F.stream_ops=D,F}},Ct={DEFAULT_POLLMASK:5,calculateAt(i,o,l){if(Ee.isAbs(o))return o;var u;if(i===-100)u=y.cwd();else{var p=Ct.getStreamFromFD(i);u=p.path}if(o.length==0){if(!l)throw new y.ErrnoError(44);return u}return Ee.join2(u,o)},doStat(i,o,l){try{var u=i(o)}catch(_){if(_&&_.node&&Ee.normalize(o)!==Ee.normalize(y.getPath(_.node)))return-54;throw _}L[l>>2]=u.dev,L[l+4>>2]=u.mode,U[l+8>>2]=u.nlink,L[l+12>>2]=u.uid,L[l+16>>2]=u.gid,L[l+20>>2]=u.rdev,je=[u.size>>>0,(de=u.size,+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[l+24>>2]=je[0],L[l+28>>2]=je[1],L[l+32>>2]=4096,L[l+36>>2]=u.blocks;var p=u.atime.getTime(),v=u.mtime.getTime(),E=u.ctime.getTime();return je=[Math.floor(p/1e3)>>>0,(de=Math.floor(p/1e3),+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[l+40>>2]=je[0],L[l+44>>2]=je[1],U[l+48>>2]=p%1e3*1e3,je=[Math.floor(v/1e3)>>>0,(de=Math.floor(v/1e3),+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[l+56>>2]=je[0],L[l+60>>2]=je[1],U[l+64>>2]=v%1e3*1e3,je=[Math.floor(E/1e3)>>>0,(de=Math.floor(E/1e3),+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[l+72>>2]=je[0],L[l+76>>2]=je[1],U[l+80>>2]=E%1e3*1e3,je=[u.ino>>>0,(de=u.ino,+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[l+88>>2]=je[0],L[l+92>>2]=je[1],0},doMsync(i,o,l,u,p){if(!y.isFile(o.node.mode))throw new y.ErrnoError(43);if(u&2)return 0;var v=G.slice(i,i+l);y.msync(o,v,p,l,u)},varargs:void 0,get(){var i=L[Ct.varargs>>2];return Ct.varargs+=4,i},getp(){return Ct.get()},getStr(i){var o=sn(i);return o},getStreamFromFD(i){var o=y.getStreamChecked(i);return o}},tu=(i,o)=>{var l=0;return _r().forEach((u,p)=>{var v=o+l;U[i+p*4>>2]=v,Wf(u,v),l+=u.length+1}),0},ru=(i,o)=>{var l=_r();U[i>>2]=l.length;var u=0;return l.forEach(p=>u+=p.length+1),U[o>>2]=u,0};function nu(i){try{var o=Ct.getStreamFromFD(i);return y.close(o),0}catch(l){if(typeof y>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var su=(i,o,l,u)=>{for(var p=0,v=0;v>2],_=U[o+4>>2];o+=8;var F=y.read(i,k,E,_,u);if(F<0)return-1;if(p+=F,F<_)break;typeof u<"u"&&(u+=F)}return p};function iu(i,o,l,u){try{var p=Ct.getStreamFromFD(i),v=su(p,o,l);return U[u>>2]=v,0}catch(E){if(typeof y>"u"||E.name!=="ErrnoError")throw E;return E.errno}}var au=(i,o)=>o+2097152>>>0<4194305-!!i?(i>>>0)+o*4294967296:NaN;function ou(i,o,l,u,p){var v=au(o,l);try{if(isNaN(v))return 61;var E=Ct.getStreamFromFD(i);return y.llseek(E,v,u),je=[E.position>>>0,(de=E.position,+Math.abs(de)>=1?de>0?+Math.floor(de/4294967296)>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[p>>2]=je[0],L[p+4>>2]=je[1],E.getdents&&v===0&&u===0&&(E.getdents=null),0}catch(_){if(typeof y>"u"||_.name!=="ErrnoError")throw _;return _.errno}}var cu=(i,o,l,u)=>{for(var p=0,v=0;v>2],_=U[o+4>>2];o+=8;var F=y.write(i,k,E,_,u);if(F<0)return-1;p+=F,typeof u<"u"&&(u+=F)}return p};function lu(i,o,l,u){try{var p=Ct.getStreamFromFD(i),v=cu(p,o,l);return U[u>>2]=v,0}catch(E){if(typeof y>"u"||E.name!=="ErrnoError")throw E;return E.errno}}var fu=i=>i,cn=i=>i%4===0&&(i%100!==0||i%400===0),uu=(i,o)=>{for(var l=0,u=0;u<=o;l+=i[u++]);return l},Ci=[31,29,31,30,31,30,31,31,30,31,30,31],Ni=[31,28,31,30,31,30,31,31,30,31,30,31],hu=(i,o)=>{for(var l=new Date(i.getTime());o>0;){var u=cn(l.getFullYear()),p=l.getMonth(),v=(u?Ci:Ni)[p];if(o>v-l.getDate())o-=v-l.getDate()+1,l.setDate(1),p<11?l.setMonth(p+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else return l.setDate(l.getDate()+o),l}return l},du=(i,o)=>{k.set(i,o)},pu=(i,o,l,u)=>{var p=U[u+40>>2],v={tm_sec:L[u>>2],tm_min:L[u+4>>2],tm_hour:L[u+8>>2],tm_mday:L[u+12>>2],tm_mon:L[u+16>>2],tm_year:L[u+20>>2],tm_wday:L[u+24>>2],tm_yday:L[u+28>>2],tm_isdst:L[u+32>>2],tm_gmtoff:L[u+36>>2],tm_zone:p?sn(p):""},E=sn(l),_={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var F in _)E=E.replace(new RegExp(F,"g"),_[F]);var D=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],z=["January","February","March","April","May","June","July","August","September","October","November","December"];function Y(I,$,j){for(var J=typeof I=="number"?I.toString():I||"";J.length<$;)J=j[0]+J;return J}function q(I,$){return Y(I,$,"0")}function W(I,$){function j(pe){return pe<0?-1:pe>0?1:0}var J;return(J=j(I.getFullYear()-$.getFullYear()))===0&&(J=j(I.getMonth()-$.getMonth()))===0&&(J=j(I.getDate()-$.getDate())),J}function Z(I){switch(I.getDay()){case 0:return new Date(I.getFullYear()-1,11,29);case 1:return I;case 2:return new Date(I.getFullYear(),0,3);case 3:return new Date(I.getFullYear(),0,2);case 4:return new Date(I.getFullYear(),0,1);case 5:return new Date(I.getFullYear()-1,11,31);case 6:return new Date(I.getFullYear()-1,11,30)}}function he(I){var $=hu(new Date(I.tm_year+1900,0,1),I.tm_yday),j=new Date($.getFullYear(),0,4),J=new Date($.getFullYear()+1,0,4),pe=Z(j),ue=Z(J);return W(pe,$)<=0?W(ue,$)<=0?$.getFullYear()+1:$.getFullYear():$.getFullYear()-1}var me={"%a":I=>D[I.tm_wday].substring(0,3),"%A":I=>D[I.tm_wday],"%b":I=>z[I.tm_mon].substring(0,3),"%B":I=>z[I.tm_mon],"%C":I=>{var $=I.tm_year+1900;return q($/100|0,2)},"%d":I=>q(I.tm_mday,2),"%e":I=>Y(I.tm_mday,2," "),"%g":I=>he(I).toString().substring(2),"%G":I=>he(I),"%H":I=>q(I.tm_hour,2),"%I":I=>{var $=I.tm_hour;return $==0?$=12:$>12&&($-=12),q($,2)},"%j":I=>q(I.tm_mday+uu(cn(I.tm_year+1900)?Ci:Ni,I.tm_mon-1),3),"%m":I=>q(I.tm_mon+1,2),"%M":I=>q(I.tm_min,2),"%n":()=>` +`,"%p":I=>I.tm_hour>=0&&I.tm_hour<12?"AM":"PM","%S":I=>q(I.tm_sec,2),"%t":()=>" ","%u":I=>I.tm_wday||7,"%U":I=>{var $=I.tm_yday+7-I.tm_wday;return q(Math.floor($/7),2)},"%V":I=>{var $=Math.floor((I.tm_yday+7-(I.tm_wday+6)%7)/7);if((I.tm_wday+371-I.tm_yday-2)%7<=2&&$++,$){if($==53){var J=(I.tm_wday+371-I.tm_yday)%7;J!=4&&(J!=3||!cn(I.tm_year))&&($=1)}}else{$=52;var j=(I.tm_wday+7-I.tm_yday-1)%7;(j==4||j==5&&cn(I.tm_year%400-1))&&$++}return q($,2)},"%w":I=>I.tm_wday,"%W":I=>{var $=I.tm_yday+7-(I.tm_wday+6)%7;return q(Math.floor($/7),2)},"%y":I=>(I.tm_year+1900).toString().substring(2),"%Y":I=>I.tm_year+1900,"%z":I=>{var $=I.tm_gmtoff,j=$>=0;return $=Math.abs($)/60,$=$/60*100+$%60,(j?"+":"-")+("0000"+$).slice(-4)},"%Z":I=>I.tm_zone,"%%":()=>"%"};E=E.replace(/%%/g,"\0\0");for(var F in me)E.includes(F)&&(E=E.replace(new RegExp(F,"g"),me[F](v)));E=E.replace(/\0\0/g,"%");var S=on(E,!1);return S.length>o?0:(du(S,i),S.length-1)},gu=(i,o,l,u,p)=>pu(i,o,l,u),Oi=(i,o)=>{i<128?o.push(i):o.push(i%128|128,i>>7)},mu=i=>{for(var o={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},l={parameters:[],results:i[0]=="v"?[]:[o[i[0]]]},u=1;u{var l=i.slice(0,1),u=i.slice(1),p={i:127,p:127,j:126,f:125,d:124};o.push(96),Oi(u.length,o);for(var v=0;v{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(mu(o),i);var l=[1];vu(o,l);var u=[0,97,115,109,1,0,0,0,1];Oi(l.length,u),u.push.apply(u,l),u.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var p=new WebAssembly.Module(new Uint8Array(u)),v=new WebAssembly.Instance(p,{e:{f:i}}),E=v.exports.f;return E},xu=(i,o)=>{if(kt)for(var l=i;l(kt||(kt=new WeakMap,xu(0,ge.length)),kt.get(i)||0),ns=[],Eu=()=>{if(ns.length)return ns.pop();try{ge.grow(1)}catch(i){throw i instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":i}return ge.length-1},Fi=(i,o)=>{ge.set(i,o),Mr[i]=ge.get(i)},Rr=(i,o)=>{var l=Tu(i);if(l)return l;var u=Eu();try{Fi(u,i)}catch(v){if(!(v instanceof TypeError))throw v;var p=yu(i,o);Fi(u,p)}return kt.set(i,u),u},br=i=>{kt.delete(ce(i)),ns.push(i)};hi=r.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},yl(),ar=r.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},$l(),Al(),Hl(),Ei=r.UnboundTypeError=Yl(Error,"UnboundTypeError"),Ql(),tf();var Di=function(i,o,l,u){i||(i=this),this.parent=i,this.mount=i.mount,this.mounted=null,this.id=y.nextInode++,this.name=o,this.mode=l,this.node_ops={},this.stream_ops={},this.rdev=u},ln=365,fn=146;Object.defineProperties(Di.prototype,{read:{get:function(){return(this.mode&ln)===ln},set:function(i){i?this.mode|=ln:this.mode&=~ln}},write:{get:function(){return(this.mode&fn)===fn},set:function(i){i?this.mode|=fn:this.mode&=~fn}},isFolder:{get:function(){return y.isDir(this.mode)}},isDevice:{get:function(){return y.isChrdev(this.mode)}}}),y.FSNode=Di,y.createPreloadedFile=Qf,y.staticInit();var wu={B:cl,K:ll,a:ul,j:hl,S:dl,h:pl,na:gl,d:fl,Ca:ml,ca:vl,sa:Tl,x:Kl,w:Jl,i:Zl,ra:rf,O:sf,t:af,U:cf,o:lf,z:uf,s:hf,T:pf,M:Ef,E:wf,Da:Mf,ta:_f,Ia:Rf,ya:If,Fa:Sf,Ka:Yn,Ha:Cf,Aa:Ff,Ja:Df,Ga:$f,F:Pf,$:kf,oa:Uf,La:Lf,y:jf,L:Bf,qa:zf,pa:Hf,ja:tu,ka:ru,la:nu,ma:iu,ba:ou,R:lu,H:Iu,A:Ru,W:Yu,P:rh,r:Hu,c:Au,b:_u,n:Ou,l:Nu,N:Uu,D:eh,Q:th,J:nh,aa:fh,k:Pu,f:bu,va:Qu,g:Su,G:Zu,V:Ku,wa:Ju,u:ku,za:qu,Ba:$u,e:Mu,X:Xu,Ea:Fu,m:Cu,q:ju,xa:Wu,_:Bu,C:Lu,v:Vu,Y:Gu,p:Du,I:sh,Z:zu,ga:ah,da:lh,ha:ih,ea:ch,fa:oh,ua:fu,ia:gu},_e=ol(),_t=i=>(_t=_e.Pa)(i),ss=i=>(ss=_e.Qa)(i),$i=i=>($i=_e.Ra)(i);r.__embind_initialize_bindings=()=>(r.__embind_initialize_bindings=_e.Sa)();var ne=(i,o)=>(ne=_e.Ta)(i,o),Ar=i=>(Ar=_e.Ua)(i),se=()=>(se=_e.Va)(),ie=i=>(ie=_e.Wa)(i),Pi=i=>(Pi=_e.Xa)(i),ki=i=>(ki=_e.Ya)(i),Ui=(i,o,l)=>(Ui=_e.Za)(i,o,l),Li=i=>(Li=_e._a)(i),ji=r.dynCall_viijii=(i,o,l,u,p,v,E)=>(ji=r.dynCall_viijii=_e.$a)(i,o,l,u,p,v,E),Bi=r.dynCall_viiij=(i,o,l,u,p,v)=>(Bi=r.dynCall_viiij=_e.ab)(i,o,l,u,p,v),zi=r.dynCall_vijiii=(i,o,l,u,p,v,E)=>(zi=r.dynCall_vijiii=_e.bb)(i,o,l,u,p,v,E),Vi=r.dynCall_vijii=(i,o,l,u,p,v)=>(Vi=r.dynCall_vijii=_e.cb)(i,o,l,u,p,v),Gi=r.dynCall_viiji=(i,o,l,u,p,v)=>(Gi=r.dynCall_viiji=_e.db)(i,o,l,u,p,v);r.dynCall_jiji=(i,o,l,u,p)=>(r.dynCall_jiji=_e.eb)(i,o,l,u,p);var Hi=r.dynCall_jiiii=(i,o,l,u,p)=>(Hi=r.dynCall_jiiii=_e.fb)(i,o,l,u,p);r.dynCall_iiiiij=(i,o,l,u,p,v,E)=>(r.dynCall_iiiiij=_e.gb)(i,o,l,u,p,v,E),r.dynCall_iiiiijj=(i,o,l,u,p,v,E,_,F)=>(r.dynCall_iiiiijj=_e.hb)(i,o,l,u,p,v,E,_,F),r.dynCall_iiiiiijj=(i,o,l,u,p,v,E,_,F,D)=>(r.dynCall_iiiiiijj=_e.ib)(i,o,l,u,p,v,E,_,F,D);function Mu(i,o,l,u){var p=se();try{ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function _u(i,o,l){var u=se();try{return ce(i)(o,l)}catch(p){if(ie(u),p!==p+0)throw p;ne(1,0)}}function Ru(i,o,l,u,p,v){var E=se();try{return ce(i)(o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function bu(i,o){var l=se();try{ce(i)(o)}catch(u){if(ie(l),u!==u+0)throw u;ne(1,0)}}function Au(i,o){var l=se();try{return ce(i)(o)}catch(u){if(ie(l),u!==u+0)throw u;ne(1,0)}}function Iu(i,o,l,u){var p=se();try{return ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function Su(i,o,l){var u=se();try{ce(i)(o,l)}catch(p){if(ie(u),p!==p+0)throw p;ne(1,0)}}function Cu(i,o,l,u,p){var v=se();try{ce(i)(o,l,u,p)}catch(E){if(ie(v),E!==E+0)throw E;ne(1,0)}}function Nu(i,o,l,u,p){var v=se();try{return ce(i)(o,l,u,p)}catch(E){if(ie(v),E!==E+0)throw E;ne(1,0)}}function Ou(i,o,l,u){var p=se();try{return ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function Fu(i,o,l,u,p,v,E){var _=se();try{ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function Du(i,o,l,u,p,v,E,_,F,D,z){var Y=se();try{ce(i)(o,l,u,p,v,E,_,F,D,z)}catch(q){if(ie(Y),q!==q+0)throw q;ne(1,0)}}function $u(i,o,l,u,p,v,E){var _=se();try{ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function Pu(i){var o=se();try{ce(i)()}catch(l){if(ie(o),l!==l+0)throw l;ne(1,0)}}function ku(i,o,l,u){var p=se();try{ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function Uu(i,o,l,u,p,v){var E=se();try{return ce(i)(o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function Lu(i,o,l,u,p,v,E){var _=se();try{ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function ju(i,o,l,u,p,v){var E=se();try{ce(i)(o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function Bu(i,o,l,u,p,v,E){var _=se();try{ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function zu(i,o,l,u,p,v,E,_,F,D,z,Y,q,W,Z,he,me,S,I){var $=se();try{ce(i)(o,l,u,p,v,E,_,F,D,z,Y,q,W,Z,he,me,S,I)}catch(j){if(ie($),j!==j+0)throw j;ne(1,0)}}function Vu(i,o,l,u,p,v,E,_){var F=se();try{ce(i)(o,l,u,p,v,E,_)}catch(D){if(ie(F),D!==D+0)throw D;ne(1,0)}}function Gu(i,o,l,u,p,v,E,_,F,D){var z=se();try{ce(i)(o,l,u,p,v,E,_,F,D)}catch(Y){if(ie(z),Y!==Y+0)throw Y;ne(1,0)}}function Hu(i){var o=se();try{return ce(i)()}catch(l){if(ie(o),l!==l+0)throw l;ne(1,0)}}function qu(i,o,l,u,p,v){var E=se();try{ce(i)(o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function Wu(i,o,l,u,p,v,E){var _=se();try{ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function Xu(i,o,l,u,p){var v=se();try{ce(i)(o,l,u,p)}catch(E){if(ie(v),E!==E+0)throw E;ne(1,0)}}function Yu(i,o,l){var u=se();try{return ce(i)(o,l)}catch(p){if(ie(u),p!==p+0)throw p;ne(1,0)}}function Ku(i,o,l,u,p){var v=se();try{ce(i)(o,l,u,p)}catch(E){if(ie(v),E!==E+0)throw E;ne(1,0)}}function Ju(i,o,l,u,p,v,E,_,F){var D=se();try{ce(i)(o,l,u,p,v,E,_,F)}catch(z){if(ie(D),z!==z+0)throw z;ne(1,0)}}function Zu(i,o,l,u,p,v){var E=se();try{ce(i)(o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function Qu(i,o,l,u){var p=se();try{ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function eh(i,o,l,u,p,v,E){var _=se();try{return ce(i)(o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function th(i,o,l,u,p,v,E,_){var F=se();try{return ce(i)(o,l,u,p,v,E,_)}catch(D){if(ie(F),D!==D+0)throw D;ne(1,0)}}function rh(i,o,l,u){var p=se();try{return ce(i)(o,l,u)}catch(v){if(ie(p),v!==v+0)throw v;ne(1,0)}}function nh(i,o,l,u,p,v,E,_,F,D,z,Y){var q=se();try{return ce(i)(o,l,u,p,v,E,_,F,D,z,Y)}catch(W){if(ie(q),W!==W+0)throw W;ne(1,0)}}function sh(i,o,l,u,p,v,E,_,F,D,z,Y,q,W,Z,he){var me=se();try{ce(i)(o,l,u,p,v,E,_,F,D,z,Y,q,W,Z,he)}catch(S){if(ie(me),S!==S+0)throw S;ne(1,0)}}function ih(i,o,l,u,p,v,E){var _=se();try{ji(i,o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function ah(i,o,l,u,p,v){var E=se();try{Bi(i,o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function oh(i,o,l,u,p,v,E){var _=se();try{zi(i,o,l,u,p,v,E)}catch(F){if(ie(_),F!==F+0)throw F;ne(1,0)}}function ch(i,o,l,u,p,v){var E=se();try{Vi(i,o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function lh(i,o,l,u,p,v){var E=se();try{Gi(i,o,l,u,p,v)}catch(_){if(ie(E),_!==_+0)throw _;ne(1,0)}}function fh(i,o,l,u,p){var v=se();try{return Hi(i,o,l,u,p)}catch(E){if(ie(v),E!==E+0)throw E;ne(1,0)}}r.addFunction=Rr,r.removeFunction=br;var un;Me=function i(){un||qi(),un||(Me=i)};function qi(){if(Je>0||(Re(),Je>0))return;function i(){un||(un=!0,r.calledRun=!0,!V&&(Ue(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),Ae()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),i()},1)):i()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return qi(),e.ready}})();const vt="EXT_manifold",Ea="MERGE";class ai extends $e{static EXTENSION_NAME=vt;init(){ai.EXTENSION_NAME=vt,this.propertyType="ManifoldPrimitive",this.parentTypes=[X.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 Zc extends Se{extensionName=vt;prewriteTypes=[X.ACCESSOR];static EXTENSION_NAME=vt;createManifoldPrimitive(){return new ai(this.document.getGraph())}read(e){const{json:r}=e.jsonDoc;return(r.meshes||[]).forEach((s,a)=>{if(!s.extensions||!s.extensions[vt])return;const c=e.meshes[a],f=this.createManifoldPrimitive();c.setExtension(vt,f);const h=s.extensions[vt];if(h.manifoldPrimitive){let d=0;const g=[];g.push(d);for(const x of c.listPrimitives()){const w=x.getIndices();if(!w){console.log("Skipping non-indexed primitive ",x.getName());continue}d+=w.getCount(),g.push(d)}f.setRunIndex(g),f.setIndices(e.accessors[h.manifoldPrimitive.indices])}h.mergeIndices!=null&&h.mergeValues!=null&&f.setMerge(e.accessors[h.mergeIndices],e.accessors[h.mergeValues])}),this}prewrite(e){return this.document.getRoot().listMeshes().forEach(r=>{const n=r.getExtension(vt);if(!n)return;const s=n.getIndices();e.addAccessorToUsageGroup(s,ut.BufferViewUsage.ELEMENT_ARRAY_BUFFER);const a=n.getMergeIndices(),c=n.getMergeValues();!a||!c||(e.addAccessorToUsageGroup(a,Ea),e.addAccessorToUsageGroup(c,Ea))}),this}write(e){const{json:r}=e.jsonDoc;return this.document.getRoot().listMeshes().forEach(n=>{const s=n.getExtension(vt);if(!s)return;const a=e.meshIndexMap.get(n),c=r.meshes[a],f=s.getRunIndex(),h=f.length-1;if(h!==c.primitives.length)throw new Error("The number of primitives must be exactly one less than the length of runIndex.");const d=e.accessorIndexMap.get(s.getMergeIndices()),g=e.accessorIndexMap.get(s.getMergeValues()),x=r.accessors[d],w=r.accessors[g],M=c.primitives[0],A={indices:e.accessorIndexMap.get(s.getIndices()),mode:M.mode,attributes:{POSITION:M.attributes.POSITION}},N=r.accessors[A.indices];if(N){x&&w&&(N.sparse={count:x.count,indices:{bufferView:x.bufferView,byteOffset:x.byteOffset,componentType:x.componentType},values:{bufferView:w.bufferView,byteOffset:w.byteOffset}});for(let m=0;m{if(H>=f.length)f.push(G);else{const K=Nr[G].components,L=Nr[f[H]].components;if(K!=L)throw new Error("Attribute sizes do not correspond: "+G+" and "+f[H]);Nr[f[H]].type==null&&(f[H]=G)}})}else h.set(P,["POSITION"]);a.addPrimitive(P)}c.push(e.runIndex[d]);const x=e.numVert,w=e.numProp;let M=0;f.forEach((R,b)=>{const O=Nr[R];if(O==null)throw new Error(R+" is not a recognized attribute.");if(O.type==null){++M;return}const P=O.components;if(M+P>w)throw new Error("Too many attribute channels.");const V=new Float32Array(P*x);for(let k=0;kb&&Nr[G[b]].type!=null&&k.setAttribute(R,B)}M+=P});const A=s.createManifoldPrimitive();a.setExtension("EXT_manifold",A);const N=t.createAccessor("manifold indices").setBuffer(n).setType(te.Type.SCALAR).setArray(e.triVerts);A.setIndices(N),A.setRunIndex(c);const m=[...Array(e.numVert).keys()],C=[],T=[];if(e.mergeFromVert&&e.mergeToVert){for(const[R,b]of e.mergeFromVert.entries())m[b]=e.mergeToVert[R];for(const[R,b]of e.triVerts.entries()){const O=m[b];b!==O&&(C.push(R),T.push(O))}}if(C.length>0){const R=t.createAccessor("merge from").setBuffer(n).setType(te.Type.SCALAR).setArray(new Uint32Array(C)),b=t.createAccessor("merge to").setBuffer(n).setType(te.Type.SCALAR).setArray(new Uint32Array(T));A.setMerge(R,b)}return a}const at=await nv();at.setup();jo(Array);const Qc=sv(new Dh);Qc.registerExtensions(So);const iv=["cube","cylinder","sphere","tetrahedron","extrude","revolve","compose","union","difference","intersection","levelSet","smooth","ofMesh","hull"],av=["add","subtract","intersect","decompose","warp","transform","translate","rotate","scale","mirror","refine","setProperties","asOriginal","trimByPlane","split","splitByPlane","hull"],ov=["square","circle","union","difference","intersection","compose","ofPolygons","hull"],cv=["add","subtract","intersect","rectClip","decompose","transform","translate","rotate","scale","mirror","simplify","offset","hull"],el=["show","only","setMaterial"],lv=["setMinCircularAngle","setMinCircularEdgeLength","setCircularSegments","getCircularSegments","Mesh","GLTFNode","Manifold","CrossSection"],Ma=el.concat(lv),Cn=new Array;function kn(t,e,r){const n=at[t],s=r?n:n.prototype;for(const a of e)if(a!="cylinder"){const c=s[a];s[a]=function(...f){const h=c(...f);return Cn.push(h),h}}}kn("Manifold",av,!1);kn("Manifold",iv,!0);kn("CrossSection",cv,!1);kn("CrossSection",ov,!0);for(const t of el){const e=at[t];at[t]=function(...r){const n=e(...r);return Cn.push(n),n}}at.cleanup=function(){for(const t of Cn)if(t instanceof Array)for(const e of t)e.delete();else t.delete();Cn.length=0};let oi=!1;const Nn=new Map,ci=new Map,fv={baseColorFactor:[1,0,0],alpha:.25,roughness:1,metallic:0},uv={baseColorFactor:[.5,.5,.5],alpha:.25,roughness:1,metallic:0},Jt=new Array,On=new Map,En=new Map;let Hr=0;const er=new Map;function hv(){oi=!1,Nn.clear(),ci.clear(),Jt.length=0,On.clear(),En.clear(),er.clear(),Hr=0}class dv{_parent;manifold;translation;rotation;scale;material;name;constructor(e){this._parent=e,Jt.push(this)}clone(e){const r={...this};return r._parent=e,Jt.push(r),r}get parent(){return this._parent}}at.GLTFNode=dv;at.setMaterial=(t,e)=>{const r=t.asOriginal();return On.set(r.originalID(),e),r};function tl(t,e){let r=t.asOriginal();return e.set(r.originalID(),r.getMesh()),r}at.show=t=>tl(t,Nn);at.only=t=>(oi=!0,tl(t,ci));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)}}function hr(...t){self.console&&self.console.log(...t)}self.onmessage=async t=>{const e=t.data+` +return exportModels(typeof result === "undefined" ? undefined : result); +`;try{await new Function("exportModels","glMatrix","module",...Ma,e)(yv,Jc,at,...Ma.map(n=>at[n]))}catch(r){console.log(r.toString()),self.postMessage({objectURL:null})}finally{at.cleanup(),hv()}};function pv(t,e){const r=t.createNode(e.name);if(e.translation&&r.setTranslation(e.translation),e.rotation){const{quat:n}=Jc,s=Math.PI/180,a=n.create();n.rotateX(a,a,s*e.rotation[0]),n.rotateY(a,a,s*e.rotation[1]),n.rotateZ(a,a,s*e.rotation[2]),r.setRotation(a)}return e.scale&&r.setScale(e.scale),r}function rl(t){return t==null?{}:(t.material==null&&(t.material=rl(t.parent)),t.material)}function gv(t,{roughness:e=.2,metallic:r=1,baseColorFactor:n=[1,1,0],alpha:s=1,unlit:a=!1,name:c=""}={}){const f=t.createMaterial(c);if(a){const h=t.createExtension(Ws).createUnlit();f.setExtension("KHR_materials_unlit",h)}return s<1&&f.setAlphaMode(vr.AlphaMode.BLEND).setDoubleSided(!0),f.setRoughnessFactor(e).setMetallicFactor(r).setBaseColorFactor([...n,s])}function Fn(t,e){return En.has(e)||En.set(e,gv(t,e)),En.get(e)}function nl(t,e,r,n,s={}){const a=n.numTri();if(a==0){hr("Empty manifold, skipping.");return}hr(`Triangles: ${a.toLocaleString()}`);const c=n.boundingBox(),f=[0,0,0];for(let w=0;w<3;w++)f[w]=Math.round((c.max[w]-c.min[w])*10)/10;hr(`Bounding Box: X = ${f[0].toLocaleString()} mm, Y = ${f[1].toLocaleString()} mm, Z = ${f[2].toLocaleString()} mm`);const h=Math.round(n.getProperties().volume/10);hr(`Genus: ${n.genus().toLocaleString()}, Volume: ${(h/100).toLocaleString()} cm^3`);const d=n.getMesh(),g=new Map;for(const w of d.runOriginalID){const M=On.get(w)||s;g.set(w,{material:Fn(t,oi?uv:M),attributes:["POSITION",...M.attributes??[]]})}r.setMesh(wa(t,d,g));const x=d.numProp===3?d.vertProperties:new Float32Array(d.numVert*3);if(d.numProp>3)for(let w=0;w{const n=r.clone();t.addChild(n)})}function mv(t,e,r,n,s){sl(e,r);const a=t.createMesh();e.setMesh(a),r.getMesh().listPrimitives().forEach(c=>{const f=c.clone();c.getMaterial()===s&&f.setMaterial(n),a.addPrimitive(f)})}function vv(t,e,r,n){const s=pv(t,r),{manifold:a}=r;if(a!=null){const c=rl(r),f=n.get(a);if(f==null){nl(t,e,s,a,c);const h=new Map;h.set(c,s),n.set(a,h)}else{const h=f.get(c);if(h==null){const[d,g]=f.entries().next().value;mv(t,s,g,Fn(t,c),Fn(t,d)),f.set(c,s)}else sl(s,h)}}return er.set(r,Hr),e.components.push({id:`${Hr++}`,name:r.name,children:a==null?[]:[{objectID:`${er.get(a)}`}]}),s}async function yv(t){const e=new Os,r=Math.sqrt(2)/2,n=1/1e3,s=e.createNode("wrapper").setRotation([-r,0,0,r]).setScale([n,n,n]);e.createScene().addChild(s);const a={meshes:[],components:[],items:[],precision:7,header:{unit:"millimeter",title:"ManifoldCAD.org model",description:"ManifoldCAD.org model",application:"ManifoldCAD.org"}};if(Jt.length>0){const w=new Map,M=new Map;let A=0;for(const N of Jt)w.set(N,vv(e,a,N,M)),N.manifold&&++A;for(const N of Jt){const m=w.get(N),C={objectID:`${er.get(N)}`,transform:m.getMatrix()},{parent:T}=N;T==null?(s.addChild(m),a.items.push(C)):(w.get(T).addChild(m),a.components.find(b=>b.id==`${er.get(T)}`).children.push(C))}hr("Total glTF nodes: ",Jt.length,", Total mesh references: ",A)}else{if(t==null){hr('No output because "result" is undefined and no "GLTFNode"s were created.');return}const w=e.createNode();nl(e,a,w,t),s.addChild(w),a.items.push({objectID:`${er.get(t)}`})}const c=await Qc.writeBinary(e),f=new Blob([c],{type:"application/octet-stream"}),h=Cd(a),d={};d["3D/3dmodel.model"]=In(h),d[pa.name]=In(pa.content);const g=Hd(d),x=new Blob([g],{type:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});self.postMessage({glbURL:URL.createObjectURL(f),threeMFURL:URL.createObjectURL(x)})} 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..9bceb7068 --- /dev/null +++ b/docs/html/annotated.html @@ -0,0 +1,177 @@ + + + + + + + +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:
+
+
+ + + + diff --git a/docs/html/annotated_dup.js b/docs/html/annotated_dup.js new file mode 100644 index 000000000..a1d21aa82 --- /dev/null +++ b/docs/html/annotated_dup.js @@ -0,0 +1,63 @@ +var annotated_dup = +[ + [ "manifold", "namespacemanifold.html", [ + [ "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", "classmanifold_1_1_collider" ], + [ "ConcurrentSharedPtr", "classmanifold_1_1_concurrent_shared_ptr.html", "classmanifold_1_1_concurrent_shared_ptr" ], + [ "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 ], + [ "Halfedge2Tmp", "structmanifold_1_1_halfedge2_tmp.html", null ], + [ "HashTable", "classmanifold_1_1_hash_table.html", null ], + [ "HashTableD", "classmanifold_1_1_hash_table_d.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" ], + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", "structmanifold_1_1_mesh_g_l" ], + [ "PathImpl", "structmanifold_1_1_path_impl.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", "group___private_structmanifold_1_1_poly_vert" ], + [ "Properties", "group___connections.html#structmanifold_1_1_properties", null ], + [ "Quality", "classmanifold_1_1_quality.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", "classmanifold_1_1_sparse_indices" ], + [ "strided_range", "classmanifold_1_1strided__range.html", "classmanifold_1_1strided__range" ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "TmpInvalid", "structmanifold_1_1_tmp_invalid.html", null ], + [ "topologyErr", "structmanifold_1_1topology_err.html", null ], + [ "TriRef", "group___private.html#structmanifold_1_1_tri_ref", "group___private_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 ] + ] ], + [ "nanobind", null, [ + [ "detail", null, [ + [ "type_caster< glm::vec3 >", "structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html", null ] + ] ] + ] ], + [ "std", 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 ], + [ "GyroidSDF", "struct_gyroid_s_d_f.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 ] +]; \ 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/bdwn.png b/docs/html/bdwn.png new file mode 100644 index 000000000..940a0b950 Binary files /dev/null and b/docs/html/bdwn.png differ diff --git a/docs/html/boolean3_8h_source.html b/docs/html/boolean3_8h_source.html new file mode 100644 index 000000000..3c7a5f24d --- /dev/null +++ b/docs/html/boolean3_8h_source.html @@ -0,0 +1,157 @@ + + + + + + + +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);
+
51 Manifold::Impl Result(OpType op) const;
+
52
+
53 private:
+
54 const Manifold::Impl &inP_, &inQ_;
+
55 const float expandP_;
+
56 SparseIndices p1q2_, p2q1_;
+
57 Vec<int> x12_, x21_, w03_, w30_;
+
58 Vec<glm::vec3> v12_, v21_;
+
59};
+
60} // namespace manifold
+
Definition: boolean3.h:48
+
Definition: sparse.h:27
+
Definition: vec.h:139
+
OpType
Definition: public.h:490
+
Definition: meshIO.h:20
+
Definition: impl.h:30
+
+
+ + + + diff --git a/docs/html/classes.html b/docs/html/classes.html new file mode 100644 index 000000000..9c2f37686 --- /dev/null +++ b/docs/html/classes.html @@ -0,0 +1,165 @@ + + + + + + + +Manifold: Class Index + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Index
+
+ +
+ + + + 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..76c9e8b7b --- /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..ff42d1d68 --- /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..fd6c75eec --- /dev/null +++ b/docs/html/classmanifold_1_1_collider-members.html @@ -0,0 +1,119 @@ + + + + + + + +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)Collider
Collisions(const VecView< const T > &queriesIn) constCollider
Transform(glm::mat4x3)Collider
UpdateBoxes(const VecView< const Box > &leafBB)Collider
+
+ + + + diff --git a/docs/html/classmanifold_1_1_collider.html b/docs/html/classmanifold_1_1_collider.html new file mode 100644 index 000000000..13352b137 --- /dev/null +++ b/docs/html/classmanifold_1_1_collider.html @@ -0,0 +1,216 @@ + + + + + + + +Manifold: Collider Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Collider Class Reference
+
+
+ + + + + + + + + + + +

+Public Member Functions

 Collider (const VecView< const Box > &leafBB, const VecView< const uint32_t > &leafMorton)
 
bool Transform (glm::mat4x3)
 
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
 
+

Constructor & Destructor Documentation

+ +

◆ Collider()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Collider (const VecView< const Box > & leafBB,
const VecView< const uint32_t > & leafMorton 
)
+
+

Creates a Bounding Volume Hierarchy (BVH) from an input set of axis-aligned bounding boxes and corresponding Morton codes. It is assumed these vectors are already sorted by increasing Morton code.

+ +
+
+

Member Function Documentation

+ +

◆ Transform()

+ +
+
+ + + + + + + + +
bool Transform (glm::mat4x3 transform)
+
+

Apply axis-aligned transform to all bounding boxes. If transform is not axis-aligned, abort and return false to indicate recalculation is necessary.

+ +
+
+ +

◆ UpdateBoxes()

+ +
+
+ + + + + + + + +
void UpdateBoxes (const VecView< const Box > & leafBB)
+
+

Recalculate the collider's internal bounding boxes without changing the hierarchy.

+ +
+
+ +

◆ Collisions()

+ +
+
+ + + + + + + + +
template SparseIndices Collisions< false, true, Box > (const VecView< const T > & queriesIn) const
+
+

For a vector of query objects, this returns a sparse array of overlaps between the queries and the bounding boxes of the collider. Queries are normally axis-aligned bounding boxes. Points can also be used, and this case overlaps are defined as lying in the XY projection of the bounding box. If the query vector is the leaf vector, set selfCollision to true, which will then not report any collisions between an index and itself.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_collider.js b/docs/html/classmanifold_1_1_collider.js new file mode 100644 index 000000000..a3f415dfd --- /dev/null +++ b/docs/html/classmanifold_1_1_collider.js @@ -0,0 +1,7 @@ +var classmanifold_1_1_collider = +[ + [ "Collider", "classmanifold_1_1_collider.html#a669c441365fc439e52cd655edd70856d", null ], + [ "Transform", "classmanifold_1_1_collider.html#ab82200ff01af703f3dfe49a02dfb7e32", null ], + [ "UpdateBoxes", "classmanifold_1_1_collider.html#aa7a7428ba1ad21bb35acd27e4737aa45", null ], + [ "Collisions", "classmanifold_1_1_collider.html#a46782d8a38157f8011b0ecf273345739", null ] +]; \ No newline at end of file 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..7e279392a --- /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..8ae42d877 --- /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..49ffa95c0 --- /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..ad1cb4c30 --- /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..e10957e1b --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section-members.html @@ -0,0 +1,155 @@ + + + + + + + +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(float 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 glm::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(float degrees) constCrossSection
Scale(const glm::vec2 s) constCrossSection
Simplify(double epsilon=1e-6) constCrossSection
Square(const glm::vec2 dims, bool center=false)CrossSectionstatic
ToPolygons() constCrossSection
Transform(const glm::mat3x2 &m) constCrossSection
Translate(const glm::vec2 v) constCrossSection
Warp(std::function< void(glm::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..95dd530fe --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.html @@ -0,0 +1,1191 @@ + + + + + + + +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 ()
 
 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 glm::vec2 dims, bool center=false)
 
static CrossSection Circle (float radius, int circularSegments=0)
 
+ + + + + + + + + + + + + + + + + + + +

Modification

enum class  JoinType { Square +, Round +, Miter + }
 
CrossSection Translate (const glm::vec2 v) const
 
CrossSection Rotate (float degrees) const
 
CrossSection Scale (const glm::vec2 s) const
 
CrossSection Mirror (const glm::vec2 ax) const
 
CrossSection Transform (const glm::mat3x2 &m) const
 
CrossSection Warp (std::function< void(glm::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 glm::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 (float 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 glm::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 (float 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 glm::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 glm::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 glm::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(glm::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.
+
+
+ +
+
+ +

◆ 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..4df73bb6c --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.js @@ -0,0 +1,42 @@ +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#a106b1c0c300c4820cd9f5ec2f683a0db", null ], + [ "Rotate", "classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4", null ], + [ "Scale", "classmanifold_1_1_cross_section.html#af181324d8998fd89fa7a3e8bc7ef905c", null ], + [ "Mirror", "classmanifold_1_1_cross_section.html#adf67b7a277a85b21115f7063361da2ff", null ], + [ "Transform", "classmanifold_1_1_cross_section.html#af6b6f90c21018d47d860713c60a8399c", null ], + [ "Warp", "classmanifold_1_1_cross_section.html#a6c51d81d2e730c4a3325b4ba9b3ead39", 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..e3801a41e --- /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_, glm::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(float xDegrees=0, float yDegrees=0, float zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const glm::vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const override (defined in CsgLeafNode)CsgLeafNodevirtual
Transform(const glm::mat4x3 &m) const override (defined in CsgLeafNode)CsgLeafNodevirtual
Translate(const glm::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..627728237 --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_leaf_node.html @@ -0,0 +1,306 @@ + + + + + + + +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_, glm::mat4x3 transform_)
 
+std::shared_ptr< const Manifold::ImplGetImpl () const
 
std::shared_ptr< CsgLeafNodeToLeafNode () const override
 
std::shared_ptr< CsgNodeTransform (const glm::mat4x3 &m) const override
 
CsgNodeType GetNodeType () const override
 
glm::mat4x3 GetTransform () const override
 
- Public Member Functions inherited from CsgNode
+virtual std::shared_ptr< CsgLeafNodeToLeafNode () const =0
 
+virtual std::shared_ptr< CsgNodeTransform (const glm::mat4x3 &m) const =0
 
+virtual CsgNodeType GetNodeType () const =0
 
+virtual glm::mat4x3 GetTransform () const =0
 
+virtual std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op)
 
+std::shared_ptr< CsgNodeTranslate (const glm::vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const glm::vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (float xDegrees=0, float yDegrees=0, float 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 glm::mat4x3 & m) const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ GetNodeType()

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

Implements CsgNode.

+ +
+
+ +

◆ GetTransform()

+ +
+
+ + + + + +
+ + + + + + + +
glm::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..d44877876 --- /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(float xDegrees=0, float yDegrees=0, float zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const glm::vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const =0 (defined in CsgNode)CsgNodepure virtual
Transform(const glm::mat4x3 &m) const =0 (defined in CsgNode)CsgNodepure virtual
Translate(const glm::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..a47c8bb87 --- /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 glm::mat4x3 &m) const =0
 
+virtual CsgNodeType GetNodeType () const =0
 
+virtual glm::mat4x3 GetTransform () const =0
 
+virtual std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op)
 
+std::shared_ptr< CsgNodeTranslate (const glm::vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const glm::vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (float xDegrees=0, float yDegrees=0, float 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..2d94c31f7 --- /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(float xDegrees=0, float yDegrees=0, float zDegrees=0) const (defined in CsgNode)CsgNode
Scale(const glm::vec3 &s) const (defined in CsgNode)CsgNode
ToLeafNode() const override (defined in CsgOpNode)CsgOpNodevirtual
Transform(const glm::mat4x3 &m) const override (defined in CsgOpNode)CsgOpNodevirtual
Translate(const glm::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..cca8ab9d7 --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_op_node.html @@ -0,0 +1,311 @@ + + + + + + + +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 glm::mat4x3 &m) const override
 
std::shared_ptr< CsgLeafNodeToLeafNode () const override
 
CsgNodeType GetNodeType () const override
 
glm::mat4x3 GetTransform () const override
 
- Public Member Functions inherited from CsgNode
+virtual std::shared_ptr< CsgLeafNodeToLeafNode () const =0
 
+virtual std::shared_ptr< CsgNodeTransform (const glm::mat4x3 &m) const =0
 
+virtual CsgNodeType GetNodeType () const =0
 
+virtual glm::mat4x3 GetTransform () const =0
 
+virtual std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op)
 
+std::shared_ptr< CsgNodeTranslate (const glm::vec3 &t) const
 
+std::shared_ptr< CsgNodeScale (const glm::vec3 &s) const
 
+std::shared_ptr< CsgNodeRotate (float xDegrees=0, float yDegrees=0, float 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 glm::mat4x3 & m) const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+ +

◆ ToLeafNode()

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

Implements CsgNode.

+ +
+
+ +

◆ GetNodeType()

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

Implements CsgNode.

+ +
+
+ +

◆ GetTransform()

+ +
+
+ + + + + +
+ + + + + + + +
glm::mat4x3 GetTransform () const
+
+overridevirtual
+
+ +

Implements CsgNode.

+ +
+
+
+
+ + + + 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..523688b7b --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table-members.html @@ -0,0 +1,122 @@ + + + + + + + +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(uint32_t size, uint32_t step=1) (defined in HashTable< V, H >)HashTable< V, H >inline
Open() (defined in HashTable< V, H >)HashTable< V, H >inlinestatic
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..c92bed130 --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table.html @@ -0,0 +1,147 @@ + + + + + + + +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 (uint32_t size, uint32_t step=1)
 
+HashTableD< V, H > D ()
 
+int Entries () const
 
+int Size () const
 
+bool Full () const
 
+float 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..db3922613 --- /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, Vec< uint32_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..94d71156f --- /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, Vec< uint32_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..7f43576cc --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold-members.html @@ -0,0 +1,175 @@ + + + + + + + +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) (defined in Manifold)Manifoldstatic
Boolean(const Manifold &second, OpType op) constManifold
BoundingBox() constManifold
CalculateCurvature(int gaussianIdx, int meanIdx) constManifold
Compose(const std::vector< Manifold > &)Manifoldstatic
Cube(glm::vec3 size=glm::vec3(1.0f), bool center=false)Manifoldstatic
Cylinder(float height, float radiusLow, float radiusHigh=-1.0f, int circularSegments=0, bool center=false)Manifoldstatic
Decompose() constManifold
Error enum name (defined in Manifold)Manifold
Extrude(const CrossSection &crossSection, float height, int nDivisions=0, float twistDegrees=0.0f, glm::vec2 scaleTop=glm::vec2(1.0f))Manifoldstatic
Genus() constManifold
GetMesh() constManifold
GetMeshGL(glm::ivec3 normalIdx=glm::ivec3(0)) constManifold
GetProperties() constManifold
Hull() constManifold
Hull(const std::vector< Manifold > &manifolds)Manifoldstatic
Hull(const std::vector< glm::vec3 > &pts)Manifoldstatic
IsEmpty() constManifold
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
Mirror(glm::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
Refine(int) constManifold
ReserveIDs(uint32_t)Manifoldstatic
Revolve(const CrossSection &crossSection, int circularSegments=0, float revolveDegrees=360.0f)Manifoldstatic
Rotate(float xDegrees, float yDegrees=0.0f, float zDegrees=0.0f) constManifold
Scale(glm::vec3) constManifold
SetProperties(int, std::function< void(float *, glm::vec3, const float *)>) constManifold
Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
Sphere(float radius, int circularSegments=0)Manifoldstatic
Split(const Manifold &) constManifold
SplitByPlane(glm::vec3 normal, float originOffset) constManifold
Status() constManifold
Tetrahedron()Manifoldstatic
Transform(const glm::mat4x3 &) constManifold
Translate(glm::vec3) constManifold
TrimByPlane(glm::vec3 normal, float originOffset) constManifold
Warp(std::function< void(glm::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..f72c0ff97 --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.html @@ -0,0 +1,1781 @@ + + + + + + + +Manifold: Manifold Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Classes

struct  Impl
 
+ + + +

+Public Member Functions

Manifold Hull () const
 
+ + + + + +

+Static Public Member Functions

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

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 (glm::ivec3 normalIdx=glm::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
 
float Precision () const
 
int Genus () const
 
Properties GetProperties () const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Creation

Constructors

+
 Manifold ()
 
~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 (glm::vec3 size=glm::vec3(1.0f), bool center=false)
 
static Manifold Cylinder (float height, float radiusLow, float radiusHigh=-1.0f, int circularSegments=0, bool center=false)
 
static Manifold Sphere (float radius, int circularSegments=0)
 
static Manifold Extrude (const CrossSection &crossSection, float height, int nDivisions=0, float twistDegrees=0.0f, glm::vec2 scaleTop=glm::vec2(1.0f))
 
static Manifold Revolve (const CrossSection &crossSection, int circularSegments=0, float revolveDegrees=360.0f)
 
+ + + + + + +

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 (glm::vec3) const
 
Manifold Scale (glm::vec3) const
 
Manifold Rotate (float xDegrees, float yDegrees=0.0f, float zDegrees=0.0f) const
 
Manifold Transform (const glm::mat4x3 &) const
 
Manifold Mirror (glm::vec3) const
 
Manifold Warp (std::function< void(glm::vec3 &)>) const
 
Manifold SetProperties (int, std::function< void(float *, glm::vec3, const float *)>) const
 
Manifold CalculateCurvature (int gaussianIdx, int meanIdx) const
 
Manifold Refine (int) 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 (glm::vec3 normal, float originOffset) const
 
Manifold TrimByPlane (glm::vec3 normal, float originOffset) const
 
+static Manifold BatchBoolean (const std::vector< Manifold > &manifolds, OpType op)
 
+ + + + + + + + +

Testing hooks

These are just for internal testing.

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

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 (glm::vec3 size = glm::vec3(1.0f),
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 (float height,
float radiusLow,
float radiusHigh = -1.0f,
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 (float 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 CrossSectioncrossSection,
float height,
int nDivisions = 0,
float twistDegrees = 0.0f,
glm::vec2 scaleTop = glm::vec2(1.0f) 
)
+
+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. Default {1, 1}.
+
+
+ +
+
+ +

◆ Revolve()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Manifold Revolve (const CrossSectioncrossSection,
int circularSegments = 0,
float 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 (glm::ivec3 normalIdx = glm::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()

+ +
+
+ + + + + + + +
float 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.

+ +
+
+ +

◆ 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 (glm::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 (glm::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 (float xDegrees,
float yDegrees = 0.0f,
float zDegrees = 0.0f 
) 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 glm::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 (glm::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(glm::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.
+
+
+ +
+
+ +

◆ SetProperties()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold SetProperties (int ,
std::function< void(float *, glm::vec3, const float *)>  
) 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.
+
+
+ +
+
+ +

◆ 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. 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.
+
+
+ +
+
+ +

◆ 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.
+
+
+ +
+
+ +

◆ 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 (glm::vec3 normal,
float 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 (glm::vec3 normal,
float 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.
+
+
+ +
+
+ +

◆ 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< glm::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..7442e1520 --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.js @@ -0,0 +1,45 @@ +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#a5516d4d27772731e50540edd45553a4d", 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#a013e5ce70b14d7d19393bcdffbc73ce2", null ], + [ "Genus", "classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1", null ], + [ "GetProperties", "classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07", null ], + [ "OriginalID", "classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6", null ], + [ "AsOriginal", "classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57", null ], + [ "Translate", "classmanifold_1_1_manifold.html#ac1ebb85b775a3293bca68c2339762a08", null ], + [ "Scale", "classmanifold_1_1_manifold.html#ae06789ff9cbe03e56260538276dd8183", null ], + [ "Rotate", "classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629", null ], + [ "Transform", "classmanifold_1_1_manifold.html#a707b0078fbb9bbad183812d7290630ce", null ], + [ "Mirror", "classmanifold_1_1_manifold.html#a90bbf2842d0a2dc394d32f1a0a32c24a", null ], + [ "Warp", "classmanifold_1_1_manifold.html#aecb7b2e2a6a18a570154dec76658496c", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", 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#adc134d7a6dfbf8c74e5d531bbeb330cb", null ], + [ "TrimByPlane", "classmanifold_1_1_manifold.html#a1b711341093c115f6688cbcaae5c8741", 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_quality-members.html b/docs/html/classmanifold_1_1_quality-members.html new file mode 100644 index 000000000..8f9f80168 --- /dev/null +++ b/docs/html/classmanifold_1_1_quality-members.html @@ -0,0 +1,118 @@ + + + + + + + +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(float radius)Qualityinlinestatic
SetCircularSegments(int number)Qualityinlinestatic
SetMinCircularAngle(float angle)Qualityinlinestatic
SetMinCircularEdgeLength(float 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..0fb882433 --- /dev/null +++ b/docs/html/classmanifold_1_1_quality.html @@ -0,0 +1,264 @@ + + + + + + + +Manifold: Quality Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Quality Class Reference
+
+
+ +

#include <public.h>

+ + + + + + + + + + +

+Static Public Member Functions

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

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 (float 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 (float 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 (float 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.
+
+
+ +
+
+
+
+ + + + 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..2eff12782 --- /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(int i, bool use_q) (defined in SparseIndices)SparseIndicesinline
Get(int i, bool use_q) const (defined in SparseIndices)SparseIndicesinline
GetPQ(int 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(int size) (defined in SparseIndices)SparseIndicesinline
Set(int i, int p, int q) (defined in SparseIndices)SparseIndicesinline
SetPQ(int 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..92c153e07 --- /dev/null +++ b/docs/html/classmanifold_1_1_sparse_indices.html @@ -0,0 +1,190 @@ + + + + + + + +Manifold: SparseIndices Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Classes

struct  firstNonFinite
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SparseIndices (size_t size)
 
+int size () const
 
+Vec< int > Copy (bool use_q) const
 
+void Sort ()
 
+void Resize (int size)
 
+int & Get (int i, bool use_q)
 
+int Get (int i, bool use_q) const
 
+int64_t GetPQ (int i) const
 
+void Set (int i, int p, int q)
 
+void SetPQ (int 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_sparse_indices.js b/docs/html/classmanifold_1_1_sparse_indices.js new file mode 100644 index 000000000..f775873c8 --- /dev/null +++ b/docs/html/classmanifold_1_1_sparse_indices.js @@ -0,0 +1,4 @@ +var classmanifold_1_1_sparse_indices = +[ + [ "firstNonFinite", "structmanifold_1_1_sparse_indices_1_1first_non_finite.html", null ] +]; \ No newline at end of file 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..06b31694d --- /dev/null +++ b/docs/html/classmanifold_1_1_vec-members.html @@ -0,0 +1,159 @@ + + + + + + + +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
cbegin() const (defined in VecView< T >)VecView< T >inline
cend() const (defined in VecView< T >)VecView< T >inline
cview(int offset=0, int length=-1) 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() (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[](int i) const (defined in VecView< T >)VecView< T >inline
operator[](int i) (defined in VecView< T >)VecView< T >inline
ptr_ (defined in VecView< T >)VecView< T >protected
push_back(const T &val) (defined in Vec< T >)Vec< T >inline
reserve(int n) (defined in Vec< T >)Vec< T >inline
resize(int 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(int size) (defined in Vec< T >)Vec< T >inline
Vec(int size, T val) (defined in Vec< T >)Vec< T >inline
Vec(const Vec< 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_, int 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(int offset=0, int length=-1) (defined in Vec< T >)Vec< T >inline
view(int offset=0, int length=-1) 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..82d6bd952 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec.html @@ -0,0 +1,256 @@ + + + + + + + +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 (int size)
 
Vec (int size, T val)
 
Vec (const Vec< 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 (int n)
 
+void resize (int newSize, T val=T())
 
+void shrink_to_fit ()
 
+VecView< T > view (int offset=0, int length=-1)
 
+VecView< const T > cview (int offset=0, int length=-1) const
 
+VecView< const T > view (int offset=0, int length=-1) const
 
+T * data ()
 
+const T * data () const
 
- Public Member Functions inherited from VecView< T >
VecView (T *ptr_, int size_)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const T & operator[] (int i) const
 
+T & operator[] (int 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 ()
 
+int size () const
 
+bool empty () const
 
+void Dump ()
 
+ + + + + + + + + + + +

+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
 
+int 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..e90c0eb75 --- /dev/null +++ b/docs/html/classmanifold_1_1_vec_view-members.html @@ -0,0 +1,141 @@ + + + + + + + +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() (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[](int i) const (defined in VecView< T >)VecView< T >inline
operator[](int 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
Vec< T > (defined in VecView< T >)VecView< T >friend
Vec< typename std::remove_const< T >::type > (defined in VecView< T >)VecView< T >friend
VecView(T *ptr_, int 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
VecView< typename std::remove_const< T >::type > (defined in VecView< T >)VecView< T >friend
+
+ + + + 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..fd43746ea --- /dev/null +++ b/docs/html/classmanifold_1_1_vec_view.html @@ -0,0 +1,216 @@ + + + + + + + +Manifold: VecView< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
VecView< T > Class Template Reference
+
+
+ +

#include <vec.h>

+ +

Inherited by Vec< int >, Vec< glm::vec3 >, Vec< manifold::Box >, Vec< thrust::pair< int, int > >, Vec< Uint64 >, Vec< V >, Vec< uint32_t >, Vec< manifold::Halfedge >, Vec< glm::vec4 >, Vec< float >, Vec< manifold::TriRef >, Vec< glm::ivec3 >, Vec< char >, Vec< unsigned char >, and Vec< T >.

+ + + + + + +

+Public Types

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

+Public Member Functions

VecView (T *ptr_, int size_)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const T & operator[] (int i) const
 
+T & operator[] (int 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 ()
 
+int size () const
 
+bool empty () const
 
+void Dump ()
 
+ + + + + +

+Protected Attributes

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

+Friends

+class Vec< T >
 
+class Vec< typename std::remove_const< T >::type >
 
+class VecView< typename std::remove_const< T >::type >
 
+

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.

+
+
+ + + + diff --git a/docs/html/classmanifold_1_1strided__range-members.html b/docs/html/classmanifold_1_1strided__range-members.html new file mode 100644 index 000000000..2b248e7cb --- /dev/null +++ b/docs/html/classmanifold_1_1strided__range-members.html @@ -0,0 +1,126 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
strided_range< Iterator > Member List
+
+
+ +

This is the complete list of members for strided_range< Iterator >, including all inherited members.

+ + + + + + + + + + + + + +
begin(void) const (defined in strided_range< Iterator >)strided_range< Iterator >inline
CountingIterator typedef (defined in strided_range< Iterator >)strided_range< Iterator >
difference_type typedef (defined in strided_range< Iterator >)strided_range< Iterator >
end(void) const (defined in strided_range< Iterator >)strided_range< Iterator >inline
first (defined in strided_range< Iterator >)strided_range< Iterator >protected
iterator typedef (defined in strided_range< Iterator >)strided_range< Iterator >
last (defined in strided_range< Iterator >)strided_range< Iterator >protected
PermutationIterator typedef (defined in strided_range< Iterator >)strided_range< Iterator >
stride (defined in strided_range< Iterator >)strided_range< Iterator >protected
strided_range(Iterator first, Iterator last, difference_type stride) (defined in strided_range< Iterator >)strided_range< Iterator >inline
strided_range() (defined in strided_range< Iterator >)strided_range< Iterator >inline
TransformIterator typedef (defined in strided_range< Iterator >)strided_range< Iterator >
+
+ + + + diff --git a/docs/html/classmanifold_1_1strided__range.html b/docs/html/classmanifold_1_1strided__range.html new file mode 100644 index 000000000..6df626345 --- /dev/null +++ b/docs/html/classmanifold_1_1strided__range.html @@ -0,0 +1,166 @@ + + + + + + + +Manifold: strided_range< Iterator > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
strided_range< Iterator > Class Template Reference
+
+
+ + + + +

+Classes

struct  stride_functor
 
+ + + + + + + + + + + +

+Public Types

+typedef thrust::iterator_difference< Iterator >::type difference_type
 
+typedef thrust::counting_iterator< difference_type > CountingIterator
 
+typedef thrust::transform_iterator< stride_functor, CountingIterator > TransformIterator
 
+typedef thrust::permutation_iterator< Iterator, TransformIterator > PermutationIterator
 
+typedef PermutationIterator iterator
 
+ + + + + + + +

+Public Member Functions

strided_range (Iterator first, Iterator last, difference_type stride)
 
+iterator begin (void) const
 
+iterator end (void) const
 
+ + + + + + + +

+Protected Attributes

+Iterator first
 
+Iterator last
 
+difference_type stride
 
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1strided__range.js b/docs/html/classmanifold_1_1strided__range.js new file mode 100644 index 000000000..40814b3d1 --- /dev/null +++ b/docs/html/classmanifold_1_1strided__range.js @@ -0,0 +1,4 @@ +var classmanifold_1_1strided__range = +[ + [ "stride_functor", "structmanifold_1_1strided__range_1_1stride__functor.html", null ] +]; \ No newline at end of file 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..90ba38653 --- /dev/null +++ b/docs/html/collider_8h_source.html @@ -0,0 +1,163 @@ + + + + + + + +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 "public.h"
+
17#include "sparse.h"
+
18#include "vec.h"
+
19
+
20namespace manifold {
+
21
+
23class Collider {
+
24 public:
+
25 Collider() {}
+
26 Collider(const VecView<const Box>& leafBB,
+
27 const VecView<const uint32_t>& leafMorton);
+
28 bool Transform(glm::mat4x3);
+
29 void UpdateBoxes(const VecView<const Box>& leafBB);
+
30 template <const bool selfCollision = false, const bool inverted = false,
+
31 typename T>
+
32 SparseIndices Collisions(const VecView<const T>& queriesIn) const;
+
33
+
34 private:
+
35 Vec<Box> nodeBBox_;
+
36 Vec<int> nodeParent_;
+
37 // even nodes are leaves, odd nodes are internal, root is 1
+
38 Vec<thrust::pair<int, int>> internalChildren_;
+
39
+
40 int NumInternal() const { return internalChildren_.size(); };
+
41 int NumLeaves() const { return NumInternal() + 1; };
+
42};
+
43
+
44} // namespace manifold
+
Definition: collider.h:23
+
SparseIndices Collisions(const VecView< const T > &queriesIn) const
Definition: collider.cpp:301
+
void UpdateBoxes(const VecView< const Box > &leafBB)
Definition: collider.cpp:338
+
bool Transform(glm::mat4x3)
Definition: collider.cpp:357
+
Definition: sparse.h:27
+
Definition: vec.h:139
+
Definition: vec.h:42
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/conv_8h_source.html b/docs/html/conv_8h_source.html new file mode 100644 index 000000000..0a1d6503f --- /dev/null +++ b/docs/html/conv_8h_source.html @@ -0,0 +1,211 @@ + + + + + + + +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 "cross_section.h"
+
20#include "manifold.h"
+
21#include "public.h"
+
22#include "sdf.h"
+
23#include "types.h"
+
24
+
25using namespace manifold;
+
26using ManifoldVec = std::vector<Manifold>;
+
27using CrossSectionVec = std::vector<CrossSection>;
+
28
+
29ManifoldManifold *to_c(manifold::Manifold *m);
+
30ManifoldManifoldVec *to_c(ManifoldVec *ms);
+
31ManifoldCrossSection *to_c(manifold::CrossSection *cs);
+
32ManifoldCrossSectionVec *to_c(CrossSectionVec *csv);
+
33ManifoldSimplePolygon *to_c(manifold::SimplePolygon *p);
+
34ManifoldPolygons *to_c(manifold::Polygons *ps);
+
35ManifoldMesh *to_c(manifold::Mesh *m);
+
36ManifoldMeshGL *to_c(manifold::MeshGL *m);
+
37ManifoldBox *to_c(manifold::Box *m);
+
38ManifoldRect *to_c(manifold::Rect *m);
+
39ManifoldError to_c(manifold::Manifold::Error error);
+
40ManifoldVec2 to_c(glm::vec2 v);
+
41ManifoldVec3 to_c(glm::vec3 v);
+
42ManifoldIVec3 to_c(glm::ivec3 v);
+ +
44
+
45const manifold::Manifold *from_c(ManifoldManifold *m);
+
46ManifoldVec *from_c(ManifoldManifoldVec *ms);
+
47const manifold::CrossSection *from_c(ManifoldCrossSection *cs);
+
48CrossSectionVec *from_c(ManifoldCrossSectionVec *csv);
+
49const manifold::SimplePolygon *from_c(ManifoldSimplePolygon *m);
+
50const manifold::Polygons *from_c(ManifoldPolygons *m);
+
51const manifold::Mesh *from_c(ManifoldMesh *m);
+
52const manifold::MeshGL *from_c(ManifoldMeshGL *m);
+
53OpType from_c(ManifoldOpType op);
+
54CrossSection::FillRule from_c(ManifoldFillRule fillrule);
+
55CrossSection::JoinType from_c(ManifoldJoinType jt);
+
56const manifold::Box *from_c(ManifoldBox *m);
+
57const manifold::Rect *from_c(ManifoldRect *r);
+
58glm::vec2 from_c(ManifoldVec2 v);
+
59glm::vec3 from_c(ManifoldVec3 v);
+
60glm::ivec3 from_c(ManifoldIVec3 v);
+
61glm::vec4 from_c(ManifoldVec4 v);
+
62
+
63std::vector<glm::vec3> vector_of_vec_array(ManifoldVec3 *vs, size_t length);
+
64std::vector<glm::ivec3> vector_of_vec_array(ManifoldIVec3 *vs, size_t length);
+
65std::vector<glm::vec4> vector_of_vec_array(ManifoldVec4 *vs, size_t length);
+
66
+
67template <typename T>
+
68std::vector<T> vector_of_array(T *ts, size_t length) {
+
69 auto vec = std::vector<T>();
+
70 for (int i = 0; i < length; ++i) {
+
71 vec.push_back(ts[i]);
+
72 }
+
73 return vec;
+
74}
+
75
+
76template <typename T>
+
77T *copy_data(void *mem, std::vector<T> v) {
+
78 T *ts = reinterpret_cast<T *>(mem);
+
79 memcpy(ts, v.data(), sizeof(T) * v.size());
+
80 return ts;
+
81}
+
Definition: cross_section.h:39
+
FillRule
Definition: cross_section.h:64
+
JoinType
Definition: cross_section.h:111
+
Definition: manifold.h:114
+
std::vector< glm::vec2 > SimplePolygon
Definition: public.h:113
+
std::vector< SimplePolygon > Polygons
Definition: public.h:121
+
Definition: public.h:126
+
Definition: public.h:164
+
OpType
Definition: public.h:490
+
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: public.h:168
+
Definition: manifold.h:46
+
Definition: public.h:319
+
+
+ + + + diff --git a/docs/html/cross__section_8h_source.html b/docs/html/cross__section_8h_source.html new file mode 100644 index 000000000..1afb40ba3 --- /dev/null +++ b/docs/html/cross__section_8h_source.html @@ -0,0 +1,264 @@ + + + + + + + +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 "glm/ext/matrix_float3x2.hpp"
+
22#include "glm/ext/vector_float2.hpp"
+
23#include "public.h"
+
24
+
25namespace manifold {
+
26
+
31struct PathImpl;
+
32
+ +
40 public:
+
45
+ + +
48
+
49 CrossSection(const CrossSection& other);
+
50 CrossSection& operator=(const CrossSection& other);
+
51 CrossSection(CrossSection&&) noexcept;
+
52 CrossSection& operator=(CrossSection&&) noexcept;
+
53
+
54 // Adapted from Clipper2 docs:
+
55 // http://www.angusj.com/clipper2/Docs/Units/Clipper/Types/FillRule.htm
+
56 // (Copyright © 2010-2023 Angus Johnson)
+
64 enum class FillRule {
+
65 EvenOdd,
+
66 NonZero,
+
67 Positive,
+ +
69 };
+
70
+
71 CrossSection(const SimplePolygon& contour,
+
72 FillRule fillrule = FillRule::Positive);
+
73 CrossSection(const Polygons& contours,
+
74 FillRule fillrule = FillRule::Positive);
+
75 CrossSection(const Rect& rect);
+
76 static CrossSection Square(const glm::vec2 dims, bool center = false);
+
77 static CrossSection Circle(float radius, int circularSegments = 0);
+
79
+
84 double Area() const;
+
85 int NumVert() const;
+
86 int NumContour() const;
+
87 bool IsEmpty() const;
+
88 Rect Bounds() const;
+
90
+
94 CrossSection Translate(const glm::vec2 v) const;
+
95 CrossSection Rotate(float degrees) const;
+
96 CrossSection Scale(const glm::vec2 s) const;
+
97 CrossSection Mirror(const glm::vec2 ax) const;
+
98 CrossSection Transform(const glm::mat3x2& m) const;
+
99 CrossSection Warp(std::function<void(glm::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 glm::mat3x2 transform_ = glm::mat3x2(1.0f);
+
169 CrossSection(std::shared_ptr<const PathImpl> paths);
+
170 std::shared_ptr<const PathImpl> GetPaths() const;
+
171};
+
173} // namespace manifold
+
Definition: cross_section.h:39
+
CrossSection Boolean(const CrossSection &second, OpType op) const
Definition: cross_section.cpp:355
+
CrossSection Translate(const glm::vec2 v) const
Definition: cross_section.cpp:482
+
CrossSection & operator+=(const CrossSection &)
Definition: cross_section.cpp:403
+
Polygons ToPolygons() const
Definition: cross_section.cpp:731
+
CrossSection operator+(const CrossSection &) const
Definition: cross_section.cpp:395
+
CrossSection operator^(const CrossSection &) const
Definition: cross_section.cpp:428
+
CrossSection & operator-=(const CrossSection &)
Definition: cross_section.cpp:420
+
std::vector< CrossSection > Decompose() const
Definition: cross_section.cpp:454
+
CrossSection Warp(std::function< void(glm::vec2 &)> warpFunc) const
Definition: cross_section.cpp:556
+
static CrossSection Compose(std::vector< CrossSection > &)
Definition: cross_section.cpp:445
+
static CrossSection BatchBoolean(const std::vector< CrossSection > &crossSections, OpType op)
Definition: cross_section.cpp:367
+
int NumVert() const
Definition: cross_section.cpp:699
+
bool IsEmpty() const
Definition: cross_section.cpp:717
+
CrossSection Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
Definition: cross_section.cpp:612
+
CrossSection Rotate(float degrees) const
Definition: cross_section.cpp:495
+
FillRule
Definition: cross_section.h:64
+
@ 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:436
+
CrossSection Simplify(double epsilon=1e-6) const
Definition: cross_section.cpp:587
+
CrossSection Hull() const
Definition: cross_section.cpp:658
+
double Area() const
Definition: cross_section.cpp:694
+
CrossSection()
Definition: cross_section.cpp:208
+
static CrossSection Circle(float radius, int circularSegments=0)
Definition: cross_section.cpp:338
+
CrossSection Mirror(const glm::vec2 ax) const
Definition: cross_section.cpp:525
+
Rect Bounds() const
Definition: cross_section.cpp:723
+
JoinType
Definition: cross_section.h:111
+ + + +
CrossSection Scale(const glm::vec2 s) const
Definition: cross_section.cpp:510
+
CrossSection operator-(const CrossSection &) const
Definition: cross_section.cpp:412
+
CrossSection Transform(const glm::mat3x2 &m) const
Definition: cross_section.cpp:541
+
int NumContour() const
Definition: cross_section.cpp:712
+
std::vector< glm::vec2 > SimplePolygon
Definition: public.h:113
+
std::vector< SimplePolygon > Polygons
Definition: public.h:121
+
OpType
Definition: public.h:490
+
Definition: meshIO.h:20
+
Definition: public.h:319
+
+
+ + + + diff --git a/docs/html/csg__tree_8h_source.html b/docs/html/csg__tree_8h_source.html new file mode 100644 index 000000000..706c3486b --- /dev/null +++ b/docs/html/csg__tree_8h_source.html @@ -0,0 +1,229 @@ + + + + + + + +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.h"
+
17#include "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 glm::mat4x3 &m) const = 0;
+
29 virtual CsgNodeType GetNodeType() const = 0;
+
30 virtual glm::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 glm::vec3 &t) const;
+
36 std::shared_ptr<CsgNode> Scale(const glm::vec3 &s) const;
+
37 std::shared_ptr<CsgNode> Rotate(float xDegrees = 0, float yDegrees = 0,
+
38 float 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_,
+
46 glm::mat4x3 transform_);
+
47
+
48 std::shared_ptr<const Manifold::Impl> GetImpl() const;
+
49
+
50 std::shared_ptr<CsgLeafNode> ToLeafNode() const override;
+
51
+
52 std::shared_ptr<CsgNode> Transform(const glm::mat4x3 &m) const override;
+
53
+
54 CsgNodeType GetNodeType() const override;
+
55
+
56 glm::mat4x3 GetTransform() const override;
+
57
+ +
59 const std::vector<std::shared_ptr<CsgLeafNode>> &nodes);
+
60
+
61 private:
+
62 mutable std::shared_ptr<const Manifold::Impl> pImpl_;
+
63 mutable glm::mat4x3 transform_ = glm::mat4x3(1.0f);
+
64};
+
65
+
66class CsgOpNode final : public CsgNode {
+
67 public:
+
68 CsgOpNode();
+
69
+
70 CsgOpNode(const std::vector<std::shared_ptr<CsgNode>> &children, OpType op);
+
71
+
72 CsgOpNode(std::vector<std::shared_ptr<CsgNode>> &&children, OpType op);
+
73
+
74 std::shared_ptr<CsgNode> Boolean(const std::shared_ptr<CsgNode> &second,
+
75 OpType op) override;
+
76
+
77 std::shared_ptr<CsgNode> Transform(const glm::mat4x3 &m) const override;
+
78
+
79 std::shared_ptr<CsgLeafNode> ToLeafNode() const override;
+
80
+
81 CsgNodeType GetNodeType() const override { return op_; }
+
82
+
83 glm::mat4x3 GetTransform() const override;
+
84
+
85 private:
+
86 struct Impl {
+
87 std::vector<std::shared_ptr<CsgNode>> children_;
+
88 bool forcedToLeafNodes_ = false;
+
89 };
+ +
91 CsgNodeType op_;
+
92 glm::mat4x3 transform_ = glm::mat4x3(1.0f);
+
93 // the following fields are for lazy evaluation, so they are mutable
+
94 mutable std::shared_ptr<CsgLeafNode> cache_ = nullptr;
+
95
+
96 void SetOp(OpType);
+
97 bool IsOp(OpType op);
+
98
+
99 static std::shared_ptr<Manifold::Impl> BatchBoolean(
+
100 OpType operation,
+
101 std::vector<std::shared_ptr<const Manifold::Impl>> &results);
+
102
+
103 void BatchUnion() const;
+
104
+
105 std::vector<std::shared_ptr<CsgNode>> &GetChildren(
+
106 bool forceToLeafNodes = true) const;
+
107};
+
108
+
109} // namespace manifold
+
Definition: utils.h:190
+
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:66
+
OpType
Definition: public.h:490
+
Definition: meshIO.h:20
+
Definition: impl.h:30
+
+
+ + + + diff --git a/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html b/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html new file mode 100644 index 000000000..875dd6808 --- /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

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

+Files

file  boolean3.h [code]
 
file  csg_tree.h [code]
 
file  impl.h [code]
 
file  mesh_fixes.h [code]
 
file  shared.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_035854e2c8d5363d0a7c6528cb1706b0.html b/docs/html/dir_035854e2c8d5363d0a7c6528cb1706b0.html new file mode 100644 index 000000000..21a11a84a --- /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
+
+
+ + + + +

+Files

file  meshIO.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_0701a8296ffb54d5e8b875616b7dbaff.html b/docs/html/dir_0701a8296ffb54d5e8b875616b7dbaff.html new file mode 100644 index 000000000..75ca1f401 --- /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..597f64ca9 --- /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

file  test.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html b/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html new file mode 100644 index 000000000..65a84cacd --- /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..b32683497 --- /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
+
+
+ + + + +

+Files

file  collider.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html b/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html new file mode 100644 index 000000000..27a06864b --- /dev/null +++ b/docs/html/dir_2c51409c809e8ad66fa65b4037751a14.html @@ -0,0 +1,130 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + + + + + + + + + + + + + +

+Files

file  hashtable.h [code]
 
file  optional_assert.h [code]
 
file  par.h [code]
 
file  public.h [code]
 
file  sparse.h [code]
 
file  utils.h [code]
 
file  vec.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_3129add96c7ae9ff67479c7829851787.html b/docs/html/dir_3129add96c7ae9ff67479c7829851787.html new file mode 100644 index 000000000..e41d88f42 --- /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
+
+
+ + + + +

+Files

file  manifold.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html b/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html new file mode 100644 index 000000000..24d60b48d --- /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..77648e8c4 --- /dev/null +++ b/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: c Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
c Directory Reference
+
+
+ + + + +

+Directories

directory  include
 
+
+
+ + + + diff --git a/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html b/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html new file mode 100644 index 000000000..077001bc1 --- /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_44bc45adee95d64f3fc07ac8632ac6e6.html b/docs/html/dir_44bc45adee95d64f3fc07ac8632ac6e6.html new file mode 100644 index 000000000..7b2ede4d6 --- /dev/null +++ b/docs/html/dir_44bc45adee95d64f3fc07ac8632ac6e6.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: sdf Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sdf Directory Reference
+
+
+ + + + + + +

+Directories

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_46e7b3646ff8bc1527ae1e0fd4b7ea0c.html b/docs/html/dir_46e7b3646ff8bc1527ae1e0fd4b7ea0c.html new file mode 100644 index 000000000..350867bb4 --- /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
+
+
+ + + + +

+Files

file  cross_section.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html b/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html new file mode 100644 index 000000000..d9c539ec7 --- /dev/null +++ b/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: polygon Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
polygon Directory Reference
+
+
+ + + + + + +

+Directories

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_595091899e7484108f36f28facccf73b.html b/docs/html/dir_595091899e7484108f36f28facccf73b.html new file mode 100644 index 000000000..37048e282 --- /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
+
+
+ + + + +

+Files

file  polygon.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html b/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html new file mode 100644 index 000000000..07a18e81c --- /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..09b72a3df --- /dev/null +++ b/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: cross_section Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
cross_section Directory Reference
+
+
+ + + + + + +

+Directories

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 000000000..17695e353 --- /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..1bc9f200b --- /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

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_7a1d03d6e98827f36dd6952c603435c3.html b/docs/html/dir_7a1d03d6e98827f36dd6952c603435c3.html new file mode 100644 index 000000000..960302364 --- /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

file  samples.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html b/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html new file mode 100644 index 000000000..4e35eb77d --- /dev/null +++ b/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: utilities Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
utilities Directory Reference
+
+
+ + + + +

+Directories

directory  include
 
+
+
+ + + + diff --git a/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html b/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html new file mode 100644 index 000000000..4218d1336 --- /dev/null +++ b/docs/html/dir_831f472cf672c235312e7f1d1816ce6c.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: collider Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
collider Directory Reference
+
+
+ + + + + + +

+Directories

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html b/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html new file mode 100644 index 000000000..8f3a33c2f --- /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..f60f3a643 --- /dev/null +++ b/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: wasm Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
wasm Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_bec6917ed0ee86d39288c395bdef2150.html b/docs/html/dir_bec6917ed0ee86d39288c395bdef2150.html new file mode 100644 index 000000000..957dd262b --- /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

directory  examples
 
+
+
+ + + + diff --git a/docs/html/dir_bee2aafd430f50c741cae4861fc3aab1.html b/docs/html/dir_bee2aafd430f50c741cae4861fc3aab1.html new file mode 100644 index 000000000..ae4147992 --- /dev/null +++ b/docs/html/dir_bee2aafd430f50c741cae4861fc3aab1.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_c5bd9479356315758215f331b902faba.html b/docs/html/dir_c5bd9479356315758215f331b902faba.html new file mode 100644 index 000000000..19eb5b715 --- /dev/null +++ b/docs/html/dir_c5bd9479356315758215f331b902faba.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: include Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+ + + + + + + + +

+Files

file  conv.h [code]
 
file  manifoldc.h [code]
 
file  types.h [code]
 
+
+
+ + + + diff --git a/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html b/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html new file mode 100644 index 000000000..d54a410dc --- /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..61ea33f8e --- /dev/null +++ b/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: manifold Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
manifold Directory Reference
+
+
+ + + + + + +

+Directories

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

+Files

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

+Directories

directory  include
 
directory  src
 
+
+
+ + + + diff --git a/docs/html/dir_f133c49f97637acfb65c04f34a613096.html b/docs/html/dir_f133c49f97637acfb65c04f34a613096.html new file mode 100644 index 000000000..7001bb346 --- /dev/null +++ b/docs/html/dir_f133c49f97637acfb65c04f34a613096.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/doc.png b/docs/html/doc.png new file mode 100644 index 000000000..17edabff9 Binary files /dev/null and b/docs/html/doc.png differ diff --git a/docs/html/docd.png b/docs/html/docd.png new file mode 100644 index 000000000..d7c94fda9 Binary files /dev/null and b/docs/html/docd.png differ diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css new file mode 100644 index 000000000..89dee6c43 --- /dev/null +++ b/docs/html/doxygen.css @@ -0,0 +1,1973 @@ +/* The standard CSS for doxygen 1.9.5*/ + +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.png'); + +/* 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; + +/** 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-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; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 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.png'); + +/* 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; + +/** 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-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--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; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 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); + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 10px; + width: 10px; +} +::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 8px; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-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); +} + +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; +} + +#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.0; + 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.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.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:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + 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: url("bdwn.png") 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: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +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; +} + diff --git a/docs/html/doxygen.svg b/docs/html/doxygen.svg new file mode 100644 index 000000000..d42dad52d --- /dev/null +++ b/docs/html/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/dynsections.js b/docs/html/dynsections.js new file mode 100644 index 000000000..f579fbf3e --- /dev/null +++ b/docs/html/dynsections.js @@ -0,0 +1,123 @@ +/* + @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 + + + + + + +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..91a732e93 --- /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..5f94f29d4 --- /dev/null +++ b/docs/html/functions_c.html @@ -0,0 +1,130 @@ + + + + + + + +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..3d100a7ef --- /dev/null +++ b/docs/html/functions_d.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:
+ +

- d -

+
+
+ + + + diff --git a/docs/html/functions_dup.js b/docs/html/functions_dup.js new file mode 100644 index 000000000..276fdbe1a --- /dev/null +++ b/docs/html/functions_dup.js @@ -0,0 +1,23 @@ +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 ], + [ "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..5956eceee --- /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..dc60810f6 --- /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
+
+
+
+
+ +
+
+
+ + + + diff --git a/docs/html/functions_f.html b/docs/html/functions_f.html new file mode 100644 index 000000000..ab95535fa --- /dev/null +++ b/docs/html/functions_f.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:
+ +

- f -

+
+
+ + + + diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html new file mode 100644 index 000000000..82ea4be6b --- /dev/null +++ b/docs/html/functions_func.html @@ -0,0 +1,286 @@ + + + + + + + +Manifold: Class Members - Functions + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- 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..060807d1f --- /dev/null +++ b/docs/html/functions_g.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:
+ +

- g -

+
+
+ + + + diff --git a/docs/html/functions_h.html b/docs/html/functions_h.html new file mode 100644 index 000000000..da046f8f9 --- /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..83b9f854e --- /dev/null +++ b/docs/html/functions_i.html @@ -0,0 +1,121 @@ + + + + + + + +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..3821d069f --- /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_m.html b/docs/html/functions_m.html new file mode 100644 index 000000000..a8e38638d --- /dev/null +++ b/docs/html/functions_m.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:
+ +

- m -

+
+
+ + + + diff --git a/docs/html/functions_n.html b/docs/html/functions_n.html new file mode 100644 index 000000000..7e2439f32 --- /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..8ceb4c222 --- /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..0e5ac84e8 --- /dev/null +++ b/docs/html/functions_p.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:
+ +

- p -

+
+
+ + + + diff --git a/docs/html/functions_r.html b/docs/html/functions_r.html new file mode 100644 index 000000000..0e5daf52f --- /dev/null +++ b/docs/html/functions_r.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:
+ +

- r -

+
+
+ + + + diff --git a/docs/html/functions_s.html b/docs/html/functions_s.html new file mode 100644 index 000000000..144d7a356 --- /dev/null +++ b/docs/html/functions_s.html @@ -0,0 +1,132 @@ + + + + + + + +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..334bc9853 --- /dev/null +++ b/docs/html/functions_t.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:
+ +

- t -

+
+
+ + + + diff --git a/docs/html/functions_u.html b/docs/html/functions_u.html new file mode 100644 index 000000000..fd8aff0b8 --- /dev/null +++ b/docs/html/functions_u.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:
+ +

- u -

+
+
+ + + + diff --git a/docs/html/functions_v.html b/docs/html/functions_v.html new file mode 100644 index 000000000..42e0f0dad --- /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..ebb5a5c83 --- /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
+
+
+
+
+ +
+  + +

- 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..0038548e1 --- /dev/null +++ b/docs/html/functions_w.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:
+ +

- w -

+
+
+ + + + diff --git a/docs/html/group___connections.html b/docs/html/group___connections.html new file mode 100644 index 000000000..62a27efd8 --- /dev/null +++ b/docs/html/group___connections.html @@ -0,0 +1,502 @@ + + + + + + + +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
 
+ + + + + +

+Typedefs

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

+Functions

float sind (float x)
 
float cosd (float x)
 
glm::mat4x3 RotateUp (glm::vec3 up)
 
int CCW (glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol)
 
std::vector< glm::ivec3 > Triangulate (const Polygons &polygons, float 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. More...
 
+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.

+
+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.

+
+ +
+
+ +

◆ manifold::Smoothness

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

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

+
+ + + + + + + +
Class Members
+int +halfedge +The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i].
+float +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
+float +surfaceArea +
+float +volume +
+ +
+
+

Typedef Documentation

+ +

◆ SimplePolygon

+ +
+
+ + + + +
using SimplePolygon = std::vector<glm::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< glm::ivec3 > Triangulate (const Polygonspolygons,
float 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<glm::ivec3> The triangles, referencing the original polygon points in order.
+ +
+
+ +

◆ sind()

+ +
+
+ + + + + +
+ + + + + + + + +
float sind (float x)
+
+inline
+
+

Sine function where multiples of 90 degrees come out exact.

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

◆ cosd()

+ +
+
+ + + + + +
+ + + + + + + + +
float cosd (float x)
+
+inline
+
+

Cosine function where multiples of 90 degrees come out exact.

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

◆ RotateUp()

+ +
+
+ + + + + +
+ + + + + + + + +
glm::mat4x3 RotateUp (glm::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 (glm::vec2 p0,
glm::vec2 p1,
glm::vec2 p2,
float 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.
+ +
+
+
+
+ + + + diff --git a/docs/html/group___connections.js b/docs/html/group___connections.js new file mode 100644 index 000000000..eddb14d6c --- /dev/null +++ b/docs/html/group___connections.js @@ -0,0 +1,78 @@ +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#abe99befaf9804cdadc31f0233bf4827a", null ], + [ "triVerts", "group___connections.html#a2e749255313f9e672d69b4a94bd8e73e", null ], + [ "vertNormal", "group___connections.html#a7e3e35f7f7302164b545e6ea8e7cc6a6", null ], + [ "halfedgeTangent", "group___connections.html#a496f746871d5d54cf13f1935b0e4fc66", null ], + [ "precision", "group___connections.html#acd76b1c12cd41083eeef7b6f09c32141", null ] + ] ], + [ "Smoothness", "group___connections.html#structmanifold_1_1_smoothness", [ + [ "halfedge", "group___connections.html#a92b70d1d84a0bf7e23f384f939dc426f", null ], + [ "smoothness", "group___connections.html#a6ebfae52291cc3b6f4e25043eaf14381", 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#a4e57b8d753c7850eafadadd5c6712d0f", null ], + [ "Size", "structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651", null ], + [ "Center", "structmanifold_1_1_box.html#aa2116eed911ac1b0277788b05b0f663f", null ], + [ "Scale", "structmanifold_1_1_box.html#ac60a4c17cace9263b70bf5e5c6f43b58", null ], + [ "Contains", "structmanifold_1_1_box.html#a1aa1ea08f35a830ecc80b2bc83c9bcce", null ], + [ "Contains", "structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d", null ], + [ "Union", "structmanifold_1_1_box.html#ac35d2842beedafce43f5ae4dea7aef3b", null ], + [ "Union", "structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd", null ], + [ "Transform", "structmanifold_1_1_box.html#a821dd8a461d5c6938968cd76125b2102", null ], + [ "operator+", "structmanifold_1_1_box.html#af972bb4de52bdc0a952d4a6907f53e67", null ], + [ "operator+=", "structmanifold_1_1_box.html#a994c4a973b15e5f2f7dbccb7b5dc19d4", null ], + [ "operator*", "structmanifold_1_1_box.html#a60e8048a284bf5f5de8bc93fe2e3b617", null ], + [ "operator*=", "structmanifold_1_1_box.html#af62267ab92ad369671e2cb34a296d4fc", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a0eae49109f2471de7546d95c273f3461", 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#a00ed04e729457429ca773061236a3bee", null ], + [ "Size", "structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71", null ], + [ "Area", "structmanifold_1_1_rect.html#a10d5618fa11db90402e29c30fbf50096", null ], + [ "Scale", "structmanifold_1_1_rect.html#ac60a4c17cace9263b70bf5e5c6f43b58", null ], + [ "Center", "structmanifold_1_1_rect.html#a04bdce0e30cdda6f80ccb5255a12f7df", null ], + [ "Contains", "structmanifold_1_1_rect.html#a348dcfe50700c6ff69c6fa7641f7537d", 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#af8cf47248b361c1f8eec6b22dedb4233", null ], + [ "Union", "structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70", null ], + [ "operator+", "structmanifold_1_1_rect.html#a3b80b2b8aa4ae73c6b4be29b7d4f09fc", null ], + [ "operator+=", "structmanifold_1_1_rect.html#a88e57e987bcbbc947831388b367fa036", null ], + [ "operator*", "structmanifold_1_1_rect.html#a2ef09e7a095674473637a34b26b4b389", null ], + [ "operator*=", "structmanifold_1_1_rect.html#aec959d2e100436dce6e226adb93ce9aa", null ], + [ "Transform", "structmanifold_1_1_rect.html#a3c4003d2fc5299530dcce7deb9df54a2", null ] + ] ], + [ "manifold::SimplePolygon", "group___connections.html#ga53c298f15c33cb04ef759cec45eaecd1", null ], + [ "manifold::Polygons", "group___connections.html#ga60a66d8ddacc086bb45d8afc37f646d1", null ], + [ "manifold::Triangulate", "group___connections.html#ga1d01ff53289da0842e539ddf8cda5c96", null ], + [ "manifold::sind", "group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3", null ], + [ "manifold::cosd", "group___connections.html#ga502f5a841d8d1fcba289e167a1177bda", null ], + [ "manifold::RotateUp", "group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da", null ], + [ "manifold::CCW", "group___connections.html#ga20f946797231119dd2b7260c216cda31", 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..9f60e83d5 --- /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#abe99befaf9804cdadc31f0233bf4827a", null ], + [ "triVerts", "group___connections.html#a2e749255313f9e672d69b4a94bd8e73e", null ], + [ "vertNormal", "group___connections.html#a7e3e35f7f7302164b545e6ea8e7cc6a6", null ], + [ "halfedgeTangent", "group___connections.html#a496f746871d5d54cf13f1935b0e4fc66", null ], + [ "precision", "group___connections.html#acd76b1c12cd41083eeef7b6f09c32141", 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..68dd4f12a --- /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#a92b70d1d84a0bf7e23f384f939dc426f", null ], + [ "smoothness", "group___connections.html#a6ebfae52291cc3b6f4e25043eaf14381", 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..88a74dd99 --- /dev/null +++ b/docs/html/group___core.html @@ -0,0 +1,226 @@ + + + + + + + +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 + }
 
+ + + +

+Functions

Mesh LevelSet (std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, 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()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Mesh LevelSet (std::function< float(glm::vec3)> sdf,
Box bounds,
float edgeLength,
float level,
bool canParallel 
)
+
+

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
+ + + + + + +
sdfThe signed-distance functor, containing this function signature: float operator()(glm::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.
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.
+
+
+
Returns
Mesh This class does not depend on Manifold, so it just returns a Mesh, but it is guaranteed to be manifold and so can always be used as input to the Manifold constructor for further operations.
+ +
+
+
+
+ + + + diff --git a/docs/html/group___core.js b/docs/html/group___core.js new file mode 100644 index 000000000..6cfe5d18a --- /dev/null +++ b/docs/html/group___core.js @@ -0,0 +1,91 @@ +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#a106b1c0c300c4820cd9f5ec2f683a0db", null ], + [ "Rotate", "classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4", null ], + [ "Scale", "classmanifold_1_1_cross_section.html#af181324d8998fd89fa7a3e8bc7ef905c", null ], + [ "Mirror", "classmanifold_1_1_cross_section.html#adf67b7a277a85b21115f7063361da2ff", null ], + [ "Transform", "classmanifold_1_1_cross_section.html#af6b6f90c21018d47d860713c60a8399c", null ], + [ "Warp", "classmanifold_1_1_cross_section.html#a6c51d81d2e730c4a3325b4ba9b3ead39", 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#a5516d4d27772731e50540edd45553a4d", 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#a013e5ce70b14d7d19393bcdffbc73ce2", null ], + [ "Genus", "classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1", null ], + [ "GetProperties", "classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07", null ], + [ "OriginalID", "classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6", null ], + [ "AsOriginal", "classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57", null ], + [ "Translate", "classmanifold_1_1_manifold.html#ac1ebb85b775a3293bca68c2339762a08", null ], + [ "Scale", "classmanifold_1_1_manifold.html#ae06789ff9cbe03e56260538276dd8183", null ], + [ "Rotate", "classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629", null ], + [ "Transform", "classmanifold_1_1_manifold.html#a707b0078fbb9bbad183812d7290630ce", null ], + [ "Mirror", "classmanifold_1_1_manifold.html#a90bbf2842d0a2dc394d32f1a0a32c24a", null ], + [ "Warp", "classmanifold_1_1_manifold.html#aecb7b2e2a6a18a570154dec76658496c", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", 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#adc134d7a6dfbf8c74e5d531bbeb330cb", null ], + [ "TrimByPlane", "classmanifold_1_1_manifold.html#a1b711341093c115f6688cbcaae5c8741", 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 ], + [ "manifold::OpType", "group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969", null ], + [ "manifold::LevelSet", "group___core.html#ga7e9804ea4f23462a8a8bdec4fb826a73", 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..de4894ae6 --- /dev/null +++ b/docs/html/group___debug.html @@ -0,0 +1,264 @@ + + + + + + + +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 glm::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()

+ +
+
+ + + + + + + + +
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..9bb70341e --- /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 ] + ] ], + [ "manifold::ManifoldParams", "group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275", null ], + [ "manifold::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..6e7518f81 --- /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___mesh_i_o.html b/docs/html/group___mesh_i_o.html new file mode 100644 index 000000000..09acce551 --- /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
+float +roughness = 0.2 +Roughness value between 0 (shiny) and 1 (matte).
+float +metalness = 1 +Metalness value, generally either 0 (dielectric) or 1 (metal).
+vec4 +color = glm::vec4(1.0f) +

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 = glm::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 = glm::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..0590997ae --- /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#a2c76422d3e436164284a7dba0b8a9cc4", null ], + [ "metalness", "group___mesh_i_o.html#ad877087793da649b455041e10f4ed73f", null ], + [ "color", "group___mesh_i_o.html#af3f2d7fd6f40d5dd418aef858956a49b", null ], + [ "vertColor", "group___mesh_i_o.html#ad7e76077d824291218e32c0bdea9d3ff", null ], + [ "normalChannels", "group___mesh_i_o.html#afb46049a7293c3951d7c56b42701beaf", null ], + [ "colorChannels", "group___mesh_i_o.html#a0cb39f4007172ad6c0d647c9d0a5a4c7", 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 ] + ] ], + [ "manifold::ImportMesh", "group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0", null ], + [ "manifold::ExportMesh", "group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb", null ], + [ "manifold::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..5d534cbff --- /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#a2c76422d3e436164284a7dba0b8a9cc4", null ], + [ "metalness", "group___mesh_i_o.html#ad877087793da649b455041e10f4ed73f", null ], + [ "color", "group___mesh_i_o.html#af3f2d7fd6f40d5dd418aef858956a49b", null ], + [ "vertColor", "group___mesh_i_o.html#ad7e76077d824291218e32c0bdea9d3ff", null ], + [ "normalChannels", "group___mesh_i_o.html#afb46049a7293c3951d7c56b42701beaf", null ], + [ "colorChannels", "group___mesh_i_o.html#a0cb39f4007172ad6c0d647c9d0a5a4c7", 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..c91599706 --- /dev/null +++ b/docs/html/group___private.html @@ -0,0 +1,386 @@ + + + + + + + +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  strided_range< Iterator >
 
class  ConcurrentSharedPtr< T >
 
struct  UnionFind< I, R >
 
class  Vec< T >
 
class  VecView< T >
 
+ + + + + +

+Typedefs

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

+Functions

+glm::vec3 SafeNormalize (glm::vec3 v)
 
+float MaxPrecision (float minPrecision, const Box &bBox)
 
+int NextHalfedge (int current)
 
+glm::vec3 UVW (int vert, const glm::vec3 *barycentric)
 
+glm::mat3 NormalTransform (const glm::mat4x3 &transform)
 
glm::mat3x2 GetAxisAlignedProjection (glm::vec3 normal)
 
+glm::vec3 GetBarycentric (const glm::vec3 &v, const glm::mat3 &triPos, float precision)
 
std::vector< glm::ivec3 > TriangulateIdx (const PolygonsIdx &polys, float 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. More...
 
+void MemUsage ()
 
+template<typename... Iters>
thrust::zip_iterator< thrust::tuple< Iters... > > zip (Iters... iters)
 
+template<typename A , typename B >
thrust::permutation_iterator< A, B > perm (A a, B b)
 
+template<typename T >
thrust::counting_iterator< T > countAt (T i)
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+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 +
+vec3 +uvw +
+ +
+
+ +

◆ manifold::TriRef

+ +
+
+ + + + +
struct manifold::TriRef
+
+
+ + + + + + + + + + +
Class Members
+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.

+
+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.

+
+int +tri +

The triangle index of the original triangle this was part of: Mesh.triVerts[tri].

+
+ +
+
+ +

◆ 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()

+ +
+
+ + + + + +
+ + + + + + + + +
glm::mat3x2 GetAxisAlignedProjection (glm::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< glm::ivec3 > TriangulateIdx (const PolygonsIdx & polys,
float 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<glm::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..e2892971f --- /dev/null +++ b/docs/html/group___private.js @@ -0,0 +1,73 @@ +var group___private = +[ + [ "Collider", "classmanifold_1_1_collider.html", [ + [ "Collider", "classmanifold_1_1_collider.html#a669c441365fc439e52cd655edd70856d", null ], + [ "Transform", "classmanifold_1_1_collider.html#ab82200ff01af703f3dfe49a02dfb7e32", null ], + [ "UpdateBoxes", "classmanifold_1_1_collider.html#aa7a7428ba1ad21bb35acd27e4737aa45", null ], + [ "Collisions", "classmanifold_1_1_collider.html#a46782d8a38157f8011b0ecf273345739", null ] + ] ], + [ "Boolean3", "classmanifold_1_1_boolean3.html", null ], + [ "Manifold::Impl", "structmanifold_1_1_manifold_1_1_impl.html", [ + [ "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#aee0b0018dab5d2d37fcaf2452e0e2fad", null ], + [ "Impl", "structmanifold_1_1_manifold_1_1_impl.html#a0993c9acd8bdbd25672b9fae02c02c0f", null ], + [ "CreateHalfedges", "structmanifold_1_1_manifold_1_1_impl.html#aff973f757a74082c8fc75b0f8054557d", 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#afdc4c1c73cab15b3a13853d04fee567a", 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#a0ee79d083b1fb6b58801ebf83d47880d", null ], + [ "SetPrecision", "structmanifold_1_1_manifold_1_1_impl.html#a32981853ceaf771ca541df5b5c6e085b", 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#a9c45d5f57ab940c4a2682d6f11fdab40", 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#a18302b33e785225a5380814a9920f78a", null ], + [ "SimplifyTopology", "structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7", null ], + [ "CreateTangents", "structmanifold_1_1_manifold_1_1_impl.html#aa35fbb3d245eb24bdbd9e53d0660ad43", null ], + [ "Subdivide", "structmanifold_1_1_manifold_1_1_impl.html#ad593b78dd8d75c23f3fe0faf04501ceb", null ] + ] ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "TriRef", "group___private.html#structmanifold_1_1_tri_ref", [ + [ "meshID", "group___private.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "group___private.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "group___private.html#a15e0e24263c3a2cc742b9cfcbabedf88", null ] + ] ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", [ + [ "pos", "group___private.html#a6f4c30bf2e24353492937851cb470208", 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", [ + [ "firstNonFinite", "structmanifold_1_1_sparse_indices_1_1first_non_finite.html", null ] + ] ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "strided_range< Iterator >", "classmanifold_1_1strided__range.html", [ + [ "stride_functor", "structmanifold_1_1strided__range_1_1stride__functor.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 ], + [ "Vec< T >", "classmanifold_1_1_vec.html", null ], + [ "VecView< T >", "classmanifold_1_1_vec_view.html", null ], + [ "manifold::GetAxisAlignedProjection", "group___private.html#ga95945ec21500a4c02b449357b3ef57ec", null ], + [ "manifold::TriangulateIdx", "group___private.html#ga1e0bedc58e58ed72b02b49addf999b85", 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..678e1c9b2 --- /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#a6f4c30bf2e24353492937851cb470208", null ], + [ "idx", "group___private.html#ae40354a1051342eb5a9db005715dcfa9", null ] +]; \ No newline at end of file diff --git a/docs/html/group___private_structmanifold_1_1_tri_ref.js b/docs/html/group___private_structmanifold_1_1_tri_ref.js new file mode 100644 index 000000000..340a57979 --- /dev/null +++ b/docs/html/group___private_structmanifold_1_1_tri_ref.js @@ -0,0 +1,6 @@ +var group___private_structmanifold_1_1_tri_ref = +[ + [ "meshID", "group___private.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "group___private.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "group___private.html#a15e0e24263c3a2cc742b9cfcbabedf88", 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..dd0b58569 --- /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, float majorRadius, float minorRadius, float threadRadius, int circularSegments=0, int linearSegments=0)
 
Manifold StretchyBracelet (float radius=30.0f, float height=8.0f, float width=15.0f, float thickness=0.4f, int nDecor=20, int nCut=27, int nDivision=30)
 
Manifold MengerSponge (int n=3)
 
Manifold RoundedFrame (float edgeLength, float radius, int circularSegments=0)
 
Manifold TetPuzzle (float edgeLength, float gap, int nDivisions)
 
Manifold Scallop ()
 
Manifold GyroidModule (float 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,
float majorRadius,
float minorRadius,
float 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 (float radius,
float height,
float width,
float 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 (float edgeLength,
float 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 (float edgeLength,
float 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 (float 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..8a1876c0f --- /dev/null +++ b/docs/html/group___samples.js @@ -0,0 +1,10 @@ +var group___samples = +[ + [ "manifold::TorusKnot", "group___samples.html#ga1937d6fee956f401ad9a3c9c2dc6eae2", null ], + [ "manifold::StretchyBracelet", "group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3", null ], + [ "manifold::MengerSponge", "group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae", null ], + [ "manifold::RoundedFrame", "group___samples.html#ga8d224b44ea69ea070ebad60e6c1abbb9", null ], + [ "manifold::TetPuzzle", "group___samples.html#ga49162c3a42d672758d14855ad23258b9", null ], + [ "manifold::Scallop", "group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36", null ], + [ "manifold::GyroidModule", "group___samples.html#ga0a03a270aa7eff0866996c7abca5b0f0", 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..3c138bc7a --- /dev/null +++ b/docs/html/hashtable_8h_source.html @@ -0,0 +1,267 @@ + + + + + + + +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 "public.h"
+
20#include "utils.h"
+
21#include "vec.h"
+
22
+
23namespace {
+
24typedef unsigned long long int Uint64;
+
25typedef Uint64 (*hash_fun_t)(Uint64);
+
26inline constexpr Uint64 kOpen = std::numeric_limits<Uint64>::max();
+
27
+
28template <typename T>
+
29T AtomicCAS(T& target, T compare, T val) {
+
30 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
31 tar.compare_exchange_strong(compare, val, std::memory_order_acq_rel);
+
32 return compare;
+
33}
+
34
+
35template <typename T>
+
36void AtomicStore(T& target, T val) {
+
37 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
38 // release is good enough, although not really something general
+
39 tar.store(val, std::memory_order_release);
+
40}
+
41
+
42template <typename T>
+
43T AtomicLoad(const T& target) {
+
44 const std::atomic<T>& tar = reinterpret_cast<const std::atomic<T>&>(target);
+
45 // acquire is good enough, although not general
+
46 return tar.load(std::memory_order_acquire);
+
47}
+
48
+
49// https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key
+
50inline Uint64 hash64bit(Uint64 x) {
+
51 x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ull;
+
52 x = (x ^ (x >> 27)) * 0x94d049bb133111ebull;
+
53 x = x ^ (x >> 31);
+
54 return x;
+
55}
+
56} // namespace
+
57
+
58namespace manifold {
+
63template <typename V, hash_fun_t H = hash64bit>
+ +
65 public:
+
66 HashTableD(Vec<Uint64>& keys, Vec<V>& values, Vec<uint32_t>& used,
+
67 uint32_t step = 1)
+
68 : step_{step}, keys_{keys}, values_{values}, used_{used} {}
+
69
+
70 int Size() const { return keys_.size(); }
+
71
+
72 bool Full() const { return AtomicLoad(used_[0]) * 2 > Size(); }
+
73
+
74 void Insert(Uint64 key, const V& val) {
+
75 uint32_t idx = H(key) & (Size() - 1);
+
76 while (1) {
+
77 if (Full()) return;
+
78 Uint64& k = keys_[idx];
+
79 const Uint64 found = AtomicCAS(k, kOpen, key);
+
80 if (found == kOpen) {
+
81 AtomicAdd(used_[0], 0x1u);
+
82 values_[idx] = val;
+
83 return;
+
84 }
+
85 if (found == key) return;
+
86 idx = (idx + step_) & (Size() - 1);
+
87 }
+
88 }
+
89
+
90 V& operator[](Uint64 key) {
+
91 uint32_t idx = H(key) & (Size() - 1);
+
92 while (1) {
+
93 const Uint64 k = AtomicLoad(keys_[idx]);
+
94 if (k == key || k == kOpen) {
+
95 return values_[idx];
+
96 }
+
97 idx = (idx + step_) & (Size() - 1);
+
98 }
+
99 }
+
100
+
101 const V& operator[](Uint64 key) const {
+
102 uint32_t idx = H(key) & (Size() - 1);
+
103 while (1) {
+
104 const Uint64 k = AtomicLoad(keys_[idx]);
+
105 if (k == key || k == kOpen) {
+
106 return values_[idx];
+
107 }
+
108 idx = (idx + step_) & (Size() - 1);
+
109 }
+
110 }
+
111
+
112 Uint64 KeyAt(int idx) const { return AtomicLoad(keys_[idx]); }
+
113 V& At(int idx) { return values_[idx]; }
+
114 const V& At(int idx) const { return values_[idx]; }
+
115
+
116 private:
+
117 uint32_t step_;
+
118 VecView<Uint64> keys_;
+
119 VecView<V> values_;
+
120 VecView<uint32_t> used_;
+
121};
+
122
+
123template <typename V, hash_fun_t H = hash64bit>
+ +
125 public:
+
126 HashTable(uint32_t size, uint32_t step = 1)
+
127 : keys_{1 << (int)ceil(log2(size)), kOpen},
+
128 values_{1 << (int)ceil(log2(size)), {}},
+
129 table_{keys_, values_, used_, step} {}
+
130
+
131 HashTableD<V, H> D() { return table_; }
+
132
+
133 int Entries() const { return AtomicLoad(used_[0]); }
+
134
+
135 int Size() const { return table_.Size(); }
+
136
+
137 bool Full() const { return AtomicLoad(used_[0]) * 2 > Size(); }
+
138
+
139 float FilledFraction() const {
+
140 return static_cast<float>(AtomicLoad(used_[0])) / Size();
+
141 }
+
142
+
143 Vec<V>& GetValueStore() { return values_; }
+
144
+
145 static Uint64 Open() { return kOpen; }
+
146
+
147 private:
+
148 Vec<Uint64> keys_;
+
149 Vec<V> values_;
+
150 Vec<uint32_t> used_ = Vec<uint32_t>(1, 0);
+
151 HashTableD<V, H> table_;
+
152};
+
153
+
155} // namespace manifold
+
Definition: hashtable.h:64
+
Definition: hashtable.h:124
+
Definition: vec.h:139
+
Definition: vec.h:42
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html new file mode 100644 index 000000000..3e1052fce --- /dev/null +++ b/docs/html/hierarchy.html @@ -0,0 +1,207 @@ + + + + + + + +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]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 CBarycentric
 CBoolean3
 CBox
 CCollider
 CConcurrentSharedPtr< T >
 CConcurrentSharedPtr< Impl >
 CCrossSection
 CCubeVoid
 CEdge
 Cenable_shared_from_this
 CCsgNode
 CCsgLeafNode
 CCsgOpNode
 CExecutionParams
 CExportOptions
 CSparseIndices::firstNonFinite< T >
 CGyroidSDF
 CHalfedge
 CHalfedge2Tmp
 Chash< std::pair< int, int > >
 CHashTable< V, H >
 CHashTableD< V, H >
 CHashTableD< V, hash64bit >
 CManifold::Impl
 CLayers
 CManifold
 CManifoldIVec3
 CManifoldManifoldPair
 CManifoldProperties
 CManifoldVec2
 CManifoldVec3
 CManifoldVec4
 CMaterial
 CMesh
 CMeshGL
 CManifold::Impl::MeshRelationD
 CMeshSize
 COptions
 CPathImpl
 CPolyVert
 CProperties
 CQuality
 CRect
 CReindexEdge< inverted >
 CManifold::Impl::Relation
 Cruntime_error
 CgeometryErr
 CtopologyErr
 CuserErr
 CConcurrentSharedPtr< T >::SharedPtrGuard
 CSmoothness
 CSparseIndices
 Cstrided_range< Iterator >
 CTimer
 CTmpEdge
 CTmpInvalid
 CTriRef
 Ctype_caster< glm::vec3 >
 Cunary_function
 Cstrided_range< Iterator >::stride_functor
 CUnionFind< I, R >
 CVecView< T >
 CVec< int >
 CVec< glm::vec3 >
 CVec< manifold::Box >
 CVec< thrust::pair< int, int > >
 CVec< Uint64 >
 CVec< V >
 CVec< uint32_t >
 CVec< manifold::Halfedge >
 CVec< glm::vec4 >
 CVec< float >
 CVec< manifold::TriRef >
 CVec< glm::ivec3 >
 CVec< char >
 CVec< unsigned char >
 CVec< T >
 CVecView< char >
 CVecView< const manifold::TmpEdge >
 CVecView< float >
 CVecView< glm::ivec3 >
 CVecView< glm::vec3 >
 CVecView< glm::vec4 >
 CVecView< int >
 CVecView< manifold::Box >
 CVecView< manifold::Halfedge >
 CVecView< manifold::TriRef >
 CVecView< thrust::pair< int, int > >
 CVecView< uint32_t >
 CVecView< Uint64 >
 CVecView< unsigned char >
 CVecView< V >
+
+
+
+ + + + diff --git a/docs/html/hierarchy.js b/docs/html/hierarchy.js new file mode 100644 index 000000000..14325f1d8 --- /dev/null +++ b/docs/html/hierarchy.js @@ -0,0 +1,100 @@ +var hierarchy = +[ + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "Boolean3", "classmanifold_1_1_boolean3.html", null ], + [ "Box", "structmanifold_1_1_box.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 ], + [ "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 ] + ] ] + ] ], + [ "ExecutionParams", "group___debug.html#structmanifold_1_1_execution_params", null ], + [ "ExportOptions", "group___mesh_i_o.html#structmanifold_1_1_export_options", null ], + [ "SparseIndices::firstNonFinite< T >", "structmanifold_1_1_sparse_indices_1_1first_non_finite.html", null ], + [ "GyroidSDF", "struct_gyroid_s_d_f.html", null ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "Halfedge2Tmp", "structmanifold_1_1_halfedge2_tmp.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 ], + [ "HashTableD< V, hash64bit >", "classmanifold_1_1_hash_table_d.html", null ], + [ "Manifold::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 ], + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", null ], + [ "Manifold::Impl::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 ], + [ "Options", "struct_options.html", null ], + [ "PathImpl", "structmanifold_1_1_path_impl.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", null ], + [ "Properties", "group___connections.html#structmanifold_1_1_properties", null ], + [ "Quality", "classmanifold_1_1_quality.html", null ], + [ "Rect", "structmanifold_1_1_rect.html", null ], + [ "ReindexEdge< inverted >", "structmanifold_1_1_reindex_edge.html", null ], + [ "Manifold::Impl::Relation", "structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation", 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 ] + ] ], + [ "ConcurrentSharedPtr< T >::SharedPtrGuard", "classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html", null ], + [ "Smoothness", "group___connections.html#structmanifold_1_1_smoothness", null ], + [ "SparseIndices", "classmanifold_1_1_sparse_indices.html", null ], + [ "strided_range< Iterator >", "classmanifold_1_1strided__range.html", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "TmpInvalid", "structmanifold_1_1_tmp_invalid.html", null ], + [ "TriRef", "group___private.html#structmanifold_1_1_tri_ref", null ], + [ "type_caster< glm::vec3 >", "structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html", null ], + [ "unary_function", null, [ + [ "strided_range< Iterator >::stride_functor", "structmanifold_1_1strided__range_1_1stride__functor.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< glm::vec3 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::Box >", "classmanifold_1_1_vec.html", null ], + [ "Vec< thrust::pair< int, int > >", "classmanifold_1_1_vec.html", null ], + [ "Vec< Uint64 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< V >", "classmanifold_1_1_vec.html", null ], + [ "Vec< uint32_t >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::Halfedge >", "classmanifold_1_1_vec.html", null ], + [ "Vec< glm::vec4 >", "classmanifold_1_1_vec.html", null ], + [ "Vec< float >", "classmanifold_1_1_vec.html", null ], + [ "Vec< manifold::TriRef >", "classmanifold_1_1_vec.html", null ], + [ "Vec< glm::ivec3 >", "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::TmpEdge >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< float >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< glm::ivec3 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< glm::vec3 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< glm::vec4 >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< int >", "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< thrust::pair< int, int > >", "classmanifold_1_1_vec_view.html", null ], + [ "VecView< uint32_t >", "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 ] +]; \ 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..81a5fd726 --- /dev/null +++ b/docs/html/impl_8h_source.html @@ -0,0 +1,285 @@ + + + + + + + +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 "collider.h"
+
19#include "manifold.h"
+
20#include "optional_assert.h"
+
21#include "polygon.h"
+
22#include "shared.h"
+
23#include "sparse.h"
+
24#include "utils.h"
+
25#include "vec.h"
+
26
+
27namespace manifold {
+
28
+ +
31 struct Relation {
+
32 int originalID = -1;
+
33 glm::mat4x3 transform = glm::mat4x3(1);
+
34 bool backSide = false;
+
35 };
+ +
38 int originalID = -1;
+
39 int numProp = 0;
+
40 Vec<float> properties;
+
41 std::map<int, Relation> meshIDtransform;
+
42 Vec<TriRef> triRef;
+
43 Vec<glm::ivec3> triProperties;
+
44 };
+
45
+
46 Box bBox_;
+
47 float precision_ = -1;
+
48 Error status_ = Error::NoError;
+
49 Vec<glm::vec3> vertPos_;
+
50 Vec<Halfedge> halfedge_;
+
51 Vec<glm::vec3> vertNormal_;
+
52 Vec<glm::vec3> faceNormal_;
+
53 Vec<glm::vec4> halfedgeTangent_;
+
54 MeshRelationD meshRelation_;
+
55 Collider collider_;
+
56
+
57 static std::atomic<uint32_t> meshIDCounter_;
+
58 static uint32_t ReserveIDs(uint32_t);
+
59
+
60 Impl() {}
+
61 enum class Shape { Tetrahedron, Cube, Octahedron };
+
62 Impl(Shape);
+
63
+
64 Impl(const MeshGL&, std::vector<float> propertyTolerance = {});
+
65 Impl(const Mesh&, const MeshRelationD& relation,
+
66 const std::vector<float>& propertyTolerance = {},
+
67 bool hasFaceIDs = false);
+
68
+
69 void CreateFaces(const std::vector<float>& propertyTolerance = {});
+
70 void RemoveUnreferencedVerts(Vec<glm::ivec3>& triVerts);
+
71 void InitializeOriginal();
+
72 void CreateHalfedges(const Vec<glm::ivec3>& triVerts);
+
73 void CalculateNormals();
+
74 void IncrementMeshIDs();
+
75
+
76 void Update();
+
77 void MarkFailure(Error status);
+
78 void Warp(std::function<void(glm::vec3&)> warpFunc);
+
79 Impl Transform(const glm::mat4x3& transform) const;
+
80 SparseIndices EdgeCollisions(const Impl& B, bool inverted = false) const;
+
81 SparseIndices VertexCollisionsZ(VecView<const glm::vec3> vertsIn,
+
82 bool inverted = false) const;
+
83
+
84 bool IsEmpty() const { return NumVert() == 0; }
+
85 int NumVert() const { return vertPos_.size(); }
+
86 int NumEdge() const { return halfedge_.size() / 2; }
+
87 int NumTri() const { return halfedge_.size() / 3; }
+
88 int NumProp() const { return meshRelation_.numProp; }
+
89 int NumPropVert() const {
+
90 return NumProp() == 0 ? NumVert()
+
91 : meshRelation_.properties.size() / NumProp();
+
92 }
+
93
+
94 // properties.cu
+
95 Properties GetProperties() const;
+
96 void CalculateCurvature(int gaussianIdx, int meanIdx);
+
97 void CalculateBBox();
+
98 bool IsFinite() const;
+
99 bool IsIndexInBounds(VecView<const glm::ivec3> triVerts) const;
+
100 void SetPrecision(float minPrecision = -1);
+
101 bool IsManifold() const;
+
102 bool Is2Manifold() const;
+
103 bool MatchesTriNormals() const;
+
104 int NumDegenerateTris() const;
+
105
+
106 // sort.cu
+
107 void Finish();
+
108 void SortVerts();
+
109 void ReindexVerts(const Vec<int>& vertNew2Old, int numOldVert);
+
110 void CompactProps();
+
111 void GetFaceBoxMorton(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton) const;
+
112 void SortFaces(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton);
+
113 void GatherFaces(const Vec<int>& faceNew2Old);
+
114 void GatherFaces(const Impl& old, const Vec<int>& faceNew2Old);
+
115
+
116 // face_op.cu
+
117 void Face2Tri(const Vec<int>& faceEdge, const Vec<TriRef>& halfedgeRef);
+
118 PolygonsIdx Face2Polygons(int face, glm::mat3x2 projection,
+
119 const Vec<int>& faceEdge) const;
+
120
+
121 // edge_op.cu
+
122 void SimplifyTopology();
+
123 void DedupeEdge(int edge);
+
124 void CollapseEdge(int edge, std::vector<int>& edges);
+
125 void RecursiveEdgeSwap(int edge, int& tag, std::vector<int>& visited,
+
126 std::vector<int>& edgeSwapStack,
+
127 std::vector<int>& edges);
+
128 void RemoveIfFolded(int edge);
+
129 void PairUp(int edge0, int edge1);
+
130 void UpdateVert(int vert, int startEdge, int endEdge);
+
131 void FormLoop(int current, int end);
+
132 void CollapseTri(const glm::ivec3& triEdge);
+
133 void SplitPinchedVerts();
+
134
+
135 // smoothing.cu
+
136 void CreateTangents(const std::vector<Smoothness>&);
+
137 Vec<Barycentric> Subdivide(int n);
+
138 void Refine(int n);
+
139};
+
140} // namespace manifold
+
Definition: collider.h:23
+
Definition: vec.h:139
+
Definition: meshIO.h:20
+
Definition: public.h:168
+
Definition: impl.h:30
+
bool IsIndexInBounds(VecView< const glm::ivec3 > triVerts) const
Definition: properties.cpp:407
+
void IncrementMeshIDs()
Definition: impl.cpp:828
+
PolygonsIdx Face2Polygons(int face, glm::mat3x2 projection, const Vec< int > &faceEdge) const
Definition: face_op.cpp:197
+
bool IsManifold() const
Definition: properties.cpp:274
+
void SetPrecision(float minPrecision=-1)
Definition: impl.cpp:793
+
bool IsFinite() const
Definition: properties.cpp:396
+
void CalculateBBox()
Definition: properties.cpp:382
+
void SimplifyTopology()
Definition: edge_op.cpp:145
+
bool MatchesTriNormals() const
Definition: properties.cpp:302
+
bool Is2Manifold() const
Definition: properties.cpp:286
+
void SortVerts()
Definition: sort.cpp:302
+
void ReindexVerts(const Vec< int > &vertNew2Old, int numOldVert)
Definition: sort.cpp:340
+
void SortFaces(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)
Definition: sort.cpp:391
+
int originalID
The originalID of this Manifold if it is an original; -1 otherwise.
Definition: impl.h:38
+
void CreateTangents(const std::vector< Smoothness > &)
Definition: smoothing.cpp:324
+
void GatherFaces(const Vec< int > &faceNew2Old)
Definition: sort.cpp:421
+
Vec< Barycentric > Subdivide(int n)
Definition: smoothing.cpp:428
+
void CalculateNormals()
Definition: impl.cpp:809
+
void GetFaceBoxMorton(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) const
Definition: sort.cpp:378
+
void Update()
Definition: impl.cpp:697
+
void Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)
Definition: face_op.cpp:40
+
void CompactProps()
Definition: sort.cpp:351
+
void Finish()
Definition: sort.cpp:242
+
SparseIndices VertexCollisionsZ(VecView< const glm::vec3 > vertsIn, bool inverted=false) const
Definition: impl.cpp:878
+
int NumDegenerateTris() const
Definition: properties.cpp:311
+
SparseIndices EdgeCollisions(const Impl &B, bool inverted=false) const
Definition: impl.cpp:850
+
void CreateHalfedges(const Vec< glm::ivec3 > &triVerts)
Definition: impl.cpp:663
+ + +
Definition: manifold.h:46
+
+
+ + + + diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 000000000..2998415c5 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,128 @@ + + + + + + + +Manifold: WASM/JS Examples + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
WASM/JS Examples
+
+
+

This is the home of our editor, ManifoldCAD.org, as well as our other public examples of integrations with three.js, <model-viewer>, and glTF. Included are manifold-gltf.js and gltf-io.js, which are intended to be fairly general-purpose libraries for interfacing between manifolds and glTF. We should probably make them into their own npm package at some point.

+

+Local development

+

First, follow the directions in the root README to get your C++ build environment set up and working for WASM. From this directory (bindings/wasm/examples/) you can test the JS bindings by running:

+
npm install
+
npm test
+

To develop the manifoldCAD.org editor as well as our other example pages, run

npm run dev
+

which will serve the pages, watch for changes, and automatically rebuild and refresh. This build step doesn't do TS type-checking, so to verify everything is correct (beyond VSCode's TS linting), run

npm run build
+

See package.json for other useful scripts.

+

Note that the emcmake command automatically copies your WASM build into built/, (here, not just under the buildWASM directory) which is then packaged by Vite into dist/assets/.

+

To debug the WASM build directly in Chrome dev tools, simply build in debug mode:

emcmake cmake -DCMAKE_BUILD_TYPE=Debug .. && emmake make
+

and install the DWARF Chrome extension.

+

When testing ManifoldCAD.org (either locally or the deployed version) note that it uses a service worker for faster loading. This means you need to open the page twice to see updates (the first time loads the old version and caches the new one, the second time loads the new version from cache). To see changes on each reload, open Chrome dev tools, go to the Application tab and check "update on reload".

+

+Note for firefox users

+

To use the manifoldCAD.org editor (npm run dev), you'll likely have to set dom.workers.modules.enabled: true in your about:config, as mentioned in the discussion of the issue#328 of this repository.

+
+
+
+ + + + 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..56f62801b --- /dev/null +++ b/docs/html/manifold_8h_source.html @@ -0,0 +1,347 @@ + + + + + + + +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 "cross_section.h"
+
20#include "public.h"
+
21
+
22namespace manifold {
+
23
+
31ExecutionParams& ManifoldParams();
+
32
+
33class CsgNode;
+
34class CsgLeafNode;
+
35
+
46struct MeshGL {
+
48 uint32_t NumVert() const { return vertProperties.size() / numProp; };
+
50 uint32_t NumTri() const { return triVerts.size() / 3; };
+
51
+
53 uint32_t numProp = 3;
+
57 std::vector<float> vertProperties;
+
60 std::vector<uint32_t> triVerts;
+
63 std::vector<uint32_t> mergeFromVert;
+
67 std::vector<uint32_t> mergeToVert;
+
72 std::vector<uint32_t> runIndex;
+
78 std::vector<uint32_t> runOriginalID;
+
83 std::vector<float> runTransform;
+
91 std::vector<uint32_t> faceID;
+
96 std::vector<float> halfedgeTangent;
+
101 float precision = 0;
+
102
+
103 MeshGL() = default;
+
104 MeshGL(const Mesh& mesh);
+
105
+
106 bool Merge();
+
107};
+
114class Manifold {
+
115 public:
+
120 Manifold();
+
121 ~Manifold();
+
122 Manifold(const Manifold& other);
+
123 Manifold& operator=(const Manifold& other);
+
124 Manifold(Manifold&&) noexcept;
+
125 Manifold& operator=(Manifold&&) noexcept;
+
126
+
127 Manifold(const MeshGL&, const std::vector<float>& propertyTolerance = {});
+
128 Manifold(const Mesh&);
+
129
+
130 static Manifold Smooth(const MeshGL&,
+
131 const std::vector<Smoothness>& sharpenedEdges = {});
+
132 static Manifold Smooth(const Mesh&,
+
133 const std::vector<Smoothness>& sharpenedEdges = {});
+
134 static Manifold Tetrahedron();
+
135 static Manifold Cube(glm::vec3 size = glm::vec3(1.0f), bool center = false);
+
136 static Manifold Cylinder(float height, float radiusLow,
+
137 float radiusHigh = -1.0f, int circularSegments = 0,
+
138 bool center = false);
+
139 static Manifold Sphere(float radius, int circularSegments = 0);
+
140 static Manifold Extrude(const CrossSection& crossSection, float height,
+
141 int nDivisions = 0, float twistDegrees = 0.0f,
+
142 glm::vec2 scaleTop = glm::vec2(1.0f));
+
143 static Manifold Revolve(const CrossSection& crossSection,
+
144 int circularSegments = 0,
+
145 float revolveDegrees = 360.0f);
+
147
+
152 static Manifold Compose(const std::vector<Manifold>&);
+
153 std::vector<Manifold> Decompose() const;
+
155
+
160 Mesh GetMesh() const;
+
161 MeshGL GetMeshGL(glm::ivec3 normalIdx = glm::ivec3(0)) const;
+
162 bool IsEmpty() const;
+
163 enum class Error {
+
164 NoError,
+
165 NonFiniteVertex,
+
166 NotManifold,
+
167 VertexOutOfBounds,
+
168 PropertiesWrongLength,
+
169 MissingPositionProperties,
+
170 MergeVectorsDifferentLengths,
+
171 MergeIndexOutOfBounds,
+
172 TransformWrongLength,
+
173 RunIndexWrongLength,
+
174 FaceIDWrongLength,
+
175 InvalidConstruction,
+
176 };
+
177 Error Status() const;
+
178 int NumVert() const;
+
179 int NumEdge() const;
+
180 int NumTri() const;
+
181 int NumProp() const;
+
182 int NumPropVert() const;
+
183 Box BoundingBox() const;
+
184 float Precision() const;
+
185 int Genus() const;
+ +
188
+
194 int OriginalID() const;
+
195 Manifold AsOriginal() const;
+
196 static uint32_t ReserveIDs(uint32_t);
+
198
+
202 Manifold Translate(glm::vec3) const;
+
203 Manifold Scale(glm::vec3) const;
+
204 Manifold Rotate(float xDegrees, float yDegrees = 0.0f,
+
205 float zDegrees = 0.0f) const;
+
206 Manifold Transform(const glm::mat4x3&) const;
+
207 Manifold Mirror(glm::vec3) const;
+
208 Manifold Warp(std::function<void(glm::vec3&)>) const;
+ +
210 int, std::function<void(float*, glm::vec3, const float*)>) const;
+
211 Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const;
+
212 Manifold Refine(int) const;
+
213 // Manifold RefineToLength(float);
+
214 // Manifold RefineToPrecision(float);
+
216
+
221 Manifold Boolean(const Manifold& second, OpType op) const;
+
222 static Manifold BatchBoolean(const std::vector<Manifold>& manifolds,
+
223 OpType op);
+
224 // Boolean operation shorthand
+
225 Manifold operator+(const Manifold&) const; // Add (Union)
+ +
227 Manifold operator-(const Manifold&) const; // Subtract (Difference)
+ +
229 Manifold operator^(const Manifold&) const; // Intersect
+ +
231 std::pair<Manifold, Manifold> Split(const Manifold&) const;
+
232 std::pair<Manifold, Manifold> SplitByPlane(glm::vec3 normal,
+
233 float originOffset) const;
+
234 Manifold TrimByPlane(glm::vec3 normal, float originOffset) const;
+
236
+
237 Manifold Hull() const;
+
238 static Manifold Hull(const std::vector<Manifold>& manifolds);
+
239 static Manifold Hull(const std::vector<glm::vec3>& pts);
+
240
+
245 bool MatchesTriNormals() const;
+
246 int NumDegenerateTris() const;
+
247 int NumOverlaps(const Manifold& second) const;
+
249
+
250 struct Impl;
+
251
+
252 private:
+
253 Manifold(std::shared_ptr<CsgNode> pNode_);
+
254 Manifold(std::shared_ptr<Impl> pImpl_);
+
255 static Manifold Invalid();
+
256 mutable std::shared_ptr<CsgNode> pNode_;
+
257
+
258 CsgLeafNode& GetCsgLeafNode() const;
+
259};
+
261} // namespace manifold
+
Definition: cross_section.h:39
+
Definition: csg_tree.h:41
+
Definition: manifold.h:114
+
float Precision() const
Definition: manifold.cpp:401
+
int NumOverlaps(const Manifold &second) const
Definition: manifold.cpp:480
+
int NumEdge() const
Definition: manifold.cpp:371
+
Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const
Definition: manifold.cpp:637
+
Manifold SetProperties(int, std::function< void(float *, glm::vec3, const float *)>) const
Definition: manifold.cpp:580
+
Manifold TrimByPlane(glm::vec3 normal, float originOffset) const
Definition: manifold.cpp:776
+
static uint32_t ReserveIDs(uint32_t)
Definition: manifold.cpp:452
+
static Manifold Sphere(float radius, int circularSegments=0)
Definition: constructors.cpp:204
+
Box BoundingBox() const
Definition: manifold.cpp:392
+
Error Status() const
Definition: manifold.cpp:361
+
static Manifold Cube(glm::vec3 size=glm::vec3(1.0f), bool center=false)
Definition: constructors.cpp:151
+
int NumProp() const
Definition: manifold.cpp:379
+
int NumTri() const
Definition: manifold.cpp:375
+
int Genus() const
Definition: manifold.cpp:410
+
Manifold & operator+=(const Manifold &)
Definition: manifold.cpp:699
+
Manifold Rotate(float xDegrees, float yDegrees=0.0f, float zDegrees=0.0f) const
Definition: manifold.cpp:522
+
MeshGL GetMeshGL(glm::ivec3 normalIdx=glm::ivec3(0)) const
Definition: manifold.cpp:191
+
Manifold Refine(int) const
Definition: manifold.cpp:653
+
std::pair< Manifold, Manifold > Split(const Manifold &) const
Definition: manifold.cpp:741
+
bool MatchesTriNormals() const
Definition: manifold.cpp:461
+
int OriginalID() const
Definition: manifold.cpp:427
+
Manifold Transform(const glm::mat4x3 &) const
Definition: manifold.cpp:534
+
Mesh GetMesh() const
Definition: manifold.cpp:157
+
std::vector< Manifold > Decompose() const
Definition: constructors.cpp:469
+
int NumVert() const
Definition: manifold.cpp:367
+
Manifold & operator^=(const Manifold &)
Definition: manifold.cpp:729
+
bool IsEmpty() const
Definition: manifold.cpp:352
+
Manifold Mirror(glm::vec3) const
Definition: manifold.cpp:546
+
static Manifold Compose(const std::vector< Manifold > &)
Definition: constructors.cpp:456
+
Manifold Boolean(const Manifold &second, OpType op) const
Definition: manifold.cpp:673
+
Manifold AsOriginal() const
Definition: manifold.cpp:437
+
Manifold Hull() const
Definition: manifold.cpp:817
+
int NumPropVert() const
Definition: manifold.cpp:385
+
static Manifold Revolve(const CrossSection &crossSection, int circularSegments=0, float revolveDegrees=360.0f)
Definition: constructors.cpp:324
+
Manifold Translate(glm::vec3) const
Definition: manifold.cpp:496
+
static Manifold Extrude(const CrossSection &crossSection, float height, int nDivisions=0, float twistDegrees=0.0f, glm::vec2 scaleTop=glm::vec2(1.0f))
Definition: constructors.cpp:238
+
Properties GetProperties() const
Definition: manifold.cpp:418
+
static Manifold Cylinder(float height, float radiusLow, float radiusHigh=-1.0f, int circularSegments=0, bool center=false)
Definition: constructors.cpp:175
+
Manifold operator^(const Manifold &) const
Definition: manifold.cpp:722
+
Manifold()
Definition: manifold.cpp:83
+
Manifold operator-(const Manifold &) const
Definition: manifold.cpp:707
+
std::pair< Manifold, Manifold > SplitByPlane(glm::vec3 normal, float originOffset) const
Definition: manifold.cpp:762
+
Manifold Scale(glm::vec3) const
Definition: manifold.cpp:506
+
Manifold & operator-=(const Manifold &)
Definition: manifold.cpp:714
+
Manifold Warp(std::function< void(glm::vec3 &)>) const
Definition: manifold.cpp:564
+
Manifold operator+(const Manifold &) const
Definition: manifold.cpp:692
+
static Manifold Tetrahedron()
Definition: constructors.cpp:139
+
int NumDegenerateTris() const
Definition: manifold.cpp:470
+
static Manifold Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})
Definition: constructors.cpp:81
+
Definition: public.h:126
+
Definition: public.h:164
+
OpType
Definition: public.h:490
+
ExecutionParams & ManifoldParams()
Definition: manifold.cpp:780
+
Definition: meshIO.h:20
+
Definition: public.h:168
+
Definition: impl.h:30
+
Definition: manifold.h:46
+
std::vector< uint32_t > runIndex
Definition: manifold.h:72
+
bool Merge()
Definition: sort.cpp:512
+
uint32_t NumVert() const
Number of property vertices.
Definition: manifold.h:48
+
std::vector< float > runTransform
Definition: manifold.h:83
+
uint32_t NumTri() const
Number of triangles.
Definition: manifold.h:50
+
std::vector< float > halfedgeTangent
Definition: manifold.h:96
+
std::vector< uint32_t > mergeFromVert
Definition: manifold.h:63
+
std::vector< float > vertProperties
Definition: manifold.h:57
+
std::vector< uint32_t > runOriginalID
Definition: manifold.h:78
+
std::vector< uint32_t > faceID
Definition: manifold.h:91
+
float precision
Definition: manifold.h:101
+
uint32_t numProp
Number of properties per vertex, always >= 3.
Definition: manifold.h:53
+
std::vector< uint32_t > mergeToVert
Definition: manifold.h:67
+
std::vector< uint32_t > triVerts
Definition: manifold.h:60
+
+
+ + + + diff --git a/docs/html/manifoldc_8h_source.html b/docs/html/manifoldc_8h_source.html new file mode 100644 index 000000000..e870ac3a0 --- /dev/null +++ b/docs/html/manifoldc_8h_source.html @@ -0,0 +1,545 @@ + + + + + + + +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 "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);
+
54
+
55// SDF
+
56// By default, the execution policy (sequential or parallel) of
+
57// manifold_level_set will be chosen automatically depending on the size of the
+
58// job and whether Manifold has been compiled with a PAR backend. If you are
+
59// using these bindings from a language that has a runtime lock preventing the
+
60// parallel execution of closures, then you should use manifold_level_set_seq to
+
61// force sequential execution.
+
62ManifoldMeshGL *manifold_level_set(void *mem, float (*sdf)(float, float, float),
+
63 ManifoldBox *bounds, float edge_length,
+
64 float level);
+
65ManifoldMeshGL *manifold_level_set_seq(void *mem,
+
66 float (*sdf)(float, float, float),
+
67 ManifoldBox *bounds, float edge_length,
+
68 float level);
+
69// The _context variants of manifold_level_set allow a pointer to be passed
+
70// back to each invocation of the sdf function pointer, for languages that
+
71// need additional data.
+
72ManifoldMeshGL *manifold_level_set_context(
+
73 void *mem, float (*sdf)(float, float, float, void *), ManifoldBox *bounds,
+
74 float edge_length, float level, void *ctx);
+
75ManifoldMeshGL *manifold_level_set_seq_context(
+
76 void *mem, float (*sdf)(float, float, float, void *), ManifoldBox *bounds,
+
77 float edge_length, float level, void *ctx);
+
78
+
79// Manifold Vectors
+
80
+
81ManifoldManifoldVec *manifold_manifold_empty_vec(void *mem);
+
82ManifoldManifoldVec *manifold_manifold_vec(void *mem, size_t sz);
+
83void manifold_manifold_vec_reserve(ManifoldManifoldVec *ms, size_t sz);
+
84size_t manifold_manifold_vec_length(ManifoldManifoldVec *ms);
+
85ManifoldManifold *manifold_manifold_vec_get(void *mem, ManifoldManifoldVec *ms,
+
86 int idx);
+
87void manifold_manifold_vec_set(ManifoldManifoldVec *ms, int idx,
+
88 ManifoldManifold *m);
+
89void manifold_manifold_vec_push_back(ManifoldManifoldVec *ms,
+
90 ManifoldManifold *m);
+
91
+
92// Manifold Booleans
+
93
+
94ManifoldManifold *manifold_boolean(void *mem, ManifoldManifold *a,
+
95 ManifoldManifold *b, ManifoldOpType op);
+
96ManifoldManifold *manifold_batch_boolean(void *mem, ManifoldManifoldVec *ms,
+
97 ManifoldOpType op);
+
98ManifoldManifold *manifold_union(void *mem, ManifoldManifold *a,
+
99 ManifoldManifold *b);
+
100ManifoldManifold *manifold_difference(void *mem, ManifoldManifold *a,
+
101 ManifoldManifold *b);
+
102ManifoldManifold *manifold_intersection(void *mem, ManifoldManifold *a,
+
103 ManifoldManifold *b);
+
104ManifoldManifoldPair manifold_split(void *mem_first, void *mem_second,
+
105 ManifoldManifold *a, ManifoldManifold *b);
+
106ManifoldManifoldPair manifold_split_by_plane(void *mem_first, void *mem_second,
+
107 ManifoldManifold *m,
+
108 float normal_x, float normal_y,
+
109 float normal_z, float offset);
+
110ManifoldManifold *manifold_trim_by_plane(void *mem, ManifoldManifold *m,
+
111 float normal_x, float normal_y,
+
112 float normal_z, float offset);
+
113
+
114// Convex Hulls
+
115
+
116ManifoldManifold *manifold_hull(void *mem, ManifoldManifold *m);
+
117ManifoldManifold *manifold_batch_hull(void *mem, ManifoldManifoldVec *ms);
+
118ManifoldManifold *manifold_hull_pts(void *mem, ManifoldVec3 *ps, size_t length);
+
119
+
120// Manifold Transformations
+
121
+
122ManifoldManifold *manifold_translate(void *mem, ManifoldManifold *m, float x,
+
123 float y, float z);
+
124ManifoldManifold *manifold_rotate(void *mem, ManifoldManifold *m, float x,
+
125 float y, float z);
+
126ManifoldManifold *manifold_scale(void *mem, ManifoldManifold *m, float x,
+
127 float y, float z);
+
128ManifoldManifold *manifold_transform(void *mem, ManifoldManifold *m, float x1,
+
129 float y1, float z1, float x2, float y2,
+
130 float z2, float x3, float y3, float z3,
+
131 float x4, float y4, float z4);
+
132ManifoldManifold *manifold_mirror(void *mem, ManifoldManifold *m, float nx,
+
133 float ny, float nz);
+
134ManifoldManifold *manifold_warp(void *mem, ManifoldManifold *m,
+
135 ManifoldVec3 (*fun)(float, float, float));
+
136ManifoldManifold *manifold_refine(void *mem, ManifoldManifold *m, int refine);
+
137
+
138// Manifold Shapes / Constructors
+
139
+
140ManifoldManifold *manifold_empty(void *mem);
+
141ManifoldManifold *manifold_copy(void *mem, ManifoldManifold *m);
+
142ManifoldManifold *manifold_tetrahedron(void *mem);
+
143ManifoldManifold *manifold_cube(void *mem, float x, float y, float z,
+
144 int center);
+
145ManifoldManifold *manifold_cylinder(void *mem, float height, float radius_low,
+
146 float radius_high, int circular_segments,
+
147 int center);
+
148ManifoldManifold *manifold_sphere(void *mem, float radius,
+
149 int circular_segments);
+
150ManifoldManifold *manifold_of_meshgl(void *mem, ManifoldMeshGL *mesh);
+
151ManifoldManifold *manifold_smooth(void *mem, ManifoldMeshGL *mesh,
+
152 int *half_edges, float *smoothness,
+
153 int n_idxs);
+
154ManifoldManifold *manifold_extrude(void *mem, ManifoldCrossSection *cs,
+
155 float height, int slices,
+
156 float twist_degrees, float scale_x,
+
157 float scale_y);
+
158ManifoldManifold *manifold_revolve(void *mem, ManifoldCrossSection *cs,
+
159 int circular_segments);
+
160ManifoldManifold *manifold_compose(void *mem, ManifoldManifoldVec *ms);
+
161ManifoldManifoldVec *manifold_decompose(void *mem, ManifoldManifold *m);
+
162ManifoldManifold *manifold_as_original(void *mem, ManifoldManifold *m);
+
163
+
164// Manifold Info
+
165
+
166int manifold_is_empty(ManifoldManifold *m);
+
167ManifoldError manifold_status(ManifoldManifold *m);
+
168int manifold_num_vert(ManifoldManifold *m);
+
169int manifold_num_edge(ManifoldManifold *m);
+
170int manifold_num_tri(ManifoldManifold *m);
+
171ManifoldBox *manifold_bounding_box(void *mem, ManifoldManifold *m);
+
172float manifold_precision(ManifoldManifold *m);
+
173int manifold_genus(ManifoldManifold *m);
+
174ManifoldProperties manifold_get_properties(ManifoldManifold *m);
+
175int manifold_get_circular_segments(float radius);
+
176int manifold_original_id(ManifoldManifold *m);
+
177uint32_t manifold_reserve_ids(uint32_t n);
+
178ManifoldManifold *manifold_set_properties(
+
179 void *mem, ManifoldManifold *m, int num_prop,
+
180 void (*fun)(float *new_prop, ManifoldVec3 position, const float *old_prop));
+
181ManifoldManifold *manifold_calculate_curvature(void *mem, ManifoldManifold *m,
+
182 int gaussian_idx, int mean_idx);
+
183
+
184// CrossSection Shapes/Constructors
+
185
+
186ManifoldCrossSection *manifold_cross_section_empty(void *mem);
+
187ManifoldCrossSection *manifold_cross_section_copy(void *mem,
+
188 ManifoldCrossSection *cs);
+
189ManifoldCrossSection *manifold_cross_section_of_simple_polygon(
+
190 void *mem, ManifoldSimplePolygon *p, ManifoldFillRule fr);
+
191ManifoldCrossSection *manifold_cross_section_of_polygons(void *mem,
+
192 ManifoldPolygons *p,
+
193 ManifoldFillRule fr);
+
194ManifoldCrossSection *manifold_cross_section_square(void *mem, float x, float y,
+
195 int center);
+
196ManifoldCrossSection *manifold_cross_section_circle(void *mem, float radius,
+
197 int circular_segments);
+
198ManifoldCrossSection *manifold_cross_section_compose(
+
199 void *mem, ManifoldCrossSectionVec *csv);
+
200ManifoldCrossSectionVec *manifold_cross_section_decompose(
+
201 void *mem, ManifoldCrossSection *cs);
+
202
+
203// CrossSection Vectors
+
204
+
205ManifoldCrossSectionVec *manifold_cross_section_empty_vec(void *mem);
+
206ManifoldCrossSectionVec *manifold_cross_section_vec(void *mem, size_t sz);
+
207void manifold_cross_section_vec_reserve(ManifoldCrossSectionVec *csv,
+
208 size_t sz);
+
209size_t manifold_cross_section_vec_length(ManifoldCrossSectionVec *csv);
+
210ManifoldCrossSection *manifold_cross_section_vec_get(
+
211 void *mem, ManifoldCrossSectionVec *csv, int idx);
+
212void manifold_cross_section_vec_set(ManifoldCrossSectionVec *csv, int idx,
+
213 ManifoldCrossSection *cs);
+
214void manifold_cross_section_vec_push_back(ManifoldCrossSectionVec *csv,
+
215 ManifoldCrossSection *cs);
+
216
+
217// CrossSection Booleans
+
218
+
219ManifoldCrossSection *manifold_cross_section_boolean(void *mem,
+
220 ManifoldCrossSection *a,
+
221 ManifoldCrossSection *b,
+
222 ManifoldOpType op);
+
223ManifoldCrossSection *manifold_cross_section_batch_boolean(
+
224 void *mem, ManifoldCrossSectionVec *csv, ManifoldOpType op);
+
225ManifoldCrossSection *manifold_cross_section_union(void *mem,
+
226 ManifoldCrossSection *a,
+
227 ManifoldCrossSection *b);
+
228ManifoldCrossSection *manifold_cross_section_difference(
+
229 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
230ManifoldCrossSection *manifold_cross_section_intersection(
+
231 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
232
+
233// CrossSection Convex Hulls
+
234
+
235ManifoldCrossSection *manifold_cross_section_hull(void *mem,
+
236 ManifoldCrossSection *cs);
+
237ManifoldCrossSection *manifold_cross_section_batch_hull(
+
238 void *mem, ManifoldCrossSectionVec *css);
+
239ManifoldCrossSection *manifold_cross_section_hull_simple_polygon(
+
240 void *mem, ManifoldSimplePolygon *ps);
+
241ManifoldCrossSection *manifold_cross_section_hull_polygons(
+
242 void *mem, ManifoldPolygons *ps);
+
243
+
244// CrossSection Transformation
+
245
+
246ManifoldCrossSection *manifold_cross_section_translate(void *mem,
+
247 ManifoldCrossSection *cs,
+
248 float x, float y);
+
249ManifoldCrossSection *manifold_cross_section_rotate(void *mem,
+
250 ManifoldCrossSection *cs,
+
251 float deg);
+
252ManifoldCrossSection *manifold_cross_section_scale(void *mem,
+
253 ManifoldCrossSection *cs,
+
254 float x, float y);
+
255ManifoldCrossSection *manifold_cross_section_mirror(void *mem,
+
256 ManifoldCrossSection *cs,
+
257 float ax_x, float ax_y);
+
258ManifoldCrossSection *manifold_cross_section_transform(void *mem,
+
259 ManifoldCrossSection *cs,
+
260 float x1, float y1,
+
261 float x2, float y2,
+
262 float x3, float y3);
+
263ManifoldCrossSection *manifold_cross_section_warp(
+
264 void *mem, ManifoldCrossSection *cs, ManifoldVec2 (*fun)(float, float));
+
265ManifoldCrossSection *manifold_cross_section_simplify(void *mem,
+
266 ManifoldCrossSection *cs,
+
267 double epsilon);
+
268ManifoldCrossSection *manifold_cross_section_offset(
+
269 void *mem, ManifoldCrossSection *cs, double delta, ManifoldJoinType jt,
+
270 double miter_limit, int circular_segments);
+
271
+
272// CrossSection Info
+
273
+
274double manifold_cross_section_area(ManifoldCrossSection *cs);
+
275int manifold_cross_section_num_vert(ManifoldCrossSection *cs);
+
276int manifold_cross_section_num_contour(ManifoldCrossSection *cs);
+
277int manifold_cross_section_is_empty(ManifoldCrossSection *cs);
+
278ManifoldRect *manifold_cross_section_bounds(void *mem,
+
279 ManifoldCrossSection *cs);
+
280ManifoldPolygons *manifold_cross_section_to_polygons(void *mem,
+
281 ManifoldCrossSection *cs);
+
282
+
283// Rectangle
+
284
+
285ManifoldRect *manifold_rect(void *mem, float x1, float y1, float x2, float y2);
+
286ManifoldVec2 manifold_rect_min(ManifoldRect *r);
+
287ManifoldVec2 manifold_rect_max(ManifoldRect *r);
+
288ManifoldVec2 manifold_rect_dimensions(ManifoldRect *r);
+
289ManifoldVec2 manifold_rect_center(ManifoldRect *r);
+
290float manifold_rect_scale(ManifoldRect *r);
+
291int manifold_rect_contains_pt(ManifoldRect *r, float x, float y);
+
292int manifold_rect_contains_rect(ManifoldRect *a, ManifoldRect *b);
+
293void manifold_rect_include_pt(ManifoldRect *r, float x, float y);
+
294ManifoldRect *manifold_rect_union(void *mem, ManifoldRect *a, ManifoldRect *b);
+
295ManifoldRect *manifold_rect_transform(void *mem, ManifoldRect *r, float x1,
+
296 float y1, float x2, float y2, float x3,
+
297 float y3);
+
298ManifoldRect *manifold_rect_translate(void *mem, ManifoldRect *r, float x,
+
299 float y);
+
300ManifoldRect *manifold_rect_mul(void *mem, ManifoldRect *r, float x, float y);
+
301int manifold_rect_does_overlap_rect(ManifoldRect *a, ManifoldRect *r);
+
302int manifold_rect_is_empty(ManifoldRect *r);
+
303int manifold_rect_is_finite(ManifoldRect *r);
+
304
+
305// Bounding Box
+
306
+
307ManifoldBox *manifold_box(void *mem, float x1, float y1, float z1, float x2,
+
308 float y2, float z2);
+
309ManifoldVec3 manifold_box_min(ManifoldBox *b);
+
310ManifoldVec3 manifold_box_max(ManifoldBox *b);
+
311ManifoldVec3 manifold_box_dimensions(ManifoldBox *b);
+
312ManifoldVec3 manifold_box_center(ManifoldBox *b);
+
313float manifold_box_scale(ManifoldBox *b);
+
314int manifold_box_contains_pt(ManifoldBox *b, float x, float y, float z);
+
315int manifold_box_contains_box(ManifoldBox *a, ManifoldBox *b);
+
316void manifold_box_include_pt(ManifoldBox *b, float x, float y, float z);
+
317ManifoldBox *manifold_box_union(void *mem, ManifoldBox *a, ManifoldBox *b);
+
318ManifoldBox *manifold_box_transform(void *mem, ManifoldBox *b, float x1,
+
319 float y1, float z1, float x2, float y2,
+
320 float z2, float x3, float y3, float z3,
+
321 float x4, float y4, float z4);
+
322ManifoldBox *manifold_box_translate(void *mem, ManifoldBox *b, float x, float y,
+
323 float z);
+
324ManifoldBox *manifold_box_mul(void *mem, ManifoldBox *b, float x, float y,
+
325 float z);
+
326int manifold_box_does_overlap_pt(ManifoldBox *b, float x, float y, float z);
+
327int manifold_box_does_overlap_box(ManifoldBox *a, ManifoldBox *b);
+
328int manifold_box_is_finite(ManifoldBox *b);
+
329
+
330// Static Quality Globals
+
331
+
332void manifold_set_min_circular_angle(float degrees);
+
333void manifold_set_min_circular_edge_length(float length);
+
334void manifold_set_circular_segments(int number);
+
335
+
336// Manifold Mesh Extraction
+
337
+
338int manifold_meshgl_num_prop(ManifoldMeshGL *m);
+
339int manifold_meshgl_num_vert(ManifoldMeshGL *m);
+
340int manifold_meshgl_num_tri(ManifoldMeshGL *m);
+
341size_t manifold_meshgl_vert_properties_length(ManifoldMeshGL *m);
+
342size_t manifold_meshgl_tri_length(ManifoldMeshGL *m);
+
343size_t manifold_meshgl_merge_length(ManifoldMeshGL *m);
+
344size_t manifold_meshgl_run_index_length(ManifoldMeshGL *m);
+
345size_t manifold_meshgl_run_original_id_length(ManifoldMeshGL *m);
+
346size_t manifold_meshgl_run_transform_length(ManifoldMeshGL *m);
+
347size_t manifold_meshgl_face_id_length(ManifoldMeshGL *m);
+
348size_t manifold_meshgl_tangent_length(ManifoldMeshGL *m);
+
349float *manifold_meshgl_vert_properties(void *mem, ManifoldMeshGL *m);
+
350uint32_t *manifold_meshgl_tri_verts(void *mem, ManifoldMeshGL *m);
+
351uint32_t *manifold_meshgl_merge_from_vert(void *mem, ManifoldMeshGL *m);
+
352uint32_t *manifold_meshgl_merge_to_vert(void *mem, ManifoldMeshGL *m);
+
353uint32_t *manifold_meshgl_run_index(void *mem, ManifoldMeshGL *m);
+
354uint32_t *manifold_meshgl_run_original_id(void *mem, ManifoldMeshGL *m);
+
355float *manifold_meshgl_run_transform(void *mem, ManifoldMeshGL *m);
+
356uint32_t *manifold_meshgl_face_id(void *mem, ManifoldMeshGL *m);
+
357float *manifold_meshgl_halfedge_tangent(void *mem, ManifoldMeshGL *m);
+
358
+
359// memory size
+
360
+
361size_t manifold_manifold_size();
+
362size_t manifold_manifold_vec_size();
+
363size_t manifold_cross_section_size();
+
364size_t manifold_cross_section_vec_size();
+
365size_t manifold_simple_polygon_size();
+
366size_t manifold_polygons_size();
+
367size_t manifold_manifold_pair_size();
+
368size_t manifold_meshgl_size();
+
369size_t manifold_box_size();
+
370size_t manifold_rect_size();
+
371size_t manifold_curvature_size();
+
372
+
373// destruction
+
374
+
375void manifold_destruct_manifold(ManifoldManifold *m);
+
376void manifold_destruct_manifold_vec(ManifoldManifoldVec *ms);
+
377void manifold_destruct_cross_section(ManifoldCrossSection *m);
+
378void manifold_destruct_cross_section_vec(ManifoldCrossSectionVec *csv);
+
379void manifold_destruct_simple_polygon(ManifoldSimplePolygon *p);
+
380void manifold_destruct_polygons(ManifoldPolygons *p);
+
381void manifold_destruct_meshgl(ManifoldMeshGL *m);
+
382void manifold_destruct_box(ManifoldBox *b);
+
383void manifold_destruct_rect(ManifoldRect *b);
+
384
+
385// pointer free + destruction
+
386
+
387void manifold_delete_manifold(ManifoldManifold *m);
+
388void manifold_delete_manifold_vec(ManifoldManifoldVec *ms);
+
389void manifold_delete_cross_section(ManifoldCrossSection *cs);
+
390void manifold_delete_cross_section_vec(ManifoldCrossSectionVec *csv);
+
391void manifold_delete_simple_polygon(ManifoldSimplePolygon *p);
+
392void manifold_delete_polygons(ManifoldPolygons *p);
+
393void manifold_delete_meshgl(ManifoldMeshGL *m);
+
394void manifold_delete_box(ManifoldBox *b);
+
395void manifold_delete_rect(ManifoldRect *b);
+
396
+
397// MeshIO / Export
+
398
+
399#ifdef MANIFOLD_EXPORT
+
400ManifoldMaterial *manifold_material(void *mem);
+
401void manifold_material_set_roughness(ManifoldMaterial *mat, float roughness);
+
402void manifold_material_set_metalness(ManifoldMaterial *mat, float metalness);
+
403void manifold_material_set_color(ManifoldMaterial *mat, ManifoldVec4 color);
+
404void manifold_material_set_vert_color(ManifoldMaterial *mat,
+
405 ManifoldVec4 *vert_color, size_t n_vert);
+
406ManifoldExportOptions *manifold_export_options(void *mem);
+
407void manifold_export_options_set_faceted(ManifoldExportOptions *options,
+
408 int faceted);
+
409void manifold_export_options_set_material(ManifoldExportOptions *options,
+
410 ManifoldMaterial *mat);
+
411void manifold_export_meshgl(const char *filename, ManifoldMeshGL *mesh,
+
412 ManifoldExportOptions *options);
+
413ManifoldMeshGL *manifold_import_meshgl(void *mem, const char *filename,
+
414 int force_cleanup);
+
415
+
416size_t manifold_material_size();
+
417size_t manifold_export_options_size();
+
418
+
419void manifold_destruct_material(ManifoldMaterial *m);
+
420void manifold_destruct_export_options(ManifoldExportOptions *options);
+
421
+
422void manifold_delete_material(ManifoldMaterial *m);
+
423void manifold_delete_export_options(ManifoldExportOptions *options);
+
424#endif
+
425
+
426#ifdef __cplusplus
+
427}
+
428#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..e273e908f --- /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/mesh__fixes_8h_source.html b/docs/html/mesh__fixes_8h_source.html new file mode 100644 index 000000000..f324830c4 --- /dev/null +++ b/docs/html/mesh__fixes_8h_source.html @@ -0,0 +1,172 @@ + + + + + + + +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 const glm::mat3 transform;
+
14
+
15 glm::vec3 operator()(glm::vec3 normal) {
+
16 normal = glm::normalize(transform * normal);
+
17 if (isnan(normal.x)) normal = glm::vec3(0.0f);
+
18 return normal;
+
19 }
+
20};
+
21
+
22struct TransformTangents {
+
23 const glm::mat3 transform;
+
24 const bool invert;
+
25 VecView<const glm::vec4> oldTangents;
+ +
27
+
28 void operator()(thrust::tuple<glm::vec4&, int> inOut) {
+
29 glm::vec4& tangent = thrust::get<0>(inOut);
+
30 int edge = thrust::get<1>(inOut);
+
31 if (invert) {
+
32 edge = halfedge[FlipHalfedge(edge)].pairedHalfedge;
+
33 }
+
34
+
35 tangent = glm::vec4(transform * glm::vec3(oldTangents[edge]),
+
36 oldTangents[edge].w);
+
37 }
+
38};
+
39
+
40struct FlipTris {
+
41 VecView<Halfedge> halfedge;
+
42
+
43 void operator()(thrust::tuple<TriRef&, int> inOut) {
+
44 TriRef& bary = thrust::get<0>(inOut);
+
45 const int tri = thrust::get<1>(inOut);
+
46
+
47 thrust::swap(halfedge[3 * tri], halfedge[3 * tri + 2]);
+
48
+
49 for (const int i : {0, 1, 2}) {
+
50 thrust::swap(halfedge[3 * tri + i].startVert,
+
51 halfedge[3 * tri + i].endVert);
+
52 halfedge[3 * tri + i].pairedHalfedge =
+
53 FlipHalfedge(halfedge[3 * tri + i].pairedHalfedge);
+
54 }
+
55 }
+
56};
+
57} // namespace
+
Definition: vec.h:42
+
Definition: shared.h:149
+
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..c4c0e4fa6 --- /dev/null +++ b/docs/html/mesh_i_o_8h_source.html @@ -0,0 +1,168 @@ + + + + + + + +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.h"
+
19
+
20namespace manifold {
+
21
+
30struct Material {
+
32 float roughness = 0.2;
+
34 float metalness = 1;
+
37 glm::vec4 color = glm::vec4(1.0f);
+
41 std::vector<glm::vec4> vertColor;
+
44 glm::ivec3 normalChannels = glm::ivec3(-1);
+
47 glm::ivec4 colorChannels = glm::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
+
glm::ivec4 colorChannels
Definition: meshIO.h:47
+
float roughness
Roughness value between 0 (shiny) and 1 (matte).
Definition: meshIO.h:32
+
bool faceted
Definition: meshIO.h:56
+
Material mat
PBR material properties.
Definition: meshIO.h:58
+
std::vector< glm::vec4 > vertColor
Definition: meshIO.h:41
+
float metalness
Metalness value, generally either 0 (dielectric) or 1 (metal).
Definition: meshIO.h:34
+
glm::vec4 color
Definition: meshIO.h:37
+
glm::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:270
+
Definition: meshIO.h:53
+
Definition: meshIO.h:30
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/modules.html b/docs/html/modules.html new file mode 100644 index 000000000..5952a15b1 --- /dev/null +++ b/docs/html/modules.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Modules + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Modules
+
+
+
Here is a list of all modules:
+
[detail level 12]
+ + + + + + + +
 MeshIO3D model file I/O based on Assimp
 SamplesExamples of usage and interesting designs
 CoreThe central classes of the library
 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/modules.js b/docs/html/modules.js new file mode 100644 index 000000000..3eff93abb --- /dev/null +++ b/docs/html/modules.js @@ -0,0 +1,9 @@ +var modules = +[ + [ "MeshIO", "group___mesh_i_o.html", "group___mesh_i_o" ], + [ "Samples", "group___samples.html", "group___samples" ], + [ "Core", "group___core.html", "group___core" ], + [ "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/namespacebricks.html b/docs/html/namespacebricks.html new file mode 100644 index 000000000..e64058538 --- /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

+def brick ()
 
+def halfbrick ()
 
+def row (length)
 
+def wall (length, height, alternate=0)
 
+def walls (length, width, height)
 
+def floor (length, width)
 
+def 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..e262b7316 --- /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

+def 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..df9025dc6 --- /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

+def gyroid (x, y, z)
 
+def gyroid_levelset (level, period, size, n)
 
+def rhombic_dodecahedron (size)
 
+def gyroid_module (size=20, n=15)
 
+def 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..84f739fc8 --- /dev/null +++ b/docs/html/namespacemanifold.html @@ -0,0 +1,405 @@ + + + + + + + +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
 
class  CrossSection
 
class  CsgLeafNode
 
class  CsgNode
 
class  CsgOpNode
 
struct  ExecutionParams
 
struct  ExportOptions
 
struct  geometryErr
 
struct  Halfedge
 
struct  Halfedge2Tmp
 
class  HashTable
 
class  HashTableD
 
class  Manifold
 
struct  Material
 
struct  Mesh
 
struct  MeshGL
 
struct  PathImpl
 
struct  PolyVert
 
struct  Properties
 
class  Quality
 
struct  Rect
 
struct  ReindexEdge
 
struct  Smoothness
 
class  SparseIndices
 
class  strided_range
 
struct  Timer
 
struct  TmpEdge
 
struct  TmpInvalid
 
struct  topologyErr
 
struct  TriRef
 
struct  UnionFind
 
struct  userErr
 
class  Vec
 
class  VecView
 
+ + + + + + + + + + + + + + + +

+Typedefs

+using GeneralTriangulation = std::function< std::vector< glm::ivec3 >(int)>
 
+using AddTriangle = std::function< void(int, glm::ivec3, glm::vec3, TriRef)>
 
+using SimplePolygonIdx = std::vector< PolyVert >
 
+using PolygonsIdx = std::vector< SimplePolygonIdx >
 
using SimplePolygon = std::vector< glm::vec2 >
 
using Polygons = std::vector< SimplePolygon >
 
+using logicErr = std::logic_error
 
+ + + + + + + +

+Enumerations

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

+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, float majorRadius, float minorRadius, float threadRadius, int circularSegments=0, int linearSegments=0)
 
Manifold StretchyBracelet (float radius=30.0f, float height=8.0f, float width=15.0f, float thickness=0.4f, int nDecor=20, int nCut=27, int nDivision=30)
 
Manifold MengerSponge (int n=3)
 
Manifold RoundedFrame (float edgeLength, float radius, int circularSegments=0)
 
Manifold TetPuzzle (float edgeLength, float gap, int nDivisions)
 
Manifold Scallop ()
 
Manifold GyroidModule (float size=20, int n=20)
 
+Manifold CondensedMatter (int fn=16)
 
+template SparseIndices Collider::Collisions< false, false, glm::vec3 > (const VecView< const glm::vec3 > &) const
 
+template SparseIndices Collider::Collisions< false, true, glm::vec3 > (const VecView< const glm::vec3 > &) const
 
ExecutionParamsManifoldParams ()
 
+glm::vec3 SafeNormalize (glm::vec3 v)
 
+float MaxPrecision (float minPrecision, const Box &bBox)
 
+int NextHalfedge (int current)
 
+glm::vec3 UVW (int vert, const glm::vec3 *barycentric)
 
+glm::mat3 NormalTransform (const glm::mat4x3 &transform)
 
glm::mat3x2 GetAxisAlignedProjection (glm::vec3 normal)
 
+glm::vec3 GetBarycentric (const glm::vec3 &v, const glm::mat3 &triPos, float 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< glm::ivec3 > TriangulateIdx (const PolygonsIdx &polys, float 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. More...
 
Mesh LevelSet (std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, bool canParallel=true)
 
+constexpr ExecutionPolicy autoPolicy (int size)
 
+template<typename... Args>
void exclusive_scan (ExecutionPolicy policy, Args... args)
 
+template<typename DerivedPolicy , typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Predicate >
OutputIterator copy_if (ExecutionPolicy policy, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred)
 
+template<typename DerivedPolicy , typename InputIterator1 , typename OutputIterator , typename Predicate >
OutputIterator copy_if (ExecutionPolicy policy, InputIterator1 first, InputIterator1 last, OutputIterator result, Predicate pred)
 
float sind (float x)
 
float cosd (float x)
 
glm::mat4x3 RotateUp (glm::vec3 up)
 
int CCW (glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float 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 glm::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)
 
+void MemUsage ()
 
+template<typename... Iters>
thrust::zip_iterator< thrust::tuple< Iters... > > zip (Iters... iters)
 
+template<typename A , typename B >
thrust::permutation_iterator< A, B > perm (A a, B b)
 
+template<typename T >
thrust::counting_iterator< T > countAt (T i)
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+template<typename T >
AtomicAdd (T &target, T add)
 
+template<>
int AtomicAdd (int &target, int add)
 
+ + + + + + + + +

+Variables

+constexpr float kTolerance = 1e-5
 
std::vector< glm::ivec3 > Triangulate (const Polygons &polygons, float 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. More...
 
+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.

+
+
+ + + + diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html new file mode 100644 index 000000000..3ec65b8e2 --- /dev/null +++ b/docs/html/namespacemembers.html @@ -0,0 +1,132 @@ + + + + + + + +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..d2c395f8a --- /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
+
+
+
+
+ +
+
+
+ + + + diff --git a/docs/html/namespacemembers_func.html b/docs/html/namespacemembers_func.html new file mode 100644 index 000000000..f5f46077a --- /dev/null +++ b/docs/html/namespacemembers_func.html @@ -0,0 +1,129 @@ + + + + + + + +Manifold: Namespace Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
+ + + + diff --git a/docs/html/namespacemembers_type.html b/docs/html/namespacemembers_type.html new file mode 100644 index 000000000..f2bef8ffe --- /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
+
+
+
+
+ +
+
+
+ + + + diff --git a/docs/html/namespacerun__all.html b/docs/html/namespacerun__all.html new file mode 100644 index 000000000..1383a6c75 --- /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..6990ade0f --- /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

+def 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..c5c1a4388 --- /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

+def 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..c8a7766a7 --- /dev/null +++ b/docs/html/navtree.css @@ -0,0 +1,150 @@ +#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; + outline:none; +} + +#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..27983687a --- /dev/null +++ b/docs/html/navtree.js @@ -0,0 +1,549 @@ +/* + @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,show) +{ + 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, false); + } + } + 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, showRoot) +{ + 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, showRoot); + }, showRoot); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + } + } +} + +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); + },true); + } 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); + } + },true); + } +} + +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#include "public.h"
+
18
+
19#ifdef MANIFOLD_DEBUG
+
20#include <iostream>
+
21#include <sstream>
+
22#include <string>
+
23
+
24template <typename Ex>
+
25void Assert(bool condition, const char* file, int line, const std::string& cond,
+
26 const std::string& msg) {
+
27 if (!condition) {
+
28 std::ostringstream output;
+
29 output << "Error in file: " << file << " (" << line << "): \'" << cond
+
30 << "\' is false: " << msg;
+
31 throw Ex(output.str());
+
32 }
+
33}
+
34#define ASSERT(condition, EX, msg) \
+
35 Assert<EX>(condition, __FILE__, __LINE__, #condition, msg);
+
36#else
+
37#define ASSERT(condition, EX, msg)
+
38#endif
+
+
+ + + + diff --git a/docs/html/pages.html b/docs/html/pages.html new file mode 100644 index 000000000..7026f2771 --- /dev/null +++ b/docs/html/pages.html @@ -0,0 +1,116 @@ + + + + + + + +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/par_8h_source.html b/docs/html/par_8h_source.html new file mode 100644 index 000000000..312222f63 --- /dev/null +++ b/docs/html/par_8h_source.html @@ -0,0 +1,308 @@ + + + + + + + +Manifold: par.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
par.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 <thrust/binary_search.h>
+
17#include <thrust/count.h>
+
18#include <thrust/execution_policy.h>
+
19#include <thrust/gather.h>
+
20#include <thrust/logical.h>
+
21#include <thrust/remove.h>
+
22#include <thrust/sequence.h>
+
23#include <thrust/sort.h>
+
24#include <thrust/system/cpp/execution_policy.h>
+
25#include <thrust/uninitialized_copy.h>
+
26
+
27#include <algorithm>
+
28#include <numeric>
+
29#if MANIFOLD_PAR == 'T'
+
30#include <thrust/system/tbb/execution_policy.h>
+
31
+
32#if MANIFOLD_PAR == 'T' && TBB_INTERFACE_VERSION >= 10000 && \
+
33 __has_include(<pstl/glue_execution_defs.h>)
+
34#include <execution>
+
35#endif
+
36
+
37#include "tbb/tbb.h"
+
38#define MANIFOLD_PAR_NS tbb
+
39#else
+
40#define MANIFOLD_PAR_NS cpp
+
41#endif
+
42
+
43namespace manifold {
+
44
+
45enum class ExecutionPolicy {
+
46 Par,
+
47 Seq,
+
48};
+
49
+
50// ExecutionPolicy:
+
51// - Sequential for small workload,
+
52// - Parallel (CPU) for medium workload,
+
53// - GPU for large workload if available.
+
54inline constexpr ExecutionPolicy autoPolicy(int size) {
+
55 // some random numbers
+
56 if (size <= (1 << 12)) {
+
57 return ExecutionPolicy::Seq;
+
58 }
+
59 return ExecutionPolicy::Par;
+
60}
+
61
+
62#define THRUST_DYNAMIC_BACKEND_VOID(NAME) \
+
63 template <typename... Args> \
+
64 void NAME(ExecutionPolicy policy, Args... args) { \
+
65 switch (policy) { \
+
66 case ExecutionPolicy::Par: \
+
67 thrust::NAME(thrust::MANIFOLD_PAR_NS::par, args...); \
+
68 break; \
+
69 case ExecutionPolicy::Seq: \
+
70 thrust::NAME(thrust::cpp::par, args...); \
+
71 break; \
+
72 } \
+
73 }
+
74
+
75#define THRUST_DYNAMIC_BACKEND(NAME, RET) \
+
76 template <typename Ret = RET, typename... Args> \
+
77 Ret NAME(ExecutionPolicy policy, Args... args) { \
+
78 switch (policy) { \
+
79 case ExecutionPolicy::Par: \
+
80 return thrust::NAME(thrust::MANIFOLD_PAR_NS::par, args...); \
+
81 case ExecutionPolicy::Seq: \
+
82 break; \
+
83 } \
+
84 return thrust::NAME(thrust::cpp::par, args...); \
+
85 }
+
86
+
87#if MANIFOLD_PAR != 'T' || \
+
88 (TBB_INTERFACE_VERSION >= 10000 && __has_include(<pstl/glue_execution_defs.h>))
+
89#if MANIFOLD_PAR == 'T'
+
90#define STL_DYNAMIC_BACKEND(NAME, RET) \
+
91 template <typename Ret = RET, typename... Args> \
+
92 Ret NAME(ExecutionPolicy policy, Args... args) { \
+
93 switch (policy) { \
+
94 case ExecutionPolicy::Par: \
+
95 return std::NAME(std::execution::par_unseq, args...); \
+
96 case ExecutionPolicy::Seq: \
+
97 break; \
+
98 } \
+
99 return std::NAME(args...); \
+
100 }
+
101#define STL_DYNAMIC_BACKEND_VOID(NAME) \
+
102 template <typename... Args> \
+
103 void NAME(ExecutionPolicy policy, Args... args) { \
+
104 switch (policy) { \
+
105 case ExecutionPolicy::Par: \
+
106 std::NAME(std::execution::par_unseq, args...); \
+
107 break; \
+
108 case ExecutionPolicy::Seq: \
+
109 std::NAME(args...); \
+
110 break; \
+
111 } \
+
112 }
+
113#else
+
114#define STL_DYNAMIC_BACKEND(NAME, RET) \
+
115 template <typename Ret = RET, typename... Args> \
+
116 Ret NAME(ExecutionPolicy policy, Args... args) { \
+
117 return std::NAME(args...); \
+
118 }
+
119#define STL_DYNAMIC_BACKEND_VOID(NAME) \
+
120 template <typename... Args> \
+
121 void NAME(ExecutionPolicy policy, Args... args) { \
+
122 std::NAME(args...); \
+
123 }
+
124#endif
+
125
+
126template <typename... Args>
+
127void exclusive_scan(ExecutionPolicy policy, Args... args) {
+
128 // https://github.com/llvm/llvm-project/issues/59810
+
129 std::exclusive_scan(args...);
+
130}
+
131template <typename DerivedPolicy, typename InputIterator1,
+
132 typename InputIterator2, typename OutputIterator, typename Predicate>
+
133OutputIterator copy_if(ExecutionPolicy policy, InputIterator1 first,
+
134 InputIterator1 last, InputIterator2 stencil,
+
135 OutputIterator result, Predicate pred) {
+
136 if (policy == ExecutionPolicy::Seq)
+
137 return thrust::copy_if(thrust::cpp::par, first, last, stencil, result,
+
138 pred);
+
139 else
+
140 // note: this is not a typo, see
+
141 // https://github.com/NVIDIA/thrust/issues/1977
+
142 return thrust::copy_if(first, last, stencil, result, pred);
+
143}
+
144template <typename DerivedPolicy, typename InputIterator1,
+
145 typename OutputIterator, typename Predicate>
+
146OutputIterator copy_if(ExecutionPolicy policy, InputIterator1 first,
+
147 InputIterator1 last, OutputIterator result,
+
148 Predicate pred) {
+
149#if MANIFOLD_PAR == 'T'
+
150 if (policy == ExecutionPolicy::Seq)
+
151 return std::copy_if(first, last, result, pred);
+
152 else
+
153 return std::copy_if(std::execution::par_unseq, first, last, result, pred);
+
154#else
+
155 return std::copy_if(first, last, result, pred);
+
156#endif
+
157}
+
158
+
159#else
+
160#define STL_DYNAMIC_BACKEND(NAME, RET) THRUST_DYNAMIC_BACKEND(NAME, RET)
+
161#define STL_DYNAMIC_BACKEND_VOID(NAME) THRUST_DYNAMIC_BACKEND_VOID(NAME)
+
162
+
163THRUST_DYNAMIC_BACKEND_VOID(exclusive_scan)
+
164THRUST_DYNAMIC_BACKEND(copy_if, void)
+
165#endif
+
166
+
167THRUST_DYNAMIC_BACKEND_VOID(gather)
+
168THRUST_DYNAMIC_BACKEND_VOID(scatter)
+
169THRUST_DYNAMIC_BACKEND_VOID(for_each)
+
170THRUST_DYNAMIC_BACKEND_VOID(for_each_n)
+
171THRUST_DYNAMIC_BACKEND_VOID(sequence)
+
172STL_DYNAMIC_BACKEND_VOID(transform)
+
173STL_DYNAMIC_BACKEND_VOID(uninitialized_fill)
+
174STL_DYNAMIC_BACKEND_VOID(uninitialized_copy)
+
175STL_DYNAMIC_BACKEND_VOID(stable_sort)
+
176STL_DYNAMIC_BACKEND_VOID(fill)
+
177STL_DYNAMIC_BACKEND_VOID(copy)
+
178STL_DYNAMIC_BACKEND_VOID(inclusive_scan)
+
179STL_DYNAMIC_BACKEND_VOID(copy_n)
+
180
+
181// void implies that the user have to specify the return type in the template
+
182// argument, as we are unable to deduce it
+
183THRUST_DYNAMIC_BACKEND(transform_reduce, void)
+
184THRUST_DYNAMIC_BACKEND(gather_if, void)
+
185THRUST_DYNAMIC_BACKEND(reduce_by_key, void)
+
186STL_DYNAMIC_BACKEND(remove, void)
+
187STL_DYNAMIC_BACKEND(find, void)
+
188STL_DYNAMIC_BACKEND(find_if, void)
+
189STL_DYNAMIC_BACKEND(all_of, bool)
+
190STL_DYNAMIC_BACKEND(is_sorted, bool)
+
191STL_DYNAMIC_BACKEND(reduce, void)
+
192STL_DYNAMIC_BACKEND(count_if, int)
+
193STL_DYNAMIC_BACKEND(remove_if, void)
+
194
+
195} // namespace manifold
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/polygon_8h_source.html b/docs/html/polygon_8h_source.html new file mode 100644 index 000000000..de0f90937 --- /dev/null +++ b/docs/html/polygon_8h_source.html @@ -0,0 +1,156 @@ + + + + + + + +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 <functional>
+
17
+
18#include "public.h"
+
19
+
20namespace manifold {
+
21
+
29struct PolyVert {
+
31 glm::vec2 pos;
+
33 int idx;
+
34};
+
35
+
36using SimplePolygonIdx = std::vector<PolyVert>;
+
37using PolygonsIdx = std::vector<SimplePolygonIdx>;
+
38
+
39std::vector<glm::ivec3> TriangulateIdx(const PolygonsIdx &polys,
+
40 float precision = -1);
+
46std::vector<glm::ivec3> Triangulate(const Polygons &polygons,
+
47 float precision = -1);
+
48
+
49ExecutionParams &PolygonParams();
+
51} // namespace manifold
+
std::vector< glm::ivec3 > Triangulate(const Polygons &polygons, float precision=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition: polygon.cpp:858
+
std::vector< SimplePolygon > Polygons
Definition: public.h:121
+
Definition: public.h:601
+
glm::vec2 pos
X-Y position.
Definition: polygon.h:31
+
int idx
ID or index into another vertex vector.
Definition: polygon.h:33
+
std::vector< glm::ivec3 > TriangulateIdx(const PolygonsIdx &polys, float precision=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition: polygon.cpp:818
+
Definition: polygon.h:29
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/public_8h_source.html b/docs/html/public_8h_source.html new file mode 100644 index 000000000..dac481c63 --- /dev/null +++ b/docs/html/public_8h_source.html @@ -0,0 +1,580 @@ + + + + + + + +Manifold: public.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
public.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_FORCE_EXPLICIT_CTOR
+
17#include <glm/ext/matrix_transform.hpp>
+
18#include <glm/glm.hpp>
+
19#include <glm/gtc/constants.hpp>
+
20#include <glm/gtx/compatibility.hpp>
+
21#include <glm/gtx/rotate_vector.hpp>
+
22#include <limits>
+
23#include <memory>
+
24#include <unordered_map>
+
25#include <vector>
+
26
+
27#ifdef MANIFOLD_DEBUG
+
28#include <iomanip>
+
29#include <iostream>
+
30#include <sstream>
+
31#endif
+
32
+
33namespace manifold {
+
34
+
35constexpr float kTolerance = 1e-5;
+
36
+
47inline float sind(float x) {
+
48 if (!std::isfinite(x)) return sin(x);
+
49 if (x < 0.0f) return -sind(-x);
+
50 int quo;
+
51 x = remquo(fabs(x), 90.0f, &quo);
+
52 switch (quo % 4) {
+
53 case 0:
+
54 return sin(glm::radians(x));
+
55 case 1:
+
56 return cos(glm::radians(x));
+
57 case 2:
+
58 return -sin(glm::radians(x));
+
59 case 3:
+
60 return -cos(glm::radians(x));
+
61 }
+
62 return 0.0f;
+
63}
+
64
+
70inline float cosd(float x) { return sind(x + 90.0f); }
+
71
+
78inline glm::mat4x3 RotateUp(glm::vec3 up) {
+
79 up = glm::normalize(up);
+
80 glm::vec3 axis = glm::cross(up, {0, 0, 1});
+
81 float angle = glm::asin(glm::length(axis));
+
82 if (glm::dot(up, {0, 0, 1}) < 0) angle = glm::pi<float>() - angle;
+
83 return glm::mat4x3(glm::rotate(glm::mat4(1), angle, axis));
+
84}
+
85
+
97inline int CCW(glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol) {
+
98 glm::vec2 v1 = p1 - p0;
+
99 glm::vec2 v2 = p2 - p0;
+
100 float area = v1.x * v2.y - v1.y * v2.x;
+
101 float base2 = glm::max(glm::dot(v1, v1), glm::dot(v2, v2));
+
102 if (area * area * 4 <= base2 * tol * tol)
+
103 return 0;
+
104 else
+
105 return area > 0 ? 1 : -1;
+
106}
+
107
+
113using SimplePolygon = std::vector<glm::vec2>;
+
114
+
121using Polygons = std::vector<SimplePolygon>;
+
122
+
126struct Mesh {
+
128 std::vector<glm::vec3> vertPos;
+
131 std::vector<glm::ivec3> triVerts;
+
135 std::vector<glm::vec3> vertNormal;
+
140 std::vector<glm::vec4> halfedgeTangent;
+
145 float precision = 0;
+
146};
+
147
+ + + +
159};
+
160
+ +
165 float surfaceArea, volume;
+
166};
+
167
+
168struct Box {
+
169 glm::vec3 min = glm::vec3(std::numeric_limits<float>::infinity());
+
170 glm::vec3 max = glm::vec3(-std::numeric_limits<float>::infinity());
+
171
+
175 Box() {}
+
176
+
180 Box(const glm::vec3 p1, const glm::vec3 p2) {
+
181 min = glm::min(p1, p2);
+
182 max = glm::max(p1, p2);
+
183 }
+
184
+
188 glm::vec3 Size() const { return max - min; }
+
189
+
193 glm::vec3 Center() const { return 0.5f * (max + min); }
+
194
+
199 float Scale() const {
+
200 glm::vec3 absMax = glm::max(glm::abs(min), glm::abs(max));
+
201 return glm::max(absMax.x, glm::max(absMax.y, absMax.z));
+
202 }
+
203
+
207 bool Contains(const glm::vec3& p) const {
+
208 return glm::all(glm::greaterThanEqual(p, min)) &&
+
209 glm::all(glm::greaterThanEqual(max, p));
+
210 }
+
211
+
215 bool Contains(const Box& box) const {
+
216 return glm::all(glm::greaterThanEqual(box.min, min)) &&
+
217 glm::all(glm::greaterThanEqual(max, box.max));
+
218 }
+
219
+
223 void Union(const glm::vec3 p) {
+
224 min = glm::min(min, p);
+
225 max = glm::max(max, p);
+
226 }
+
227
+
231 Box Union(const Box& box) const {
+
232 Box out;
+
233 out.min = glm::min(min, box.min);
+
234 out.max = glm::max(max, box.max);
+
235 return out;
+
236 }
+
237
+
245 Box Transform(const glm::mat4x3& transform) const {
+
246 Box out;
+
247 glm::vec3 minT = transform * glm::vec4(min, 1.0f);
+
248 glm::vec3 maxT = transform * glm::vec4(max, 1.0f);
+
249 out.min = glm::min(minT, maxT);
+
250 out.max = glm::max(minT, maxT);
+
251 return out;
+
252 }
+
253
+
257 Box operator+(glm::vec3 shift) const {
+
258 Box out;
+
259 out.min = min + shift;
+
260 out.max = max + shift;
+
261 return out;
+
262 }
+
263
+
267 Box& operator+=(glm::vec3 shift) {
+
268 min += shift;
+
269 max += shift;
+
270 return *this;
+
271 }
+
272
+
276 Box operator*(glm::vec3 scale) const {
+
277 Box out;
+
278 out.min = min * scale;
+
279 out.max = max * scale;
+
280 return out;
+
281 }
+
282
+
286 Box& operator*=(glm::vec3 scale) {
+
287 min *= scale;
+
288 max *= scale;
+
289 return *this;
+
290 }
+
291
+
295 inline bool DoesOverlap(const Box& box) const {
+
296 return min.x <= box.max.x && min.y <= box.max.y && min.z <= box.max.z &&
+
297 max.x >= box.min.x && max.y >= box.min.y && max.z >= box.min.z;
+
298 }
+
299
+
304 inline bool DoesOverlap(glm::vec3 p) const { // projected in z
+
305 return p.x <= max.x && p.x >= min.x && p.y <= max.y && p.y >= min.y;
+
306 }
+
307
+
311 bool IsFinite() const {
+
312 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
313 }
+
314};
+
315
+
319struct Rect {
+
320 glm::vec2 min = glm::vec2(std::numeric_limits<float>::infinity());
+
321 glm::vec2 max = glm::vec2(-std::numeric_limits<float>::infinity());
+
322
+
326 Rect() {}
+
327
+
331 Rect(const glm::vec2 a, const glm::vec2 b) {
+
332 min = glm::min(a, b);
+
333 max = glm::max(a, b);
+
334 }
+
335
+
340
+
344 glm::vec2 Size() const { return max - min; }
+
345
+
349 float Area() const {
+
350 auto sz = Size();
+
351 return sz.x * sz.y;
+
352 }
+
353
+
358 float Scale() const {
+
359 glm::vec2 absMax = glm::max(glm::abs(min), glm::abs(max));
+
360 return glm::max(absMax.x, absMax.y);
+
361 }
+
362
+
366 glm::vec2 Center() const { return 0.5f * (max + min); }
+
367
+
371 bool Contains(const glm::vec2& p) const {
+
372 return glm::all(glm::greaterThanEqual(p, min)) &&
+
373 glm::all(glm::greaterThanEqual(max, p));
+
374 }
+
375
+
379 bool Contains(const Rect& rect) const {
+
380 return glm::all(glm::greaterThanEqual(rect.min, min)) &&
+
381 glm::all(glm::greaterThanEqual(max, rect.max));
+
382 }
+
383
+
387 bool DoesOverlap(const Rect& rect) const {
+
388 return min.x <= rect.max.x && min.y <= rect.max.y && max.x >= rect.min.x &&
+
389 max.y >= rect.min.y;
+
390 }
+
391
+
395 bool IsEmpty() const { return max.y <= min.y || max.x <= min.x; };
+
396
+
400 bool IsFinite() const {
+
401 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
402 }
+
403
+
405
+
409
+
413 void Union(const glm::vec2 p) {
+
414 min = glm::min(min, p);
+
415 max = glm::max(max, p);
+
416 }
+
417
+
421 Rect Union(const Rect& rect) const {
+
422 Rect out;
+
423 out.min = glm::min(min, rect.min);
+
424 out.max = glm::max(max, rect.max);
+
425 return out;
+
426 }
+
427
+
431 Rect operator+(const glm::vec2 shift) const {
+
432 Rect out;
+
433 out.min = min + shift;
+
434 out.max = max + shift;
+
435 return out;
+
436 }
+
437
+
441 Rect& operator+=(const glm::vec2 shift) {
+
442 min += shift;
+
443 max += shift;
+
444 return *this;
+
445 }
+
446
+
450 Rect operator*(const glm::vec2 scale) const {
+
451 Rect out;
+
452 out.min = min * scale;
+
453 out.max = max * scale;
+
454 return out;
+
455 }
+
456
+
460 Rect& operator*=(const glm::vec2 scale) {
+
461 min *= scale;
+
462 max *= scale;
+
463 return *this;
+
464 }
+
465
+
473 Rect Transform(const glm::mat3x2& m) const {
+
474 Rect rect;
+
475 rect.min = m * glm::vec3(min, 1);
+
476 rect.max = m * glm::vec3(max, 1);
+
477 return rect;
+
478 }
+
480};
+
490enum class OpType { Add, Subtract, Intersect };
+
491
+
500class Quality {
+
501 private:
+
502 inline static int circularSegments_ = 0;
+
503 inline static float circularAngle_ = 10.0f;
+
504 inline static float circularEdgeLength_ = 1.0f;
+
505
+
506 public:
+
517 static void SetMinCircularAngle(float angle) {
+
518 if (angle <= 0) return;
+
519 circularAngle_ = angle;
+
520 }
+
521
+
531 static void SetMinCircularEdgeLength(float length) {
+
532 if (length <= 0) return;
+
533 circularEdgeLength_ = length;
+
534 }
+
535
+
545 static void SetCircularSegments(int number) {
+
546 if (number < 3 && number != 0) return;
+
547 circularSegments_ = number;
+
548 }
+
549
+
557 static int GetCircularSegments(float radius) {
+
558 if (circularSegments_ > 0) return circularSegments_;
+
559 int nSegA = 360.0f / circularAngle_;
+
560 int nSegL = 2.0f * radius * glm::pi<float>() / circularEdgeLength_;
+
561 int nSeg = fmin(nSegA, nSegL) + 3;
+
562 nSeg -= nSeg % 4;
+
563 return std::max(nSeg, 3);
+
564 }
+
565};
+
583#ifdef MANIFOLD_DEBUG
+
584struct userErr : public virtual std::runtime_error {
+
585 using std::runtime_error::runtime_error;
+
586};
+
587struct topologyErr : public virtual std::runtime_error {
+
588 using std::runtime_error::runtime_error;
+
589};
+
590struct geometryErr : public virtual std::runtime_error {
+
591 using std::runtime_error::runtime_error;
+
592};
+
593using logicErr = std::logic_error;
+
594#endif
+ +
604 bool intermediateChecks = false;
+
607 bool verbose = false;
+
610 bool processOverlaps = true;
+
613 bool suppressErrors = false;
+
615 bool deterministic = false;
+
617 bool cleanupTriangles = true;
+
618};
+
619
+
620#ifdef MANIFOLD_DEBUG
+
621
+
622template <typename T>
+
623inline std::ostream& operator<<(std::ostream& stream, const glm::tvec2<T>& v) {
+
624 return stream << "x = " << v.x << ", y = " << v.y;
+
625}
+
626
+
627template <typename T>
+
628inline std::ostream& operator<<(std::ostream& stream, const glm::tvec3<T>& v) {
+
629 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z;
+
630}
+
631
+
632template <typename T>
+
633inline std::ostream& operator<<(std::ostream& stream, const glm::tvec4<T>& v) {
+
634 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z
+
635 << ", w = " << v.w;
+
636}
+
637
+
638inline std::ostream& operator<<(std::ostream& stream, const glm::mat4x3& mat) {
+
639 glm::mat3x4 tam = glm::transpose(mat);
+
640 return stream << tam[0] << std::endl
+
641 << tam[1] << std::endl
+
642 << tam[2] << std::endl;
+
643}
+
644
+
645inline std::ostream& operator<<(std::ostream& stream, const Box& box) {
+
646 return stream << "min: " << box.min << ", "
+
647 << "max: " << box.max;
+
648}
+
649
+
650inline std::ostream& operator<<(std::ostream& stream, const Rect& box) {
+
651 return stream << "min: " << box.min << ", "
+
652 << "max: " << box.max;
+
653}
+
654
+
659template <typename T>
+
660void Dump(const std::vector<T>& vec) {
+
661 std::cout << "Vec = " << std::endl;
+
662 for (int i = 0; i < vec.size(); ++i) {
+
663 std::cout << i << ", " << vec[i] << ", " << std::endl;
+
664 }
+
665 std::cout << std::endl;
+
666}
+
667
+
668template <typename T>
+
669void Diff(const std::vector<T>& a, const std::vector<T>& b) {
+
670 std::cout << "Diff = " << std::endl;
+
671 if (a.size() != b.size()) {
+
672 std::cout << "a and b must have the same length, aborting Diff"
+
673 << std::endl;
+
674 return;
+
675 }
+
676 for (int i = 0; i < a.size(); ++i) {
+
677 if (a[i] != b[i])
+
678 std::cout << i << ": " << a[i] << ", " << b[i] << std::endl;
+
679 }
+
680 std::cout << std::endl;
+
681}
+
683#endif
+
684} // namespace manifold
+
685
+
686#undef HOST_DEVICE
+
Definition: public.h:500
+
static void SetMinCircularAngle(float angle)
Definition: public.h:517
+
static void SetMinCircularEdgeLength(float length)
Definition: public.h:531
+
static void SetCircularSegments(int number)
Definition: public.h:545
+
static int GetCircularSegments(float radius)
Definition: public.h:557
+
std::vector< glm::ivec3 > triVerts
Definition: public.h:131
+
std::vector< glm::vec4 > halfedgeTangent
Definition: public.h:140
+
float smoothness
Definition: public.h:158
+
std::vector< glm::vec3 > vertNormal
Definition: public.h:135
+
int halfedge
The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i].
Definition: public.h:154
+
std::vector< glm::vec3 > vertPos
Required: The X-Y-Z positions of all vertices.
Definition: public.h:128
+
float precision
Definition: public.h:145
+
int CCW(glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol)
Definition: public.h:97
+
float cosd(float x)
Definition: public.h:70
+
std::vector< glm::vec2 > SimplePolygon
Definition: public.h:113
+
std::vector< SimplePolygon > Polygons
Definition: public.h:121
+
glm::mat4x3 RotateUp(glm::vec3 up)
Definition: public.h:78
+
float sind(float x)
Definition: public.h:47
+
Definition: public.h:126
+
Definition: public.h:164
+
Definition: public.h:152
+
OpType
Definition: public.h:490
+
bool deterministic
Deterministic outputs. Will disable some parallel optimizations.
Definition: public.h:615
+
bool suppressErrors
Definition: public.h:613
+
bool processOverlaps
Definition: public.h:610
+
bool cleanupTriangles
Perform optional but recommended triangle cleanups in SimplifyTopology()
Definition: public.h:617
+
bool verbose
Definition: public.h:607
+
bool intermediateChecks
Definition: public.h:604
+
void Dump(const std::vector< T > &vec)
Definition: public.h:660
+
Definition: public.h:601
+
Definition: meshIO.h:20
+
Definition: public.h:168
+
bool DoesOverlap(glm::vec3 p) const
Definition: public.h:304
+
bool Contains(const glm::vec3 &p) const
Definition: public.h:207
+
bool IsFinite() const
Definition: public.h:311
+
bool DoesOverlap(const Box &box) const
Definition: public.h:295
+
Box(const glm::vec3 p1, const glm::vec3 p2)
Definition: public.h:180
+
Box operator*(glm::vec3 scale) const
Definition: public.h:276
+
Box Transform(const glm::mat4x3 &transform) const
Definition: public.h:245
+
Box Union(const Box &box) const
Definition: public.h:231
+
Box & operator+=(glm::vec3 shift)
Definition: public.h:267
+
glm::vec3 Center() const
Definition: public.h:193
+
void Union(const glm::vec3 p)
Definition: public.h:223
+
float Scale() const
Definition: public.h:199
+
Box()
Definition: public.h:175
+
glm::vec3 Size() const
Definition: public.h:188
+
Box & operator*=(glm::vec3 scale)
Definition: public.h:286
+
Box operator+(glm::vec3 shift) const
Definition: public.h:257
+
bool Contains(const Box &box) const
Definition: public.h:215
+
Definition: public.h:319
+
Rect(const glm::vec2 a, const glm::vec2 b)
Definition: public.h:331
+
glm::vec2 Center() const
Definition: public.h:366
+
float Area() const
Definition: public.h:349
+
glm::vec2 Size() const
Definition: public.h:344
+
Rect operator*(const glm::vec2 scale) const
Definition: public.h:450
+
bool IsFinite() const
Definition: public.h:400
+
bool Contains(const glm::vec2 &p) const
Definition: public.h:371
+
Rect operator+(const glm::vec2 shift) const
Definition: public.h:431
+
Rect Transform(const glm::mat3x2 &m) const
Definition: public.h:473
+
Rect & operator+=(const glm::vec2 shift)
Definition: public.h:441
+
bool IsEmpty() const
Definition: public.h:395
+
Rect Union(const Rect &rect) const
Definition: public.h:421
+
float Scale() const
Definition: public.h:358
+
bool Contains(const Rect &rect) const
Definition: public.h:379
+
Rect()
Definition: public.h:326
+
bool DoesOverlap(const Rect &rect) const
Definition: public.h:387
+
Rect & operator*=(const glm::vec2 scale)
Definition: public.h:460
+
void Union(const glm::vec2 p)
Definition: public.h:413
+
Definition: public.h:590
+
Definition: public.h:587
+
Definition: public.h:584
+
+
+ + + + 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..4e911f3a4 --- /dev/null +++ b/docs/html/samples_8h_source.html @@ -0,0 +1,159 @@ + + + + + + + +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.h"
+
17
+
18namespace manifold {
+
19
+
37Manifold TorusKnot(int p, int q, float majorRadius, float minorRadius,
+
38 float threadRadius, int circularSegments = 0,
+
39 int linearSegments = 0);
+
40
+
41Manifold StretchyBracelet(float radius = 30.0f, float height = 8.0f,
+
42 float width = 15.0f, float thickness = 0.4f,
+
43 int nDecor = 20, int nCut = 27, int nDivision = 30);
+
44
+
45Manifold MengerSponge(int n = 3);
+
46
+
47Manifold RoundedFrame(float edgeLength, float radius, int circularSegments = 0);
+
48
+
49Manifold TetPuzzle(float edgeLength, float gap, int nDivisions);
+
50
+
51Manifold Scallop();
+
52
+
53Manifold GyroidModule(float size = 20, int n = 20);
+
54
+
55Manifold CondensedMatter(int fn = 16); // end of Samples
+
57} // namespace manifold
+
Manifold GyroidModule(float size=20, int n=20)
Definition: gyroid_module.cpp:47
+
Manifold TorusKnot(int p, int q, float majorRadius, float minorRadius, float threadRadius, int circularSegments=0, int linearSegments=0)
Definition: knot.cpp:41
+
Manifold MengerSponge(int n=3)
Definition: menger_sponge.cpp:44
+
Manifold Scallop()
Definition: scallop.cpp:23
+
Manifold TetPuzzle(float edgeLength, float gap, int nDivisions)
Definition: tet_puzzle.cpp:28
+
Manifold RoundedFrame(float edgeLength, float radius, int circularSegments=0)
Definition: rounded_frame.cpp:29
+
Manifold StretchyBracelet(float radius=30.0f, float height=8.0f, float width=15.0f, float thickness=0.4f, int nDecor=20, int nCut=27, int nDivision=30)
Definition: bracelet.cpp:75
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/docs/html/sdf_8h_source.html b/docs/html/sdf_8h_source.html new file mode 100644 index 000000000..9b8fa2726 --- /dev/null +++ b/docs/html/sdf_8h_source.html @@ -0,0 +1,138 @@ + + + + + + + +Manifold: sdf.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
sdf.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
+
19#include "public.h"
+
20
+
21namespace manifold {
+
22Mesh LevelSet(std::function<float(glm::vec3)> sdf, Box bounds, float edgeLength,
+
23 float level = 0, bool canParallel = true);
+
24}
+
Mesh LevelSet(std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, bool canParallel=true)
Definition: sdf.cpp:303
+
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..6547dc4c7 --- /dev/null +++ b/docs/html/search/all_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#a10d5618fa11db90402e29c30fbf50096',1,'manifold::Rect::Area()']]], + ['asoriginal_1',['AsOriginal',['../classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js new file mode 100644 index 000000000..fec6965e5 --- /dev/null +++ b/docs/html/search/all_1.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['barycentric_0',['Barycentric',['../group___private.html#structmanifold_1_1_barycentric',1,'manifold']]], + ['batchboolean_1',['BatchBoolean',['../classmanifold_1_1_cross_section.html#a8543728360bc7dda5472d5aa8647b36e',1,'manifold::CrossSection']]], + ['boolean_2',['Boolean',['../classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2',1,'manifold::CrossSection::Boolean()'],['../classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df',1,'manifold::Manifold::Boolean()']]], + ['boolean3_3',['Boolean3',['../classmanifold_1_1_boolean3.html',1,'manifold']]], + ['boundingbox_4',['BoundingBox',['../classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67',1,'manifold::Manifold']]], + ['bounds_5',['Bounds',['../classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c',1,'manifold::CrossSection']]], + ['box_6',['Box',['../structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5',1,'manifold::Box::Box()'],['../structmanifold_1_1_box.html#a4e57b8d753c7850eafadadd5c6712d0f',1,'manifold::Box::Box(const glm::vec3 p1, const glm::vec3 p2)'],['../structmanifold_1_1_box.html',1,'Box']]], + ['bricks_7',['bricks',['../namespacebricks.html',1,'']]] +]; diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js new file mode 100644 index 000000000..089b239ac --- /dev/null +++ b/docs/html/search/all_10.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['rect_0',['Rect',['../structmanifold_1_1_rect.html',1,'Rect'],['../structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22',1,'manifold::Rect::Rect()'],['../structmanifold_1_1_rect.html#a00ed04e729457429ca773061236a3bee',1,'manifold::Rect::Rect(const glm::vec2 a, const glm::vec2 b)']]], + ['refine_1',['Refine',['../classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac',1,'manifold::Manifold']]], + ['reindexedge_2',['ReindexEdge',['../structmanifold_1_1_reindex_edge.html',1,'manifold']]], + ['reindexverts_3',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a9c45d5f57ab940c4a2682d6f11fdab40',1,'manifold::Manifold::Impl']]], + ['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']]], + ['reserveids_5',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['revolve_6',['Revolve',['../classmanifold_1_1_manifold.html#aaf8fa0b43477e935d650c2f774d76c85',1,'manifold::Manifold']]], + ['rotate_7',['Rotate',['../classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629',1,'manifold::Manifold::Rotate()']]], + ['rotateup_8',['RotateUp',['../group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da',1,'manifold']]], + ['roughness_9',['roughness',['../group___mesh_i_o.html#a2c76422d3e436164284a7dba0b8a9cc4',1,'manifold::Material']]], + ['round_10',['Round',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c',1,'manifold::CrossSection']]], + ['roundedframe_11',['RoundedFrame',['../group___samples.html#ga8d224b44ea69ea070ebad60e6c1abbb9',1,'manifold']]], + ['run_5fall_12',['run_all',['../namespacerun__all.html',1,'']]], + ['runindex_13',['runIndex',['../structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4',1,'manifold::MeshGL']]], + ['runoriginalid_14',['runOriginalID',['../structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0',1,'manifold::MeshGL']]], + ['runtransform_15',['runTransform',['../structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js new file mode 100644 index 000000000..db25fd32c --- /dev/null +++ b/docs/html/search/all_11.js @@ -0,0 +1,35 @@ +var searchData= +[ + ['samples_0',['Samples',['../group___samples.html',1,'']]], + ['scale_1',['Scale',['../structmanifold_1_1_box.html#ac60a4c17cace9263b70bf5e5c6f43b58',1,'manifold::Box::Scale()'],['../structmanifold_1_1_rect.html#ac60a4c17cace9263b70bf5e5c6f43b58',1,'manifold::Rect::Scale()'],['../classmanifold_1_1_manifold.html#ae06789ff9cbe03e56260538276dd8183',1,'manifold::Manifold::Scale()'],['../classmanifold_1_1_cross_section.html#af181324d8998fd89fa7a3e8bc7ef905c',1,'manifold::CrossSection::Scale()']]], + ['scallop_2',['scallop',['../namespacescallop.html',1,'']]], + ['scallop_3',['Scallop',['../group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36',1,'manifold']]], + ['setcircularsegments_4',['SetCircularSegments',['../classmanifold_1_1_quality.html#a6b80d08df8a58d699ce644e1248fe0e2',1,'manifold::Quality']]], + ['setmincircularangle_5',['SetMinCircularAngle',['../classmanifold_1_1_quality.html#a17d90e845a2c75a0ef859e3ec5363a9e',1,'manifold::Quality']]], + ['setmincircularedgelength_6',['SetMinCircularEdgeLength',['../classmanifold_1_1_quality.html#a6a3a5a1105d40f044f777f0e3c14506a',1,'manifold::Quality']]], + ['setprecision_7',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a32981853ceaf771ca541df5b5c6e085b',1,'manifold::Manifold::Impl']]], + ['setproperties_8',['SetProperties',['../classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389',1,'manifold::Manifold']]], + ['sharedptrguard_9',['SharedPtrGuard',['../classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html',1,'manifold::ConcurrentSharedPtr']]], + ['simplepolygon_10',['SimplePolygon',['../group___connections.html#ga53c298f15c33cb04ef759cec45eaecd1',1,'manifold']]], + ['simplify_11',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_12',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_13',['sind',['../group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3',1,'manifold']]], + ['size_14',['Size',['../structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71',1,'manifold::Rect::Size()'],['../structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651',1,'manifold::Box::Size()']]], + ['smooth_15',['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={})']]], + ['smoothness_16',['Smoothness',['../group___connections.html#structmanifold_1_1_smoothness',1,'manifold']]], + ['smoothness_17',['smoothness',['../group___connections.html#a6ebfae52291cc3b6f4e25043eaf14381',1,'manifold::Smoothness']]], + ['sortfaces_18',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_19',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['sparseindices_20',['SparseIndices',['../classmanifold_1_1_sparse_indices.html',1,'manifold']]], + ['sphere_21',['Sphere',['../classmanifold_1_1_manifold.html#a1fa0a21aed71099905b89a10bcde0539',1,'manifold::Manifold']]], + ['split_22',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['split_5fcube_23',['split_cube',['../namespacesplit__cube.html',1,'']]], + ['splitbyplane_24',['SplitByPlane',['../classmanifold_1_1_manifold.html#adc134d7a6dfbf8c74e5d531bbeb330cb',1,'manifold::Manifold']]], + ['square_25',['Square',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304',1,'manifold::CrossSection::Square()'],['../classmanifold_1_1_cross_section.html#a6e14a9728e2b4a5912c70c8c1b42f029',1,'manifold::CrossSection::Square(const glm::vec2 dims, bool center=false)']]], + ['status_26',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['stretchybracelet_27',['StretchyBracelet',['../group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3',1,'manifold']]], + ['stride_5ffunctor_28',['stride_functor',['../structmanifold_1_1strided__range_1_1stride__functor.html',1,'manifold::strided_range']]], + ['strided_5frange_29',['strided_range',['../classmanifold_1_1strided__range.html',1,'manifold']]], + ['subdivide_30',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#ad593b78dd8d75c23f3fe0faf04501ceb',1,'manifold::Manifold::Impl']]], + ['suppresserrors_31',['suppressErrors',['../group___debug.html#a48b673772893c29c426e98f8c84f0206',1,'manifold::ExecutionParams']]] +]; diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js new file mode 100644 index 000000000..411e607a3 --- /dev/null +++ b/docs/html/search/all_12.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['tetpuzzle_0',['TetPuzzle',['../group___samples.html#ga49162c3a42d672758d14855ad23258b9',1,'manifold']]], + ['tetrahedron_1',['Tetrahedron',['../classmanifold_1_1_manifold.html#afbd42733f05fb87dec1b3dae9ff9f582',1,'manifold::Manifold']]], + ['timer_2',['Timer',['../structmanifold_1_1_timer.html',1,'manifold']]], + ['tmpedge_3',['TmpEdge',['../structmanifold_1_1_tmp_edge.html',1,'manifold']]], + ['tmpinvalid_4',['TmpInvalid',['../structmanifold_1_1_tmp_invalid.html',1,'manifold']]], + ['topologyerr_5',['topologyErr',['../structmanifold_1_1topology_err.html',1,'manifold']]], + ['topolygons_6',['ToPolygons',['../classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2',1,'manifold::CrossSection']]], + ['torusknot_7',['TorusKnot',['../group___samples.html#ga1937d6fee956f401ad9a3c9c2dc6eae2',1,'manifold']]], + ['transform_8',['Transform',['../structmanifold_1_1_box.html#a821dd8a461d5c6938968cd76125b2102',1,'manifold::Box::Transform()'],['../structmanifold_1_1_rect.html#a3c4003d2fc5299530dcce7deb9df54a2',1,'manifold::Rect::Transform()'],['../classmanifold_1_1_manifold.html#a707b0078fbb9bbad183812d7290630ce',1,'manifold::Manifold::Transform()'],['../classmanifold_1_1_cross_section.html#af6b6f90c21018d47d860713c60a8399c',1,'manifold::CrossSection::Transform()'],['../classmanifold_1_1_collider.html#ab82200ff01af703f3dfe49a02dfb7e32',1,'manifold::Collider::Transform()']]], + ['translate_9',['Translate',['../classmanifold_1_1_cross_section.html#a106b1c0c300c4820cd9f5ec2f683a0db',1,'manifold::CrossSection::Translate()'],['../classmanifold_1_1_manifold.html#ac1ebb85b775a3293bca68c2339762a08',1,'manifold::Manifold::Translate()']]], + ['tri_10',['tri',['../group___private.html#a15e0e24263c3a2cc742b9cfcbabedf88',1,'manifold::TriRef']]], + ['triangulate_11',['Triangulate',['../group___connections.html#ga1d01ff53289da0842e539ddf8cda5c96',1,'manifold']]], + ['triangulateidx_12',['TriangulateIdx',['../group___private.html#ga1e0bedc58e58ed72b02b49addf999b85',1,'manifold']]], + ['trimbyplane_13',['TrimByPlane',['../classmanifold_1_1_manifold.html#a1b711341093c115f6688cbcaae5c8741',1,'manifold::Manifold']]], + ['triref_14',['TriRef',['../group___private.html#structmanifold_1_1_tri_ref',1,'manifold']]], + ['triverts_15',['triVerts',['../structmanifold_1_1_mesh_g_l.html#afe0601a32ce917d3324b430a34f5d118',1,'manifold::MeshGL::triVerts()'],['../group___connections.html#a2e749255313f9e672d69b4a94bd8e73e',1,'manifold::Mesh::triVerts()']]], + ['type_5fcaster_3c_20glm_3a_3avec3_20_3e_16',['type_caster< glm::vec3 >',['../structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html',1,'nanobind::detail']]] +]; diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js new file mode 100644 index 000000000..4da6f5475 --- /dev/null +++ b/docs/html/search/all_13.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['union_0',['Union',['../structmanifold_1_1_box.html#ac35d2842beedafce43f5ae4dea7aef3b',1,'manifold::Box::Union(const glm::vec3 p)'],['../structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd',1,'manifold::Box::Union(const Box &box) const'],['../structmanifold_1_1_rect.html#af8cf47248b361c1f8eec6b22dedb4233',1,'manifold::Rect::Union(const glm::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']]], + ['updateboxes_3',['UpdateBoxes',['../classmanifold_1_1_collider.html#aa7a7428ba1ad21bb35acd27e4737aa45',1,'manifold::Collider']]], + ['usererr_4',['userErr',['../structmanifold_1_1user_err.html',1,'manifold']]] +]; diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js new file mode 100644 index 000000000..44ac44995 --- /dev/null +++ b/docs/html/search/all_14.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_20float_20_3e_2',['Vec< float >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3aivec3_20_3e_3',['Vec< glm::ivec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3avec3_20_3e_4',['Vec< glm::vec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3avec4_20_3e_5',['Vec< glm::vec4 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20int_20_3e_6',['Vec< int >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3abox_20_3e_7',['Vec< manifold::Box >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3ahalfedge_20_3e_8',['Vec< manifold::Halfedge >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3atriref_20_3e_9',['Vec< manifold::TriRef >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_10',['Vec< thrust::pair< int, int > >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint32_5ft_20_3e_11',['Vec< uint32_t >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint64_20_3e_12',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_13',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_14',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_15',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_16',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_17',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20float_20_3e_18',['VecView< float >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3aivec3_20_3e_19',['VecView< glm::ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec3_20_3e_20',['VecView< glm::vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec4_20_3e_21',['VecView< glm::vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_22',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_23',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_24',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_25',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_26',['VecView< thrust::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint32_5ft_20_3e_27',['VecView< uint32_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_28',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_29',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_30',['VecView< V >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['verbose_31',['verbose',['../group___debug.html#ab3f078684998b83967d507d0f453f454',1,'manifold::ExecutionParams']]], + ['vertcolor_32',['vertColor',['../group___mesh_i_o.html#ad7e76077d824291218e32c0bdea9d3ff',1,'manifold::Material']]], + ['vertexcollisionsz_33',['VertexCollisionsZ',['../structmanifold_1_1_manifold_1_1_impl.html#afdc4c1c73cab15b3a13853d04fee567a',1,'manifold::Manifold::Impl']]], + ['vertnormal_34',['vertNormal',['../group___connections.html#a7e3e35f7f7302164b545e6ea8e7cc6a6',1,'manifold::Mesh']]], + ['vertpos_35',['vertPos',['../group___connections.html#abe99befaf9804cdadc31f0233bf4827a',1,'manifold::Mesh']]], + ['vertproperties_36',['vertProperties',['../structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js new file mode 100644 index 000000000..334e9ab60 --- /dev/null +++ b/docs/html/search/all_15.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['warp_0',['Warp',['../classmanifold_1_1_cross_section.html#a6c51d81d2e730c4a3325b4ba9b3ead39',1,'manifold::CrossSection::Warp()'],['../classmanifold_1_1_manifold.html#aecb7b2e2a6a18a570154dec76658496c',1,'manifold::Manifold::Warp()']]], + ['wasm_2fjs_20examples_1',['WASM/JS Examples',['../index.html',1,'']]] +]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js new file mode 100644 index 000000000..05034a593 --- /dev/null +++ b/docs/html/search/all_2.js @@ -0,0 +1,32 @@ +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']]], + ['ccw_3',['CCW',['../group___connections.html#ga20f946797231119dd2b7260c216cda31',1,'manifold']]], + ['center_4',['Center',['../structmanifold_1_1_rect.html#a04bdce0e30cdda6f80ccb5255a12f7df',1,'manifold::Rect::Center()'],['../structmanifold_1_1_box.html#aa2116eed911ac1b0277788b05b0f663f',1,'manifold::Box::Center()']]], + ['circle_5',['Circle',['../classmanifold_1_1_cross_section.html#adcb3b6bc6e70c831ac8c1890277e8548',1,'manifold::CrossSection']]], + ['cleanuptriangles_6',['cleanupTriangles',['../group___debug.html#a85c1664e476e1da1b3d0973b3451857b',1,'manifold::ExecutionParams']]], + ['collider_7',['Collider',['../classmanifold_1_1_collider.html#a669c441365fc439e52cd655edd70856d',1,'manifold::Collider::Collider()'],['../classmanifold_1_1_collider.html',1,'Collider']]], + ['collisions_8',['Collisions',['../classmanifold_1_1_collider.html#a46782d8a38157f8011b0ecf273345739',1,'manifold::Collider']]], + ['color_9',['color',['../group___mesh_i_o.html#af3f2d7fd6f40d5dd418aef858956a49b',1,'manifold::Material']]], + ['colorchannels_10',['colorChannels',['../group___mesh_i_o.html#a0cb39f4007172ad6c0d647c9d0a5a4c7',1,'manifold::Material']]], + ['compactprops_11',['CompactProps',['../structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a',1,'manifold::Manifold::Impl']]], + ['compose_12',['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_13',['ConcurrentSharedPtr',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['concurrentsharedptr_3c_20impl_20_3e_14',['ConcurrentSharedPtr< Impl >',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['connections_15',['Connections',['../group___connections.html',1,'']]], + ['contains_16',['Contains',['../structmanifold_1_1_box.html#a1aa1ea08f35a830ecc80b2bc83c9bcce',1,'manifold::Box::Contains(const glm::vec3 &p) const'],['../structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d',1,'manifold::Box::Contains(const Box &box) const'],['../structmanifold_1_1_rect.html#a348dcfe50700c6ff69c6fa7641f7537d',1,'manifold::Rect::Contains(const glm::vec2 &p) const'],['../structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6',1,'manifold::Rect::Contains(const Rect &rect) const']]], + ['core_17',['Core',['../group___core.html',1,'']]], + ['cosd_18',['cosd',['../group___connections.html#ga502f5a841d8d1fcba289e167a1177bda',1,'manifold']]], + ['createhalfedges_19',['CreateHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#aff973f757a74082c8fc75b0f8054557d',1,'manifold::Manifold::Impl']]], + ['createtangents_20',['CreateTangents',['../structmanifold_1_1_manifold_1_1_impl.html#aa35fbb3d245eb24bdbd9e53d0660ad43',1,'manifold::Manifold::Impl']]], + ['crosssection_21',['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)'],['../classmanifold_1_1_cross_section.html',1,'CrossSection']]], + ['csgleafnode_22',['CsgLeafNode',['../classmanifold_1_1_csg_leaf_node.html',1,'manifold']]], + ['csgnode_23',['CsgNode',['../classmanifold_1_1_csg_node.html',1,'manifold']]], + ['csgopnode_24',['CsgOpNode',['../classmanifold_1_1_csg_op_node.html',1,'manifold']]], + ['cube_25',['Cube',['../classmanifold_1_1_manifold.html#a42a229536f08603883f7bf6329de589b',1,'manifold::Manifold']]], + ['cube_5fwith_5fdents_26',['cube_with_dents',['../namespacecube__with__dents.html',1,'']]], + ['cubevoid_27',['CubeVoid',['../struct_cube_void.html',1,'']]], + ['cylinder_28',['Cylinder',['../classmanifold_1_1_manifold.html#ad13bd5caab7cb2ad363be98066b93a68',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js new file mode 100644 index 000000000..fdea4b755 --- /dev/null +++ b/docs/html/search/all_3.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['debug_0',['Debug',['../group___debug.html',1,'']]], + ['decompose_1',['Decompose',['../classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c',1,'manifold::CrossSection::Decompose()'],['../classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106',1,'manifold::Manifold::Decompose()']]], + ['deterministic_2',['deterministic',['../group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf',1,'manifold::ExecutionParams']]], + ['doesoverlap_3',['DoesOverlap',['../structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669',1,'manifold::Box::DoesOverlap(const Box &box) const'],['../structmanifold_1_1_box.html#a0eae49109f2471de7546d95c273f3461',1,'manifold::Box::DoesOverlap(glm::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/all_4.js b/docs/html/search/all_4.js new file mode 100644 index 000000000..1e273fb01 --- /dev/null +++ b/docs/html/search/all_4.js @@ -0,0 +1,11 @@ +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']]], + ['evenodd_2',['EvenOdd',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390',1,'manifold::CrossSection']]], + ['exceptions_3',['Exceptions',['../group___exceptions.html',1,'']]], + ['executionparams_4',['ExecutionParams',['../group___debug.html#structmanifold_1_1_execution_params',1,'manifold']]], + ['exportmesh_5',['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_6',['ExportOptions',['../group___mesh_i_o.html#structmanifold_1_1_export_options',1,'manifold']]], + ['extrude_7',['Extrude',['../classmanifold_1_1_manifold.html#ac7c16cfa9564e2af5367105ed4016763',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js new file mode 100644 index 000000000..cdf86f525 --- /dev/null +++ b/docs/html/search/all_5.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['face2polygons_0',['Face2Polygons',['../structmanifold_1_1_manifold_1_1_impl.html#a18302b33e785225a5380814a9920f78a',1,'manifold::Manifold::Impl']]], + ['face2tri_1',['Face2Tri',['../structmanifold_1_1_manifold_1_1_impl.html#af037f51003b109c22f6a67cea6238021',1,'manifold::Manifold::Impl']]], + ['faceid_2',['faceID',['../structmanifold_1_1_mesh_g_l.html#ac6e7182a9cef30c9644ee167fbff30e1',1,'manifold::MeshGL']]], + ['faceted_3',['faceted',['../group___mesh_i_o.html#a30d67be5305ec851cfd4e8e4a15c6d05',1,'manifold::ExportOptions']]], + ['fillrule_4',['FillRule',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4',1,'manifold::CrossSection']]], + ['finish_5',['Finish',['../structmanifold_1_1_manifold_1_1_impl.html#af9d1bc46635e487c85720b943dd8ba28',1,'manifold::Manifold::Impl']]], + ['firstnonfinite_6',['firstNonFinite',['../structmanifold_1_1_sparse_indices_1_1first_non_finite.html',1,'manifold::SparseIndices']]] +]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js new file mode 100644 index 000000000..c045cf7f5 --- /dev/null +++ b/docs/html/search/all_6.js @@ -0,0 +1,15 @@ +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']]], + ['getaxisalignedprojection_3',['GetAxisAlignedProjection',['../group___private.html#ga95945ec21500a4c02b449357b3ef57ec',1,'manifold']]], + ['getcircularsegments_4',['GetCircularSegments',['../classmanifold_1_1_quality.html#a7cd38ae559bc27df5e18b988176f82ae',1,'manifold::Quality']]], + ['getfaceboxmorton_5',['GetFaceBoxMorton',['../structmanifold_1_1_manifold_1_1_impl.html#ae950ed2beaef893ec411aa3921aa25a8',1,'manifold::Manifold::Impl']]], + ['getmesh_6',['GetMesh',['../classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750',1,'manifold::Manifold']]], + ['getmeshgl_7',['GetMeshGL',['../classmanifold_1_1_manifold.html#a5516d4d27772731e50540edd45553a4d',1,'manifold::Manifold']]], + ['getproperties_8',['GetProperties',['../classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07',1,'manifold::Manifold']]], + ['gyroid_5fmodule_9',['gyroid_module',['../namespacegyroid__module.html',1,'']]], + ['gyroidmodule_10',['GyroidModule',['../group___samples.html#ga0a03a270aa7eff0866996c7abca5b0f0',1,'manifold']]], + ['gyroidsdf_11',['GyroidSDF',['../struct_gyroid_s_d_f.html',1,'']]] +]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js new file mode 100644 index 000000000..3efa93615 --- /dev/null +++ b/docs/html/search/all_7.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['halfedge_0',['halfedge',['../group___connections.html#a92b70d1d84a0bf7e23f384f939dc426f',1,'manifold::Smoothness']]], + ['halfedge_1',['Halfedge',['../structmanifold_1_1_halfedge.html',1,'manifold']]], + ['halfedge2tmp_2',['Halfedge2Tmp',['../structmanifold_1_1_halfedge2_tmp.html',1,'manifold']]], + ['halfedgetangent_3',['halfedgeTangent',['../group___connections.html#a496f746871d5d54cf13f1935b0e4fc66',1,'manifold::Mesh::halfedgeTangent()'],['../structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5',1,'manifold::MeshGL::halfedgeTangent()']]], + ['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']]], + ['hashtabled_3c_20v_2c_20hash64bit_20_3e_7',['HashTableD< V, hash64bit >',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]], + ['how_20to_20contribute_8',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['hull_9',['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#a10a70ad7f357e93a96b86dd29fe12556',1,'manifold::Manifold::Hull(const std::vector< glm::vec3 > &pts)']]] +]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js new file mode 100644 index 000000000..026725218 --- /dev/null +++ b/docs/html/search/all_8.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['idx_0',['idx',['../group___private.html#ae40354a1051342eb5a9db005715dcfa9',1,'manifold::PolyVert']]], + ['impl_1',['Impl',['../structmanifold_1_1_manifold_1_1_impl.html#aee0b0018dab5d2d37fcaf2452e0e2fad',1,'manifold::Manifold::Impl::Impl(Shape)'],['../structmanifold_1_1_manifold_1_1_impl.html#a0993c9acd8bdbd25672b9fae02c02c0f',1,'manifold::Manifold::Impl::Impl(const Mesh &, const MeshRelationD &relation, const std::vector< float > &propertyTolerance={}, bool hasFaceIDs=false)'],['../structmanifold_1_1_manifold_1_1_impl.html',1,'Manifold::Impl']]], + ['importmesh_2',['ImportMesh',['../group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0',1,'manifold']]], + ['incrementmeshids_3',['IncrementMeshIDs',['../structmanifold_1_1_manifold_1_1_impl.html#a11d47359eb52523a2bc86f6d4ab22633',1,'manifold::Manifold::Impl']]], + ['intermediatechecks_4',['intermediateChecks',['../group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb',1,'manifold::ExecutionParams']]], + ['is2manifold_5',['Is2Manifold',['../structmanifold_1_1_manifold_1_1_impl.html#a7b0298da43b37952e432a1a0c4b02e00',1,'manifold::Manifold::Impl']]], + ['isempty_6',['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_7',['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_8',['IsIndexInBounds',['../structmanifold_1_1_manifold_1_1_impl.html#a0ee79d083b1fb6b58801ebf83d47880d',1,'manifold::Manifold::Impl']]], + ['ismanifold_9',['IsManifold',['../structmanifold_1_1_manifold_1_1_impl.html#a28f34ca6c256f1f7fa44e862540ec421',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js new file mode 100644 index 000000000..7b4fe3d01 --- /dev/null +++ b/docs/html/search/all_9.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/all_a.js b/docs/html/search/all_a.js new file mode 100644 index 000000000..61fc6d0cc --- /dev/null +++ b/docs/html/search/all_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['layers_0',['Layers',['../struct_layers.html',1,'']]], + ['levelset_1',['LevelSet',['../group___core.html#ga7e9804ea4f23462a8a8bdec4fb826a73',1,'manifold']]] +]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js new file mode 100644 index 000000000..98cc3cd81 --- /dev/null +++ b/docs/html/search/all_b.js @@ -0,0 +1,29 @@ +var searchData= +[ + ['manifold_0',['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()']]], + ['manifold_1',['manifold',['../namespacemanifold.html',1,'']]], + ['manifold_2',['Manifold',['../classmanifold_1_1_manifold.html',1,'manifold']]], + ['manifoldivec3_3',['ManifoldIVec3',['../struct_manifold_i_vec3.html',1,'']]], + ['manifoldmanifoldpair_4',['ManifoldManifoldPair',['../struct_manifold_manifold_pair.html',1,'']]], + ['manifoldparams_5',['ManifoldParams',['../group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275',1,'manifold']]], + ['manifoldproperties_6',['ManifoldProperties',['../struct_manifold_properties.html',1,'']]], + ['manifoldvec2_7',['ManifoldVec2',['../struct_manifold_vec2.html',1,'']]], + ['manifoldvec3_8',['ManifoldVec3',['../struct_manifold_vec3.html',1,'']]], + ['manifoldvec4_9',['ManifoldVec4',['../struct_manifold_vec4.html',1,'']]], + ['mat_10',['mat',['../group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60',1,'manifold::ExportOptions']]], + ['matchestrinormals_11',['MatchesTriNormals',['../structmanifold_1_1_manifold_1_1_impl.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::Impl::MatchesTriNormals()'],['../classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::MatchesTriNormals()']]], + ['material_12',['Material',['../group___mesh_i_o.html#structmanifold_1_1_material',1,'manifold']]], + ['mengersponge_13',['MengerSponge',['../group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae',1,'manifold']]], + ['merge_14',['Merge',['../structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254',1,'manifold::MeshGL']]], + ['mergefromvert_15',['mergeFromVert',['../structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078',1,'manifold::MeshGL']]], + ['mergetovert_16',['mergeToVert',['../structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a',1,'manifold::MeshGL']]], + ['mesh_17',['Mesh',['../group___connections.html#structmanifold_1_1_mesh',1,'manifold']]], + ['meshgl_18',['MeshGL',['../structmanifold_1_1_mesh_g_l.html',1,'MeshGL'],['../structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed',1,'manifold::MeshGL::MeshGL()']]], + ['meshid_19',['meshID',['../group___private.html#a3552b302dec169446141ae02c7a2dc12',1,'manifold::TriRef']]], + ['meshio_20',['MeshIO',['../group___mesh_i_o.html',1,'']]], + ['meshrelationd_21',['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_22',['MeshSize',['../struct_mesh_size.html',1,'']]], + ['metalness_23',['metalness',['../group___mesh_i_o.html#ad877087793da649b455041e10f4ed73f',1,'manifold::Material']]], + ['mirror_24',['Mirror',['../classmanifold_1_1_cross_section.html#adf67b7a277a85b21115f7063361da2ff',1,'manifold::CrossSection::Mirror()'],['../classmanifold_1_1_manifold.html#a90bbf2842d0a2dc394d32f1a0a32c24a',1,'manifold::Manifold::Mirror()']]], + ['miter_25',['Miter',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js new file mode 100644 index 000000000..2da995886 --- /dev/null +++ b/docs/html/search/all_c.js @@ -0,0 +1,15 @@ +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']]], + ['normalchannels_2',['normalChannels',['../group___mesh_i_o.html#afb46049a7293c3951d7c56b42701beaf',1,'manifold::Material']]], + ['numcontour_3',['NumContour',['../classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c',1,'manifold::CrossSection']]], + ['numdegeneratetris_4',['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_5',['NumEdge',['../classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a',1,'manifold::Manifold']]], + ['numoverlaps_6',['NumOverlaps',['../classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704',1,'manifold::Manifold']]], + ['numprop_7',['numProp',['../structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75',1,'manifold::MeshGL']]], + ['numprop_8',['NumProp',['../classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348',1,'manifold::Manifold']]], + ['numpropvert_9',['NumPropVert',['../classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d',1,'manifold::Manifold']]], + ['numtri_10',['NumTri',['../structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6',1,'manifold::MeshGL::NumTri()'],['../classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6',1,'manifold::Manifold::NumTri()']]], + ['numvert_11',['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_d.js b/docs/html/search/all_d.js new file mode 100644 index 000000000..a09855c78 --- /dev/null +++ b/docs/html/search/all_d.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['offset_0',['Offset',['../classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a',1,'manifold::CrossSection']]], + ['operator_2a_1',['operator*',['../structmanifold_1_1_box.html#a60e8048a284bf5f5de8bc93fe2e3b617',1,'manifold::Box::operator*()'],['../structmanifold_1_1_rect.html#a2ef09e7a095674473637a34b26b4b389',1,'manifold::Rect::operator*()']]], + ['operator_2a_3d_2',['operator*=',['../structmanifold_1_1_box.html#af62267ab92ad369671e2cb34a296d4fc',1,'manifold::Box::operator*=()'],['../structmanifold_1_1_rect.html#aec959d2e100436dce6e226adb93ce9aa',1,'manifold::Rect::operator*=()']]], + ['operator_2b_3',['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#af972bb4de52bdc0a952d4a6907f53e67',1,'manifold::Box::operator+()'],['../structmanifold_1_1_rect.html#a3b80b2b8aa4ae73c6b4be29b7d4f09fc',1,'manifold::Rect::operator+(const glm::vec2 shift) const']]], + ['operator_2b_3d_4',['operator+=',['../structmanifold_1_1_rect.html#a88e57e987bcbbc947831388b367fa036',1,'manifold::Rect::operator+=()'],['../structmanifold_1_1_box.html#a994c4a973b15e5f2f7dbccb7b5dc19d4',1,'manifold::Box::operator+=()'],['../classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688',1,'manifold::Manifold::operator+=()'],['../classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a',1,'manifold::CrossSection::operator+=(const CrossSection &)']]], + ['operator_2d_5',['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_6',['operator-=',['../classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0',1,'manifold::CrossSection::operator-=()'],['../classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b',1,'manifold::Manifold::operator-=()']]], + ['operator_5e_7',['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_8',['operator^=',['../classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3',1,'manifold::CrossSection::operator^=()'],['../classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522',1,'manifold::Manifold::operator^=()']]], + ['options_9',['Options',['../struct_options.html',1,'']]], + ['optype_10',['OpType',['../group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969',1,'manifold']]], + ['originalid_11',['originalID',['../structmanifold_1_1_manifold_1_1_impl.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::Manifold::Impl::MeshRelationD::originalID()'],['../group___private.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::TriRef::originalID()']]], + ['originalid_12',['OriginalID',['../classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js new file mode 100644 index 000000000..ea18fa4a6 --- /dev/null +++ b/docs/html/search/all_e.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['pathimpl_0',['PathImpl',['../structmanifold_1_1_path_impl.html',1,'manifold']]], + ['polygons_1',['Polygons',['../group___connections.html#ga60a66d8ddacc086bb45d8afc37f646d1',1,'manifold']]], + ['polyvert_2',['PolyVert',['../group___private.html#structmanifold_1_1_poly_vert',1,'manifold']]], + ['pos_3',['pos',['../group___private.html#a6f4c30bf2e24353492937851cb470208',1,'manifold::PolyVert']]], + ['positive_4',['Positive',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147',1,'manifold::CrossSection']]], + ['precision_5',['Precision',['../classmanifold_1_1_manifold.html#a013e5ce70b14d7d19393bcdffbc73ce2',1,'manifold::Manifold']]], + ['precision_6',['precision',['../structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141',1,'manifold::MeshGL::precision()'],['../group___connections.html#acd76b1c12cd41083eeef7b6f09c32141',1,'manifold::Mesh::precision()']]], + ['private_7',['Private',['../group___private.html',1,'']]], + ['processoverlaps_8',['processOverlaps',['../group___debug.html#a7166fd3caef3744f7241075f21f76af3',1,'manifold::ExecutionParams']]], + ['properties_9',['Properties',['../group___connections.html#structmanifold_1_1_properties',1,'manifold']]] +]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js new file mode 100644 index 000000000..6ef66f21f --- /dev/null +++ b/docs/html/search/all_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['quality_0',['Quality',['../classmanifold_1_1_quality.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js new file mode 100644 index 000000000..37d0992a0 --- /dev/null +++ b/docs/html/search/classes_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['barycentric_0',['Barycentric',['../group___private.html#structmanifold_1_1_barycentric',1,'manifold']]], + ['boolean3_1',['Boolean3',['../classmanifold_1_1_boolean3.html',1,'manifold']]], + ['box_2',['Box',['../structmanifold_1_1_box.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_1.js b/docs/html/search/classes_1.js new file mode 100644 index 000000000..907ae7d64 --- /dev/null +++ b/docs/html/search/classes_1.js @@ -0,0 +1,11 @@ +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']]], + ['crosssection_3',['CrossSection',['../classmanifold_1_1_cross_section.html',1,'manifold']]], + ['csgleafnode_4',['CsgLeafNode',['../classmanifold_1_1_csg_leaf_node.html',1,'manifold']]], + ['csgnode_5',['CsgNode',['../classmanifold_1_1_csg_node.html',1,'manifold']]], + ['csgopnode_6',['CsgOpNode',['../classmanifold_1_1_csg_op_node.html',1,'manifold']]], + ['cubevoid_7',['CubeVoid',['../struct_cube_void.html',1,'']]] +]; diff --git a/docs/html/search/classes_10.js b/docs/html/search/classes_10.js new file mode 100644 index 000000000..263391ca8 --- /dev/null +++ b/docs/html/search/classes_10.js @@ -0,0 +1,34 @@ +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_20float_20_3e_2',['Vec< float >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3aivec3_20_3e_3',['Vec< glm::ivec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3avec3_20_3e_4',['Vec< glm::vec3 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20glm_3a_3avec4_20_3e_5',['Vec< glm::vec4 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20int_20_3e_6',['Vec< int >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3abox_20_3e_7',['Vec< manifold::Box >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3ahalfedge_20_3e_8',['Vec< manifold::Halfedge >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20manifold_3a_3atriref_20_3e_9',['Vec< manifold::TriRef >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_10',['Vec< thrust::pair< int, int > >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint32_5ft_20_3e_11',['Vec< uint32_t >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20uint64_20_3e_12',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_13',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_14',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_15',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_16',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_17',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20float_20_3e_18',['VecView< float >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3aivec3_20_3e_19',['VecView< glm::ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec3_20_3e_20',['VecView< glm::vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec4_20_3e_21',['VecView< glm::vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_22',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_23',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_24',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_25',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_26',['VecView< thrust::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint32_5ft_20_3e_27',['VecView< uint32_t >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_28',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_29',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_30',['VecView< V >',['../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..81c92bdc8 --- /dev/null +++ b/docs/html/search/classes_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['edge_0',['Edge',['../struct_edge.html',1,'']]], + ['executionparams_1',['ExecutionParams',['../group___debug.html#structmanifold_1_1_execution_params',1,'manifold']]], + ['exportoptions_2',['ExportOptions',['../group___mesh_i_o.html#structmanifold_1_1_export_options',1,'manifold']]] +]; diff --git a/docs/html/search/classes_3.js b/docs/html/search/classes_3.js new file mode 100644 index 000000000..78299d94e --- /dev/null +++ b/docs/html/search/classes_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['firstnonfinite_0',['firstNonFinite',['../structmanifold_1_1_sparse_indices_1_1first_non_finite.html',1,'manifold::SparseIndices']]] +]; diff --git a/docs/html/search/classes_4.js b/docs/html/search/classes_4.js new file mode 100644 index 000000000..824a99918 --- /dev/null +++ b/docs/html/search/classes_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['geometryerr_0',['geometryErr',['../structmanifold_1_1geometry_err.html',1,'manifold']]], + ['gyroidsdf_1',['GyroidSDF',['../struct_gyroid_s_d_f.html',1,'']]] +]; diff --git a/docs/html/search/classes_5.js b/docs/html/search/classes_5.js new file mode 100644 index 000000000..0a0f731c6 --- /dev/null +++ b/docs/html/search/classes_5.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['halfedge_0',['Halfedge',['../structmanifold_1_1_halfedge.html',1,'manifold']]], + ['halfedge2tmp_1',['Halfedge2Tmp',['../structmanifold_1_1_halfedge2_tmp.html',1,'manifold']]], + ['hash_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_2',['hash< std::pair< int, int > >',['../structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html',1,'std']]], + ['hashtable_3',['HashTable',['../classmanifold_1_1_hash_table.html',1,'manifold']]], + ['hashtabled_4',['HashTableD',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]], + ['hashtabled_3c_20v_2c_20hash64bit_20_3e_5',['HashTableD< V, hash64bit >',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_6.js b/docs/html/search/classes_6.js new file mode 100644 index 000000000..e4549cae9 --- /dev/null +++ b/docs/html/search/classes_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['impl_0',['Impl',['../structmanifold_1_1_manifold_1_1_impl.html',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/classes_7.js b/docs/html/search/classes_7.js new file mode 100644 index 000000000..940c7fa56 --- /dev/null +++ b/docs/html/search/classes_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['layers_0',['Layers',['../struct_layers.html',1,'']]] +]; diff --git a/docs/html/search/classes_8.js b/docs/html/search/classes_8.js new file mode 100644 index 000000000..5d5e44dea --- /dev/null +++ b/docs/html/search/classes_8.js @@ -0,0 +1,15 @@ +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']]], + ['meshgl_9',['MeshGL',['../structmanifold_1_1_mesh_g_l.html',1,'manifold']]], + ['meshrelationd_10',['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_11',['MeshSize',['../struct_mesh_size.html',1,'']]] +]; diff --git a/docs/html/search/classes_9.js b/docs/html/search/classes_9.js new file mode 100644 index 000000000..869ec5188 --- /dev/null +++ b/docs/html/search/classes_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['options_0',['Options',['../struct_options.html',1,'']]] +]; diff --git a/docs/html/search/classes_a.js b/docs/html/search/classes_a.js new file mode 100644 index 000000000..7d83b5884 --- /dev/null +++ b/docs/html/search/classes_a.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['pathimpl_0',['PathImpl',['../structmanifold_1_1_path_impl.html',1,'manifold']]], + ['polyvert_1',['PolyVert',['../group___private.html#structmanifold_1_1_poly_vert',1,'manifold']]], + ['properties_2',['Properties',['../group___connections.html#structmanifold_1_1_properties',1,'manifold']]] +]; diff --git a/docs/html/search/classes_b.js b/docs/html/search/classes_b.js new file mode 100644 index 000000000..6ef66f21f --- /dev/null +++ b/docs/html/search/classes_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['quality_0',['Quality',['../classmanifold_1_1_quality.html',1,'manifold']]] +]; diff --git a/docs/html/search/classes_c.js b/docs/html/search/classes_c.js new file mode 100644 index 000000000..d46029aff --- /dev/null +++ b/docs/html/search/classes_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['rect_0',['Rect',['../structmanifold_1_1_rect.html',1,'manifold']]], + ['reindexedge_1',['ReindexEdge',['../structmanifold_1_1_reindex_edge.html',1,'manifold']]], + ['relation_2',['Relation',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation',1,'manifold::Manifold::Impl']]] +]; diff --git a/docs/html/search/classes_d.js b/docs/html/search/classes_d.js new file mode 100644 index 000000000..add86b8d4 --- /dev/null +++ b/docs/html/search/classes_d.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['sharedptrguard_0',['SharedPtrGuard',['../classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html',1,'manifold::ConcurrentSharedPtr']]], + ['smoothness_1',['Smoothness',['../group___connections.html#structmanifold_1_1_smoothness',1,'manifold']]], + ['sparseindices_2',['SparseIndices',['../classmanifold_1_1_sparse_indices.html',1,'manifold']]], + ['stride_5ffunctor_3',['stride_functor',['../structmanifold_1_1strided__range_1_1stride__functor.html',1,'manifold::strided_range']]], + ['strided_5frange_4',['strided_range',['../classmanifold_1_1strided__range.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..3acc575f0 --- /dev/null +++ b/docs/html/search/classes_e.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['timer_0',['Timer',['../structmanifold_1_1_timer.html',1,'manifold']]], + ['tmpedge_1',['TmpEdge',['../structmanifold_1_1_tmp_edge.html',1,'manifold']]], + ['tmpinvalid_2',['TmpInvalid',['../structmanifold_1_1_tmp_invalid.html',1,'manifold']]], + ['topologyerr_3',['topologyErr',['../structmanifold_1_1topology_err.html',1,'manifold']]], + ['triref_4',['TriRef',['../group___private.html#structmanifold_1_1_tri_ref',1,'manifold']]], + ['type_5fcaster_3c_20glm_3a_3avec3_20_3e_5',['type_caster< glm::vec3 >',['../structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html',1,'nanobind::detail']]] +]; diff --git a/docs/html/search/classes_f.js b/docs/html/search/classes_f.js new file mode 100644 index 000000000..70b326a1a --- /dev/null +++ b/docs/html/search/classes_f.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/close.svg b/docs/html/search/close.svg new file mode 100644 index 000000000..a933eea1a --- /dev/null +++ b/docs/html/search/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + 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..6547dc4c7 --- /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#a10d5618fa11db90402e29c30fbf50096',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..b102a5a2b --- /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']]], + ['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#a4e57b8d753c7850eafadadd5c6712d0f',1,'manifold::Box::Box(const glm::vec3 p1, const glm::vec3 p2)']]] +]; diff --git a/docs/html/search/functions_10.js b/docs/html/search/functions_10.js new file mode 100644 index 000000000..f9bfc0ad7 --- /dev/null +++ b/docs/html/search/functions_10.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['tetpuzzle_0',['TetPuzzle',['../group___samples.html#ga49162c3a42d672758d14855ad23258b9',1,'manifold']]], + ['tetrahedron_1',['Tetrahedron',['../classmanifold_1_1_manifold.html#afbd42733f05fb87dec1b3dae9ff9f582',1,'manifold::Manifold']]], + ['topolygons_2',['ToPolygons',['../classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2',1,'manifold::CrossSection']]], + ['torusknot_3',['TorusKnot',['../group___samples.html#ga1937d6fee956f401ad9a3c9c2dc6eae2',1,'manifold']]], + ['transform_4',['Transform',['../classmanifold_1_1_collider.html#ab82200ff01af703f3dfe49a02dfb7e32',1,'manifold::Collider::Transform()'],['../classmanifold_1_1_cross_section.html#af6b6f90c21018d47d860713c60a8399c',1,'manifold::CrossSection::Transform()'],['../classmanifold_1_1_manifold.html#a707b0078fbb9bbad183812d7290630ce',1,'manifold::Manifold::Transform()'],['../structmanifold_1_1_box.html#a821dd8a461d5c6938968cd76125b2102',1,'manifold::Box::Transform()'],['../structmanifold_1_1_rect.html#a3c4003d2fc5299530dcce7deb9df54a2',1,'manifold::Rect::Transform()']]], + ['translate_5',['Translate',['../classmanifold_1_1_cross_section.html#a106b1c0c300c4820cd9f5ec2f683a0db',1,'manifold::CrossSection::Translate()'],['../classmanifold_1_1_manifold.html#ac1ebb85b775a3293bca68c2339762a08',1,'manifold::Manifold::Translate()']]], + ['triangulate_6',['Triangulate',['../group___connections.html#ga1d01ff53289da0842e539ddf8cda5c96',1,'manifold']]], + ['triangulateidx_7',['TriangulateIdx',['../group___private.html#ga1e0bedc58e58ed72b02b49addf999b85',1,'manifold']]], + ['trimbyplane_8',['TrimByPlane',['../classmanifold_1_1_manifold.html#a1b711341093c115f6688cbcaae5c8741',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..079a386d0 --- /dev/null +++ b/docs/html/search/functions_11.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['union_0',['Union',['../structmanifold_1_1_box.html#ac35d2842beedafce43f5ae4dea7aef3b',1,'manifold::Box::Union(const glm::vec3 p)'],['../structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd',1,'manifold::Box::Union(const Box &box) const'],['../structmanifold_1_1_rect.html#af8cf47248b361c1f8eec6b22dedb4233',1,'manifold::Rect::Union(const glm::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']]], + ['updateboxes_2',['UpdateBoxes',['../classmanifold_1_1_collider.html#aa7a7428ba1ad21bb35acd27e4737aa45',1,'manifold::Collider']]] +]; diff --git a/docs/html/search/functions_12.js b/docs/html/search/functions_12.js new file mode 100644 index 000000000..6b2a3f9a9 --- /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#afdc4c1c73cab15b3a13853d04fee567a',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..b633daf75 --- /dev/null +++ b/docs/html/search/functions_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['warp_0',['Warp',['../classmanifold_1_1_cross_section.html#a6c51d81d2e730c4a3325b4ba9b3ead39',1,'manifold::CrossSection::Warp()'],['../classmanifold_1_1_manifold.html#aecb7b2e2a6a18a570154dec76658496c',1,'manifold::Manifold::Warp()']]] +]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js new file mode 100644 index 000000000..e753d44c8 --- /dev/null +++ b/docs/html/search/functions_2.js @@ -0,0 +1,20 @@ +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']]], + ['ccw_3',['CCW',['../group___connections.html#ga20f946797231119dd2b7260c216cda31',1,'manifold']]], + ['center_4',['Center',['../structmanifold_1_1_box.html#aa2116eed911ac1b0277788b05b0f663f',1,'manifold::Box::Center()'],['../structmanifold_1_1_rect.html#a04bdce0e30cdda6f80ccb5255a12f7df',1,'manifold::Rect::Center()']]], + ['circle_5',['Circle',['../classmanifold_1_1_cross_section.html#adcb3b6bc6e70c831ac8c1890277e8548',1,'manifold::CrossSection']]], + ['collider_6',['Collider',['../classmanifold_1_1_collider.html#a669c441365fc439e52cd655edd70856d',1,'manifold::Collider']]], + ['collisions_7',['Collisions',['../classmanifold_1_1_collider.html#a46782d8a38157f8011b0ecf273345739',1,'manifold::Collider']]], + ['compactprops_8',['CompactProps',['../structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a',1,'manifold::Manifold::Impl']]], + ['compose_9',['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_10',['Contains',['../structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d',1,'manifold::Box::Contains()'],['../structmanifold_1_1_rect.html#aca39547495139ea25f2edd87569e10b6',1,'manifold::Rect::Contains(const Rect &rect) const'],['../structmanifold_1_1_rect.html#a348dcfe50700c6ff69c6fa7641f7537d',1,'manifold::Rect::Contains(const glm::vec2 &p) const'],['../structmanifold_1_1_box.html#a1aa1ea08f35a830ecc80b2bc83c9bcce',1,'manifold::Box::Contains()']]], + ['cosd_11',['cosd',['../group___connections.html#ga502f5a841d8d1fcba289e167a1177bda',1,'manifold']]], + ['createhalfedges_12',['CreateHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#aff973f757a74082c8fc75b0f8054557d',1,'manifold::Manifold::Impl']]], + ['createtangents_13',['CreateTangents',['../structmanifold_1_1_manifold_1_1_impl.html#aa35fbb3d245eb24bdbd9e53d0660ad43',1,'manifold::Manifold::Impl']]], + ['crosssection_14',['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_15',['Cube',['../classmanifold_1_1_manifold.html#a42a229536f08603883f7bf6329de589b',1,'manifold::Manifold']]], + ['cylinder_16',['Cylinder',['../classmanifold_1_1_manifold.html#ad13bd5caab7cb2ad363be98066b93a68',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..5e32e86aa --- /dev/null +++ b/docs/html/search/functions_3.js @@ -0,0 +1,6 @@ +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()']]], + ['doesoverlap_1',['DoesOverlap',['../structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669',1,'manifold::Box::DoesOverlap(const Box &box) const'],['../structmanifold_1_1_box.html#a0eae49109f2471de7546d95c273f3461',1,'manifold::Box::DoesOverlap(glm::vec3 p) const'],['../structmanifold_1_1_rect.html#ae9b86c34e407f27313804c9a7d30c8c2',1,'manifold::Rect::DoesOverlap()']]], + ['dump_2',['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..110155f66 --- /dev/null +++ b/docs/html/search/functions_4.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['edgecollisions_0',['EdgeCollisions',['../structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5',1,'manifold::Manifold::Impl']]], + ['exportmesh_1',['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_2',['Extrude',['../classmanifold_1_1_manifold.html#ac7c16cfa9564e2af5367105ed4016763',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..1ad655262 --- /dev/null +++ b/docs/html/search/functions_5.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['face2polygons_0',['Face2Polygons',['../structmanifold_1_1_manifold_1_1_impl.html#a18302b33e785225a5380814a9920f78a',1,'manifold::Manifold::Impl']]], + ['face2tri_1',['Face2Tri',['../structmanifold_1_1_manifold_1_1_impl.html#af037f51003b109c22f6a67cea6238021',1,'manifold::Manifold::Impl']]], + ['finish_2',['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..dc618c4c8 --- /dev/null +++ b/docs/html/search/functions_6.js @@ -0,0 +1,12 @@ +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#ga95945ec21500a4c02b449357b3ef57ec',1,'manifold']]], + ['getcircularsegments_3',['GetCircularSegments',['../classmanifold_1_1_quality.html#a7cd38ae559bc27df5e18b988176f82ae',1,'manifold::Quality']]], + ['getfaceboxmorton_4',['GetFaceBoxMorton',['../structmanifold_1_1_manifold_1_1_impl.html#ae950ed2beaef893ec411aa3921aa25a8',1,'manifold::Manifold::Impl']]], + ['getmesh_5',['GetMesh',['../classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750',1,'manifold::Manifold']]], + ['getmeshgl_6',['GetMeshGL',['../classmanifold_1_1_manifold.html#a5516d4d27772731e50540edd45553a4d',1,'manifold::Manifold']]], + ['getproperties_7',['GetProperties',['../classmanifold_1_1_manifold.html#ace809d84f44f59232653183bf86ece07',1,'manifold::Manifold']]], + ['gyroidmodule_8',['GyroidModule',['../group___samples.html#ga0a03a270aa7eff0866996c7abca5b0f0',1,'manifold']]] +]; diff --git a/docs/html/search/functions_7.js b/docs/html/search/functions_7.js new file mode 100644 index 000000000..7c74ce9c9 --- /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#a10a70ad7f357e93a96b86dd29fe12556',1,'manifold::Manifold::Hull(const std::vector< glm::vec3 > &pts)']]] +]; diff --git a/docs/html/search/functions_8.js b/docs/html/search/functions_8.js new file mode 100644 index 000000000..0d730d6c7 --- /dev/null +++ b/docs/html/search/functions_8.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['impl_0',['Impl',['../structmanifold_1_1_manifold_1_1_impl.html#aee0b0018dab5d2d37fcaf2452e0e2fad',1,'manifold::Manifold::Impl::Impl(Shape)'],['../structmanifold_1_1_manifold_1_1_impl.html#a0993c9acd8bdbd25672b9fae02c02c0f',1,'manifold::Manifold::Impl::Impl(const Mesh &, const MeshRelationD &relation, const std::vector< float > &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#a0ee79d083b1fb6b58801ebf83d47880d',1,'manifold::Manifold::Impl']]], + ['ismanifold_7',['IsManifold',['../structmanifold_1_1_manifold_1_1_impl.html#a28f34ca6c256f1f7fa44e862540ec421',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..5246685cf --- /dev/null +++ b/docs/html/search/functions_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['levelset_0',['LevelSet',['../group___core.html#ga7e9804ea4f23462a8a8bdec4fb826a73',1,'manifold']]] +]; diff --git a/docs/html/search/functions_a.js b/docs/html/search/functions_a.js new file mode 100644 index 000000000..819586559 --- /dev/null +++ b/docs/html/search/functions_a.js @@ -0,0 +1,10 @@ +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']]], + ['mirror_6',['Mirror',['../classmanifold_1_1_cross_section.html#adf67b7a277a85b21115f7063361da2ff',1,'manifold::CrossSection::Mirror()'],['../classmanifold_1_1_manifold.html#a90bbf2842d0a2dc394d32f1a0a32c24a',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..fd7e97574 --- /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..c81925cfa --- /dev/null +++ b/docs/html/search/functions_c.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['offset_0',['Offset',['../classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a',1,'manifold::CrossSection']]], + ['operator_2a_1',['operator*',['../structmanifold_1_1_box.html#a60e8048a284bf5f5de8bc93fe2e3b617',1,'manifold::Box::operator*()'],['../structmanifold_1_1_rect.html#a2ef09e7a095674473637a34b26b4b389',1,'manifold::Rect::operator*()']]], + ['operator_2a_3d_2',['operator*=',['../structmanifold_1_1_box.html#af62267ab92ad369671e2cb34a296d4fc',1,'manifold::Box::operator*=()'],['../structmanifold_1_1_rect.html#aec959d2e100436dce6e226adb93ce9aa',1,'manifold::Rect::operator*=()']]], + ['operator_2b_3',['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#af972bb4de52bdc0a952d4a6907f53e67',1,'manifold::Box::operator+()'],['../structmanifold_1_1_rect.html#a3b80b2b8aa4ae73c6b4be29b7d4f09fc',1,'manifold::Rect::operator+()']]], + ['operator_2b_3d_4',['operator+=',['../structmanifold_1_1_box.html#a994c4a973b15e5f2f7dbccb7b5dc19d4',1,'manifold::Box::operator+=()'],['../structmanifold_1_1_rect.html#a88e57e987bcbbc947831388b367fa036',1,'manifold::Rect::operator+=()'],['../classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688',1,'manifold::Manifold::operator+=()'],['../classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a',1,'manifold::CrossSection::operator+=(const CrossSection &)']]], + ['operator_2d_5',['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_6',['operator-=',['../classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0',1,'manifold::CrossSection::operator-=()'],['../classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b',1,'manifold::Manifold::operator-=()']]], + ['operator_5e_7',['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_8',['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_9',['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..dd0074ca0 --- /dev/null +++ b/docs/html/search/functions_d.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['precision_0',['Precision',['../classmanifold_1_1_manifold.html#a013e5ce70b14d7d19393bcdffbc73ce2',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..d0724091a --- /dev/null +++ b/docs/html/search/functions_e.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['rect_0',['Rect',['../structmanifold_1_1_rect.html#ae436fd0322c99157c5443a3385961e22',1,'manifold::Rect::Rect()'],['../structmanifold_1_1_rect.html#a00ed04e729457429ca773061236a3bee',1,'manifold::Rect::Rect(const glm::vec2 a, const glm::vec2 b)']]], + ['refine_1',['Refine',['../classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac',1,'manifold::Manifold']]], + ['reindexverts_2',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a9c45d5f57ab940c4a2682d6f11fdab40',1,'manifold::Manifold::Impl']]], + ['reserveids_3',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['revolve_4',['Revolve',['../classmanifold_1_1_manifold.html#aaf8fa0b43477e935d650c2f774d76c85',1,'manifold::Manifold']]], + ['rotate_5',['Rotate',['../classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629',1,'manifold::Manifold::Rotate()']]], + ['rotateup_6',['RotateUp',['../group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da',1,'manifold']]], + ['roundedframe_7',['RoundedFrame',['../group___samples.html#ga8d224b44ea69ea070ebad60e6c1abbb9',1,'manifold']]] +]; diff --git a/docs/html/search/functions_f.js b/docs/html/search/functions_f.js new file mode 100644 index 000000000..a40ca3cc8 --- /dev/null +++ b/docs/html/search/functions_f.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['scale_0',['Scale',['../classmanifold_1_1_manifold.html#ae06789ff9cbe03e56260538276dd8183',1,'manifold::Manifold::Scale()'],['../structmanifold_1_1_box.html#ac60a4c17cace9263b70bf5e5c6f43b58',1,'manifold::Box::Scale()'],['../structmanifold_1_1_rect.html#ac60a4c17cace9263b70bf5e5c6f43b58',1,'manifold::Rect::Scale()'],['../classmanifold_1_1_cross_section.html#af181324d8998fd89fa7a3e8bc7ef905c',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#a17d90e845a2c75a0ef859e3ec5363a9e',1,'manifold::Quality']]], + ['setmincircularedgelength_4',['SetMinCircularEdgeLength',['../classmanifold_1_1_quality.html#a6a3a5a1105d40f044f777f0e3c14506a',1,'manifold::Quality']]], + ['setprecision_5',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a32981853ceaf771ca541df5b5c6e085b',1,'manifold::Manifold::Impl']]], + ['setproperties_6',['SetProperties',['../classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389',1,'manifold::Manifold']]], + ['simplify_7',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_8',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_9',['sind',['../group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3',1,'manifold']]], + ['size_10',['Size',['../structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651',1,'manifold::Box::Size()'],['../structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71',1,'manifold::Rect::Size()']]], + ['smooth_11',['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={})']]], + ['sortfaces_12',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_13',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['sphere_14',['Sphere',['../classmanifold_1_1_manifold.html#a1fa0a21aed71099905b89a10bcde0539',1,'manifold::Manifold']]], + ['split_15',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['splitbyplane_16',['SplitByPlane',['../classmanifold_1_1_manifold.html#adc134d7a6dfbf8c74e5d531bbeb330cb',1,'manifold::Manifold']]], + ['square_17',['Square',['../classmanifold_1_1_cross_section.html#a6e14a9728e2b4a5912c70c8c1b42f029',1,'manifold::CrossSection']]], + ['status_18',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['stretchybracelet_19',['StretchyBracelet',['../group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3',1,'manifold']]], + ['subdivide_20',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#ad593b78dd8d75c23f3fe0faf04501ceb',1,'manifold::Manifold::Impl']]] +]; 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..403f03a21 --- /dev/null +++ b/docs/html/search/groups_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['debug_0',['Debug',['../group___debug.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..9eb049365 --- /dev/null +++ b/docs/html/search/groups_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['samples_0',['Samples',['../group___samples.html',1,'']]] +]; diff --git a/docs/html/search/mag.svg b/docs/html/search/mag.svg new file mode 100644 index 000000000..9f46b301e --- /dev/null +++ b/docs/html/search/mag.svg @@ -0,0 +1,37 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/docs/html/search/mag_d.svg b/docs/html/search/mag_d.svg new file mode 100644 index 000000000..b9a814c78 --- /dev/null +++ b/docs/html/search/mag_d.svg @@ -0,0 +1,37 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/docs/html/search/mag_sel.svg b/docs/html/search/mag_sel.svg new file mode 100644 index 000000000..03626f64a --- /dev/null +++ b/docs/html/search/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/docs/html/search/mag_seld.svg b/docs/html/search/mag_seld.svg new file mode 100644 index 000000000..6e720dcc9 --- /dev/null +++ b/docs/html/search/mag_seld.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + 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..c77632f7e --- /dev/null +++ b/docs/html/search/pages_0.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_1.js b/docs/html/search/pages_1.js new file mode 100644 index 000000000..87e2fa69c --- /dev/null +++ b/docs/html/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['wasm_2fjs_20examples_0',['WASM/JS Examples',['../index.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..e103a2621 --- /dev/null +++ b/docs/html/search/search.js @@ -0,0 +1,816 @@ +/* + @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) + { + 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"; + } + + searchResults.Search(searchValue); + + 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 + { + 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 + { + 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 "par.h"
+
18#include "sparse.h"
+
19#include "utils.h"
+
20#include "vec.h"
+
21
+
22namespace manifold {
+
23
+
27inline glm::vec3 SafeNormalize(glm::vec3 v) {
+
28 v = glm::normalize(v);
+
29 return glm::isfinite(v.x) ? v : glm::vec3(0);
+
30}
+
31
+
32inline float MaxPrecision(float minPrecision, const Box& bBox) {
+
33 float precision = glm::max(minPrecision, kTolerance * bBox.Scale());
+
34 return glm::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 glm::vec3 UVW(int vert, const glm::vec3* barycentric) {
+
44 glm::vec3 uvw(0.0f);
+
45 if (vert < 0) {
+
46 uvw[vert + 3] = 1;
+
47 } else {
+
48 uvw = barycentric[vert];
+
49 }
+
50 return uvw;
+
51}
+
52
+
53inline glm::mat3 NormalTransform(const glm::mat4x3& transform) {
+
54 return glm::inverse(glm::transpose(glm::mat3(transform)));
+
55}
+
56
+
61inline glm::mat3x2 GetAxisAlignedProjection(glm::vec3 normal) {
+
62 glm::vec3 absNormal = glm::abs(normal);
+
63 float xyzMax;
+
64 glm::mat2x3 projection;
+
65 if (absNormal.z > absNormal.x && absNormal.z > absNormal.y) {
+
66 projection = glm::mat2x3(1.0f, 0.0f, 0.0f, //
+
67 0.0f, 1.0f, 0.0f);
+
68 xyzMax = normal.z;
+
69 } else if (absNormal.y > absNormal.x) {
+
70 projection = glm::mat2x3(0.0f, 0.0f, 1.0f, //
+
71 1.0f, 0.0f, 0.0f);
+
72 xyzMax = normal.y;
+
73 } else {
+
74 projection = glm::mat2x3(0.0f, 1.0f, 0.0f, //
+
75 0.0f, 0.0f, 1.0f);
+
76 xyzMax = normal.x;
+
77 }
+
78 if (xyzMax < 0) projection[0] *= -1.0f;
+
79 return glm::transpose(projection);
+
80}
+
81
+
82inline glm::vec3 GetBarycentric(const glm::vec3& v, const glm::mat3& triPos,
+
83 float precision) {
+
84 const glm::mat3 edges(triPos[2] - triPos[1], triPos[0] - triPos[2],
+
85 triPos[1] - triPos[0]);
+
86 const glm::vec3 d2(glm::dot(edges[0], edges[0]), glm::dot(edges[1], edges[1]),
+
87 glm::dot(edges[2], edges[2]));
+
88 const int longSide = d2[0] > d2[1] && d2[0] > d2[2] ? 0
+
89 : d2[1] > d2[2] ? 1
+
90 : 2;
+
91 const glm::vec3 crossP = glm::cross(edges[0], edges[1]);
+
92 const float area2 = glm::dot(crossP, crossP);
+
93 const float tol2 = precision * precision;
+
94
+
95 glm::vec3 uvw(0);
+
96 for (const int i : {0, 1, 2}) {
+
97 const glm::vec3 dv = v - triPos[i];
+
98 if (glm::dot(dv, dv) < tol2) {
+
99 // Return exactly equal if within tolerance of vert.
+
100 uvw[i] = 1;
+
101 return uvw;
+
102 }
+
103 }
+
104
+
105 if (d2[longSide] < tol2) { // point
+
106 return glm::vec3(1, 0, 0);
+
107 } else if (area2 > d2[longSide] * tol2) { // triangle
+
108 for (const int i : {0, 1, 2}) {
+
109 const int j = Next3(i);
+
110 const glm::vec3 crossPv = glm::cross(edges[i], v - triPos[j]);
+
111 const float area2v = glm::dot(crossPv, crossPv);
+
112 // Return exactly equal if within tolerance of edge.
+
113 uvw[i] = area2v < d2[i] * tol2 ? 0 : glm::dot(crossPv, crossP);
+
114 }
+
115 uvw /= (uvw[0] + uvw[1] + uvw[2]);
+
116 return uvw;
+
117 } else { // line
+
118 const int nextV = Next3(longSide);
+
119 const float alpha =
+
120 glm::dot(v - triPos[nextV], edges[longSide]) / d2[longSide];
+
121 uvw[longSide] = 0;
+
122 uvw[nextV] = 1 - alpha;
+
123 const int lastV = Next3(nextV);
+
124 uvw[lastV] = alpha;
+
125 return uvw;
+
126 }
+
127}
+
128
+
133struct Halfedge {
+
134 int startVert, endVert;
+
135 int pairedHalfedge;
+
136 int face;
+
137 bool IsForward() const { return startVert < endVert; }
+
138 bool operator<(const Halfedge& other) const {
+
139 return startVert == other.startVert ? endVert < other.endVert
+
140 : startVert < other.startVert;
+
141 }
+
142};
+
143
+ +
145 int tri;
+
146 glm::vec3 uvw;
+
147};
+
148
+
149struct TriRef {
+ + +
159 int tri;
+
160};
+
161
+
166struct TmpEdge {
+
167 int first, second, halfedgeIdx;
+
168
+
169 TmpEdge() {}
+
170 TmpEdge(int start, int end, int idx) {
+
171 first = glm::min(start, end);
+
172 second = glm::max(start, end);
+
173 halfedgeIdx = idx;
+
174 }
+
175
+
176 bool operator<(const TmpEdge& other) const {
+
177 return first == other.first ? second < other.second : first < other.first;
+
178 }
+
179};
+ +
183 void operator()(thrust::tuple<TmpEdge&, const Halfedge&, int> inout) {
+
184 const Halfedge& halfedge = thrust::get<1>(inout);
+
185 int idx = thrust::get<2>(inout);
+
186 if (!halfedge.IsForward()) idx = -1;
+
187
+
188 thrust::get<0>(inout) = TmpEdge(halfedge.startVert, halfedge.endVert, idx);
+
189 }
+
190};
+
191
+ +
193 bool operator()(const TmpEdge& edge) { return edge.halfedgeIdx < 0; }
+
194};
+
195
+
196Vec<TmpEdge> inline CreateTmpEdges(const Vec<Halfedge>& halfedge) {
+
197 Vec<TmpEdge> edges(halfedge.size());
+
198 for_each_n(autoPolicy(edges.size()),
+
199 zip(edges.begin(), halfedge.begin(), countAt(0)), edges.size(),
+
200 Halfedge2Tmp());
+
201 int numEdge =
+
202 remove_if<decltype(edges.begin())>(
+
203 autoPolicy(edges.size()), edges.begin(), edges.end(), TmpInvalid()) -
+
204 edges.begin();
+
205 ASSERT(numEdge == halfedge.size() / 2, topologyErr, "Not oriented!");
+
206 edges.resize(numEdge);
+
207 return edges;
+
208}
+
209
+
210template <const bool inverted>
+ + +
213 SparseIndices& indices;
+
214
+
215 void operator()(int i) {
+
216 int& edge = indices.Get(i, inverted);
+
217 edge = edges[edge].halfedgeIdx;
+
218 }
+
219};
+
220
+
221#ifdef MANIFOLD_DEBUG
+
222inline std::ostream& operator<<(std::ostream& stream, const Halfedge& edge) {
+
223 return stream << "startVert = " << edge.startVert
+
224 << ", endVert = " << edge.endVert
+
225 << ", pairedHalfedge = " << edge.pairedHalfedge
+
226 << ", face = " << edge.face;
+
227}
+
228
+
229inline std::ostream& operator<<(std::ostream& stream, const Barycentric& bary) {
+
230 return stream << "tri = " << bary.tri << ", uvw = " << bary.uvw;
+
231}
+
232
+
233inline std::ostream& operator<<(std::ostream& stream, const TriRef& ref) {
+
234 return stream << "meshID: " << ref.meshID
+
235 << ", originalID: " << ref.originalID << ", tri: " << ref.tri;
+
236}
+
237#endif
+
238} // namespace manifold
+
Definition: sparse.h:27
+
Definition: vec.h:139
+
Definition: vec.h:42
+
int tri
Definition: shared.h:159
+
int meshID
Definition: shared.h:153
+
int originalID
Definition: shared.h:156
+
glm::mat3x2 GetAxisAlignedProjection(glm::vec3 normal)
Definition: shared.h:61
+
Definition: shared.h:144
+
Definition: shared.h:149
+
Definition: meshIO.h:20
+
Definition: shared.h:182
+
Definition: shared.h:133
+
Definition: shared.h:211
+
Definition: shared.h:166
+
Definition: shared.h:192
+
Definition: public.h:587
+
+
+ + + + diff --git a/docs/html/sparse_8h_source.html b/docs/html/sparse_8h_source.html new file mode 100644 index 000000000..d82d9de62 --- /dev/null +++ b/docs/html/sparse_8h_source.html @@ -0,0 +1,318 @@ + + + + + + + +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 "optional_assert.h"
+
19#include "par.h"
+
20#include "public.h"
+
21#include "utils.h"
+
22#include "vec.h"
+
23
+
24namespace manifold {
+
25
+ +
28 // sparse indices where {p1: q1, p2: q2, ...} are laid out as
+
29 // p1 q1 p2 q2 or q1 p1 q2 p2, depending on endianness
+
30 // such that the indices are sorted by (p << 32) | q
+
31 public:
+
32#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
+
33 defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \
+
34 defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || \
+
35 defined(__MIBSEB__)
+
36 static constexpr size_t pOffset = 0;
+
37#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
+
38 defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \
+
39 defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \
+
40 defined(__MIPSEL) || defined(__MIPSEL__) || defined(__EMSCRIPTEN__) || \
+
41 defined(_WIN32)
+
42 static constexpr size_t pOffset = 1;
+
43#else
+
44#error "unknown architecture"
+
45#endif
+
46 static constexpr int64_t EncodePQ(int p, int q) {
+
47 return (int64_t(p) << 32) | q;
+
48 }
+
49
+
50 SparseIndices() = default;
+
51 SparseIndices(size_t size) : data_(size * sizeof(int64_t)) {}
+
52
+
53 int size() const { return data_.size() / sizeof(int64_t); }
+
54
+
55 Vec<int> Copy(bool use_q) const {
+
56 Vec<int> out(size());
+
57 int offset = pOffset;
+
58 if (use_q) offset = 1 - offset;
+
59 const int* p = ptr();
+
60 for_each(autoPolicy(out.size()), countAt(0), countAt((int)out.size()),
+
61 [&](int i) { out[i] = p[i * 2 + offset]; });
+
62 return out;
+
63 }
+
64
+
65 void Sort() {
+
66 VecView<int64_t> view = AsVec64();
+
67 stable_sort(autoPolicy(size()), view.begin(), view.end());
+
68 }
+
69
+
70 void Resize(int size) { data_.resize(size * sizeof(int64_t), -1); }
+
71
+
72 inline int& Get(int i, bool use_q) {
+
73 if (use_q)
+
74 return ptr()[2 * i + 1 - pOffset];
+
75 else
+
76 return ptr()[2 * i + pOffset];
+
77 }
+
78
+
79 inline int Get(int i, bool use_q) const {
+
80 if (use_q)
+
81 return ptr()[2 * i + 1 - pOffset];
+
82 else
+
83 return ptr()[2 * i + pOffset];
+
84 }
+
85
+
86 inline int64_t GetPQ(int i) const {
+
87 VecView<const int64_t> view = AsVec64();
+
88 return view[i];
+
89 }
+
90
+
91 inline void Set(int i, int p, int q) {
+
92 VecView<int64_t> view = AsVec64();
+
93 view[i] = EncodePQ(p, q);
+
94 }
+
95
+
96 inline void SetPQ(int i, int64_t pq) {
+
97 VecView<int64_t> view = AsVec64();
+
98 view[i] = pq;
+
99 }
+
100
+
101 VecView<int64_t> AsVec64() {
+
102 return VecView<int64_t>(reinterpret_cast<int64_t*>(data_.data()),
+
103 data_.size() / sizeof(int64_t));
+
104 }
+
105
+
106 VecView<const int64_t> AsVec64() const {
+ +
108 reinterpret_cast<const int64_t*>(data_.data()),
+
109 data_.size() / sizeof(int64_t));
+
110 }
+
111
+
112 VecView<int32_t> AsVec32() {
+
113 return VecView<int32_t>(reinterpret_cast<int32_t*>(data_.data()),
+
114 data_.size() / sizeof(int32_t));
+
115 }
+
116
+
117 VecView<const int32_t> AsVec32() const {
+ +
119 reinterpret_cast<const int32_t*>(data_.data()),
+
120 data_.size() / sizeof(int32_t));
+
121 }
+
122
+
123 inline void Add(int p, int q) {
+
124 for (int i = 0; i < sizeof(int64_t); ++i) data_.push_back(-1);
+
125 Set(size() - 1, p, q);
+
126 }
+
127
+
128 void Unique() {
+
129 Sort();
+
130 VecView<int64_t> view = AsVec64();
+
131 int newSize = std::unique(view.begin(), view.end()) - view.begin();
+
132 Resize(newSize);
+
133 }
+
134
+
135 size_t RemoveZeros(Vec<int>& S) {
+
136 ASSERT(S.size() == size(), userErr,
+
137 "Different number of values than indicies!");
+
138 VecView<int64_t> view = AsVec64();
+
139 auto zBegin = zip(S.begin(), view.begin());
+
140 auto zEnd = zip(S.end(), view.end());
+
141 size_t size =
+
142 remove_if<decltype(zBegin)>(autoPolicy(S.size()), zBegin, zEnd,
+
143 [](thrust::tuple<int, int64_t> x) {
+
144 return thrust::get<0>(x) == 0;
+
145 }) -
+
146 zBegin;
+
147 S.resize(size, -1);
+
148 Resize(size);
+
149 return size;
+
150 }
+
151
+
152 template <typename T>
+ +
154 bool NotFinite(float v) const { return !isfinite(v); }
+
155 bool NotFinite(glm::vec2 v) const { return !isfinite(v[0]); }
+
156 bool NotFinite(glm::vec3 v) const { return !isfinite(v[0]); }
+
157 bool NotFinite(glm::vec4 v) const { return !isfinite(v[0]); }
+
158
+
159 bool operator()(thrust::tuple<T, int, int64_t> x) const {
+
160 bool result = NotFinite(thrust::get<0>(x));
+
161 return result;
+
162 }
+
163 };
+
164
+
165 template <typename T>
+
166 size_t KeepFinite(Vec<T>& v, Vec<int>& x) {
+
167 ASSERT(x.size() == size(), userErr,
+
168 "Different number of values than indicies!");
+
169 VecView<int64_t> view = AsVec64();
+
170 auto zBegin = zip(v.begin(), x.begin(), view.begin());
+
171 auto zEnd = zip(v.end(), x.end(), view.end());
+
172 size_t size = remove_if<decltype(zBegin)>(autoPolicy(v.size()), zBegin,
+
173 zEnd, firstNonFinite<T>()) -
+
174 zBegin;
+
175 v.resize(size);
+
176 x.resize(size);
+
177 Resize(size);
+
178 return size;
+
179 }
+
180
+
181#ifdef MANIFOLD_DEBUG
+
182 void Dump() const {
+
183 std::cout << "SparseIndices = " << std::endl;
+
184 const int* p = ptr();
+
185 for (int i = 0; i < size(); ++i) {
+
186 std::cout << i << ", p = " << Get(i, false) << ", q = " << Get(i, true)
+
187 << std::endl;
+
188 }
+
189 std::cout << std::endl;
+
190 }
+
191#endif
+
192
+
193 private:
+
194 Vec<char> data_;
+
195 inline int* ptr() { return reinterpret_cast<int32_t*>(data_.data()); }
+
196 inline const int* ptr() const {
+
197 return reinterpret_cast<const int32_t*>(data_.data());
+
198 }
+
199};
+
200
+
201} // namespace manifold
+
Definition: sparse.h:27
+
Definition: vec.h:139
+
Definition: vec.h:42
+
Definition: meshIO.h:20
+ +
Definition: public.h:584
+
+
+ + + + 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..b400760f4 --- /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()(glm::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..a971b707d --- /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

+float operator() (glm::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..cb787c7f6 --- /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..38e057408 --- /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

+glm::vec2 west
 
+glm::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..19d996389 --- /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()(glm::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..ccb8359bc --- /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

+float operator() (glm::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..144123eb2 --- /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()(glm::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..67df46a60 --- /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

+float operator() (glm::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..10be56bc0 --- /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..69f778731 --- /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..c4bce99c6 --- /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..b44b643aa --- /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..5c50d1abe --- /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..6e7d3ca35 --- /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

+float surface_area
 
+float volume
 
+

Member Data Documentation

+ +

◆ surface_area

+ +
+
+ + + + +
float surface_area
+
+ +
+
+ +

◆ volume

+ +
+
+ + + + +
float 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..d00919267 --- /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..42ffca0a0 --- /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

+float x
 
+float y
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
float x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
float 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..a8efd34e9 --- /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..4bc107f1b --- /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

+float x
 
+float y
 
+float z
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
float x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
float y
+
+ +
+
+ +

◆ z

+ +
+
+ + + + +
float 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..58d2c80ab --- /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..9b3885af4 --- /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

+float x
 
+float y
 
+float z
 
+float w
 
+

Member Data Documentation

+ +

◆ x

+ +
+
+ + + + +
float x
+
+ +
+
+ +

◆ y

+ +
+
+ + + + +
float y
+
+ +
+
+ +

◆ z

+ +
+
+ + + + +
float z
+
+ +
+
+ +

◆ w

+ +
+
+ + + + +
float 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..e4394da77 --- /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..9b7061441 --- /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..cf82d4721 --- /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..518c880ad --- /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/structmanifold_1_1_box-members.html b/docs/html/structmanifold_1_1_box-members.html new file mode 100644 index 000000000..1eda4eec8 --- /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 glm::vec3 p1, const glm::vec3 p2)Boxinline
Center() constBoxinline
Contains(const glm::vec3 &p) constBoxinline
Contains(const Box &box) constBoxinline
DoesOverlap(const Box &box) constBoxinline
DoesOverlap(glm::vec3 p) constBoxinline
IsFinite() constBoxinline
max (defined in Box)Box
min (defined in Box)Box
operator*(glm::vec3 scale) constBoxinline
operator*=(glm::vec3 scale)Boxinline
operator+(glm::vec3 shift) constBoxinline
operator+=(glm::vec3 shift)Boxinline
Scale() constBoxinline
Size() constBoxinline
Transform(const glm::mat4x3 &transform) constBoxinline
Union(const glm::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..46ef3aab5 --- /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 glm::vec3 p1, const glm::vec3 p2)
 
glm::vec3 Size () const
 
glm::vec3 Center () const
 
float Scale () const
 
bool Contains (const glm::vec3 &p) const
 
bool Contains (const Box &box) const
 
void Union (const glm::vec3 p)
 
Box Union (const Box &box) const
 
Box Transform (const glm::mat4x3 &transform) const
 
Box operator+ (glm::vec3 shift) const
 
Boxoperator+= (glm::vec3 shift)
 
Box operator* (glm::vec3 scale) const
 
Boxoperator*= (glm::vec3 scale)
 
bool DoesOverlap (const Box &box) const
 
bool DoesOverlap (glm::vec3 p) const
 
bool IsFinite () const
 
+ + + + + +

+Public Attributes

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

Constructor & Destructor Documentation

+ +

◆ Box() [1/2]

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

Default constructor is an infinite box that contains all space.

+ +
+
+ +

◆ Box() [2/2]

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

Creates a box that contains the two given points.

+ +
+
+

Member Function Documentation

+ +

◆ Size()

+ +
+
+ + + + + +
+ + + + + + + +
glm::vec3 Size () const
+
+inline
+
+

Returns the dimensions of the Box.

+ +
+
+ +

◆ Center()

+ +
+
+ + + + + +
+ + + + + + + +
glm::vec3 Center () const
+
+inline
+
+

Returns the center point of the Box.

+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + +
+ + + + + + + +
float Scale () const
+
+inline
+
+

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

+ +
+
+ +

◆ Contains() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const glm::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 glm::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 glm::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+ (glm::vec3 shift) const
+
+inline
+
+

Shift this box by the given vector.

+ +
+
+ +

◆ operator+=()

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

Shift this box in-place by the given vector.

+ +
+
+ +

◆ operator*()

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

Scale this box by the given vector.

+ +
+
+ +

◆ operator*=()

+ +
+
+ + + + + +
+ + + + + + + + +
Box & operator*= (glm::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 (glm::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..343705cf8 --- /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#a4e57b8d753c7850eafadadd5c6712d0f", null ], + [ "Size", "structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651", null ], + [ "Center", "structmanifold_1_1_box.html#aa2116eed911ac1b0277788b05b0f663f", null ], + [ "Scale", "structmanifold_1_1_box.html#ac60a4c17cace9263b70bf5e5c6f43b58", null ], + [ "Contains", "structmanifold_1_1_box.html#a1aa1ea08f35a830ecc80b2bc83c9bcce", null ], + [ "Contains", "structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d", null ], + [ "Union", "structmanifold_1_1_box.html#ac35d2842beedafce43f5ae4dea7aef3b", null ], + [ "Union", "structmanifold_1_1_box.html#a8d8616c9f61502d6fe2331ba7a3dc7fd", null ], + [ "Transform", "structmanifold_1_1_box.html#a821dd8a461d5c6938968cd76125b2102", null ], + [ "operator+", "structmanifold_1_1_box.html#af972bb4de52bdc0a952d4a6907f53e67", null ], + [ "operator+=", "structmanifold_1_1_box.html#a994c4a973b15e5f2f7dbccb7b5dc19d4", null ], + [ "operator*", "structmanifold_1_1_box.html#a60e8048a284bf5f5de8bc93fe2e3b617", null ], + [ "operator*=", "structmanifold_1_1_box.html#af62267ab92ad369671e2cb34a296d4fc", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a46774b2491c515fa7f6d48c561395669", null ], + [ "DoesOverlap", "structmanifold_1_1_box.html#a0eae49109f2471de7546d95c273f3461", null ], + [ "IsFinite", "structmanifold_1_1_box.html#a33b7dcc502aae627fbc56bcfecf33af1", null ] +]; \ No newline at end of file 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..9a6191606 --- /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..8bc48906f --- /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_halfedge2_tmp-members.html b/docs/html/structmanifold_1_1_halfedge2_tmp-members.html new file mode 100644 index 000000000..6500d3a1f --- /dev/null +++ b/docs/html/structmanifold_1_1_halfedge2_tmp-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Halfedge2Tmp Member List
+
+
+ +

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

+ + +
operator()(thrust::tuple< TmpEdge &, const Halfedge &, int > inout) (defined in Halfedge2Tmp)Halfedge2Tmpinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_halfedge2_tmp.html b/docs/html/structmanifold_1_1_halfedge2_tmp.html new file mode 100644 index 000000000..0e6bd1c56 --- /dev/null +++ b/docs/html/structmanifold_1_1_halfedge2_tmp.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Halfedge2Tmp Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Halfedge2Tmp Struct Reference
+
+
+ + + + +

+Public Member Functions

+void operator() (thrust::tuple< TmpEdge &, const Halfedge &, int > inout)
 
+
+
+ + + + 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..f831c3708 --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl-members.html @@ -0,0 +1,182 @@ + + + + + + + +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
CollapseEdge(int edge, std::vector< int > &edges) (defined in Manifold::Impl)Manifold::Impl
CollapseTri(const glm::ivec3 &triEdge) (defined in Manifold::Impl)Manifold::Impl
collider_ (defined in Manifold::Impl)Manifold::Impl
CompactProps()Manifold::Impl
CreateFaces(const std::vector< float > &propertyTolerance={}) (defined in Manifold::Impl)Manifold::Impl
CreateHalfedges(const Vec< glm::ivec3 > &triVerts)Manifold::Impl
CreateTangents(const std::vector< Smoothness > &)Manifold::Impl
DedupeEdge(int edge) (defined in Manifold::Impl)Manifold::Impl
EdgeCollisions(const Impl &B, bool inverted=false) constManifold::Impl
Face2Polygons(int face, glm::mat3x2 projection, const Vec< int > &faceEdge) constManifold::Impl
Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)Manifold::Impl
faceNormal_ (defined in Manifold::Impl)Manifold::Impl
Finish()Manifold::Impl
FormLoop(int current, int end) (defined in Manifold::Impl)Manifold::Impl
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
GetProperties() const (defined in Manifold::Impl)Manifold::Impl
halfedge_ (defined in Manifold::Impl)Manifold::Impl
halfedgeTangent_ (defined in Manifold::Impl)Manifold::Impl
Impl() (defined in Manifold::Impl)Manifold::Implinline
Impl(Shape)Manifold::Impl
Impl(const MeshGL &, std::vector< float > propertyTolerance={}) (defined in Manifold::Impl)Manifold::Impl
Impl(const Mesh &, const MeshRelationD &relation, const std::vector< float > &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 glm::ivec3 > triVerts) constManifold::Impl
IsManifold() constManifold::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
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
RecursiveEdgeSwap(int edge, int &tag, std::vector< int > &visited, std::vector< int > &edgeSwapStack, std::vector< int > &edges) (defined in Manifold::Impl)Manifold::Impl
Refine(int n) (defined in Manifold::Impl)Manifold::Impl
ReindexVerts(const Vec< int > &vertNew2Old, int numOldVert)Manifold::Impl
RemoveIfFolded(int edge) (defined in Manifold::Impl)Manifold::Impl
RemoveUnreferencedVerts(Vec< glm::ivec3 > &triVerts) (defined in Manifold::Impl)Manifold::Impl
ReserveIDs(uint32_t) (defined in Manifold::Impl)Manifold::Implstatic
SetPrecision(float minPrecision=-1)Manifold::Impl
Shape enum name (defined in Manifold::Impl)Manifold::Impl
SimplifyTopology()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(int n)Manifold::Impl
Transform(const glm::mat4x3 &transform) const (defined in Manifold::Impl)Manifold::Impl
Update()Manifold::Impl
UpdateVert(int vert, int startEdge, int endEdge) (defined in Manifold::Impl)Manifold::Impl
VertexCollisionsZ(VecView< const glm::vec3 > vertsIn, bool inverted=false) constManifold::Impl
vertNormal_ (defined in Manifold::Impl)Manifold::Impl
vertPos_ (defined in Manifold::Impl)Manifold::Impl
Warp(std::function< void(glm::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..f3bbfe8e8 --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl.html @@ -0,0 +1,1030 @@ + + + + + + + +Manifold: Manifold::Impl Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + +

+Classes

struct  MeshRelationD
 
struct  Relation
 
+ + + +

+Public Types

enum class  Shape { Tetrahedron +, Cube +, Octahedron + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Impl (Shape)
 
Impl (const MeshGL &, std::vector< float > propertyTolerance={})
 
 Impl (const Mesh &, const MeshRelationD &relation, const std::vector< float > &propertyTolerance={}, bool hasFaceIDs=false)
 
+void CreateFaces (const std::vector< float > &propertyTolerance={})
 
+void RemoveUnreferencedVerts (Vec< glm::ivec3 > &triVerts)
 
+void InitializeOriginal ()
 
void CreateHalfedges (const Vec< glm::ivec3 > &triVerts)
 
void CalculateNormals ()
 
void IncrementMeshIDs ()
 
void Update ()
 
+void MarkFailure (Error status)
 
+void Warp (std::function< void(glm::vec3 &)> warpFunc)
 
+Impl Transform (const glm::mat4x3 &transform) const
 
SparseIndices EdgeCollisions (const Impl &B, bool inverted=false) const
 
SparseIndices VertexCollisionsZ (VecView< const glm::vec3 > vertsIn, bool inverted=false) const
 
+bool IsEmpty () const
 
+int NumVert () const
 
+int NumEdge () const
 
+int NumTri () const
 
+int NumProp () const
 
+int NumPropVert () const
 
+Properties GetProperties () const
 
+void CalculateCurvature (int gaussianIdx, int meanIdx)
 
void CalculateBBox ()
 
bool IsFinite () const
 
bool IsIndexInBounds (VecView< const glm::ivec3 > triVerts) const
 
void SetPrecision (float minPrecision=-1)
 
bool IsManifold () const
 
bool Is2Manifold () const
 
bool MatchesTriNormals () const
 
int NumDegenerateTris () const
 
void Finish ()
 
void SortVerts ()
 
void ReindexVerts (const Vec< int > &vertNew2Old, int 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 (int face, glm::mat3x2 projection, const Vec< int > &faceEdge) const
 
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 glm::ivec3 &triEdge)
 
+void SplitPinchedVerts ()
 
void CreateTangents (const std::vector< Smoothness > &)
 
Vec< BarycentricSubdivide (int n)
 
+void Refine (int n)
 
+ + + +

+Static Public Member Functions

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

+Public Attributes

+Box bBox_
 
+float precision_ = -1
 
+Error status_ = Error::NoError
 
+Vec< glm::vec3 > vertPos_
 
+Vec< Halfedgehalfedge_
 
+Vec< glm::vec3 > vertNormal_
 
+Vec< glm::vec3 > faceNormal_
 
+Vec< glm::vec4 > halfedgeTangent_
 
+MeshRelationD meshRelation_
 
+Collider collider_
 
+ + + +

+Static Public Attributes

+static std::atomic< uint32_t > meshIDCounter_
 
+

Class Documentation

+ +

◆ 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< float > +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 = glm::mat4x3(1) +
+bool +backSide = false +
+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Impl() [1/2]

+ +
+
+ + + + + + + + +
Impl (Shape shape)
+
+

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< float > & 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< glm::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 glm::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 glm::ivec3 > triVerts) const
+
+

Checks that the input triVerts array has all indices inside bounds of the vertPos_ array.

+ +
+
+ +

◆ SetPrecision()

+ +
+
+ + + + + + + + +
void SetPrecision (float 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,
int 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 (int face,
glm::mat3x2 projection,
const Vec< int > & faceEdge 
) const
+
+

For the input face index, return a set of 2D polygons formed by the input projection of the vertices.

+ +
+
+ +

◆ 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}.

+ +
+
+ +

◆ CreateTangents()

+ +
+
+ + + + + + + + +
void CreateTangents (const std::vector< Smoothness > & sharpenedEdges)
+
+

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.

+ +
+
+ +

◆ Subdivide()

+ +
+
+ + + + + + + + +
Vec< Barycentric > Subdivide (int n)
+
+

Split each edge into n pieces 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).

+ +
+
+
+
+ + + + 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..083a15816 --- /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..8db5e6584 --- /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.

+ +
+
+ +

◆ 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_path_impl-members.html b/docs/html/structmanifold_1_1_path_impl-members.html new file mode 100644 index 000000000..ef564d3e5 --- /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..ec007b340 --- /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_rect-members.html b/docs/html/structmanifold_1_1_rect-members.html new file mode 100644 index 000000000..bd8482af1 --- /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 glm::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 glm::vec2 scale) constRectinline
operator*=(const glm::vec2 scale)Rectinline
operator+(const glm::vec2 shift) constRectinline
operator+=(const glm::vec2 shift)Rectinline
Rect()Rectinline
Rect(const glm::vec2 a, const glm::vec2 b)Rectinline
Scale() constRectinline
Size() constRectinline
Transform(const glm::mat3x2 &m) constRectinline
Union(const glm::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..d41227639 --- /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 <public.h>

+ + + + + + +

+Public Member Functions

 Rect ()
 
 Rect (const glm::vec2 a, const glm::vec2 b)
 
+ + + + + +

+Public Attributes

+glm::vec2 min = glm::vec2(std::numeric_limits<float>::infinity())
 
+glm::vec2 max = glm::vec2(-std::numeric_limits<float>::infinity())
 
+ + + + + + + + + + + + + + + + + + + + +

Information

Details of the rectangle

+
glm::vec2 Size () const
 
float Area () const
 
float Scale () const
 
glm::vec2 Center () const
 
bool Contains (const glm::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 glm::vec2 p)
 
Rect Union (const Rect &rect) const
 
Rect operator+ (const glm::vec2 shift) const
 
Rectoperator+= (const glm::vec2 shift)
 
Rect operator* (const glm::vec2 scale) const
 
Rectoperator*= (const glm::vec2 scale)
 
Rect Transform (const glm::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 glm::vec2 a,
const glm::vec2 b 
)
+
+inline
+
+

Create a rectangle that contains the two given points.

+ +
+
+

Member Function Documentation

+ +

◆ Size()

+ +
+
+ + + + + +
+ + + + + + + +
glm::vec2 Size () const
+
+inline
+
+

Return the dimensions of the rectangle.

+ +
+
+ +

◆ Area()

+ +
+
+ + + + + +
+ + + + + + + +
float Area () const
+
+inline
+
+

Return the area of the rectangle.

+ +
+
+ +

◆ Scale()

+ +
+
+ + + + + +
+ + + + + + + +
float Scale () const
+
+inline
+
+

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

+ +
+
+ +

◆ Center()

+ +
+
+ + + + + +
+ + + + + + + +
glm::vec2 Center () const
+
+inline
+
+

Returns the center point of the rectangle.

+ +
+
+ +

◆ Contains() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Contains (const glm::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 glm::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 glm::vec2 shift) const
+
+inline
+
+

Shift this rectangle by the given vector.

+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect & operator+= (const glm::vec2 shift)
+
+inline
+
+

Shift this rectangle in-place by the given vector.

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect operator* (const glm::vec2 scale) const
+
+inline
+
+

Scale this rectangle by the given vector.

+ +
+
+ +

◆ operator*=()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect & operator*= (const glm::vec2 scale)
+
+inline
+
+

Scale this rectangle in-place by the given vector.

+ +
+
+ +

◆ Transform()

+ +
+
+ + + + + +
+ + + + + + + + +
Rect Transform (const glm::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..d158bc320 --- /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#a00ed04e729457429ca773061236a3bee", null ], + [ "Size", "structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71", null ], + [ "Area", "structmanifold_1_1_rect.html#a10d5618fa11db90402e29c30fbf50096", null ], + [ "Scale", "structmanifold_1_1_rect.html#ac60a4c17cace9263b70bf5e5c6f43b58", null ], + [ "Center", "structmanifold_1_1_rect.html#a04bdce0e30cdda6f80ccb5255a12f7df", null ], + [ "Contains", "structmanifold_1_1_rect.html#a348dcfe50700c6ff69c6fa7641f7537d", 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#af8cf47248b361c1f8eec6b22dedb4233", null ], + [ "Union", "structmanifold_1_1_rect.html#ac00b0b5a156d4a40a65637b7d419df70", null ], + [ "operator+", "structmanifold_1_1_rect.html#a3b80b2b8aa4ae73c6b4be29b7d4f09fc", null ], + [ "operator+=", "structmanifold_1_1_rect.html#a88e57e987bcbbc947831388b367fa036", null ], + [ "operator*", "structmanifold_1_1_rect.html#a2ef09e7a095674473637a34b26b4b389", null ], + [ "operator*=", "structmanifold_1_1_rect.html#aec959d2e100436dce6e226adb93ce9aa", null ], + [ "Transform", "structmanifold_1_1_rect.html#a3c4003d2fc5299530dcce7deb9df54a2", 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..23f02fab7 --- /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()(int 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..9d127a9a5 --- /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() (int i)
 
+ + + + + +

+Public Attributes

+VecView< const TmpEdgeedges
 
+SparseIndicesindices
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite-members.html b/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite-members.html new file mode 100644 index 000000000..954c5638f --- /dev/null +++ b/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
SparseIndices::firstNonFinite< T > Member List
+
+
+ +

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

+ + + + + + +
NotFinite(float v) const (defined in SparseIndices::firstNonFinite< T >)SparseIndices::firstNonFinite< T >inline
NotFinite(glm::vec2 v) const (defined in SparseIndices::firstNonFinite< T >)SparseIndices::firstNonFinite< T >inline
NotFinite(glm::vec3 v) const (defined in SparseIndices::firstNonFinite< T >)SparseIndices::firstNonFinite< T >inline
NotFinite(glm::vec4 v) const (defined in SparseIndices::firstNonFinite< T >)SparseIndices::firstNonFinite< T >inline
operator()(thrust::tuple< T, int, int64_t > x) const (defined in SparseIndices::firstNonFinite< T >)SparseIndices::firstNonFinite< T >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite.html b/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite.html new file mode 100644 index 000000000..c972f22e0 --- /dev/null +++ b/docs/html/structmanifold_1_1_sparse_indices_1_1first_non_finite.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: SparseIndices::firstNonFinite< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
SparseIndices::firstNonFinite< T > Struct Template Reference
+
+
+ + + + + + + + + + + + +

+Public Member Functions

+bool NotFinite (float v) const
 
+bool NotFinite (glm::vec2 v) const
 
+bool NotFinite (glm::vec3 v) const
 
+bool NotFinite (glm::vec4 v) const
 
+bool operator() (thrust::tuple< T, int, int64_t > x) 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..9bf7b43aa --- /dev/null +++ b/docs/html/structmanifold_1_1_timer-members.html @@ -0,0 +1,122 @@ + + + + + + + +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
Timer() (defined in Timer)Timerinline
~Timer() (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..92eb66ffe --- /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

+cudaEvent_t start
 
+cudaEvent_t 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..e1b35f71f --- /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..786077c4f --- /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_tmp_invalid-members.html b/docs/html/structmanifold_1_1_tmp_invalid-members.html new file mode 100644 index 000000000..9d9bf9455 --- /dev/null +++ b/docs/html/structmanifold_1_1_tmp_invalid-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TmpInvalid Member List
+
+
+ +

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

+ + +
operator()(const TmpEdge &edge) (defined in TmpInvalid)TmpInvalidinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tmp_invalid.html b/docs/html/structmanifold_1_1_tmp_invalid.html new file mode 100644 index 000000000..7b3c44f0b --- /dev/null +++ b/docs/html/structmanifold_1_1_tmp_invalid.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: TmpInvalid Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
TmpInvalid Struct Reference
+
+
+ + + + +

+Public Member Functions

+bool operator() (const TmpEdge &edge)
 
+
+
+ + + + 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..b5c3e35a7 --- /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..f4b327610 --- /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_1geometry_err.html b/docs/html/structmanifold_1_1geometry_err.html new file mode 100644 index 000000000..66bb6ae6a --- /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_1strided__range_1_1stride__functor-members.html b/docs/html/structmanifold_1_1strided__range_1_1stride__functor-members.html new file mode 100644 index 000000000..91b19c984 --- /dev/null +++ b/docs/html/structmanifold_1_1strided__range_1_1stride__functor-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
strided_range< Iterator >::stride_functor Member List
+
+
+ +

This is the complete list of members for strided_range< Iterator >::stride_functor, including all inherited members.

+ + + + +
operator()(const difference_type &i) const (defined in strided_range< Iterator >::stride_functor)strided_range< Iterator >::stride_functorinline
stride (defined in strided_range< Iterator >::stride_functor)strided_range< Iterator >::stride_functor
stride_functor(difference_type stride) (defined in strided_range< Iterator >::stride_functor)strided_range< Iterator >::stride_functorinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1strided__range_1_1stride__functor.html b/docs/html/structmanifold_1_1strided__range_1_1stride__functor.html new file mode 100644 index 000000000..4a3644c99 --- /dev/null +++ b/docs/html/structmanifold_1_1strided__range_1_1stride__functor.html @@ -0,0 +1,134 @@ + + + + + + + +Manifold: strided_range< Iterator >::stride_functor Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
strided_range< Iterator >::stride_functor Struct Reference
+
+
+ +

Inherits unary_function< difference_type, difference_type >.

+ + + + + + +

+Public Member Functions

stride_functor (difference_type stride)
 
+difference_type operator() (const difference_type &i) const
 
+ + + +

+Public Attributes

+difference_type stride
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1topology_err.html b/docs/html/structmanifold_1_1topology_err.html new file mode 100644 index 000000000..eddbd0b8e --- /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..ab1eb0b32 --- /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/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4-members.html b/docs/html/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4-members.html new file mode 100644 index 000000000..378a2606d --- /dev/null +++ b/docs/html/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< glm::vec3 > Member List
+
+
+ +

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

+ + + + + +
Caster typedef (defined in type_caster< glm::vec3 >)type_caster< glm::vec3 >
from_cpp(glm::vec3 vec, rv_policy policy, cleanup_list *ls) noexcept (defined in type_caster< glm::vec3 >)type_caster< glm::vec3 >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< glm::vec3 >)type_caster< glm::vec3 >inline
NB_TYPE_CASTER(glm::vec3, const_name("Vec3")) (defined in type_caster< glm::vec3 >)type_caster< glm::vec3 >
+
+ + + + diff --git a/docs/html/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html b/docs/html/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html new file mode 100644 index 000000000..0b42ea026 --- /dev/null +++ b/docs/html/structnanobind_1_1detail_1_1type__caster_3_01glm_1_1vec3_01_4.html @@ -0,0 +1,139 @@ + + + + + + + +Manifold: type_caster< glm::vec3 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< glm::vec3 > Struct Reference
+
+
+ + + + +

+Public Types

+using Caster = make_caster< float >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (glm::vec3, const_name("Vec3"))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (glm::vec3 vec, rv_policy policy, cleanup_list *ls) noexcept
 
+
+
+ + + + 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..42a946bea --- /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..f7cda93f5 --- /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/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..8fdbcd1ae --- /dev/null +++ b/docs/html/test_8h_source.html @@ -0,0 +1,183 @@ + + + + + + + +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.h"
+
20#include "public.h"
+
21
+
22// somehow gcc11 + gtest 1.11.0 is unable to print glm::ivec3
+
23namespace glm {
+
24inline void PrintTo(const ivec3& point, std::ostream* os) {
+
25 *os << "(" << point.x << "," << point.y << "," << point.x << ")";
+
26}
+
27} // namespace glm
+
28
+
29using namespace manifold;
+
30
+
31struct Options {
+
32 bool exportModels = false;
+
33 manifold::ExecutionParams params = {};
+
34};
+
35
+
36extern Options options;
+
37
+
38struct MeshSize {
+
39 int numVert, numTri;
+
40 int numProp = 0;
+
41 int numPropVert = numVert;
+
42};
+
43
+
44Polygons SquareHole(float xOffset = 0.0);
+
45Mesh Csaszar();
+
46Mesh Gyroid();
+
47Mesh Tet();
+
48MeshGL TetGL();
+
49MeshGL CubeSTL();
+
50MeshGL WithIndexColors(const Mesh& in);
+
51MeshGL WithPositionColors(const Manifold& in);
+
52MeshGL WithNormals(const Manifold& in);
+
53MeshGL CubeUV();
+
54float GetMaxProperty(const MeshGL& mesh, int channel);
+
55float GetMinProperty(const MeshGL& mesh, int channel);
+
56void Identical(const Mesh& mesh1, const Mesh& mesh2);
+
57void RelatedGL(const Manifold& out, const std::vector<MeshGL>& originals,
+
58 bool checkNormals = false, bool updateNormals = false);
+
59void ExpectMeshes(const Manifold& manifold,
+
60 const std::vector<MeshSize>& meshSize);
+
61void CheckNormals(const Manifold& manifold);
+
62void CheckStrictly(const Manifold& manifold);
+
63void CheckGL(const Manifold& manifold);
+
Definition: manifold.h:114
+
std::vector< SimplePolygon > Polygons
Definition: public.h:121
+
Definition: public.h:126
+
Definition: public.h:601
+
Definition: meshIO.h:20
+
Definition: test.h:38
+
Definition: test.h:31
+
Definition: manifold.h:46
+
+
+ + + + diff --git a/docs/html/types_8h_source.html b/docs/html/types_8h_source.html new file mode 100644 index 000000000..e32f1c9b9 --- /dev/null +++ b/docs/html/types_8h_source.html @@ -0,0 +1,224 @@ + + + + + + + +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 float x;
+
45 float y;
+ +
47
+
48typedef struct ManifoldVec3 {
+
49 float x;
+
50 float y;
+
51 float z;
+ +
53
+
54typedef struct ManifoldIVec3 {
+
55 int x;
+
56 int y;
+
57 int z;
+ +
59
+
60typedef struct ManifoldVec4 {
+
61 float x;
+
62 float y;
+
63 float z;
+
64 float w;
+ +
66
+
67typedef struct ManifoldProperties {
+
68 float surface_area;
+
69 float 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..5daf7cc77 --- /dev/null +++ b/docs/html/utils_8h_source.html @@ -0,0 +1,391 @@ + + + + + + + +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 "par.h"
+
27#include "vec.h"
+
28
+
29namespace manifold {
+
30
+
35#ifdef MANIFOLD_DEBUG
+
36inline void MemUsage() {
+
37#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
+
38 size_t free, total;
+
39 cudaMemGetInfo(&free, &total);
+
40 std::cout << "Using " << (total - free) / 1048575 << " Mb ("
+
41 << (100 * (total - free)) / total << " %)" << std::endl;
+
42#endif
+
43}
+
44
+
45struct Timer {
+
46#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
+
47 cudaEvent_t start, end;
+
48
+
49 Timer() {
+
50 cudaEventCreate(&start);
+
51 cudaEventCreate(&end);
+
52 }
+
53
+
54 ~Timer() {
+
55 cudaEventDestroy(start);
+
56 cudaEventDestroy(end);
+
57 }
+
58
+
59 void Start() { cudaEventRecord(start, 0); }
+
60
+
61 void Stop() { cudaEventRecord(end, 0); }
+
62
+
63 float Elapsed() {
+
64 cudaEventSynchronize(end);
+
65 float elapsed;
+
66 cudaEventElapsedTime(&elapsed, start, end);
+
67 return elapsed;
+
68 }
+
69#else
+
70 std::chrono::high_resolution_clock::time_point start, end;
+
71
+
72 void Start() { start = std::chrono::high_resolution_clock::now(); }
+
73
+
74 void Stop() { end = std::chrono::high_resolution_clock::now(); }
+
75
+
76 float Elapsed() {
+
77 return std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
+
78 .count();
+
79 }
+
80#endif
+
81 void Print(std::string message) {
+
82 std::cout << "----------- " << std::round(Elapsed()) << " ms for "
+
83 << message << std::endl;
+
84 }
+
85};
+
86#endif
+
87
+
88template <typename... Iters>
+
89thrust::zip_iterator<thrust::tuple<Iters...>> zip(Iters... iters) {
+
90 return thrust::make_zip_iterator(thrust::make_tuple(iters...));
+
91}
+
92
+
93template <typename A, typename B>
+
94thrust::permutation_iterator<A, B> perm(A a, B b) {
+
95 return thrust::make_permutation_iterator(a, b);
+
96}
+
97
+
98template <typename T>
+
99thrust::counting_iterator<T> countAt(T i) {
+
100 return thrust::make_counting_iterator(i);
+
101}
+
102
+
103inline int Next3(int i) {
+
104 constexpr glm::ivec3 next3(1, 2, 0);
+
105 return next3[i];
+
106}
+
107
+
108inline int Prev3(int i) {
+
109 constexpr glm::ivec3 prev3(2, 0, 1);
+
110 return prev3[i];
+
111}
+
112
+
113template <typename T>
+
114T AtomicAdd(T& target, T add) {
+
115#ifdef __CUDA_ARCH__
+
116 // required for synchronization
+
117 __threadfence();
+
118 return atomicAdd(&target, add);
+
119#else
+
120 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
121 T old_val = tar.load();
+
122 while (!tar.compare_exchange_weak(old_val, old_val + add,
+
123 std::memory_order_seq_cst))
+
124 ;
+
125 return old_val;
+
126#endif
+
127}
+
128
+
129template <>
+
130inline int AtomicAdd(int& target, int add) {
+
131#ifdef __CUDA_ARCH__
+
132 // required for synchronization
+
133 __threadfence();
+
134 return atomicAdd(&target, add);
+
135#else
+
136 std::atomic<int>& tar = reinterpret_cast<std::atomic<int>&>(target);
+
137 int old_val = tar.fetch_add(add, std::memory_order_seq_cst);
+
138 return old_val;
+
139#endif
+
140}
+
141
+
142// Copied from
+
143// https://github.com/thrust/thrust/blob/master/examples/strided_range.cu
+
144template <typename Iterator>
+ +
146 public:
+
147 typedef typename thrust::iterator_difference<Iterator>::type difference_type;
+
148
+ +
150 : public thrust::unary_function<difference_type, difference_type> {
+
151 difference_type stride;
+
152
+
153 stride_functor(difference_type stride) : stride(stride) {}
+
154
+
155 difference_type operator()(const difference_type& i) const {
+
156 return stride * i;
+
157 }
+
158 };
+
159
+
160 typedef typename thrust::counting_iterator<difference_type> CountingIterator;
+
161 typedef typename thrust::transform_iterator<stride_functor, CountingIterator>
+
162 TransformIterator;
+
163 typedef typename thrust::permutation_iterator<Iterator, TransformIterator>
+
164 PermutationIterator;
+
165
+
166 // type of the strided_range iterator
+
167 typedef PermutationIterator iterator;
+
168
+
169 // construct strided_range for the range [first,last)
+
170 strided_range(Iterator first, Iterator last, difference_type stride)
+
171 : first(first), last(last), stride(stride) {}
+
172 strided_range() {}
+
173
+
174 iterator begin(void) const {
+
175 return PermutationIterator(
+
176 first, TransformIterator(CountingIterator(0), stride_functor(stride)));
+
177 }
+
178
+
179 iterator end(void) const {
+
180 return begin() + ((last - first) + (stride - 1)) / stride;
+
181 }
+
182
+
183 protected:
+
184 Iterator first;
+
185 Iterator last;
+
186 difference_type stride;
+
187};
+
188
+
189template <typename T>
+ +
191 public:
+
192 ConcurrentSharedPtr(T value) : impl(std::make_shared<T>(value)) {}
+ +
194 : impl(other.impl), mutex(other.mutex) {}
+ +
196 public:
+
197 SharedPtrGuard(std::recursive_mutex* mutex, T* content)
+
198 : mutex(mutex), content(content) {
+
199 mutex->lock();
+
200 }
+
201 ~SharedPtrGuard() { mutex->unlock(); }
+
202
+
203 T& operator*() { return *content; }
+
204 T* operator->() { return content; }
+
205
+
206 private:
+
207 std::recursive_mutex* mutex;
+
208 T* content;
+
209 };
+
210 SharedPtrGuard GetGuard() { return SharedPtrGuard(mutex.get(), impl.get()); };
+
211 unsigned int UseCount() { return impl.use_count(); };
+
212
+
213 private:
+
214 std::shared_ptr<T> impl;
+
215 std::shared_ptr<std::recursive_mutex> mutex =
+
216 std::make_shared<std::recursive_mutex>();
+
217};
+
218
+
219template <typename I = int, typename R = unsigned char>
+
220struct UnionFind {
+
221 Vec<I> parents;
+
222 // we do union by rank
+
223 // note that we shift rank by 1, rank 0 means it is not connected to anything
+
224 // else
+
225 Vec<R> ranks;
+
226
+
227 UnionFind(I numNodes) : parents(numNodes), ranks(numNodes, 0) {
+
228 sequence(autoPolicy(numNodes), parents.begin(), parents.end());
+
229 }
+
230
+
231 I find(I x) {
+
232 while (parents[x] != x) {
+
233 parents[x] = parents[parents[x]];
+
234 x = parents[x];
+
235 }
+
236 return x;
+
237 }
+
238
+
239 void unionXY(I x, I y) {
+
240 if (x == y) return;
+
241 if (ranks[x] == 0) ranks[x] = 1;
+
242 if (ranks[y] == 0) ranks[y] = 1;
+
243 x = find(x);
+
244 y = find(y);
+
245 if (x == y) return;
+
246 if (ranks[x] < ranks[y]) std::swap(x, y);
+
247 if (ranks[x] == ranks[y]) ranks[x]++;
+
248 parents[y] = x;
+
249 }
+
250
+
251 I connectedComponents(std::vector<I>& components) {
+
252 components.resize(parents.size());
+
253 I lonelyNodes = 0;
+
254 std::unordered_map<I, I> toLabel;
+
255 for (size_t i = 0; i < parents.size(); ++i) {
+
256 // we optimize for connected component of size 1
+
257 // no need to put them into the hashmap
+
258 if (ranks[i] == 0) {
+
259 components[i] = static_cast<I>(toLabel.size()) + lonelyNodes++;
+
260 continue;
+
261 }
+
262 parents[i] = find(i);
+
263 auto iter = toLabel.find(parents[i]);
+
264 if (iter == toLabel.end()) {
+
265 I s = static_cast<I>(toLabel.size()) + lonelyNodes;
+
266 toLabel.insert(std::make_pair(parents[i], s));
+
267 components[i] = s;
+
268 } else {
+
269 components[i] = iter->second;
+
270 }
+
271 }
+
272 return toLabel.size() + lonelyNodes;
+
273 }
+
274};
+
276} // namespace manifold
+ +
Definition: utils.h:190
+
Definition: vec.h:139
+
Definition: utils.h:145
+
Definition: meshIO.h:20
+
Definition: utils.h:45
+
Definition: utils.h:220
+ +
+
+ + + + diff --git a/docs/html/vec_8h_source.html b/docs/html/vec_8h_source.html new file mode 100644 index 000000000..80b4ac679 --- /dev/null +++ b/docs/html/vec_8h_source.html @@ -0,0 +1,437 @@ + + + + + + + +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#include <exception>
+
17#if TRACY_ENABLE && TRACY_MEMORY_USAGE
+
18#include "tracy/Tracy.hpp"
+
19#else
+
20#define TracyAllocS(ptr, size, n) (void)0
+
21#define TracyFreeS(ptr, n) (void)0
+
22#endif
+
23
+
24// #include "optional_assert.h"
+
25#include "par.h"
+
26#include "public.h"
+
27
+
28namespace manifold {
+
29
+
33template <typename T>
+
34class Vec;
+
35
+
41template <typename T>
+
42class VecView {
+
43 public:
+
44 using Iter = T *;
+
45 using IterC = const T *;
+
46
+
47 VecView(T *ptr_, int size_) : ptr_(ptr_), size_(size_) {}
+
48
+
49 VecView(const VecView &other) {
+
50 ptr_ = other.ptr_;
+
51 size_ = other.size_;
+
52 }
+
53
+
54 VecView &operator=(const VecView &other) {
+
55 ptr_ = other.ptr_;
+
56 size_ = other.size_;
+
57 return *this;
+
58 }
+
59
+
60 // allows conversion to a const VecView
+
61 operator VecView<const T>() const { return {ptr_, size_}; }
+
62
+
63 inline const T &operator[](int i) const {
+
64 if (i < 0 || i >= size_) throw std::out_of_range("Vec out of range");
+
65 return ptr_[i];
+
66 }
+
67
+
68 inline T &operator[](int i) {
+
69 if (i < 0 || i >= size_) throw std::out_of_range("Vec out of range");
+
70 return ptr_[i];
+
71 }
+
72
+
73 IterC cbegin() const { return ptr_; }
+
74 IterC cend() const { return ptr_ + size_; }
+
75
+
76 IterC begin() const { return cbegin(); }
+
77 IterC end() const { return cend(); }
+
78
+
79 Iter begin() { return ptr_; }
+
80 Iter end() { return ptr_ + size_; }
+
81
+
82 const T &front() const {
+
83 if (size_ == 0)
+
84 throw std::out_of_range("attempt to take the front of an empty vector");
+
85 return ptr_[0];
+
86 }
+
87
+
88 const T &back() const {
+
89 if (size_ == 0)
+
90 throw std::out_of_range("attempt to take the back of an empty vector");
+
91 return ptr_[size_ - 1];
+
92 }
+
93
+
94 T &front() {
+
95 if (size_ == 0)
+
96 throw std::out_of_range("attempt to take the front of an empty vector");
+
97 return ptr_[0];
+
98 }
+
99
+
100 T &back() {
+
101 if (size_ == 0)
+
102 throw std::out_of_range("attempt to take the back of an empty vector");
+
103 return ptr_[size_ - 1];
+
104 }
+
105
+
106 int size() const { return size_; }
+
107
+
108 bool empty() const { return size_ == 0; }
+
109
+
110#ifdef MANIFOLD_DEBUG
+
111 void Dump() {
+
112 std::cout << "Vec = " << std::endl;
+
113 for (int i = 0; i < size(); ++i) {
+
114 std::cout << i << ", " << ptr_[i] << ", " << std::endl;
+
115 }
+
116 std::cout << std::endl;
+
117 }
+
118#endif
+
119
+
120 protected:
+
121 T *ptr_ = nullptr;
+
122 int size_ = 0;
+
123
+
124 VecView() = default;
+
125 friend class Vec<T>;
+
126 friend class Vec<typename std::remove_const<T>::type>;
+
127 friend class VecView<typename std::remove_const<T>::type>;
+
128};
+
129
+
130/*
+
131 * Specialized vector implementation with multithreaded fill and uninitialized
+
132 * memory optimizations.
+
133 * Note that the constructor and resize function will not perform initialization
+
134 * if the parameter val is not set. Also, this implementation is a toy
+
135 * implementation that did not consider things like non-trivial
+
136 * constructor/destructor, please keep T trivial.
+
137 */
+
138template <typename T>
+
139class Vec : public VecView<T> {
+
140 public:
+
141 Vec() {}
+
142
+
143 // Note that the vector constructed with this constructor will contain
+
144 // uninitialized memory. Please specify `val` if you need to make sure that
+
145 // the data is initialized.
+
146 Vec(int size) {
+
147 reserve(size);
+
148 this->size_ = size;
+
149 }
+
150
+
151 Vec(int size, T val) { resize(size, val); }
+
152
+
153 Vec(const Vec<T> &vec) {
+
154 this->size_ = vec.size();
+
155 this->capacity_ = this->size_;
+
156 auto policy = autoPolicy(this->size_);
+
157 if (this->size_ != 0) {
+
158 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
159 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
160 TracyAllocS(ptr_, size_ * sizeof(T), 3);
+
161 uninitialized_copy(policy, vec.begin(), vec.end(), this->ptr_);
+
162 }
+
163 }
+
164
+
165 Vec(const std::vector<T> &vec) {
+
166 this->size_ = vec.size();
+
167 this->capacity_ = this->size_;
+
168 auto policy = autoPolicy(this->size_);
+
169 if (this->size_ != 0) {
+
170 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
171 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
172 TracyAllocS(ptr_, size_ * sizeof(T), 3);
+
173 uninitialized_copy(policy, vec.begin(), vec.end(), this->ptr_);
+
174 }
+
175 }
+
176
+
177 Vec(Vec<T> &&vec) {
+
178 this->ptr_ = vec.ptr_;
+
179 this->size_ = vec.size_;
+
180 capacity_ = vec.capacity_;
+
181 vec.ptr_ = nullptr;
+
182 vec.size_ = 0;
+
183 vec.capacity_ = 0;
+
184 }
+
185
+
186 operator VecView<T>() { return {this->ptr_, this->size_}; }
+
187 operator VecView<const T>() const { return {this->ptr_, this->size_}; }
+
188
+
189 ~Vec() {
+
190 if (this->ptr_ != nullptr) {
+
191 TracyFreeS(ptr_, 3);
+
192 free(this->ptr_);
+
193 }
+
194 this->ptr_ = nullptr;
+
195 this->size_ = 0;
+
196 capacity_ = 0;
+
197 }
+
198
+
199 Vec<T> &operator=(const Vec<T> &other) {
+
200 if (&other == this) return *this;
+
201 if (this->ptr_ != nullptr) {
+
202 TracyFreeS(this->ptr_, 3);
+
203 free(this->ptr_);
+
204 }
+
205 this->size_ = other.size_;
+
206 capacity_ = other.size_;
+
207 auto policy = autoPolicy(this->size_);
+
208 if (this->size_ != 0) {
+
209 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
210 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
211 TracyAllocS(ptr_, size_ * sizeof(T), 3);
+
212 uninitialized_copy(policy, other.begin(), other.end(), this->ptr_);
+
213 }
+
214 return *this;
+
215 }
+
216
+
217 Vec<T> &operator=(Vec<T> &&other) {
+
218 if (&other == this) return *this;
+
219 if (this->ptr_ != nullptr) {
+
220 TracyFreeS(ptr_, 3);
+
221 free(this->ptr_);
+
222 }
+
223 this->size_ = other.size_;
+
224 capacity_ = other.capacity_;
+
225 this->ptr_ = other.ptr_;
+
226 other.ptr_ = nullptr;
+
227 other.size_ = 0;
+
228 other.capacity_ = 0;
+
229 return *this;
+
230 }
+
231
+
232 operator VecView<T>() const { return {this->ptr_, this->size_}; }
+
233
+
234 void swap(Vec<T> &other) {
+
235 std::swap(this->ptr_, other.ptr_);
+
236 std::swap(this->size_, other.size_);
+
237 std::swap(capacity_, other.capacity_);
+
238 }
+
239
+
240 inline void push_back(const T &val) {
+
241 if (this->size_ >= capacity_) {
+
242 // avoid dangling pointer in case val is a reference of our array
+
243 T val_copy = val;
+
244 reserve(capacity_ == 0 ? 128 : capacity_ * 2);
+
245 this->ptr_[this->size_++] = val_copy;
+
246 return;
+
247 }
+
248 this->ptr_[this->size_++] = val;
+
249 }
+
250
+
251 void reserve(int n) {
+
252 if (n > capacity_) {
+
253 T *newBuffer = reinterpret_cast<T *>(malloc(n * sizeof(T)));
+
254 if (newBuffer == nullptr) throw std::bad_alloc();
+
255 TracyAllocS(newBuffer, n * sizeof(T), 3);
+
256 if (this->size_ > 0)
+
257 uninitialized_copy(autoPolicy(this->size_), this->ptr_,
+
258 this->ptr_ + this->size_, newBuffer);
+
259 if (this->ptr_ != nullptr) {
+
260 TracyFreeS(ptr_, 3);
+
261 free(this->ptr_);
+
262 }
+
263 this->ptr_ = newBuffer;
+
264 capacity_ = n;
+
265 }
+
266 }
+
267
+
268 void resize(int newSize, T val = T()) {
+
269 bool shrink = this->size_ > 2 * newSize;
+
270 reserve(newSize);
+
271 if (this->size_ < newSize) {
+
272 uninitialized_fill(autoPolicy(newSize - this->size_),
+
273 this->ptr_ + this->size_, this->ptr_ + newSize, val);
+
274 }
+
275 this->size_ = newSize;
+
276 if (shrink) shrink_to_fit();
+
277 }
+
278
+
279 void shrink_to_fit() {
+
280 T *newBuffer = nullptr;
+
281 if (this->size_ > 0) {
+
282 newBuffer = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
283 if (newBuffer == nullptr) throw std::bad_alloc();
+
284 TracyAllocS(newBuffer, size_ * sizeof(T), 3);
+
285 uninitialized_copy(autoPolicy(this->size_), this->ptr_,
+
286 this->ptr_ + this->size_, newBuffer);
+
287 }
+
288 if (this->ptr_ != nullptr) {
+
289 TracyFreeS(ptr_, 3);
+
290 free(this->ptr_);
+
291 }
+
292 this->ptr_ = newBuffer;
+
293 capacity_ = this->size_;
+
294 }
+
295
+
296 VecView<T> view(int offset = 0, int length = -1) {
+
297 if (length == -1) {
+
298 length = this->size_ - offset;
+
299 if (length < 0) throw std::out_of_range("Vec::view out of range");
+
300 } else if (offset + length > this->size_ || offset < 0) {
+
301 throw std::out_of_range("Vec::view out of range");
+
302 } else if (length < 0) {
+
303 throw std::out_of_range("Vec::view negative length is not allowed");
+
304 }
+
305 return VecView<T>(this->ptr_ + offset, length);
+
306 }
+
307
+
308 VecView<const T> cview(int offset = 0, int length = -1) const {
+
309 if (length == -1) {
+
310 length = this->size_ - offset;
+
311 if (length < 0) throw std::out_of_range("Vec::cview out of range");
+
312 } else if (offset + length > this->size_ || offset < 0) {
+
313 throw std::out_of_range("Vec::cview out of range");
+
314 } else if (length < 0) {
+
315 throw std::out_of_range("Vec::cview negative length is not allowed");
+
316 }
+
317 return VecView<const T>(this->ptr_ + offset, length);
+
318 }
+
319
+
320 VecView<const T> view(int offset = 0, int length = -1) const {
+
321 return cview(offset, length);
+
322 }
+
323
+
324 T *data() { return this->ptr_; }
+
325 const T *data() const { return this->ptr_; }
+
326
+
327 private:
+
328 int capacity_ = 0;
+
329};
+
331} // namespace manifold
+
Definition: vec.h:139
+
Definition: vec.h:42
+
Definition: meshIO.h:20
+
+
+ + + + diff --git a/editor.d.ts b/editor.d.ts new file mode 100644 index 000000000..2f0e6fd31 --- /dev/null +++ b/editor.d.ts @@ -0,0 +1,3257 @@ +// 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; +} + +/** + * Set material properties on the input manifold. They will be carried along + * through operations. + * + * @param manifold The object to add properties to - returned for chaining. + * @param material A set of material properties to apply to this manifold. + */ +declare function setMaterial( + manifold: Manifold, material: GLTFMaterial): Manifold; + +/** + * 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..b06f8261f --- /dev/null +++ b/examples.js @@ -0,0 +1,531 @@ +// 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. + +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 only outputs one of the halves. This demonstrates how + // redundant points along a polygon can be used to make twisted extrusions + // smoother. 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().scale(scale); + + const box = []; + box.push([1, -1], [1, 1]); + for (let i = 0; i <= nDivisions; ++i) { + box.push([gap / (4 * scale), 1 - i * 2 / nDivisions]); + } + + const cyan = [0, 1, 1]; + const magenta = [1, 0, 1]; + const fade = (color, pos) => { + for (let i = 0; i < 3; ++i) { + color[i] = cyan[i] * pos[2] + magenta[i] * (1 - pos[2]); + } + }; + + // 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, 1, nDivisions, 270).setProperties(3, fade), + {baseColorFactor: [1, 1, 1], attributes: ['COLOR_0']}); + + const result = tet.intersect( + screw.rotate([0, 0, -45]).translate([0, 0, -0.5]).scale(2 * 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. Our default material: + // { + // roughness = 0.2, + // metallic = 1, + // baseColorFactor = [1, 1, 0], + // alpha = 1, + // unlit = false, + // name = '' + // } + const node = new GLTFNode(); + node.manifold = result; + 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} = 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); + 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 + + 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 result = heart.scale(100 / (box.max[0] - box.min[0])); + 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. + + // @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 getCircularSegments(threadRadius). + // @param linearSegments Number of segments along the length of the knot. + // Default makes roughly square facets. + + function torusKnot( + p, q, majorRadius, minorRadius, threadRadius, circularSegments = 0, + linearSegments = 0) { + const {vec3} = glMatrix; + + function gcd(a, b) { + return b == 0 ? a : gcd(b, a % b); + } + + const kLoops = gcd(p, q); + p /= kLoops; + q /= kLoops; + const n = circularSegments > 2 ? circularSegments : + getCircularSegments(threadRadius); + const m = linearSegments > 2 ? linearSegments : + n * q * majorRadius / threadRadius; + + const offset = 2 + const circle = CrossSection.circle(1, n).translate([offset, 0]); + + const func = (v) => { + const psi = q * Math.atan2(v[0], v[1]); + const theta = psi * p / q; + 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(p * minorRadius, q * r)); + v[0] += minorRadius; + vec3.rotateY(v, v, center, theta); + v[0] += majorRadius; + vec3.rotateZ(v, v, center, psi); + }; + + let knot = Manifold.revolve(circle, m).warp(func); + + if (kLoops > 1) { + const knots = []; + for (let k = 0; k < kLoops; ++k) { + knots.push(knot.rotate([0, 0, 360 * (k / kLoops) * (q / p)])); + } + knot = Manifold.compose(knots); + } + + return knot; + } + + // This recreates Matlab Knot by Emmett Lalish: + // https://www.thingiverse.com/thing:7080 + + const result = torusKnot(1, 3, 25, 10, 3.75); + 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/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/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/index.html b/index.html new file mode 100644 index 000000000..a3aae3073 --- /dev/null +++ b/index.html @@ -0,0 +1,92 @@ + + + + + ManifoldCAD + + + + + + + + + + + + + + + + + + + + + + +
+
+

ManifoldCAD

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

Loading...

+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/make-manifold.html b/make-manifold.html new file mode 100644 index 000000000..94ba11616 --- /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_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..747204777 --- /dev/null +++ b/manifold-encapsulated-types.d.ts @@ -0,0 +1,875 @@ +// 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[]; + +/** + * @name Defaults + * 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. + */ +///@{ +export function setMinCircularAngle(angle: number): void; +export function setMinCircularEdgeLength(length: number): void; +export function setCircularSegments(segments: number): void; +export function getCircularSegments(radius: number): number; +///@} + +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(polygons: Polygons, fillRule?: FillRule); + + // Shapes + + static square(size?: Vec2|number, center?: boolean): CrossSection; + + 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(v: 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(v: 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(polygons: 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; +} + +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. + */ + static levelSet( + sdf: (point: Vec3) => number, bounds: Box, edgeLength: number, + level?: 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(v: 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; + + /** + * 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; + + /** + * 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; + + // 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; + + // 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; + + // 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; +} + +export class Mesh { + constructor(options: MeshOptions); + numProp: number; + vertProperties: Float32Array; + triVerts: Uint32Array; + mergeFromVert: Uint32Array; + mergeToVert: Uint32Array; + runIndex: Uint32Array; + runOriginalID: Uint32Array; + runTransform: Float32Array; + faceID: Uint32Array; + halfedgeTangent: Float32Array; + get numTri(): number; + get numVert(): number; + get numRun(): number; + merge(): boolean; + verts(tri: number): SealedUint32Array<3>; + position(vert: number): SealedFloat32Array<3>; + extras(vert: number): Float32Array; + tangent(halfedge: number): SealedFloat32Array<4>; + 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..be8a82d34 --- /dev/null +++ b/manifold.d.ts @@ -0,0 +1,35 @@ +// 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; + setup: () => void; +} + +export default function Module(config?: {locateFile: () => string}): + Promise; diff --git a/model-viewer.html b/model-viewer.html new file mode 100644 index 000000000..b82355ee6 --- /dev/null +++ b/model-viewer.html @@ -0,0 +1,58 @@ + + + + + Manifold - <code></code><model-viewer></code> Example + + + + + + + + + + + +

This example demonstrates feeding Manifold's output into <model-viewer> via gltf-transform. It also shows how to pass mesh + properties like UV coordinates through Manifold and how to re-associate textures after operations. 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..6644fa3ce 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..e9442678c 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..bc412f6f1 --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,30 @@ +# 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/bracelet.cpp src/knot.cpp src/menger_sponge.cpp + src/rounded_frame.cpp src/scallop.cpp src/tet_puzzle.cpp + src/gyroid_module.cpp src/condensed_matter.cpp) + +target_include_directories(samples + PUBLIC ${PROJECT_SOURCE_DIR}/include +) + +target_link_libraries(samples + PUBLIC manifold sdf +) + +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..3b3620943 --- /dev/null +++ b/samples/include/samples.h @@ -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. + +#pragma once +#include "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, float majorRadius, float minorRadius, + float threadRadius, int circularSegments = 0, + int linearSegments = 0); + +Manifold StretchyBracelet(float radius = 30.0f, float height = 8.0f, + float width = 15.0f, float thickness = 0.4f, + int nDecor = 20, int nCut = 27, int nDivision = 30); + +Manifold MengerSponge(int n = 3); + +Manifold RoundedFrame(float edgeLength, float radius, int circularSegments = 0); + +Manifold TetPuzzle(float edgeLength, float gap, int nDivisions); + +Manifold Scallop(); + +Manifold GyroidModule(float 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..fe2b7f6f0 --- /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 "cross_section.h" +#include "samples.h" + +namespace { + +using namespace manifold; + +Manifold Base(float width, float radius, float decorRadius, float twistRadius, + int nDecor, float innerRadius, float outerRadius, float 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, width, nDivision, 180) + .Scale({1.0f, 0.5f, 1.0f}) + .Translate({0.0f, radius, 0.0f}); + + for (int i = 0; i < nDecor; ++i) { + base += decor.Rotate(0, 0, (360.0f / nDecor) * i); + } + + Polygons stretch(1); + float dPhiRad = 2 * glm::pi() / nCut; + glm::vec2 p0(outerRadius, 0.0f); + glm::vec2 p1(innerRadius, -cut); + glm::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(float radius, float height, float width, + float thickness, int nDecor, int nCut, + int nDivision) { + float twistRadius = glm::pi() * radius / nDecor; + float decorRadius = twistRadius * 1.5; + float outerRadius = radius + (decorRadius + twistRadius) * 0.5; + float innerRadius = outerRadius - height; + float cut = 0.5 * (glm::pi() * 2 * innerRadius / nCut - thickness); + float 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..0d083816e --- /dev/null +++ b/samples/src/condensed_matter.cpp @@ -0,0 +1,149 @@ +// 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; + +constexpr float AtomicRadiusN2 = 0.65; +constexpr float BondPairN2 = 1.197; +constexpr float AtomicRadiusSi = 1.1; +constexpr float LatticeCellSizeSi = 5.4309; +constexpr float fccOffset = 0.25; +constexpr float AtomicRadiusC = 0.7; +constexpr float LatticeCellSizeC = 3.65; +constexpr float cellLenA = 2.464; +constexpr float cellLenB = cellLenA; +constexpr float cellLenC = 6.711; +constexpr float cellAngleA = 90; +constexpr float cellAngleB = cellAngleA; +constexpr float cellAngleC = 120; +constexpr float LayerSeperationC = 3.364; + +Manifold bond(int fn, vec3 p1 = {0, 0, 0}, vec3 p2 = {1, 1, 1}, float ar1 = 1.0, + float ar2 = 2.0) { + float cyR = std::min(ar1, ar2) / 5.0; + float dist = length(p1 - p2); + vec3 cyC = (p1 + p2) / 2.0f; + float beta = degrees(acos((p1.z - p2.z) / dist)); + float 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, float d = 0.0, float ar = 1.0) { + float 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}, + float ar = 1.0) { + std::vector parts; + vec3 p1 = {0, 0, 0}; + parts.push_back(Manifold::Sphere(ar, fn)); + float 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, float ar = 1.0, float unitCell = 2.0, + float fccOffset = 0.25) { + std::vector parts; + float huc = unitCell / 2.0; + float 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, float x = 1.0, float y = 1.0, float z = 1.0) { + return fccDiamond(fn, AtomicRadiusSi, LatticeCellSizeSi, fccOffset) + .Translate({LatticeCellSizeSi * x, LatticeCellSizeSi * y, + LatticeCellSizeSi * z}); +} + +Manifold SiN2Cell(int fn, float x = 1.0, float y = 1.0, float z = 1.0) { + float 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; + float 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)); + + float xyPlane[] = {-2, -1, 0, +1, +2}; + for (float x : xyPlane) + for (float 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..0f6bee74c --- /dev/null +++ b/samples/src/gyroid_module.cpp @@ -0,0 +1,59 @@ +// 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.h" +#include "samples.h" +#include "sdf.h" + +namespace { +using namespace manifold; + +struct Gyroid { + float operator()(glm::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(float size) { + Manifold box = + Manifold::Cube(size * glm::sqrt(2.0f) * glm::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(float size, int n) { + auto gyroid = [&](float level) { + const float period = glm::two_pi(); + return Manifold(LevelSet(Gyroid(), {glm::vec3(-period), glm::vec3(period)}, + period / n, level)) + .Scale(glm::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.0f)}); +} +} // namespace manifold diff --git a/samples/src/knot.cpp b/samples/src/knot.cpp new file mode 100644 index 000000000..b9eac98fa --- /dev/null +++ b/samples/src/knot.cpp @@ -0,0 +1,83 @@ +// 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 "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, float majorRadius, float minorRadius, + float 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, m); + + knot = + knot.Warp([p, q, majorRadius, minorRadius, threadRadius](glm::vec3& v) { + float psi = q * atan2(v.x, v.y); + float theta = psi * p / q; + glm::vec2 xy = glm::vec2(v); + float x1 = sqrt(glm::dot(xy, xy)); + float phi = atan2(x1 - 2, v.z); + v = glm::vec3(cos(phi), 0.0f, sin(phi)); + v *= threadRadius; + float r = majorRadius + minorRadius * cos(theta); + v = glm::rotateX(v, -float(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 (float k = 0; k < kLoops; ++k) { + knots.push_back( + knot.Rotate(0, 0, 360.0f * (k / kLoops) * (q / float(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..39ef721d4 --- /dev/null +++ b/samples/src/menger_sponge.cpp @@ -0,0 +1,65 @@ +// 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, float w, + glm::vec2 position, int depth, int maxDepth) { + w /= 3; + holes.push_back( + hole.Scale({w, w, 1.0f}).Translate(glm::vec3(position, 0.0f))); + if (depth == maxDepth) return; + + glm::vec2 offsets[8] = {{-w, -w}, {-w, 0.0f}, {-w, w}, {0.0f, w}, + {w, w}, {w, 0.0f}, {w, -w}, {0.0f, -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(glm::vec3(1.0f), true); + + std::vector holes; + Fractal(holes, result, 1.0, {0.0f, 0.0f}, 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..9f05b2191 --- /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(float edgeLength, float 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..d72d5f495 --- /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 float height = 1; + constexpr float radius = 3; + constexpr float offset = 2; + constexpr int wiggles = 12; + constexpr float sharpness = 0.8; + + Mesh scallop; + std::vector sharpenedEdges; + scallop.vertPos = {{-offset, 0, height}, {-offset, 0, -height}}; + + const float delta = glm::pi() / wiggles; + for (int i = 0; i < 2 * wiggles; ++i) { + float theta = (i - wiggles) * delta; + float amp = 0.5 * height * glm::max(glm::cos(0.8f * theta), 0.0f); + + 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; + + float smoothness = 1 - sharpness * glm::cos((theta + delta / 2) / 2); + int 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 \ No newline at end of file diff --git a/samples/src/tet_puzzle.cpp b/samples/src/tet_puzzle.cpp new file mode 100644 index 000000000..89a8cb8df --- /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(float edgeLength, float gap, int nDivisions) { + const glm::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.0f / nDivisions}); + } + + Manifold screw = Manifold::Extrude(box, 2, nDivisions, 270) + .Rotate(0, 0, -45) + .Translate({0, 0, -1}) + .Scale(scale); + + return tet ^ screw; +} +} // namespace manifold \ No newline at end of file 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..b65bae7bf --- /dev/null +++ b/three.html @@ -0,0 +1,52 @@ + + + + + Manifold - three.js Example + + + + + + + + + + +

This demonstrates the minimum code to connect Manifold to a three.js rendering. A slightly more complex example + involving GLTF export and <model-viewer> can be found here.

+
+ + + + + \ No newline at end of file